LibreOffice 26.2 Help
LibreLogo is a simple, localized, Logo-like programming environment with turtle vector graphics for teaching of computing (programming and word processing), DTP and graphic design. See http://www.numbertext.org/logo/librelogo.pdf.
The LibreLogo toolbar () contains turtle moving, program start, stop, home, clear screen, program editor/syntax highlighting/translating icons and an input bar (command line).
They are equivalents of the Logo commands “FORWARD 10”, “BACK 10”, “LEFT 15”, “RIGHT 15”. Clicking on one of the icons will also focus the turtle shape scrolling the page to its position.
Click on the icon “Start Logo program” to execute the text (or only the selected) text of the Writer document as a LibreLogo program. In an empty document an example program will be inserted and executed.
Click on the icon “Stop” to stop the program execution.
Click on the icon “Home” to reset the position and settings of the turtle.
Click on the icon “Clear screen” to remove the drawing objects of the document.
The “magic wand” icon sets 2-page layout for program editing, expands and converts to uppercase the abbreviated, lowercase Logo commands in the Writer document. Change the language of the document () and click on this icon to translate the Logo program to the selected language.
Hit Enter in the command line to execute its content. To stop the program use the icon “Stop”.
Hold down the Enter to repeat the command line, for example, on the following command sequence:
FORWARD 200 LEFT 89
To reset the command line triple-click it or press CommandCtrl+A to select the previous commands, and type the new commands.
Turtle shape of LibreLogo is a normal fixed size drawing object. You can position and rotate it on standard way, too, using the mouse and the Rotate icon of the Drawing Object Properties toolbar. Modify Line Thickness, Line Color and Area Color settings of the turtle shape to set PENSIZE, PENCOLOR and FILLCOLOR attributes of LibreLogo.
LibreLogo drawings and programs use the same Writer document. The LibreLogo canvas is on the first page of the Writer document. You can insert a page break before the LibreLogo programs and set page zoom using the “magic wand” icon of the Logo toolbar, also change the font size for a comfortable 2-page layout for LibreLogo programming: left (first) page is the canvas, right (second) page is the LibreLogo program editor.
LibreLogo is an easily localizable, Logo-like programming language, localized in several languages by LibreOffice native language communities. It is back-compatible with the older Logo systems in the case of the simple Logo programs used in education, eg.
TO triangle :size
REPEAT 3 [
FORWARD :size
LEFT 120
]
END
triangle 10 triangle 100 triangle 200
List members are comma separated: POSITION [0, 0]
Program blocks and lists are different
Program blocks need space or new line at parenthesization: REPEAT 10 [ FORWARD 10 LEFT 36 ]
Lists need close parenthesization: POSITION [0, 0], and not POSITION [ 0, 0 ]
1-line function declarations are not supported (TO and END need new lines).
The colon is optional before the variable names.
TO triangle size
REPEAT 3 [ FORWARD size LEFT 120 ]
END
String notation supports also orthographical and Python syntax.
PRINT "word ; original Logo syntax
PRINT “Arbitrary text.” ; orthography, Writer
PRINT 'Arbitrary text.' ; Python syntax
Python list and string handling
PRINT “text”[2] ; print “x”
PRINT “text”[1:3] ; print “ex”
Python-like FOR loop
Python-like variable declaration:
x = 15
PRINT x
There are no extra query functions:
PRINT FILLCOLOR
p = POSITION
PRINT p
REPEAT 10 [ POSITION ANY POSITION p ]
Alternative parenthesization in function calls
TO star size color
FILLCOLOR color
REPEAT 5 [ LEFT 72 FORWARD size RIGHT 144 FORWARD size ]
FILL
END
star 100 “red”
star(100, “green”)
star(100, “blue”)
Commands, color constants are case insensitive:
PRINT “Hello, World!”
print “Hello, World, again!”
Variable names are case sensitive:
a = 5
A = 7
PRINT a
PRINT A
Lines of a LibreLogo program are paragraphs in the Writer document. A program line can contain multiple commands:
PRINT “Hello, World!” PRINT “LibreLogo”
Lines or line parts are comments from a semicolon to the end of the line (paragraph):
; some comments
PRINT 5 * 5 ; some comments
It’s possible to break a program line for more paragraphs using the character tilde at the end of the line:
PRINT “This is a very long ” + ~
“warning message”
FORWARD 10 ; move forward 10pt (1pt = 1/72 inch)
FORWARD 10pt ; see above
FORWARD 0.5in ; move forward 0.5 inch (1 inch = 2.54 cm)
FORWARD 1" ; see above
FD 1mm
FD 1cm
BACK 10 ; move back 10pt
LEFT 90 ; turn counterclockwise 90 degrees
LEFT 90° ; see above
LT 3h ; see above (clock position)
LT any ; turn to a random position
RIGHT 90 ; tu