"""Push the reviewed Ruby-room boulder normally; verify its exact position from a normal save.""" from nav import * import ast eid=int(sys.argv[1]);assert eid in [55,69,81] key=sys.argv[2];count=int(sys.argv[3]);label=sys.argv[4];assert key in ['up','down','left','right'] and 1<=count<=4 v=json.loads(subprocess.check_output(['ruby',str(ROOT/'scripts/route_map.rb'),'803','0','0'],stderr=subprocess.DEVNULL));e=v['events'][str(eid)];assert 'pbPushThisBoulder' in str(e['list']);dx,dy={'up':(0,-1),'down':(0,1),'left':(-1,0),'right':(1,0)}[key];x,y=e['x'],e['y'];expected=[x+count*dx,y+count*dy] tree=ast.parse((ROOT/'scripts/nav.py').read_text());fun=next(n for n in tree.body if isinstance(n,ast.FunctionDef)and n.name=='route');ns=dict(ROOT=ROOT,json=json,heapq=heapq,re=re);exec(ast.unparse(fun).replace('graph = {}','jumps = {}; graph = {}').replace('native_jump = terrain(n) == 1','native_jump = False'),ns) vv=json.loads(json.dumps(v));vv['events'].pop(str(eid));g=ns['route'](vv,None,True);cursor=(x,y) for _ in range(count): dest=cursor[0]+dx,cursor[1]+dy;assert (key,dest)in g.get(cursor,[]);cursor=dest subprocess.run([sys.executable,str(ROOT/'scripts/q.py'),f'803,{x-dx},{y-dy}'],check=True) seq=[] for j in range(count): seq += [key+':.12','wait:.55'] if j