You are on page 1of 3

MINI-PROJECT W

Module Code
Module Name

: EGx111
: Computer Programming

Time Allowed: To present & submit by week 16

Objective: Draw a flowchart and write a Sudoku Solver Program


The Sudoku Puzzle
Sudoku is a logic-based number-placement puzzle. The objective is to fill a 99 grid with digits
so that each column, each row, and each of the nine 33 sub-grids that compose the grid (also
called "boxes", or "regions") contains all of the digits from 1 to 9. The Sudoku puzzle provides
a partially completed grid with various digits given in some cells (so called "givens"), which
typically has a unique solution. The player enters numbers into the blank spaces so that each
row, column and 3x3 box must contain the digits 1 to 9. Fig.1 shows a typical Sudoku puzzle,
and the solution is shown in Fig.2.

Difficulty level of the Sudoku puzzles varies significantly. There is no connection between the
difficulty of a Sudoku puzzle and the number of clues (givens) it contains. This is a myth.
There are very hard puzzles with many clues and easy puzzles with very few clues. It is the
number of logic decisions, their redundancy and their complexity which determines how hard
the puzzle is going to be.

The Project Description


Objectives of the project are as follows:
1) To use computer memory (i.e., structures and 2D arrays) to store the 99 digits, and puzzle
information including givens and digits entered by the players;
2) To display the Sudoku puzzle as shown (refer to Fig.3);
3) To create a manual mode that allows the player to use arrow keys to move the cursor around
within the 99 grid and to enter digits into the empty cells. Note that the player is not allowed
to alter Givens;
4) To evaluate the users input according to rules defined when the puzzle is completed, or any
time required by the user;
5) *To create an auto-search mode that uses Scanning method to automatically solve simple
Sudoku puzzles, such as for example the one shown in Fig.1.
You need to present your solution searching logic, demonstrate your program to your lab tutor
(supervisor) and submit soft copy of your program or report if required.
References
Some additional materials are attached below for your references. You are encouraged to
search to get useful information via Internet yourself to complete the project.
Reference 1: Screen Design

Fig.3

Reference 2: Code to Move Curser to (x,y) Position


#include<stdio.h>
#include<windows.h>
void gotoxy(int x, int y)
{
COORD coord;
coord.X = x;
coord.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}
void main()
{int x,y;
char ch;
x = 10;
y = 5;
ch = 'A';
gotoxy(x,y); // move cursor to x,y
putchar(ch); // print A at row:10, column:5
}

You might also like