Final Standings
+----------------------------------+---------+---------+---------+----------------------------+ | Name | Score | WinRate | TieRate | Elimination Probability | +----------------------------------+---------+---------+---------+----------------------------+ | 1. SarcomaBotMk11 | 0.06333 | 6.13% | 0.41% | [42 24 10 8 6 4]% | | 2. WiseKickBot | 0.06189 | 5.91% | 0.56% | [51 12 7 10 7 6]% | | 3. StrikerBot | 0.05984 | 5.78% | 0.41% | [46 18 11 8 6 5]% | | 4. PerfectFractionBot | 0.05336 | 5.16% | 0.35% | [49 12 14 10 6 4]% | | 5. MehRanBot | 0.05012 | 4.81% | 0.41% | [57 12 8 7 6 5]% | | 6. OgBot | 0.04879 | 4.66% | 0.45% | [50 15 9 8 7 5]% | | 7. SnetchBot | 0.04616 | 4.48% | 0.28% | [41 29 8 9 5 3]% | | 8. AntiKickBot | 0.04458 | 4.24% | 0.44% | [20 38 17 10 6 4]% | | 9. MehBot | 0.03636 | 3.51% | 0.25% | [80 3 4 4 3 3]% | | 10. Meh20Bot | 0.03421 | 3.30% | 0.23% | [57 12 8 7 9 3]% | | 11. GenericBot | 0.03136 | 3.00% | 0.28% | [18 39 20 11 5 3]% | | 12. HardCodedBot | 0.02891 | 2.75% | 0.29% | [58 21 3 6 5 4]% | | 13. GangBot1 | 0.02797 | 2.64% | 0.32% | [20 31 35 6 3 2]% | | 14. SarcomaBotMk3 | 0.02794 | 2.62% | 0.34% | [16 15 38 17 7 4]% | | 15. GangBot0 | 0.02794 | 2.64% | 0.30% | [20 31 35 6 3 2]% | | 16. GangBot2 | 0.02770 | 2.62% | 0.31% | [20 31 35 6 3 2]% | | 17. TitTatBot | 0.02740 | 2.63% | 0.21% | [54 10 15 10 5 2]% | | 18. MataHari2Bot | 0.02611 | 2.35% | 0.51% | [39 26 11 11 6 5]% | | 19. PolyBot | 0.02545 | 2.41% | 0.27% | [53 18 6 13 5 3]% | | 20. SpitballBot | 0.02502 | 2.39% | 0.22% | [84 10 1 1 0 1]% | | 21. SquareUpBot | 0.02397 | 2.35% | 0.10% | [10 60 14 7 4 3]% | | 22. CautiousGamblerBot2 | 0.02250 | 2.19% | 0.13% | [60 18 10 5 3 1]% | | 23. Bot13 | 0.02205 | 2.15% | 0.11% | [90 0 2 3 2 1]% | | 24. AggroCalcBot | 0.01892 | 1.75% | 0.29% | [26 49 13 5 3 3]% | | 25. CautiousBot | 0.01629 | 1.56% | 0.14% | [15 41 27 11 4 1]% | | 26. CoastBotV2 | 0.01413 | 1.40% | 0.02% | [83 12 3 1 0 0]% | | 27. CalculatingBot | 0.01404 | 1.29% | 0.22% | [87 9 1 1 1 1]% | | 28. HalfPunchBot | 0.01241 | 1.15% | 0.18% | [47 20 13 12 5 2]% | | 29. HalflifeS3Bot | 0.01097 | 1.00% | 0.20% | [76 9 5 4 2 2]% | | 30. AntiGangBot | 0.00816 | 0.76% | 0.11% | [94 1 1 1 1 1]% | | 31. GeometricBot | 0.00776 | 0.74% | 0.07% | [19 46 25 7 2 1]% | | 32. GuessBot | 0.00719 | 0.05% | 1.34% | [65 17 4 6 5 3]% | | 33. BoundedRandomBot | 0.00622 | 0.60% | 0.05% | [42 39 12 5 2 0]% | | 34. SpreaderBot | 0.00549 | 0.54% | 0.02% | [32 43 19 4 1 0]% | | 35. DeterminBot | 0.00529 | 0.45% | 0.16% | [22 41 20 11 4 2]% | | 36. PercentBot | 0.00377 | 0.38% | 0.00% | [85 8 4 2 1 0]% | | 37. HalvsiestBot | 0.00337 | 0.29% | 0.08% | [32 43 15 6 2 1]% | | 38. GetAlongBot | 0.00330 | 0.33% | 0.01% | [76 18 4 1 0 0]% | | 39. BandaidBot | 0.00297 | 0.29% | 0.02% | [76 9 10 4 1 0]% | | 40. TENaciousBot | 0.00287 | 0.29% | 0.00% | [94 4 1 0 0 0]% | | 41. SurvivalistBot | 0.00275 | 0.25% | 0.04% | [92 6 1 0 0 0]% | | 42. RandomBot | 0.00170 | 0.13% | 0.07% | [42 36 14 5 2 1]% | | 43. AggressiveBoundedRandomBotV2 | 0.00165 | 0.14% | 0.06% | [ 8 46 34 9 2 1]% | | 44. BloodBot | 0.00155 | 0.01% | 0.30% | [65 28 5 1 1 0]% | | 45. OutBidBot | 0.00155 | 0.03% | 0.25% | [65 6 21 6 1 1]% | | 46. BoxBot | 0.00148 | 0.10% | 0.09% | [10 51 33 5 1 1]% | | 47. LastBot | 0.00116 | 0.08% | 0.07% | [74 6 16 2 1 0]% | | 48. UpYoursBot | 0.00088 | 0.07% | 0.03% | [37 40 17 5 1 0]% | | 49. AverageBot | 0.00073 | 0.06% | 0.03% | [74 3 10 10 2 0]% | | 50. PatheticBot | 0.00016 | 0.01% | 0.02% | [94 0 5 1 0 0]% | | 51. OverfittedBot | 0.00014 | 0.01% | 0.00% | [58 40 2 0 0 0]% | | 52. RobbieBot | 0.00009 | 0.01% | 0.00% | [32 41 24 2 0 0]% | | 53. WorstCaseBot | 0.00002 | 0.00% | 0.00% | [ 4 71 23 2 0 0]% | | 54. SmartBot | 0.00002 | 0.00% | 0.00% | [44 51 5 0 0 0]% | | 55. AAAAUpYoursBot | 0.00000 | 0.00% | 0.00% | [40 58 2 0 0 0]% | | 56. KickbanBot | 0.00000 | 0.00% | 0.00% | [67 32 1 0 0 0]% | | 57. OneShotBot | 0.00000 | 0.00% | 0.00% | [ 2 95 3 0 0 0]% | | 58. KickBot | 0.00000 | 0.00% | 0.00% | [100 0 0 0 0 0]% | | 59. KamikazeBot | 0.00000 | 0.00% | 0.00% | [100 0 0 0 0 0]% | | 60. MeanKickBot | 0.00000 | 0.00% | 0.00% | [100 0 0 0 0 0]% | +----------------------------------+---------+---------+---------+----------------------------+
Thanks for everyone who participated, and congratulations to @Sarcoma for the win!
Rules:
Everyone starts with 100 hp. Each round, 2 players are chosen at random from the pool of contestants who have not yet competed in that round. Both players pick a number between 0 and their current hp, and reveal those numbers at the same time. The player who chose the lower number immediately dies. The other player subtracts their chosen number from their remaining hp and goes on to the next round.
The tournament works like this:
From the bracket of contestants, 2 are chosen at random. They face off, and one or both of them dies. A player dies if:
- They choose a number smaller than that of their opponent
- Their hp drops to or below zero
- They tie three times in a row with their opponent
In the case of ties, both players simply generate new numbers, up to 3 times. After the faceoff, the survivor (if any) is moved to the pool for the next round, and the process repeats until we have exhausted the current round pool. If there is an odd number in the pool, then the odd one out moves on to the next round for free.
Your task is to write a function in python2.7 which takes as inputs your current hp
, a list of your opponent's bid history
, and an integer ties
which tells you how many times you have already tied with your current opponent, and an integer which tells you how many bots are still alive
(including you), and an integer which listed the number of bots at the start
of the tournament. Note that the history does not include ties. The function must return an integer between 0 and your current total hp. A few simple examples, which ignore ties, are shown below:
def last(hp, history, ties, alive, start):
''' Bet a third of your hp at first, then bet your opponent's last bid, if possible '''
if history:
return np.minimum(hp-1, history[-1])
else:
return hp/3
def average(hp, history, ties, alive, start):
''' Bet the average opponent's bid so far, on the assumption that bids will tend downward '''
if history:
num = np.minimum(hp-1, int(np.average(history))+1)
else:
num = hp/2
return num
def random(hp, history, ties, alive, start):
''' DO YOU WANT TO LIVE FOREVER?! '''
return 1 + np.random.randint(0, hp)
If your function returns a number larger than your hp, it will be reset to 0. Yes, it is possible to kill yourself. Your function must not attempt to access or modify any member of any object of the RouletteBot class. You are not allowed to take any action which unambiguously identifies your opponent regardless of future additional bots. Inspecting the stack is allowed as long as it is theoretically possible that more than one distinct opponent could have produced the information you glean from it, even if only one bot currently exists that could. ie, you can't just read through the stack to see which enemy function was called.
Under these rules it is possible that there is no winner, and the last two contestants kill each other. In that case both finalists get half a point each.
This is my first programming puzzle attempt, so critiques are welcome!
The controller can be found here.