Author | ipha |
Submission date | 2013-10-02 15:52:45.338725 |
Rating | 4931 |
Matches played | 659 |
Win rate | 49.47 |
Use rpsrunner.py to play unranked matches on your computer.
#!/usr/bin/env python2
import random
wins = 0
loss = 0
patterns = [["RRR", "P"],
["PPP", "S"],
["SSS", "R"]
]
log = ""
def get_throw():
for pattern in patterns:
if(pattern[0] == log[-3:]):
return pattern[1]
return random.choice("RPS")
output = get_throw()
log += input