mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-05 22:48:42 +00:00
44 lines
638 B
Text
44 lines
638 B
Text
decl flow_control_test : Unit -> Unit
|
|
def flow_control_test = {
|
|
// if && || a < b
|
|
// || a == b
|
|
// && b < c
|
|
// && c > 10
|
|
|
|
if ((a < b) || (a == b)) && (b < c)
|
|
then IO.print x
|
|
elif x < 0
|
|
then {
|
|
; ++x
|
|
; IO.print y
|
|
} else {
|
|
return {}
|
|
}
|
|
|
|
while (a > 0) && (!array.is_empty)
|
|
do {
|
|
; --a
|
|
; array.pop
|
|
}
|
|
|
|
while x < 10 do
|
|
x += x + 3
|
|
|
|
for i in 0..y do {
|
|
; IO.print i
|
|
}
|
|
|
|
for & i & j
|
|
in (& 0..y & 0..k)
|
|
do { // TODO: decide ??? does it work (like auto zip) ???
|
|
; IO.print 1
|
|
; IO.print 2
|
|
; IO.print 128
|
|
}
|
|
|
|
loop {
|
|
; ++y
|
|
if y > 100 then
|
|
break
|
|
}
|
|
}
|