2020-03-16 07:50:12 +01:00
|
|
|
// This script runs an infinite loop, ending it with a break statement
|
|
|
|
|
2017-10-28 17:44:05 +02:00
|
|
|
let x = 10;
|
|
|
|
|
|
|
|
// simulate do..while using loop
|
|
|
|
loop {
|
|
|
|
print(x);
|
2020-03-16 07:50:12 +01:00
|
|
|
|
2020-05-25 14:14:31 +02:00
|
|
|
x -= 1;
|
2020-03-16 07:50:12 +01:00
|
|
|
|
2017-10-28 17:44:05 +02:00
|
|
|
if x <= 0 { break; }
|
|
|
|
}
|