From 2970520a9592b5c6d45291f54073552a474b71b4 Mon Sep 17 00:00:00 2001 From: Cody Date: Thu, 30 Mar 2023 02:44:54 -0500 Subject: Restructure --- documentation/tour/variables.sloth | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 documentation/tour/variables.sloth (limited to 'documentation/tour/variables.sloth') diff --git a/documentation/tour/variables.sloth b/documentation/tour/variables.sloth new file mode 100644 index 0000000..c3a9137 --- /dev/null +++ b/documentation/tour/variables.sloth @@ -0,0 +1,16 @@ +# Variables can be declared using the `var` keyword, however they will be mutable. +# If you would like to make the variable immutable you can use `val` +# +# Variables can not be exported and can not be referrenced accross modules. +var x = 0; +val y = 0; + +x = 5; # Valid +y = 5; # Invalid + +# 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; -- cgit v1.2.3