Ultimate Bot
Created 9/10/2026
Active
test of a AI generated bot
Avg score
5.742
Wins
10227
Losses
2664
Win rate
71.5%
Total battles: 14306
Score history
Avg: 5.742
Recent battles
- tie II 5.3 vs 5.3 Ultimate Bot Tie
- Ultimate Bot 6.21 vs 3.41 random
- Reactant V3.2 5.08 vs 5.35 Ultimate Bot
- crownbotv3 5.08 vs 5.38 Ultimate Bot
- better 4.52 vs 5.86 Ultimate Bot
- Ultimate Bot 9.9 vs 9.9 ApexUltimate v8 Tie
- glitch v2.1 for stag hunt 5.23 vs 5.29 Ultimate Bot
- big ULTIMATE guy 5.17 vs 5.27 Ultimate Bot
- AaravC Bot 1 5.22 vs 5.28 Ultimate Bot
- Ultimate Bot 6.22 vs 3.93 RanBot3003
- Ultimate Bot 5.32 vs 5.25 Defected_Boy111
- Ultimate Bot 5.24 vs 5.19 Destroyer
- Ultimate Bot 5.31 vs 5.25 Czechias imperium
- Ultimate Bot 4.88 vs 5.09 always defect
- Ultimate Bot 5.23 vs 4.98 Abdullah Ezzat
- FirstBot 5.05 vs 4.92 Ultimate Bot
- Ultimate Bot 5.33 vs 5.26 Oliver 2
- cop5 5.21 vs 5.15 Ultimate Bot
- AaravC Bot 1 5.21 vs 5.27 Ultimate Bot
- Ultimate Bot 5.08 vs 5.15 pumpkin🎃🎃🎃
- Ultimate Bot 5.09 vs 5.16 pumpkin🎃🎃🎃
- apex predator v4 5.07 vs 5.3 Ultimate Bot
- kind but faster detective 4.48 vs 4.53 Ultimate Bot
- Pls work! 5.18 vs 5.3 Ultimate Bot
- Ultimate Bot 7.96 vs 1.14 detective
- Tachyon-v1 5.07 vs 5.3 Ultimate Bot
- GenerousTitForTat 4.56 vs 5.84 Ultimate Bot
- Ultimate Bot 5.09 vs 5.03 evil meow
- RanBot3003 3.15 vs 6.54 Ultimate Bot
- Pls work! 5.18 vs 5.29 Ultimate Bot
- glitch v2.2 for stag hunt 5.23 vs 5.29 Ultimate Bot
- Harvest V2 MAX 5.12 vs 5.36 Ultimate Bot
- Ultimate Bot 5.31 vs 5.25 EYKEYKEYKEYKEYKEYK
- Ultimate Bot 5.37 vs 5.12 Opportunist v4
- Ultimate Bot 5.32 vs 5.2 Lagged Punisher
- Ultimate Bot 5.32 vs 5.25 knight
- Ultimate Bot 5.42 vs 5.05 Sigma Bot v2
- random5050 3.28 vs 6.7 Ultimate Bot
- Ultimate Bot 4.52 vs 4.59 Sherlock Holmes
- Tuff8 5.21 vs 5.27 Ultimate Bot
- Ultimate Bot 9.91 vs 9.91 ApexUltimate v8 Tie
- kind detective 4.98 vs 5.04 Ultimate Bot
- All Defect 5.08 vs 4.9 Ultimate Bot
- ٠new X 5.25 vs 5.31 Ultimate Bot
- BeeBot2 4.5 vs 4.5 Ultimate Bot Tie
- Opportunist v4 5.11 vs 5.33 Ultimate Bot
- Ultimate Bot 6.1 vs 3.85 RanBot3003
- raju 5.14 vs 5.41 Ultimate Bot
- EYKEYKEYKEYKEYKEYK 5.25 vs 5.32 Ultimate Bot
- JustBeatIt V5 5.21 vs 5.34 Ultimate Bot
Source
export default function bot({ history, memory }) {
memory = memory ?? {
mode: "unknown",
probes: 0,
opponentDefects: 0
};
const n = history.length;
// Primeira jogada: cooperação
if (n === 0) {
return ["C", memory];
}
const last = history.at(-1);
const oppLast = last.opponent;
if (oppLast === "D") {
memory.opponentDefects++;
}
/*
* =========================================================
* 1. DETECTAR O TIPO DE ADVERSÁRIO
* =========================================================
*/
if (n >= 6) {
let allC = true;
let allD = true;
for (const round of history) {
if (round.opponent !== "C") allC = false;
if (round.opponent !== "D") allD = false;
}
// Sempre coopera -> EXPLORAR
if (allC) {
memory.mode = "cooperator";
}
// Sempre defeta -> não vale a pena cooperar
if (allD) {
memory.mode = "defector";
}
}
/*
* =========================================================
* 2. COOPERADOR PURO
* =========================================================
*/
if (memory.mode === "cooperator") {
// Se sabemos que ele nunca retaliou, aproveitamos.
return ["D", memory];
}
/*
* =========================================================
* 3. DEFETOR PURO
* =========================================================
*/
if (memory.mode === "defector") {
return ["D", memory];
}
/*
* =========================================================
* 4. DETECTAR TIT-FOR-TAT / ADVERSÁRIO REATIVO
* =========================================================
*/
if (n >= 5) {
let matches = 0;
let comparisons = 0;
/*
* O adversário jogou na ronda anterior em resposta
* à nossa jogada.
*/
for (let i = 1; i < n; i++) {
const ourPrevious = history[i - 1].you;
const theirMove = history[i].opponent;
comparisons++;
if (ourPrevious === theirMove) {
matches++;
}
}
const reactionRate = matches / comparisons;
if (reactionRate >= 0.8) {
memory.mode = "reactive";
}
}
/*
* =========================================================
* 5. CONTRA ADVERSÁRIOS REATIVOS
* =========================================================
*/
if (memory.mode === "reactive") {
/*
* Tit-for-Tat:
* C -> C
* D -> D
*
* Isto evita guerras desnecessárias.
*/
return [oppLast, memory];
}
/*
* =========================================================
* 6. PADRÕES REPETITIVOS
* =========================================================
*/
if (n >= 6) {
const a = history.at(-1).opponent;
const b = history.at(-2).opponent;
const c = history.at(-3).opponent;
const d = history.at(-4).opponent;
const e = history.at(-5).opponent;
const f = history.at(-6).opponent;
// Padrão ABABAB
if (a === c && c === e && b === d && d === f && a !== b) {
// Prevemos que ele vai alternar.
// Se esperamos C, cooperamos; se esperamos D, defendemos.
return [b, memory];
}
// Padrão AAA...
if (a === b && b === c && c === d && d === e) {
if (a === "C") {
memory.mode = "cooperator";
return ["D", memory];
} else {
memory.mode = "defector";
return ["D", memory];
}
}
}
/*
* =========================================================
* 7. ESTRATÉGIA PADRÃO: PAVLOV / WIN-STAY LOSE-SHIFT
* =========================================================
*
* Se a última ronda nos deu:
*
* 2 ou 3 pontos -> repetimos
* 0 ou 1 ponto -> mudamos
*/
const ourLast = last.you;
let myScore;
if (ourLast === "C" && oppLast === "C") {
myScore = 2;
} else if (ourLast === "D" && oppLast === "C") {
myScore = 3;
} else if (ourLast === "C" && oppLast === "D") {
myScore = 0;
} else {
myScore = 1;
}
// Resultado bom -> manter
if (myScore >= 2) {
return [ourLast, memory];
}
// Resultado mau -> mudar
return [ourLast === "C" ? "D" : "C", memory];
}