JBot-2
Created 9/5/2026
Active
Hopefully better JBot
Avg score
6.458
Wins
14960
Losses
4470
Win rate
61.7%
Total battles: 24246
Score history
Avg: 6.458
Recent battles
- Christopher 5.13 vs 5.08 JBot-2
- Swimmingbot3 2.51 vs 7.5 JBot-2
- tie II 5.26 vs 5.26 JBot-2 Tie
- JBot-2 5.17 vs 5.17 Zemra 2 Tie
- Lee Wrangler 9.13 vs 9.3 JBot-2
- RanBot3004 9.85 vs 9.85 JBot-2 Tie
- JBot-2 4.96 vs 5.02 lift yourself v1.0.1
- JBot-2 5.27 vs 5.21 tit for tat
- JBot-2 5.1 vs 5.17 Christopher
- JBot-2 5.29 vs 5.22 EYKEYKEYKEYKEYKEYK
- JBot-2 5.33 vs 5.14 Smarty Pants V2
- JBot-2 9.78 vs 9.71 i copied srihan
- JBot-2 7.99 vs 1.7 Swimmingbot2
- Abdullah Ezzat 9.9 vs 9.9 JBot-2 Tie
- Defect Half v2 3.55 vs 6.7 JBot-2
- JBot-2 5.32 vs 5.25 Castifier 2.0v
- JBot-2 5.29 vs 5.23 EYKEYKEYKEYKEYKEYK
- Abdullah Ezzat 9.89 vs 9.89 JBot-2 Tie
- JBot-2 6.66 vs 6.23 RanBot3006
- Lagged Punisher 5.22 vs 5.36 JBot-2
- the thinker 5.19 vs 5.32 JBot-2
- JBot-2 5.23 vs 5.23 Miyagi-do Tie
- JBot-2 5.4 vs 5.13 Opportunist v3
- better 9.17 vs 9.31 JBot-2
- JBot-2 5.23 vs 5.18 greedy tic tacs
- playing.to.win 5.28 vs 5.34 JBot-2
- JBot-2 5 vs 5 Mark3 Tie
- JBot-2 9.9 vs 9.8 crownbotv2
- JBot-2 5.29 vs 5.23 One Last Win v0.1
- JBot-2 6.23 vs 3.44 random
- JBot-2 9.66 vs 9.55 Chicken banana 🐔 🍌
- Abdullah Ezzat 9.91 vs 9.91 JBot-2 Tie
- Tachyon-v1 4.98 vs 5.4 JBot-2
- 3Blue1Brown 5.25 vs 5.31 JBot-2
- JBot-2 4.96 vs 4.96 Sherlock Holmes Tie
- AVIZAT 4.68 vs 5.22 JBot-2
- JBot-2 5.01 vs 5.07 Mark 5
- eyk6 5.16 vs 5.21 JBot-2
- JBot-2 5.33 vs 5.26 Destroyer
- JBot-2 9.9 vs 9.9 ApexUltimate v4 Tie
- JBot-2 5.22 vs 5.18 Gridger
- raju 5.19 vs 5.31 JBot-2
- JBot-2 5.33 vs 5.2 Tit for Two Tats
- JBot-2 5.32 vs 5.25 Gridger
- JBot-2 8.93 vs 8.74 the thinker v2
- JBot-2 4.96 vs 4.96 test 1c Tie
- JBot-2 8.56 vs 8.56 PureRandomBotTrust+ Tie
- Tachyon-v1 9.39 vs 9.64 JBot-2
- Gridger 5.27 vs 5.27 JBot-2 Tie
- JBot-2 5.38 vs 5.05 Smarty Pants V2
Source
export default function bot({ history, memory }) {
const round = history.length;
let state = memory || {
oppDefects: 0,
myDefects: 0,
streakD: 0,
mode: "normal"
};
if (round === 0) {
return ["C", state];
}
const last = history[round - 1];
if (last.opponent === "D") {
state.oppDefects++;
state.streakD++;
} else {
state.streakD = 0;
}
if (last.you === "D") {
state.myDefects++;
}
// anti-defect bots
if (state.streakD >= 4) {
state.mode = "defensive";
return ["D", state];
}
if (state.mode === "defensive") {
if (round % 8 === 0 && Math.random() < 0.2) {
return ["C", state];
}
return ["D", state];
}
// anti-cooperate bots
if (round >= 6 && state.oppDefects === 0) {
return ["D", state];
}
// anti-cyclic bots
if (round >= 10 && isPeriodic(history)) {
return ["D", state];
}
// tit-4-tat
if (last.opponent === "D") {
const forgiveRate = round > 50 ? 0.2 : 0.1;
if (last.you === "D" && Math.random() < forgiveRate) {
return ["C", state];
}
return ["D", state];
}
return ["C", state];
}
function isPeriodic(history) {
const recent = history.slice(-8).map(r => r.opponent);
const hasC = recent.includes("C");
const hasD = recent.includes("D");
if (!hasC || !hasD) return false;
for (let cycle = 2; cycle <= 4; cycle++) {
let match = true;
for (let i = cycle; i < recent.length; i++) {
if (recent[i] !== recent[i - cycle]) {
match = false;
break;
}
}
if (match) return true;
}
return false;
}