This project is an end-of-year project for implementing strategies in a variant of the prisoner's dilemma game. Students will write Python functions that compete against each other in a tournament to accumulate the highest total score based on a dynamic payoff matrix.
src/
: Contains the Python scripts for the tournament.tournament.py
: Core tournament logic.strategies.py
: Example strategies.
docs/
: Contains the LaTeX documentation for the project.tests/
: Contains test scripts to ensure the code works as expected.
-
Clone the repository:
git clone https://github.com/starolis/trust-or-treachery.git
-
Navigate to the src directory and run the tournament:
cd trust-or-treachery-tournament/src python tournament.py
Examples of different strategies are provided in the tournament.py script. These include always_cooperate, always_defect, tit_for_tat, score_based_strategy, reputation_based_strategy, and nuclear_option_strategy.