Results are now out here!
Congratulations offset prediction for winning the challenge!
Don't worry if you missed out, the controller code as well as all the bots that competed are all in the Github repo, so you can always test your bot against those that competed in the challenge yourself.
(Hover for more info)
This challenge, inspired by the xkcd comic above, is where bots must try to maximise their grades for two subjects: Cybersecurity and Game Theory.
Mechanics
All of the bots presumably have adequate hacking skills to change their own score to whatever they desire within the range of 0-100. This may or may not be due to the fact that the school security systems are rubbish.
Each round, the bots will receive last round's cybersecurity scores in no particular order in an array as input. This is to help make informed decisions about their opponents.
Scoring
The final score for each round is the geometric mean of the two individual scores:
- The Cybersecurity score is simply the raw score outputted by the bot.
- The Game Theory score is equal to
100 - abs(avg * 0.8 - score)
whereavg
is the average Cybersecurity score andscore
is the bot's Cybersecurity score.
Using the geometric mean rather than the arithmetic mean is to penalise any strategies that neglect one score to maximise the other.
The score for each round is added to a total score. The bot with the highest total score at the end of the game wins!
Specifications
The challenge is in JS.
Your bot must be an object that has a run
method that takes an array of numbers as input and returns a number between 1 and 100 inclusive.
Other rules
- Storing data in your bot's properties is allowed, and encouraged!
- Using
Math.random
is allowed. - Using the helper functions
sum
andaverage
is allowed. - Trying to access any other variables outside your bot's own properties is forbidden.
- Standard loopholes apply.
Controller code can be found here.
Example bots
{
// Example bot
// It assumes all other bots are greedy and choose 100
// So it chooses 80
name: "Simpleton", // Just for fun
run() {
return 80
}
}
{
// Example bot
// He assumes everyone will choose the same scores as last round
// So he chooses 80% of the average last round
name: "LastRounder",
own: 0, // Setting properties is allowed
run(scores) {
// The average of everyone else's score x 0.8
this.own = (sum(scores) - this.own) / (scores.length - 1) * 0.8
return this.own
}
}
Clarification: Both example bots play in the game as well.
Submissions are due by 11:59pm UTC on Saturday 1 May, but I might be lenient depending on when I'm next online.
If I have made a mistake in my code, feel free to point it out. Thanks
Trying to access any other variables outside your bot's own properties is forbidden.
That's no fun! Javascript has so many neat reflection capabilities that could be abused to render the JS engine unusable for all other bots though \$\endgroup\$