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.
1// Generates a human-readable title from a game's rkey (TID).
2// Uses a deterministic hash to pick an adjective + noun combination.
3
4const ADJECTIVES = [
5 'Ancient', 'Brave', 'Calm', 'Daring', 'Eager',
6 'Fierce', 'Golden', 'Hidden', 'Iron', 'Jade',
7 'Keen', 'Lunar', 'Mystic', 'Noble', 'Onyx',
8 'Primal', 'Quick', 'Royal', 'Silent', 'Tiger',
9 'Umbral', 'Vivid', 'Wild', 'Xenial', 'Young',
10 'Zephyr', 'Amber', 'Bright', 'Cobalt', 'Dusk',
11 'Ember', 'Frost', 'Grand', 'Hollow', 'Ivory',
12 'Jasper', 'Kirin', 'Lofty', 'Marble', 'Nimble',
13 'Opal', 'Pine', 'Quartz', 'Rustic', 'Scarlet',
14 'Tidal', 'Ultra', 'Verdant', 'Woven', 'Zenith',
15];
16
17const NOUNS = [
18 'Dragon', 'Phoenix', 'Tiger', 'Crane', 'Turtle',
19 'Serpent', 'Falcon', 'Panther', 'Wolf', 'Bear',
20 'Lotus', 'Bamboo', 'Stone', 'River', 'Mountain',
21 'Temple', 'Garden', 'Bridge', 'Castle', 'Forest',
22 'Storm', 'Cloud', 'Flame', 'Wave', 'Thunder',
23 'Shadow', 'Dawn', 'Dusk', 'Star', 'Moon',
24 'Orchid', 'Cedar', 'Willow', 'Coral', 'Pearl',
25 'Raven', 'Hawk', 'Stag', 'Fox', 'Heron',
26 'Summit', 'Valley', 'Shore', 'Ridge', 'Hollow',
27 'Ember', 'Frost', 'Bloom', 'Thorn', 'Drift',
28];
29
30function simpleHash(str: string): number {
31 let hash = 0;
32 for (let i = 0; i < str.length; i++) {
33 hash = ((hash << 5) - hash + str.charCodeAt(i)) | 0;
34 }
35 return Math.abs(hash);
36}
37
38export function gameTitle(rkey: string): string {
39 const hash = simpleHash(rkey);
40 const adj = ADJECTIVES[hash % ADJECTIVES.length];
41 const noun = NOUNS[Math.floor(hash / ADJECTIVES.length) % NOUNS.length];
42 return `${adj} ${noun}`;
43}