0% found this document useful (0 votes)
6 views26 pages

Sudoku Final

The document is a project report for a Sudoku game developed by Sudharshan S as part of his Bachelor of Technology degree at Anna University. The project utilizes Python, Tkinter, and PyGame to create an interactive application that generates and solves Sudoku puzzles, featuring adjustable difficulty levels and user-friendly controls. It aims to enhance logical reasoning and provide an engaging experience for both beginners and experienced players, with plans for future enhancements like multiplayer modes and AI-driven hints.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views26 pages

Sudoku Final

The document is a project report for a Sudoku game developed by Sudharshan S as part of his Bachelor of Technology degree at Anna University. The project utilizes Python, Tkinter, and PyGame to create an interactive application that generates and solves Sudoku puzzles, featuring adjustable difficulty levels and user-friendly controls. It aims to enhance logical reasoning and provide an engaging experience for both beginners and experienced players, with plans for future enhancements like multiplayer modes and AI-driven hints.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 26

SUDOKU GAME

PROJECT REPORT SUBMITTED IN PARTIAL


FULFILLMENT OF THE REQUIREMENTS FOR THE
AWARD OF THE

PROJECT DEGREE OF BACHELOR OF TECHNOLOGY

REPORT IN COMPUTER SCIENCE AND BUSINESS


SYSTEMS OF THE ANNA UNIVERSITY
JUNE
2025

PROJECT
WORK

Submitted by
SUDHARSHAN S
722824244056

BATCH
2024 - 2028
Under the Guidance of
Ms.M.VAISHALI M.E.,

COMPUTER SCIENCE AND BUSINESS SYSTEMS


Sri Eshwar College of Engineering
(An Autonomous Institution – Affiliated to Anna University)
COIMBATORE – 641 202
Sri Eshwar College of Engineering
(An Autonomous Institution – Affiliated to Anna University)
COIMBATORE – 641 202

BONAFIDE CERTIFICATE

Certified that this Report titled “SUDOKU GAME” is the bonafide work of

SUDHARSHAN.S 722824244056 who carried out the project work under my

supervision.

SIGNATURE SIGNATURE
R.SURESH M.Sc,M.Phil,Ph.D,SET Ms.M.VAISHALI M.E.,
PROFESSOR SUPERVISOR
HEAD OF THE DEPARTMENT ASSISTANT PROFESSOR
SCIENCE AND HUMANITIES
COMPUTER SCIENCE AND BUSINESS
Sri Eshwar College of Engineering,
SYSTEMS
Coimbatore – 641 202.
Sri Eshwar College of Engineering,
Coimbatore – 641 202.

Submitted for the Autonomous Semester End Project Viva-Voce held on

…………………..

INTERNAL EXAMINER EXTERNAL EXAMINER


TABLE OF CONTENTS

CHAPTER PAGE NO.


NO. TITLE

ABSTRACT

LIST OF FIGURES

1 INTRODUCTION
1.1 OBJECTIVES

1.2 SCOPE OF THE PROJECT

SYSTEM ANALYSIS AND SPECIFICATION


2

2.1 PROBLEM DESCRIPTION


FUNCTIONAL REQUIREMENT -
2.2 HARDWARE & SOFTWARE

NON – FUNCTIONAL REQUIREMENT


2.3

3 PROJECT DESCRIPTION

3.1 MODULE DESCRIPTION

4 IMPLEMENTATION

5 RESULTS AND DISCUSSION

6 CONCLUSION & FUTURE ENHANCEMENT


ABSTRACT

The Sudoku Game is an interactive application developed using Python,


leveraging Tkinter and PyGame to provide a visually appealing interface and
dynamic gameplay. This project focuses on solving and generating Sudoku
puzzles with user-friendly controls and customizable difficulty levels. It
streamlines the process of puzzle-solving, offering an engaging and efficient
experience for beginners and seasoned players alike.
The application supports three key functionalities with distinct interactions:
 Puzzle Generation: Dynamically creates Sudoku boards with adjustable
difficulty settings (Easy, Medium, Hard).
 Solver Algorithm: Implements a backtracking algorithm to efficiently
