I am an intermediate programmer currently trying out constraint programming using the cream library. I need help to write a solver for a kakuro puzzle.
Printable View
I am an intermediate programmer currently trying out constraint programming using the cream library. I need help to write a solver for a kakuro puzzle.
Think about how you would solve a kakuro puzzle, then program the procedures, and get the program to move through the puzzle (probably by recursively calling your procedures).
One thing that I would consider for kakuro puzzles is to get the program to store possible number combinations from rows and columns and crosscheck each row and column to see if any numbers are required to be somewhere, then get the program to try to solve from there using normal logic.
It isn't a difficult task to accomplish what you are trying to do, but it takes some careful programming and logic.
I built a sudoku solver a year or two ago and I made about 5 different processes for the program to recursively go through to try to solve the puzzle. After some trial and error, I got it working. Just keep in mind that a brute force algorithm should be your absolute final resort if there is no other possible way to logistically solve the puzzle.
Thanks, i dont want to use brute force. I need to know how to declare the sum variables , for example 3/5 in this image http://www.kakuropuzzle.com/beginner/09591-18221.gif i.e the sum values. apparently i can use an array of cells but i havent done that before. please help