Advertisement
fmasanori

Show Calouros 03

Oct 11th, 2011
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. import pygame.mixer
  2. sounds = pygame.mixer
  3. sounds.init()
  4.  
  5. def espera_tocar(canal):
  6.     while canal.get_busy():
  7.         pass
  8.  
  9. certos = 0
  10. errados = 0
  11. opção = int(input ("Aperte 1)Certo 2)Errado e 0)Finalizar "))
  12.  
  13. while opção != 0:
  14.     if opção == 1:
  15.         s = sounds.Sound("correct.wav")
  16.         espera_tocar(s.play())
  17.         certos = certos + 1
  18.     if opção == 2:    
  19.         s2 = sounds.Sound("wrong.wav")
  20.         espera_tocar(s2.play())
  21.         errados = errados + 1
  22.     opção = int(input ("Aperte 1)Certo 2)Errado e 0)Finalizar "))
  23.  
  24. print ("Certos:", certos, "Errados:", errados)
  25.  
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement