forked from solstice/docs
More docs
This commit is contained in:
32
src/tutorial_variables.md
Normal file
32
src/tutorial_variables.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# 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.
|
||||
Reference in New Issue
Block a user