If and while (scoping coming soon)

This commit is contained in:
2026-02-28 11:27:45 +11:00
parent 82a127f34c
commit 2719017f72
4 changed files with 254 additions and 38 deletions

View File

@@ -1,33 +1,15 @@
// heheheha comment
a = 0
b = 1
n = 92
x = 5
puts x + 3
puts 5 * 7
puts 3.0 / 2
puts 10 - 3
puts "dingle" + "dongle"
i = 0
// Uh oh it's the order of operations
while i != n {
temp = a + b
a = b
b = temp
puts 5 + 3 * 7
puts 5 * 3 + 7
// Let's do some equalities
puts 5 == 5
puts 3 == 2
puts "dingus" == "dongus"
puts 3.14 == 3.14
puts 3 + 5 == 3 + 5
// And now some of the other thingys
puts 3 > 5
puts 3 < 5
puts 10 != 3
puts 3 >= 2
puts 3 >= 3
// Put stuff inside a code block, what could possibly go wrong
{
puts "Hi from the code block!"
i = i + 1
}
puts a