Looking at the incorrectly completed Kakuro diagram below the blue numbers are the answer cells which would be all blank at the start of the puzzle. The green cells are the target sums annotated as "down \ across". The red cells are targets that are not correctly answered. For example on the top row 4\ represents the vertical target sum for the two cells below. As 1+2 = 3 this is not the answer of 4 that we are after. Also the horizontal part of the target sum 15\14 adds up to 13. The other constraint is that any of the digits 0 to 9 can appear only once in a sum. To make total 4 the digits 1 and 3 must be used.
![]() |
| Incorrectly completed Kakuro |
A larger example
#Kakurok k_20061006.txt Paul_A_Grosse
x,x,10\,4\,x,x,x,x,x,16\,9\,x,x,x,x,3\,12\,x,x,x,x,x,4\,20\,x
x,17\4,0,0,3\,x,x,x,22\17,0,0,x,x,x,\10,0,0,23\,x,x,x,9\6,0,0,3\
\14,0,0,0,0,21\,x,17\13,0,0,0,x,x,x,\6,0,0,0,10\,x,30\10,0,0,0,0
\13,0,0,17\3,0,0,14\9,0,0,x,x,x,x,x,x,x,\4,0,0,17\17,0,0,16\4,0,0
x,\9,0,0,29\30,0,0,0,0,17\,x,x,x,x,x,x,17\30,0,0,0,0,29\17,0,0,x
x,x,\29,0,0,0,0,6\12,0,0,17\,24\,x,x,23\,9\16,0,0,17\30,0,0,0,0,x,x
x,x,x,16\16,0,0,15\28,0,0,0,0,0,x,\34,0,0,0,0,0,34\13,0,0,17\,x,x
x,x,7\17,0,0,4\10,0,0,0,\17,0,0,6\,16\8,0,0,\13,0,0,0,6\16,0,0,6\,x
x,11\22,0,0,0,0,0,0,x,x,\29,0,0,0,0,x,x,\38,0,0,0,0,0,0,11\
\4,0,0,x,\3,0,0,11\,x,x,x,\10,0,0,x,x,x,x,11\10,0,0,x,\4,0,0
\10,0,0,23\,4\,\7,0,0,x,x,x,x,x,x,x,x,x,\6,0,0,x,17\,39\10,0,0
x,x,\4,0,0,\4,0,0,11\,x,x,x,x,x,x,x,21\,3\11,0,0,\17,0,0,x,x
x,x,16\3,0,0,16\,9\13,0,0,x,x,x,x,x,x,\7,0,0,0,3\,16\16,0,0,3\,x
x,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15,0,0,0,0,10\,x
x,3\3,0,0,13\17,0,0,0,0,x,x,x,x,x,x,x,\11,0,0,0,0,3\4,0,0,3\
\3,0,0,3\12,0,0,\6,0,0,16\,17\,x,x,x,x,3\,4\17,0,0,\3,0,0,4\4,0,0
\10,0,0,0,0,x,x,\24,0,0,0,x,x,x,\8,0,0,0,x,x,\10,0,0,0,0
x,\7,0,0,x,x,x,x,\16,0,0,x,x,x,\4,0,0,x,x,x,x,\3,0,0,x
The next one to try ....
![]() |
| The solution took 0.28 seconds on a 2012 Core i7 MacBook. 280 lines solved. |
Kakuro table
![]() |
| Kakuro count table |
Script
Usage : Kakuro_solver {options} puzzle.txt
-v x set debug level 0..10
-h Generate usage message
-f puzzleFile.txt from which .html will be generated (used when reading solver output only)
-p .html will be generated from puzzleFile.txt on STDIN (does not generate solver output)
Programs reads STDIN looking for either puzzleFile format lines or Solver output lines
If the input is in puzzleFile.txt program will generate solver input lines unless -p is given in which case .html version of the board is generated.
If the input is solver output lines the program will expect a -f puzzleFile.txt parameter. From both these input streams program will then generate display .html output.
Input puzzleFile format is rectangular with each square being any of target number down/target number across, 0=target square, #=comment line, x=block square
Note: Last line of puzzle must be padded out to full width with tailing ,x blocks if necessar
Example puzzleFile :
#k_003.txt No 322 Diabolic
x,x,45/,20/,x,x,12/,4/,45/,x
x,24/13,0,0,x,13/7,0,0,0,23/
/13,0,0,0,26/30,0,0,0,0,0
/33,0,0,0,0,0,13/,14/9,0,0
/17,0,0,4/35,0,0,0,0,0,0
.... and so on but use the other /
Example Solver output format
sat
( (V12 8)
(V13 6)
(V16 3)
(V17 1)
....
May issue a
**ERROR** Missing ... if invalid input equation is detected ie ,x12/ or
**ERROR** Single Digit target sum ... if invalid single digit target sum is found















