Programme permettant de jouer à Shifumi :
import random PIERRE = Image("99999:" "90009:" "90009:" "90009:" "99999") CISEAU = Image('99009:' '99090:' '00900:' '99090:' '99009') PAPIER = Image('00000:' '00000:' '99999:' '00000:' '00000') while True: if accelerometer.is_gesture('shake'): tirage = random.randint(1,3) if tirage==1: display.show(PIERRE) if tirage==2: display.show(PAPIER) if tirage==3: display.show(CISEAU)
⚠ Bien penser à reporter l’indentation des « if » pour que le programme fonctionne.
Aucune réponse