Author | BoxFish |
Submission date | 2013-06-17 11:58:23.377423 |
Rating | 2157 |
Matches played | 683 |
Win rate | 21.67 |
Use rpsrunner.py to play unranked matches on your computer.
import random
#Simple program to test system
rCount = 0;
sCount = 0;
pCount = 0;
tCount = 0;
if (input == "R"):
rCount = rCount + 1;
elif (input == "S"):
sCount = sCount + 1;
elif (input == "P"):
pCount = pCount + 1;
tCount = (rCount + sCount + pCount) + 1;
pOut = rCount/tCount;
rOut = sCount/tCount;
sOut = pCount/tCount;
if ((pOut >= rOut) and (pOut >= sOut)):
output = "P";
elif ((rOut >= pOut) and (rOut >= sOut)):
output = "R";
elif ((sOut >= pOut) and (sOut >= rOut)):
output = "S";