1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
|
<?xml version="1.0" encoding="UTF-8"?>
<helpdocument version="1.0">
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
-->
<meta>
<topic id="LibreLogo" indexer="include" status="PUBLISH">
<title id="title" xml-lang="en-US">LibreLogo Toolbar</title>
<filename>/text/swriter/librelogo/LibreLogo.xhp</filename>
</topic>
</meta>
<body>
<bookmark xml-lang="en-US" branch="index" id="bm1">
<bookmark_value>LibreLogo</bookmark_value>
<bookmark_value>Logo</bookmark_value>
<bookmark_value>Turtle graphics</bookmark_value>
</bookmark>
<bookmark xml-lang="en-US" branch="hid/.HelpId:addon_LibreLogo.OfficeToolBar" id="bm2" localize="false"/>
<paragraph role="heading" level="1" xml-lang="en-US" id="hd_170">LibreLogo</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_180">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 <link href="http://www.numbertext.org/logo/librelogo.pdf">http://www.numbertext.org/logo/librelogo.pdf</link>.</paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_220">LibreLogo toolbar</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_230">The LibreLogo toolbar (<item type="menuitem">View - Toolbars - Logo</item>) contains turtle moving, program start, stop, home, clear screen, program editor/syntax highlighting/translating icons and an input bar (command line).</paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_240">Turtle moving icons</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_250">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.</paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_280">Start Logo program</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_290">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.</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_300">Click on the icon “Stop” to stop the program execution.</paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_310">Home</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_320">Click on the icon “Home” to reset the position and settings of the turtle.</paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_330">Clear screen</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_340">Click on the icon “Clear screen” to remove the drawing objects of the document.</paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_344">Program editor/Syntax highlighting/Translating</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_345">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 (<switchinline select="sys"><caseinline select="MAC"><menuitem>%PRODUCTNAME - Preferences</menuitem></caseinline><defaultinline><menuitem>Tools - Options</menuitem></defaultinline></switchinline><menuitem> - Language Settings - Languages - Western</menuitem>) and click on this icon to translate the Logo program to the selected language.</paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_350">Command line</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_360">Hit Enter in the command line to execute its content. To stop the program use the icon “Stop”.</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_370">Hold down the Enter to repeat the command line, for example, on the following command sequence:</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_380"> FORWARD 200 LEFT 89<br/></paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_390">To reset the command line triple-click it or press <switchinline select="sys"><caseinline select="MAC"><keycode>Command</keycode></caseinline><defaultinline><keycode>Ctrl</keycode></defaultinline></switchinline><keycode>+A</keycode> to select the previous commands, and type the new commands.</paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_413">Graphical user interface of basic turtle settings</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_415">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 Width, Line Color and Area Color settings of the turtle shape to set PENSIZE, PENCOLOR and FILLCOLOR attributes of LibreLogo.</paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_420">Program editing</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_430">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.</paragraph>
<paragraph role="heading" level="1" xml-lang="en-US" id="hd_440">LibreLogo programming language</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_450">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.</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_460"> TO triangle :size<br/> REPEAT 3 [<br/> FORWARD :size<br/> LEFT 120<br/> ]<br/> END<br/> <br/> triangle 10 triangle 100 triangle 200<br/></paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_470">Differences from the Logo programming language</paragraph>
<list type="unordered">
<listitem>
<paragraph role="listitem" xml-lang="en-US" id="par_480">List members are comma separated: POSITION [0, 0]</paragraph>
</listitem>
<listitem>
<paragraph role="listitem" xml-lang="en-US" id="par_490">Program blocks and lists are different</paragraph>
</listitem>
<listitem><switch select="sys"><comment>FIXME: Hack to get a nested list</comment><default>
<list type="unordered">
<listitem>
<paragraph role="listitem" xml-lang="en-US" id="par_500">Program blocks need space or new line at parenthesization: REPEAT 10 [ FORWARD 10 LEFT 36 ]</paragraph>
</listitem>
<listitem>
<paragraph role="listitem" xml-lang="en-US" id="par_510">Lists need close parenthesization: POSITION [0, 0], and not POSITION [ 0, 0 ]</paragraph>
</listitem>
</list>
</default></switch></listitem>
<listitem>
<paragraph role="listitem" xml-lang="en-US" id="par_520">1-line function declarations are not supported (TO and END need new lines).</paragraph>
</listitem>
</list>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_530">Other features of LibreLogo</paragraph>
<list type="unordered">
<listitem>
<paragraph role="listitem" xml-lang="en-US" id="par_540">The colon is optional before the variable names.</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_550"> TO triangle size<br/> REPEAT 3 [ FORWARD size LEFT 120 ]<br/> END<br/></paragraph>
</listitem>
<listitem>
<paragraph role="paragraph" xml-lang="en-US" id="par_560">String notation supports also orthographical and Python syntax.</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_570"> PRINT "word ; original Logo syntax<br/> PRINT “Arbitrary text.” ; orthography, Writer<br/> PRINT 'Arbitrary text.' ; Python syntax<br/></paragraph>
</listitem>
<listitem>
<paragraph role="paragraph" xml-lang="en-US" id="par_580">Python list and string handling</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_590"> PRINT “text”[2] ; print “x”<br/> PRINT “text”[1:3] ; print “ex”<br/></paragraph>
</listitem>
<listitem>
<paragraph role="paragraph" xml-lang="en-US" id="par_600">Python-like FOR loop</paragraph>
</listitem>
<listitem>
<paragraph role="paragraph" xml-lang="en-US" id="par_610">Python-like variable declaration:</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_620"> x = 15<br/> PRINT x<br/></paragraph>
</listitem>
<listitem>
<paragraph role="paragraph" xml-lang="en-US" id="par_630">There are no extra query functions:</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_640"> PRINT FILLCOLOR<br/> p = POSITION<br/> PRINT p<br/> REPEAT 10 [ POSITION ANY POSITION p ]<br/></paragraph>
</listitem>
<listitem>
<paragraph role="paragraph" xml-lang="en-US" id="par_650">Alternative parenthesization in function calls</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_660"> TO star size color<br/> FILLCOLOR color<br/> REPEAT 5 [ LEFT 72 FORWARD size RIGHT 144 FORWARD size ]<br/> FILL<br/> END<br/> <br/> star 100 “red”<br/> star (100, “green”)<br/> star(100, “blue”)<br/></paragraph>
</listitem>
</list>
<paragraph role="heading" level="1" xml-lang="en-US" id="hd_670">LibreLogo commands</paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_680">Basic syntax</paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_690">Case sensitivity</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_700">Commands, color constants are case insensitive:</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_710"> PRINT “Hello, World!”<br/> print “Hello, World, again!”<br/></paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_720">Variable names are case sensitive:</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_730"> a = 5<br/> A = 7<br/> PRINT a<br/> PRINT A<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_740">Program lines</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_750">Lines of a LibreLogo program are paragraphs in the Writer document. A program line can contain multiple commands:</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_760"> PRINT “Hello, World!” PRINT “LibreLogo”<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_770">Comments</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_780">Lines or line parts are comments from a semicolon to the end of the line (paragraph):</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_790"> ; some comments<br/> PRINT 5 * 5 ; some comments<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_800">Break program lines to multiple paragraphs</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_810">It’s possible to break a program line for more paragraphs using the character tilde at the end of the line:</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_820"> PRINT “This is a very long ” + ~<br/> “warning message”<br/></paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_830">Turtle moving</paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_840">FORWARD (fd)</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_850"> FORWARD 10 ; move forward 10pt (1pt = 1/72 inch)<br/> FORWARD 10pt ; see above<br/> FORWARD 0.5in ; move forward 0.5 inch (1 inch = 2.54 cm)<br/> FORWARD 1" ; see above<br/> FD 1mm<br/> FD 1cm<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_860">BACK (bk)</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_870"> BACK 10 ; move back 10pt<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_880">LEFT (lt)</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_890"> LEFT 90 ; turn counterclockwise 90 degrees<br/> LEFT 90° ; see above<br/> LT 3h ; see above (clock position)<br/> LT any ; turn to a random position<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_900">RIGHT (rt)</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_910"> RIGHT 90 ; turn clockwise 90 degrees<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_920">PENUP (pu)</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_930"> PENUP ; turtle will move without drawing<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_940">PENDOWN (pd)</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_950"> PENDOWN ; turtle will move with drawing<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_960">POSITION (pos)</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_970"> POSITION [0, 0] ; turn and move to the top-left corner<br/> POSITION PAGESIZE ; turn and move to the bottom-right corner<br/> POSITION [PAGESIZE[0], 0] ; turn and move to the top-right corner<br/> POSITION ANY ; turn and move to a random position<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_980">HEADING (seth)</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_990"> HEADING 0 ; turn north<br/> HEADING 12h ; see above<br/> HEADING [0, 0] ; turn to the top-left corner<br/> HEADING ANY ; turn to a random direction<br/></paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_1000">Other turtle commands</paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1010">HIDETURTLE (ht)</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1020"> HIDETURTLE ; hide turtle (until the showturtle command)<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1030">SHOWTURTLE (st)</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1040"> SHOWTURTLE ; show turtle<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1050">HOME</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1060"> HOME ; reset initial turtle position<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1070">CLEARSCREEN (cs)</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1080"> CLEARSCREEN ; remove drawing objects of the document<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1090">FILL and CLOSE</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1100"> FILL ; close and fill the actual line shape or points<br/> CLOSE ; close the actual line shape or join the actual points<br/></paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_1102">Example: filling a regular triangle:</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1104"> FORWARD 50 LEFT 120 FORWARD 50 FILL<br/></paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_1106">Example: drawing a regular triangle:</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1108"> FORWARD 50 LEFT 120 FORWARD 50 CLOSE<br/></paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_1110">Pen settings</paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1120">PENSIZE (ps)</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1130"> PENSIZE 100 ; line width is 100 points<br/> PENSIZE ANY ; equivalent of PENSIZE RANDOM 10<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1140">PENCOLOR/PENCOLOUR (pc)</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1150"> PENCOLOR “red” ; set red pen color (by color name, see color constants)<br/> PENCOLOR [255, 255, 0] ; set yellow color (RGB list)<br/> PENCOLOR 0xffff00 ; set yellow color (hexa code)<br/> PENCOLOR 0 ; set black color (0x000000)<br/> PENCOLOR ANY ; random color<br/> PENCOLOR [5] ; set red color (by color identifier, see color constants)<br/> PENCOLOR “invisible” ; invisible pen color for shapes without visible outline<br/> PENCOLOR “~red” ; set random red color<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1151">PENTRANSPARENCY</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1152"> PENTRANSPARENCY 80 ; set the transparency of the actual pen color to 80%<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1153">PENCAP/LINECAP</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1155"> PENCAP “none” ; without extra line end (default)<br/> PENCAP “round” ; rounded line end<br/> PENCAP “square” ; square line end<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1160">PENJOINT/LINEJOINT</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1170"> PENJOINT “rounded” ; rounded line joint (default)<br/> PENJOINT “miter” ; sharp line joint<br/> PENJOINT “bevel” ; bevel line joint<br/> PENJOINT “none” ; without line joint<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1180">PENSTYLE</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1190"> PENSTYLE “solid” ; solid line (default)<br/> PENSTYLE “dotted” ; dotted line<br/> PENSTYLE “dashed” ; dashed line<br/> <br/> ; custom dot–dash pattern specified by a list with the following arguments:<br/> ; – number of the neighbouring dots<br/> ; – length of a dot<br/> ; – number of the neighbouring dashes<br/> ; – length of a dash<br/> ; – distance of the dots/dashes<br/> ; – type (optional):<br/> ; 0 = dots are rectangles (default)<br/> ; 2 = dots are squares (lengths and distances are relative to the pensize)<br/> <br/> PENSTYLE [3, 1mm, 2, 4mm, 2mm, 2] ; ...––...––...––<br/></paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_1200">Fill settings</paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1210">FILLCOLOR/FILLCOLOUR (fc)</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1220"> FILLCOLOR “blue” ; fill with blue color, see also PENCOLOR<br/> FILLCOLOR “invisible” CIRCLE 10 ; unfilled circle<br/> FILLCOLOR [“blue”, “red”] ; gradient between red and blue<br/> FILLCOLOR [[255, 255, 255], [255, 128, 0]] ; between white and orange<br/> FILLCOLOR [“blue”, “red”, 1, 0, 0] ; set axial gradient (with the required rotation and border settings), possible values: 0-5 = linear, axial, radial, elliptical, square and rectangle gradients<br/> FILLCOLOR [“red”, “blue”, 0, 90, 20] ; linear with 20% border, rotated with 90 degrees from the actual heading of the turtle<br/> FILLCOLOR [“red”, “blue”, 0, 90, 20, 0, 0, 200, 50] ; from 200% to 50% intensity<br/> FILLCOLOR [ANY, ANY, 2, 0, 0, 50, 50] ; radial gradient with random colors and 50-50% horizontal and vertical positions of the center<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1225">FILLTRANSPARENCY</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1226"> FILLTRANSPARENCY 80 ; set the transparency of the actual fill color to 80%<br/> FILLTRANSPARENCY [80] ; set linear transparency gradient from 80% to 0%<br/> FILLTRANSPARENCY [80, 20] ; set linear transparency gradient from 80% to 20%<br/> FILLTRANSPARENCY [80, 20, 1, 90] ; set axial transparency gradient rotated with 90 degrees from the actual heading of the turtle<br/> FILLTRANSPARENCY [80, 20, 2, 0, 20, 50, 50] ; set radial transparency gradient from outer 80% to inner 20% transparency with 20% border and with 50-50% horizontal and vertical positions of the center<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1230">FILLSTYLE</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1240"> FILLSTYLE 0 ; fill without hatches (default)<br/> FILLSTYLE 1 ; black single hatches (horizontal)<br/> FILLSTYLE 2 ; black single hatches (45 degrees)<br/> FILLSTYLE 3 ; black single hatches (-45 degrees)<br/> FILLSTYLE 4 ; black single hatches (vertical)<br/> FILLSTYLE 5 ; red crossed hatches (45 degrees)<br/> FILLSTYLE 6 ; red crossed hatches (0 degrees)<br/> FILLSTYLE 7 ; blue crossed hatches (45 degrees)<br/> FILLSTYLE 8 ; blue crossed hatches (0 degrees)<br/> FILLSTYLE 9 ; blue triple crossed<br/> FILLSTYLE 10 ; black wide single hatches (45 degrees)<br/> <br/> ; custom hatches specified by a list with the following arguments:<br/> ; – style (1 = single, 2 = double, 3 = triple hatching)<br/> ; – color<br/> ; – distance<br/> ; – degree<br/> <br/> FILLSTYLE [2, “green”, 3pt, 15°] ; green crossed hatches (15 degrees)<br/></paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_1250">Drawing objects</paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1260">CIRCLE</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1270"> CIRCLE 100 ; draw a circle shape (diameter = 100pt)<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1280">ELLIPSE</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1290"> ELLIPSE [50, 100] ; draw an ellipse with 50 and 100 diameters<br/> ELLIPSE [50, 100, 2h, 12h] ; draw an elliptical sector (from 2h clock position to 12h)<br/> ELLIPSE [50, 100, 2h, 12h, 2] ; draw an elliptical segment<br/> ELLIPSE [50, 100, 2h, 12h, 3] ; draw an elliptical arc<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1300">SQUARE</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1310"> SQUARE 100 ; draw a square shape (size = 100pt)<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1320">RECTANGLE</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1330"> RECTANGLE [50, 100] ; draw a rectangle shape (50×100pt)<br/> RECTANGLE [50, 100, 10] ; draw a rectangle with rounded corners<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1340">POINT</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1350"> POINT ; draw a point with size and color of the pen<br/></paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_1354">CLOSE can join the last points, FILL can fill the shape defined by points. For example, it’s easy to draw a “flat” star starting from its center:</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1357"> PENUP<br/> REPEAT 5 [<br/> FORWARD 80<br/> POINT<br/> BACK 80<br/> RIGHT 36<br/> FORWARD 50<br/> POINT<br/> BACK 50<br/> RIGHT 120<br/> ] FILL<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1360">LABEL</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1370"> LABEL “text” ; print text in the turtle position<br/> LABEL 'text' ; see above<br/> LABEL "text ; see above (only for single words)<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1380">TEXT</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1390"> CIRCLE 10 TEXT “text” ; set text of the actual drawing object<br/></paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_1400">Font settings</paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1410">FONTCOLOR/FONTCOLOUR</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1420"> FONTCOLOR “green” ; set font color<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1430">FONTFAMILY</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1440"> FONTFAMILY “Linux Libertine G” ; set font (family)<br/> FONTFAMILY “Linux Libertine G:smcp=1” ; set also font feature (small caps)<br/> FONTFAMILY “Linux Libertine G:smcp=1&onum=1” ; small caps + old figures<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1450">FONTSIZE</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1460"> FONTSIZE 12 ; set 12pt<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1470">FONTWEIGHT</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1480"> FONTWEIGHT “bold” ; set bold font<br/> FONTWEIGHT “normal” ; set normal weight<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1490">FONTSTYLE</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1500"> FONTSTYLE “italic” ; set italic variant<br/> FONTSTYLE “normal” ; set normal variant<br/></paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_1510">PICTURE (pic)</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_1520">PICTURE is for </paragraph>
<list type="unordered">
<listitem>
<paragraph role="listitem" xml-lang="en-US" id="par_1530">shape grouping;</paragraph>
</listitem>
<listitem>
<paragraph role="listitem" xml-lang="en-US" id="par_1540">starting new line shapes;</paragraph>
</listitem>
<listitem>
<paragraph role="listitem" xml-lang="en-US" id="par_1545">saving SVG images and SVG/SMIL animations;</paragraph>
</listitem>
<listitem>
<paragraph role="listitem" xml-lang="en-US" id="par_1550">keeping the consistency of positions and line shapes at the left border.</paragraph>
</listitem>
</list>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1560">Shape grouping</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1570"> ; PICTURE [ LibreLogo_commands ]<br/> PICTURE [ FORWARD 100 CIRCLE 100 ] ; tree-like grouped shape<br/></paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_1580">See also “Group” in %PRODUCTNAME Writer Help.</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1590"> TO tree location<br/> PENUP POSITION location HEADING 0 PENDOWN<br/> PICTURE [ FORWARD 100 CIRCLE 100 ] ; tree-like grouped shape<br/> END<br/> <br/> PICTURE [ tree [230, 400] tree [300, 400] ] ; grouped shapes in a grouped shape<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1600">Starting new line shapes</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1610"> PICTURE ; start a new line shape<br/> FORWARD 10 PICTURE FORWARD 10 ; two line shapes<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1614">Saving SVG images</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1617"> PICTURE “example.svg” [ CIRCLE 5 ] ; save the picture as an SVG image file in the user folder<br/> PICTURE “Desktop/example.svg” [ FORWARD 100 CIRCLE 5 ] ; as above, with a relative path<br/> PICTURE “/home/user/example.svg” [ CIRCLE 5 ] ; absolute path for Unix/Linux<br/> PICTURE “C:\example.svg” [ CIRCLE 5 ] ; absolute path for Windows<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1618">Saving SVG/SMIL animations (drawings with SLEEP commands)</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1619"> PICTURE “animation.svg” [ CIRCLE 5 SLEEP 1000 CIRCLE 99 ] ; save as an SVG/SMIL animation (see also SLEEP)<br/> PICTURE “animation2.svg” [ CIRCLE 5 SLEEP 1000 CIRCLE 99 SLEEP 2000 ] ; as above, but using SLEEP after the last object will result looping: after 2 seconds the SVG animation restarts in SMIL-conformant browsers</paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1620">Consistency at the left border</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_1630">Use PICTURE to keep the consistency of positions and line shapes at the left border of Writer:</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1640"> PICTURE [ CIRCLE 20 POSITION [-100, 100] CIRCLE 20 ]<br/></paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_1650">Loops</paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1660">REPEAT</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1670"> ; REPEAT number [ commands ]<br/> <br/> REPEAT 10 [ FORWARD 10 LEFT 45 CIRCLE 10 ] ; repeat 10 times<br/></paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1680"> ; number is optional<br/> <br/> REPEAT [ POSITION ANY ] ; endless loop<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1690">REPCOUNT</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_1700">Loop variable (also in the FOR and WHILE loops).</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1710"> REPEAT 100 [ FORWARD REPCOUNT LEFT 90 ]<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1720">FOR IN</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_1730">Loop for the list elements:</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1740"> FOR i IN [1, 5, 7, 9, 11] [<br/> FORWARD i<br/> LEFT 90<br/> ]<br/></paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_1750">Loop for the characters of a character sequence:</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1760"> FOR i IN “text” [<br/> LABEL i<br/> FORWARD 10<br/> ]<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1770">WHILE</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1780"> WHILE TRUE [ POSITION ANY ] ; endless loop<br/> WHILE REPCOUNT <= 10 [ FORWARD 50 LEFT 36 ] ; as REPEAT 10 [ ... ]<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1790">BREAK</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_1800">Stop the loop.</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1810"> REPEAT [ ; endless loop<br/> POSITION ANY<br/> IF REPCOUNT = 100 [ BREAK ] ; equivalent of the REPEAT 100 [ ... ]<br/> ]<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1820">CONTINUE</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_1830">Jump into the next iteration of the loop.</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1840"> REPEAT 100 [<br/> POSITION ANY<br/> IF REPCOUNT % 2 = 0 [ CONTINUE ]<br/> CIRCLE 10 ; draw circles on every 2nd positions<br/> ]<br/></paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_1850">Conditions</paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1860">IF</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1870"> ; IF condition [ true block ]<br/> ; IF condition [ true block ] [ false block ]<br/> <br/> IF a < 10 [ PRINT “Small” ]<br/> IF a < 10 [ PRINT “Small” ] [ PRINT “Big” ]<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1880">AND, OR, NOT</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_1890">Logical operators.</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1900"> IF a < 10 AND NOT a = 5 [ PRINT “0, 1, 2, 3, 4, 6, 7, 8 or 9” ]<br/> IF a < 10 AND a != 5 [ PRINT “0, 1, 2, 3, 4, 6, 7, 8 or 9” ] ; as above<br/></paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_1910">Subroutines</paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1920">TO, END</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_1930">New word (or procedure).</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1940"> TO triangle<br/> REPEAT 2 [ FORWARD 100 RIGHT 120 ] FILL<br/> END<br/> <br/> REPEAT 10 [ triangle PENUP POSITION ANY PENDOWN ]<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1950">OUTPUT</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_1960">Return value of the function.</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_1970"> TO randomletter<br/> OUTPUT RANDOM “qwertzuiopasdfghjklyxcvbnm”<br/> END<br/> <br/> PRINT randomletter + randomletter + randomletter ; print 3-letter random character sequence<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_1980">STOP</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_1990">Return from the procedure.</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2000"> TO example number<br/> IF number < 0 [ STOP ]<br/> PRINT SQRT number ; print square root<br/> ]<br/> <br/> example 100<br/> example -1 ; without output and error<br/> example 25<br/></paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_2010">Default variables</paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2020">ANY</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_2030">Default random value of colors, etc.</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2040"> PENCOLOR ANY ; random pen color<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2050">TRUE</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_2060">Logical value.</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2070"> WHILE TRUE [ POSITION ANY ] ; endless loop<br/> PRINT TRUE ; print true<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2080">FALSE</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_2090">Logical value.</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2100"> WHILE NOT FALSE [ POSITION ANY ] ; endless loop<br/> PRINT FALSE ; print false<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2110">PAGESIZE</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2120"> PRINT PAGESIZE ; print list of the page sizes in points, eg. [595.30, 841.89]<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2130">PI/π</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2140"> PRINT PI ; print 3.14159265359<br/></paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_2150">Input/Output</paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2160">PRINT</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2170"> PRINT “text” ; print “text” in a dialog box<br/> PRINT 5 + 10 ; print 15<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2180">INPUT</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2190"> PRINT INPUT “Input value?” ; ask and print a string by a query dialog box<br/> PRINT FLOAT (INPUT “First number?”) + FLOAT (INPUT “Second number?”) ; simple calculator<br/></paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_2200">SLEEP</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2210"> SLEEP 1000 ; wait for 1000 ms (1 sec)<br/></paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_2220">GLOBAL</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_2230">Set global variables used in procedures.</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2240"> GLOBAL about<br/> about = “LibreLogo”<br/> <br/> TO example<br/> PRINT about<br/> GLOBAL about ; when we want to add a new value<br/> about = “new value for the global variable”<br/> END<br/> <br/> example<br/> PRINT about<br/></paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_2250">Functions</paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2260">RANDOM</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2270"> PRINT RANDOM 100 ; random float number (0 <= x < 100)<br/> PRINT RANDOM “text” ; random letter of the “text”<br/> PRINT RANDOM [1, 2] ; random list element (1 or 2)<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2280">INT</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2290"> PRINT INT 3.8 ; print 3 (integer part of 3.8)<br/> PRINT INT RANDOM 100 ; random integer number (0 <= x < 100)<br/> PRINT INT “7” ; convert the string parameter to integer<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2300">FLOAT</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2310"> ; convert the string parameter to float number<br/> PRINT 2 * FLOAT “5.5” ; print 11.0<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2320">STR</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2330"> ; convert the number parameter to string<br/> PRINT “Result: ” + STR 5 ; print “Result: 5”<br/> PRINT 10 * STR 5 ; print 5555555555<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2340">SQRT</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2350"> PRINT SQRT 100 ; print 10, square root of 100<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2360">SIN</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2370"> PRINT SIN 90 * PI/180 ; print 1.0 (sinus of 90° in radians)<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2380">COS</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2390"> PRINT COS 0 * PI/180 ; print 1.0 (cosinus of 0° in radians)<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2395">LOG10</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2396"> PRINT LOG10 100 ; print 2.0 (common logarithm of 100)<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2400">ROUND</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2410"> PRINT ROUND 3.8 ; print 4 (rounding 3.8)<br/> PRINT ROUND RANDOM 100 ; random integer number (0 <= x <= 100)<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2420">ABS</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2430"> PRINT ABS -10 ; print 10, absolute value of -10<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2440">COUNT</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2450"> PRINT COUNT “text” ; print 4, character count of “text”<br/> PRINT COUNT [1, 2, 3] ; print 3, size of the list<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2460">SET</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2470"> ; Convert list to Python set<br/> PRINT SET [4, 5, 6, 6] ; print {4, 5, 6}<br/> PRINT SET [4, 5, 6, 6] | SET [4, 1, 9] ; print {1, 4, 5, 6, 9}, union<br/> PRINT SET [4, 5, 6, 6] & SET [4, 1, 9] ; print {4}, intersection<br/> PRINT SET ([4, 5, 6, 6]) - SET [4, 1, 9] ; print {5, 6}, difference<br/> PRINT SET [4, 5, 6, 6] ^ SET [4, 1, 9] ; print {1, 5, 6, 9}, symmetric difference <br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2480">RANGE</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2490"> ; Python-like list generation<br/> PRINT LIST RANGE 10 ; print [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]<br/> PRINT LIST RANGE 3 10 ; print [3, 4, 5, 6, 7, 8, 9]<br/> PRINT LIST RANGE 3 10 3 ; print [3, 6, 9]<br/> <br/> FOR i IN RANGE 10 50 10 [ ; loop for [10, 20, 30, 40]<br/> FORWARD i<br/> LEFT 90<br/> ]<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2500">LIST</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2510"> ; remove the repeating elements of a list using set and list conversion<br/> PRINT LIST (SET [1, 3, 5, 5, 2, 1]) ; print [1, 3, 5, 2]<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2520">TUPLE</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_2530">Conversion to Python tuple (non-modifiable list)</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2540"> PRINT TUPLE [4, 5]<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2550">SORTED</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_2560">It returns with a sorted list.</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2570"> PRINT SORTED [5, 1, 3, 4] ; print [1, 3, 4, 5]<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2580">SUB</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_2590">Substitute character sequences using regex (regular expression) patterns.</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2600"> PRINT SUB (“t”, “T”, “text”) ; print “Text”, replacing “t” with “T”<br/> PRINT SUB (“(.)”, “\\1\\1”, “text”) ; print “tteexxtt”, doubling every characters<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2610">SEARCH</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_2620">Search character sequences patterns using regex patterns.</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2630"> IF SEARCH (“\w”, "word") [ PRINT “Letter in the word.” ]<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2640">FINDALL</paragraph>
<paragraph role="paragraph" xml-lang="en-US" id="par_2650">Find all character sequences in the input string matching the given regex pattern.</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2660"> PRINT FINDALL(“\w+”, “Dogs, cats.”) ; print [“Dogs”, “cats”], the list of the words.<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2670">MIN</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2680"> PRINT MIN [1, 2, 3] ; print 1, the lowest element of the list<br/></paragraph>
<paragraph role="heading" level="3" xml-lang="en-US" id="hd_2690">MAX</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2700"> PRINT MAX [1, 2, 3] ; print 3, the greatest element of the list<br/></paragraph>
<paragraph role="heading" level="2" xml-lang="en-US" id="hd_2710">Color constants</paragraph>
<paragraph role="logocode" xml-lang="en-US" id="par_2720"> PENCOLOR “SILVER” ; set by name<br/> PENCOLOR [1] ; set by identifiers<br/> PENCOLOR “~SILVER” ; random silver color<br/> <br/></paragraph>
<table id="tbl_colorconstants"><tablerow>
<tablecell><paragraph xml-lang="en-US" id="par_2740" role="tablehead">Identifier</paragraph></tablecell>
<tablecell><paragraph xml-lang="en-US" id="par_2750" role="tablehead">Name</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_2770">0</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_2780">BLACK</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_2800">1</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_2810">SILVER</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_2830">2</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_2840">GRAY/GREY</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_2860">3</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_2870">WHITE</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_2890">4</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_2900">MAROON</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_2920">5</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_2930">RED</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_2950">6</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_2960">PURPLE</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_2980">7</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_2990">FUCHSIA/MAGENTA</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3010">8</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3020">GREEN</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3040">9</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3050">LIME</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3070">10</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3080">OLIVE</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3100">11</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3110">YELLOW</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3130">12</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3140">NAVY</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3160">13</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3170">BLUE</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3190">14</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3200">TEAL</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3220">15</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3230">AQUA</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3250">16</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3260">PINK</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3280">17</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3290">TOMATO</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3310">18</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3320">ORANGE</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3340">19</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3350">GOLD</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3370">20</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3380">VIOLET</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3400">21</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3410">SKYBLUE</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3430">22</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3440">CHOCOLATE</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3460">23</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3470">BROWN</paragraph></tablecell>
</tablerow><tablerow>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3490">24</paragraph></tablecell>
<tablecell><paragraph role="tablecontent" xml-lang="en-US" id="par_3500">INVISIBLE</paragraph></tablecell>
</tablerow></table>
</body></helpdocument>
|