You are on page 1of 12

TIC-TAC-TOE

GAME ON
PYTHON

• Submitted to : Vandana pal


• Submitted by : Gaurav sharma
ACKNOWLEDGMENT

We are very grateful to our teachers and professors who gave us a chance to work on his presentation.
We would like to thank him for giving us valuable suggestions and ideas.
We would also like to thankful our college for providing us all the necessary resources for the
presentation. All in all, we would to thank everyone involved in this project and helped us with their
suggestions to make the presentation better.
Finally, we would like to thank our parents and friends for always being with us and supporting us in
every situation.
Name- Vandana Pal
Roll no.-1728213057
INTRODUCTION
TiC-TAC-TOE is a very popular game, so let’s implement an
automatic tic-tac-toe game using python.
Python is a high-level, interpreted and general purpose dynamic
programming language that focuses on code readability.The python is
widely used in bigger organizations because of its multiprogramming
paradigm.
Our presentation is to implement the TIC-TAC-TOE game which will
features like single player and two players modes. In single player
modes we have used game theory logics like minimax algorithms to
determine the best move that the computer plays.
OBJECTIVES
TIC-TAC-TOE game is an very easy game which is mostly played among
children and to also helps them to improve their concentration.
The objective of this TiC-TAC-TOE game python project is to build a tic-tac-
toe game so you can play it without wasting paper and improve your
concentration To build this gamewe use the thinker module with concept of
python.
To play this game we require two players to play one is X and the other is O and
the both players play by putting their marks in empty squares.
To win the gamesplayers have to get 3 of her marks in a row (up, down, across
or diagonally).
RULES

Traditionally the first player plays with “X”. So you can decide who wants to go with “X” and
who wants to go with “O”.

Only one player can play at a time.

If any of the players have filled a square then the other player and the same player cannot
override that square.

There are only two conditions that may match will be draw or may win.
• The player that succeeds in placing three respective marks (X or O) in a horizontal, vertical, or
diagonal row wins the game.
MODULAR DESCRIPTION
Following are the modules that are essential to implement the TIC-TAC-TOE game in python:
Initialization
In your Python 3 IDLE click File and create a New File.
Start by saving your file and calling it py
• Now run your code, just click RUN (or press F5 on the keyboard)
Newboard: To play TIC TAC TOE, we are going to need to print out the game board grid that consists of three rows, and the columns. With the function create_line the
grid can be printed on the screen.
Player’s name: It is important to save the name of the two players. For this, store each name in a variable. Use input to get each player’s name and store them in
variables.
New move: When we start the game only a 3x3 square grid will be displayed. It will receive the current player and the input of X and O from the keyboard.
Ask the player what symbol they want, using input.
Save it in variable input_symbol.
Draw X: This module is all about drawing X on the grid. So, for this, we have to write code in create_line package. The grid co-ordinates have change into a pixel, and
then have to adjust X in the board.
Draw O: This module is all about drawing O on the grid. So, for this, we have to write code in create_line package. The grid co-ordinates have change into a pixel, and
then have to adjust O in the board.
Game over screen: This module displays the result according to the outcome on the screen. If the outcome is on side of the player with symbol X, then, “X Wins”
appear on the screen in the form of text.
If the outcome is on the side of the player with symbol O, then, “O Wins” appear on the screen.
Has won: It’s all about checking the winner and sharing the result in on the screen. The result is checked by using Has_won function in python3 library.
No win: In this module, it will check that the result is a tie or not. The result is a draw when blank spaces in the grid are all filled, and there is no win It will print “draw
match” on the screen.
REQUIREMENT SPECIFICATIONS

Hardware requirement
Processor- intel core i3 or above
HARD DISK- 128GB
Memory-1GB RAM
Software requirement
Front end: python 3
Back end: python 3.6.0 interpreter
Graphical user interface(GUI) toolkit
PROJECT IMPLEMENTATION

After initializing this game, a 3x3 a hash shape square board grid will pop up in the screen of the user.

The game will be played between Computer & the human player.

One of the players has to choose, ‘O’ and the other, ‘X’ to mark their respective cells.

The player will have to input a numerical character, from 1 to 9, to select a position for X or O into the space they
For example: if they are playing with O and input 2, the O will go to the first row – the second column. If the player
wants to place O in the third row – first column, then they have to enter 7. And, it is similar for the other positions.

The game starts with one of the players and the game ends when one of the players has one whole row/ column/
diagonal filled with his/her respective character (‘O’ or ‘X’).
• If the blank spaces in the grid are all filled, and there is no winner, then the game is said to be a draw.
FEATURES

• Single player
• Multi playey
• Background music
• Different themes
FUTURE SCOPE & ENHANCEMENT

Our project will be able to implement in future after making some


changes andmodifications as we make our project at a very low level. So the
modifications that canbe done in our project are:In future one change can be
done by adding the fingerprints of the persons of which theaddress is
entered.And one more major change which can be done in this project is that
toadd the snaps of the person of which the address is entered.We can also add
or subtractdetails of the individual
CONCLUSION

Tic-tac-toe game is most familiar among all the age groups. Intelligence can
be a property of any purpose-driven decision maker. This basic idea has been
suggested many times. An algorithm of playing tic-tac-toe has been presented
and tested that works in efficient way. Overall the system works without any
bugs.
Thank
You

You might also like