2023-05-13 14:54:48 +03:00
|
|
|
decl flow_control_test : -> Unit
|
2023-03-31 12:10:12 +03:00
|
|
|
def flow_control_test = {
|
2023-05-11 23:14:36 +03:00
|
|
|
if (a < b ||. a == b) && (b < c) then IO.print: x
|
2023-04-11 13:49:22 +03:00
|
|
|
elif x < 0 then {
|
2023-05-11 23:14:36 +03:00
|
|
|
; x += 1
|
2023-05-07 09:25:38 +03:00
|
|
|
; IO.print: y
|
2023-03-31 12:10:12 +03:00
|
|
|
} else {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-11 23:14:36 +03:00
|
|
|
while (a > 0) && not: (array.is_empty:) do {
|
|
|
|
|
; a -= 1
|
2023-05-07 09:25:38 +03:00
|
|
|
; array.pop:
|
2023-03-31 12:10:12 +03:00
|
|
|
}
|
|
|
|
|
|
2023-05-11 23:14:36 +03:00
|
|
|
while x < 10 do x +=. x + 3
|
2023-03-31 12:10:12 +03:00
|
|
|
|
2023-05-11 23:14:36 +03:00
|
|
|
for i in 0--y do {
|
2023-05-07 09:25:38 +03:00
|
|
|
; IO.print: i
|
2023-03-31 12:10:12 +03:00
|
|
|
}
|
|
|
|
|
|
2023-05-13 14:54:48 +03:00
|
|
|
for & i & j in (& 0--y & 0--k) do { // ??
|
2023-05-07 09:25:38 +03:00
|
|
|
; IO.print: 1
|
|
|
|
|
; IO.print: 2
|
|
|
|
|
; IO.print: 128
|
2023-03-31 12:10:12 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
loop {
|
2023-05-11 23:14:36 +03:00
|
|
|
; y += 1
|
2023-03-31 12:10:12 +03:00
|
|
|
if y > 100 then
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|