22 lines
382 B
Text
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
|
|
]
|