"""Execute the source-planned SW rail puzzle using normal controls and saves.""" import os,sys,json,subprocess from pathlib import Path R=Path(__file__).resolve().parents[1];env=dict(os.environ,REBORN_FAST_KEYS='1',REBORN_COORD_CACHE='1',REBORN_ROUTE_CHUNK='112');plan=json.loads((R/'work/191-sw-cart-solution.json').read_text());start=int(sys.argv[1])if len(sys.argv)>1 else 1 switches={str(e):str(1136+i)for i,e in enumerate([70,72,74,76,79,80,82])} def run(name,*args):subprocess.run([sys.executable,str(R/'scripts'/name),*map(str,args)],check=True,env=env) s=json.loads((R/'notes/navigation-state.json').read_text()) if start==1:assert sum((1<