TEST1414112

AuthorTEST141
Submission date2018-03-08 20:05:45.251000
Rating3783
Matches played304
Win rate37.17

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

Source code:

#import modules
import random


#Counter and human move list setup
if input == "":
    i = 0
    moveRec = []
else:
    i += 1
    moveRec.append(input)


#Set up a string arrray to allow translation between numbers and moves
name = ["R", "S", "P"]

#First 3 computer moves
initMove = ["S","P","S"]

#Check to see if you're in first 3 moves
if i < 3:
    output = initMove[i]


if i >= 3:
    if random.randint(1,10) > 8:
        output = random.choice(["R","P","S"])
    else:
        output = moveRec[i-3]


#TODO: Create a 3-cycle long player move list, record frequency of cycles, set up ouput for the cycle, set up "win-flip" architecture