Jack in the Box
Saves up its energy until it can beat the game in 40 moves, bringing the number of average moves per game down.
{
"Jack in the Box": function(dist, energy, bots, storage) {
if (!dist) {
if (energy >= 250) {
storage.speed = energy / 100
} else {
storage.speed = .5
}
}
return storage.speed
}
}
Simpleton
Simpleton just wants to win :(
{
"Simpleton": function(dist, energy, bots, storage) {
if (!dist) {
storage.speed = energy / 100
}
return storage.speed
}
}
Steady
Steady tries to go the same amount every turn, but doesn't like having extra energy.
{
"Steady": function(dist, energy, bots, storage) {
storage.turns = storage.turns || 0
storage.totalTurns = storage.totalTurns || 0
storage.games = storage.games || 0
storage.totalEnergyGained = storage.totalEnergyGained || 0
storage.previousEnergy = storage.previousEnergy || 0
if (!dist) {
if (storage.games == 0) {
storage.speed = 1
} else {
storage.totalTurns += storage.turns
storage.turns = 0
storage.speed = Math.sqrt(storage.totalEnergyGained / storage.totalTurns) + storage.previousEnergy / storage.totalTurns
}
storage.totalEnergyGained += energy - storage.previousEnergy
storage.games++
}
storage.turns++;
storage.previousEnergy = Math.max(energy - Math.max(Math.min(storage.speed, 100 - dist, Math.sqrt(energy)), 0) ** 2, 0)
return storage.speed;
}
}