Project 2
Project 2
PROJECT REPORT ON
“TIC-TAC-TOE GAME”
CERTIFICATE
This is to certify that Cadet Roll
No. has successfully completed the
project Work entitled "TIC-TAC-TOE GAME." in the
subject INFORMATICS PRACTICES (065) laid down in
the regulations of CBSE for the purpose of Practical
Examination
TABLE OF CONTENTS [ T O C]
TABN
01 ACKNOWLEDGEMENT 04
02 INTRODUCTION 05
04 PROPOSED SYSTEM 06
07 FLOW CHART 09
08 SOURCE CODE 15
09 OUTPUT 20
10 TESTING 21
ACKNOWLEDGEMENT
Apart from the efforts of me, the success of any project depends largely
on the encouragement and guidelines of many others. I take this opportunity
to express my gratitude to the people who have been instrumental in the
successful completion of this project.
The guidance and support received from all the members who contributed
and who are contributing to this project, was vital for the success of the project.
I am grateful for their Constant support and help.
INTRODUCTION
PROPOSED SYSTEM
Today one afford to rely on the fallible human beings of be
really wants to stand against today's merciless competition where
not to wise saying "to err is human" no longer valid, it's outdated to
rationalize your mistake So, to keep pace with time, to bring about
the best result without malfunctioning and greater efficiency so to
replace the unending heaps of ties with a much sophisticated hard
disk of the computer.
This prevents a lot of time and money. The work becomes fully
automated and any information regarding the organization can be
obtained by clicking the button. Moreover, now it's an age of
computers of and automating such an organization gives the better
look
INITIATION PHASE
PLANNING PHASE
DEVELOPMENT PHASE
IMPLEMENTATION PHASE
This phase is initiated after the system has been tested and
accepted by the user. In this phase, the system is installed to support
the intended business functions. System performance is compared to
performance objectives established during the planning phase
Implementation includes user notification, user training, installation
of hardware, installation of software onto production computers, and
integration of the system into daily work processes. This phase
continues until the system is operating in production in accordance
with the defined user requirements.
SOURCE CODE
CLOCK = pg.time.Clock()
screen = pg.display.set_mode((width, height+100),0,32)
pg.display.set_caption("Tic Tac Toe by sachin kumar")
opening = pg.image.load('imgs\\tic tac opening.png')
x_img = pg.image.load('imgs\m_x.png')
o_img = pg.image.load('imgs\m_o.png')
x_img = pg.transform.scale(x_img, (80,80))
o_img = pg.transform.scale(o_img, (80,80))
opening = pg.transform.scale(opening, (width, height+100))
def game_opening():
screen.blit(opening,(0,0))
pg.display.update()
time.sleep(1)
screen.fill(white)
# Drawing vertical lines
pg.draw.line(screen,line_color,(width/3,0),(width/3, height),7)
pg.draw.line(screen,line_color,(width/3*2,0),(width/3*2,
height),7)
# Drawing horizontal lines
pg.draw.line(screen,line_color,(0,height/3),(width, height/3),7)
pg.draw.line(screen,line_color,(0,height/3*2),(width,
height/3*2),7)
draw_status()
def draw_status():
global draw
if winner is None:
message = XO.upper() + "'s Turn"
else:
message = winner.upper() + " won!"
if draw:
message = 'Game Draw!'
font = pg.font.Font(None, 30)
text = font.render(message, 1, (255, 255, 255))
# copy the rendered message onto the board
screen.fill ((0, 0, 0), (0, 400, 500, 100))
elif(x<width):
col = 3
else:
col = None
#get row of mouse click (1-3)
if(y<height/3):
row = 1
elif (y<height/3*2):
row = 2
elif(y<height):
row = 3
else:
row = None
#print(row,col)
if(row and col and TTT[row-1][col-1] is None):
global XO
#draw the x or o on screen
drawXO(row,col)
check_win()
def reset_game():
global TTT, winner,XO, draw
time.sleep(3)
XO = 'x'
draw = False
game_opening()
winner=None
TTT = [[None]*3,[None]*3,[None]*3]
game_opening()
# run the game loop forever
while(True):
for event in pg.event.get():
if event.type == QUIT:
pg.quit()
sys.exit()
elif event.type == MOUSEBUTTONDOWN:
OUTPUT
TESTING
TESTING METHODS
Software testing methods are traditionally divided into black
box testing and white box testing. These two approaches are used to
describe the point of view that a test engineer takes when designing
test cases.
SPECIFICATION-BASED TESTING
provided to the tester, who they set that for a given input. The output
value (or behaviour), either RUUPE value specified in the test case.
Specification-based testing is necessary, but it is insufficient toguard
against certain risks
That's why there are situations when (1) a black box tester writes
many test cases to check something that can be tested by onlyone test
case, and/or (2) some parts of the back end are not tested at all.
Therefore, black box testing has the advantage of "an unaffiliated
opinion," on the one hand, and the disadvantage of "blind exploring,"
on the other.
For example, the test designer can create tests to cause all
statements in the program to be executed at least once
fault injection methods
Mutation testing methods.
Static testing - White box testing includes all static testing.
SOFTWARE REQUIREMENTS:-
1. Windows OS
2. Python
BIBLIOGRAPHY
1. Computer science With Python Class XI and XII By: Sumita Arora
2. Computer science With Python Class XI and XII By: Preeti Arora
3. Website: https://www.gbsss.in/ , http://tgtpgtcs.com/
4. PROJECT GUIDE: SACHIN SIR LECTURER COMPUTER SCIENCE