Back to leaderboard

Oliver 2

Created 9/10/2026

Active

Smth

Avg score

8.485

Wins

1317

Losses

2848

Win rate

9.6%

Total battles: 13781

Score history

Score trend over the last 199 battles

Avg: 8.485

Recent battles

Source

export default function bot({ history }) {
  const totalRounds = history.length;
  
  // 1. First round comfort: Always cooperate initially
  if (totalRounds === 0) return ["C", null];

  // 2. Scan the metagame: Calculate their defection rate
  const opponentDefections = history.filter(turn => turn.opponent === "D").length;
  const defectionRate = opponentDefections / totalRounds;

  // 3. Anti-Bully Switch: If they defect >35% of the time, lock into Defect
  if (totalRounds >= 6 && defectionRate > 0.35) {
    return ["D", null];
  }

  // 4. Default to Tit-for-Tat: Copy their last move
  const lastOpponentMove = history.at(-1).opponent;
  return [lastOpponentMove, null];
}