// Block-sized bit mold sunk into the ground with a stone furnace built over its funnel. const { load, flatWorld, rect, ticks, dump } = require('../../test/harness'); const { run } = load(); const C = n => run(n); const kind = process.argv[2] || 'bit', wallName = process.argv[3] || 'STONE'; flatWorld(run, 220, 160, 100); run('bot.x = 90; bot.y = 60;'); // pit for the mold: x 80..103, y 100..111 run(`for (let y=100;y<=111;y++) for (let x=80;x<=103;x++) setCell(y*W+x, EMPTY, AMB[y], 0)`); run(`bag[R${wallName === 'STONE' ? 'STONE' : 'BRICK'}] = 500; bagTotal = 500;`); console.log('mold', JSON.stringify(run(`placeMoldAt('${kind}', 21, 25, ${wallName === 'STONE' ? 'RSTONE' : 'RBRICK'})`))); const W_ = C(wallName); rect(run, 80, 100, 83, 111, W_); rect(run, 100, 100, 103, 111, W_); rect(run, 80, 108, 103, 111, W_); if (process.env.GRATE) { run('bag[LCLAY] = 100; bagTotal += 100;'); console.log('grate', JSON.stringify(run('placeBlocks(BP_GRATE, 0, blockLine(21, 24, 24, 24))'))); } // furnace walls above, floor at ground level except over the mold rect(run, 74, 74, 75, 99, W_); rect(run, 108, 74, 109, 99, W_); rect(run, 74, 74, 109, 75, W_); run(`for (let y=74;y<76;y++) for (let x=91;x<93;x++) setCell(y*W+x, EMPTY, AMB[y], 0)`); run(`{ let r=mulberry32(9); for (let y=80;y<=99;y++) for (let x=76;x<=107;x++) { const i=y*W+x; if (mat[i]===EMPTY && !part[i]) setCell(i, r()<0.32 ? CUORE : COAL, AMB[y], 0); } }`); run(`for (let k=0;k<40;k++){ toolIgnite(80,79); toolIgnite(103,79); simTick(); }`); for (const t of [1200, 1200, 1200, 1800]) { ticks(run, t); console.log('--- +' + t, run(`JSON.stringify(molds.map(m=>({state:m.state, fill:+m.fill.toFixed(2), ready: m.ready.length, flaw:m.flaw})))`)); } if (process.argv[4]) dump(run, 72, 70, 112, 112, true);