RosettaCodeData/Task/Count-in-octal/Logo/count-in-octal.logo
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

22 lines
382 B
Text

to increment_octal :n
ifelse [empty? :n] [
output 1
] [
local "last
make "last last :n
local "butlast
make "butlast butlast :n
make "last sum :last 1
ifelse [:last < 8] [
output word :butlast :last
] [
output word (increment_octal :butlast) 0
]
]
end
make "oct 0
while ["true] [
print :oct
make "oct increment_octal :oct
]