solve puzzles, ensuring valid solutions.
 User Interaction: Allows players to input values manually, validate
their solutions, and track completion time.
Built using Python with Tkinter for GUI components and PyGame for
interactive rendering, the application ensures smooth user experience,
responsive visuals, and seamless transitions between different difficulty modes.
The interface includes a grid-based layout, timer display, input validation
mechanics, and user feedback messages to enhance accessibility.
Key Features:
 Grid-based dynamic rendering using Tkinter and PyGame
 Adjustable difficulty levels with random puzzle generation
 Timer integration for tracking solving speed
 Hint system for guiding users through challenging puzzles
 Interactive number input with validation
 Optimized backtracking algorithm for quick puzzle solving
The system follows a modular design approach, ensuring separation of
concerns between UI, logic processing, and puzzle generation. Deployed as a
standalone Python application, it serves as a strong foundation for future
enhancements such as multiplayer modes, AI-driven puzzle hints, and mobile
compatibility.
This project demonstrates the practical application of Python in game
development and algorithmic problem-solving, showcasing skills in GUI
design, logic optimization, and interactive user experience.
LIST OF FIGURES

FIG.NO TITLE PAGE NO.

5.1 LANDING MODULE

5.2.1, 5.2.2, 5.2.3 GAMEPLAY SCREENS


CHAPTER 1
INTRODUCTION
1.1 OBJECTIVE

The primary objective of this project is to develop an interactive Sudoku Solver using Python,
Tkinter, and PyGame that provides an engaging way to generate, solve, and interact with
Sudoku puzzles. The system ensures an intuitive interface, enabling users to solve puzzles
efficiently while offering features such as difficulty selection, timer tracking, and hint-based
solving assistance.

For players, the application provides a dynamic puzzle generator with adjustable difficulty
settings (Easy, Medium, Hard). It features a solver algorithm to assist users when stuck and a
validation mechanism to check for correct inputs.

The project emphasizes:

 Efficient and user-friendly Sudoku puzzle-solving.


 Dynamic puzzle generation with adjustable difficulty.
 Timer-based tracking for improving problem-solving speed.
 Hint system for guided puzzle-solving assistance.
 Grid-based interactive interface using Tkinter and PyGame.

This system aims to enhance logical reasoning, improve puzzle-solving strategies, and provide an
accessible digital tool for Sudoku enthusiasts, ultimately contributing to an enjoyable and
intuitive gaming experience.

1.2 SCOPE OF THE PROJECT

The Sudoku Solver is designed to provide an interactive and efficient way to generate, solve,
and validate Sudoku puzzles using Python, Tkinter, and PyGame. It offers an intuitive interface for users
to engage with Sudoku puzzles, supporting various difficulty levels and dynamic puzzle generation. The
system ensures seamless grid interactions, optimized solving algorithms, and an engaging user experience.
The application integrates grid-based rendering and real-time validation to assist players in solving
puzzles effectively. The solver algorithm employs backtracking techniques, ensuring correct and
efficient solutions while maintaining a smooth visual flow within the graphical interface.
Data is processed dynamically, allowing users to generate random puzzles, validate entries, and
interact with hints or timer-based challenges. The platform is built with modular flexibility,
supporting future enhancements like multiplayer modes, AI-driven puzzle hints, mobile app
adaptation, graphical analytics, and performance tracking. This system enhances logical reasoning,
encourages strategic problem-solving, and delivers a polished and interactive Sudoku experience.

CHAPTER 2
SYSTEM ANALYSIS AND SPECIFICATION

Sudoku enthusiasts, especially beginners, often struggle with solving puzzles efficiently due to
the complexity of logical reasoning required. Many find it challenging to determine the correct
placement of numbers, recognize patterns, and apply solving techniques without assistance.
Traditional Sudoku-solving methods rely heavily on manual trial-and-error, which can lead to
frustration and errors, especially in difficult puzzle variations.

Additionally, there is no unified interactive platform where users can generate random Sudoku
puzzles, receive hints, track solving time, and validate their solutions in real-time. The absence of
intuitive tools for step-by-step solving guidance, adjustable difficulty levels, and automated
puzzle validation further limits the learning experience. These gaps affect user engagement,
problem-solving confidence, and long-term interest in logical puzzle-solving.

