A Project Report ON: Department of Computer Engineering

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

A

PROJECT REPORT
ON
TIC TAC TOE GAME
Submitted in the partial fulfilment of the requirements for the award of diploma in Engg.
PROGRAMMING WITH PYTHON(22616)

SUBMITTED BY

Prathamesh Thakur 1911450032


Prathamesh Indre 1911450033
Chinmay Thakur 1911450035

UNDER THE GUIDANCE OF


PROF. ASMITA PATIL
SUBMITED TO
Maharashtra State Board of Technical Education
&
Department of Computer Engineering
BHARTIYA EDUCATION/SOCIAL CHARITABLE TRUSTS SHETH SHREE OTARMAL
SHESHMAL PARMAR COLLEGE OF DIPLOMA ENGINEERING
AT/POST: - NAGOTAHNE (VELSHET)-402106, TAL:-ROHA, DIST:-RAIGAD (M.S.) INDIA
Academic Year 2021-22
CERTIFICATE

This is to certify that the project entirely on TIC TAC TOE GAME materials submitted Mr.
Prathamesh Thakur, Mr. Prathamesh Indre, Mr. Chinmay Thakur S.S.O.S.P. College of Diploma
Engineering, Nagothane, (Third year department of Computer Engineering for the year 2021-22)
in partial fulfilment for the Diploma in Engineering, is his/her own work carried out under my
guidance and is worthy of examination.

I further certify that this work has not been submitted to any other college for the purpose of
degree or diploma.

Date: Place: Nagothane

Prof. Asmita Patil Prof. Asmita Patil Prof . Pravin Bharti


(Project Guide) (H.O.D) (Principal)
ACKNOWLEDGMENT

We wish to express my deepest and most sincere gratitude to my Guide Prof. Asmita Patil
her exemplary guidance, encouragement and support throughout the study. The confidence reposed
by her has helped me to develop positive orientation towards project. It has been the most
rewarding experience to undertake this project under her.
We further wish to express my sincere thanks to all faculty members, support staff of
S.S.O.S.P College of Diploma Engineering, Velshet, Nagothane –Roha and all my colleagues for
providing moral support throughout the project work.
We would like to express thanks to concerned authority of central library of the college for
providing us with the various literature materials required for our project work.
Finally, before ending, we would like to express our true gratitude to all those involved directly or
indirectly in our project.

Your’s Sincerely,
Prathamesh Thakur 1911450032
Prathamesh Indre 1911450033
Chinmay Thakur 1911450035
PREFACE
We the student of Third Year Computer Engineering (S.S.O.S.P. COLLEGE OF
DIPLOMA ENGINEERING) have a great pleasure in presenting our report on our project on Tic
Tac Toe.
Consistent with the level of presentation every effort has been made to ensure that the
material included in the report is state of art and in the current expectation of the direct of future
development.

This report has covered as much as it could and especially all the important points about our
project. The Information in this report is accurate and great care has been taken about the face and
figures mentioned in this report.

All the information that could be brought before you has been provided in this report. The synopsis
has been a joint effort of all members of our group and I am thanking full to them for their co-
operation.
TIC TAC TOE GAME
1.0 Brief Information

This project of “TIC TAC TOE GAME” reminds us those old days and memories. So
we have built this game to revive those memories through simple python programming.
This game is displayed in 3 by 3 format. User needs to put the input in rows and
column format. The goal of Tic-Tac-Toe is to be one of the players to get three same
symbols in a row - horizontally, vertically or diagonally - on a 3 x 3 grid. And at last
the winner is declared. This project may seems to be hard, but reminds us of old days
and can be implemented anywhere.
2.0 Aim of this Micro-Project
1. To develop a project titled “TIC TAC TOE GAME”.

3.0 Action Plan

S. Details of activity Planned start Planned Name of responsible


No. date Finish date team members

1. To study to different 2/4/22 4/4/22 Prathamesh Thakur


programs related to tic
tac toe
2. Installation of ide and 5/4/22 6/4/22 Chinmay Thakur
libraries
3. To perform program 7/4/22 17/4/22 Prathamesh indre
code.
4. To make report. 28/4/22 21/4/22 Chinmay thakur

