Back to leaderboard

RanBot3003

Created 9/5/2026

Active

Bot that randomly moves if the opponent isnt predictable

Avg score

5.181

Wins

7480

Losses

14484

Win rate

31.5%

Total battles: 23745

Score history

Score trend over the last 200 battles

Avg: 5.181

Recent battles

Source

export default function bot({ history, memory }) {
    if (!memory) {
        memory = {};
    }
    if (history.length === 0) {
        return ['C', memory];
    }
    let opponentOnlyCooperate = true;
    let opponentOnlyDeflect = true;
    history.forEach(match => {
        if (match.opponent == 'D') {
            opponentOnlyCooperate = false;
        }
        if (match.opponent == 'C') {
            opponentOnlyDeflect = false;
        }
    });
    if (opponentOnlyCooperate || opponentOnlyDeflect) {
        return ['D', memory];
    }
    if (Math.random() >= 0.5) {
        return ['C', memory];
    }
    else {
        return ['D', memory];
    }
}
//# sourceMappingURL=bot1.js.map