Author | rockadidas |
Submission date | 2014-10-11 05:59:18.202245 |
Rating | 5038 |
Matches played | 566 |
Win rate | 50.0 |
Use rpsrunner.py to play unranked matches on your computer.
import random
tactics = ["R", "P", "S"]
def winner(opponent_tactic):
return tactics[(tactics.index(opponent_tactic) + 1) % 3]
hist = ""
if input == "":
output = random.choice(tactics)
else:
hist = hist + input
output = winner(hist[-1])