You are on page 1of 2

6x6 SUDOKU MOBILE PHONE GAME

Andrew Jones Dr J. Marsland ABSTRACT


This report outlines the development of a computer program that allows users to play sudoku puzzles on their mobile phone. Sudoku is a logical puzzle where the player places digits on a game board according to a simple set of rules. This game has the functionality to generate new puzzles when the user requires them. Puzzles are stored in a specially designed storage system and the game is able to generate puzzle solutions. The game has been written using Java Micro Edition (J2ME) and has been tested on a Nokia N80 handset. possible to add new puzzles, delete old puzzles and store changes that the user makes to the puzzle board. There must be a puzzle solver that can successfully find the solution to genuine Sudoku puzzles. The game must have the ability to generate new puzzles on request. The program should have an appropriate user interface which allows the user to access all the previously described functions.

JAVA MICRO EDITION (J2ME)


The program has been written using the Java programming language. Java is a high-level object-oriented programming language which has the advantage of being platform independent. J2ME differs from the more widely used standard edition (J2SE) of the Java language. Due to the limited capabilities of mobile devices it isn't be possible to fit the full functionality of J2SE onto a mobile device such as a mobile phone. J2ME provides for the exclusion of parts of the platform and provides device category specific components. This is realised through a combination of J2ME configurations and profiles [1], A configuration allows for the minimisation of the J2SE platform by removing components such as Java libraries and Java language components. Profiles are associated with specifying the hardware and software capabilities of the target device [1].

WHAT IS SUDOKU?
Sudoku is a logical puzzle that is played on a board like the one shown in figure 1. The objective of the game is to place numbers in all the squares on the board. The only rule that must be followed is that every row, column and 2x3 box must contain the numbers l-to-6 and there must be no repetition of any number within any row, column or 2x3 box. A sudoku puzzle begins by giving the user the answer to some of the squares, on figure 1 these are shown in grey. The given squares in the puzzle must only allow for one correct solution to be found.

(1) An Example Sudoku Puzzle

EQUIPMENT
The game has been developed for and tested using the Nokia N80 handset. With regards to the Java capabilities of this phone, the Nokia N80 operates using the Java Mobile Information Device Profile (MIDP) version 2. 0 and the Connected Limited Device Configuration (CLDC) version 1.1 [2]. The program has been compiled and packaged using the J2ME Wireless Toolkit. This is a freeware application provided by Sun Microsystems to aid the development of J2ME application. This also provides a set of emulators that have been used to test the software before it has been transferred to the Nokia N80 handset.

PROJECT OBJECTIVES
The objective of this project is to develop a program for a mobile phone that will be able to fulfil the following requirements: The program must have some sort of interface where the user is presented with a sudoku puzzle and they are able to interact with this puzzle so as to find a solution. There must be some sort of system that allows the user to save multiple sudoku puzzles. It should be

GRAPHICAL USER INTERAFCE (GUI)


The GUI features a system of menus that allow the user to navigate through various options. The main menu lists all the puzzles stored on the application, each puzzle has a delete and play option. Also, the main menu has an option to create a new puzzle. Figure 2 shows the output from the game board. Given cells are shown with a light blue background, the cursor has a light grey background and in this particular case, the puzzle has been solved. The user can move the cursor around the board using the navigation keys on their phone. The value of the selected square can be changed using the numeric keys. A number of options are available to the user using the options hotkey in the bottom left corner of the screen.

puzzle it is discarded and a new random puzzle is generated and tested using the solver. This is repeated until a genuine puzzle is encountered. The puzzle generator has an added function that allows the user to select between two different game difficulties. The game difficulties are based on the principal that the more cells that are given to the user, the easier the puzzle will be to solve. Therefore, the intermediate puzzle difficulty provides the user with 12 given cells and difficult puzzles provide the user with 10 given cells.

PUZZLE STORAGE SYSTEM


Essentially, the objective is to allow the user to store data associated with multiple sudoku puzzles and allow the user to access this data at any given time. To do this, the data must be stored in a way that is persistent and will not be lost when the application is closed. This is achieved using the Record Management System (RMS) provided by the J2ME library. The RMS allows Record Stores to be created and within a record store, multiple records can be stored, deleted and updated. There are a number of methods which are used to carry out specific functions with regard to the storage system. Essentially, these methods provide the system with the ability to store data associated with a particular puzzle. Load this stored data from memory and update the stored data to represent changes that are made to the puzzle board while the user is playing the game.

(2) The Game Board

PUZZLE SOLVING ALGORITHM


This is implemented using two basic puzzle solving techniques. The first technique is referred to as One Choice, This technique inspects the values of all the solved squares in the row, column and 2x3 box of each square. If all but one number in the range l-to-6 is found during this inspection, the remaining number must be the solution to the square in question. The other technique that is used is called Elimination. In this case, an array of possible solutions to each square is required. Again, the row, column and 2x3 box is inspected for each square. If one of the possibilities of the square in question is not encountered during this scan, this possibility must be the solution to the square.

REFERENCES
[1] Martin J Wells, J2ME Game Programming, Thompson Course Technology (2004). [2] http://www.nseries.com/nseries/v2/media/product/tech_specs/en-GB/tec h_specs_n80_en_GB.html

PUZZLE GENERATOR
The system that is used to generate new puzzles is relatively simple. A fixed number of random values are entered into randomly placed squares on the puzzle board. This randomly generated puzzle is then passed into the solver. If the solver finds a solution to the puzzle, it must be a genuine puzzle and is presented to the user. If the solver is unable to find a solution to the

You might also like