You are on page 1of 9

Maharashtra State Board of Technical Education

Government Polytechnic College,


Murtizapur

Academic Year
2023-24

A Micro Project Report On


“Tic-Tac-Toe Game”
In Subject Programing with Python

Department of Computer Engineering

Submitted by:-

Roll no. Name Enrollment no.


59 Darshan S. Navlakha 2012410140
60 Atharv V. Rane 2012410150
69 Kamesh S. Nemade 2112410094
71 Vishal S. Pasarate 2112410097

Under the Guidance of


Mr. Amol Kulkarni Sir
Maharashtra State
Board of Technical Education

Certificate

This is to certify that Mr. _____________________________________ Roll No-


__________ has successfully completed Micro-project in course Programming
With Python (22616) for the academic year 2023-24 as prescribed in the
'Assessment Manual' during his/her tenure of completing Six Semester of Diploma
in Computer Engineering from institute, Government Polytechnic, Murtizapur
with institute code 1241.

Place: Murtizapur Enrollment No:

Date: Exam Seat No:

Course Teacher Head of the Department Principal


Annexure – I

Micro Project Proposal


“Tic-Tac-Toe Game”
● Aims/Benefits of the Micro-Project:
1. To develop an interesting game for children to pass their free time.
2. To develop the well-known board game Tic-Tac-Toe for two players.
3. To be one of the players to get three same symbols in a row – horizontally,
vertically or diagonally on a 3 x 3 grid.

● Course Outcomes Addressed:


1. Display message on screen using Python script on IDE.
2. Develop python program to demonstrate use of Operators.
3. Perform operations on data structures in Python.
4. Develop functions for given problems.

Software Requirements
The software used for the development of the project is:

● Operating system : Windows 11


● Programming Language : Python
● IDLE, py coding
● Microsoft Word

● Action Plan:

Sr Details of Activity Planned Planned Name of Responsible Team


No Start Date Finish Date Members

1 Decide project topic


2 Decide features of project Darshan S. Navlakha
3 Prepare project proposal Atharv V. Rane
4 Decide different data structures Kamesh S. Nemade
5 Develop actual program code Vishal S. Pasarate
6 Debug the program code
7 Preparing final project report

● Resources Required:
Name of Resource Specification Qty. Remarks

Hardware Resource Desktop with Intel 1 -


Core 2 Duo 2.93
GHz, RAM 8GB, HDD 160
GB
Software Resource IDLE, py coding 1 -
Any Other Resource Microsoft Word 1 -

Name of Team Members with Roll Nos:

Roll No Name of Team Members

59 Darshan S. Navlakha
60 Atharv V. Rane
69 Kamesh S. Nemade
71 Vishal S. Pasarate

Annexure – II

Micro Project Report


1.0 Rationale:
The objective of this project is to develop the well-known board game Tic-Tac Toe for
two players. Generally, this is a two-player strategy board game. The Tic-Tac-Toe game
is based on having a game board (2D array) of size 3 x 3. The players alternate placing
Xs and Os on the board until either one has placed three Xs or Os in a row horizontally,
vertically, or diagonally; or all nine board squares are filled. The player wins if s/he
draws three Xs or three Os in a row. Otherwise, the game is draw. Initially the board grid
squares are initialized to zeros. Xs and Os might be denoted by numbers inside the board
grid by ones and twos respectively. I.e. if player one chooses X, the location of that
choice is registered as 1 and when player two chooses O the location of that choice in
your array is registered as 2. At the end if a row of 1s is registered then player one won
the game. Or if a row of 2s is registered thus player two won the game. If not, the game is
draw. The game ends when there is no more empty fields in the array (board) to fill or if
one of the players wins the game.

2.0 Aims/Benefits of the Micro-Project:

1. To develop an interesting game for children to pass their free time.


2. To develop the well-known board game Tic-Tac-Toe for two players.
3. To be one of the players to get three same symbols in a row – horizontally, vertically
or diagonally on a 3 x 3 grid.

3.0 Course Outcomes Achieved:

1. Display message on screen using Python script on IDE.


2. Develop python program to demonstrate use of Operators.
3. Perform operations on data structures in Python.
4. Develop functions for given problems.

4.0 Literature Review:

Author(Publication) Abstract Conclusion


Kalyani Adawadkar This paper describes the main We used this paper to learn
(Sigma Institute of features and applications of different features available in
Engineering) Python Programming Python and its applications.
David Beazley This book contains a We used this book to learn the
(Sams Publishing) complete learning of Python basic concepts of Python
Programming Programming
Tom Gutschmidt This book covers game We used this book to learn how
(Premier Press) programming in three to build efficient, flexible and
different scripting languages well integrated programs and
i.e, Python, Lua and Ruby systems

5.0 Actual Methodology Followed:


Code:

theBoard = {'1': ' ' , '2': ' ' , '3': ' ' ,
'4': ' ' , '5': ' ' , '6': ' ' ,
'7': ' ' , '8': ' ' , '9': ' ' }

board_keys = []

for key in theBoard:


board_keys.append(key)

def printBoard(board):
print("\n")
print(' '+board['1'] + ' | ' + board['2'] + ' | ' + board['3'])
print(' ---+---+---')
print(' '+board['4'] + ' | ' + board['5'] + ' | ' + board['6'])
print(' ---+---+---')
print(' '+board['7'] + ' | ' + board['8'] + ' | ' + board['9'])
print("\n")

# Now we'll write the main function which has all the gameplay functionality.
def game():
turn = 'X'
count = 0

for i in range(10):
printBoard(theBoard)
move=input("It's your turn," + turn + ". Move to which place? ")

if theBoard[move] == ' ':


theBoard[move] = turn
count += 1
else:
print("THAT PLACE IS ALREADY FILLED.\nMove to which place?")
continue

# Now we will check if player X or O has won,for every move after 5 moves.
if count >= 5:
if theBoard['1'] == theBoard['2'] == theBoard['3'] != ' ': # across the top
printBoard(theBoard)
print("\nGAME OVER.\n\n")
print(" ****** CONGRATULATIONS! " +turn + " YOU WON THE GAME
******\n\n")
break
# Check other winning conditions...

# Check for a tie


if count == 9:
print("\nGAME OVER.\n\n")
print("*** IT'S A TIE!! ***\n\n")
break

# Change player turn


if turn =='X':
turn = 'O'
else:
turn = 'X'

# Ask if player wants to restart the game


restart = input("Do you want to play Again?(y/n)")
if restart == "y" or restart == "Y":
for key in board_keys:
theBoard[key] = " "
game() # restart the game

# Start the game


game()

6.0 Actual Resources Used:

The resources used during the completion of project are mentioned in the below

Sr Name of Specification Qty. Remarks


No Resource/Material

1 Hardware Resource Laptop with Intel 1 -


Core i5, RAM 8GB,
HDD 500 GB
2 Software Resource IDLE 1 -

3 Any Other Resource Microsoft Word - -

7.0 Outputs of Micro-Project:


8.0 Skilled Developed/Learning Outcome of this Micro-Project:

We learnt,
1. To demonstrate the use of Operators.
2. To perform operations on data structures in Python.
3. To develop functions for given problems.
4. Efficient communication skills.
5. Working as a team member for developing c program.
6. Developing leadership qualities.

9.0 Application of this Micro-Project:

1. This project can be used as an interesting game for children to pass their free time.
2. The project can be also used to understand.
3. The project can be used in learning.

You might also like