Count in octal: Difference between revisions

Content added Content deleted
(→‎LOLCODE: Add implementation)
Line 616: Line 616:
make "oct increment_octal :oct
make "oct increment_octal :oct
]</lang>
]</lang>

=={{header|LOLCODE}}==
LOLCODE has no conception of octal numbers, but we can use string concatenation (<tt>SMOOSH</tt>) and basic arithmetic to accomplish the task.
<lang LOLCODE>HAI 1.3

HOW IZ I octal YR num
I HAS A digit, I HAS A oct ITZ ""
IM IN YR octalizer
digit R MOD OF num AN 8
oct R SMOOSH digit oct MKAY
num R QUOSHUNT OF num AN 8
NOT num, O RLY?
YA RLY, FOUND YR oct
OIC
IM OUTTA YR octalizer
IF U SAY SO

IM IN YR printer UPPIN YR num
VISIBLE I IZ octal YR num MKAY
IM OUTTA YR printer

KTHXBYE</lang>


=={{header|Lua}}==
=={{header|Lua}}==