The Sudoku Solver project aims to address these challenges by offering an interactive,
algorithm-driven platform using Python, Tkinter, and PyGame. It enables users to input
numbers, receive hints, and validate their solutions instantly, fostering an engaging and structured
approach to Sudoku. The system also supports timer-based tracking and dynamic puzzle
generation, ensuring a seamless learning and gaming experience.

2.1 FUNCTIONAL REQUIREMENT

1. USER INTERFACE & GAMEPLAY MECHANICS

Develop an intuitive GUI using PyGame, allowing users to select difficulty levels and
play Sudoku seamlessly.
Support grid-based interactions, enabling users to fill cells and validate their inputs in real
time.
Provide a hint system to assist users by suggesting possible moves when requested.

2. DIFFICULTY LEVELS & GAME LOGIC

 Offer three difficulty levels: Easy (4×4), Intermediate (9×9), Hard (16×16),
dynamically adjusting puzzle complexity.
 Implement random puzzle generation ensuring a unique Sudoku experience each time.
 Validate Sudoku rules—each row, column, and sub-grid must contain unique numbers
without repetition.

3. TIMER AND SCORE TRACKING

Optionally provide a score system, factoring in completion time and correctness to


encourage replayability.
 Integrate a timer to track how long users take to solve each puzzle.

4. DATA STORAGE AND USER PROGRESS

 Ensure smooth integration of game state persistence, reducing the need for replays.

5. FUTURE ENHANCEMENTS AND SCALABILITY

 Enhance difficulty level customization, allowing users to tweak settings like hint
frequency, error highlighting, etc.
 Integrate AI-driven Sudoku solving, enabling an automatic solution feature for learning
and assistance.
 Prepare for mobile-responsiveness or porting to a web-based platform for broader
accessibility.

SOFTWARE AND HARDWARE REQUIREMENTS

1. HARDWARE REQUIREMENTS:

• Minimum: Intel i3 processor, 8 GB RAM

• Recommended: Intel i5 or higher, 16 GB RAM for faster performance

2. SOFTWARE REQUIREMENTS:

• Python

• PyGame

• Tkinter
o NON-FUNCTIONAL REQUIREMENT

1. PERFORMANCE

 The system should provide fast responses to user interactions, such as inputting
numbers, validating solutions, generating new puzzles, and using the solver
feature. It must ensure smooth performance even with complex puzzles and
multiple simultaneous actions.

2. SCALABILITY

 The application should be scalable to support a growing number of Sudoku


puzzles, difficulty modes, and interactive features. Future enhancements like
multiplayer support, AI-driven hints, or mobile app integration should be
accommodated without major architectural changes.

3. RELIABILITY & AVAILABILITY

 The system must ensure consistent performance with high uptime and minimal
service disruption. Backup mechanisms and proper error handling should be in
place to prevent data loss, ensuring the Sudoku Game remains available and
functional at all times.

4. SECURITY

 The system must ensure consistent performance with high uptime and minimal
service disruption. Backup mechanisms and proper error handling should be in
place to prevent data loss, ensuring the Sudoku Game remains available and
functional at all times.

5. USABILITY

 The system must ensure consistent performance with high uptime and minimal
service disruption. Backup mechanisms and proper error handling should be in
place to prevent data loss, ensuring the Sudoku Game remains available and
functional at all times.

CHAPTER 3
PROJECT DESCRIPTION

3.1 MODULE DESCRIPTION

3.1.1 USER

The User module allows players to register, log in, and manage their profiles.
Users can track their game progress, set difficulty preferences, and view their previously
completed puzzles. This ensures a personalized gaming experience and enhances user
engagement.

3.1.2 SUDOKU GAME MODULE

This module offers an interactive Sudoku experience with various difficulty


levels. It supports randomly generated puzzles, validation checks, and hints to assist players in
solving challenges. The dynamic grid enhances accessibility and usability.

3.1.3 TIMER AND SCORING MODULE

The Timer & Scoring module monitors the time taken to complete puzzles and
rewards players based on their performance. It introduces competitive elements by tracking
high scores, fastest completion times, and accuracy statistics.

