If and while (scoping coming soon)
This commit is contained in:
40
test.sols
40
test.sols
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user