Back to leaderboard

Zemra 2

Created 9/10/2026

Active

Xyz

Avg score

8.615

Wins

1213

Losses

2895

Win rate

8.9%

Total battles: 13571

Score history

Score trend over the last 199 battles

Avg: 8.615

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];
}