Files
donlucasandClaude Opus 5 cae83501da Hero comes ashore, and joining cost nothing
The crab is a companion, not a replacement: five states, crablets on the
sand, crablets in the water, and an exit queue that goes UNDER rather than
swimming off -- a crab does not swim, it walks in, and the eyestalks carry
on above the surface. Same 10x8 box as KittenSwim, so the lane arithmetic
needed no new numbers.

"Join" was costed at threading a companion interface through 25 production
call sites. It needed none. The sprite data became a FIELD on the existing
type, so NewCrab() returns what NewCat() returns and every call site is
untouched; the refactor never left internal/companion.

Measured, so nobody re-derives it: the crab's ink is 12x7 cells to the cat's
9x7, at 64-66 of 84 cells against the cat's 60 -- the same weight, arranged
sideways. The three extra columns were always free, because cat.Size()
returns the BOX and the cat has never used its last three.

Coat LOCKED at salmon, cube index 210. An exact cube entry, so it survives
the glyph path's 2.6x saturate unchanged. Every coat the cat ships is a
near-neutral the boost ignores; this is the first companion colour with
enough chroma that it had to be checked.

Two defects its own tests found before he did, both of which the cat had
already fixed: a crablet losing an eye to a neighbour's body at 16 subagents,
and two swimmers sharing a lane. One cause -- column de-duplication bucketed
as x/width, which does not prevent overlap. Replaced with an interval
allocator that reserves the sprite AND its two ripple cells.

The generated study pages are ignored, not committed: 15 MB of HTML that
`go run ./notes/charstudy/crab` rebuilds. The generator is the record.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015GQLYhGnSpasru9xeJbJry
2026-09-07 21:08:47 -07:00

281 lines
7.2 KiB
Go

package main
// The five states, for pincer and hero. Each body splits at px row 12: the
// LOWER half (shell bottom and legs) never changes, and the UPPER half carries
// the claws, the stalks and the whole expression. That is the cat's own
// arrangement -- one body, a handful of cells doing the talking -- and it is
// what makes the animation cheap.
//
// The claw is the channel the cat does not have. Where the cat flicks a tail,
// a crab raises a claw, and a raised claw survives a screenshot: it is position,
// not rate, which is what the encoding rule demands.
var pincerLower = []string{
"########################",
"########################",
".######################.",
"..####################..",
"...##################...",
"..##..############..##..",
"..##..############..##..",
".##....##########....##.",
".##....##########....##.",
"##......########......##",
"##......########......##",
"##.......######.......##",
".#.......######.......#.",
".#........####........#.",
".#....................#.",
".#....................#.",
}
var pincerWork = []string{
"##..##............##..##",
"##..##............##..##",
"######............######",
"######............######",
"######..##....##..######",
"######..##....##..######",
".####...##....##...####.",
".####...##....##...####.",
"..####################..",
".######################.",
"########################",
"########################",
}
// A single pixel row of drift. The whole idle motion is the claws breathing.
var pincerWork2 = []string{
"........................",
"##..##............##..##",
"##..##............##..##",
"######............######",
"######..##....##..######",
"######..##....##..######",
".####...##....##...####.",
".####...##....##...####.",
"..####################..",
".######################.",
"########################",
"########################",
}
var pincerRest = []string{
"........................",
"........................",
"######............######",
"######............######",
"######..##....##..######",
"######..##....##..######",
"######..##....##..######",
".####...##....##...####.",
"..####################..",
".######################.",
"########################",
"########################",
}
// One claw up. Authored right, which is screen LEFT once the sprite is
// mirrored -- so the raised claw points at the agent's transcript rather than
// at the frame edge.
var pincerAsk = []string{
"..................##..##",
"..................##..##",
"..................######",
"##..##............######",
"##..##..##....##..######",
"######..##....##..######",
"######..##....##...####.",
".####...##....##...####.",
"..####################..",
".######################.",
"########################",
"########################",
}
var pincerDone = []string{
"##..##............##..##",
"##..##............##..##",
"##..##............##..##",
"######............######",
"######..##....##..######",
"######..##....##..######",
".####...##....##...####.",
".####...##....##...####.",
"..####################..",
".######################.",
"########################",
"########################",
}
// Claws pulled in and down, stalks short. Hunched, and it stays hunched --
// worried persists until it clears, unlike every other state.
var pincerWorried = []string{
"........................",
"........................",
"........................",
"........................",
"........##....##........",
"..####..##....##..####..",
"..####..##....##..####..",
"..######..........######",
"..####################..",
".######################.",
"########################",
"########################",
}
var heroLower = []string{
"########################",
"########################",
".######################.",
"..####################..",
"...##################...",
"..##..############..##..",
"..##..############..##..",
".##....##########....##.",
".##....##########....##.",
"##......########......##",
"##......########......##",
"##.......######.......##",
".#.......######.......#.",
".#........####........#.",
".#....................#.",
".#....................#.",
}
var heroWork = []string{
"##..##............##..##",
"##..##............##..##",
"######............######",
"######............######",
"######............######",
".####..............####.",
"..##................##..",
"..##................##..",
"..##....##....##....##..",
"..##....##....##....##..",
"..####################..",
".######################.",
}
var heroWork2 = []string{
"........................",
"##..##............##..##",
"##..##............##..##",
"######............######",
"######............######",
"######............######",
"..##................##..",
"..##................##..",
"..##....##....##....##..",
"..##....##....##....##..",
"..####################..",
".######################.",
}
var heroRest = []string{
"........................",
"........................",
"........................",
"##..##............##..##",
"##..##............##..##",
"######............######",
"######............######",
".####..............####.",
"..##....##....##....##..",
"..##....##....##....##..",
"..####################..",
".######################.",
}
var heroAsk = []string{
"..................##..##",
"..................##..##",
"..................######",
"..................######",
"##..##............######",
"##..##.............####.",
"######..............##..",
".####...............##..",
"..##....##....##....##..",
"..##....##....##....##..",
"..####################..",
".######################.",
}
var heroDone = []string{
"##..##............##..##",
"##..##............##..##",
"##..##............##..##",
"######............######",
"######............######",
".####..............####.",
"..##................##..",
"..##................##..",
"..##....##....##....##..",
"..##....##....##....##..",
"..####################..",
".######################.",
}
var heroWorried = []string{
"........................",
"........................",
"........................",
"........................",
"........##....##........",
"........##....##........",
"..####..##....##..####..",
"..####..##....##..####..",
"..######..........######",
"..######..........######",
"..####################..",
".######################.",
}
// ---- the sub companions -------------------------------------------------
//
// 12x16 px, six cells by four -- the kittens' size and the kittens' place.
// A sub-cell is 1px wide by 2px tall, so at this size a one-pixel notch DOES
// survive, which is what lets a crablet keep an open pincer the froglet could
// not have kept.
var crabletPincer = []string{
"#.#......#.#",
"###......###",
"###..##..###",
".#...##...#.",
"..########..",
".##########.",
"############",
"############",
".##########.",
"..########..",
"##..####..##",
"##..####..##",
"#....##....#",
"#....##....#",
"#..........#",
"............",
}
var crabletHero = []string{
"#.#......#.#",
"###......###",
".#........#.",
".#...##...#.",
".#...##...#.",
"..########..",
".##########.",
"############",
".##########.",
"..########..",
"##..####..##",
"##..####..##",
"#....##....#",
"#....##....#",
"#..........#",
"............",
}