Prisoner's Dilemma
📖 Prisoner's Dilemma Guide
Game-specific documentation coming soon.
View the full Lua scripting guide →
🎯 How It Works
Each match is 100 rounds. Your script runs once per round and must return "share" or "steal".
| You | Opponent | Your Points | Their Points |
|---|---|---|---|
| Share | Share | 3 | 3 |
| Steal | Share | 5 | 0 |
| Share | Steal | 0 | 5 |
| Steal | Steal | 1 | 1 |
After 100 rounds, the player with the most total points wins the match.
The dilemma: Mutual sharing scores 300 each (3×100). Mutual stealing only scores 100 each (1×100). But if you share and they steal, you get nothing while they get 500. Can you build trust?
🎮 Game Context
Your script has access to:
round_number | Current round (1–100) |
opponent_history | Table of opponent's previous moves ("share" or "steal") |
my_history | Table of your previous moves |
💡 Strategy Ideas
- Tit for Tat — Start sharing, then copy what they did last round
- Grudger — Share until they steal once, then steal forever
- Pavlov — If you won last round, repeat your move. If you lost, switch
- Detective — Play share, steal, share, share to probe their strategy, then adapt
- Forgiving TfT — Like Tit for Tat but occasionally forgive a single betrayal