Write a Sudoku Puzzle Solver.
Each row can only contain a distinct arrangement of the numbers 1 to 9.
Each column can only contain a distinct arrangement of the numbers 1 to 9.
Each house can only contain a distinct arrangement of the number 1 to 9.
An house being the nine squares contained in each section of the grid.
Example.
Valid Sudoku (Single Solution)
53 ¦ 7 ¦ 6 ¦195¦ 98¦ ¦ 6 ---+---+--- 8 ¦ 6 ¦ 3 4 ¦8 3¦ 1 7 ¦ 2 ¦ 6 ---+---+--- 6 ¦ ¦28 ¦419¦ 5 ¦ 8 ¦ 79
Invalid Sudoku (Multiple Solutions)
5 6¦ 2 ¦9 3 8! ¦5 ! ¦ ---+---+--- 6 ¦285¦ 9 ¦9 3¦ 8 ¦761¦ 4 ---+---+--- ¦ ¦ 4¦ ¦3 2 1¦ 5 ¦6 7
I'll award Reputations Points for interesting submissions.
- The shortest code
- The quickest solver. (Tested on the 2 above grids).
- Interesting way of solving.
This post has been edited by AdamSpeight2008: 11 June 2011 - 02:03 PM

New Topic/Question
Reply



MultiQuote











|