Skip to content

Instantly share code, notes, and snippets.

@theonewolf
Created November 26, 2013 04:26
Show Gist options
  • Select an option

  • Save theonewolf/7653456 to your computer and use it in GitHub Desktop.

Select an option

Save theonewolf/7653456 to your computer and use it in GitHub Desktop.
example bot with movement memory reset each turn
import rg
from random import seed,randint
class Robot:
def __init__(self):
self.oldturn = -1
seed(None)
def act(self, game):
if game.turn != self.oldturn:
print '--- NEW TURN[%d] ---' % game.turn
self.moves = []
self.oldturn = game.turn
self.moves.append(randint(0,100))
print 'Moves: %s' % str(self.moves)
return ['guard']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment