scrub1

Authorscrub
Submission date2017-12-06 16:32:06.578070
Rating3949
Matches played319
Win rate36.36

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

Source code:

import random




if input == "": 
    countS = countR = countP = 0
    opponentMoves = [] 
    	
elif input == "R":
  	opponentMoves += ['R']

elif input == "P": 		
   	opponentMoves += ['P']

elif input == "S":
   	opponentMoves += ['S']

last4 = opponentMoves[-4:]
for move in last4:
    if move == 'R':
        countR += 1
    if move == 'P':
        countP += 1
    if move == 'S':
        countS += 1

if countR > countP and countR > countS:
    output = 'P' 

elif countP > countS and countP > countR:
    output = 'S'

else:
    output = 'R'