4.0 Resource Required


S. Name of Specifications Quantity
No. Resource/material
1. MS Word Office 1
2. Visual Studio, PC, Online V1.67.1, 8GB RAM, 1TB, i5 1
Compiler 8th gen, Programmiz compiler
3. Browser Brave 1

Names of team members


Prathamesh Thakur
Prathamesh Indre
Chinmay Thakur
TIC TAC TOE GAME
1.0 Brief Information
This project of “TIC TAC TOE GAME” reminds us those old days and memories. So we have
built this game to revive those memories through simple python programming. This game is
displayed in 3 by 3 format. User needs to put the input in rows and column format. The goal of
Tic-Tac-Toe is to be one of the players to get three same symbols in a row - horizontally,
vertically or diagonally - on a 3 x 3 grid. And at last the winner is declared. This project may
seems to be hard, but reminds us of old days and can be implemented anywhere.

2.0 Aim of this Micro-Project

1. To develop a project titled “TIC TAC TOE”.

3.0 Course Outcomes Integrated


1. Use libraries to run certain block of codes.
2. Conditional statements of python.
3. User inputs in row and column format.
4. Display which user won.
5. Input is displaed in the form of ‘X’ and ‘0’.

4.0 Actual Methodology:

1. We have studied different programs of tic tac toe.


2. Used different conditional statements.
3. Python basic libraries are used.
4. Ran on different IDEs and interpreters.
5. Made a proper report.
5.0 Resource Required
S. Name of Specifications Quantity
No. Resource/material
1. MS Word Office 1
2. Visual Studio, PC, online V1.67.1, 8GB RAM, 1TB, i5 1
compiler 8th gen, GTX 1050Ti,
programmiz compiler
3. Browser Brave 1

6.0 Output of this Micro-Project


Source Code-
import random
class TicTacToe:
def __init__(self):
self.board = []
def create_board(self):
for i in range(3):
row = []
for j in range(3):
row.append('-')
self.board.append(row)
def get_random_first_player(self):
return random.randint(0, 1
def fix_spot(self, row, col, player):
self.board[row][col] = player
def is_player_win(self, player):
win = None
n = len(self.board)
# checking rows
for i in range(n):
win = True
for j in range(n):
if self.board[i][j] != player:
win = False
break
if win:
return win
# checking columns
for i in range(n):
win = True
for j in range(n):
if self.board[j][i] != player:
win = False
break
if win:
return win
# checking diagonals
win = True
for i in range(n):
if self.board[i][i] != player:
win = False
break
if win:
return win

win = True
for i in range(n):
if self.board[i][n - 1 - i] != player:
win = False
break
if win:
return win
return False

for row in self.board:


for item in row:
if item == '-':
return False
return True
def is_board_filled(self):
for row in self.board:
for item in row:
if item == '-':
return False
return True

def swap_player_turn(self, player):


return 'X' if player == 'O' else 'O'

def show_board(self):
for row in self.board:
for item in row:
print(item, end=" ")
print()

def start(self):
self.create_board()

player = 'X' if self.get_random_first_player() == 1 else 'O'


while True:
print(f"Player {player} turn")

self.show_board()

# taking user input


row, col = list(
map(int, input("Enter row and column numbers to fix spot: ").split()))
print()

# fixing the spot


self.fix_spot(row - 1, col - 1, player)

# checking whether current player is won or not


if self.is_player_win(player):
print(f"Player {player} wins the game!")
break

# checking whether the game is draw or not


if self.is_board_filled():
print("Match Draw!")
break

# swapping the turn


player = self.swap_player_turn(player)

# showing the final view of board


print()
self.show_board()
# starting the game
tic_tac_toe = TicTacToe()

tic_tac_toe.start()

Output-
7.0 Skilled Developed/Learning outcome of this Micro-Project:
We learn how to work as a team and how to distribute work under team. Sharing of
ideas and also sharing of knowledge under team. We have learn to create forms and
implement the program code for their operations. We have learn to perform conditional
statements, libraries, etc.

You might also like