// Stored snow keeps its identity and remains in the world's water budget. const { load, suite, flatWorld, ticks } = require('./harness'); const { run } = load(); const { check, done } = suite(); flatWorld(run, 240, 160, 120); run("globalThis.snowSilo = addMachine('silo', 20, 20, 0); setCell(80 * W + 85, SNOW, -10, 0); stamp[80 * W + 85] = 0; tickStamp = 1;"); const before = run('worldWater()'); run('siloTick(snowSilo)'); check('silo accepts snow and keeps its name', run('snowSilo.sm === SNOW && snowSilo.sn === 1')); check('snow inside still counts as water', run('worldWater()') === before); run('for (let y = 80; y < 104; y++) for (let x = 80; x < 92; x++) temp[y * W + x] = 100;'); ticks(run, 180); check('stored snow does not melt in a warm silo', run('snowSilo.sm === SNOW && snowSilo.sn === 1')); run('snowSilo.open = true; siloTick(snowSilo)'); check('opening the gate releases snow, then the silo is empty', run('snowSilo.sn === 0 && snowSilo.sm === EMPTY && mat[103 * W + 84 + (tick & 3)] === SNOW')); check('releasing snow preserves the water count', run('worldWater()') === before); done();