|
How to Print Turtle Graphics
and Turtle Commands
First, create a textbox on the graphics
screen, called text1, which will hold the turtle commands.
I've given this a slightly grey background colour to make
it easier to see on the page.
We will use the command printToTextBox,
which will redirect the printed text into the text box
printToTextBox "text1
Now create a small procedure called copylines
to copylines
make "line rl
print :line
run :line
copylines
end
Run this procedure, and it will allow
you to type any commands, which will be printed into the
text box and then run as normal. You can then print the
graphic screen from the file menu and you will get a printout
of the turtle graphics screen and the commands you have
typed side by side, just as it appears on the screen.
For best results, you will want to move
the turtle over to the left so it doesn't interfere with
the textbox. To do this we create a short setup procedure,
something like
to begin
printToTextBox "text1
ask "t1 [pu setxcor -200 pd]
copylines
end
You should end up with something like
this...

Click
here to download an example project (IMP) of how this works.
|