Variables
Creating Variables
In Solstice, you can initialize a variable using the syntax:
name = value
where:
nameis the name of your variable. You can use all letters in variable names, as well as underscores and numbers.- The standard way to name your variables in Solstice is with
camelCase.
- The standard way to name your variables in Solstice is with
valueis some sort of value. This value can be:- an integer (number with no decimal place)
- a double (number with a decimal place)
- a string (collection of characters, as seen before)
- a character (a single letter)
- a boolean (either
trueorfalse)
We’ll look at types of values in the next part.
Recalling Variables
Recall a variable’s content by using it’s name:
puts name
where name is the name of your variable.