periczeljkosmederevo R1.2

AuthorPeric N Zeljko
Submission date2012-10-28 11:41:32.492471
Rating4760
Matches played773
Win rate49.42

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

Source code:

import random
r = 0
p = 0
s = 0
o = ""

if input == "":
   o = "R"
else:
   o = ""
   while o == "":
      o = random.choice(["R","P","S","R","P","S","R","P","S","R","R","R","P","P","P","S","S","S"]) 
      if o == "R":
         if r<34:
            r = r + 1
         else:
            o = ""
      elif o == "P":
         if p < 34:
            p = p + 1
         else: 
            o = ""
      elif o == "S": 
         if s < 34:
            s = s + 1
         else: 
            o = ""
      if ( r > 33 & p > 33 & s > 33 ):
         r = 0
         p = 0
         s = 0
output = o