A cross-platform Sudoku game implemented in C++, easy to operate via the command line. It can be used to relax during development breaks. With only a few hundred lines of code, beginners can easily grasp it. Contributions are welcome! Feel free to add features or fix bugs through pull requests.
- Cross-Platform / Compiler Support : Linux/Windows/macOS
- Multilingual Support: English / 中文
- No Third-Party Library Dependencies
- Runs in the Console
- CMake 3.12 or higher
- C++17
cmake -B build -S .
cmake --build buildThe 'sudoku' executable generated by the build process will be located in the 'bin' directory.
./sudoku # Start the game directly
./sudoku -l filename # Load the game progress from a file
./sudoku -h # Display help information- 0 # Delete the number entered
- u # Undo the previous move
- Enter # Attempt to solve the puzzle
- Esc # Exit the game
- w # Move cursor up ↑
- a # Move cursor left ←
- s # Move cursor down ↓
- d # Move cursor right →
- k # Move cursor up ↑
- h # Move cursor left ←
- j # Move cursor down ↓
- l # Move cursor right →
│--.gitignore
│--build.bat // One-click build script for Windows
│--build.sh // One-click build script for Linux/macOS
│--CMakeLists.txt // CMake project file
│--README.md
└--src // Source code directory
│--block.cpp // Sudoku block class, represents rows, columns, and subgrids
│--block.h
│--color.h // Color class
│--command.cpp // Command class, implements undo functionality
│--command.h
│--common.h // Common header file
│--input.cpp // Input class
│--input.h
│--main.cpp // Main entry file
│--scene.cpp // Game scene class
│--scene.h
│--test.cpp // Test file
│--test.h
└--utility.inl // Some utility global functions