about summary refs log tree commit diff
path: root/users/tazjin/rlox/examples/hello.lox
blob: 31752d9e2f5e0f7de7ff1f947a5a199af8f9b419 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var a = 12;
var b = a * 2;

{
  var b = a * 3;
  a = 42;
  print b;
}

print a;
print b;

if (5 > 4)
  print "it's true";
else
  print "it's false";

if (false)
  print "it's not true";

if (true and false)
  print "won't happen";

if (true or false)
  print "will happen";

var n = 5;
while (n > 0) {
  print "counting down";
  n = n - 1;
}

for(var i = 0; i < 10; i = i + 1)
  print "bla";