Add aspirinV2: fixed-cell 15-puzzle
Cells never move; each NumericSelectLabel shows the number it holds on white and the empty cell takes the board colour via a linked backgroundColor. Adds the V2 generator, build step (with a direct-Java sedonac fallback), offline verifier mode (--v2) and viewer support. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""Builds aspirin(.sax/_solver.sax) -> .sab and packages app-ORION-<name>.zip for simulatorLauncher.exe.
|
||||
"""Builds aspirin(.sax/_solver.sax/V2.sax) -> .sab and packages app-ORION-<name>.zip for simulatorLauncher.exe.
|
||||
|
||||
Zip layout matches the launcher's ExampleApp backups:
|
||||
app.sax, device/app.sab, device/kits.scode, device/fonts/*.oxfl, fontBankXL/*.oxfl
|
||||
@@ -22,9 +22,24 @@ env = dict(os.environ, sedona_home=SEDONA)
|
||||
with zipfile.ZipFile(EXAMPLE) as src:
|
||||
scode = src.read("device/kits.scode")
|
||||
|
||||
for name, args in (("aspirin", []), ("aspirin_solver", ["--solver"])):
|
||||
subprocess.check_call([sys.executable, "gen_aspirin.py"] + args)
|
||||
subprocess.check_call([os.path.join(SEDONA, "bin", "sedonac.exe"), f"{name}.sax"], env=env)
|
||||
JAVA = r"C:\Niagara\Niagara-4.15.1.16\jre\bin\java.exe" # fallback when sedonac.exe finds no JVM
|
||||
|
||||
|
||||
def sedonac(sax):
|
||||
if subprocess.call([os.path.join(SEDONA, "bin", "sedonac.exe"), sax], env=env) == 0:
|
||||
return
|
||||
lib = os.path.join(SEDONA, "lib")
|
||||
subprocess.check_call([JAVA, f"-Dsedona.home={SEDONA}", "-cp",
|
||||
os.pathsep.join([os.path.join(lib, "sedonac.jar"),
|
||||
os.path.join(lib, "sedona.jar")]),
|
||||
"sedonac.Main", sax])
|
||||
|
||||
|
||||
for name, gen in (("aspirin", ["gen_aspirin.py"]),
|
||||
("aspirin_solver", ["gen_aspirin.py", "--solver"]),
|
||||
("aspirinV2", ["gen_aspirinV2.py"])):
|
||||
subprocess.check_call([sys.executable] + gen)
|
||||
sedonac(f"{name}.sax")
|
||||
out = f"app-ORION-{name}.zip"
|
||||
with zipfile.ZipFile(out, "w", zipfile.ZIP_DEFLATED) as z:
|
||||
z.write(f"{name}.sax", "app.sax")
|
||||
|
||||
Reference in New Issue
Block a user