Logo is a programming language in a graphic environment. The basis of
the application is a "Function". Its an instruction given to a
"turtle", which is the triangle you see in the middle of the screen.
When it moves, the "turtle" leaves behind a black or colored mark.
The environment consists of a Screen and a Console. The
turtle is on the screen, and the instructions are typed in the
console.
There are about pre-defined fifty functions, described at the end of
this section of the users guide. Within the application, there are
two ways to see the list of the functions. The first one is by the
on-line help menu, which is below the apple in the menu bar or can be
brought forward by hitting simultaneously the command key and the "h"
key on the keyboard. The other way is to leave the Logo module : you
can then access the "Preferences..." from the "File" menu in the menu
bar, and then the Logo preferences, by clicking on the appropriate
icon.
You can change the name of a function, but it will still execute the
same instructions. To change the name of a function, go to the
"Preferences..." in the "File" menu. Click on the Logo icon, and
double click on the appropriate function : the window showing up lets
you change the name. This is useful if you want shorter names or
names easier to remember. Clicking on "Default" brings back the
original name.
For most functions, you will have to specify a number within
parenthesis, called parameter. For example,
forward(10); will bring the "turtle" to move ahead a distance
of 10 pixels. The pen draws the mark on the screen. The semi-colon is
mandatory. For other functions, the parenthesis are necessary
but contain no number : for example, hide turtle();.
Only simple instructions, containing one function, can be written in
the console. You can write only one full line of instructions at a
time, every one ending with a semi-colon. You must then execute these
instructions by hitting the return key on the keyboard.
More complex instructions, containing many functions or control
instructions (see below) must be written in the New
function window ( to get there, select "New Function..." from the
"Program" menu ).
The screen can be seen as a Cartesian grid, with displacements in the
xy plane, and with angles in degrees :
The zero positions of the x and y axis are at the top left-hand
corner.
When you're in the console, you can use the following shortcuts. With
the up and down arrows on the keyboard, the previous or following
instructions can be rewritten. For example, if, after having typed in
three instructions, you hit the "up" arrow three times, the first
instruction will be re-written. To execute it again, just hit the
return key.
Also, if you type in the first letters of a function, hitting the
tabulator key ( or the left or right arrows ) on the keyboard will
often complete the name automatically.
The console is used to execute functions. To create more elaborate
functions, you must select "New function..." from the "Program" menu.
The following window shows up:
In this window, you can type in the most elaborate functions.
These new functions can be called from the console and executed there
by typing their name and proper parameters. To create a function,
first give it a name by typing in the proper box. Then, if your
function contains parameters, give them a name and default values.
Parameters are variables, a term that is defined later in this
guide.
Then, type in your function in the large area bellow. To get there,
just click in it.
To modify a function already created, go to the "Program" menu and
select "Function editor...". You can then modify the function on
which you double-click. A window similar to the "New function..."
window shows up. Make the changes you want by typing them in the
appropriate places. Be careful : modifying parameters has
consequences every time you call upon this modified function. To
erase a function, open the window "Function editor...", select the
function you wish to erase and press delete from the keyboard.
The "Color picker" selected from the "Program" menu gives a number(
RGB-red, green, blue) corresponding to the color chosen. This number
is to be used with the functions pen color(color); and
background color(color);.
********************
You can find the menu commands in the menu bar at the top of your
screen when you're in the Logo module.
Open: to get drawn shapes, saved from previous work; you must be in one of the section windows or in the main window to be able to do so;
Save: to create a document containing the work done;
Print: to print on paper what shows up on the Logo screen.
Cancel : not available in version 1.1;
Repeat : not available in version 1.1;
Cut : to remove the selected text;
Copy : to put the drawing on the screen ( or the number in the color picker or the function in the new function/function editor window ) into the clipboard;
Paste : to put the text in the clipboard in the new function or function editor window;
Erase : to remove the selected text;
Select all : to select all the text in the new
function/function editor window.
New function : to create new functions;
Export functions : to export functions from one copy of the application to another on another computer by creating a document containing the functions;
Import functions: to import functions created in Logo from Learn and Play with another computer;
Function Editor : to modify functions you have created;
Color picker : to find the RGB number corresponding
to a color.
"Program" menu: To bring to the foreground or to open a selected window in Logo.