Skip to content

๐Ÿ”ข A Java-based console Sudoku Solver using Backtracking with user input and file upload support.

License

Notifications You must be signed in to change notification settings

Asmit159/sudoku-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงฉ Sudoku Solver โ€” Console + File Input

A fully functional Sudoku Solver built in Java using Backtracking.
Created by Asmit Mandal(Asmit159), this project can solve any valid 9ร—9 Sudoku โ€”
either entered manually through the console or uploaded via a text file.


Technology Used

๐Ÿ’ป Javaโ€ƒ๐Ÿ”ข Sudoku Solverโ€ƒ๐Ÿงฉ Backtrackingโ€ƒ๐Ÿ”„ Recursionโ€ƒ๐Ÿ“ Console Application
๐Ÿ“‚ File I/Oโ€ƒ๐Ÿ‘ค User Inputโ€ƒโš™๏ธ Algorithmโ€ƒ๐Ÿ—‚ Data Structuresโ€ƒ๐ŸŽฏ Problem Solving
โœจ Open Sourceโ€ƒ๐Ÿ† Coding Challengeโ€ƒ๐Ÿ“š Programming Exerciseโ€ƒ๐Ÿ›  Portfolio Project
๐Ÿš€ Beginner Friendlyโ€ƒ๐Ÿ”ฅ Algorithm Practiceโ€ƒ๐Ÿ’ก Coding Projectโ€ƒ๐ŸŒŸ Java Projects


โš™๏ธ Features

  • โœ… Solves any standard 9ร—9 Sudoku using recursion and backtracking.
  • ๐Ÿ–ฅ๏ธ Accepts manual console input or text file input (.txt format).
  • ๐Ÿง  Efficient safety checks for row, column, and 3ร—3 subgrid.
  • ๐Ÿ“œ Prints the completed Sudoku grid neatly in the console.
  • ๐Ÿ”’ Author permission required before forking or redistribution.
  • ๐Ÿ”ฎReact UI for users to interact easily(Future upgrade)

๐Ÿš€ How to Use

๐Ÿงฉ Option 1: Console Input

  1. Run the program.
  2. Enter each Sudoku row (9 numbers separated by space).
  3. Use 0 for blank cells.
  4. The solved Sudoku will be displayed in the console.

๐Ÿ“ Option 2: File Input

  1. Create a text file (e.g., sudoku.txt) containing the Sudoku grid.
    Example:
  • 0 0 8 0 0 0 0 0 0
  • 4 9 0 1 5 7 0 0 2
  • 0 0 3 0 0 4 1 9 0
  • 1 8 5 0 6 0 0 2 0
  • 0 0 0 0 2 0 0 6 0
  • 9 6 0 4 0 5 3 0 0
  • 0 3 0 0 7 2 0 0 4
  • 0 4 9 0 3 0 0 5 7
  • 8 2 7 0 0 9 0 1 3
  1. Run the program and choose the file input option.
  2. Enter the file path when prompted.

Check it out

Demo at sudoku-solver/assests/images


๐Ÿง  Algorithm Used

  • Backtracking:
    Tries placing digits (1โ€“9) in each empty cell.
    Checks if the placement is safe (row, column, subgrid).
    If not valid, it backtracks and tries another number.
    The recursion continues until the entire Sudoku is solved.

๐Ÿง‘โ€๐Ÿ’ป Author

Asmit Mandal


โš ๏ธ License & Permissions

This project is an original work by Asmit Mandal.
Any forking, redistribution, or modification of this code requires explicit author permission.


โญ If you find this project useful, consider starring the repo to support the developer!

About

๐Ÿ”ข A Java-based console Sudoku Solver using Backtracking with user input and file upload support.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages