LOGO Turtle Graphics Demonstration Program By Neil Wick [71056,613] This program is a casual attempt to write a computer language in Basic. It is not a full-function Logo programming language, but it has a few functions and it was written while I stood in line on my vacation (and the lines weren't really that long). Standard Logo abbreviated commands are used. (The fully spelled-out equivalents were avoided to save memory and screen space.) After the opening screen (which you can skip past by pressing any key), you will get a blank screen with a cursor in the corner. The "turtle" is invisible, as it always is and is right in the middle of the screen (home) facing up (0 degrees). You may have a file containing procedures named PROCS.DO. If this file does not exist, it will be created. (More about this file later.) You must type commands in capitals. Spaces must appear around commands, but not on the insides of brackets. Multiple commands may be typed on one line with spaces between them. When you come to the bottom of the screen, you'll keep typing over the same line. (Kind of messy, but this was basically a "quickie.") The following commands are permitted: FD n (forward) BK n (back) Move the turtle n units forwards or backwards in the direction it's facing RT n (right) LT n (left) Change the turtle's heading n degrees to the left or right CS (clear screen) CLEAN (clean screen) CLEAN merely wipes off everything which appears on the screen (and homes the text cursor); CS also homes the turtle and sets its heading to 0 degrees HOME Moves the turtle to the middle of the screen PU (pen up) PD (pen down) PE (pen erase) When the pen is down (as at the beginning), any movement of the turtle draws a line. When it's up, the turtle moves without drawing a line. PE causes the pen to draw a white line. SETH n (set heading) SETX n (set x coordinate) SETY n (set y coordinate) Unlike RT, LT, FD, and BK, these commands set the turtle to an absolute location and heading. Positive coordinates go up and to the right. Negative ones go down and to the left. Note that this is opposite to Basic for Y coordinates. The origin (0,0) is in the middle of the screen. Valid coordinates range from -120 to 119 for X and -32 to 31 for Y. Valid heading range from -32768 to 32767 degrees. Menu The F8 key (Menu) will end the program and take you back the the M100 menu. You should end Logo this way so that the 256 bytes of high memory reserved at the beginning of the program are freed up again. REPEAT n [proc1 proc2] REPEAT takes one or more commands or procedures in brackets. The items in the brackets are repeated n times. REPEATs cannot contain other REPEATs not can they contain procs with REPEATs in them. Procedures (the PROCS.DO file) The PROCS file may contain procedures. They should appear as follows: 1st line: blank 2nd line: TO procname 3rd to n-1 lines: commands nth line: END Do not press enter after the last END statement. Be sure the file starts with a blank line. See example file PROCS.LGO. Procs may not contain other procs. I'd be happy to hear any comments as I hope to write a machine language version (maybe some day). Neil