Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abdullahjaswal/sudoku_rust
The Sudoku generator, developed in Rust, uses a randomized backtracking algorithm to fill the grid.
https://github.com/abdullahjaswal/sudoku_rust
console-application rust sudoku sudoku-generator
Last synced: 6 days ago
JSON representation
The Sudoku generator, developed in Rust, uses a randomized backtracking algorithm to fill the grid.
- Host: GitHub
- URL: https://github.com/abdullahjaswal/sudoku_rust
- Owner: AbdullahJaswal
- Created: 2024-01-08T23:44:33.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-01-10T03:20:21.000Z (12 months ago)
- Last Synced: 2024-11-07T10:46:45.713Z (about 2 months ago)
- Topics: console-application, rust, sudoku, sudoku-generator
- Language: Rust
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sudoku Puzzle Generator
The Sudoku generator, developed in Rust, uses a randomized backtracking algorithm to fill the grid. For each cell, it first checks which digits are already used in the same row, column, and 3x3 grid, and then selects a random digit from the unused ones. If it finds that a cell cannot be filled with any unused digit (no valid number can be placed in that cell without breaking Sudoku rules), the algorithm resets the entire grid and starts over. This process of trial and error continues until the algorithm successfully fills the entire grid with valid numbers in every cell. The algorithm goes through multiple iterations until it creates a valid grid and is efficient enough to generate a puzzle within a second.