55
18
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.
If a bot wins in the final by bidding all of its hp, does it get the point for victory or is considered dead? – AlexRacer – 2018-10-02T21:08:03.847
It would count as a tie – KBriggs – 2018-10-02T21:10:13.947
4FWIW, I plan to use a neural network trained on all the other bots just for fun once you set up the controller :) – Quintec – 2018-10-02T22:27:33.457
@Quintec That's what I was waiting for ^_^. I will post the controller tomorrow, I'm away from my computer at the moment – KBriggs – 2018-10-02T22:30:10.377
@KBriggs Does the variable 'alive' for the function include both the current bot (you) and your opponent, as well as the other bots, or just the other bots remaining? (So do I have to subtract 2 to get the 'actual number?). Further edit (sorry, enter saved comment too early): are the remaining alive bots expected to fight you in turn, or each other? So if I have 2 alive bots remaining (not counting me or my opponent) would I be expected to face one alive bot (the remainder of the 2 from another fight) or two? – SSight3 – 2018-10-03T13:02:05.687
@SSight3 yes, it includes both you and your current opponent. It just shows the current number alive - but doesn't necessarily mean anything about the number left to face. For example, with 4 bots left, if you win your battle, and the remaining 2 kill each other, you win without facing anyone else. – KBriggs – 2018-10-03T13:23:55.380
1Is there a way to know the average rounds survived per type of bot? I think that would make the optimization of the code a little more interesting. – Markov Chained – 2018-10-03T21:03:21.183
I don't collect that data currently but I certainly could. I'll implement that tomorrow – KBriggs – 2018-10-03T21:04:55.243
1@MarkovChained I added elimination probability information to the leaderboards. – KBriggs – 2018-10-04T05:33:42.930
Thanks! Also this would make for some really interesting analogous study for disease evolution yanno? – Markov Chained – 2018-10-04T07:47:52.813
What do you mean? That's not my expertise, could you elaborate? – KBriggs – 2018-10-04T12:02:42.530
@KBriggs On lines 17-19 of your controller, in guess, you are testing the type of the answer ("num") and only after you are casting it, thus, if I am not mistaken, dooming any bot that returns a float ( between others Kickbot and Punchbot)! Could you maybe let floats through and cast them ? – Johan – 2018-10-04T15:43:45.887
@Johan I will do that, but I have to run for the moment. Stay tuned for this afternoon – KBriggs – 2018-10-04T15:54:08.717
Sure, when you have time. On my local (with python 3.6) it seems sufficient to ensure that num != None with current bots. – Johan – 2018-10-04T15:59:02.250
2The type check was for the benefit of antiantiantiantiupyoursbot. I'll find another way – KBriggs – 2018-10-04T16:10:36.597
Er classybot, that is – KBriggs – 2018-10-04T16:26:50.873
@Johan how's that? I think that takes care of everything so far and doesn't obviously break anyone. – KBriggs – 2018-10-04T18:06:31.630
@KBriggs It's not my field either, but what you are doing here is basically creating a petri dish of bacteria competing for resources. They adapt to get the resources (win) and eliminate the competition. Someone has to know a microbiologist that can read code around here. – Markov Chained – 2018-10-04T19:18:49.123
@KBriggs This has been a very weird competition. I love it. Sorry for making a mess of things. <3 – Qfwfq – 2018-10-04T19:47:08.617
@KBriggs Indeed, looks perfect, apart from Kamikaze breaking itself anyway haha – Johan – 2018-10-04T19:48:17.320
@Qfwfq no need to apologize, I fully endorse exploiting my insecure code to get an advantage, within the spirit of the rules, anyway ^_^ – KBriggs – 2018-10-04T20:12:49.617
1@Quintec if you do create a neural network for this, could you send me a link to the Repo? I'm very interested in learning how this is done. – Sarcoma – 2018-10-04T20:40:16.020
Me too, actually – KBriggs – 2018-10-04T20:41:59.377
3@Sarcoma Seems like this competition has sparked a serious code war. This competition hasn't ended, but I'm already looking forward to evolution of this. Maybe even the next step, AI enhanced competition :P – Markov Chained – 2018-10-04T21:27:42.307
Excuse my ignorance about python and codegolf conventions but are you allowed to use additional modules that are not imported by the controller? No one seems to be doing it but didn't see rules stating that its not allowed – OganM – 2018-10-04T21:33:50.187
@OganM if you need another module I'll import it for you, just specify what you need in your answer. As long as it's a standard pip install anyway. – KBriggs – 2018-10-04T21:37:43.650
@MarkovChained I was cursed by coming second with my first attempt. If it were in the middle somewhere I could have just left it and moved on with my life. – Sarcoma – 2018-10-04T22:22:31.323
1
@Sarcoma Sure, though heads up - I'm probably going to use tensorflow, so the amount of work I'm doing is much less than you'd expect ;p
– Quintec – 2018-10-04T23:31:50.387@Quintec I just need to get a better understanding of it all. I have project I wanted to try it on: https://github.com/sarcoma/Python-Rummy I wanted to use machine learning to create an AI opponent, but I've not got round to it yet.
– Sarcoma – 2018-10-04T23:47:23.930Trying to work out the deadline for entries. You said 10am EST, isn't it EDT at the moment? To save any confusion could you use UTC? – Sarcoma – 2018-10-06T09:54:34.230
1@Sarcoma: 2:00 UTC, 2 hours from the timestamp on this comment – KBriggs – 2018-10-06T12:01:47.537
@KBriggs How long does a whole update with N = 100.000 take on your computer (approximately) ? – Johan – 2018-10-06T13:11:52.117
1About 10 minutes. I'll run a million for the final – KBriggs – 2018-10-06T13:16:28.273
@KBriggs Fine tuning became a pain once Mari and Og were added. Can't run reliable test runs without them though. Great battle. Good luck to all. – Sarcoma – 2018-10-06T14:05:05.013
3WOOOOOOOOOOOOOO! – Sarcoma – 2018-10-06T15:23:40.417
1Well played @Sarcoma ! – Johan – 2018-10-06T15:25:03.337
2Thanks for playing, everyone, I had a lot of fun. I'm already shopping the format in my head for next time ^_^ – KBriggs – 2018-10-06T15:28:21.543
5Oh my god. The deliberate trolling of changing mean_kick to always return zero when it was used so many places is brilliant. – Magua – 2018-10-06T17:07:39.280
1Welp, looks like I didn't have time to finish the neural network because of school, maybe next challenge :) – Quintec – 2018-10-06T18:02:43.070
1Too bad, I was really looking forward to seeing how that is done – KBriggs – 2018-10-06T18:03:25.307
1Would it be ok to use the Robot Roulette script for a developer meetup? – Sarcoma – 2018-10-06T19:24:50.107
What's a developer meetup? But sure, feel free to use it however you please – KBriggs – 2018-10-06T19:26:22.990
@Sarcoma you had in mind doing a live roulettebots competition? Could be fun. Let me know how it goes. – KBriggs – 2018-10-06T20:03:11.470
@KBriggs Yeah, I think it could be cool, it's something anyone can have a go at. – Sarcoma – 2018-10-06T20:10:58.250
1@Sarcoma I added a license to make it explicit. have fun! – KBriggs – 2018-10-06T20:54:19.770
1Thanks for the great challenge, following along with this was indeed a lot of fun! – Joshua Webb – 2018-10-07T01:55:22.753
Cheers, I'll probably tweak the format a bit and try again in a while – KBriggs – 2018-10-07T02:04:03.613
@KBriggs So do I get a tick? – Sarcoma – 2018-10-08T14:19:14.233
Oh, right. Forgot all about it – KBriggs – 2018-10-08T15:31:14.297
I posted a sandbox proposal for the next iteration of this game, please weight in if you have ideas: https://codegolf.meta.stackexchange.com/questions/2140/sandbox-for-proposed-challenges/16982#16982. It will be a few weeks before I have time to run it again, so no rush.
– KBriggs – 2018-10-10T14:15:28.3571I'm voting to close this question because it is already de-facto closed to new answers ("Final Standings") – pppery – 2019-09-04T20:44:32.623
@pppery no objections here – KBriggs – 2019-09-06T13:58:47.583
You're too lake, the community has already decided I'm out of line (although, if you want this to be closed, you could cast your own close vote I guess) – pppery – 2019-09-06T18:54:03.353
Doesn't really make a practical difference at this point – KBriggs – 2019-09-07T20:48:16.997