| Bytes | Lang | Time | Link |
|---|---|---|---|
| 109 | The Run of Doom | 200409T172135Z | The Fift |
| nan | 200409T171526Z | Noodle9 |
The Run of Doom, score 109
var kid_api = function (api) {
var bunny = api.bunny();
var kids = api.kids();
for (var i = 0;i<kids.length;i++) {
if(kids[i].me) {
var me = kids[i];
if (me.x < 24) {
return api.east();
} else if (me.x > 24) {
return api.west();
} else {
var s = api.shared_storage();
var my_data = s[i];
if (!my_data) {
return;
}else if (my_data.backaway == bunny.eggs_remaining) {
return;
}else if(bunny.y == me.y + my_data.y && bunny.eggs_remaining != 1) {
s[2] = Object.assign({}, s.opposites[my_data.func])
s[0] = Object.assign({}, s.opposites[my_data.func])
s[2-i].backaway = bunny.eggs_remaining;
s[i].backaway = 1;
api[s[i].func]();
} else if (me.y + my_data.y < 0 || me.y + my_data.y > 49) {
s[i] = null;
} else {
api[my_data.func]();
}
}
}
}
}
Teams.push(
{
name: 'the_run_of_doom',
shared_storage: {
2: {"func": "north", "y": -1},
0: null,
"opposites": {
"south":{"func": "north", "y":-1},
"north":{"func":"south", "y":1}
},
},
functions: [
kid_api,
function(api) {
// NE kid
},
kid_api,
function(api) {
// SW kid
}
]
}
);
Uses only two kids: one that starts on the north side, and one that starts on the south side (this version uses NW and SE, but it could be rewritten to use NE and SW, or NE and SE, or NW and SW fairly easily). With a little more effort, one could do this with any combination of two kids.
A score of 110 isn't possible, since the game always ends immediately after the bunny drops the last egg, so I believe this answer is unbeatable.
random - 0 to 33 points
Totally random kids!
Teams.push(
{
name: 'random',
shared_storage: {
sequence: 'abcd',
take_step: function(api) {
var char = api.shared_storage().sequence[Math.floor(Math.random() * 5)];
if(char) {
api[api.my_storage()['key'][char]]();
}
}
},
functions: [
function(api) {
// NW kid
if(!api.my_storage()['key']) {
api.my_storage()['key'] = {'a': 'east', 'b': 'south', 'c': 'west', 'd': 'north'}
}
api.shared_storage().take_step(api);
},
function(api) {
// NE kid
if(!api.my_storage()['key']) {
api.my_storage()['key'] = {'a': 'east', 'b': 'south', 'c': 'west', 'd': 'north'}
}
api.shared_storage().take_step(api);
},
function(api) {
// SE kid
if(!api.my_storage()['key']) {
api.my_storage()['key'] = {'a': 'east', 'b': 'south', 'c': 'west', 'd': 'north'}
}
api.shared_storage().take_step(api);
},
function(api) {
// SW kid
if(!api.my_storage()['key']) {
api.my_storage()['key'] = {'a': 'east', 'b': 'south', 'c': 'west', 'd': 'north'}
}
api.shared_storage().take_step(api);
}
]
}
);