wuz/tests/test_while.wuz

56 lines
426 B
Plaintext

let! a = 7
while a < 100
a = a + 1
end
assert 100 == a
let! b = 0
let! c = 0
let! d = 0
while b < 16
c = 0
while c < 16
c = c + 1
d = d + 1
end
b = b + 1
end
assert d == 256
let! e = 0
while true
e = e + 1
if e >= 17
break
end
end
assert 17 == e
let! f = 0
let! g = 0
while f < 100
f = f + 1
if f % 2 == 0
continue
end
if f >= 50
break
end
g = g + 1
end
assert 51 == f
assert 25 == g