Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- def makeChoice(message, validAnswers):
- phrases = ("", "по-русски сказано: ", "ты что, тупой? тебя спрашивают: ", "ну, не выпендривайся тут. ")
- phraseNo, answer = 0, None
- while answer not in validAnswers:
- print(phrases[phraseNo], message, sep="", end="")
- answer = input()
- phraseNo = randint(1,len(phrases)-1)
- return answer
- print("Ghost Game")
- score = 5
- ghost = True
- while ghost:
- ghost_door = str(randint(1,3))
- door = makeChoice("Есть 3 дверей, за одной из них призрак, какую дверь выберете [1, 2, 3]? ", ("1", "2", "3"))
- if door == ghost_door:
- print("Призрак!")
- else:
- print("Тут нет призрака.")
- score = score - 1
- print("У Вас осталось", score, "xp")
- if score == 0:
- break
- answer = makeChoice("Продолжить игру? [1 - Да] или [2 - Нет]: ", ("1", "2"))
- if answer != "1":
- break
Add Comment
Please, Sign In to add comment