Logo is an educational programming language developed in the late 60's. The idea of the developers was to provide a simple tool to "program" drawings. The goal of the project is to develop an execution environment for the Logo in Java. A detailed description of the language and its history is available on Logo's Wikipedia page. A brief description follows.
The Logo language
A Logo program aims to design a set of segments (straight or curved) within a drawing area. Running a program makes a cursor move (historically represented as a turtle or a triangle), generating an underlying drawing.
The area where the design produced by the program is made consists of a portion of the top having finished dimensions (base, height). The coordinate (0,0) indicates the lower left point of the plane. The central position of the drawing area, ie those of coordinates (base / 2, height / 2), is called home. The area is also characterized by a background color. The initial color is white.
The cursor is characterized by the following attributes:
● Position: cursor position
● Direction: indicates the angle towards which the cursor is pointing. The angle is represented
with an integer in the interval [0.360] where 0 indicates the horizontal direction towards
right (3 o'clock, if we consider a clock).
● Line Color: indicates the color of the line produced by the cursor as a result of
● Area Color: indicates the color of the area that is colored when a series of
segments produce an enclosed area.
● Plot: it is a Boolean parameter that indicates whether during a move the
cursor generates a path or not.
By default, the cursor is positioned in the home page, it has a direction of 0 degrees, the color of the line is black, while the color of the area is white (as the default background color).
The movement of the cursor is defined by means of a program which consists of a list of instructions of the following form:
● FORWARD <dist>: moves the cursor forward towards its direction (if the area limits are reached, the cursor stops at the edge);
● BACKWARD <dist>: moves the cursor backwards with respect to its direction (if the limits of the area are reached, the cursor stops at the edge);
● LEFT <angle>: rotates the cursor counterclockwise by the degrees described by the parameter (the angles are indicated as integers in the range [0, 360]);
● RIGHT <angle>: rotates the cursor clockwise by the degrees described by the parameter (the angles are indicated as integers in the range [0, 360]);
● CLEARSCREEN: clears what is drawn;
● HOME: moves the cursor in the home position;
● PENUP: detach the sheet from the sheet;
● PENDOWN: attach the pen to the sheet;
● SETPENCOLOR <byte> <byte> <byte>: sets the pen color to color
represented by the RGB color represented by the three data bytes (<byte> indicates a value
integer in the range [0.255]);
● SETFILLCOLOR <byte> <byte> <byte>: sets the color of the fill of
a closed area;
● SETSCREENCOLOR <byte> <byte> <byte>: sets the background color
of the drawing area;
● SETPENSIZE <size>: indicates the size of the pen stroke, <size> is an integer
of magnitude greater than or equal to 1;
● REPEAT <num> [<cmds>]: repeats the sequence of commands in the list
During the movement of the cursor, as indicated by the program, the cursor generates a sequence of lines. When the lines close, a closed area is identified, this consists of a sequence of lines that start and end at the same point. Once a closed area has been identified, the lines can no longer be part of a second closed area.