Skip to content

Instantly share code, notes, and snippets.

@hayksaakian
Last active December 28, 2015 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hayksaakian/7551288 to your computer and use it in GitHub Desktop.
Save hayksaakian/7551288 to your computer and use it in GitHub Desktop.
@staticmethod
def get_adjacent_robots(self, game, player_comparator=None):
def generate():
for loc,bot in game.get('robots').items():
if rg.wdist(loc, self.location) <= 1:
if player_comparator == None or player_comparator(self.player_id, bot.player_id):
yield (loc, bot)
return dict(generate())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment