搜尋套件、儲存庫與 APP 分類

套件詳情v2.1.0

sudoku_api

sudoku_api 簡化了數獨謎題的產生、互動與管理。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
46
喜歡數
23
Pub 分數
130

安裝套件

flutter pub add sudoku_api

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

sudoku_api 是一個 Flutter/Dart 套件,專為簡化應用程式中 Sudoku 難題的建立、操作與管理而設計。它提供開發者生成有效 Sudoku 網格、驗證解答以及高效處理謎題狀態的工具。非常適合開發基於邏輯的拼圖應用遊戲開發者,支援 Android、iOS、Web、macOS、Windows 及 Linux 多個平台。此套件輕量級,並可透過 pub.dev 輕鬆整合至 Flutter 專案中。其乾淨的 API 讓謎題產生與使用者互動功能的實作變得簡單直覺。

適用情境

  • 將數獨謎題整合到行動遊戲中
  • 建構具有邏輯挑戰的教育應用程式
  • 建立基於網路的拼圖平台
  • 開發跨平台拼圖應用程式
  • 實現動態拼圖生成
  • 新增互動式數獨求解功能

主要特色

  • 輕鬆產生謎題
  • 解決方案驗證
  • 跨平台支援
  • 輕便高效
  • 簡單 API 結合
  • 拼圖的狀態管理

適合對象

  • 遊戲開發者
  • 教育類應用程式開發者
  • 解謎愛好者
  • Flutter 初學者
  • 跨平台應用程式建構工具

使用建議

  • 需要理解數獨規則
  • 限制為標準的9x9網格
  • 無內建 UI 組件
  • 依賴外部狀態管理
  • 未針對大規模拼圖資料庫進行優化
  • 基礎版本中無法自定難度等級

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Simple, dart API for Sudoku puzzles

Introduction

sudoku_api simplifies the generation, interaction, and management of Sudoku Puzzles.

Well, how does it do that?

  • Contains a Built-in solver for generating new puzzles, or solving existing ones
  • Utilizes and exposes event streams for grid interactions (e.g. cell value changed), and puzzle states
  • Exposes a bunch of neat, easy to use models manipulating Cells, Positions, Grids, and even Patterns of a Sudoku puzzle
What is Sudoku?

... a logic-based, combinatorial number-placement puzzle. The objective is to fill a 9×9 grid with digits so that each column, each row, and each of the nine 3×3 subgrids (segments) that compose the grid contain all of the digits from 1 to 9. The puzzle setter provides a partially completed grid, which for a well-posed puzzle has a single solution.

Example


import 'package:sudoku_api/Puzzle.dart';

void main() {
  
  PuzzleOptions puzzleOptions = new PuzzleOptions(patternName: "winter");
  
  Puzzle puzzle = new Puzzle(puzzleOptions);
  
    puzzle.generate().then((_) {
      print("=====================================");
      print("Your puzzle, fresh off the press:");
      print("-------------------------------------");
      printGrid(puzzle.board());
      print("=====================================");
      print("Give up? Here's your puzzle solution:");
      print("-------------------------------------");
      printGrid(puzzle.solvedBoard());
      print("=====================================");
    });
}
Output
=====================================
Your puzzle, fresh off the press:
-------------------------------------
  9           8   
3 4     7     6 9 
    8   5   1     
      4   5       
4 5 6   9   3 1 2 
      3   2       
    2   8   9     
8 3     2     7 5 
  6           2   
=====================================
Give up? Here's your puzzle solution:
-------------------------------------
2 9 1 6 3 4 5 8 7 
3 4 5 1 7 8 2 6 9 
6 7 8 2 5 9 1 3 4 
1 2 3 4 6 5 7 9 8 
4 5 6 8 9 7 3 1 2 
7 8 9 3 1 2 4 5 6 
5 1 2 7 8 6 9 4 3 
8 3 4 9 2 1 6 7 5 
9 6 7 5 4 3 8 2 1 
=====================================
Contributing

Let's make some sweet Sudoku, together.

  1. Fork sudoku_api, clone, and checkout the dev branch
  2. Write some pretty neat code, then push
  3. Create a pull request from a fork
Implementations

Sudoku Toolkit (AlvinRamoutar) - WIP

Inspiration

One of my college projects; Java Sudoku.

Libraries

所屬分類

依賴

依賴清單 3 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。