Inspired by the eponymous article from TheZvi.
The Darwin Game is a strategic competition based on the iterated Nash bargaining game, with rules designed to simulate evolution through natural selection among competing programs.
This repo is implementing the Darwin Game tournament platform in Python, allowing you to run a tournament with different strategy implementations. Some strategies generated by ChatGPT are already included.
Primary: to have as many copies of your program in the pool at the end of the 200th round as possible.
Secondary: to ensure at least one copy of your program survives as many rounds as possible.
- Each player starts with 100 copies of their program in the pool.
- In each round, programs are paired randomly to compete against one another, including the possibility of a program competing against its own copy.
- Each paired set of programs engages in an iterated Nash bargaining game, where each turn involves both players simultaneously choosing an integer between 0 and 5.
- If the sum of both numbers is 5 or less, each player scores points equal to the number they chose.
- If the sum exceeds 5, neither player scores any points.
- The exact number of turns in each game is large but undisclosed, to prevent end-game strategies.
- The total points scored by all copies of a program are aggregated.
- The proportion of the total points a program scores dictates the percentage of the pool it will claim in the next round. This means successful strategies gain more copies, simulating evolutionary success.
The Darwin Game encourages players to evolve their strategies over time, balancing short-term gains with long-term survival and success, mirroring the principles of natural selection and adaptation.
- Implement your player as a child of the Player abstract class.
- Place your player class into the
/darwin_game/players
(sub)folder. - Your code should not take more than 0.0003 seconds to run, otherwise your turn will be counted as 0
You will need Python 3.12 to run the tournament.
poetry install
poetry run python -m darwin_game.run_tournament
That will run the tournament with the players currently in the /darwin_game/players
folder.