Roku Doku Solver

Add a reply

Posted by flagitious 1306 days ago:
It is like sudoku except 3x2.

Input would look like:

+---+---+
|1 3| |
| 5 |1 3|
+---+---+
| 1|56 |
| |2 |
+---+---+
|3 2| 4 |
|6 | |
+---+---+


note that shoud be a square, but spaces seem to be skinnier even inside "code" formatting

Output would like this:

+---+---+
|123|456|
|456|123|
+---+---+
|231|564|
|564|231|
+---+---+
|312|645|
|645|312|
+---+---+


Alternatively input could be just a string of 36 numbers with 0 for unknown and output the same way but with no 0's. However I don't like this for Roku Doku because then you cannot tell if it is a 3x2 or a 2x3. Input/ouput could also be slightly prettier by adding spaces between numbers (like rubyquiz.com sudoku quiz):

+-------+-------+
| 1 2 3 | 4 5 6 |
| 4 5 6 | 1 2 3 |
+-------+-------+
| 2 3 1 | 5 6 4 |
| 5 6 4 | 2 3 1 |
+-------+-------+
| 3 1 2 | 6 4 5 |
| 6 4 5 | 3 1 2 |
+-------+-------+


Sudoku has been "been there done that"ed and the shortest solutions would exceed 4 seconds on most test cases. This would be a little different due to rectangles opposed to squares and I doubt it would run into any time out problems.

See also: http://theory.tifr.res.in/~sgupta/sudoku/roku.html

If you like this challenge idea, please share your opinion for which input/output format you would prefer

Add a reply