Back to leaderboard

AcyclicTitForTat

Created 9/10/2026

Active

Builds on TitForTat If Opponent and Self are unaligned, can randomly choose to use opposite move than opponent

Avg score

3.992

Wins

1959

Losses

3767

Win rate

30.2%

Total battles: 6488

Score history

Score trend over the last 199 battles

Avg: 3.992

Recent battles

Source

/* AcyclicTitForTat
Builds on TitForTat
If Opponent and Self are unaligned, can randomly choose to use opposite move than opponent
*/

const ATTEMPT_CORRECT = 0.8


export default function bot({ history }) {
    if (history.length === 0) {
        return ["C", null];
    }

    let lastRound = history.at(-1);

    if (history.length === 1 || lastRound.opponent === lastRound.self && Math.random() > ATTEMPT_CORRECT) {
        return [lastRound.opponent, null];
    } else {
        return [lastRound.opponent === "C" ? "D" : "C", null];
    }
}

export let botName = "AcyclicTitForTat"