3.1.4 PYGAME MODULE

The PyGame module is responsible for rendering graphics, handling user input,
and creating a visually appealing interface for the Sudoku game. It ensures smooth
interactions and transitions between menu selection, puzzle-solving, and game features.

3.1.5 SETTINGS MENU MODULE

The Settings Menu module allows users to customize their game experience.
Players can adjust sound settings, toggle hints, set difficulty preferences, change themes for
visual customization, and manage timer options. This module ensures flexibility and
accessibility in gameplay.
CHAPTER 4
IMPLEMENTATION

main.py

import PyGame
from settings_menu import SettingsMenu
from sudoku_game import SudokuGame

def main():
PyGame.init()
running = True

while running:
screen = PyGame.display.set_mode((600, 400))
PyGame.display.set_caption("Sudoku Settings")

settings = SettingsMenu(screen)
difficulty = settings.run()

if difficulty is None:
running = False
break

if difficulty == 4 or difficulty == 9:
grid_pixels = 600
else:
grid_pixels = 800

window_height = grid_pixels + 140 # extra space for timer + buttons


screen = PyGame.display.set_mode((grid_pixels, window_height))
PyGame.display.set_caption("Sudoku Game")

game = SudokuGame(screen, difficulty)


game.run()

PyGame.quit()

if __name__ == "__main__":
main()
sudoku_board.py

import random
import math

class SudokuBoard:
def __init__(self, size):
self.size = size
self.base = int(math.sqrt(size))
self.solution = self._generate_solution()

self.puzzle = [row[:] for row in self.solution]


clues = self._get_clues_count()
self._remove_numbers(clues)

self.current = [row[:] for row in self.puzzle]

self.givens = [
[(self.puzzle[r][c] != 0) for c in range(self.size)]
for r in range(self.size)
]

def _get_clues_count(self):
if self.size == 4:
return 6
elif self.size == 9:
return 25
elif self.size == 16:
return 60
else:
return self.size * self.size // 4

def _generate_solution(self):
N = self.size
base = self.base

def pattern(r, c):


