You are on page 1of 8

TIC TAC TOE GAME

Submitted by

R.MUTHUKUMARAN RA2211030020155
R.UKESH SHARMA RA2211030020183
S.LOKESH RA2211030020187
V.AKILESH RA2211030020188

Under the guidance of


Dr. Sri Devi
(Assistant Professors, Department of Computer Science and Engineering)
In partial fulfillment for the award of the degree
of

BACHELOR OF TECHNOLOGY
in

COMPUTER SCIENCE AND ENGINEERING


of

COLLEGE OF ENGINEERING AND TECHNOLOGY

RAMAPURAM , CHENNAI-600089

OCTOBER 2023

1
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

(Deemed to be University Under Section 3 of UGC Act, 1956)

BONAFIDE CERTIFICATE

Certified that the Mini Project titled “Project title Tic-Tac-Toe” is the bonafide
certificate of Team Members Name and Reg no R.MUTHUKUMARAN
RA2211030020155, R.UKESH SHARMA RA2211030020183, S.LOKESH
RA2211030020187, V.AKILESH RA2211030020188 of II Year CSE/Specialization
submitted for the course 21CSC201J Data Structures and Algorithms for the Academic
Year 2023 – 24 Odd Semester.

SIGNATURE
Staff Name
Assistant Professor
Computer Science & Engineering
SRM Institute of Science and Technology
Ramapuram, Chennai.

2
Scope:
New game modes: You could develop new game modes, such as a four-player mode, a
cooperative mode, or a mode where players can choose different board sizes.

New challenges: You could add new challenges to the game, such as time limits, move
limits, or special pieces with unique abilities.

New AI opponents: You could develop new AI opponents that are more challenging and
unpredictable.

New themes and graphics: You could create Tic Tac Toe games with different themes and
graphics, such as a space-themed game, a fantasy-themed game, or a game with custom
characters and pieces.

Educational Tic Tac Toe games: You could develop Tic Tac Toe games that are designed to
be educational, such as games that teach players about math, science, or history.

Objective:
To create a fun and engaging game for people of all ages and skill levels. Tic Tac Toe is a
classic game that is easy to learn but difficult to master, making it a great choice for a
game that can be enjoyed by everyone.

To develop programming skills. Developing a Tic Tac Toe game is a great way to learn the
basics of programming, such as game logic, user input, and output.

To experiment with new game mechanics and ideas. Tic Tac Toe is a simple game, but it
can be used as a platform to experiment with new game mechanics and ideas. For
example, you could develop a Tic Tac Toe game with a new board size, new pieces, or new
rules.

To create a game that is educational or educational. Tic Tac Toe can be used to teach
players about a variety of topics, such as math, science, and history. You could develop a
Tic Tac Toe game that is specifically designed for educational purposes.

Problem Statement:
Accessibility: The game should be playable on a variety of platforms, including mobile
devices, computers, and consoles. It should also be accessible to people with disabilities,
such as by providing colorblind-friendly options and text-to-speech support.

3
Localization: The game should be available in multiple languages, making it accessible to a
wider audience.

Game modes: The game should include a variety of game modes, such as single-player,
multiplayer, and online play. This will give players more options for how they want to play
the game.

Educational content: The game could be designed to be educational or informative. This


could be done by incorporating educational content into the game, such as math problems
or science facts.

Social impact: The game could be designed to have a positive social impact. This could be
done by supporting a charitable cause or promoting a particular social message.

Fun and engaging: The game should be fun and engaging for players of all ages and skill
levels. This means that the game should be easy to learn but difficult to master. It should
also be challenging and rewarding for players to win.

Well-designed and implemented: The game should be well-designed and implemented.


This means that the game should be easy to play and control. It should also be visually
appealing and free of bugs and errors.

Problem description:
Balancing difficulty: Tic Tac Toe is a relatively simple game, so it can be challenging to
make it difficult enough to be engaging for experienced players. However, you also need
to make sure that the game is easy enough for beginners to learn and enjoy.

Creating a variety of gameplay: Tic Tac Toe is a turn-based game, so it can be challenging
to create a variety of gameplay experiences. You can address this challenge by adding new
game modes, such as a four-player mode, a cooperative mode, or a mode where players
can choose different board sizes. You can also add new challenges to the game, such as
time limits, move limits, or special pieces with unique abilities.

Developing a challenging AI opponent: If you are developing a single-player mode for your
game, you will need to develop a challenging AI opponent. This can be difficult, as Tic Tac
Toe is a relatively simple game. However, there are a number of strategies that you can use
to create a more challenging AI opponent, such as using minimax algorithms or machine
learning.

Making the game accessible: It is important to make sure that your game is accessible to
people of all ages and skill levels. This means providing options for colorblind players and
text-to-speech support for players with visual impairments. You should also make sure that
the game controls are simple and easy to use.

Unique and innovative: Your game should be unique and innovative in some way. What
4
new features or gameplay mechanics will you add to the classic Tic Tac Toe formula

Coding:
def enter(i,j,player,board):
if not board[i][j]:
board[i][j] = player
return True
else:
print("invalid input")
return False

def win(board):
for i in range(3):
if board[i][0] == board[i][1] == board[i][2] != '':
return board[i][0]
if board[0][i] == board[1][i] == board[2][i] != '':
return board[0][i]
if board[0][0] == board[1][1] == board[2][2] != '':
return board[0][0]
if board[2][0] == board[1][1] == board[0][2] != '':
return board[2][0]

def show(board):
for i in range(3):
print("|",end="")
for j in range(3):
print(board[i][j],"|",end="")
print("\n")

board = []
for i in range(3):
x = []
for j in range(3):
x.append('')
board.append(x)
c=9
while True:
if c>0:
a = input("enter position:\n")
5
i = int(a[0])-1
j = int(a[1])-1

if c%2!=0:
player = 'X'
else:
player = 'O'
if enter(i, j, player, board):
c -= 1
else:
print("Try Again")
show(board)
winner = win(board)
if winner:
print(winner,"is winner")
break
else:
print("draw")
break
Output:

6
7
8

You might also like