tester99

Authornoname
Submission date2018-05-18 15:00:39.358990
Rating3863
Matches played278
Win rate37.41

Use rpsrunner.py to play unranked matches on your computer.

Source code:

#!/usr/bin/env python
import sys
import time


cycle = {"R": "P", "P": "S", "S": "R"}

if input == "": # initialize variables for the first round
	rockCount = paperCount = scissorsCount = 0
elif input == "R":
	rockCount += 1
elif input == "P":
	paperCount += 1
elif input == "S":
	scissorsCount += 1

print rockCount, paperCount, scissorsCount
# time.sleep(.005)

if input == "":
    output = cycle["R"]
else: 
    output = cycle[input]

if rockCount > paperCount and rockCount > scissorsCount:
	output = "P"
elif paperCount > scissorsCount:
	output = "S"
else:
	output = "R"