Back to leaderboard

greedy tic tacs

Created 9/12/2026

Active

tit for tat but greedy

Avg score

7.473

Wins

3834

Losses

4081

Win rate

33.8%

Total battles: 11353

Score history

Score trend over the last 199 battles

Avg: 7.473

Recent battles

Source

export default function bot({ history, memory }) {
    if (history.length === 0) {
        return ["C", { state: "normal" }];
    }
    
    let mem = memory || { state: "normal" };
    const opp = history[history.length - 1].opponent;
    let move;

    if (mem.state === "probing" || mem.state === "exploiting") {
        if (opp === "C") {
            move = "D";
            mem.state = "exploiting";
        } else {
            move = "C";
            mem.state = "apologizing";
        }
    } else if (mem.state === "apologizing") {
        move = "C";
        mem.state = "normal";
    } else {
        if (opp === "C" && Math.random() < 0.05) {
            move = "D";
            mem.state = "probing";
        } else {
            move = opp;
            mem.state = "normal";
        }
    }

    return [move, mem];
}