rhai/scripts/loop.rhai
2020-03-18 10:40:07 +08:00

13 lines
180 B
Plaintext

// This script runs an infinite loop, ending it with a break statement
let x = 10;
// simulate do..while using loop
loop {
print(x);
x = x - 1;
if x <= 0 { break; }
}