Author | newyorkpizza |
Submission date | 2014-10-11 09:36:37.378090 |
Rating | 3199 |
Matches played | 568 |
Win rate | 30.46 |
Use rpsrunner.py to play unranked matches on your computer.
import random
gambits = [
["R", "R", "R"], # The Avalanche
["P", "P", "P"], # The Bureaucrat
["P", "S", "R"], # The Crescendo
["R", "S", "P"], # The Denoument
["R", "P", "P"], # Fistful O' Dollars
["P", "S", "S"], # Paper Dolls
["P", "S", "P"], # Scissor Sandwich
["S", "S", "S"] # The Toolbox
]
if input == "":
n = 0
else:
n += 1
index = n % 3
if index == 0:
current_gambit = random.randrange(0, len(gambits))
output = gambits[current_gambit][index]