metabolism: DESIGN-REVISION.md — the wells & LittleVM-castes redesign presented as the reviewable proposal of record
This commit is contained in:
@@ -24,11 +24,16 @@ function plant(w) {
|
||||
}
|
||||
|
||||
const configs = [];
|
||||
for (const a of process.argv.slice(4)) {
|
||||
if (a.startsWith('w')) configs.push({ workers: Number(a.slice(1)) });
|
||||
else if (a.startsWith('v')) configs.push({ vmEvery: Number(a.slice(1)) });
|
||||
const argCfg = (a) => {
|
||||
if (a.startsWith('w')) return { workers: Number(a.slice(1)) };
|
||||
if (a.startsWith('v')) return { vmEvery: Number(a.slice(1)) };
|
||||
return null;
|
||||
};
|
||||
for (const a of process.argv.slice(2)) {
|
||||
const cfg = argCfg(a);
|
||||
if (cfg) configs.push(cfg);
|
||||
}
|
||||
if (!configs.length) configs = [{ workers: 0, vmEvery: 2 }, { workers: 2 }, { workers: 4 }];
|
||||
if (!configs.length) configs.push({ workers: 0, vmEvery: 2 }, { workers: 2 }, { workers: 4 });
|
||||
for (const cfg of configs) {
|
||||
const w = new World(song, { fps: 30, field: 128, genesis: 0, vmEvery: cfg.vmEvery ?? 2, workers: cfg.workers ?? 0 });
|
||||
plant(w);
|
||||
|
||||
Reference in New Issue
Block a user