Loops/While: Difference between revisions

→‎{{header|Ruby}}: Improved readability
(→‎{{header|Prolog}}: show how to start Prolog execution)
(→‎{{header|Ruby}}: Improved readability)
Line 1,281:
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>puts i = 1024
puts i or i /= 2 while i > 0</lang>
 
<code>until ''condition''</code> is equivalent to <code>while not ''condition''</code>.
Line 1,292:
i /= 2
end</lang>
 
=={{header|Run BASIC}}==
<lang runbasic>i = 1024
1,149

edits