0% found this document useful (0 votes)
111 views13 pages

Sudoku Game

This document describes a console-based Sudoku game created in C++. It includes an introduction to Sudoku puzzles, the algorithm used to create the game, and results. The game uses functions to generate puzzles of different difficulties, display the board and accept input from keyboard arrows and keys. It checks for valid inputs and solves to display the completed puzzle. The conclusion discusses creating three difficulty modes and playing using keyboard functions with the ability to get the solution.

Uploaded by

manan hude
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
111 views13 pages

Sudoku Game

This document describes a console-based Sudoku game created in C++. It includes an introduction to Sudoku puzzles, the algorithm used to create the game, and results. The game uses functions to generate puzzles of different difficulties, display the board and accept input from keyboard arrows and keys. It checks for valid inputs and solves to display the completed puzzle. The conclusion discusses creating three difficulty modes and playing using keyboard functions with the ability to get the solution.

Uploaded by

manan hude
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

SUDOKU GAME

INTRODUCTION
1. Sudoku is a puzzle that has enjoyed worldwide popularity since 2005. To solve
a Sudoku puzzle, one needs to use a combination of logic and trial-and-error.
2. More math is involved behind the scenes: combinations used in counting valid
sudoku grids, group theory(well-known algebraic structures, such as rings,
fields, and vector spaces) used to describe ideas of when two grids are
equivalent, and computational complexity with regards to solving Sudokus.
3. Sudoku is a logic-based, combinatorial, number-placement puzzle. The
objective is to fill a 9-by-9 grid with digits so that each column, each row, and
each of the nine 3-by-3 sub-grids that compose the grid also called "boxes",
"blocks", "regions", or "sub-squares" contains all of the digits from 1 to 9. The
puzzle setter provides a partially completed grid, which for a well-posed
puzzle has a unique solution.
SUDOKU GRID
TOOLS
Platform: Code Blocks/VS Code

Language: C++
 
ALGORITHM
1. We have declared 18 void functions and 1 char function for various activities in Sudoku
Game. In main function, we have added main menu of start, instruction and exit.

2. Using gotoMenu () function, we are taking user input using switch case and getch().

3. Then, we are initiating game in playSudoku () function. Using setPuzzle () we are


creating string model of puzzle. We have created 3 modes as easy, medium and hard
using level argument.

4. We also have use getch() function to get user input. We have created
showHardProgressMode() function for hard level where progress is not shown in
percentage or in number.
ALGORITHM
1) Most important function is mainGame() where all building of table is created. We have define
pointer which display position and various colors have been added for different pages. Function
of keyboard keys also define in mainGame() function.

2) Then, we have defined function for arrow keys, delete ,backspace key. Then we have given
condition in setNumberKey() function that the number will be added only when the box is
empty.

3) Then, we define structure of pausegame(), exitMenu(). After that, we create checkGame() to


check whether puzzle is solved or not. If solved then switch case for finished will be applied.

4) Lastly, we create function as hideCursor(), which hides cursor in the console screen and to
function keyboard keys smoothly.
RESULTS
RESULTS
RESULTS
RESULTS
RESULTS
CONCLUSION
 We have created console based sudoku game. We have added 3 modes which are Easy, Medium
and Hard.

 We have used keyboard functions to play the game. We also get solution at the end.

 We can play it using arrows and W, A, S, D letters also.


REFERENCES
http://pi.math.cornell.edu/~mec/Summer2009/Mahmood/Intro.html

https://docs.microsoft.com/en-us/windows/console/setconsoletextattribute

https://www.daniweb.com/programming/software-development/threads/368006/getch-and
-arrow-keys

http://www.qb64.org/wiki/Keyboard_scancodes

https://pdf.co/blog/sudoku-game-in-c

https://en.wikipedia.org/wiki/Sudoku

https://sudoku.com/

You might also like