Files
docs/src/tutorial_variables.md

33 lines
796 B
Markdown
Raw Normal View History

2026-05-10 16:34:54 +10:00
# Variables
## Creating Variables
In Solstice, you can initialize a variable using the syntax:
```solstice
name = value
```
where:
* `name` is 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`.
* `value` is 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 `true` or `false`)
We'll look at types of values in the next part.
## Recalling Variables
Recall a variable's content by using it's name:
```solstice
puts name
```
where `name` is the name of your variable.