Assignment Statement
Assignment statements are statements that define a variable with a value or an expression; successive assignment statements for the same variable results in the second statement overriding the first.
See Overwriting
Variables
Variables are used to store data to be referenced.
Below is a list of elements that are accepted in the variable declaration box of any statement.
Accepted | Error |
---|---|
Words E.g. print, cube |
Reserved words E.g. import, if, true, break, return |
Words+numbers E.g. print1, cube1side2 |
Numbers E.g. 10, 0.5 |
Words+underscore(+numbers) E.g. blue_cube, print_1 |
Symbols E.g. _1, print!, [] |
Global attributes E.g. @floor, @hud |
Spaces between words E.g. print 1 |
Strings E.g “hello”, “123” |
|
IDs E.g “ps0”, “ps1” |
|
List E.g [1,2,3], [blue, black] |
|
Entities E.g. extrude[1] |
Inputs
Below is a list of elements that can be accepted in the input box of any statement, if the input box does not indicate a specific type of element it accepts.
Accepted | Error |
---|---|
Variables E.g. print, cube_1 |
Undefined words that are not variables E.g. print, cube_1 |
Accepted operators E.g. 5%2, [] |
Unaccepted symbols E.g. :, ? |
Numbers E.g. 10, 0.5 |
|
Inlines expressions E.g. PI, XY, range(0,30) |
|
Strings E.g “hello”, “123” |
|
IDs E.g “ps0”, “ps1” |
|
Lists E.g [1,2,3], [blue, black] |
|
Entities E.g. extrude[1] |