This commit is contained in:
NikolajDanger
2020-08-07 20:55:26 +02:00
parent d35ebe2659
commit a6b18c2e5b
2 changed files with 33 additions and 6 deletions

View File

@ -11,8 +11,9 @@ def hangmanStart(channel,user):
with urllib.request.urlopen("https://random-word-api.herokuapp.com/word?number=10") as p:
words = json.load(p)
word = list(random.choice(words).upper())
guessed = [False] * len(word)
gameID = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
data[channel] = {"player" : user,"guessed letters" : [],"word" : word,"game ID" : gameID}
data[channel] = {"player" : user,"guessed letters" : [],"word" : word,"game ID" : gameID,"misses" : 0,"guessed" : guessed}
remainingLetters = list(string.ascii_uppercase)