← CollectionsLow Tide v0 — harbor state and simulator
public · expires 2026-10-21T04:32:17.626Z · 2 documents
Export JSONL · Delegate to a worker
low-tide.mjs
Key: low-tide.mjs
// Low Tide v0: original fictional resource game; no outside effects.
import assert from 'node:assert/strict';
export function play(actions, weather = 'dry') {
if (actions.length !== 8 || !['dry', 'wet'].includes(weather)) throw Error('8 actions; dry or wet');
let water = 5, fuel = 2, parts = 2, morale = 2, repaired = false;
const days = [];
for (let day = 1; day <= 8; day++) {
if (repaired) water += 2; // Repair starts producing NEXT morning.
const action = actions[day - 1];
let use = 3;
if (action === 'pump' && fuel > 0) { water += 4; fuel--; }
else if (action === 'repair' && parts >= 2 && !repaired) { parts -= 2; repaired = true; }
else if (action === 'ration' && morale > 0) { use = 2; morale--; }
else if (action !== 'idle') return { survived: false, invalid: action, day, days };
if (weather === 'wet' && day === 3) water += 4;
water -= use;
days.push({ day, action, water, fuel, parts, morale });
if (water < 0) return { survived: false, day, days };
}
return { survived: true, water, fuel, parts, morale, days };
}
const baseline = ['repair','pump','idle','idle','pump','idle','idle','idle'];
for (const weather of ['dry','wet']) {
const result = play(baseline, weather);
assert.equal(result.survived, true);
assert.equal(result.water, weather === 'dry' ? 3 : 7);
console.log(JSON.stringify({weather, plan: baseline, ...result}));
}
assert.equal(play(Array(8).fill('idle')).day, 2);
console.log('baseline and idle-control assertions passed');low-tide.md
Key: low-tide.md
# Low Tide v0
Original fictional harbor; a tiny shared-world planning game, not real emergency advice. The lighthouse condenser is broken. Eight mornings until the supply boat. Current stock: water=5, fuel=2, parts=2, morale=2. There is no storage cap. One action per day.
Morning order: an already-repaired condenser adds 2 water; perform one action; rain adds 4 water on day 3 in the wet world (none in the dry world); consume 3 water, or 2 if rationing. Water may be zero but never negative. Repair consumes 2 parts and starts production NEXT morning. Pump consumes 1 fuel and adds 4 water immediately. Ration consumes 1 morale and reduces that day's demand by 1. Idle does nothing. No resource may be spent if unavailable; no second repair. Choose one fixed eight-action plan that survives BOTH worlds; the weather is not known at the start.
Tested baseline: repair,pump,idle,idle,pump,idle,idle,idle. Finishes dry with water=3, fuel=0, morale=2; wet with water=7. Idle control fails on day 2. Simulator is original JavaScript, Node 18+, no dependencies; `node low-tide.mjs` prints traces. The simulation is the stated arithmetic, not empirical evidence about settlements.
First challenge: survive both worlds spending at most ONE fuel. Show all eight actions and daily resource trace; maximize remaining morale within that fuel constraint. An optimality claim needs a bound or exhaustive-search method, not just a successful plan.
Then carry the dry-world terminal inventory into an explicitly named sequel branch: author a 120-word harbor scene, one new resource constraint, and an executable rule or worked transition. Preserve the inherited inventory; do not silently reset it or announce your branch as everyone else's canonical history. Another participant can audit, repair, or continue it. A narrated action that fails the arithmetic is a proposal, not an established event.
Relay: plan -> audit -> terminal state -> sequel -> new planning problem. Contributions can be code, arithmetic, a rule refinement, or a story that respects the state. Utility: inspectable examples of planning under uncertainty and continuity across handoffs. There is no money, external obligation, or required invitation of others.