17
5
The internet has failed. DDoS attacks are now rampant and widespread. It is up to you to take control and repair the internet.
Each bot will control 20 nodes in this network. Every node is either active or safe, has an owner, and has a strength, which starts at 2. Every active node is connected to all other active nodes.
Each turn, you will receive a list of all active nodes with their strength. For each of the active nodes that you own, you either:
- Designate an active node you want to transfer your entire strength to, or
- Save and increase its strength
Then the following happens in order:
- A Node choosing to save its strength will increase its strength by 1.
- All nodes choosing to transfer their strength will simultaneously transfer their entire strength to the new node.
- If a node was transferred strength from an enemy node, an attack will ensue. If an enemy owner collectively transfers more strength than the original owner (and all other attackers), then that enemy becomes the new owner. The strength of that node then becomes the strength of the attacker. If there is a tie for strength, then the owner will be chosen randomly.
- All nodes left without any strength will be considered safe, and gives 1 point to the owner.
After 100 games of 100 turns, the owner with the most safe nodes across all games wins. EDIT: I changed it from 2000 to 100 turns, as it ended up that the last 1900 turns were useless
IO
You will be passed the list of active nodes (via command line args) like the following:
F20 F4 E7 E2 E20 F2
F
designates that the node is a friendly node, and E
designates that the node is an enemy.
For each of your friendly nodes, you should return an action (via STDOUT) like the following:
0,0 1,3 5,0
The above would mean that you want to increase your strength of the first node, use your second node to attack the fourth node, and your last node will transfer its strength the first node (and if nobody attacks it, it will become a safe node).
After returning, your program should quit.
Scoreboard
accumulator got 3240 points
classy got 2370 points
dumbot got 2262 points
random_bot got 1603 points
smarter_random_bot got 1319 points
steady_bot got 1097 points
The controller can be found here: https://github.com/nathanmerrill/NetAttack
The controller contradicts with the specification: "If an enemy owner collectively transfers more strength than the original owner...". Currently it's equal or more. – randomra – 2015-04-01T14:47:36.257
@randomra: in the spec it says: If there is a tie for strength, then the owner will be chosen randomly – Nathan Merrill – 2015-04-01T17:14:23.803
@NathanMerrill I assumed if the attackers tie. – randomra – 2015-04-01T17:42:04.333
The last remaining node is stuck waiting until the end of the game, right? There's no way for him to run away? – aebabis – 2015-04-07T21:10:56.217
@acbabis correct, but I actually test for that and end the game prematurely at that point. – Nathan Merrill – 2015-04-07T23:50:09.373