I've been struggling as I wanted to try the hanged man game on python : For those who don't know the game, you basically need to guess all the letters of a word (with a limited number of attempts previously announced). What's difficult, is that I want each guessed letters to appear on the spare parts of the word to guess and the already used letters to be mentionned as well. And as we've already decided the number of attempts allowed (let's say 10), I want to try to show the remaining attempts left !!
Here's what I've done already (the generate random words) but I'm stuck :
import urllib
response = urllib.request.urlopen('https://random-word-api.herokuapp.com/word?number=1')
word =response.read().decode('utf-8').strip('[\"]')
print(word)
Many thanks for your help.
Aucun commentaire:
Enregistrer un commentaire