LOGO Primitives
Command |
Short Form |
Example |
Description |
Chapter 9
|
|||
MAKE |
MAKE |
MAKE “X 50 |
Defines a global variable and assigns an initial value. |
LOCAL |
LOCAL |
LOCAL “X |
Changes a global variable to a variable that is local to the procedure where this command occurs. |
|
|
|
|
Command |
Short Form |
Example |
Description |
Chapter 11
|
|||
PRINTOUT NAMES |
PO NAMES |
PO NAMES |
Prints out all of the global variables. |
ERN |
ERN |
ERN “X |
ERN removes the variable(s) specified by its input from the Logo workspace |
ERASE NAMES |
ERASE NAMES |
ERASE NAMES |
ERASE NAMES removes all user-defined variables from the workspace. |
|
|
|
|
Command |
Short Form |
Example |
Description |
Chapter 12
|
|||
REMAINDER |
|
REMAINDER 5 2 Result: 1 |
Reports an integer remainder of the first number divided by the second number. |
INT |
|
INT 8.9 Result: 8 |
INT reports the integer portion of its input by removing the decimal portion, if any. No rounding occurs. |
ROUND |
|
ROUND 1.5 Result: 2 |
ROUND reports the input number rounded to the nearest integer. |
SQRT |
|
SQRT 2 Result: 1.41 |
Outputs the square root of its input. The input number must be a positive number. |
ATAN |
|
ATAN 0.5 Result: 26.57 |
Gives the arctangent of its input. |
SIN |
|
SIN 30 Result: 0.5 |
SIN reports the sine of its input, which is the number of
degrees in an angle. |
COS |
|
COS 60 Result: 0.5 |
COS reports the cosine of its input, which is the number
of degrees in an angle. |
RANDOM |
|
RANDOM 5 This could report a 1, 2, 3, 4, or 5 |
RANDOM reports a randomly selected number from 1 through its input. The output can only be a positive integer. |
ABS |
|
ABS –10 Result: 10 |
ABS reports the absolute value of its input. |
PI |
|
PI Result: 3.14 |
Reports the value of PI |