Facebook
From Algo, 1 Month ago, written in Python.
Embed
Download Paste or View Raw
Hits: 141
  1.  
  2.  
  3. while 1:
  4.     pygame.display.update()
  5.     for event in pygame.event.get():
  6.        if event.type == pygame.KEYDOWN:
  7.  
  8.  
  9.            if event.key == pygame.K_q:
  10.                num = randint(1,3)
  11.                if num == 1:
  12.                    quest_card.set_text('What do you study at Algorithmics?', 25)
  13.                if num == 2:
  14.                    quest_card.set_text('What language is spoken in France?', 25)
  15.                if num == 3:
  16.                    quest_card.set_text('What grows on an apple tree?', 35)      
  17.  
  18.  
  19.                quest_card.draw(10,25)
  20.  
  21.  
  22.            if event.key == pygame.K_a:
  23.                num = randint(1,3)
  24.                if num == 1:
  25.                    ans_card.set_text('Python', 35)
  26.                if num == 2:
  27.                    ans_card.set_text('French', 35)
  28.                if num == 3:
  29.                    ans_card.set_text('Apples', 35)      
  30.  
  31.  
  32.                ans_card.draw(10, 25)
  33.     clock.tick(40)