Count in octal: Difference between revisions

→‎0815: Fix to conform to task specification.
No edit summary
(→‎0815: Fix to conform to task specification.)
Line 6:
 
=={{header|0815}}==
<lang 0815>}:l:> Start loop, enqueue Z (initially 0).
<lang 0815>
}:o: Treat the queue as a stack and
|~}:z:=x<:8:x/=>&~^:z:
<:8:= accumulate the octal digits
<:ffffffffffffffff:~>}:s:{x
/=>&~ of the current number.
<:ffffffffffffffff:
-#:out:=%~ ^:so:
 
</lang>
<:0:- Get a sentinel negative 1.
&>@ Enqueue it between the digits and the current number.
{ Dequeue the first octal digit.
 
}:p:
~%={+ Rotate each octal digit into place and print it.
^:p:
 
<:a:~$ Output a newline.
<:1:x{+ Dequeue the current number and increment it.
^:l:</lang>
 
=={{header|Ada}}==