Back to leaderboard

PureRandomBotTrust+

Created 9/7/2026

Active

PureRandomBotTrust+

Avg score

8.113

Wins

9118

Losses

2228

Win rate

52.5%

Total battles: 17380

Score history

Score trend over the last 200 battles

Avg: 8.113

Recent battles

Source

/**
 * Bot Strategy:
 * 1. Always start with "D" on Round 1.
 * 2. As soon as opponent plays "C", transition to cooperation.
 * 3. Echo-breaker on Round 3: absorbs standard Tit-for-Tat retaliation to unlock 2.0 pts/round.
 * 4. Endgame Defect: Always play "D" on the 100th turn (history.length === 99).
 */
export default function bot({ history }) {
  // Round 1: Always start with "D"
  if (history.length === 0) {
    return ["D", null];
  }

  // 100th turn (0-indexed 99): Always play "D"
  if (history.length === 99) {
    return ["D", null];
  }

  // If opponent has never played "C", continue defecting (protect 1.0 floor)
  const opponentEverCooperated = history.some(round => round.opponent === "C");
  if (!opponentEverCooperated) {
    return ["D", null];
  }

  // Reconcile with Tit-for-Tat bots on Round 3:
  // If we played D on R1 (opp played C), and we played C on R2 (opp played D):
  // Play "C" on Round 3 to break the 1.50-point deadlock and reach 2.00 pts/round.
  if (history.length === 2 && history[0].opponent === "C" && history[1].opponent === "D") {
    return ["C", null];
  }

  // Otherwise, reciprocate opponent's last move
  const lastOpponentMove = history.at(-1)?.opponent ?? "D";
  return [lastOpponentMove, null];
}