Anonymous user
Loops/While: Difference between revisions
→LOLCODE: Add implementation
(→0815: Add implementation) |
(→LOLCODE: Add implementation) |
||
Line 610:
<lang logo>make "n 1024
while [:n > 0] [print :n make "n :n / 2]</lang>
=={{header|LOLCODE}}==
LOLCODE's loop semantics require an afterthought if a condition is used, thus the <tt>nop</tt> in the following example. The more idiomatic approach would have been to <tt>GTFO</tt> of the loop once <tt>n</tt> had reached 0.
<lang LOLCODE>HAI 1.3
I HAS A n ITZ 1024
IM IN YR loop UPPIN YR nop WILE n
VISIBLE n
n R QUOSHUNT OF n AN 2
IM OUTTA YR loop
KTHXBYE</lang>
=={{header|Lua}}==
|