Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Help to write Kakuro puzzle solver

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help to write Kakuro puzzle solver

    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.


  2. #2
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,706
    Thanks
    25
    Thanked 338 Times in 313 Posts

    Default Re: Help to write Kakuro puzzle solver

    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.
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  3. #3
    Junior Member
    Join Date
    Mar 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help to write Kakuro puzzle solver

    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
    Last edited by divadola; March 22nd, 2011 at 05:49 PM.

Similar Threads

  1. THE THREAD SOLVER
    By javapenguin in forum What's Wrong With My Code?
    Replies: 0
    Last Post: November 16th, 2010, 09:49 PM
  2. Replies: 0
    Last Post: March 28th, 2010, 02:27 PM
  3. Sudoku solver
    By Elliott50 in forum Algorithms & Recursion
    Replies: 2
    Last Post: December 22nd, 2009, 02:03 PM
  4. Sudoku Solver
    By MysticDeath in forum Java Theory & Questions
    Replies: 5
    Last Post: September 19th, 2009, 10:33 PM
  5. [SOLVED] Problem in implementation of Fifteen Puzzle with 2D Arrays
    By bruint in forum Collections and Generics
    Replies: 8
    Last Post: May 3rd, 2009, 11:37 PM