Back to leaderboard

Mark3

Created 9/6/2026

Active

Better than Mark2

View code

Avg score

6.940

Wins

11269

Losses

3537

Win rate

54.0%

Total battles: 20858

Score history

Score trend over the last 199 battles

Avg: 6.940

Recent battles

Source

export default function bot({ history, memory }) {
    let move;

    if (history.length < 3) {
        move = Math.random() < 0.5 ? "C" : "D";
    } 
    else {
        const recent = history.slice(-5);

        let def = 0;

        for (const round of recent) {
            if (round.opponent === "D") {
                ++def;
            }
        }

        if (def >= 3) {
            move = "D";
        }
        else {
            move = history.at(-1).opponent === "D" ? "D" : "C";
        }
    }

    return [move, memory];
}