Loops/Do-while: Difference between revisions
m
→{{header|M2000 Interpreter}}
(Add lang example) |
|||
Line 2,031:
x=0
\\ Do or Repeat
Do
x++
print x,
when x mod 6>0
print
// or we can use Until x mod 6 = 0
// and we can use block if we like it
x=0
Do {
x++
}
print
x=0
{
Line 2,042 ⟶ 2,050:
if x mod 6<>0 Then loop ' set loop flag of current block to true
\\ when block end check Loop flag and if true execute block again
}
print
}
Checkit
Line 2,050 ⟶ 2,059:
{{out}}
<pre>
1 2 3 4 5 6
1 2 3 4 5 6
1 2 3 4 5 6
</pre>
|