RosettaCodeData/Task/Count-in-octal/0815/count-in-octal.0815
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

17 lines
472 B
Text

}:l:> Start loop, enqueue Z (initially 0).
}:o: Treat the queue as a stack and
<:8:= accumulate the octal digits
/=>&~ of the current number.
^:o:
<: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: