Eclipse Sudoku RCP Sample

This sample demonstrates how you can use Eclipse RCP to build a Sudoku Game. The sample can be used as either a standalone RCP application, or can be added to an Eclipse workbench where it manifests as a view.

Game play is relatively simple. As you hover over a cell, it shows you the values that could possibly go in that cell. If you click on that cell, the number contained in that cell will advance by one. If the cell is initially empty, a one ("1") will be placed in the cell; if the cell initially contains nine ("9"), it is cleared. You can also type a key to set the value of the active cell (typing space clears the cell).

As you set values into the cells, the puzzle board will warn you if any part of the board violates the rules of Sudoku by highlighting rows, columns, and blocks to indicate the violation.

A few puzzle generators and solvers are provided. This is where the real power in the sample lies. The game can be extended using standard Eclipse extensions to provide additional puzzle generators and solvers. The extension point org.eclipse.sudoku.core.factory can be used to provide new puzzle generators. Generators are made using a generator factory. An example of a factory can be found in the org.eclipse.sudoku.factory.generator.SudokuBoardGeneratorFactory class. The extension point org.eclipse.sudoku.core.solver can be used to implement a solver (see org.eclipse.sudoku.solver.backtracking.BacktrackingSolver for an example of a brute force backtracking solver).

Installation

If you want to get the plug-ins to use, you can access them by pointing the Update Manager at the update site: http://www.eclipse.org/evangelism/samples/updates. Once you've installed it, you can open it through the "Window > Show View > Other..." menu item.

Getting the Source Code

The source code for this application is available through the Eclipse CVS server which you can access using the Team Project Set found here. This Team Project Set contains the information required by Eclipse to install the collection of projects that make up the Sudoku game.

You must download this file and store it locally. The easiest way to do this is to right click on the link above (or here), and select "Save Link As..." from the menu. Save the file where you can easily find it (like on the desktop for example). Once you use this file to import the projects, you can discard it.

You must then import the Team Project Set into your workspace. Do this by selecting "Import..." from the "File" menu; on the first page of the wizard, select "Team Project Set" (under the "Team" category).

On the next page of the wizard, enter the path to the downloaded file and click "Finish".

If you are prompted for a user id and password, enter "anonymous" for the user id and leave the password field blank.