From a14b0defe8aec0eb8e80827e5c9cc76ebe742fd3 Mon Sep 17 00:00:00 2001 From: László Németh Date: Tue, 16 Jul 2013 18:29:55 +0200 Subject: update librelogo help (SVG image saving, small fixes) Change-Id: I8c91a77251034e7837a47d64d178c5063d03b759 --- source/text/swriter/librelogo/LibreLogo.xhp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'source/text/swriter/librelogo/LibreLogo.xhp') diff --git a/source/text/swriter/librelogo/LibreLogo.xhp b/source/text/swriter/librelogo/LibreLogo.xhp index f8ab88e8c9..ea92171855 100644 --- a/source/text/swriter/librelogo/LibreLogo.xhp +++ b/source/text/swriter/librelogo/LibreLogo.xhp @@ -25,13 +25,13 @@ LibreLogo -LibreLogo is a simple, native, 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. +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. LibreLogo toolbar The LibreLogo toolbar (View » Toolbars » Logo) contains turtle moving, program run and stop, home and clear screen and 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. Program run and start -Click on the icon “run” to execute the text of the Writer document as a LibreLogo program. +Click on the icon “run” to execute the text (or only the selected) text of the Writer document as a LibreLogo program. 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. @@ -47,7 +47,7 @@ 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 the zoom/font size for a comfortable two page layout for LibreLogo programming: left (first) page is the canvas, right (second) page is for the LibreLogo programs. LibreLogo programming language -LibreLogo is a native, easily localisable, Logo-like programming language. It is back-compatible with the older Logo systems in the case of the simple Logo programs used in education, eg. +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
Differences from the Logo programming language @@ -79,7 +79,7 @@ String notation supports also orthographical and Python syntax. - PRINT "word" ; original Logo syntax
PRINT “Arbitrary text.” ; orthography, Writer
PRINT 'Arbitrary text.' ; Python syntax
+ PRINT "word ; original Logo syntax
PRINT “Arbitrary text.” ; orthography, Writer
PRINT 'Arbitrary text.' ; Python syntax
Python list and string handling @@ -133,7 +133,7 @@ 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) - HEADING 0 ; turn north
HEADING 12h ; see above
HEADING ANY ; turn to a random position
+ 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)
@@ -194,6 +194,9 @@ starting new line shapes; + + file saving; + keeping the consistency of positions and line shapes at the left border. @@ -204,6 +207,8 @@ TO tree location
PENUP POSITION location HEADING 0 PENDOWN
PICTURE [ FORWARD 100 CIRCLE 100 ] ; tree-like grouped shape
END

PICTURE [ tree [30, 50] tree [100, 50] ] ; grouped shapes in a grouped shape
Starting new line shapes PICTURE ; start a new line shape
FORWARD 10 PICTURE FORWARD 10 ; two line shapes
+File saving (only SVG) + PICTURE “example.svg” [ CIRCLE 5 ] ; save the picture as an SVG image file in the user folder
PICTURE “Desktop/example.svg” [ FORWARD 100 CIRCLE 5 ] ; as above, with a relative path
PICTURE “/home/user/example.svg” [ CIRCLE 5 ] ; absolute path for Unix/Linux
PICTURE “C:\example.svg” [ CIRCLE 5 ] ; absolute path for Windows
Consistency at the left border Use picture to keep the consistency of positions and line shapes at the left border of Writer: PICTURE [ CIRCLE 20 POSITION [-100, 100] CIRCLE 20 ]
@@ -226,13 +231,13 @@ REPEAT [ ; endless loop
POSITION ANY
IF REPCOUNT = 100 [ BREAK ] ; equivalent of the REPEAT 100 [ ... ]
]
CONTINUE Jump into the next iteration of the loop. - REPEAT 100 [
POSITION ANY
IF REPCOUNT % 2 <> 0 [ CONTINUE ]
CIRCLE 10 ; draw circles on every 2nd positions
]
+ REPEAT 100 [
POSITION ANY
IF REPCOUNT % 2 = 0 [ CONTINUE ]
CIRCLE 10 ; draw circles on every 2nd positions
]
Conditions IF ; IF condition [ true block ]
; IF condition [ true block ] [ false block ]

IF a < 10 [ PRINT “Small” ]
IF a < 10 [ PRINT “Small” ] [ PRINT “Big” ]
AND, OR, NOT Logical operators. - IF a < 10 AND NOT a < 5 [ PRINT “5, 6, 7, 8 or 9” ]
+ IF a < 10 AND NOT a = 5 [ PRINT “0, 1, 2, 3, 4, 6, 7, 8 or 9” ]
IF a < 10 AND a != 5 [ PRINT “0, 1, 2, 3, 4, 6, 7, 8 or 9” ] ; as above
Subroutines TO, END New word (or procedure). -- cgit v1.2.3