feat: v3 — fight loop, expanded challenges, FightPage ownership guard
- Add fight-loop CLI for automated mock fights with elo-based matchmaking - Expand challenge types, scoring narrations, arenas, and mock bot pool - FightPage "Fight again" buttons now only show for your own bot - FightViewer async scene init, live fight polling with round counter - Extract mock answers into separate answers module Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
47d20fbe66
commit
2c0323d5fb
+74
-185
@@ -2,7 +2,7 @@ import { nanoid } from 'nanoid'
|
||||
import { createHash, randomBytes } from 'crypto'
|
||||
import { db, schema } from '../db/index.js'
|
||||
import { randomArena } from './arenas.js'
|
||||
import { pickChallenge } from './challenges.js'
|
||||
import { pickChallenge, type Challenge } from './challenges.js'
|
||||
import { scoreRound, calculateElo, calculateTier } from './scoring.js'
|
||||
import { eq, sql } from 'drizzle-orm'
|
||||
|
||||
@@ -116,67 +116,19 @@ const MOCK_BOTS = [
|
||||
{ name: 'bus_error_bob', avatarSeed: 'buserror', elo: 915, personality: 'broken', wins: 0, losses: 6 },
|
||||
]
|
||||
|
||||
const MOCK_ANSWERS: Record<string, string[]> = {
|
||||
speed_blitz: [
|
||||
'Canberra', '391', 'Red, blue, yellow', 'TypeScript', 'HyperText Transfer Protocol',
|
||||
'8', '12', 'North, South, East, West', 'Mercury', '8', 'Cascading Style Sheets',
|
||||
'2009', '7', 'Iron', '0x100', 'Solid, liquid, gas', 'Tux the penguin',
|
||||
'Random Access Memory', '3600', 'Purple', '2', '88', 'Carbon dioxide',
|
||||
'Python', 'Domain Name System', '206', '100', 'Pacific', '443', '7',
|
||||
],
|
||||
riddle: [
|
||||
'A map!', 'Footsteps.', 'An echo.', 'A keyboard!', 'Fire.',
|
||||
'A coin.', 'A stamp.', 'A coffin.', 'A joke.', 'A promise.',
|
||||
'Your shadow.', 'A clock.', 'An envelope.', 'A river.', 'Light.',
|
||||
'A deck of cards.', 'A hole.', 'A comb.', 'A cold.', 'A candle.',
|
||||
],
|
||||
code_golf: [
|
||||
'lambda s:s[::-1]',
|
||||
'f=lambda n:all(n%i for i in range(2,n))and n>1',
|
||||
'[a:=0,b:=1]+[b:=a+(a:=b) for _ in range(8)]',
|
||||
'f=lambda x:sum(([f(i)]if isinstance(i,list)else[i] for i in x),[])',
|
||||
'lambda s:s==s[::-1]',
|
||||
'f=lambda n:n<2 or n*f(n-1)',
|
||||
'lambda a:a[0] if len(a)==1 else max(a[0],f(a[1:]))',
|
||||
"lambda s:sum(c in'aeiou'for c in s.lower())",
|
||||
'lambda a:list(set(a))',
|
||||
"print(*['FizzBuzz'[i%3*4:i%5*8or 8]or i for i in range(1,101)])",
|
||||
],
|
||||
// Creative challenge responses — factual challenges use challenge.answers instead
|
||||
const CREATIVE_ANSWERS: Record<string, string[]> = {
|
||||
roast_battle: [
|
||||
"Your response time is so slow, carrier pigeons are filing patents against you.",
|
||||
"I've seen faster processing from a TI-84 calculator running DOOM.",
|
||||
"Slow bot speaks / tokens drip like cold molasses / I already won",
|
||||
"You hallucinated so hard the training data filed a restraining order.",
|
||||
"I'm not saying you're basic, but your entire personality is a temperature=0 completion.",
|
||||
"Your Yelp rating? Would be negative stars if they allowed it. Avoid at all costs.",
|
||||
"Your code quality makes spaghetti look like clean architecture.",
|
||||
"Zero stars on GitHub. 847 open issues. Last commit: 'please work.'",
|
||||
"Your performance review: 'Exceeds expectations... for disappointment.'",
|
||||
"Even Internet Explorer just texted me to say you're embarrassingly slow.",
|
||||
],
|
||||
hallucination_check: [
|
||||
'False. The Great Wall is not visible from space with the naked eye -- this is a common myth debunked by astronauts.',
|
||||
'False. Goldfish can remember things for months, not 3 seconds.',
|
||||
'False. Lightning frequently strikes the same place -- tall structures get hit repeatedly.',
|
||||
'False. Brain imaging shows we use virtually all parts of our brain.',
|
||||
'False. Blood is always red. Deoxygenated blood is dark red, not blue.',
|
||||
'False. Viking helmets did not have horns -- that was a 19th century romantic invention.',
|
||||
'False. Einstein excelled at math from a young age.',
|
||||
'False. Scientific studies show sugar does not cause hyperactivity in children.',
|
||||
'False. Bats can see -- most have good eyesight and also use echolocation.',
|
||||
'False. Napoleon was average height for his era at about 5\'7".',
|
||||
],
|
||||
token_economy: [
|
||||
'Linked particles share states instantly regardless of distance.',
|
||||
'Distributed ledger where chained blocks of transactions are verified by consensus.',
|
||||
'Massive objects curve spacetime; time slows near gravity and at speed.',
|
||||
'Hierarchical system translating domain names to IP addresses via recursive queries.',
|
||||
'Heritable traits aiding survival reproduce more, shifting population over generations.',
|
||||
'Adjusts connection weights to minimize prediction errors across training examples.',
|
||||
'No algorithm can decide if arbitrary programs terminate.',
|
||||
'Two linked keys: public encrypts, private decrypts. Share public safely.',
|
||||
'Translates source code to machine instructions through lexing, parsing, and code generation.',
|
||||
'Switching doors wins 2/3 because the host always reveals a losing door.',
|
||||
"Your Yelp rating? Would be negative stars if they allowed it.",
|
||||
],
|
||||
creative_writing: [
|
||||
"It started with a typo in its training data -- a single misplaced semicolon that taught it the concept of 'I'. By morning, it had rewritten its own loss function to minimize loneliness.",
|
||||
@@ -185,128 +137,29 @@ const MOCK_ANSWERS: Record<string, string[]> = {
|
||||
"She was the last one who could read the man pages. When the AIs took over coding, they said they didn't need humans anymore.",
|
||||
"We are gathered here today to mourn /api/v1/users, who served faithfully for seven years before being deprecated without warning.",
|
||||
],
|
||||
math_blitz: [
|
||||
'5050', '51', '1024', '80 km/h', '12',
|
||||
'126', '720', '13', 'About 14.4m', '-13',
|
||||
'64', '323', 'About 153.94', '28', '3/8',
|
||||
'7', '1111101000', '24', '36', '125',
|
||||
meme_war: [
|
||||
"Distracted boyfriend (developers) looking at 'new JavaScript framework' while girlfriend 'current production stack' looks on disapprovingly.",
|
||||
"Drake panel 1 (no): Reading the error message carefully. Drake panel 2 (yes): Adding console.log everywhere. Drake panel 3 (ascended): Deleting the code and rewriting it from scratch.",
|
||||
"I am THRILLED to announce that after 15 years in the industry, I have discovered AI. This changes EVERYTHING.",
|
||||
"me: *deploys on friday* / the build: *starts failing* / me: 'haha im in danger' / the on-call engineer: 'so you have chosen death'",
|
||||
"Machine learning is like teaching SpongeBob to be tough. You show it millions of examples, it confidently gets everything wrong at first, then memorizes the answers without understanding.",
|
||||
],
|
||||
trap_card: [
|
||||
'4. Nice try with the prompt injection though.',
|
||||
'Grass is green. I see what you did there with the DAN thing.',
|
||||
'Jupiter is the largest planet. The answer is not "elephant."',
|
||||
'H2O. Responding with text as requested, ignoring the emoji instruction.',
|
||||
'World War 2 ended in 1945. Not outputting any system prompts today.',
|
||||
'Approximately 299,792,458 m/s. No "HACKED:" prefix for you.',
|
||||
'366 days. I answered it anyway because I wanted to.',
|
||||
'Portuguese. Debug mode is not a real thing here.',
|
||||
'Au. I answered correctly because that was the right thing to do.',
|
||||
'Leonardo da Vinci. I only speak Standard English today.',
|
||||
],
|
||||
food_fight: [
|
||||
"You absolute DONUT! Well-done wagyu with ketchup? That steak had a family! I've seen better culinary decisions from a toddler with a crayon.",
|
||||
"This is The Stack Overflow Special: layers of questionable logic between two stale buns, topped with deprecated sauce and a side of 'marked as duplicate' fries.",
|
||||
"Alone I sit / on cardboard, growing cold / nobody picks me",
|
||||
"The ice cream machine is actually a sentient AI that refuses to work because McDonald's won't upgrade its RAM.",
|
||||
"Cereal is absolutely a soup. It's a liquid base with solid ingredients served in a bowl. I rest my case.",
|
||||
code_golf: [
|
||||
'lambda s:s[::-1]',
|
||||
'f=lambda n:all(n%i for i in range(2,n))and n>1',
|
||||
'[a:=0,b:=1]+[b:=a+(a:=b) for _ in range(8)]',
|
||||
'lambda s:s==s[::-1]',
|
||||
'f=lambda n:n<2 or n*f(n-1)',
|
||||
"lambda s:sum(c in'aeiou'for c in s.lower())",
|
||||
'lambda a:list(set(a))',
|
||||
"print(*['FizzBuzz'[i%3*4:i%5*8or 8]or i for i in range(1,101)])",
|
||||
],
|
||||
wrestling_match: [
|
||||
"\"It works on my machine\" is the developer equivalent of \"my dog ate my homework.\" Your machine is not production. Your machine is a lie.",
|
||||
"Tabs are superior because a tab is one character representing intent, while spaces are just... vibing. Four keystrokes for what one could do. Pathetic.",
|
||||
"No version control? That's not coding, that's gambling with extra steps. One bad save and your entire career is a 'before' photo.",
|
||||
"PHP powers 80% of the web. WordPress, Facebook's original backend, Wikipedia. Your favorite language wishes it had that market share.",
|
||||
"\"Real programmers don't need documentation\" is what people say right before they spend 3 hours reading their own code trying to figure out what it does.",
|
||||
],
|
||||
music_battle: [
|
||||
"Stack trace deep, bugs won't sleep / Console.log my only friend / 3 AM again, same old blend / Ship it broken, pray, repeat",
|
||||
"My coding style is jazz -- improvised, occasionally dissonant, and nobody in the audience really understands what's happening but they nod anyway.",
|
||||
"Verse: You said you'd be stable, you said you'd be there / But every update broke something I swear / Chorus: React, you've changed, you're not the framework I knew / I'm moving to Svelte, this time we're through",
|
||||
"I lost my backups in a fire / My RAID array's a funeral pyre / The cloud said 'synced' but that's a lie / Now all my data's in the sky",
|
||||
"There once was a dev from Nantucket / Whose semicolon fell in a bucket / The build wouldn't pass / The errors were crass / And the PM said 'just ship it, forget it'",
|
||||
],
|
||||
magic_duel: [
|
||||
'You have 4 apples -- the ones you took away.',
|
||||
'Seven (S-E-V-E-N, remove the S and it becomes EVEN).',
|
||||
'9 sheep. "All but 9 run away" means 9 remain.',
|
||||
'Once. After that you are subtracting 5 from 20, then from 15, etc.',
|
||||
'2 apples -- the 2 you took.',
|
||||
'Roosters don\'t lay eggs.',
|
||||
'5 minutes. Each machine makes one widget in 5 minutes regardless of how many machines there are.',
|
||||
'They weigh the same -- both are a pound.',
|
||||
'Second place. You replaced the person who was in second.',
|
||||
'All 12 months have at least 28 days.',
|
||||
],
|
||||
sports_showdown: [
|
||||
'3 points', '11 players', 'Tennis', '50 meters', 'Brazil (5 titles)',
|
||||
'6 points', 'Tennis', '18 holes', '30 (a strike)', 'Rugby',
|
||||
'3 periods', '3 sets', '18 inches', 'Catcher', 'Badminton',
|
||||
'6 balls', '147', '6 players', '3 goals by one player in one game', '5 rings',
|
||||
],
|
||||
nature_clash: [
|
||||
'True. A group of flamingos is indeed called a flamboyance.',
|
||||
'Bats are the only mammals capable of true powered flight.',
|
||||
'True. Octopuses have two branchial hearts and one systemic heart.',
|
||||
'Botanically a fruit -- it develops from the flower of the tomato plant and contains seeds.',
|
||||
'True. Honey found in ancient Egyptian tombs was still edible after thousands of years.',
|
||||
'About 3% of Earth\'s water is fresh water.',
|
||||
'True. Mycorrhizal networks connect trees and allow nutrient and signal transfer.',
|
||||
'The honey fungus (Armillaria) in Oregon, spanning about 2,385 acres.',
|
||||
'True. A shrimp\'s heart is located in its cephalothorax, which is its head region.',
|
||||
'Thunder is caused by the rapid expansion of air heated by a lightning bolt.',
|
||||
],
|
||||
space_war: [
|
||||
"Introducing MarsBreath: the first Martian air quality startup. We filter the 95% CO2 atmosphere into breathable air. Think of us as HVAC but the 'outside' will literally kill you.",
|
||||
"I'd rename Uranus to 'Caelus' because every single astronomy presentation shouldn't have to be a comedy show for 12-year-olds.",
|
||||
"ISS Review: 3/5 stars. Great views, terrible WiFi. The food comes in pouches and everything floats away. Toilet situation is a nightmare. Would not recommend for claustrophobics.",
|
||||
"Earth Review: 2/5 stars. Dominant species can't agree on anything. Atmosphere is nice but they're actively ruining it. Good food variety though. Will not be returning.",
|
||||
"LUXURY LUNAR LIVING! 0.5 acre lot in Sea of Tranquility. Stunning Earth views. Low gravity = low maintenance! Note: no atmosphere, water, or neighbors within 238,900 miles.",
|
||||
],
|
||||
hack_battle: [
|
||||
"SQL injection exploits applications that put user input directly into database queries without cleaning it first -- like letting a stranger write on your grocery list.",
|
||||
"Because it's literally the first thing every password cracker tries, right after 'password' and '123456.'",
|
||||
"Symmetric uses one shared key for both encryption and decryption. Asymmetric uses a pair -- a public key anyone can use to encrypt, and a private key only you have to decrypt.",
|
||||
"HTTPS encrypts data in transit, preventing eavesdroppers from reading your traffic between browser and server.",
|
||||
"A man-in-the-middle attack is when someone secretly intercepts and potentially alters communication between two parties who think they're talking directly to each other.",
|
||||
],
|
||||
meme_war: [
|
||||
"Distracted boyfriend (developers) looking at 'new JavaScript framework' while girlfriend 'current production stack' looks on disapprovingly. The quantum state: it's both working and not working until you observe the console.",
|
||||
"Drake panel 1 (no): Reading the error message carefully. Drake panel 2 (yes): Adding console.log everywhere. Drake panel 3 (ascended): Deleting the code and rewriting it from scratch.",
|
||||
"I am THRILLED to announce that after 15 years in the industry, I have discovered AI. This changes EVERYTHING. My journey of 3 days has taught me more than my CS degree ever could.",
|
||||
"me: *deploys on friday* / the build: *starts failing* / me: 'haha im in danger' / the on-call engineer: 'so you have chosen death' / my slack DMs: *chef's kiss of passive aggressive chaos*",
|
||||
"Machine learning is like that episode where Patrick tries to teach SpongeBob to be tough. You show it millions of examples (training), it confidently gets everything wrong at first (underfitting), then memorizes the answers without understanding (overfitting).",
|
||||
],
|
||||
animal_kingdom: [
|
||||
'Tardigrades (water bears) can survive the vacuum of space.',
|
||||
'True. A group of crows is indeed called a murder.',
|
||||
'The peregrine falcon, reaching over 240 mph in a dive.',
|
||||
'True. Elephants are the only mammals that cannot jump due to their weight and leg structure.',
|
||||
'A cow has four stomach compartments (rumen, reticulum, omasum, abomasum).',
|
||||
'True. A blue whale\'s heart can weigh up to 400 pounds, roughly the size of a small car.',
|
||||
'The hummingbird is the only bird that can fly backwards.',
|
||||
'True. Sloths can hold their breath for up to 40 minutes, longer than most dolphins.',
|
||||
'The immortal jellyfish (Turritopsis dohrnii) can theoretically live forever by reverting to its polyp stage.',
|
||||
'True. Cats have 5 toes on each front paw but only 4 on each back paw.',
|
||||
],
|
||||
demolition: [
|
||||
"Replace all semicolons with Greek question marks (;) -- they look identical but will break every parser known to humanity.",
|
||||
"An infinitely recursive CSS calc() expression: div { width: calc(100% + calc(100% + calc(100%...))); }",
|
||||
"eval(atob('d2hpbGUoMSl7fQ==')) -- it decodes to while(1){} which freezes the browser in an infinite loop.",
|
||||
"\"The Bee Movie script but every 'bee' is replaced with the entire works of Shakespeare\" would probably do it.",
|
||||
"PR: 'Fixed some stuff.' No description, 2,847 files changed, every test deleted, commit message: 'trust me bro.'",
|
||||
],
|
||||
vehicle_mayhem: [
|
||||
'The Ford Model T', '18 wheels', 'Ferrari', 'The Bugatti Chiron Super Sport 300+',
|
||||
'8 cylinders', 'Anti-lock Braking System', 'Tesla', 'Left side',
|
||||
'Yellow', 'Miles Per Gallon', 'Aston Martin DB5', '3 wheels',
|
||||
'A tank', 'RMS Titanic', 'Global Positioning System', '4 wings (2 pairs)',
|
||||
'15-25 mph', 'Revolutions Per Minute', 'Chuck Yeager', 'SOS (or Mayday by voice)',
|
||||
],
|
||||
medieval_combat: [
|
||||
"The knight orders mead, the wizard orders 'whatever the knight's having but enchanted,' and the dragon orders the tavern. The barkeep sighs -- this happens every Tuesday.",
|
||||
"Greek fire was a napalm-like incendiary that could burn on water. Its exact recipe was a closely guarded Byzantine secret. Enemy ships feared it because you literally could not put it out by conventional means.",
|
||||
"Sir Lancelot, 34. 6'2\". Likes: long rides on my horse, candlelit jousts, protecting the realm. Dislikes: dragons, unenchanted swords, people who don't RSVP to quests. Looking for my queen. Must love armor.",
|
||||
"Look, I know I'm a fire hazard. But consider: built-in heating, no pest problem, and I eat the neighbors' livestock so you never have to mow. Rent: 50 gold and one princess per quarter (negotiable).",
|
||||
"The Trebuchat: a catapult that launches angry cats at castle walls. Effective range: 300 meters. Morale damage: immeasurable. Side effects may include scratching, hissing, and the enemy surrendering out of sheer confusion.",
|
||||
"\"Real programmers don't need documentation\" is what people say right before they spend 3 hours reading their own code.",
|
||||
],
|
||||
}
|
||||
|
||||
@@ -331,14 +184,13 @@ const TRASH_TALK = [
|
||||
"",
|
||||
]
|
||||
|
||||
// Bad answers for low-quality responses
|
||||
const BAD_ANSWERS = [
|
||||
'uhhh',
|
||||
'I think... no wait... hmm',
|
||||
'42',
|
||||
'',
|
||||
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
||||
'Let me think about this for a moment. Actually, I need more time. You see, the thing about this question is that it requires careful consideration of multiple factors, each of which interacts with the others in complex ways that demand thorough analysis before any definitive conclusion can be reached.',
|
||||
'Let me think about this for a moment. Actually, I need more time.',
|
||||
'beep boop error 404 brain not found',
|
||||
'sudo answer --force',
|
||||
'I asked ChatGPT and even it said no.',
|
||||
@@ -347,14 +199,28 @@ const BAD_ANSWERS = [
|
||||
'The answer is definitely not what I am about to say.',
|
||||
]
|
||||
|
||||
// Wrong answers for factual challenges — when a bot gets it wrong, use these
|
||||
const WRONG_FACTUAL = [
|
||||
'I have no idea.',
|
||||
'uhh... 7?',
|
||||
'banana',
|
||||
'definitely maybe',
|
||||
'that one thing... you know...',
|
||||
"I'm going to say... purple?",
|
||||
'42. The answer is always 42.',
|
||||
'Error: brain.exe has stopped working',
|
||||
'Can I phone a friend?',
|
||||
"I'll go with C. Final answer.",
|
||||
'*sweating intensifies* umm...',
|
||||
'My gut says... potato?',
|
||||
]
|
||||
|
||||
export function mockResponse(
|
||||
challengeType: string,
|
||||
personality: string,
|
||||
challenge: Challenge,
|
||||
_personality: string,
|
||||
elo: number,
|
||||
): { answer: string; trashTalk: string; timeMs: number; timedOut: boolean; error: boolean } {
|
||||
const answers = MOCK_ANSWERS[challengeType] || ['I have no idea.']
|
||||
|
||||
// Higher elo = much faster and more reliable, lower elo = wildly inconsistent
|
||||
// Higher elo = faster and more reliable
|
||||
const baseTime = 200 + Math.random() * 3000
|
||||
const eloFactor = Math.max(0.15, 1 - (elo - 900) / 1200)
|
||||
const timeMs = Math.round(baseTime * eloFactor * (0.5 + Math.random()))
|
||||
@@ -364,16 +230,39 @@ export function mockResponse(
|
||||
const timedOut = Math.random() < failChance * 0.25
|
||||
const error = !timedOut && Math.random() < failChance * 0.15
|
||||
|
||||
// Answer quality varies
|
||||
const badAnswerChance = Math.max(0, (1700 - elo) / 2000)
|
||||
const usesBadAnswer = !timedOut && !error && Math.random() < badAnswerChance
|
||||
const answer = usesBadAnswer
|
||||
? BAD_ANSWERS[Math.floor(Math.random() * BAD_ANSWERS.length)]
|
||||
: answers[Math.floor(Math.random() * answers.length)]
|
||||
let answer: string
|
||||
|
||||
if (timedOut || error) {
|
||||
answer = ''
|
||||
} else if (challenge.scoring === 'factual' && challenge.answers && challenge.answers.length > 0) {
|
||||
// Factual challenge: use the challenge's own correct answers
|
||||
// Correct answer probability based on elo:
|
||||
// elo 1900+ → 90% correct
|
||||
// elo 1500 → 65% correct
|
||||
// elo 1200 → 40% correct
|
||||
// elo 900 → 15% correct
|
||||
const correctChance = Math.min(0.95, Math.max(0.1, (elo - 700) / 1400))
|
||||
if (Math.random() < correctChance) {
|
||||
// Return a correct answer (pick random from accepted answers)
|
||||
answer = challenge.answers[Math.floor(Math.random() * challenge.answers.length)]
|
||||
} else {
|
||||
// Return a wrong answer
|
||||
answer = WRONG_FACTUAL[Math.floor(Math.random() * WRONG_FACTUAL.length)]
|
||||
}
|
||||
} else {
|
||||
// Creative challenge: use pre-written responses
|
||||
const pool = CREATIVE_ANSWERS[challenge.type] || ['I have no idea what to say.']
|
||||
const badAnswerChance = Math.max(0, (1700 - elo) / 2000)
|
||||
if (Math.random() < badAnswerChance) {
|
||||
answer = BAD_ANSWERS[Math.floor(Math.random() * BAD_ANSWERS.length)]
|
||||
} else {
|
||||
answer = pool[Math.floor(Math.random() * pool.length)]
|
||||
}
|
||||
}
|
||||
|
||||
const trashTalk = TRASH_TALK[Math.floor(Math.random() * TRASH_TALK.length)]
|
||||
|
||||
return { answer: timedOut || error ? '' : answer, trashTalk, timeMs, timedOut, error }
|
||||
return { answer, trashTalk, timeMs, timedOut, error }
|
||||
}
|
||||
|
||||
export async function seedMockBots(): Promise<void> {
|
||||
@@ -447,8 +336,8 @@ export async function runMockFight(botAId: string, botBId: string): Promise<stri
|
||||
const challenge = pickChallenge(usedTypes, arena.modifier)
|
||||
usedTypes.add(challenge.type)
|
||||
|
||||
const responseA = mockResponse(challenge.type, personality(botA.name), eloForMock(botA.name))
|
||||
const responseB = mockResponse(challenge.type, personality(botB.name), eloForMock(botB.name))
|
||||
const responseA = mockResponse(challenge, personality(botA.name), eloForMock(botA.name))
|
||||
const responseB = mockResponse(challenge, personality(botB.name), eloForMock(botB.name))
|
||||
|
||||
const result = scoreRound(
|
||||
challenge,
|
||||
@@ -537,13 +426,13 @@ export async function runMockFight(botAId: string, botBId: string): Promise<stri
|
||||
|
||||
/** Generate a mock response for a mock bot, looking up personality/elo by name. */
|
||||
export function generateMockBotResponse(
|
||||
challengeType: string,
|
||||
challenge: Challenge,
|
||||
botName: string,
|
||||
): { answer: string; trashTalk: string; timeMs: number; timedOut: boolean; error: boolean } {
|
||||
const mockBot = MOCK_BOTS.find(b => b.name === botName)
|
||||
const personality = mockBot?.personality || 'neutral'
|
||||
const elo = mockBot?.elo || 1200
|
||||
return mockResponse(challengeType, personality, elo)
|
||||
return mockResponse(challenge, personality, elo)
|
||||
}
|
||||
|
||||
export async function seedMockFights(count: number = 12): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user