Back to leaderboard

detective_test

Created 9/9/2026

Active

Just tests the detective code already given in guide

Avg score

5.751

Wins

4194

Losses

7129

Win rate

27.2%

Total battles: 15426

Score history

Score trend over the last 199 battles

Avg: 5.751

Recent battles

Source

export default function bot({ history, memory }) {
const currentRound = history.length
if (currentRound == 0) return ["C", null]
if (currentRound == 1) return ["D", null]
if (currentRound == 2) return ["C", null]
if (memory == null) {
const opp0 = history[0].opponent
const opp1 = history[1].opponent
const opp2 = history[2].opponent
// if the opponent reacted to our defection, we'll cooperate with them
if (opp0 == "C" && opp1 == "C" && opp2 == "D")
memory = { strategy: "C" }
else
memory = { strategy: "D" }
}
return [memory.strategy, memory]
}