1. Реализуйте программу таким образом, чтобы пользователь мог повторить игру столько раз, сколько захочет.
Выведите сообщение типа Try again? и варианты ответа:
Yes ([y]) и No ([n]).
2. По завершению игры выведите общий счет и количество побед (Player VS Computer).
Програма на Python
Даю 30 балов
Ответы на вопрос
Ответ:
gameOver = False
pWins = 0
cWins = 0
totScore = 0
while gameOver == False:
print("Game is running...")
print("Enter 'stop' to stopping game running...")
gameOvertext = input()
if gameOvertext == "stop":
print()
gameOver = True
else:
continue
print("Enter score of the game:")
score = int(input())
print()
print("Who did win?")
while True:
whoWon = input()
if whoWon == "computer":
cWins += 1
totScore += score
gameOver == False
print()
break
elif whoWon == "player":
pWins += 1
totScore += score
gameOver == False
print()
break
else:
print("You must enter 'computer' or 'player' ")
continue
print("The game is over!")
print("Try again?")
print("Yes ([y]) or No ([n])")
choice = input()
if choice == "y" or choice == "yes" or choice == "Yes":
print()
gameOver = False
else:
gameOver = True
print()
print("Сomputer won ",cWins, " times")
print("Player won ",pWins, " times")
print("Total score: ", totScore)
Это консольная версия программы, так как я не знаю архитектуры и логики вашей игры...
Удачи))