import random
choices = ["rock", "paper", "scizor"]
choicesDictionary = {
"rock": {
"alias": ["r", "rocks", "1"],
"win": "scizor",
"lose": "paper",
},
"paper": {
"alias": ["p", "papers", "2"],
"win": "rock",
"lose": "scizor",
},
"scizor": {
"alias": ["s", "scizors", "3"],
"win": "paper",
"lose": "rock",
},
}
playerChoice = input("Make your choice:\n")
if playerChoice not in choices:
for choice in choicesDictionary.keys():
if playerChoice in choicesDictionary[choice]["alias"]:
playerChoice = choice
break
while playerChoice not in choices:
playerChoice = input("Make your choice:\n")
if playerChoice not in choices:
for choice in choicesDictionary.keys():
if playerChoice in choicesDictionary[choice]["alias"]:
playerChoice = choice
computer = random.choice(choices)
if choicesDictionary[playerChoice]["win"] == computer: status = "You won the game!"
if choicesDictionary[playerChoice]["lose"] == computer: status = "You lost the game!"
if playerChoice == computer: status = "The game resulted in a draw!"
print(f"The game started! You chose {playerChoice}")
print(f"Computer chose {computer}! {status}")