It's not fair that 1% of the users hold 75% of the lolcode questions. #OccupyMatsMug
~ user2296177
I agree. Without further ado, here's the LOLCODE version of 99 bottles of beer on the wall:
OBTW
PRINT TEH LOLCODE VERSHUN OV N BOTTLEZ OV BER ON TEH WALL.
TLDR
HAI 1.3
HOW IZ I COUNTDOWN YR NUMAH
I HAS A NAUW ITZ A NUMBR
I HAS A LEZZ ITZ A NUMBR
IM IN YR LOOPZ NERFIN YR COWNTR TIL BOTH SAEM COWNTR AN DIFF OF 1 AN NUMAH
NAUW R SUM OF NUMAH AN COWNTR
LEZZ R DIFF OF NAUW AN 1
VISIBLE SMOOSH NAUW AN " LITTERS OV KITTEHS ON TEH NETZ" MKAY
VISIBLE SMOOSH NAUW AN " LITTERS OV KITTEHS" MKAY
VISIBLE "WAN FALLS DOWN AN BREAKZ PAH"
VISIBLE SMOOSH LEZZ AN " LITTERS OV KITTEHS ON TEH NETZ" MKAY
VISIBLE ""
IM OUTTA YR LOOPZ
VISIBLE "1 LITTER OV KITTEHS ON TEH NETZ"
VISIBLE "1 LITTER OV KITTEHS"
VISIBLE "WAN FALLS DOWN AN BREAKZ PAH"
VISIBLE "NO MOAR LITTERs OV KITTEHS ON TEH NETZ"
IF U SAY SO
I IZ COUNTDOWN YR 99 MKAY
KTHXBYE
Disclaimer: No actual kittens were harmed while writing this program.
The number of iterations is held in the variable NUMAH
. I know NUMBR
is a more fitting name, but that's already claimed as a type.
The above is compiled using the latest lci using the 1.3 specification (thanks to Pimgd for the link). Since the 1.3 specification doesn't contain every feature of the language, see the 1.2 specification as well.
I don't think LOLCODE has templates or the likes, so getting all the output on screen is a bit tedious.
Output:
99 LITTERS OV KITTEHS ON TEH NETZ
99 LITTERS OV KITTEHS
WAN FALLS DOWN AN BREAKZ PAH
98 LITTERS OV KITTEHS ON TEH NETZ
etc.
1 LITTER OV KITTEHS ON TEH NETZ
1 LITTER OV KITTEHS
WAN FALLS DOWN AN BREAKZ PAH
NO MOAR LITTERs OV KITTEHS ON TEH NETZ
Is this idiomatic LOLCODE?