Skip to content

[Dana] Add Sudoku solver program#83

Merged
kostis merged 4 commits intokostis:masterfrom
JohnnyPol:add-sudoku-solver-program
Aug 24, 2025
Merged

[Dana] Add Sudoku solver program#83
kostis merged 4 commits intokostis:masterfrom
JohnnyPol:add-sudoku-solver-program

Conversation

@JohnnyPol
Copy link
Contributor

Summary

This PR adds a new Dana program implementing a recursive backtracking Sudoku solver.
The solver demonstrates a non-trivial recursion + backtracking algorithm, which makes it a valuable addition to the repository’s test programs.

Details

  • File added: sudoku.dana under testing/programs/
  • Input file: sudoku.input (classic puzzle with 0 = empty)
  • Expected result file: sudoku.result (unique solved Sudoku grid)

Features of the Program

  • Uses recursion and backtracking to fill the board.
  • Includes helper functions:
    • isSafe → validates row, column, and 3×3 subgrid constraints.
    • findEmpty → locates the next empty cell.
    • solve → recursive solver with backtracking.
    • printBoard → prints the solved grid.
  • Prints "No solution" if the puzzle has no valid completion.

@kostis kostis changed the title Add Sudoku solver Dana program [Dana] Add Sudoku solver program Aug 24, 2025
@kostis kostis merged commit 6187dab into kostis:master Aug 24, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants