Loops/While: Difference between revisions

→‎{{header|Dc}}: replaced do/until answer with a while example
(→‎{{header|Dc}}: replaced do/until answer with a while example)
Line 512:
 
=={{header|Dc}}==
<lang Dc>[ q ] sQ [ d 0!<Q p 2 / lW x ] sW 1024 lW x</lang>
{{incorrect|Dc|This implements a DO/UNTIL loop. See discussion page for more.}}
People may think all loops in Dc looks alike. In fact, there aren't loop, but conditional execution in Dc. You expand and execute the content of a register (in here, p) whenever the condition is satisfied.
<lang Dc>1024[p2/d0<p]dspx</lang>
 
=={{header|Dao}}==
169

edits