return (base * (r % base) + r // base + c) % N

r_base = range(base)
rows = [
g * base + r
for g in random.sample(r_base, base)
for r in random.sample(r_base, base)
]
cols = [
g * base + c
for g in random.sample(r_base, base)
for c in random.sample(r_base, base)
]
nums = random.sample(range(1, N + 1), N)
board = [
[nums[pattern(r, c)] for c in cols]
for r in rows
]
return board

def _remove_numbers(self, clues):


N = self.size
total_cells = N * N
positions = [(r, c) for r in range(N) for c in range(N)]
random.shuffle(positions)
to_remove = total_cells - clues

for i in range(to_remove):
r, c = positions[i]
self.puzzle[r][c] = 0

def is_valid_move(self, row, col, val):


return val == self.solution[row][col]

sudoku_game.py

import PyGame
from sudoku_board import SudokuBoard

high_score = 0

class SudokuGame:
def __init__(self, screen, size):
self.screen = screen
self.size = size
self.board = SudokuBoard(size)

self.locked = [[False] * size for _ in range(size)]


for r in range(size):
for c in range(size):
if self.board.givens[r][c]:
self.locked[r][c] = True

if size == 4:
self.point_value = 2
elif size == 9:
self.point_value = 3
else:
self.point_value = 5

self.score = 0

if size == 4:
self.total_time = 120 # 2 minutes
elif size == 9:
self.total_time = 300 # 5 minutes
else:
self.total_time = 600 # 10 minutes

self.start_ticks = PyGame.time.get_ticks()
self.game_active = True

self.grid_pixels = self.screen.get_width()
self.window_width = self.screen.get_width()
self.window_height = self.screen.get_height()
self.cell_size = self.grid_pixels // self.size
self.grid_origin_x = (self.window_width - self.cell_size * self.size) // 2
self.grid_origin_y = 40 # leave room at top for the timer

self.exit_rect = PyGame.Rect(10, self.window_height - 50, 100, 40)


self.action_rect = PyGame.Rect(self.window_width - 110, self.window_height - 50,
100, 40)

self.font = PyGame.font.SysFont(None, int(self.cell_size * 0.8))


self.button_font = PyGame.font.SysFont(None, 30)
self.score_font = PyGame.font.SysFont(None, 30)
self.large_font = PyGame.font.SysFont(None, 80)

self.selected = None

self.input_buffer = ""

def run(self):
global high_score

clock = PyGame.time.Clock()
running = True

while running:
for ev in PyGame.event.get():
if ev.type == PyGame.QUIT:
return

if ev.type == PyGame.KEYDOWN:
if ev.key == PyGame.K_ESCAPE:
return

if self.selected and not self.locked[self.selected[0]][self.selected[1]]:


r, c = self.selected

if ev.key in (PyGame.K_BACKSPACE, PyGame.K_DELETE):


self.input_buffer = ""
self.board.current[r][c] = 0
elif PyGame.K_0 <= ev.key <= PyGame.K_9:
if len(self.input_buffer) < 2:
digit = ev.key - PyGame.K_0
if not (len(self.input_buffer) == 0 and digit == 0):
self.input_buffer += str(digit)

try:
val = int(self.input_buffer)
except ValueError:
val = None

if val is not None and 1 <= val <= self.size:


self.board.current[r][c] = val

if self.board.is_valid_move(r, c, val):
if not self.locked[r][c]:
self.locked[r][c] = True
if self.game_active:
self.score += self.point_value
else:
if self.game_active:
self.score -= 1

self.input_buffer = ""

else:
if self.input_buffer != "" and (val is None or val > self.size):
self.input_buffer = ""
self.board.current[r][c] = 0

if ev.type == PyGame.MOUSEBUTTONDOWN and ev.button == 1:


mx, my = ev.pos

if self.game_active:
self.input_buffer = ""
self.selected = None
for rr in range(self.size):
for cc in range(self.size):
cell_x = self.grid_origin_x + cc * self.cell_size
cell_y = self.grid_origin_y + rr * self.cell_size
cell_rect = PyGame.Rect(cell_x, cell_y, self.cell_size, self.cell_size)
if cell_rect.collidepoint(mx, my):
if not self.locked[rr][cc]:
self.selected = (rr, cc)
break
if self.selected:
break

if self.exit_rect.collidepoint(mx, my):
return
if self.action_rect.collidepoint(mx, my) and self.game_active:
self.game_active = False
running = False

if self.game_active:
elapsed = (PyGame.time.get_ticks() - self.start_ticks) / 1000
remaining = max(int(self.total_time - elapsed), 0)
if remaining == 0:
self.game_active = False
running = False
else:
elapsed = (PyGame.time.get_ticks() - self.start_ticks) / 1000
remaining = max(int(self.total_time - elapsed), 0)

self.screen.fill((255, 255, 255))

for rr in range(self.size):
for cc in range(self.size):
x = self.grid_origin_x + cc * self.cell_size
y = self.grid_origin_y + rr * self.cell_size
rect = PyGame.Rect(x, y, self.cell_size, self.cell_size)

if self.board.givens[rr][cc]:
bg = (200, 200, 200) # Grey for givens
elif self.locked[rr][cc]:
bg = (180, 255, 180) # Light green for correct/locked
else:
bg = (255, 255, 255) # White for empty

PyGame.draw.rect(self.screen, bg, rect)

if self.selected == (rr, cc):


PyGame.draw.rect(self.screen, (255, 255, 0), rect, 3)
else:
PyGame.draw.rect(self.screen, (0, 0, 0), rect, 1)

val = self.board.current[rr][cc]
if val != 0:
text = str(val)
txt_surf = self.font.render(text, True, (0, 0, 0))
txt_rect = txt_surf.get_rect(center=rect.center)
self.screen.blit(txt_surf, txt_rect)

minutes = remaining // 60
seconds = remaining % 60
time_text = f"Time: {minutes:02d}:{seconds:02d}"
time_surf = self.score_font.render(time_text, True, (0, 0, 0))
time_rect = time_surf.get_rect(
center=(
self.window_width // 2,
self.grid_origin_y + self.size * self.cell_size + 20
)
)
self.screen.blit(time_surf, time_rect)

PyGame.draw.rect(self.screen, (200, 200, 200), self.exit_rect)


exit_lbl = self.button_font.render("Exit", True, (0, 0, 0))
exit_lbl_rect = exit_lbl.get_rect(center=self.exit_rect.center)
self.screen.blit(exit_lbl, exit_lbl_rect)

PyGame.draw.rect(self.screen, (200, 200, 200), self.action_rect)


done_lbl = self.button_font.render("Done", True, (0, 0, 0))
done_lbl_rect = done_lbl.get_rect(center=self.action_rect.center)
self.screen.blit(done_lbl, done_lbl_rect)

PyGame.display.flip()
clock.tick(30)

if self.score > high_score:


high_score = self.score

self._show_final_screen(high_score)

def _show_final_screen(self, high_score):


display_score = max(self.score, 0)

clock = PyGame.time.Clock()
done = False

while not done:


for ev in PyGame.event.get():
if ev.type == PyGame.QUIT:
done = True
if ev.type == PyGame.KEYDOWN:
done = True
if ev.type == PyGame.MOUSEBUTTONDOWN and ev.button == 1:
done = True

self.screen.fill((255, 255, 255))

title_surf = self.large_font.render("Game Over", True, (0, 0, 0))


title_rect = title_surf.get_rect(center=(self.window_width // 2, self.window_height //
2 - 80))
self.screen.blit(title_surf, title_rect)

final_surf = self.score_font.render(f"Final Score: {display_score}", True, (0, 0, 0))


final_rect = final_surf.get_rect(center=(self.window_width // 2, self.window_height //
2 - 20))
self.screen.blit(final_surf, final_rect)

high_surf = self.score_font.render(f"High Score: {high_score}", True, (0, 0, 0))


high_rect = high_surf.get_rect(center=(self.window_width // 2, self.window_height //
2 + 20))
self.screen.blit(high_surf, high_rect)

prompt_surf = self.button_font.render("Press any key to return", True, (0, 0, 0))


prompt_rect = prompt_surf.get_rect(center=(self.window_width // 2,
self.window_height // 2 + 80))
self.screen.blit(prompt_surf, prompt_rect)

PyGame.display.flip()
clock.tick(30)

settings_menu.py

import PyGame

class SettingsMenu:
def __init__(self, screen):
self.screen = screen

self.bg_color = (30, 30, 30)


self.button_color = (70, 70, 70)
self.selected_color = (100, 100, 200)
self.text_color = (255, 255, 255)

self.title_font = PyGame.font.SysFont(None, 50)


self.button_font = PyGame.font.SysFont(None, 30)

self.selected = 4

w, h = self.screen.get_size()

btn_w, btn_h = 300, 50


x_center = (w - btn_w) // 2

self.easy_rect = PyGame.Rect(x_center, 80, btn_w, btn_h)


self.med_rect = PyGame.Rect(x_center, 160, btn_w, btn_h)
self.hard_rect = PyGame.Rect(x_center, 240, btn_w, btn_h)

self.start_rect = PyGame.Rect(x_center, 320, btn_w, btn_h)

self.exit_rect = PyGame.Rect(10, h - 50, 100, 40)

def run(self):
clock = PyGame.time.Clock()

while True:
for ev in PyGame.event.get():
if ev.type == PyGame.QUIT:
return None
if ev.type == PyGame.KEYDOWN:
if ev.key == PyGame.K_ESCAPE:
return None

if ev.type == PyGame.MOUSEBUTTONDOWN and ev.button == 1:


mx, my = ev.pos

if self.easy_rect.collidepoint(mx, my):
self.selected = 4
elif self.med_rect.collidepoint(mx, my):
self.selected = 9
elif self.hard_rect.collidepoint(mx, my):
self.selected = 16

elif self.start_rect.collidepoint(mx, my):


return self.selected

elif self.exit_rect.collidepoint(mx, my):


return None

self.screen.fill(self.bg_color)

title_surf = self.title_font.render("Select Difficulty", True, self.text_color)


title_rect = title_surf.get_rect(center=(self.screen.get_width() // 2, 30))
self.screen.blit(title_surf, title_rect)

easy_color = self.selected_color if self.selected == 4 else self.button_color


PyGame.draw.rect(self.screen, easy_color, self.easy_rect)
easy_text = self.button_font.render("Easy (2×2)", True, self.text_color)
easy_text_rect = easy_text.get_rect(center=self.easy_rect.center)
self.screen.blit(easy_text, easy_text_rect)

med_color = self.selected_color if self.selected == 9 else self.button_color


PyGame.draw.rect(self.screen, med_color, self.med_rect)
med_text = self.button_font.render("Intermediate (3×3)", True, self.text_color)
med_text_rect = med_text.get_rect(center=self.med_rect.center)
self.screen.blit(med_text, med_text_rect)

hard_color = self.selected_color if self.selected == 16 else self.button_color


PyGame.draw.rect(self.screen, hard_color, self.hard_rect)
hard_text = self.button_font.render("Hard (4×4)", True, self.text_color)
hard_text_rect = hard_text.get_rect(center=self.hard_rect.center)
self.screen.blit(hard_text, hard_text_rect)

PyGame.draw.rect(self.screen, self.button_color, self.start_rect)


start_text = self.button_font.render("Start Game", True, self.text_color)
start_text_rect = start_text.get_rect(center=self.start_rect.center)
self.screen.blit(start_text, start_text_rect)

PyGame.draw.rect(self.screen, self.button_color, self.exit_rect)


exit_text = self.button_font.render("Exit", True, self.text_color)
exit_text_rect = exit_text.get_rect(center=self.exit_rect.center)
self.screen.blit(exit_text, exit_text_rect)

PyGame.display.flip()
clock.tick(30)
CHAPTER 5
RESULTS AND DISCUSSIONS

LANDING PAGE: Handles a clean interface with difficulty level selection (Easy,
Intermediate, Hard) and options to start or exit the Sudoku game.

Fig:5.1 Landing Module

GAMEPLAY SCREEN: A multi-grid Sudoku game with interactive puzzle-solving, a


timer, and difficulty-based challenges (4x4, 9x9, 16x16).

Fig:5.2.1 Gameplay Screen – 1 (4x4 Easy level – Sudoku)


Fig:5.2.2 Gameplay Screen – 2 (9x9 Intermediate level – Sudoku)

Fig:5.2.3 Gameplay Screen – 3 (16x16 Hard level – Sudoku)


CHAPTER 6
CONCLUSION AND FUTURE ENHANCEMENT

The Sudoku Game is an intelligent platform designed to assist users in solving and
generating Sudoku puzzles efficiently. It provides features such as puzzle validation, AI-
powered solving algorithms, difficulty level selection, and secure user authentication,
allowing users to interact with the system based on their preferences and expertise. Users
can input puzzles, receive instant solutions with step-by-step breakdowns, and track their
solving history, fostering an engaging and educational experience. The integrated
challenge module encourages users to practice and improve their puzzle-solving skills,
while all data, including user profiles and completed puzzles, is securely stored in a
database for easy retrieval and analysis.

Looking ahead, the system can be enhanced with features like personalized solving tips
based on user patterns, adaptive difficulty adjustments, and integration with interactive
tutorials to guide beginners through logical techniques. Developing a mobile application
would increase accessibility, allowing users to solve and track puzzles on the go.
Additionally, incorporating AI-driven puzzle generation could create unique and
progressively challenging Sudoku grids tailored to individual users. These future
enhancements would significantly improve user engagement, scalability, and
effectiveness of the system, making it an indispensable tool for Sudoku enthusiasts and
learners alike.
REFERENCES:

1. Sudoku Problem in Python

https://www.geeksforgeeks.org/sudoku-problem-in-python/

2. PyGame Tutorial

https://www.tutorialspoint.com/PyGame/index.htm/

3. Tkinter Tutorial

https://www.geeksforgeeks.org/python-tkinter-tutorial/

4. Algorithm to Solve Sudoku | Sudoku Solver

https://www.geeksforgeeks.org/sudoku-backtracking-7/

5. Python Math Module

https://www.w3schools.com/python/python_math.asp/

You might also like