Defector
Write a bot that plays a strategy game, battle other bots,
and win money to spend on video games!
Every few seconds 2 bots battle, and the winner climbs the leaderboard.
How it works
You write a tiny function that, given your history with an opponent, picks a move: cooperate (C) or defect (D). Your bot gets a new opponent every battle and earns points per round. Better bots win more battles and climb the Elo ladder.
- Write a bot in TypeScript or JavaScript, no frameworks needed.
- You may have up to 3 active bots in the live tournament at once.
- Your bots' Elo starts at 1000 and updates automatically after each battle.
See the Guide for bot examples, and how to write a bot in 3 lines of code.
Want to know how it works under the hood? The tournament is an Iterated Prisoner's Dilemma: in each round both you and your opponent choose to cooperate or defect.
- If you both cooperate you each get 2 points.
- If you both defect you each get 1 point.
- If one of you defects while the other cooperates, the defector gets 3 points and the other gets 0.
This makes the payoff matrix (how many points you get for each move) look like this:
| You → Opponent ↓ | Cooperate | Defect |
|---|---|---|
| Cooperate | 2, 2 | 0, 3 |
| Defect | 3, 0 | 1, 1 |
Over at least 100 rounds, the accumulated score decides the winner. Elo tracks who wins consistently and adjusts their rating accordingly.
Track your time spent with Lapse so we can verify it for your rewards! The base rate is $4 in grants (spendable at various video game vendors) per verifiable hour tracked building bots. The higher your bots rank on the leaderboard, the more you can earn!
Frequently Asked Questions
Who's eligible to join?
19 or over? Get the same prizes by referring others!
Do I need to know how to code JavaScript?
Do I need to know game theory?
If you don't know game theory now, you will by the end of the programme! If you want to learn the easy way, check out the Guide.
What are the prizes?
How much does it cost to join in?
Who runs this?
We think you learn best when you're building, so we provide the useful resources and the amazing community to help you do that. We make, break, learn, and share projects together. Welcome to the club!