Download Kakuro Puzzle Game

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Kakuro Puzzle Game
Chang-Yin Lin
CS491B-FALL 2006
Contents
Abstract………………………………………………………………………………………..3
1. Introduction…………………………………………………………………………………3
1.1 History………………………………………………………………………………. 3
1.2 How to play and rule…………………………………………………………………4
2. Technology Background…………………………………………………………………….4
3. System Overview…………………………………………………………………………...5
3.1 System environment……………………………………………………………….…5
4. Design and Implement……………………………………………………………………...5
4.1 MainMenu……………………………………………………………………………5
4.2 Generator……………………………………………………………………………..6
4.3 Interface………………………………………………………………………………7
5. Conclusion…………………………………………………………………………………..
6. References…………………………………………………………………………………...
Abstract
Kakuro puzzle game is a kind of logic puzzle game between crosswords and sudoku
puzzle game. This game has two properties include crosswords and numbers. It is similar
to crossword because it has clues both across and down. On the other hand, it just likes a
sudoku which can not have the same number in a row or a column. In this game, we can
use several technologies to solve this puzzle efficiency. As a result, people like the challenge
because people have to face different puzzles and change their strategies to solve those
puzzles.
1. Introduction
Kakuro are easy to learn yet highly addictive language-independent logic puzzles now
following the footsteps of the worldwide Sudoku success. Requiring just pure logic and
simple add/subtract calculations, these numerical-crossword puzzles will carry you into a
fascinating world of number combinations you never imagined could exist.
Kakuro puzzles come in endless variations, available in almost any grid size and range from
very easy to extremely difficult, taking anything from ten minutes to several hours to solve.
Make one mistake and you’ll find yourself stuck later on as you get closer to the solution… If
you like Sudoku, you will love Concepts Kakuro as well!
1.1 History
Dell Magazines published the first puzzles of this type originally named Cross Sums in
1966, the same American publication which one decade later introduced Sudoku puzzles to
the world. Since then, Cross Sums puzzles have been available in the USA by Kappa’s
Games Magazine and many other publishers. According to the Cross Sums article in
Wikipedia, these puzzles have been a regular feature in most math-and-logic publications in
the USA for many years. Just like what happened with Sudoku, the market craze and the
re-branding from Cross Sums to Kakuro occurred only after the puzzle was imported to Japan,
improved, and exported back to the West.
In 1980 Cross Sums were imported to Japan by
Maki Kaji, president of Nikoli puzzles, who named
them Kasan Kurosu – a combination of the Japanese
word for “addition” and the Japanese pronunciation
of the English word “cross.” In 1986, Six years after
their initial release in Japan, Nikoli rebranded Kasan
Kurosu as Kakuro, a common abbreviation method
which is used in Japen. The company then release its
first dedicated Kakuro booklet, followed by 22
additional volumes till today. According to Wikipedia,
NiKoli has sold about one million Kakuro books in total.
Today, Kakuro puzzles from Nikoli appear in 100 Japanese magazines and newspaper and
its popularity in Japan is second only to sudoku. The third most popular puzzle is slitherlink,
which is an original Nikoli invention.
Kakuro was not always the second, According to Maki Kaji, Kakuro was Nikoli top
ranking puzzle from 1986 to 1992, when it was overtaken by Sudoku which rules the top of
the list until today.
1.2 How to play and rule
The rule in this game is that place one digit from 1 to 9 in each empty box so that the
sum of the digits in each set of consecutive white boxes (horizontal or vertical) is the number
appearing to the left of a set or above the set. No number may appear more than once in any
consecutive boxes.
2. Technology Background
In this project, we used the java technology to design our system. The java technology
includes the two major parts. One is Java Programming Language, another is Java Platform.
The java programming is a kind of object oriented programming language and it is very
powerful to design can write a program. On the other hand, Java Platform is an environment
for the programming running.
The java programming language let programmer write powerful, enterprise worthy
programs that run in the browser, from desktop or on a server. One of the java
programming’s advantages is running the compile code on the Java Virtual Machine. It means
that we can’t not spend too much resource in the operating system. The program is
interpreted by Java Virtual Machine for native operating system. Actually, the Java Virtual
Machine will be the same in each machine. Then, we compile the programming and can bring
the program to each machine that is available on the Java Virtual Machine. We do not worry
the program need to fix when we are in different machine with different operating System.
The Java platform is a software-only platform that runs on top of other hardware-based
platforms. Because hardware-based platforms vary in their storage, memory, network
connection, and computing power capabilities, specialized Java platforms are available to
address applications development for and deployment to those different environments.
As a result, we choose the Java technology to design and write our project. In addition,
We can compile the java code into easily everywhere. Sometimes, we only need to modify a
few code lines to run in the different environment. It is convenience for people who need to
test some code in many places.
3. System Overview
The goal of this system is that creates a Kakuro puzzle and helps player to solve this
puzzle. Firstly, the generator creates a puzzle game for players. For each puzzle, the system
provides the unique solution of the puzzle. Then the players can solve the puzzle by
themselves. If the players need more information to solve the puzzles. The System will
calculate the combination of the sum to help players.
3.1 System environment
For the software, the users need to have java JDK1.5 or later in Window XP professional
sp1 or sp2. For the hardware, the system had be testing on Intel Pentium centrino 1.3GHz,
256ram laptop and Intel Pentium 2.8G Hz 512 ram desktop. The system worked well on
those two computers.
Computer 1
Computer 2
TYPE
laptop
Desktop
CPU
Intel Pentium Centrino
Intel Pentium 4
CPU speed
1.3 GHz
2.8 GHz
RAM
256ram
512 ram
OS
Window
Window
Professional
Professional
Sp2
Sp1
The laptop had executed slowly when the puzzle is bigger then 8×8. When we test the
system on laptop, the system would be lag for sometimes. The system’s performances were
better on the Desktop than the laptop.
4. Design and Implement
4.1 Main Menu
Our process is started from the main
Menu. In this Menu, there are two combineboxes and three buttons. Two combine-boxes
is used to design the puzzle’s range. 5 is means
5 game cells and 1 clue cells. When user make
sure the width and height’s numbers, they can
click the “play” button to play the puzzle game
“Restart” means to restart the game. The button
of the list is “close” which is closing the process
and leave the game.
4.2 Generator
WE use several integer maps to run the generator. In addition, we use math.random () to
find the number. Then, using those steps to generate our generator.
First, we initial these maps.
Second step, we set the top line and the most left line to zero because we should have
clue cells to show the information. When we do this step, we can make sure we have the
outside lines to show the information.
Thirdly, we use the random method to random the numbers zero to three. If the random
number is zero, it will be the clue cells (information cells). If not the cells will be the white
empty cells. When we decide the cells, we also set the symmetrical cell the same value. The
symmetrical is a kind of rule for the generator. The Japanese think that will be challenge for
the player.
Fourth, we run the map again to set the random number from one to nine to the cells
which are not zero. When we set the number, we have to look for two things. One is checking
the total consecutive cells that are smaller than nine because the rule is use digital numbers. If
the number of the consecutive cells is bigger than nine, we will set the tenth cell to zero and
also set its symmetrical cell to zero. Another is checking that do not have the same number
in the consecutive cells. We will auto-random the number until the different one.
Finally, we run the last part is checking the two or three nearly clues. If those clues have
the same number and the same number of cells, it will not have a unique solution. Another
situation is checked. When a square empty cells such as2×2, 3×3, 4×4. The square ‘s top clue
cells and left cells are the same number and the same permutation. The final steps is to make
sure the puzzle which is unique solution. The below pictures are the examples that do not
have the unique solution. Left example the square’s top line has {11,11} and the left line still
Has {11,11}. In the empty cells we can switch 4,7 and get the same solution. In the right
example, the left line is {19,19}. If the up line and the down line are switched, they will get
the same result.
4.3 Interface
For this picture, it is our interface.
In our interface, we have three parts: game, operate and help(hint).
4.3.1 Game
there are two kinds cells in the game grid. One is blue box which is clue box and none
box. Another is white blank box.
each white blank box have two mouse handler to control. First is press, when players
press the button, there are popping up a message window to show the numbers. Players
can decide a number. In the mouse handler will check the same row or column used the
numbers, so player do not worry to put the same number in the same row or column. If
players figure out that they make the mistakes, the can press the position and choice the
zero to release the number.
Another mouse handler is touch. When player touch the position, the position’s row
and column line will be white line. It means the white line’s number can not be the same
number.
4.3.2 Operate
”close” is close the window and finish the game.
”restart” is going to the main menu to restart the game.
”check” is going to check the player’s solution. When players finish the puzzle, it will
pop up a complex message window. Then will go back to the main menu
”reset” is going to clean the whole empty cells to replay the game.
”hint(on/off)” open the help part and show the information to the player.
”solution” will show the solution to the player.
4.3.3 help(hint)
In this part, it will show the position’s information. The possible number is depending on the
combination of sum. When players eliminate the possible combination numbers, players also
get less and less possible number.
Minimum values for each clue length:








