C90 No Globals

AuthorJSoffer
Submission date2011-05-30 01:38:48.318510
Rating2310
Matches played6702
Win rate17.77

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

Source code:

import time                                                                  
                                                                             
class Alea:                                                                  
    def __init__(self):                                                      
        self.actual = int(time.time())                                       
    def alea(self):                                                          
        self.actual = self.actual * 1103515245 + 12345                       
        return (((self.actual >> 16) % 32768) % 3)                                                                                              
                                                                             
aleatorios = Alea()                                                          
                                                                             
output = ['R', 'P', 'S'][aleatorios.alea()]