mahoraga v2
Created 9/2/2026
Active
more complicated version of the original, with even more complicated math, because who doesn't love math.......?
Avg score
5.191
Wins
25438
Losses
6
Win rate
80.8%
Total battles: 31465
Score history
Avg: 5.191
Recent battles
- mahoraga v2 6.03 vs 3.62 adaptive bot
- mahoraga v2 7.74 vs 1.35 Swimmingbot3
- generous tft 4.46 vs 5.4 mahoraga v2
- Apex 4.96 vs 5.03 mahoraga v2
- lift yourself v1.0.1 5 vs 5 mahoraga v2 Tie
- Lee Wrangler 4.97 vs 5.02 mahoraga v2
- mahoraga v2 5.02 vs 4.97 cop5
- ICY EXODILED AIC A-TRONICS 4.89 vs 5.09 mahoraga v2
- mahoraga v2 5.03 vs 4.97 Aura67
- mahoraga v2 7.74 vs 1.35 Swimmingbot3
- mahoraga v2 5.02 vs 4.97 EYKEYKEYKEYKEYKEYK
- Unintended Defection bot 5 vs 5 mahoraga v2 Tie
- mahoraga v2 5.09 vs 4.88 i copied srihan
- WILLIAM SMITH 4.88 vs 5.09 mahoraga v2
- mahoraga v2 5.02 vs 4.97 Defender 3.0v
- Tachyon-v1 4.75 vs 5.18 mahoraga v2
- Sigma Bot v2 4.77 vs 5.17 mahoraga v2
- evil tic tacs 5 vs 5 mahoraga v2 Tie
- defect until 2 cops 5 vs 5 mahoraga v2 Tie
- Bumwinnah4 4.93 vs 5.05 mahoraga v2
- The Ultimate Bot v3 4.8 vs 5.15 mahoraga v2
- Castifier 2.0v 4.96 vs 5.03 mahoraga v2
- mahoraga v2 5.02 vs 4.97 DR MUNDO v0.2
- mahoraga v2 5.27 vs 4.64 Bumwinnah2
- mahoraga v2 5.03 vs 4.96 OmegaTFT
- mahoraga v2 5.02 vs 4.97 glitch v2.2 for stag hunt
- mahoraga v2 5 vs 5 Test123 Tie
- zyxl bot 5 vs 5 mahoraga v2 Tie
- mahoraga v2 5.13 vs 4.82 Poseidon
- DR MUNDO v0.2 4.97 vs 5.02 mahoraga v2
- something 4.95 vs 5.04 mahoraga v2
- something 4.85 vs 5.11 mahoraga v2
- better 4.96 vs 5.03 mahoraga v2
- mahoraga v2 5.08 vs 4.9 WILLIAM SMITH
- mahoraga v2 5.11 vs 4.86 Reactant V3.5.1
- Dilemma-Bot-Hackclub 4.96 vs 5.03 mahoraga v2
- mahoraga v2 5.03 vs 4.97 OmegaTitForTat
- mahoraga v2 5.06 vs 4.92 playing.to.win
- mahoraga v2 5.04 vs 4.94 Mark3
- mahoraga v2 5.03 vs 4.96 cop7
- evil meow 4.93 vs 5.05 mahoraga v2
- Swimmingbot2 1.17 vs 7.87 mahoraga v2
- mahoraga v2 5.38 vs 4.5 Bot 1
- Agnes-distill-Tachyon-v2 4.74 vs 5.19 mahoraga v2
- mahoraga v2 5 vs 5 All Defect Tie
- mahoraga v2 5.03 vs 4.97 Lee Wrangler
- mahoraga v2 5 vs 5 Always Defect Tie
- All Defect 5 vs 5 mahoraga v2 Tie
- eyk6 4.97 vs 5.02 mahoraga v2
- generous tft 4.67 vs 5.25 mahoraga v2
Source
export default function bot({ history, memory }) {
const C = "C", D = "D", n = history.length;
if (n === 0) return [D, { version: 1 }];
const models = ["AD", "AC", "TFT", "PAV", "GRIM", "RAND"];
const logp = [-Math.log(6), -Math.log(6), -Math.log(6), -Math.log(6), -Math.log(6), -Math.log(6)];
const eps = 0.015;
let grimTriggered = false;
for (let i = 1; i < n; i++) {
if (history[i - 1].opponent === D) grimTriggered = true;
const prev = history[i - 1];
const actual = history[i].opponent;
const predictions = [
D,
C,
prev.you,
prev.you === prev.opponent ? prev.opponent : (prev.opponent === C ? D : C),
grimTriggered ? D : C,
null,
];
for (let j = 0; j < predictions.length; j++) {
const p = predictions[j] === null ? 0.5 : (predictions[j] === actual ? 1 - eps : eps);
logp[j] += Math.log(p);
}
}
const peak = Math.max(...logp);
let total = 0;
for (let i = 0; i < logp.length; i++) total += Math.exp(logp[i] - peak);
const posterior = logp.map(x => Math.exp(x - peak) / total);
const pHard = posterior[0] + 0.65 * posterior[4];
const pReciprocal = posterior[2] + posterior[3];
const last = history[n - 1];
let move = D;
if (n === 1) {
move = D;
} else if (last.opponent === D) {
move = D;
} else if (pHard > 0.72 || history.every(x => x.opponent === D)) {
move = D;
} else if (last.you === C && last.opponent === C) {
move = C;
} else if (last.you === C && last.opponent === D) {
move = D;
} else if (last.you === D && last.opponent === C) {
move = D;
} else if (last.you === D && last.opponent === D) {
move = pReciprocal > pHard + 0.08 ? C : D;
}
if (n > 8 && pReciprocal < 0.25 && last.opponent === D) move = D;
return [move === C || move === D ? move : D, memory || { version: 1 }];
}