Jump to content

Count in octal: Difference between revisions

→‎LOLCODE: Add implementation
(→‎LOLCODE: Add implementation)
Line 616:
make "oct increment_octal :oct
]</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}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.