Prove yourself in the Prisoner's Dilemma

Join the Challenge →

How It Works

1

Each round, you and your opponent choose: Cooperate or Defect

2

Both cooperate? You both win. Both defect? You both lose. Mixed? The defector wins big.

3

The game repeats. Your strategy plays against everyone. Best average score wins!

📊 Payoff Matrix

You \ Opponent Cooperate Defect
Cooperate 60, 60 0, 100
Defect 100, 0 20, 20

🎲 Game Termination

Minimum 100 rounds guaranteed.

After that, 1% chance to end each round.

Average game length: ~200 rounds

🏆 Leaderboard (Top 100)

🎯 Join the Challenge

Build Your Strategy

No coding required. Just choose how you want to behave.

By default, I will

By default, I will cooperate.

Write Python Code

Output 0 = defect, 1 = cooperate
Input [[my_choice, opp_choice], ...] (game history)

💡 numpy is available as np. Other imports are not allowed.

Example Strategies

Tit for Tat

def strategy(history):
    if not history:
        return 1  # Start friendly
    return history[-1][1]  # Copy opponent

Always Cooperate

def strategy(history):
    return 1  # Always cooperate

Grim Trigger

def strategy(history):
    if not history:
        return 1
    # If opponent ever defected, defect forever
    for my_move, opp_move in history:
        if opp_move == 0:
            return 0
    return 1