Created
August 9, 2020 20:02
-
-
Save kat-perreira/e33567f00ccf883719aa0bd079de0041 to your computer and use it in GitHub Desktop.
Ada Build project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rock, Paper, Scissors hardcoded values | |
computer = 'paper' | |
user = 'rock' | |
# win, lose, tie strings | |
game_strings = { | |
'win': 'You Win!', | |
'lose': 'You Lose!', | |
'tie': 'Tie!' | |
} | |
# Tie | |
if computer == user: | |
print(game_strings['tie']) | |
# Rock vs Paper | |
if computer == 'rock' and user == 'paper': | |
print (game_strings['win']) | |
elif computer == 'paper': | |
if user == 'rock': | |
print (game_strings['lose']) | |
# Rock vs Scissors | |
if computer == 'rock' and user == 'scissors': | |
print (game_strings['lose']) | |
elif user == 'rock' and computer == 'scissors': | |
print(game_strings['win']) | |
# Paper vs Scissors | |
if computer == 'paper' and user == 'scissors': | |
print (game_strings['win']) | |
elif user == 'paper' and computer == 'scissors': | |
print(game_strings['lose']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment