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

1.

INTRODUCTION

One of the most universally played childhood games is TIC TAC TOE. An
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,
player1 (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 X s and O s 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 O s 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.


1. PROJECT DESCRIPTION

 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.

 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 different points
regarding this project.
result
Player 1 Player 2
Modules
Modules breaks the project into kind of various mini projects so that
work can be distributed among the team members. This modules
helps us to analyze the project more efficiently and also accomplish
the task easily within time. Based on our project “ tic tak toe” we
have divided our project following modules.

Initialization &TITLE SCREEN: we are using canvas supported standard


item called create_text that will enable us to create informative text on the
screen. like, the title of the game should be TIC TAC TOE and just below to
that another text that will be appearing is Click to play.

NEW BOARD: The main objective of this module is to create a new board
that consists of three rows and the columns. The board is nothing but a 2
Dimensional three by three matrix and we’ll create the matrix by using list of
strings.
GAMEOVER SCREEN: This module is concerned with displaying the result
according to the outcome on the screen. It takes outcome as an object and displays
the appropriate result.

CLICK: This module handles most of the game logic. A tkinter application
runs most of its time inside an event loop, which is entered via the main loop
method

NEW MOVE:
This module is concerned with pacing the X’s and O’s in the selected cells on the board. It
receives the current player

HAS WON:
This module is concerned with checking for the winner and returns the result to an
appropriate calling function. In the click module, we’ve already converted the grids
into pixels and store them into some variables.

IS A DRAW:
In this module, we’re just checking the result is a tie or not. The result is a tie when all
the boxes/cells are filled. Checking whether it is a draw is fairly straightforward.

EXIT:
This module is used for closing the root window permanently. In this
module we’ve passed event as an argument based upon this event the
window can be closed.

We want the access from the current instance in our exit ()


method which is done through self.

self.destroy()
Functionalities
The purpose of this functionalities 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. Some
functionalities used for this project are

 creating functions:
Can define functions of your own
Functions let you to break up code into manageable
chunks.
Eg new_move(), move(), exit().

 Defining a Function:
Functions make programs easier to read, write and
maintain.
Function definition: Code that defines what a new
function does.
Function header: First line of a function definition
Give function name that conveys what it does or
produces
Eg def title_screen():
print "Welcome to the world's greatest game!"

 Documenting a Function:
Docstring: String that documents a function
Eg: def exit():
"""Display game instructions."""
print "Are you sure of leaving this game"

 Calling a Programmer-Created Function:


New_game()
Call tells the computer to execute function
New_game()
Call works just like call to built-in function
Tells the computer to execute previously-defined
function.

All the modules will be used in the form of


functionalities like screen_title(), new_game(), won(),
draw(), exit(). When project is being built and these
functionalities are inter related in a project like “ tik tak
toe”.

You might also like