Sudoku game GUI

When traveling in summer 2012 I got fascinated by the game Sudoku. Not too much to play the game itself more the logic behind it. Since I never played Sudoku before, when I came home from my travel I looked up the rules. Then I was thinking that all this logic behind this game can be written in code instead of thinking for hours.
This is how this lite project began. First it started as a console application with only the implementation of different solving types and a step by step output.
The idea was to solve the puzzle in a similar way as a person, not just doing a brute force approach.
When the algorithms were working I thought why not make a game interface, where people can put in a convenient way their Sudoku Matrix and start playing. So started the Qt GUI.

The GUI
The GUI is written using the C++ framework Qt. It compiles with Qt 5 and Qt 4.

MainWindow
First looking at the main window several features can be seen:

The big black numbers: These are the numbers which are set into the Matrix
The small red numbers: These numbers show what numbers are possible in the certain field in order not to violate the requirement that every number is only allowed to appear in each sub matrix, column and raw only once. A click on one of these numbers fills in the clicked number into the field.

MainWindow1Step

The gray step backward button appear after filling in the first field and give the player the possibility to go one step backward.

Enter Sudoku: Here the user can enter his/her own Sudoku to play with.

EnterSudoku

Solve: Uses the implemented Algorithms and tries to solve the Sudoku in the game Matrix.
Log Output: Shows the output step by step of the solver and many other information. It exists mainly for debugging but can also show the different steps in the solving process.

LogSudoku

Some of the buttons are function less and are leftovers of the development process or are on the todo list for implementation.

Download and Compile
The code of the game can be found here:

Source:
Code on GitHub

A simple

git clone https://github.com/digibird1/SudokuGUI
cd SudokuGUI/
qmake
make
./SudokuGUI

should start the game

Advertisements
One comment on “Sudoku game GUI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: