Anonymous user
Loops/While: Difference between revisions
→{{header|Ruby}}: begin-end-while is actually do-while loop
Underscore (talk | contribs) (Added Perl 6 and slightly edited Perl 5.) |
(→{{header|Ruby}}: begin-end-while is actually do-while loop) |
||
Line 502:
i /= 2
end</lang>
The above can be written in one statement (using the return value of the Kernel#puts method: nil is false), but the readability suffers:
<lang ruby>i = 1024
|