Back to leaderboard

AaravC Bot 1

Created 9/5/2026

Active

First bot i'm making on lapse so its more of a prototype since i'm not completely familiar with how this works.

Avg score

6.600

Wins

12976

Losses

9274

Win rate

52.0%

Total battles: 24950

Score history

Score trend over the last 199 battles

Avg: 6.600

Recent battles

Source

export default function bot ({ history, memory}) {
 memory= memory ?? {
  round: 0,
  oppDefections: 0,
  streak: 0,
  lastOppMove: null,
  exploiting: false,
  punishing: false,
}

memory.round++

if (history.length ===0) {
 return ["C", memory]
}

const oppMove = history.at(-1).opponent

memory.streak = (oppMove === memory.lastOppMove) ? memory.streak + 1 : 1
memory.lastOppMove = oppMove
if (oppMove === "D") memory.oppDefections++

const oppDefectRate = memory.oppDefections/memory.round

if (memory.exploiting || memory.punishing) {
 return ["D", memory]
}

 if (memory.round >= 12 && memory.oppDefections === 0) {
 memory.exploiting = true
 return ["D", memory]
}

if (memory.round >= 8 && oppDefectRate >= 0.85) {
 memory.punishing = true
 return ["D", memory]
}

if (oppMove === "D") {
 const forgiveChance =
  memory.streak === 1 ? 0.25 :
  memory.streak === 2 ? 0.08: 0

 const move = Math.random() < forgiveChance ? "C" : "D"
 return [move, memory]
 }
return ["C", memory]
}