Add bot to play against.

This commit is contained in:
Greyson Parrelli
2026-07-23 15:58:12 -04:00
parent 3825dbacec
commit db1a6ef290
23 changed files with 1852 additions and 23 deletions
+4 -2
View File
@@ -13,8 +13,10 @@ async function post(path: string, body: unknown): Promise<Session> {
return data as Session
}
export function createGame(name: string): Promise<Session> {
return post('/api/games', { name })
export type BotDifficulty = 'easy' | 'medium' | 'hard'
export function createGame(name: string, bot?: BotDifficulty): Promise<Session> {
return post('/api/games', bot ? { name, bot } : { name })
}
export function joinGame(code: string, name: string): Promise<Session> {