"""Normal cart interaction with a destination predicted from installed puzzle source.""" import json,subprocess,sys,os from pathlib import Path R=Path(__file__).resolve().parents[1];eid=int(sys.argv[1]);label=sys.argv[2];assert eid in [28,29,41,42] n=json.loads((R/'notes/navigation-state.json').read_text());model=json.loads((R/'work/197-rail-cart-transitions.json').read_text())[str(eid)];var=str(model['variable']);before=n['variables'][var] if eid==42 and any(n['switches'].get(str(s))for s in [1164,1165]): proof=json.loads((R/'work/198-loaded-cart-source-proof.json').read_text());assert len(proof)==2 and all(p['all_80_transitions_match_empty_cart'] and p['player_routes']==0 for p in proof) mask=sum((1<