我是 python 新手,我只是在处理这个应用程序
import random
# create a sequence of words to choose from
WORDS = ("hello","goodbye","smile","evening","daytime")
#
# pick one word randomly from the sequence
word = random.choice(WORDS)
# create a variable to see if the guess is correct
correct = word
# create a jumbled version of the word
jumble =""
while word:
position = random.randrange(len(word))
jumble += word[position]
word = word[:position] + word[(position + 1):]
# start the game
print( \
"""
Welcome to the anagram quiz!
Unscramble the letters to make a word.
(Press the enter key at the prompt to quit.)
""")
print ("The jumble is:", jumble)
guess = input("\nYour guess: ")
guess = guess.lower()
while (guess != correct) and (guess != ""):
print ("Sorry, that's not it.")
guess = input("Your guess: ")
guess = guess.lower()
if guess == correct:
print ("That's it! You guessed it!\n")
print ("Thank you for playing.")
input("\n\nPress the enter key to exit.")
正如您所看到的那样,它混淆了一个单词让用户猜测这个词是什么,我需要能够改进这一点,以便用户在他们被卡住时得到提示并添加一个评分系统来奖励那些解决混乱的人无需提示。
我已经尝试了几个小时,但没有找到,请您帮我添加该功能。
谢谢你。