Skip to content

Instantly share code, notes, and snippets.

@kat-perreira
Created August 9, 2020 20:02
Show Gist options
  • Save kat-perreira/e33567f00ccf883719aa0bd079de0041 to your computer and use it in GitHub Desktop.
Save kat-perreira/e33567f00ccf883719aa0bd079de0041 to your computer and use it in GitHub Desktop.
Ada Build project
# 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