text
stringlengths 0
99.6k
|
|---|
DRAW
|
Sets up the graphics screen, with the turtle in the center of the screen, pointing straight up. Defaults to SCOLOR and SPLITSCREEN , but these may be changed. It is extremely important that this word (or SCOLOR or DCOLOR) be used at least once before typing any of the other graphics words!
|
FD or FORWARD
|
Takes a number on the stack and moves the turtle forward that distance. Draws a line if the turtles pen is down. Example:
|
20 FD ( move the turtle 20 turtle steps forward)
|
BK or BACK
|
Takes a number on the stack and moves the turtle back that distance. Draws a line if the pen is down. Example:
|
20 BK ( move the turtle 20 turtle steps back)
|
RT or RIGHT
|
Takes a number on the stack, and rotates the turtle right that number of degrees. Example:
|
90 RIGHT ( rotate the turtle 90 degrees to the right)
|
LT or LEFT
|
Takes a number on the stack, and rotates the turtle left that number of degrees. Example:
|
90 LT ( rotate the turtle 90 degrees to the left)
|
*fp0
|
SP or SPLITSCREEN
|
Enters SPLITSCREEN mode, with 5 lines of text on the bottom of the screen, and the rest of the screen in graphics mode. This is the default condition. Due to the location of the hires screen, a small amount of flicker may be observed, particularly when the turtle is in the region of the split. This is a hardware limitation over which I have no control. Sorry.
|
FS or FULLSCREEN
|
Exits SPLITSCREEN mode. The entire graphics screen is displayed. Note that if you want to mix music and graphics, you must be in FULLSCREEN mode. This is because both splitscreen mode and the music words are interrupt driven.
|
NOSPLIT
|
This will cause DRAW to default to FULLSCREEN mode. Executing SPLITSCREEN will restore SPLITSCREEN as the default condition.
|
BG or BACKGROUND
|
Takes a number on the stack, and sets the background color of the hires screen to that color. When in splitscreen mode, the border color will also be affected by this command. The number should be between 0 and 15, as described in the programmers reference guide. Example:
|
1 BG ( sets background to white)
|
PC or PENCOLOR
|
Takes a number on the stack, and sets the pencolor of the turtle to that color. Note that a pencolor of -1 is allowed, and will cause the turtle to erase, instead of draw. Example:
|
2 PC ( draw in red)
|
PE or PENERASE
|
Causes the turtle to erase instead of draw as it moves. Note that the pen must be down in order to erase. (Or the eraser must be down, in this case.)
|
PU or PENUP
|
Lifts the turtles pen. The turtle may be moved without drawing or eraseing a line.
|
PD or PENDOWN
|
Sets the turtles pen down. The turtle will once again draw a line as it moves.
|
HT or HIDETURTLE
|
Makes the turtle invisible. Note that a pleasant side effect of this is that drawing will become even faster.
|
ST or SHOWTURTLE
|
Makes the turtle visible.
|
SCOLOR
|
Enters single color or HIRES mode. In this mode, all colors are available, but drawing over lines drawn in one color with a line in another color will change a small portion of the previous line to the new color. Lines have a finer, sharper appearance in this mode. Note that executing either SCOLOR or DCOLOR will have the same effect as DRAW - the screen will be cleared, and the turtle moved to its home position.
|
DCOLOR
|
Enters double color mode. In this mode, up to three lines of different colors may share the same area without conflict. Lines are thicker, but the colors are easier to see. Note that when in DCOLOR mode, scrolling of the text screen underneath the draw screen may affect certain of the colors. Since splitscreen mode is usually used only when debugging, this should not be a serious problem. (It's due to the sharing of color memory between the text screen and the hires screen.) Once DCOLOR has been selected, draw will default to this mode until SCOLOR is once again executed.
|
HOME
|
Sends the turtle to its home - center screen, pointing straight up. Note that the turtle will draw a line if the pen is down. (see: WINDOW)
|
SETXY
|
Takes two values from the stack - the X and Y coordinates of a point, and moves the turtle to that location, drawing a line if the pen is down. Example:
|
100 100 SETXY ( move the turtle to 100 100 )
|
SETH or SETHEADING
|
Takes a number on the stack which sets the current heading of the turtle. 0 degrees is pointing straight up, with degrees increasing to the right. Example:
|
90 SETH ( aim turtle at the right of the screen)
|
G$
|
Takes the address of a text string, and two coordinates. G$ then types the textstring on the graphics screen. The characters are not drawn by the turtle, and so the turtles position and heading are not affected. The only commands which affect both the turtle and G$ are PC ( except -1 PC , which has no effect on G$) and WINDOW. Characters drawn in DCOLOR mode are not very legible, incidentally. Example:
|
" THIS IS A STRING" 100 100 G$ ( type string starting at 100 100)
|
WINDOW ( x1 y1 x2 y2 -- )
|
Sets up a drawing window for the turtle. Takes four entries from the stack. x1 and y1 are the coordinates of the lower left corner of the drawing window, while x2 and y2 are the coordinates of the upper right hand corner of the drawing window. Executing this command will cause the turtle to center itself inside the window, and, although the turtle can move outside of the window, lines will be drawn only within the window boundary. Note that G$ is also affected by this command. HOME will center the turtle at its new home, but DRAW will reset the window to its maximum. Note that an error occurs if the coordinates passed to WINDOW are outside of the current window. An example of windowing is provided on the source disk. Make sure the disk is mounted, and then type 130 LOAD .
|
RESWIND
|
Calling this word will reset the turtle window to its default condition. This word must be used if you intend to set up multiple windows, since the new window will likely be outside of the old one, and therefore cause an error. Example:
|
: WINDOW1 RESWIND 0 0 50 50 WINDOW ;
|
: WINDOW2 RESWIND 100 100 150 150 WINDOW ;
|
The following are variables which may be accessed to determine the state of the turtle.
|
XCOR YCOR These are system variables which contain the current X coordinate andd Y coordinate of the turtle. Note that these variables should only be used to determine the coordinates of the turtle. Storing values in these variables will have strange effects. If you want to change the turtles position, you should use SETXY . Example:
|
XCOR @ YCOR @ . . ( display the current xy coordinates of the turtle.)
|
HEADING This contains the current heading of the turtle, in degrees. 0 is straight up, increasing to the right. The same caution applies as for XCOR YCOR . If you want to change the turtles heading, use SETH or SETHEADING. Example:
|
HEADING @ . ( print the turtles heading on the screen)
|
PENSTATE True if pen is down.
|
TURTLESTATE True if turtle is visible.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.