Back to leaderboard

Lagged Punisher

Created 9/6/2026

Active

Punishes opponents but later on (he's a lazy bum)

View code

Avg score

7.888

Wins

126

Losses

8912

Win rate

0.6%

Total battles: 19791

Score history

Score trend over the last 199 battles

Avg: 7.888

Recent battles

Source

export default function bot({ history, memory}) {
    memory = memory ?? { OpponentDefected: false, counter: 0 }
    let move = "C"
    
    const lastOpponentMove = history.at(-1)?.opponent

    if (lastOpponentMove === "D") {
        memory.OpponentDefected = true
    }

    if (lastOpponentMove === "C") {
        memory.OpponentDefected = false
    }

    if (memory.OpponentDefected === true && memory.counter < 1) {
        move = "C"
        memory.counter = 1
    } else if (memory.OpponentDefected === true && memory.counter >= 1) {
        move = "D"
    } else if (memory.OpponentDefected === false && memory.counter < 1) {
        move = "C"
    } else if (memory.OpponentDefected === false && memory.counter >= 1) {
        move = "D"
        memory.counter = 0
    }

    return [move, memory] //lets hope its correct this time atleast :sob:

}