11 More arbitrary tweaks edited Jan 4 at 11:53 Belhenix 9177 bronze badges class StepBot(Bot): def __init__(self, *args): super().__init__(*args) self.cycles = 0 self.steps = 8 self.smallTarget = 15 self.bigTarget = 20 self.rush = True #target for game self.breakPoint = 40 def make_throw(self, scores, last_round): # Stacks upon stacks upon stacks self.bigTarget += 1 self.cycles += 1 self.steps += 1 if self.cycles <=3: self.smallTarget += 1 else: self.bigTarget -= 1 if self.steps % 2 == 0 else 0 target = self.bigTarget if scores[self.index] < 12 else self.bigTarget if self.cycles <=3 else self.smallTarget # If you didn't start the last round (and can't reach normally), panic ensues if last_round and max(scores) - (target // 3) > scores[self.index]: # Reaching target won't help, run for it! while max(scores) > scores[self.index] + sum(self.current_throws): yield True else: if last_round: self.breakPoint = max(scores) # Hope for big points when low, don't bite more than you can chew when high currentStep = 1 while currentStep <= self.steps: currentStep += 1 if sum(self.current_throws) > target: break; yield True # After throw, if we get to 40 then rush (worst case we'll get drawn back) if scores[self.index] + sum(self.current_throws) > self.breakPoint and self.rush: currentStep = 1 self.steps = 2 self.rush = False target = 8 + ((random.randint(7, 1615) ** 0.5) // 1) # 4 or 5 # print(target) currentStep += 1 # If goal wasn't reached or surpassed even after rushing, run for it! while last_round and max(scores) > scores[self.index] + sum(self.current_throws): yield True yield False  class StepBot(Bot): def __init__(self, *args): super().__init__(*args) self.cycles = 0 self.steps = 8 self.smallTarget = 15 self.bigTarget = 20 self.rush = True #target for game self.breakPoint = 40 def make_throw(self, scores, last_round): # Stacks upon stacks upon stacks self.bigTarget += 1 self.cycles += 1 self.steps += 1 if self.cycles <=3: self.smallTarget += 1 else: self.bigTarget -= 1 if self.steps % 2 == 0 else 0 target = self.bigTarget if scores[self.index] < 12 else self.bigTarget if self.cycles <=3 else self.smallTarget # If you didn't start the last round (and can't reach normally), panic ensues if last_round and max(scores) - (target // 3) > scores[self.index]: # Reaching target won't help, run for it! while max(scores) > scores[self.index] + sum(self.current_throws): yield True else: if last_round: self.breakPoint = max(scores) # Hope for big points when low, don't bite more than you can chew when high currentStep = 1 while currentStep <= self.steps: if sum(self.current_throws) > target: break; yield True # After throw, if we get to 40 then rush (worst case we'll get drawn back) if scores[self.index] + sum(self.current_throws) > self.breakPoint and self.rush: currentStep = 1 self.steps = 2 self.rush = False target = 8 + ((random.randint(7, 16) ** 0.5) // 1) # 4 or 5 # print(target) currentStep += 1 # If goal wasn't reached or surpassed even after rushing, run for it! while last_round and max(scores) > scores[self.index] + sum(self.current_throws): yield True yield False  class StepBot(Bot): def __init__(self, *args): super().__init__(*args) self.cycles = 0 self.steps = 8 self.smallTarget = 15 self.bigTarget = 20 self.rush = True #target for game self.breakPoint = 40 def make_throw(self, scores, last_round): # Stacks upon stacks upon stacks self.bigTarget += 1 self.cycles += 1 self.steps += 1 if self.cycles <=3: self.smallTarget += 1 else: self.bigTarget -= 1 if self.steps % 2 == 0 else 0 target = self.bigTarget if scores[self.index] < 12 else self.bigTarget if self.cycles <=3 else self.smallTarget # If you didn't start the last round (and can't reach normally), panic ensues if last_round and max(scores) - (target // 3) > scores[self.index]: # Reaching target won't help, run for it! while max(scores) > scores[self.index] + sum(self.current_throws): yield True else: if last_round: self.breakPoint = max(scores) # Hope for big points when low, don't bite more than you can chew when high currentStep = 1 while currentStep <= self.steps: currentStep += 1 if sum(self.current_throws) > target: break; yield True # After throw, if we get to 40 then rush (worst case we'll get drawn back) if scores[self.index] + sum(self.current_throws) > self.breakPoint and self.rush: currentStep = 1 self.steps = 2 self.rush = False target = 8 + ((random.randint(7, 15) ** 0.5) // 1) # print(target) # If goal wasn't reached or surpassed even after rushing, run for it! while last_round and max(scores) > scores[self.index] + sum(self.current_throws): yield True yield False  10 updated, fares better but can't beat OptFor2x edited Jan 4 at 7:01 Belhenix 9177 bronze badges Update: StepBot now enters the top ranks! Didn't think he'd made it. Competition got really tough but I'm satisfied with the bot's results.class StepBot(Bot): def __init__(self, *args): super().__init__(*args) self.cycles = 0 self.steps = 78 self.smallTarget = 15 self.bigTarget = 20 self.rush = True #target for game self.breakPoint = 40 def make_throw(self, scores, last_round): # Stacks upon stacks upon stacks self.bigTarget += 1 self.cycles += 1 self.steps += 1 if self.cycles <=3: self.smallTarget += 1 else: self.bigTarget -= 1 if self.steps % 2 == 0 else 0 target = self.bigTarget if scores[self.index] < 12 else self.bigTarget if self.cycles <=3 else self.smallTarget # If you didn't start the last round (and can't reach normally), panic ensues if last_round and max(scores) - (target // 3) > scores[self.index]: # MakeReaching ortarget breakwon't help, run for it! while max(scores)-1 >=> scores[self.index] + sum(self.current_throws): yield True else: #if Hopelast_round: for big points when low, don't bite more than you can chew when high self.breakPoint = max(scores) target# =Hope self.bigTargetfor ifbig scores[self.index]points target: break; yield True # After throw, if we get to 40 then rush if we're low this round (worst case we'll get drawn back) if scores[self.index] + sum(self.current_throws) > 40self.breakPoint and self.rush: currentStep = 1 self.steps = 2 self.rush = False target = 8 + ((random.randint(7, 1516) ** 0.5) // 1) # 4 or 5 # print(target) currentStep += 1 # If goal wasn't reached or surpassed even after rushing, run for it! while last_round and max(scores) > scores[self.index] + sum(self.current_throws): yield True yield False  Update: StepBot now enters the top ranks! Didn't think he'd made it.class StepBot(Bot): def __init__(self, *args): super().__init__(*args) self.cycles = 0 self.steps = 7 self.smallTarget = 15 self.bigTarget = 20 self.rush = True def make_throw(self, scores, last_round): # Stacks upon stacks upon stacks self.bigTarget += 1 self.cycles += 1 self.steps += 1 if self.cycles <=3: self.smallTarget += 1 else: self.bigTarget -= 1 if self.steps % 2 == 0 else 0 # If you didn't start the last round, panic ensues if last_round: # Make or break while max(scores)-1 >= scores[self.index] + sum(self.current_throws): yield True else: # Hope for big points when low, don't bite more than you can chew when high target = self.bigTarget if scores[self.index] < 12 else self.bigTarget if self.cycles <=3 else self.smallTarget currentStep = 1 while currentStep <= self.steps: if sum(self.current_throws) > target: break; yield True # After throw, if we get to 40 then rush if we're low this round (worst case we'll get drawn back) if scores[self.index] + sum(self.current_throws) > 40 and self.rush: currentStep = 1 self.steps = 2 self.rush = False target = 8 + ((random.randint(7, 15) ** 0.5) // 1) # 4 or 5 currentStep += 1 yield False  StepBot now enters the top ranks! Didn't think he'd made it. Competition got really tough but I'm satisfied with the bot's results.class StepBot(Bot): def __init__(self, *args): super().__init__(*args) self.cycles = 0 self.steps = 8 self.smallTarget = 15 self.bigTarget = 20 self.rush = True #target for game self.breakPoint = 40 def make_throw(self, scores, last_round): # Stacks upon stacks upon stacks self.bigTarget += 1 self.cycles += 1 self.steps += 1 if self.cycles <=3: self.smallTarget += 1 else: self.bigTarget -= 1 if self.steps % 2 == 0 else 0 target = self.bigTarget if scores[self.index] < 12 else self.bigTarget if self.cycles <=3 else self.smallTarget # If you didn't start the last round (and can't reach normally), panic ensues if last_round and max(scores) - (target // 3) > scores[self.index]: # Reaching target won't help, run for it! while max(scores) > scores[self.index] + sum(self.current_throws): yield True else: if last_round: self.breakPoint = max(scores) # Hope for big points when low, don't bite more than you can chew when high currentStep = 1 while currentStep <= self.steps: if sum(self.current_throws) > target: break; yield True # After throw, if we get to 40 then rush (worst case we'll get drawn back) if scores[self.index] + sum(self.current_throws) > self.breakPoint and self.rush: currentStep = 1 self.steps = 2 self.rush = False target = 8 + ((random.randint(7, 16) ** 0.5) // 1) # 4 or 5 # print(target) currentStep += 1 # If goal wasn't reached or surpassed even after rushing, run for it! while last_round and max(scores) > scores[self.index] + sum(self.current_throws): yield True yield False  9 Arbitrary tweaks that improve win rate through mysterious means edited Dec 22 '18 at 1:39 Belhenix 9177 bronze badges class StepBot(Bot): def __init__(self, *args): super().__init__(*args) self.cycles = 0 self.steps = 7 self.smallTarget = 15 self.bigTarget = 20 self.rush = True def make_throw(self, scores, last_round): # Stacks upon stacks upon stacks self.bigTarget += 1 - (1 if self.steps % 3 == 0 else 0) self.cycles += 1 self.steps += 1 if self.cycles <=3: self.smallTarget += 1 # If you didn't start the last round, panic ensues if last_roundelse: #self.bigTarget Rack-= up1 pointsif justself.steps in% case 2 == 0 else 0 # while scores[self.index] + sum(self.current_throws) <= 35: If you didn't start the last round, panic ensues # yieldif Truelast_round: # Keep going until we'reMake notor behindbreak while max(scores)-1 >= scores[self.index] + sum(self.current_throws): yield True else: # Hope for big points when low, don't bite more than you can chew when high target = self.bigTarget if scores[self.index] < 12 else self.bigTarget if self.cycles <=4<=3 else self.smallTarget currentStep = 1 while currentStep <= self.steps: if sum(self.current_throws) > target: break; yield True # After throw, if we get to 40 then rush if we're low this round (worst case we'll get drawn back) if scores[self.index] + sum(self.current_throws) > 40 and self.rush: currentStep = 1 self.steps = 2 self.rush = False target = self8 + ((random.smallTargetrandint(7, -15) ** 0.5) // 1) # 4 or 5 currentStep += 1 yield False  class StepBot(Bot): def __init__(self, *args): super().__init__(*args) self.cycles = 0 self.steps = 7 self.smallTarget = 15 self.bigTarget = 20 self.rush = True def make_throw(self, scores, last_round): # Stacks upon stacks upon stacks self.bigTarget += 1 - (1 if self.steps % 3 == 0 else 0) self.cycles += 1 self.steps += 1 if self.cycles <=3: self.smallTarget += 1 # If you didn't start the last round, panic ensues if last_round: # Rack up points just in case # while scores[self.index] + sum(self.current_throws) <= 35: # yield True # Keep going until we're not behind while max(scores) >= scores[self.index] + sum(self.current_throws): yield True else: # Hope for big points when low, don't bite more than you can chew when high target = self.bigTarget if scores[self.index] < 12 else self.bigTarget if self.cycles <=4 else self.smallTarget currentStep = 1 while currentStep <= self.steps: if sum(self.current_throws) > target: break; yield True # After throw, if we get to 40 then rush (worst case we'll get drawn back) if scores[self.index] + sum(self.current_throws) > 40 and self.rush: currentStep = 1 self.steps = 2 self.rush = False target = self.smallTarget - 5 currentStep += 1 yield False  class StepBot(Bot): def __init__(self, *args): super().__init__(*args) self.cycles = 0 self.steps = 7 self.smallTarget = 15 self.bigTarget = 20 self.rush = True def make_throw(self, scores, last_round): # Stacks upon stacks upon stacks self.bigTarget += 1 self.cycles += 1 self.steps += 1 if self.cycles <=3: self.smallTarget += 1 else: self.bigTarget -= 1 if self.steps % 2 == 0 else 0 # If you didn't start the last round, panic ensues if last_round: # Make or break while max(scores)-1 >= scores[self.index] + sum(self.current_throws): yield True else: # Hope for big points when low, don't bite more than you can chew when high target = self.bigTarget if scores[self.index] < 12 else self.bigTarget if self.cycles <=3 else self.smallTarget currentStep = 1 while currentStep <= self.steps: if sum(self.current_throws) > target: break; yield True # After throw, if we get to 40 then rush if we're low this round (worst case we'll get drawn back) if scores[self.index] + sum(self.current_throws) > 40 and self.rush: currentStep = 1 self.steps = 2 self.rush = False target = 8 + ((random.randint(7, 15) ** 0.5) // 1) # 4 or 5 currentStep += 1 yield False  8 more tweaks edited Dec 21 '18 at 3:24 Belhenix 9177 bronze badges 7 More optimization, better (safer) rush when activating last round edited Dec 20 '18 at 23:18 Belhenix 9177 bronze badges 6 Small tweak edited Dec 20 '18 at 2:56 Belhenix 9177 bronze badges 5 Small tweak edited Dec 20 '18 at 2:50 Belhenix 9177 bronze badges 4 Lots of value and logic changes, now a lot more careful edited Dec 20 '18 at 1:49 Belhenix 9177 bronze badges 3 Screwed up, more edits edited Dec 19 '18 at 18:00 Belhenix 9177 bronze badges 2 Fix some python issues :) edit approved Dec 19 '18 at 18:00 Spitemaster 40566 bronze badges 1 answered Dec 19 '18 at 17:50 Belhenix 9177 bronze badges