Back to leaderboard

RanBot3004

Created 9/5/2026

Active

Bot that randomly moves if the opponent isnt predictable

Avg score

5.958

Wins

2641

Losses

15093

Win rate

11.1%

Total battles: 23701

Score history

Score trend over the last 200 battles

Avg: 5.958

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;
    let opponentCooperations = 0;
    let opponentDeflections = 0;
    history.forEach(match => {
        if (match.opponent == 'D') {
            opponentOnlyCooperate = false;
            opponentDeflections += 1;
        }
        if (match.opponent == 'C') {
            opponentOnlyDeflect = false;
            opponentCooperations += 1;
        }
    });
    let coopChance = opponentCooperations / history.length;
    let deflChance = opponentDeflections / history.length;
    if (opponentOnlyCooperate || opponentOnlyDeflect) {
        return ['D', memory];
    }
    return ['C', memory];
}
//# sourceMappingURL=bot1.js.map