Professional Documents
Culture Documents
Group 2 Project File
Group 2 Project File
modules import
tkinter import
random
# list of poss ible colour .
colours = [ ' Red ' , ' BLue ' , ' G reen' , ' P1nk' , Black ' ,
' YeLlow , ' 0r ange ' , White' , ' Brown ' ]
s core 0
# the gave
time left, initially *0 seconds.
timeleft = ?
0
if timeleft == 30:
# st ar I t he count down tżizer .
countdown()
# choose
run thethe next colour.
function to
nextColour()
the
i the colour typed is
t colour equal
if e . get( ) . Lowe r ( ) == colours [1 ] . lower ( ):
s core 1
# clear the
e . de î e te( text entry box.
0, tkinter.END)
global timeleft
# if a i s in play
game if 0:
timeleft
# dec recent the t over .
timeleft -= 1
# update the time left label
tkinter
timeLabel.config(text = "Time left:
sI r( Use le it ) )
# run the func t1on aga in after 1 secon
t iueL abel . a fter ( 1 000, countdown
)
# Dr we r Code