Master 2

AuthorLefa
Submission date2019-02-17 18:29:22.044824
Rating1933
Matches played240
Win rate17.92

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

Source code:

import random

def win(p):
     if prev=="R":
            return "S"
     elif prev=="P":
        return "R"
     elif prev=="S":
            return "P"
def selectgame(bfs_dfs,depth):
    
    
    return win(prev)
if input=="":
    bfs_dfs=random.randint(0,1)
    play=random.choice(["R","P","S"])
    repeat=""
else:
    #prev=input()
    prev=input
    bfs_dfs=0
    repeat=""
    play=""
    d=1
    #print prev
    if repeat=="":
        d+=1
        play=selectgame(bfs_dfs,d)
        
    elif repeat==input:
        winner=1
        play=win(prev)
repeat=input
output= play 
#print play           
            
    
    #intialization stage