Skip to content

Instantly share code, notes, and snippets.

@libert-xyz
Created January 5, 2016 05:33
Show Gist options
  • Save libert-xyz/9a5aa691df1dd33ba78a to your computer and use it in GitHub Desktop.
Save libert-xyz/9a5aa691df1dd33ba78a to your computer and use it in GitHub Desktop.
import random
def start_again():
print("Invalid Input")
lets_play()
def play_again():
choose = str(input("Wanna play again? Yes[y] - No[n] --> "))
if choose.lower() == 'y':
lets_play()
else:
print ("That means NO")
print ("********************************")
print ("Thank's 4 playing. See you soon")
def lets_play():
choose = str(input("Rock[r] Paper[p] or Scissors[s]? --> "))
options=['r','p','s']
if choose.lower() not in options:
start_again()
else:
robot = random.randint(0,2)
if choose.lower() == 'r' and options[robot] == 's':
print ("**You Win!, Rock beats Scissors**")
play_again()
elif choose.lower() == 's' and options[robot] == 'p':
print ("**You Win!, Scissors beats paper**")
play_again()
elif choose.lower() == 'p' and options[robot] == 'r':
print ("**You Win, Paper beats rock**")
play_again()
#User lost
elif options[robot] == 'r' and choose.lower() == 's':
print ("**You Lost, Rock beats Scissors**")
play_again()
elif options[robot] == 's' and choose.lower() == 'p':
print ("**You Lost, Scissors beats paper**")
play_again()
elif options[robot] == 'p' and choose.lower() == 'r':
print ("**You Lost, Paper beats rock**")
play_again()
else:
print ("**Tie, robot also choose %s **" %(options[robot]))
play_again()
lets_play()
@vikychoi
Copy link

vikychoi commented Nov 6, 2017

wow, detailed program, but i think u can simplify it a bit, and i wish i could know wt computer used!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment