Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- import random
- throws = ['rock', 'paper', 'scissors'] #list of choices for human and comp
- score = {'computer': 0, 'human': 0}
- def yesno(what): #goes to roshambo but potentially something else I guess
- x = input('Are you ready to RO SHAM BO? enter y/n\n') #give them an option to play
- if(x == "y"):
- print ('Okay! \nThis is going to be SO MUCH FUN')
- what()
- elif x == "n":
- print ('Why did you even load this in the first place?')
- quit
- else:
- print ("seriously, I'm not good at this yet. Follow my instructions exactly.")
- yesno(roshambo)
- def roshambo(): #game start
- print (score)
- compchoice = random.choice(throws)
- choice = input('Pick a choice! (rock, paper, or scissors), or press q to quit.\n\n\n\n') #explodes if you replace with 'choice = random.choice(throws)'
- if choice == 'q':
- quit
- elif compchoice != choice:
- winlose(choice, compchoice)
- else:
- print ('computer chose ' + compchoice + "! " + "you also chose " + choice + "!")
- print ("It's a tie! duuuuuuuuuuude!")
- roshambo()
- def winlose(choice, compchoice): #actual what beats what
- print ('The computer played ' + compchoice + '!')
- if choice == 'rock' and compchoice == 'paper':
- print ('paper beats rock! For some reason. You lose!')
- score['computer'] += 1
- roshambo()
- elif choice == 'rock' and compchoice == 'scissors':
- print ('rock beats scissors! You win!')
- score['human'] += 1
- roshambo()
- elif choice == 'paper' and compchoice == 'rock':
- print ('paper beats rock! For some reason. You win!')
- score['human'] += 1
- roshambo()
- elif choice == 'paper' and compchoice == 'scissors':
- print ('scissors beats paper! You lose!')
- score['computer'] += 1
- roshambo()
- elif choice == 'scissors' and compchoice == 'paper':
- print ('scissors beats paper! You win!')
- score['human'] += 1
- roshambo()
- elif choice == 'scissors' and compchoice == 'rock':
- print ('rock beats scissors! You lose!')
- score['computer'] += 1
- roshambo()
- else:
- print ('Please comply or you will be terminated')
- yesno(roshambo)
- yesno(roshambo) # explodes if you replace with "while True: roshambo()" and previous choice statement
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement