extremely claude-assisted go game based on atproto! working on cleaning up and giving a more unique design, still has a bit of a slop vibe to it.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384// Shared ATProto record shapes for boo.sky.go.* lexicons
export interface GameRecord { $type: 'boo.sky.go.game'; playerOne: string; playerTwo?: string; boardSize: number; status: 'waiting' | 'active' | 'completed'; winner?: string; blackScore?: number; whiteScore?: number; blackScorer?: string; whiteScorer?: string; deadStones?: string[]; // Format: ["bA01", "wT19"] handicap?: number; handicapStones?: Array<{ x: number; y: number }>; createdAt: string;}
export interface MoveRecord { $type: 'boo.sky.go.move'; uri?: string; // AT URI of this move record (populated when fetching) game: string; // AT URI of the game player: string; moveNumber: number; x: number; y: number; color: 'black' | 'white'; captureCount: number; createdAt: string;}
export interface PassRecord { $type: 'boo.sky.go.pass'; game: string; // AT URI of the game player: string; moveNumber: number; color: 'black' | 'white'; createdAt: string;}
export interface ResignRecord { $type: 'boo.sky.go.resign'; game: string; // AT URI of the game player: string; color: 'black' | 'white'; createdAt: string;}
export interface ReactionRecord { $type: 'boo.sky.go.reaction'; game: string; // AT URI of the game move: string; // AT URI of the move being reacted to emoji?: string; text: string; stars?: number; // 1-5 createdAt: string;}
export interface ProfileRecord { $type: 'boo.sky.go.profile'; wins: number; losses: number; ranking: number; status: 'playing' | 'watching' | 'offline'; createdAt: string; updatedAt?: string;}
// Convert (x, y, color) to board notation with zero-padded numbersexport function coordsToNotation(x: number, y: number, color: 'black' | 'white'): string { const col = String.fromCharCode(65 + x); // 0=A, 1=B, etc. const row = (y + 1).toString().padStart(2, '0'); // 0-indexed to 1-indexed, zero-padded return `${color === 'black' ? 'b' : 'w'}${col}${row}`;}
// Convert board notation to (x, y, color)export function notationToCoords(notation: string): { x: number, y: number, color: 'black' | 'white' } { const color = notation[0] === 'b' ? 'black' : 'white'; const col = notation.charCodeAt(1) - 65; // A=0, B=1, etc. const row = parseInt(notation.slice(2)) - 1; // 1-indexed to 0-indexed return { x: col, y: row, color };}