Compute MAN

AuthorCompute MAN's Buddy
Submission date2018-03-08 20:13:52.020020
Rating2942
Matches played301
Win rate30.9

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