K. E.
Society’s
Rajarambapu Institute of Technology, Rajaramnagar
Diploma
Programming with ‘Python’(22616)
Project Report on
“ Create report on Tic Tac Toe Game”
Submitted By:
Jadhav Abhinay Sanjay [2173018]
Pawar Akshata Mohan [2173019]
Patil Aditya Ajit [2173020]
Thombare Suraj Dhanaji [2173022]
Patil Pratik Prakash [2173023]
of Class TY Computer Engineering (Diploma)
Under The Guidance of:
[Link]
For partial fulfillment of the requirement of
‘Programming with python (22616)’ subject under
MSBTE
Department of Computer Engineering
(Diploma)
2023-24
I
DECLARATION
We, the undersigned, hereby declare that the project entitled. A study on “Create
Report on Tic Tac Toe Game’’ is written and submitted by us to K. E. Society’s
Rajarambapu Institute of Technology, Diploma , Rajaramnagar; during Year 2023-24, Sixth
Semester for partial fulfillment of the ‘Micro Project’ requirement of ‘Programming With
Python (22616)’ subject under Maharashtra State Board of Technical Education, Mumbai
curriculum, under the guidance of ‘[Link]’ is our original work.
The empirical findings in this project are based on the data collected in this project
is not copied from any other sources.
Name Sign
Jadhav Abhinay Sanjay [2173018]
Pawar Akshata Mohan [2173019]
Patil Aditya Ajit [2173020]
Thombare Suraj Dhanaji [2173022]
Patil Pratik Prakash [2173023]
II
K. E. Society’s
Rajarambapu Institute of Technology, Rajaramnagar
Diploma
Certificate
This is to certify that the micro-project report entitled “Create Report on
Need of Tic Tac Toe Game” submitted by following students of class TY Computer
Engineering (Diploma) for partial fulfillment of the requirement of ‘Programming With
Python (22616)’ course under Maharashtra State Board of Technical Education, Mumbai
curriculum, for the year 2023-24, Sixth Semester in the record of their own work carried out
under my direct supervision and guidance.
Jadhav Abhinay Sanjay [2173018]
Pawar Akshata Mohan [2173019]
Patil Aditya Ajit [2173020]
Thombare Suraj Dhanaji [2173022]
Patil Pratik Prakash [2173023]
Mr. M. C. Aswale Mr. D. V. Mirajkar Dr. H. S. Jadhav
(Guide) (HOD –Diploma CO) (Dean Diploma)
III
ACKNOWLEDGEMENT
It gives us immense pleasure to present our project report on “Create Report on
Tic Tac Toe Game” under the guidance enables this task to path of completion.
We would like to extend our thanks to Prof. Mr. D. V. Mirajkar (HOD), Mr. M.
C. Aswale and all our professors, staff members and all our friends who extended their
co-operation to complete.
Finally, yet importantly, we express our gratitude to our RIT Office, Department,
Computer Center and library staff and those who have helped us directly or indirectly
during preparation of this project report.
With warm regards,
Yours Sincerely,
Jadhav Abhinay Sanjay [2173018]
Pawar Akshata Mohan [2173019]
Patil Aditya Ajit [2173020]
Thombare Suraj Dhanaji [2173022]
Patil Pratik Prakash [2173023]
IV
INDEX
Page
Sr. no.
No.
Particulars From
01 Title Page 1
02 Declaration 2
03 Certificate 3
04 Acknowledgment 4
05 Index 5
06 Aim of Microproject 6
07 Brief Description(Introduction) 7
08 System Analysis 8
09 Software Description
10 Project Description
11 Conclusion 11
12 References 12
V
1. Abstract of Micro Project
The game TIC TAC TOE had an early variant which began in the first century in the
Roman Empire. During that time, it was called Terni Lapilli where the players only
had three pieces and had to move around the empty spaces to play. The actual game of
TIC TAC TOE could be traced back to ancient Egypt. The game was also known
during that time as "Three Men's Morris". The first reference to Noughts and crosses
was made in 1864 in a British novel called Can You Forgive Her. For many years the
game was referred to as noughts and crosses but was changed in the 20th century by
the United States to TIC TAC TOE.
The purpose of this documentation is to capture all the requirements by which the user
can play a game of tic-tac-toe in Graphical User Interface as well as they can develop
a logic that what is actually happening.
1
2. Introduction
➢ Objectives:
One of the most universally played childhood games is TIC TAC TOE. Ап interactive
TIC TAC TOE game is developed where two players will be able to play against each
other in a suitable GUI by using proper mouse movements. This game will start by
showing a simple display, prompt the user for a move and then prints the new board.
The board looks like a large hash symbol (#) with nine slots that can each contain an
X, an O, or a blank. There are two players, the X player and the O player. By default,
playerı (the O player) takes the initiative. The game will end in two situations: a win,
when one player gets three in a row, horizontally, vertically or diagonally. A draw,
when there are no remaining places to choose and neither of them has won. Here are
some rules for the game:
✓ The player with symbol 'O' goes first.
✓ Players alternate placing Xs and Os on the board until either
✓ one player has three in a row, horizontally, vertically or diagonally; or
✓ all nine squares are filled.
✓ The player who can draw three X s or three Os in a row wins.
✓ If all nine squares are filled and none of the players have three in a row, the
game is a draw.
14
3. System Analysis
Analysis can be defined by breaking up of any whole so as to find out their nature,
working functionalities etc. It defines design as to make preliminary sketches of, to
sketch a pattern or outline for planning. To plan and carry out especially by artistic
arrangement or in a skilful wall. System analysis and design can be characterized as a
set of techniques and processes, a community of interests, a culture and intellectual
orientation.
The various tasks in system analysis phase including the following:
✓ Understanding Application
✓ Project Planning
✓ Project Scheduling
✓ Performing Trade Studies.
✓ Performing Cost Benefit Analysis
✓ Recommending Alternative Solutions
✓ Supervising, Installing, Maintaining the system
➢ Existing System:
The Existing system is a simple game to play with paper and pencil between
two people Here the whole process will be carried out in the hand-written
format making nine square grids, placing X's and O's and checking for the
winner. This process will repeat every time. So, it will be a tedious job to draw
a nine square grid every time with paper and pencil. The human effort is more
here. Along with that the retrieval of the information is not easy as the records
are maintained in the hand-written papers. This application requires correct feed
on input into the respective field. Suppose the wrong inputs are entered, then
the whole process is to be done again. So, the users find it difficult to use.
13
➢ Technical Feasibility:
The technical requirement for the system is economic and it doesn't use any
other hardware or software. Technical evaluation must also assess whether the
Existing System can be upgraded to use the new technology and whether the
organization has the expertise to use it Install all the upgrades frameworks into
the Python IDLE package supported Linux based application This application
mostly depends two packages namely tkinter package and pygame package
provided by Python 3.6.0.
➢ Operational Feasibility:
The system working is quite easy to use and learn due to its simple but attractive
interface. User requires no prerequisites for operating the product Technical
performance includes issues such as determining whether the system can sense
the proper click of the mouse or after sensing the click it places the symbol in
the desired cell and whether the system is organized in such a way that it always
displays the correct result according to the moves made by the players.
❖ SYSTEM SPECIFICATION
➢ Hardware Requirement:
✓ Minimum RAM:- 1GB
✓ MINIMUM Hard Disk:- 128GB
✓ Processor:- Intel CORE i5
➢ Software Requirement:
✓ Operating System:- Support for both LINUX and
WINDOWS users.
✓ Back End:- Python 3.7.0 interpreter
✓ Front End Language:- Python
Front Design:- Tkinterface
14
[Link] Description
➢ Python 3.7.0:
IDLE stands for Integrated Development and Learning Environment is an
integrated development environment for python. It has been bundled with the
default implementation of the language since 1.5.2b.1. It is packaged as an
optional part of the python packaging with many Linux distribution. It is
completely written in python3 and Tkinter GUI toolkit. IDLE is intended to be
a simple IDE and suitable for beginners as well as advanced users. To that end
it is cross platform and avoids feature clutter. The features provided by the
IDLE includes.
✓ Python shell with syntax highlighting.
✓ Integrated debugger with stepping, persistent breakpoints
and call stack visibility.
Multi-window text editor with syntax highlighting, auto
completion, smart indenting etc.
➢ Development Tools And Technologies
1. PYTHON:
Python is a general purpose interpreted, interactive, object-oriented, and
high-level programming language. It was created by Guido Van Rossum
during 1985-1990. Like Perl, Python source code is also available under the
GNU General Public License (GPL). Python is named after a TV show
called "Monty Python's Flying Circus”.
Python 3 0(also called "Python 3000" or "Py3k") was released in December
3, 2008. The latest version of python accumulated new and redundant ways
to program the same task, Python 3.6 had an emphasis on removing
13
duplicative constructs and modules, in keeping with "There should be one
The features of dynamic typing are:
✓ Types are bound to values but not to variables.
✓ Function and method lookup is done at runtime.
✓ Values are inspect-able.
✓ There is an interactive interpreter, more than one, in fact.
✓ You can list the methods supported by any given object.
[Link] (Graphical User Interface):
Our goal in this article is to provide you with an introductory of GUI
programming. In order to learn the GUI programming, you must first understand a few
core aspects of GUI. So let's begin the discussion. The primary GUI toolkit will be
using Tk, Python's default GUI. We'll access Tk from its python interface called
Tkinter. It is not the latest and greatest nor does it have the most robust set of GUI
building blocks, but it is fairly simple to use and using it, you can build GUI's that run
on most platforms Setting up GUI application is similar to how an artist produces a
painting. Conventio- nally there is a single canvas onto which the artist must put all
the work.
14
[Link] Description
1. Problem Definition:
The project consists of developing and implementing a computer program that plays
TIC TAC TOE against another player. This developed system will reduce the
manual work that is for playing a game you've not to carry a pen or a pencil and a
few sheets of papers on your pocket all the time. The system can able to provide
hundreds or thousands of TIC TAC TOE game without any interruption.
2. Overview Of The Project:
This project is divided into several modules and all the modules are appearing in
one class. These modules are called from the main module located at the root of the
project. All the modules have different as well as vital functionalities in order to
develop the right product These modules are designed in such a way that they reflect
a highly cohesiveness.
3. Module Description:
➢ Initialization:
In the main class we've created a constructor which will hold all the tkinter
widgets that we are using in our program. First of all, we've used a highly
versatile widget called canvas to draw graphs and plots on our root window.
We set the background colour as white. Now we want to realize the effects that
we are made in our root window. For that we have to use the pack geometry
manager. Then we've called the bind function, which is actually used to interact
the GUI widget with our computer program. In the bind function we've passed
two objects namely '<x>', [Link]. The later one is used to exit from the root
window In the root window there should be three options displaying at the top
level. The minimize button (-), the maximize button() and the close button (X).
Now whenever the user clicks on the X button the bind function should capture
that and accordingly the root window will destroy that means it could not be
13
displayed any more. Then we set our game state to zero (0) and call the
title_screen module. After that we create a list with nine strings and initiate each
of them with a value zero (0) and store it in a variable called board.
14
6. Data Flow Diagram
13
7. Use Case Diagram
14
8. Program
Input:
import random
def draw_board(board):
print("---------")
for i in range(3):
print("|", end=" ")
for j in range(3):
print(board[i * 3 + j], end=" | ")
print("\n---------")
def is_winner(board, player):
win_conditions = [
[0, 1, 2], [3, 4, 5], [6, 7, 8], # Rows
[0, 3, 6], [1, 4, 7], [2, 5, 8], # Columns
[0, 4, 8], [2, 4, 6] # Diagonals
]
for condition in win_conditions:
if board[condition[0]] == board[condition[1]] == board[condition[2]] == player:
return True
return False
def is_board_full(board):
return all(cell != " " for cell in board)
def get_empty_cells(board):
return [i for i, cell in enumerate(board) if cell == " "]
def make_player_move(board):
13
while True:
move = int(input("Enter your move (0-8): "))
if 0 <= move <= 8 and board[move] == " ":
return move
print("Invalid move. Please try again.")
def make_ai_move(board):
empty_cells = get_empty_cells(board)
return [Link](empty_cells)
def play_game():
board = [" "] * 9
current_player = "X"
while True:
draw_board(board)
if current_player == "X":
move = make_player_move(board)
else:
move = make_ai_move(board)
print("AI's move:", move)
board[move] = current_player
if is_winner(board, current_player):
draw_board(board)
print(current_player + " wins!")
break
elif is_board_full(board):
draw_board(board)
print("It's a tie!")
14
break
current_player = "O" if current_player == "X" else "X"
play_game()
Output:
13
10. Conclusion
Overall, the Tic Tac Toe project provided valuable hands-on experience in software
development using Python. It not only reinforced fundamental programming concepts
but also fostered creativity and problem-solving skills. By continuously refining and
expanding upon this project, further growth and learning opportunities can be realized
in the field of software development.
14
11. References
• [Link]
[Link]
• [Link]
• [Link]
13