纠正仓库内容为衍生项目,标明 campaign-200-r2 最新版

This commit is contained in:
toshiocn
2026-10-19 16:56:31 +08:00
parent a492c5b80e
commit fdca4f67ea
1396 changed files with 392768 additions and 19530 deletions
+16
View File
@@ -0,0 +1,16 @@
from pathlib import Path
root=Path(r'G:\项目\NumberSwipe-Variants');dest=root/'campaign-50'
s=(root/'tools/design-pages.mjs').read_text(encoding='utf-8-sig')
s=s.replace("import {definitions} from './definitions.mjs';", "")
s=s.replace("from './engine-template.mjs'", "from '../rules.mjs'")
s=s.replace("const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)),'..');", "const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)),'..');const definitions=[{id:'campaign-50',title:'50关DEMO',rule:'每格一次;数字为访问步号,各关显示当前启用规则。'}];")
s=s.replace("const folder=path.join(root,'modes',def.id)", "const folder=root")
s=s.replace('for(let i=0;i<8;i++)','for(let i=0;i<pack.levels.length;i++)')
s=s.replace("l.id+'-board.svg'", "String(l.order).padStart(2,'0')+'-board.svg'").replace("l.id+'-solution.svg'", "String(l.order).padStart(2,'0')+'-solution.svg'")
s=s.replace("c.direction?({lr:", "c.parity?(c.parity==='odd'?'奇':'偶'):c.direction?({lr:")
s=s.replace('${l.id} · ${l.difficulty}', '${l.order} · ${l.chapterTitle}')
s=s.replace('${l.title}', '${l.title}')
s=s.replace('href="play.html"','href="index.html"')
s=s.replace('8关设计评审','50关设计评审')
s=s.replace('Generated 40 original boards, 40 solutions and 5 design review pages.','Generated 50 boards, 50 solution SVGs and design review page.')
(dest/'tools/design-pages.mjs').write_text(s,encoding='utf-8')