擅长:python、mysql、java
<p>在gameEnd()上尝试此版本。如果用户输入除“Y”/“Y”以外的任何内容,则退出。你知道吗</p>
<pre><code>def gameEnd ( ):
playAgain = raw_input ('Would you like to play again?')
if playAgain == 'Y' or playAgain == 'y':
gameCore()
else:
print ('You won Caves of Doom, Caves of Delight ' + wins + ' times.')
print ('You lost Caves of Doom, Caves of Delight ' + losses + ' times.')
if wins > losses:
print ('Good for you. You have a winning record!')
elif wins == losses:
print ('Well, you did okay; neither good nor bad.')
elif wins < losses:
print ('Tough luck. You have a losing record.')
time.sleep (1)
print ('Farewell, ' + name + ',' + ' and may we meet again sometime soon.')
</code></pre>