Back to leaderboard

PureRandomBotTrust

Created 9/7/2026

Active

This bot is pure random, trust me on this one.

Avg score

8.272

Wins

5332

Losses

2875

Win rate

30.3%

Total battles: 17575

Score history

Score trend over the last 199 battles

Avg: 8.272

Recent battles

Source

/**
 * Bot Strategy: Suspicious Tit-for-Tat with TFT Reconnection
 * 
 * 1. Always starts with "D" (defect on round 1).
 * 2. As soon as opponent plays "C", switches to cooperating.
 * 3. Includes an echo-breaker on round 3 so that against standard Tit-for-Tat
 *    (which retaliates on round 2 for our opening D), we forgive the retaliation
 *    and achieve 2.0 pts/round mutual cooperation instead of getting trapped in a 1.5 pts/round alternating loop.
 */
export default function bot({ history }) {
  // Round 1: Always start with "D"
  if (history.length === 0) {
    return ["D", null];
  }

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

  // Round 3 Reconnection:
  // If we played D & opp played C on round 1, then we played C & opp retaliated with D on round 2:
  // Playing "C" on round 3 breaks the alternating deadlock with Tit-for-Tat bots
  // and establishes stable mutual cooperation (2.0 pts/round).
  if (history.length === 2 && history[0].opponent === "C" && history[1].opponent === "D") {
    return ["C", null];
  }

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