/maize 7 dec 66 3/ jmp brk define next a,b,c,d,e,f law . 4 add i pdp dap . 1 jmp i . a b c d e f terminate define winner a,b xct b 1000x[a] terminate siz=16000 q=200 qq=9s-[q>10-1] /generate new maze beg, law 62 lio (10 arq jmp beg dra dio t rcr 9s xor t dac sed dac .ran jsp tex text . turn on sense switch 1 for directions _. bgo, law xtb dap . 2 dzm bnt 17. dzm . idx .-1 sas .-3 jmp .-3 clc dac ytb dac ytb 18. dac xtb dac xtb 18. law 2 dac x law 18. dac y law drt 2 dac drr law pdl dac pdp lac ran dac .sed law go /main generation loop sea, dac i pdp /return adr idx pdp lac ran rar 1 xor (311071 add (311071 dac ran ral 6s ior ran dac t /bit prob. = 3/4 ral 6s ior (70000 and t /bit prob (bits 0,1,2) = 9/16 and (770000 dac i pdp law 7 and ran adm i pdp /low btts determine sequence of branch tries /insert bit fr this location in table ubt, law bnt-1 add y dap ub1 law sht-1 add x dap ub1 1 lac i ub1 1 xor (ril~rir dac ub2 ub1, lio . xct . law 1 ril 1 rcr 1 ub2, 0 dio i ub1 /display point at this location in maze law i 9 add y mul (siz div (1 hlt sub (siz>2 dac t law i 9 add x mul (siz div (1 hlt sub (siz>2 lio t dpy-i 300 0lw, next s1w,s2w,s3w,s1w,s2w,s3w sea 2 sea 2 s1w, law i drt 1 /look left add drr spa add (4 add (drt dac ndr jdp chw /check wall's presence jmp slw /wall--skip left turn lac i pdp spa jmp lwl /try to put up wall 9/16 of time nlw, jdp cho jmp olw /if square is occupied jdp sup /otherwise step intosquare and pushj jdp pup /restore slw, next s2w,out,out,s3w,s3w,s2w /ETC. s2w, lac drr dac ndr jdp chw jmp sfw lac i pdp ral 1 sma /more fwd moves than left or right jmp fwl nfw, jdp cho jmp ofw jdp sup jdp pup sfw, next s3w,s3w,s1w,out,s1w,out s3w, law i drt 3 add drr spa add (4 add (drt dac ndr jdp chw jmp srw lac i pdp ral 2s spa jmp rwl nrw, jdp cho jmp orw jdp sup jdp pup srw, next out,s1w,s2w,s2w,out,s1w out, law i 1 adm pdp dap . 1 jmp i . olw, lac i pdp ral 3s spa jmp slw /no wall 3/4 of time lwl, jdp scn /try to put up wall jmp xlw /don't put up wall jdp ins /insert wall jmp slw xlw, jdp cho jmp slw jmp nlw 2 ofw, lac i pdp ral 4s spa jmp sfw fwl, jdp scn jmp 0fw jdp ins jmp sfw 0fw, jdp cho jmp sfw jmp nfw 2 orw, lac i pdp ral 5s spa jmp srw rwl, jdp scn jmp 0rw jdp ins jmp srw 0rw, jdp cho jmp srw jmp nrw 2 /pushj sup, 0 lio i ndr rcr 9s sar 9s adm y rcr 9s sar 9s adm x idx pdp lac drr dac i pdp idx pdp lac ndr dac drr lac sup jmp sea /popj pup, 0 lac i drr cma>>05<>05<>05<2 dac po1 law bnt dap db1 db1, lio . lac (-9xsiz siz>2 spi i jmp db2 dio po2 lio po1 dpy-i 300 lio po2 db2, ril 1 add (siz sas (18.xsiz-9xsiz siz>2 jmp db1 2 lac (siz adm po1 idx db1 sas (lio bnt 18. jmp db1 rbt lai rir 6s spi i jmp i ins lio but dac but lai cma and but ral 3s spa jmp i ins jmp in4 jmp i ins /maze display go, lio sed cla div (9 hlt lai add (1 sal q-1 sub (q>2 sal 5s dac xxp lio sed ril 9s cla div (9 hlt lai add (1 sal q-1 sub (q>2 sal 5s dac yyp law flexo q4 arq jm_ .-2 law 42 lio (10 arq jmp .-3 jsp tex text . maze number _. lac sed jdp dpt jsp tex text . complexity _. lac cmx jdp dpt szs i 10 jmp rgo jsp tex text / starting at upper left of nonsense switches. 1 down enable motion 2 up perspective display down plan display 3 down display construction process 4 down holds display of construction process after each wall is inserted until button 13 is pressed 5 down display coordinates of block occupied by observer 7 down displays running time (seconds) 8 down set clock (adjust clock so both flags 5 and 6 are off) 9 down replay this run after reaching winning block bottom row 10 press to print distance travelled so far 11 press to restart this maze from the beginning 12 press to generate a new maze 13 press to step held display (switch 4) 14 press to set new complexity number 15 press to specify maze number 16 press to simulate a win 17 press to stop entire program 18 press to continue knob 1 controls speed, left for reverse, right for forward knob 2 is not used knob 3 controls direction observer is heading, knob points up for north knob 4 controls magnification, left is wide-angle, right is telescopic the goal is in the ne corner, you start randomly in the sw sector._/ rgo, law brk /rerun maze dap 3 law but dap brn rg1, cac /replay maze law pdl dac pdp lac xxp dac xxx lac yyp dac yyy lac (add dac dis dzm di2 dzm .brc dzm v.th lac (lac dac .mag dzm tht dzm .prb lac (i dac hsp. asc 400 cbs esm /update position and angle pm2, lac xxx sar 5s ior (1 dac xco lac yyy sar 5s ior (1 dac yco lac nmg dac mag lac nsn dac snt lac ncs dac cst law q add xco sar q-1 dac .blx law q add yco sar q-1 dac .bly lio but rir 2s spi jmp clb /display coordinates lio but rir 5s spi i jmp pm5 lio (300600 jdp sdp lac blx lio (340600 jdp sdp /display running time pm5, lio but rir 3s spi i jmp pm3 law 2437 mul brc lio (300200 jdp sdp /store history of this run pm3, law 18. mul blx div (1 hlt add bly sad prb jmp pm4 dac .prb lac 3 sas (jmp brk jmp pm4 lac (-add adm hsp lio i hsp sma ril 9s lac prb rcr 9s lac hsp spa rir 9s dio i hsp /check for win pm4, clo law 18.x18. 18. sad prb jmp won lio but rir 8s spi i jmp pmz dzm bkc asc 100 jdp dar jmp pm2 /perspective display setup pmz, lac (add-10 dac .bkc asc 100 lac snt div cst jmp sgc cgs, lio cst law mve spi law mvw dac dir dac odr law i q-1 and yco spi add (q sub yco dac tyy dac ysv law i q-1 and xco spi add (q sub xco dac txx dac xsv jmp pm1 sgc, lio snt law mvn spi law mvs dac dir dac odr law i q-1 and xco spi i add (q sub xco dac txx dac xsv law i q-1 and yco spi add (q sub yco dac tyy dac ysv pm1, law i 10 dac cnt law pm2 dac luk lac (377777 dac rit cma dac lft jmp lu1 /main perspective display loop /flag 2, 1 . display right edge of wall /flag 4, 1 . display left edge of wall, or display winning wall /flag 6, 1 . the scan of walls has advanced into the visible area / or into the area to the right of the left visiblity / limit extended behind the observer. / it indicates that when a point is to the left again, / the scan should stop. / the scan cannot possibly pass in front of the observer / without flag 6 going on. luk, 0 law drd 1 lio xsv dio txx spi add (1 lio ysv dio tyy spi add (2 dap drd law q drd, jmp . jmp qd0 jmp qd1 jmp qd3 qd2, cma qd0, adm xsv dac txx jmp lu1 qd3, cma qd1, adm ysv dac tyy lu1, clf 6 stf 2 jdp wall /check for presence of wall jmp nw1 /no wall lu2, jdp cah jmp lu9 /point is behind to left jmp lu7 /point is to the right jmp lu9 /point is behind in the middle /or in fron to left dac rit /point is in fron in middle law 5000 szf i 2 szf 4 law 1000 mul mag div lll jmp lu7 dac vrt sal 1 dac .vri law i 3 dac .vrc dlp, lac hhh lio vrt dpy-i 300 swp cma>>05<7 sub po1 sas (siz>7x10 jmp dln dnl, lac (siz adm po2 idx gwd sub dmz sas (lio 19. jmp gwd lac (siz adm po1 idx xsh sas (xct sht 18. jmp dm0 idx dmx dmx, jmp . dar, 0 law xtb jda dmz swp law ytb jda dmz nop lac (-9xq add yco mul (siz div (q hlt dac tyy lac (-9xq add xco mul (siz div (q hlt lio tyy dpy-i 300 dpy-i 300 jmp i dar /rat has reached goal /display distance travelled won, dsc 100 law i 400. dac inp wo1, jdp fds lio (000200 jdp sdp law 2437 mul brc lio (700200 jdp sdp isp inp jmp wo1 lio but rir 1 spi i jmp rgo lac (add 7777 dac .ghs law 777 and 7777 dac .plb lac (jmp brp sad 3 jmp rg1 dac 3 law bu2 dap brn lac hsp add (-add dac .ghe sas ghs jmp rg1 jmp rgo /sequence break routines brk, sas (1 jmp rbn isp bkc dsc 100 ckn 200 lai cma rar 8s sub (lac sub tht sar 3s brx, adm tht jda sin dac nsn lac tht jda cos dac ncs ckn 300 lai rar 9s mul (340000 add (37000 dac .nmg brn, lio bu2. ril 9s spi i jmp re1 ckn lai sub (200 dac kn1 spa cma clo adm dis szo idx di2 lac kn1 mul ncs jda brr xxx yyy xtb lac kn1 mul nsn jda brr yyy xxx ytb re1, iot 610 idx brc jmp ret /check for running into walls brr, 0 dap br1 dap br2 idx br2 dap br3 idx br3 br1, lac i . lio brr spi i add (qx40 and (1-qx40 dac btm sar 5s sar q-1 br3, add . dap gxy br2, lac i . sar 5s sar q-1 add (sht dap gxy 1 gxy, lio . xct . spi i jmp br4 xct br1 sub btm dac btm mul btm sub (20 sma jmp br4 add (20 mul brr /reduce velocity component if near wall scl 10000>q-1 scl 4000>q-1 jmp br4 1 br4, lac brr adm i br1 idx br3 jmp i br3 /read buttons rbn, rbt lac but dio but cma and but dac .bon /buttons turned on since last time sza i jmp ret spi jdp inf /print distance lio bon ril 7s lac i 1 sad (wat jmp brm lac 1 spi jda sto /stop jmp rb1 brm, ril 1 spi jmp sta /start rb1, lio bon ril 6s spi jmp won rir 4s spi jmp bgo /new maze rir 1 spi jmp rgo /restart this maze ril 3s spi jmp scm /set complexity ril 1 spi i jmp ret smn, jsp tex /set maze number text / type in maze no. _/ jdp inp skp i jmp ret dac ran jmp bgo scm, jsp tex text / type in complexity no. (12 sal 5s dac .nxx lai sal q-1 add (q>2 sal 5s dac .nyy /compute approx angle to center of next block and cause /actual angle to approach this as a second order system bp2, lac nxx sub xxx dac .ndx lac nyy sub yyy dac .ndy div ndx jmp bp3 sar 2s lio ndx bp4, spi add (add sub tht sub vth lia spa cma sub (i sar 9s and but dac bu.2 lai sar 4s adm vth sar 5s jmp brx bp3, lac ndx div ndy hlt sar 2s cma add (lac lio ndy jmp bp4 /stop-start sto, 0 law (wat dap 1 dsc 100 jmp ret sta, lac sto dac 1 asc 100 jmp ret /calibrate clock clb, lac 3 dap clr law cl3 dap 3 asc 100 cl1, law cs2 dac 1 law i 2000.>4 100.>4 dac .clk iot 610 jmp i 1 cs2, isp clk jmp i cl1 isp clk jmp clr jmp .-2 cl3, sas (1 jmp rbn lac clk clf 7 sma stf 6 add (100.>2 spa stf 5 lio but rir 2s spi jmp cl1 clr, law . dap 3 cbs jmp pm2 /print distance inf, 0 jsp tex text . distance so far is _. jdp fds jdp dpt jsp tex text . blocks _. jmp i inf tfa, jsp tex text .too far???? _. lac (add dac dis dzm di2 jmp i inf /decimal input routine inp, 0 clc dac inf tyi lai sad (77 jmp ind sza i jmp inr sad (20 cla sub (12 sma jmp inr add (12 rar 3s add inf ral 3s add inf adm inf jmp inp 3 ind, lac inf sas (-0 jmp i inp inr, idx inp jsp tex text / input ignored. _/ jmp i inp /find distance travelled fds, 0 lac (add xor dis lio di2 swp scr 5s scr q-1 swp sni jmp i fds /text printer tex, dap txy lio i txy idx txy lac (607600 rcl 6s sad (lai txy, jmp . sad . 2 jmp tex 1 swp tyo lia jmp txy-3 /decimal print dpt, 0 dac .dp1 dzm .dp2 dpa, dac .dp3 cli>>05<>05<2 1s=1 cli t, 0 x, 0 y, 0 drr, drt xs, 0 ys, 0 ndr, 0 sdr, 0 cmx, 50. wi1, winner xtb 18.,sht 17. win, winner ytb 18.,sht 17. xxx, 0 yyy, 0 xxp, 0 yyp, 0 xco, 0 yco, 0 dis, 0 di2, 0 kn1, 0 btm, 0 cnt, 0 txx, 0 tyy, 0 xsv, 0 ysv, 0 dir, 0 odr, 0 mvn, q>10 mvw, -q>10x1000 mvs, -q>10 mve, q>10x1000 rit, 377777 lft, 400000 vrt, 0 po1, 0 po2, 0 hhh, 0 l , 0 tht, 0 ncs, 377777 nsn, 0 cst, 377777 snt, 0 xcs, 0 xsn, 0 pdp, pdl-1 variables constants pdl, start beg _