diff options
Diffstat (limited to 'tour/variables.sloth')
| -rw-r--r-- | tour/variables.sloth | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tour/variables.sloth b/tour/variables.sloth new file mode 100644 index 0000000..d105716 --- /dev/null +++ b/tour/variables.sloth @@ -0,0 +1,16 @@ +# Variables can be declared using the `let` keyword, however they will be deeply +# immutable. If you would like to make the variable mutable you can use `let mut` +# +# Variables can not be exported and can not be referrenced accross modules. +let x = 0; +let mut y = 0; + +x = 5; # Invalid +y = 5; # Valid + +# Constants can be declared using the `const` keyword, unlike variables they can +# be exported and accessed across modules. +const FPS = 60; + +pub const WIDTH = 5; +pub const HEIGHT = 17; |