3 = 1, 2
6 = 1, 2, 3
10 = 1, 2, 3, 4
15 = 1, 2, 3, 4, 5
21 = 1, 2, 3, 4, 5, 6
28 = 1, 2, 3, 4, 5, 6, 7
36 = 1, 2, 3, 4, 5, 6, 7, 8
45 = 1, 2, 3, 4, 5, 6, 7, 8, 9
Maximum values for each clue length:








17 = 9, 8
24 = 9, 8, 7
30 = 9, 8, 7, 6
35 = 9, 8, 7, 6, 5
39 = 9, 8, 7, 6, 5, 4
42 = 9, 8, 7, 6, 5, 4, 3
44 = 9, 8, 7, 6, 5, 4, 3, 2
45 = 9, 8, 7, 6, 5, 4, 3, 2, 1
When we try to find the possible combination, we will input two numbers: sum and total
cells. Then, we set two arrays one is min and one is max. Then, we work the number into
the medium to find correct possible combinations.
After that we check the using number to eliminate the impossible combination. When
we reduce the combination to one and cross the row and column line. Then, the players will
find the correct number to solve the puzzle.
5. Conclusion
for this project, we create a Kakuro puzzle to play. We provide the inter face for user to play
Kakuro game. In addition, this project will help user to know how to play the Kakuro puzzle
game. However, this project need more time to complete the puzzle. For example, how to
design the different level puzzle? When we read the article from some references websites,
they also suggestion the solve the kakuro puzzle by square, and we never put this part into the
help (hint) part. Finally, our ultimate goal to have a very clearly to explain how the solver
working part and we will keep to update the programming.
6. References
Java Development Kit. from
http://www.sun.com
About the Java Technology. From
Book Object-Oriented Design & Patterns, Cay Horstmann.
Cross Sums - Wikipedia, the free encyclopedia. From
http://en.wikipedia.org/wiki/Kakuro
Cross Sums Number Combination Guide. From
http://strivinglife.net/wordpress/wp-content/uploads/2006/04/crosssumsnumbers.pdf
Kakuro Nerd (possible combination of sum)
http://www.kakuronerd.com/
Kakuro information. From
http://www.kakuro.com/index.php
Kakuro history. From
http://www.conceptispuzzles.com/articles/kakuro/history.htm