from otree.api import Currency as c, currency_range, expect, Bot from . import * import random class PlayerBot(Bot): def play_round(self): if self.player.round_number == 1: yield Instrucciones yield dictator_inst questions = ['s3dt00', 's3dt01', 's3dt02', 's3dt03', 's3dt04', 's3dt05', 's3dt06', 's3dt07', 's3dt08', 's3dt09', 's3dt10', 's3dt11', 's3dt12', 's3dt13', 's3dt14', 's3dt15', 's3dt16', 's3dt17', 's3dt18', 's3dt19', 's3dt20', 's3dt21'] # Esta no es una representación realista de como son las decisions pero no me importa cutoff_value = random.randint(0, len(questions)) answers = [1 for _ in range(cutoff_value + 1)] + [2 for _ in range(21 - cutoff_value)] yield dictator_table, dict(zip(questions, answers)) if self.player.round_number == 2: yield Instrucciones1 questions = ['s3t100', 's3t101', 's3t102', 's3t103', 's3t104', 's3t105', 's3t106', 's3t107', 's3t108', 's3t109', 's3t110', 's3t111', 's3t112', 's3t113', 's3t114', 's3t115', 's3t116', 's3t117', 's3t118', 's3t119', 's3t120', 's3t121'] # Esta no es una representación realista de como son las decisions pero no me importa cutoff_value = random.randint(0, len(questions)) answers = [1 for _ in range(cutoff_value + 1)] + [2 for _ in range(21 - cutoff_value)] yield table1, dict(zip(questions, answers)) if self.player.round_number == 3: yield Instrucciones2 questions = ['s3t200', 's3t201', 's3t202', 's3t203', 's3t204', 's3t205', 's3t206', 's3t207', 's3t208', 's3t209', 's3t210', 's3t211', 's3t212', 's3t213', 's3t214', 's3t215', 's3t216', 's3t217', 's3t218', 's3t219', 's3t220', 's3t221'] # Esta no es una representación realista de como son las decisions pero no me importa cutoff_value = random.randint(0, len(questions)) answers = [1 for _ in range(cutoff_value + 1)] + [2 for _ in range(21 - cutoff_value)] yield table2, dict(zip(questions, answers)) if self.player.round_number == 4: yield table3, {'s3t3': random.randint(0, 6)} if self.player.round_number == 5: yield table4, {'s3t4': random.randint(0, 6)}