aboutsummaryrefslogtreecommitdiff
path: root/tour/variables.sloth
blob: d105716d0c704cff8c72c948d59c8bf3da09a054 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;