Exemple #1
0
import time, uagui

# Main Program.openWindow('Remember the Word', 900, 700)
uagui.setFontSize(50)
uagui.drawString('Welcome to the Remember game.')
uagui.drawString('I will show you a series of words.')
uagui.drawString('After showing these words,')
uagui.drawString('I will ask you which one started with a ')
uagui.drawString('particular letter and you should tell me.')
uagui.drawString('You win if you pick the right word.')
uagui.drawString('Otherwise you lose the game.')

uagui.inputString('Press the enter key to continue')
uagui.clearWindow()
uagui.movePen()

# Display the words
uagui.drawString('orange')
time.sleep(2.5)
uagui.clearWindow()
uagui.movePen()
uagui.drawString('chair')
time.sleep(2.5)
uagui.clearWindow()
uagui.movePen()
uagui.drawString('mouse')
time.sleep(2.5)
uagui.clearWindow()
uagui.movePen()
uagui.drawString('sandwich')
def getPlayerAnswer() :
   playerAnswer = uagui.inputString('What word began with the letter c?')
   uagui.clearWindow()
   uagui.movePen()
   return playerAnswer