Author | r0kk0 |
Submission date | 2018-12-10 17:05:12.384058 |
Rating | 2648 |
Matches played | 268 |
Win rate | 25.0 |
Use rpsrunner.py to play unranked matches on your computer.
import random
def cyclic_rotate(input, num):
return ( input[num:-1] + input[0:num] )
beated_by= { "R": 0, "P": -1, "S": -2, "": 0 }
output = random.choice( cyclic_rotate( [ "R", "P", "S" ], beated_by[input] ) )