LibreLogo Toolbar From LibreOffice Help EN AST BG BN BN-IN CA CS DA DE EL ES EU FI FR HU IT JA KM KO NB NL OM PL PT PT-BR RU SL SV TR VI ZH-CN ZH-TW 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. Contents 1 LibreLogo toolbar 2 Turtle moving icons 3 Start Logo program 4 Home 5 Clear screen 6 Program editor/Syntax highlighting/Translating 7 Command line 8 Graphical user interface of basic turtle settings 9 Program editing 10 LibreLogo programming language 10.1 Differences from the Logo programming language 10.2 Other features of LibreLogo 11 LibreLogo commands 11.1 Basic syntax 11.1.1 Case sensitivity 11.1.2 Program lines 11.1.3 Comments 11.1.4 Break program lines to multiple paragraphs 11.2 Turtle moving 11.2.1 FORWARD (fd) 11.2.2 BACK (bk) 11.2.3 LEFT (lt) 11.2.4 RIGHT (rt) 11.2.5 PENUP (pu) 11.2.6 PENDOWN (pd) 11.2.7 POSITION (pos) LibreLogo Toolbar - LibreOffice Help https://help.libreoffice.org/index.php?title=Writer/LibreL... 1 of 24 13/06/2016 18:24
24
Embed
LibreLogo Toolbar - Iamarfiamarf.ch/labfp/librelogo-manual-en.pdf · LibreLogo Toolbar From LibreOffice Help EN AST BG BN BN-IN CA CS DA DE EL ES EU FI FR HU IT JA KM KO NB NL OM
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
LibreLogo Toolbar
From LibreOffice Help
EN AST BG BN BN-IN CA CS DA DE EL ES EU FI FR
HU IT JA KM KO NB NL OM PL PT PT-BR RU SL SV
TR VI ZH-CN ZH-TW
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.
Contents
1 LibreLogo toolbar
2 Turtle moving icons
3 Start Logo program
4 Home
5 Clear screen
6 Program editor/Syntax highlighting/Translating
7 Command line
8 Graphical user interface of basic turtle settings
9 Program editing
10 LibreLogo programming language
10.1 Differences from the Logo programming language
10.2 Other features of LibreLogo
11 LibreLogo commands
11.1 Basic syntax
11.1.1 Case sensitivity
11.1.2 Program lines
11.1.3 Comments
11.1.4 Break program lines to multiple paragraphs
11.2 Turtle moving
11.2.1 FORWARD (fd)
11.2.2 BACK (bk)
11.2.3 LEFT (lt)
11.2.4 RIGHT (rt)
11.2.5 PENUP (pu)
11.2.6 PENDOWN (pd)
11.2.7 POSITION (pos)
LibreLogo Toolbar - LibreOffice Help https://help.libreoffice.org/index.php?title=Writer/LibreL...
1 of 24 13/06/2016 18:24
11.2.8 HEADING (seth)
11.3 Other turtle commands
11.3.1 HIDETURTLE (ht)
11.3.2 SHOWTURTLE (st)
11.3.3 HOME
11.3.4 CLEARSCREEN (cs)
11.3.5 FILL and CLOSE
11.4 Pen settings
11.4.1 PENSIZE (ps)
11.4.2 PENCOLOR/PENCOLOUR (pc)
11.4.3 PENTRANSPARENCY
11.4.4 PENCAP/LINECAP
11.4.5 PENJOINT/LINEJOINT
11.4.6 PENSTYLE
11.5 Fill settings
11.5.1 FILLCOLOR/FILLCOLOUR (fc)
11.5.2 FILLTRANSPARENCY
11.5.3 FILLSTYLE
11.6 Drawing objects
11.6.1 CIRCLE
11.6.2 ELLIPSE
11.6.3 SQUARE
11.6.4 RECTANGLE
11.6.5 POINT
11.6.6 LABEL
11.6.7 TEXT
11.7 Font settings
11.7.1 FONTCOLOR/FONTCOLOUR
11.7.2 FONTFAMILY
11.7.3 FONTSIZE
11.7.4 FONTWEIGHT
11.7.5 FONTSTYLE
11.8 PICTURE (pic)
11.8.1 Shape grouping
11.8.2 Starting new line shapes
11.8.3 Saving SVG images
11.8.4 Saving SVG/SMIL animations (drawings with SLEEP
commands)
11.8.5 Consistency at the left border
11.9 Loops
11.9.1 REPEAT
11.9.2 REPCOUNT
11.9.3 FOR IN
LibreLogo Toolbar - LibreOffice Help https://help.libreoffice.org/index.php?title=Writer/LibreL...
2 of 24 13/06/2016 18:24
11.9.4 WHILE
11.9.5 BREAK
11.9.6 CONTINUE
11.10 Conditions
11.10.1 IF
11.10.2 AND, OR, NOT
11.11 Subroutines
11.11.1 TO, END
11.11.2 OUTPUT
11.11.3 STOP
11.12 Default variables
11.12.1 ANY
11.12.2 TRUE
11.12.3 FALSE
11.12.4 PAGESIZE
11.12.5 PI/π11.13 Input/Output
11.13.1 PRINT
11.13.2 INPUT
11.14 SLEEP
11.15 GLOBAL
11.16 Functions
11.16.1 RANDOM
11.16.2 INT
11.16.3 FLOAT
11.16.4 STR
11.16.5 SQRT
11.16.6 SIN
11.16.7 COS
11.16.8 LOG10
11.16.9 ROUND
11.16.10 ABS
11.16.11 COUNT
11.16.12 SET
11.16.13 RANGE
11.16.14 LIST
11.16.15 TUPLE
11.16.16 SORTED
11.16.17 SUB
11.16.18 SEARCH
11.16.19 FINDALL
11.16.20 MIN
11.16.21 MAX
LibreLogo Toolbar - LibreOffice Help https://help.libreoffice.org/index.php?title=Writer/LibreL...
3 of 24 13/06/2016 18:24
11.17 Color constants
LibreLogo toolbar
The LibreLogo toolbar (View » Toolbars » Logo) contains turtle moving, program
start, stop, home, clear screen, program editor/syntax highlighting/translating icons
and an input bar (command line).
Turtle moving icons
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.
Start Logo program
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.
Home
Click on the icon “Home” to reset the position and settings of the turtle.
Clear screen
Click on the icon “Clear screen” to remove the drawing objects of the document.
Program editor/Syntax highlighting/Translating
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 (Tools » Options » Language
Settings » Languages » Western) and click on this icon to translate the Logo program
to the selected language.
Command line
LibreLogo Toolbar - LibreOffice Help https://help.libreoffice.org/index.php?title=Writer/LibreL...
4 of 24 13/06/2016 18:24
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 click triple in it or press Ctrl-A to select the previous
commands, and type the new commands.
Graphical user interface of basic turtle settings
Turtle shape of LibreLogo is a normal fixed size drawing object. You can positionate
and rotate it on standard way, too, using the mouse and the Rotate icon of the
Drawing Object Properties toolbar. Modify Line Width, Line Color and Area Color
settings of the turtle shape to set PENSIZE, PENCOLOR and FILLCOLOR attributes
of LibreLogo.
Program editing
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 programming language
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
LibreLogo Toolbar - LibreOffice Help https://help.libreoffice.org/index.php?title=Writer/LibreL...
5 of 24 13/06/2016 18:24
Differences from the Logo programming language
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).
Other features of LibreLogo
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”)
LibreLogo Toolbar - LibreOffice Help https://help.libreoffice.org/index.php?title=Writer/LibreL...
6 of 24 13/06/2016 18:24
star(100, “blue”)
LibreLogo commands
Basic syntax
Case sensitivity
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
Program lines
Lines of a LibreLogo program are paragraphs in the LibreOffice Writer document. A
program line can contain multiple commands:
PRINT “Hello, World!” PRINT “LibreLogo”
Comments
Lines or line parts are comments from a semicolon to the end of the line
(paragraph):
; some comments
PRINT 5 * 5 ; some comments
Break program lines to multiple paragraphs
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”
LibreLogo Toolbar - LibreOffice Help https://help.libreoffice.org/index.php?title=Writer/LibreL...
7 of 24 13/06/2016 18:24
Turtle moving
FORWARD (fd)
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 (bk)
BACK 10 ; move back 10pt
LEFT (lt)
LEFT 90 ; turn counterclockwise 90 degrees
LEFT 90° ; see above
LT 3h ; see above (clock position)
LT any ; turn to a random position
RIGHT (rt)
RIGHT 90 ; turn clockwise 90 degrees
PENUP (pu)
PENUP ; turtle will move without drawing
PENDOWN (pd)
PENDOWN ; turtle will move with drawing
POSITION (pos)
POSITION [0, 0] ; turn and move to the top-left corner
POSITION PAGESIZE ; turn and move to the bottom-right corner
POSITION [PAGESIZE[0], 0] ; turn and move to the top-right corner
POSITION ANY ; turn and move to a random position
HEADING (seth)
LibreLogo Toolbar - LibreOffice Help https://help.libreoffice.org/index.php?title=Writer/LibreL...
8 of 24 13/06/2016 18:24
HEADING 0 ; turn north
HEADING 12h ; see above
HEADING [0, 0] ; turn to the top-left corner
HEADING ANY ; turn to a random direction
Other turtle commands
HIDETURTLE (ht)
HIDETURTLE ; hide turtle (until the showturtle command)
SHOWTURTLE (st)
SHOWTURTLE ; show turtle
HOME
HOME ; reset initial turtle settings and position
CLEARSCREEN (cs)
CLEARSCREEN ; remove drawing objects of the document
FILL and CLOSE
FILL ; close and fill the actual line shape or points
CLOSE ; close the actual line shape or join the actual points
Example: filling a regular triangle:
FORWARD 50 LEFT 120 FORWARD 50 FILL
Example: drawing a regular triangle:
FORWARD 50 LEFT 120 FORWARD 50 CLOSE
Pen settings
PENSIZE (ps)
PENSIZE 100 ; line width is 100 points
PENSIZE ANY ; equivalent of PENSIZE RANDOM 10
LibreLogo Toolbar - LibreOffice Help https://help.libreoffice.org/index.php?title=Writer/LibreL...
9 of 24 13/06/2016 18:24
PENCOLOR/PENCOLOUR (pc)
PENCOLOR “red” ; set red pen color (by color name, see color constants)
PENCOLOR [255, 255, 0] ; set yellow color (RGB list)
PENCOLOR 0xffff00 ; set yellow color (hexa code)
PENCOLOR 0 ; set black color (0x000000)
PENCOLOR ANY ; random color
PENCOLOR [5] ; set red color (by color identifier, see color constants)
PENCOLOR “invisible” ; invisible pen color for shapes without visible outline
PENCOLOR “~red” ; set random red color
PENTRANSPARENCY
PENTRANSPARENCY 80 ; set the transparency of the actual pen color to 80%
PENCAP/LINECAP
PENCAP “none” ; without extra line end (default)
PENCAP “round” ; rounded line end
PENCAP “square” ; square line end
PENJOINT/LINEJOINT
PENJOINT “rounded” ; rounded line joint (default)
PENJOINT “miter” ; sharp line joint
PENJOINT “bevel” ; bevel line joint
PENJOINT “none” ; without line joint
PENSTYLE
PENSTYLE “solid” ; solid line (default)
PENSTYLE “dotted” ; dotted line
PENSTYLE “dashed” ; dashed line
; custom dot–dash pattern specified by a list with the following arguments:
; – number of the neighbouring dots
; – length of a dot
; – number of the neighbouring dashes
; – length of a dash
; – distance of the dots/dashes
; – type (optional):
; 0 = dots are rectangles (default)
LibreLogo Toolbar - LibreOffice Help https://help.libreoffice.org/index.php?title=Writer/LibreL...
10 of 24 13/06/2016 18:24
; 2 = dots are squares (lengths and distances are relative to the pensize)