Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 927 Bytes

README.md

File metadata and controls

31 lines (25 loc) · 927 Bytes

Sudoku Solver

Just for fun. Read in a json file with 81 numbers, will solve and print the solution.

Usage

In irb:

load 'lib/sudoku.rb'
game = Sudoku::Game.new
game.load_gamefile 'test/fixtures/game.json'
game.solve # => true
puts game

TODO

  • Add more puzzles for testing
  • Move current solution to "Deductive" strategy
  • Add brute force backtracking strategy
  • Add Dancing Links strategy
  • Handle unsolvable puzzles
  • Handle puzzles with multiple solutions (more common with hard puzzles)
  • CLI:
    • Read json: sudoku [json filename]
    • Read Rubyquiz format: sudoku
  • Image processing? (ie read the puzzle from an image)
  • Fix stack level error when inspecting objects (recursive relationships make an infinite loop)