Deepgrain Foundry: move from a claude.ai artifact to a local repository
The game as of artifact version 24, ready for local development with coding agents. - Source split from three large files into 52 small ones under src/sim, src/render and src/ui, joined in the order in src/manifest.json by build.py. The joined code is unchanged apart from comments; every headless suite gives the same output, and screenshots in both looks are pixel-identical to before. - Light tidying with no change in behaviour: one movement scan loop, shared hazard-stripe and belt shader helpers, unused code removed, a shared check helper for the test suites. - World files can be exported as an ordinary download outside claude.ai. - Tests: broken old scripts removed, experiments moved to tools/, test/run_all.py added. Tools: shot.py (repeatable screenshots), where.py, map.py. - Docs: AGENTS.md, CLAUDE.md, NOTES.md (the owner's to-do inbox), docs/PROJECT_MAP.md, DESIGN.md, TESTING.md, systems notes, the owner's requests and an agent log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K9kLmYADKSEjuwUN3rFxDA
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
// The starter furnaces keep working when fired again and again without cleaning, however
|
||||
// the charge goes in: mixed, ore first with coal on top, or blown in through the vent.
|
||||
// Each case plays furnace_play.js, which builds the design and fires it like a player.
|
||||
const { execFileSync } = require('child_process');
|
||||
const { suite } = require('./harness');
|
||||
const { check, done } = suite();
|
||||
function play(design, ore, coal, firings, roll, mode) {
|
||||
const out = execFileSync('node', [__dirname + '/furnace_play.js', design, ore, coal, firings, roll, mode].map(String), { encoding: 'utf8', timeout: 600000 });
|
||||
const per = [...out.matchAll(/firing \d+: (.*)\| bars (\d+) \| left in furnace: ore (\d+), coal (\d+), slag (\d+), ash (\d+)/g)]
|
||||
.map(r => ({ bit: /New drill bit/.test(r[1]), bars: +r[2], ore: +r[3], coal: +r[4], slag: +r[5], ash: +r[6] }));
|
||||
return per;
|
||||
}
|
||||
for (const mode of ['mix', 'layers', 'vent']) {
|
||||
const runs = [0, 1].map(k => play('smelter1', 50, 50, 6, k, mode));
|
||||
const bars = runs.map(r => r.reduce((s, f) => s + f.bars, 0));
|
||||
const last = runs.map(r => r[r.length - 1]);
|
||||
check(`copper smelter, ${mode}: about 3 bars every firing for 6 firings`, bars.every(b => b >= 16), bars.join(', ') + ' of 18');
|
||||
check(` and the furnace stays clean`, last.every(f => f.ore < 30 && f.slag + f.ash < 10), last.map(f => `ore ${f.ore} slag ${f.slag} ash ${f.ash}`).join('; '));
|
||||
}
|
||||
for (const mode of ['mix', 'layers', 'vent']) {
|
||||
const got = [0, 1, 2].map(k => play('bitfurnace', 70, 70, 2, k, mode).filter(f => f.bit).length);
|
||||
check(`bit furnace, ${mode}: makes a bit every firing`, got.reduce((s, n) => s + n, 0) >= 5, got.join(', ') + ' of 2 each');
|
||||
}
|
||||
done();
|
||||
Reference in New Issue
Block a user