XLogo User Documentation Documentation Version: Draft 3 - 11/22/2003 Copyright 2003 Jeff Skrysak Table of Contents I. Introduction to the software II. Overview of LOGO commands used in XLogo III. How to enter in commands IV. Saving your commands to a file V. Loading your commands from a file VI. Telling the turtle to draw VII. Printing your drawing VIII. Changing the speed of the turtle IX. Sample LOGO code X. Additional Information and Helpful Tips I. Introduction to the software XLogo is a program that allows you to enter in LOGO commands which in turn direct a turtle in the drawing area. You can use those commands and the turtle to draw an shape or image you can imagine. Multiple turtles can be used at one time and the speed may be varied. XLogo is open source, written in Objective-C, and localized in many different languages. For more information visit the XLogo website at: http://xlogo.sourceforge.net/ II. Overview of LOGO commands used in XLogo ¥ FORWARD x - move the turtle forward x spaces ¥ BACKWARD x - move the turtle backward x spaces ¥ RIGHT x - turn the turtle right x degrees ¥ LEFT x - turn the turtle left x degrees ¥ PENUP - put the pen up (stop drawing) ¥ PU - put the pen up (same as above, but shorthand) ¥ PENDOWN - put the pen down (start drawing) ¥ PD - put the pen down (same as above, but shorthand) ¥ HOME - go back to (0,0) ¥ CLEAR - clear the screen ¥ REPEAT x [command(s)] - repeat 1 or more commands x times ¥ SETHEADING x - set heading to x degrees ¥ SETH x - set heading to x degrees (same as above, but shorthand) ¥ CLEARGRAPHICS - clear the graphics on the screen ¥ CG - clear graphics (same as above, but shorthand) ¥ MAKE "name- make a variable or list ¥ SETPENSIZE x - set the size of the pen to draw thicker, or more narrow lines ¥ SETTURTLESIZE x - set the size of the turtle (using numerical value; 1.0 is normal size, 2.0 is double, etc..) ¥ SETTURTLECOLOR x - set the color of the turtle (using numerical value) ¥ SETCOLOR x - set the color (using numerical value) ¥ SETBG x - set the color of the background (using numerical value) ¥ NEWTURTLE "name - create a new turtle with a name ¥ HIDETURTLE - hide a turtle ¥ SHOWTURTLE - show a turtle ¥ TALKTO name - talk to a turtle, to give it comands ¥ TALKTO [name, name, ...] - talk to multiple turtles ¥ NORTH - set the turtle facing north (90 degrees) ¥ N- set the turtle facing north (same as above, but shorthand) ¥ NORTHWEST - set the turtle facing northwest ¥ NW - set the turtle facing northwest (same as above, but shorthand) ¥ NORTHEAST - set the turtle facing northeast ¥ NE - set the turtle facing northeast (same as above, but shorthand) ¥ WEST - set the turtle facing west ¥ W - set the turtle facing west (same as above, but shorthand) ¥ SOUTH - set the turtle facing south ¥ S - set the turtle facing south (same as above, but shorthand) ¥ SOUTHWEST - set the turtle facing southwest ¥ SW - set the turtle facing southwest (same as above, but shorthand) ¥ SOUTHEAST - set the turtle facing southeast ¥ SE - set the turtle facing southeast (same as above, but shorthand) ¥ EAST - set the turtle facing east ¥ E - set the turtle facing east (same as above, but shorthand) The letter "x" above should be replaced by a number representing the number of spaces to move (in the case of FORWARD and BACKWARD commands), the number of degress to turn (in the case of RIGHT and LEFT), or the number of repetitions (REPEAT command). * Note: The commands can be written in lower or upper case. XLogo is not case sensitive. III. How to enter in commands There are two text areas at the right side of the XLogo window. The one above is for any errors or output from the parser, and the one below (larger) is for commands. To enter commands, select that text area if it is not already selected, and begin typing in your commands. Extra spaces and lines will be ignored so your commands can be spread out or separated to your liking. IV. Saving your commands to a file To save your LOGO commands, simple chose the "Save" button at the top right of the current XLogo window, or go to the "File" menu at the top of the screen and chose "Save" or "Save As.." Figure 1 - Save button V. Loading your commands from a file To load a previously saved XLogo document, go to "File" in the menu at the top of the screen and select "Open" or "Open Recent.." from there you can chose a saved XLogo program and open it. VI. Telling the turtle to draw When you are ready to set the turtle on its drawing task, press the button at the bottom and middle of the XLogo program window. It should have a green flag and the word "GO". (see figure 4) Drawing will start shortly thereafter, at the speed of the turtle chosen by the speed selector. Figure 2 - Draw button VII. Printing your drawing To print your drawing, simply select the button with the printer image at the top right corner of the XLogo program window (see figure 5). A print dialog will appear asking you for any special print options that you may want to choose from. Only the drawing area will be printed. None of your LOGO commands will be included in the print-out. Figure 3 - Print button VIII. Changing the speed of the turtle You may change the speed of the turtle at any time, even while drawing. To do so, simply select the speed you want by moving the slider. See figure 6 for details. Figure 4 - Turtle speed IX. Sample LOGO code Below is a sample LOGO program in case you need extra help. Put it into the XLogo program to see what it does!! newturtle "Frank newturtle "Cindy talkto [Bob Frank Cindy] penup talkto "Bob left 90 forward 87 talkto "Frank left 90 forward 35 talkto "Cindy right 90 forward 35 talkto [Bob Cindy] left 90 talkto "Frank right 90 talkto [Frank Cindy] forward 25 talkto "Bob pendown repeat 92 [forward 3 left 2] talkto [Frank Cindy] pendown forward 75 talkto [Bob Frank Cindy] hideturtle X. Additional Information and Helpful Tips The default turtle's name is "Bob". You can change the default line width in the "Preferences" section of XLogo The maximum number of turtles, by default, is 99, but this can be changed in the Preferences.