Skip to content

sofiasawczenko/sudoku

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Sudoku Solver in Java

A simple Sudoku Solver implemented in Java using a backtracking algorithm. The program fills in missing numbers in a 9x9 Sudoku grid while ensuring the solution follows Sudoku rules.

How It Works

  1. The program initializes a 9x9 Sudoku board with some prefilled numbers.
  2. It applies a recursive backtracking algorithm to find a valid solution.
  3. If a solution exists, the solved board is printed; otherwise, a message indicates that the board is unsolvable.

Features

  • Uses backtracking to find a valid solution.
  • Prints the Sudoku board before and after solving.
  • Ensures:
    • Each row contains unique numbers (1-9).
    • Each column contains unique numbers (1-9).
    • Each 3x3 subgrid contains unique numbers (1-9).

Installation & Usage

  1. Clone this repository
    git clone https://github.com/sofiasawczenko/sudoku.git
    cd sudoku-solver
    
  2. Compile and Run
     javac SudokuSolver.java
     java SudokuSolver

About

Sudoku Solver is a Java-based program that solves a given 9x9 Sudoku puzzle using a backtracking algorithm. The program attempts to fill empty cells by ensuring each number from 1 to 9 follows Sudoku's rules.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages