Flèche du haut pour passer au coup suivant
from turtle import * from ion import * def pendu(i): if i==1: penup() goto(-50,-110) pendown() setheading(0) forward(120) backward(50) if i==2: setheading(90) forward(180) left(90) forward(50) if i==3: circle(10) if i==4: penup() goto(-30,50) setheading(-90) pendown() forward(60) if i==5: penup() goto(-30,50) pendown() goto(-50,30) penup() goto(-30,50) pendown() goto(0,30) if i==6: penup() goto(-30,-10) pendown() goto(0,-40) penup() goto(-30,-10) pendown() goto(-50,-40) def jeu(): mot="" mot=input("Quel est le mot à deviner?") guess="_"*len(mot) erreur=0 while (not(keydown(KEY_UP))): continue print("\n\n\n\n\n\n\n\n\n\n\n") while guess!=mot and erreur!=6: letter=input("Choisissez une lettre:") if letter in mot: print("Bravo, continuez !") guess=list(guess) position=([pos for pos, char in enumerate(mot) if char == letter]) for number in position: guess[number]=letter guess=''.join(guess) print(guess) else: erreur+=1 for k in range(1,erreur+1): pendu(k) hideturtle() while (not(keydown(KEY_UP))): continue if guess==mot: print("C'est gagné !!") if erreur==6: print("C'est perdu !!")