(FILECREATED "26-Mar-84 21:44:40" {PHYLUM}<3-LISP>COURSE>SIMPLEG.;1 15562 changes to: (VARS SIMPLEGCOMS t1 t2 t3 t4 t5 t6 t7 t8 TURTLE TurtleArrow) (RECORDS LINE TURTLE) (FNS CENTER CLEARWINDOW ComputeTurtleArrayIndex CreateTurtleRecord DrawT DrawTurtle EraseTurtle FORWARD JUMP POINT PRETTY0 PRETTY1 PRETTY2 PRETTY3 SetUpTurtleArray TRITRI TURN CCurve CCurve1) (ADVICE CLEARW) previous date: "10-Feb-84 08:51:31" {ROSEBOWL}<VITTAL>COURSE>LISP>SIMPLEG.;9) (PRETTYCOMPRINT SIMPLEGCOMS) (RPAQQ SIMPLEGCOMS ((FNS CENTER CLEARWINDOW ComputeTurtleArrayIndex CreateTurtleRecord DrawT DrawTurtle EraseTurtle FORWARD JUMP POINT PRETTY0 PRETTY1 PRETTY2 PRETTY3 SetUpTurtleArray TRITRI TURN) (FNS CCurve CCurve1) (RECORDS LINE TURTLE) (BITMAPS t1 t2 t3 t4 t5 t6 t7 t8) (VARS TURTLE TurtleArrow t1 t2 t3 t4 t5 t6 t7 t8 (TurtleArrow (QUOTE (((0 0 0) (10 0 0)) ((7 4 0) (10 0 0)) ((7 -4 0) (10 0 0)))))) (ADVISE CLEARW) (P (SETQ TurtleWindow (CREATEW (CREATEREGION 300 25 700 700) " ------ Turtle Graphics Window ------ " 10)) (* This sets up the bit maps for each of the 8 turtles) (SetUpTurtleArray) (CreateTurtleRecord) (CENTER) (CLOSEW TurtleWindow)))) (DEFINEQ (CENTER (LAMBDA NIL (* edited: "26-Mar-84 21:36") (* Move the TURTLE to the center of the TurtleWindow) (EraseTurtle) (replace CURRENTX of TURTLE with (FQUOTIENT (WINDOWPROP (fetch (TURTLE WINDOW) of TURTLE) (QUOTE WIDTH)) 2)) (replace CURRENTY of TURTLE with (FQUOTIENT (WINDOWPROP (fetch (TURTLE WINDOW) of TURTLE) (QUOTE HEIGHT)) 2)) (replace HEADING of TURTLE with 0) (DrawTurtle))) (CLEARWINDOW (LAMBDA NIL (* edited: "26-Mar-84 21:36") (EraseTurtle) (CLEARW (fetch (TURTLE WINDOW) of TURTLE)) (replace HEADING of TURTLE with (REMAINDER (fetch HEADING of TURTLE) 360)))) (ComputeTurtleArrayIndex (LAMBDA NIL (* edited: "15-Jan-84 22:38") (while (LESSP (fetch HEADING of TURTLE) 0) do (replace HEADING of TURTLE with (FPLUS (fetch HEADING of TURTLE) 360))) (ADD1 (IQUOTIENT (REMAINDER (PLUS 22.5 (fetch HEADING of TURTLE)) 360) 45)))) (CreateTurtleRecord (LAMBDA NIL (* edited: "26-Mar-84 21:37") (SETQ TURTLE (create TURTLE HEADING ← 0 CURRENTX ← 0 CURRENTY ← 0 WINDOW ← TurtleWindow ERASED? ← T)))) (DrawT (LAMBDA NIL (* dmr: " 7-JUL-83 14:36") (FORWARD 50) (TURN 90 (QUOTE RIGHT)) (FORWARD 50) (TURN 90 (QUOTE LEFT)) (FORWARD 50) (TURN 90 (QUOTE LEFT)) (FORWARD 125) (TURN 90 (QUOTE LEFT)) (FORWARD 50) (TURN 90 (QUOTE LEFT)) (FORWARD 50) (TURN 90 (QUOTE RIGHT)) (FORWARD 50))) (DrawTurtle (LAMBDA NIL (* edited: "26-Mar-84 21:37") (COND ((fetch ERASED? of TURTLE) (replace ERASED? of TURTLE with NIL) (BITBLT (ELT TurtleArray (ComputeTurtleArrayIndex)) NIL NIL (fetch (TURTLE WINDOW) of TURTLE) (DIFFERENCE (fetch CURRENTX of TURTLE) 12) (DIFFERENCE (fetch CURRENTY of TURTLE) 12) NIL NIL NIL (QUOTE INVERT) NIL))))) (EraseTurtle (LAMBDA NIL (* edited: "26-Mar-84 21:37") (COND ((NOT (fetch ERASED? of TURTLE)) (replace ERASED? of TURTLE with T) (BITBLT (ELT TurtleArray (ComputeTurtleArrayIndex)) NIL NIL (fetch (TURTLE WINDOW) of TURTLE) (DIFFERENCE (fetch CURRENTX of TURTLE) 12) (DIFFERENCE (fetch CURRENTY of TURTLE) 12) NIL NIL NIL (QUOTE INVERT)))))) (FORWARD (LAMBDA (DISTANCE LINEWIDTH) (* edited: "26-Mar-84 21:38") (PROG (nextx nexty) (SETQ nextx (FPLUS (fetch CURRENTX of TURTLE) (FTIMES DISTANCE (COS (fetch HEADING of TURTLE))))) (SETQ nexty (FPLUS (fetch CURRENTY of TURTLE) (FTIMES DISTANCE (SIN (fetch HEADING of TURTLE))))) (EraseTurtle) (DRAWLINE (fetch CURRENTX of TURTLE) (fetch CURRENTY of TURTLE) nextx nexty (COND ((NULL LINEWIDTH) 1) (T LINEWIDTH)) NIL (fetch (TURTLE WINDOW) of TURTLE)) (replace CURRENTX of TURTLE with nextx) (replace CURRENTY of TURTLE with nexty) (DrawTurtle)))) (JUMP (LAMBDA (DISTANCE) (* edited: "16-Jan-84 15:23") (PROG (nextx nexty) (* This is the same code as FORWARD sans the DRAWLINE) (EraseTurtle) (SETQ nextx (FPLUS (fetch CURRENTX of TURTLE) (FTIMES DISTANCE (COS (fetch HEADING of TURTLE))))) (SETQ nexty (FPLUS (fetch CURRENTY of TURTLE) (FTIMES DISTANCE (SIN (fetch HEADING of TURTLE))))) (replace CURRENTX of TURTLE with nextx) (replace CURRENTY of TURTLE with nexty) (DrawTurtle)))) (POINT (LAMBDA (THETA) (* dmr: "21-JUL-83 11:28") (EraseTurtle) (replace HEADING of TURTLE with THETA) (DrawTurtle))) (PRETTY0 (LAMBDA NIL (* dmr: "30-JUN-83 13:19") (for i from 1 to 10 do (FORWARD 50) (TURN 178)))) (PRETTY1 (LAMBDA NIL (* edited: "15-SEP-83 13:56") (CENTER) (POINT 90) (for i from 1 to 10 do (DrawT) (DrawT) (TURN 10)))) (PRETTY2 (LAMBDA NIL (* edited: "15-SEP-83 13:56") (CLEARWINDOW) (CENTER) (POINT 90) (for i from 1 to 10 do (DrawT) (TURN 10) (DrawT)) (for i from 1 to 75 do (JUMP 3)))) (PRETTY3 (LAMBDA NIL (* dmr: "30-JUN-83 13:42") (CENTER) (POINT 0) (for i from 1 to 20 do (PRETTY0) (JUMP 30)))) (SetUpTurtleArray (LAMBDA NIL (* dmr: "21-JUL-83 11:26") (SETQ TurtleArray (ARRAY 8 (QUOTE POINTER))) (SETA TurtleArray 3 t1) (SETA TurtleArray 2 t2) (SETA TurtleArray 1 t3) (SETA TurtleArray 8 t4) (SETA TurtleArray 7 t5) (SETA TurtleArray 6 t6) (SETA TurtleArray 5 t7) (SETA TurtleArray 4 t8))) (TRITRI (LAMBDA (SIDE) (* dmr: "24-JUL-83 18:33") (FORWARD 100) (TURN 120 (QUOTE RIGHT)) (FORWARD 25) (TURN 120 (QUOTE LEFT)) (FORWARD 100) (TURN 120 (QUOTE RIGHT)) (FORWARD 25) (TURN 120 (QUOTE LEFT)) (FORWARD 100) (TURN 120 (QUOTE RIGHT)) (FORWARD 25))) (TURN (LAMBDA (THETA DIRECTION) (* dmr: "21-JUL-83 16:37") (* THETA is number of degrees to turn. Direction is either (QUOTE LEFT) or (QUOTE RIGHT.)) (* DrawArrow (fetch CURRENTX of TURTLE) (fetch CURRENTY of TURTLE) (fetch HEADING of TURTLE)) (EraseTurtle) (replace HEADING of TURTLE with (COND ((OR (EQUAL DIRECTION NIL) (EQUAL DIRECTION (QUOTE LEFT))) (FPLUS (fetch HEADING of TURTLE) THETA)) (T (FDIFFERENCE (fetch HEADING of TURTLE) THETA)))) (COND ((LESSP (fetch HEADING of TURTLE) 0) (replace HEADING of TURTLE with (IPLUS (fetch HEADING of TURTLE) 360)))) (COND ((GREATERP (fetch HEADING of TURTLE) 360) (replace HEADING of TURTLE with (REMAINDER (fetch HEADING of TURTLE) 360)))) (DrawTurtle) (* DrawArrow (fetch CURRENTX of TURTLE) (fetch CURRENTY of TURTLE) (fetch HEADING of TURTLE)) )) ) (DEFINEQ (CCurve (LAMBDA (len angle minlen ds) (* dmr: "27-JUL-83 16:34") (SETQ minLen minlen) (CCurve1 len angle ds))) (CCurve1 (LAMBDA (len angle ds) (* dmr: "27-JUL-83 16:35") (COND ((LESSP len minLen) (POINT angle) (FORWARD len)) (T (CCurve1 (FQUOTIENT len (SQRT 2.0)) (FPLUS angle 45) ds) (CCurve1 (FQUOTIENT len (SQRT 2.0)) (FDIFFERENCE angle 45) ds))))) ) [DECLARE: EVAL@COMPILE (RECORD LINE ((X1 Y1 Z1) (X2 Y2 Z2))) (RECORD TURTLE (HEADING CURRENTX CURRENTY WINDOW ERASED?)) ] (RPAQ t1 (READBITMAP)) (25 25 "@@AL@@@@" "@@CF@@@@" "@@BB@@@@" "AHCF@L@@" "BDADAB@@" "BDALAB@@" "BBCFFB@@" "CJNCML@@" "@OHHF@@@" "@FALC@@@" "@BCNA@@@" "@DBJA@@@" "@D@HA@@@" "@D@HA@@@" "@B@HB@@@" "@C@HB@@@" "@GHHGH@@" "@DL@NL@@" "@IGOBF@@" "CB@HBB@@" "BD@LAB@@" "BD@D@J@@" "GL@L@L@@" "@@C@@@@@" "@@B@@@@@") (RPAQ t2 (READBITMAP)) (25 25 "@@AOHG@@" "@@@HHLH@" "@@@IHHH@" "@@COFCH@" "@AL@CN@@" "@C@@AH@@" "@F@GHH@@" "@D@AHL@@" "@D@CHD@@" "NL@FHD@@" "KH@LHD@@" "HHAH@GH@" "HHC@@HH@" "KHB@@HH@" "LH@@AOH@" "@H@@AAH@" "@L@@CCH@" "@O@@FC@@" "HIN@L@@@" "OHGO@@@@" "@@DD@@@@" "@ALL@@@@" "@A@H@@@@" "@A@H@@@@" "@AOH@@@@") (RPAQ t3 (READBITMAP)) (25 25 "@@@@@@@@" "AN@@A@@@" "AC@@AH@@" "CA@@AD@@" "AMANCD@@" "@DNALL@@" "@GH@G@@@" "@A@@A@@@" "@B@@@H@@" "@F@@LKH@" "@D@@FFH@" "ILCOODH@" "JH@@FGH@" "FL@@LL@@" "@D@@@H@@" "@B@@AH@@" "@GH@AL@@" "@EN@ND@@" "AMAOCD@@" "CA@@AD@@" "CI@@AD@@" "@N@@CH@@" "@@@@@@@@" "@@@@@@@@" "@@@@@@@@") (RPAQ t4 (READBITMAP)) (25 25 "F@AO@@@@" "I@AC@@@@" "AHAB@@@@" "@HCF@@@@" "@HGL@@@@" "@OHF@@@@" "@D@C@@@@" "@L@AHC@@" "NHD@LCH@" "K@F@FBH@" "I@C@CLH@" "K@A@A@H@" "M@AHAAH@" "@H@M@O@@" "@H@E@H@@" "@D@G@H@@" "@CAO@H@@" "@A@@AH@@" "@AL@A@@@" "@@F@NJ@@" "@DEOIG@@" "@GLHAAH@" "@CAHA@H@" "@AO@@IH@" "@@F@@G@@") (RPAQ t5 (READBITMAP)) (25 25 "@@AL@@@@" "AN@D@O@@" "BB@DAA@@" "BCAHAB@@" "AONGNN@@" "@AH@M@@@" "@A@HG@@@" "@C@HC@@@" "@B@HA@@@" "@B@HA@@@" "@B@HA@@@" "@B@HA@@@" "FB@HA@@@" "GABJC@@@" "EICNBC@@" "DGALGO@@" "DAALDA@@" "C@LHNB@@" "AKNCIN@@" "@NCN@@@@" "@@AB@@@@" "@@BA@@@@" "@@BM@@@@" "@@CC@@@@" "@@AN@@@@") (RPAQ t6 (READBITMAP)) (25 25 "@@CL@D@@" "@@DB@B@@" "@@DD@B@@" "@@FD@B@@" "D@COMN@@" "L@N@F@@@" "LAH@C@@@" "LF@@A@@@" "JL@AI@@@" "IH@CA@@@" "O@@FA@@@" "C@HLAO@@" "A@IHA@H@" "A@K@CHH@" "B@N@BDH@" "B@OHFDH@" "A@@@DC@@" "@L@AH@@@" "CB@C@@@@" "NCHN@@@@" "HFOLB@@@" "HDAKN@@@" "HD@HD@@@" "LL@HL@@@" "G@@G@@@@") (RPAQ t7 (READBITMAP)) (25 25 "@GL@@F@@" "@LH@AI@@" "@HH@AA@@" "@HH@AA@@" "@LOOMG@@" "@GL@CD@@" "@G@@AL@@" "@D@@@H@@" "FHF@@D@@" "JHL@@DH@" "IIOONFH@" "HHL@@EH@" "KHF@@D@@" "FH@@@H@@" "@L@@@H@@" "@N@@AH@@" "@ON@CL@@" "@HKONJ@@" "@I@@AC@@" "@HH@BAH@" "@LL@A@H@" "@FD@AM@@" "@CN@@B@@" "@@@@@@@@" "@@@@@@@@") (RPAQ t8 (READBITMAP)) (25 25 "GHAOH@@@" "HLACH@@@" "HDON@@@@" "LGJG@@@@" "DL@AL@@@" "CH@@F@@@" "AAOHCAH@" "CAL@AAH@" "BAF@@KH@" "FAC@@NH@" "GAAH@DH@" "I@@L@DH@" "IH@F@FH@" "IL@C@EH@" "FD@AHH@@" "FF@@@H@@" "BC@@@H@@" "@AL@A@@@" "@@G@CN@@" "@@MOOK@@" "@AA@@A@@" "@AA@@@H@" "@AHH@@H@" "@@HH@A@@" "@@GH@@@@") (RPAQQ TURTLE (180.0 340.0 435.5 {WINDOW}#13,20454 NIL)) (RPAQQ TurtleArrow (((0 0 0) (10 0 0)) ((7 4 0) (10 0 0)) ((7 -4 0) (10 0 0)))) (RPAQ t1 (READBITMAP)) (25 25 "@@AL@@@@" "@@CF@@@@" "@@BB@@@@" "AHCF@L@@" "BDADAB@@" "BDALAB@@" "BBCFFB@@" "CJNCML@@" "@OHHF@@@" "@FALC@@@" "@BCNA@@@" "@DBJA@@@" "@D@HA@@@" "@D@HA@@@" "@B@HB@@@" "@C@HB@@@" "@GHHGH@@" "@DL@NL@@" "@IGOBF@@" "CB@HBB@@" "BD@LAB@@" "BD@D@J@@" "GL@L@L@@" "@@C@@@@@" "@@B@@@@@") (RPAQ t2 (READBITMAP)) (25 25 "@@AOHG@@" "@@@HHLH@" "@@@IHHH@" "@@COFCH@" "@AL@CN@@" "@C@@AH@@" "@F@GHH@@" "@D@AHL@@" "@D@CHD@@" "NL@FHD@@" "KH@LHD@@" "HHAH@GH@" "HHC@@HH@" "KHB@@HH@" "LH@@AOH@" "@H@@AAH@" "@L@@CCH@" "@O@@FC@@" "HIN@L@@@" "OHGO@@@@" "@@DD@@@@" "@ALL@@@@" "@A@H@@@@" "@A@H@@@@" "@AOH@@@@") (RPAQ t3 (READBITMAP)) (25 25 "@@@@@@@@" "AN@@A@@@" "AC@@AH@@" "CA@@AD@@" "AMANCD@@" "@DNALL@@" "@GH@G@@@" "@A@@A@@@" "@B@@@H@@" "@F@@LKH@" "@D@@FFH@" "ILCOODH@" "JH@@FGH@" "FL@@LL@@" "@D@@@H@@" "@B@@AH@@" "@GH@AL@@" "@EN@ND@@" "AMAOCD@@" "CA@@AD@@" "CI@@AD@@" "@N@@CH@@" "@@@@@@@@" "@@@@@@@@" "@@@@@@@@") (RPAQ t4 (READBITMAP)) (25 25 "F@AO@@@@" "I@AC@@@@" "AHAB@@@@" "@HCF@@@@" "@HGL@@@@" "@OHF@@@@" "@D@C@@@@" "@L@AHC@@" "NHD@LCH@" "K@F@FBH@" "I@C@CLH@" "K@A@A@H@" "M@AHAAH@" "@H@M@O@@" "@H@E@H@@" "@D@G@H@@" "@CAO@H@@" "@A@@AH@@" "@AL@A@@@" "@@F@NJ@@" "@DEOIG@@" "@GLHAAH@" "@CAHA@H@" "@AO@@IH@" "@@F@@G@@") (RPAQ t5 (READBITMAP)) (25 25 "@@AL@@@@" "AN@D@O@@" "BB@DAA@@" "BCAHAB@@" "AONGNN@@" "@AH@M@@@" "@A@HG@@@" "@C@HC@@@" "@B@HA@@@" "@B@HA@@@" "@B@HA@@@" "@B@HA@@@" "FB@HA@@@" "GABJC@@@" "EICNBC@@" "DGALGO@@" "DAALDA@@" "C@LHNB@@" "AKNCIN@@" "@NCN@@@@" "@@AB@@@@" "@@BA@@@@" "@@BM@@@@" "@@CC@@@@" "@@AN@@@@") (RPAQ t6 (READBITMAP)) (25 25 "@@CL@D@@" "@@DB@B@@" "@@DD@B@@" "@@FD@B@@" "D@COMN@@" "L@N@F@@@" "LAH@C@@@" "LF@@A@@@" "JL@AI@@@" "IH@CA@@@" "O@@FA@@@" "C@HLAO@@" "A@IHA@H@" "A@K@CHH@" "B@N@BDH@" "B@OHFDH@" "A@@@DC@@" "@L@AH@@@" "CB@C@@@@" "NCHN@@@@" "HFOLB@@@" "HDAKN@@@" "HD@HD@@@" "LL@HL@@@" "G@@G@@@@") (RPAQ t7 (READBITMAP)) (25 25 "@GL@@F@@" "@LH@AI@@" "@HH@AA@@" "@HH@AA@@" "@LOOMG@@" "@GL@CD@@" "@G@@AL@@" "@D@@@H@@" "FHF@@D@@" "JHL@@DH@" "IIOONFH@" "HHL@@EH@" "KHF@@D@@" "FH@@@H@@" "@L@@@H@@" "@N@@AH@@" "@ON@CL@@" "@HKONJ@@" "@I@@AC@@" "@HH@BAH@" "@LL@A@H@" "@FD@AM@@" "@CN@@B@@" "@@@@@@@@" "@@@@@@@@") (RPAQ t8 (READBITMAP)) (25 25 "GHAOH@@@" "HLACH@@@" "HDON@@@@" "LGJG@@@@" "DL@AL@@@" "CH@@F@@@" "AAOHCAH@" "CAL@AAH@" "BAF@@KH@" "FAC@@NH@" "GAAH@DH@" "I@@L@DH@" "IH@F@FH@" "IL@C@EH@" "FD@AHH@@" "FF@@@H@@" "BC@@@H@@" "@AL@A@@@" "@@G@CN@@" "@@MOOK@@" "@AA@@A@@" "@AA@@@H@" "@AHH@@H@" "@@HH@A@@" "@@GH@@@@") (RPAQQ TurtleArrow (((0 0 0) (10 0 0)) ((7 4 0) (10 0 0)) ((7 -4 0) (10 0 0)))) (PUTPROPS CLEARW READVICE (NIL (BEFORE NIL (COND ((EQ TurtleWindow WINDOW) (EraseTurtle)))) (AFTER NIL (COND ((EQ WINDOW TurtleWindow) (DrawTurtle)))))) (READVISE CLEARW) (SETQ TurtleWindow (CREATEW (CREATEREGION 300 25 700 700) " ------ Turtle Graphics Window ------ " 10)) (* This sets up the bit maps for each of the 8 turtles) (SetUpTurtleArray) (CreateTurtleRecord) (CENTER) (CLOSEW TurtleWindow) (DECLARE: DONTCOPY (FILEMAP (NIL (1389 9172 (CENTER 1399 . 2021) (CLEARWINDOW 2023 . 2324) (ComputeTurtleArrayIndex 2326 . 2726) (CreateTurtleRecord 2728 . 2999) (DrawT 3001 . 3441) (DrawTurtle 3443 . 3923) (EraseTurtle 3925 . 4404) (FORWARD 4406 . 5217) (JUMP 5219 . 5889) (POINT 5891 . 6093) (PRETTY0 6095 . 6287) ( PRETTY1 6289 . 6529) (PRETTY2 6531 . 6850) (PRETTY3 6852 . 7075) (SetUpTurtleArray 7077 . 7465) ( TRITRI 7467 . 7864) (TURN 7866 . 9170)) (9173 9686 (CCurve 9183 . 9344) (CCurve1 9346 . 9684))))) STOP