Skip to content

Zer0-Bug/SudokuApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SudokuApp

Python Pytest License

A high-performance Sudoku engine featuring an interactive game and an automated solver.

Leveraging recursive backtracking for efficient puzzle solving and a robust terminal-based interface for gameplay.


° ° ° °



Technical Architecture

The application is architected to balance algorithmic efficiency with user interactivity. At its core, it implements a Constraint Satisfaction approach to Sudoku solving:

  1. Backtracking Solver: A recursive algorithm that explores the search space by placing digits and pruning branches as soon as a constraint (Row, Column, or 3x3 Box) is violated.
  2. Board Generation: Utilizes a randomized filling strategy followed by a cell-removal process to generate unique puzzles with varying difficulty.
  3. State Management: The board is maintained as a 2D matrix (list of lists) with real-time validation checks during both manual play and automated solving.
  4. Terminal Interface: Uses Python's standard I/O for a lightweight, dependency-free command-line experience.


Project Structure

SudokuApp/
├── project.py                                # Main orchestrator and core logic
├── test_project.py                          # Automated test suite using pytest
├── requirements.txt                          # Python dependencies manifest
├── LICENSE                                   # MIT License terms
├── README.md                                 # Project documentation
│
└── .git/                                     # Version control repository


Key Features

1. Interactive Game Mode

Experience Sudoku directly in your terminal. The game mode provides:

  • Puzzle Generation: Dynamic creation of 9x9 Sudoku boards.
  • Real-Time Validation: Immediate feedback on invalid placements.
  • Completion Check: Automated verification of the final solution.

2. Automated Backtracking Solver

Solve any valid 9x9 Sudoku puzzle instantly.

  • Heuristic Exploration: Efficiently finds solutions using recursive depth-first search.
  • Consistency Checking: Ensures the input board is valid before attempting a solution.


Technical Specifications

Aspect Details
Language Python 3.8+
Solving Algorithm Recursive Backtracking (DFS)
Testing Framework Pytest
Board Generation Randomized Filling + Cell Removal


Deployment & Installation

1. Repository Acquisition

Obtain a local copy of the repository:

git clone https://github.com/Zer0-Bug/SudokuApp.git

2. Environment Setup

Install the necessary dependencies to run tests and the application:

cd SudokuApp
pip install -r requirements.txt

3. Running the Application

Launch the interactive menu to start playing or solving:

python project.py

4. Running Tests

Execute the test suite to verify algorithm integrity:

pytest test_project.py


Contribution

Contributions are welcome! If you have suggestions for performance improvements or new features, feel free to contribute:

  1. Fork the repository.
  2. Create a new branch for your change:
    git checkout -b feature/your-feature-name
  3. Commit your changes with a clear and descriptive message:
    git commit -m "Add: brief description of the change"
  4. Push your branch to your fork:
    git push origin feature/your-feature-name
  5. Open a Pull Request describing the changes made.

All contributions are reviewed before being merged. Please ensure that your changes follow the existing code style and include relevant documentation or tests where applicable.



Email × LinkedIn