Half working stuff

This commit is contained in:
2025-12-20 14:47:24 +11:00
parent 16a406b52f
commit c04e631180
4 changed files with 94 additions and 8 deletions

View File

@@ -47,3 +47,51 @@ puts 1 + 1
puts 3.14 + 2.7
puts 532 + 314 + 89432
```
### Comparisons
Compare 2 values with `==` and `!=` (more operations coming soon)
```
puts 5 == 5
puts 5 != 5
puts "dingus" == "dongus"
puts "dingus" != "dongus"
```
### Variables
Set a variable with `=`, similar to Python.
```
x = 5
y = 10
puts x + y
```
### Control Flow
Use `if` to execute code if a condition is true.
```
password = "dingus"
if password == "password123" {
puts "Your password is insecure."
}
if password = "dingus" {
puts "Cool password!"
}
```
Use `while` to loop over a statement.
```
number = 0
while number != 10 {
number = number + 1
puts number
}
```