-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands.txt
75 lines (56 loc) · 1.91 KB
/
commands.txt
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
(Rough list of available commands/functions. Needs organized, cleaned up,
etc... eventually.)
CANVAS :x :y
Create a new canvas of size (x, y).
PENUP
Lift the pen up, i.e. turtle moves don't leave a track.
PENDOWN
Put the pen down, i.e. turtle moves leave a track (this is how you draw
lines).
PENWIDTH :width
Set the line drawn by the turtle to :width pixels thick.
PENCOLOR :color
Set the line color. This is a string with a color name recognized by Tk
(e.g. "black"), or an RGB value of the form "#RRGGBB", e.g. "#808000".
FORWARD :distance
BACKWARD :distance
Move the turtle for the given distance. These functions can be abbreviated
as FD and BACK.
LEFT :angle
RIGHT :angle
Change the direction the turtle is facing, by turning it left or right by
the specified number of degrees. Can be abbreviated as LT and RT.
SETXY :x :y
Move the turtle to position (x, y) (using Cartesian coordinates). If the
pen is down, a line will be drawn, much like with FORWARD/BACKWARD.
KEEP-OPEN
When the program is done, keep the canvas window open.
+ :a :b
- :a :b
* :a :b
Basic arithmetic.
SAY :x
Display the given object.
SHOW :x
Display the given object. [XXX explain difference]
PRINT :x
Display the given object. [XXX ditto :-)]
INTERPOLATE :list
Return a new list with variables evaluated.
EVAL :code
Evaluate a block of code (must be a list).
TO name [args...] code
Special form to define a new function.
MAKE :name :value
Special form to define a new variable.
TRUE
FALSE
Return 'true' and 'false' values, respectively. Note that these are
technically functions, but because they take no arguments, they could be
considered constants.
LOAD :filename
Load and execute the given Logo file.
REPEAT :times :code
Execute the given code block :times times.
FOREVER
Constant, currently defined as -1. Used in 'REPEAT FOREVER [ ... ]'.