Author | BoxFish |
Submission date | 2013-06-18 09:40:39.393532 |
Rating | 1479 |
Matches played | 720 |
Win rate | 15.56 |
Use rpsrunner.py to play unranked matches on your computer.
import random
#Select the choice that minimizes the loss count
if (input == ""):
rLoss = 0;
sLoss = 0;
pLoss = 0;
if ((input == "R") and (output == "S")):
sLoss += 1;
if ((input == "S") and (output == "P")):
pLoss += 1;
if ((input == "P") and (output == "R")):
rLoss += 1;
if (rLoss < sLoss) and (rLoss < pLoss):
output = "R";
elif (pLoss < sLoss) and (pLoss < rLoss):
output = "P";
elif (sLoss < pLoss) and (sLoss < rLoss):
output = "S";
else:
output = "R";