class Game: field = None debug_flag = False def __init__(self): pass def go(self, player_a, player_b): pass def debug(self, text): if self.debug_flag: print text class Game_TwoPerson(Game): """ Single instance of a game. Take input of two bots, ask them what they want to do and return the score for each. """ def __init__(self, field): self.field = field def get_answers(self, player_a, player_b): """ Execute a single match between two bots """ global debug a = player_a.bot.answer(self.field, player_b.id) b = player_b.bot.answer(self.field, player_a.id) player_a.bot.inform(b, player_b.id) player_b.bot.inform(a, player_a.id) return (a, b) def get_scores(self, a, b): score_a = self.field.field[a][b][0] score_b = self.field.field[a][b][1] #self.debug("\t[%+03i] %-10s %5i %-15s[%i]" % (score_a, player_a.get_name(), player_a.id, self.field.desc[a], a)) #self.debug("\t[%+03i] %-10s %5i %-15s[%i]" % (score_b, player_b.get_name(), player_b.id, self.field.desc[b], b)) return (score_a, score_b) #def get_payoff(self, a, b): # """ # Figure out the payoff for this single match # """