I can foresee two ways of implementing LOLCODE in the real world environment, either via “spaghetti” basic style coding, or modern “function” style coding.
There are pros and cons for each, however, for me personally, the “spaghetti” basic style wins for LOLCODE, because it fits rather well with the whole crazy 1337ness style. LOLCATS wouldn't be into “hardcore code” like Ruby or PHP, they would haxx0r Basic hunt the wumpus games from books…
.. or something. Discuss.
Thus, I suggest WUZ DAT and AGAINZ. WUZ DAT <name> being a label and <name> AGAINZ being the GOTO command. The GOTO command would be in addition to the looping IM IN YR keywords - not to replace.
A simple example demonstrating an infinate loop:
HAI WUZ DAT noisez VISIBLE "LOLCAT HAS WETZ HIS BEDZ" noisez AGAINZ KTHXBAI
A more complex example, asking for three names. This assumes that O RLY, MEBBE and SRSLY is the same as if..else..endif.
HAI
I HAS A cookie IZ 1
VISIBLE "GIEF UR NAME!"
WUZ DAT name
GIMMEH inputz
UP cookie!!1
O RLY cookie BIGGER THAN 3
VISIBLE "U WROTE " inputz " NO MOAR!!1"
MEBBE
VISIBLE "U WROTE " inputz " GIEF ANOTHAR!!1"
name AGAINZ
SRSLY
KTHXBAI
I like it. For consistency, I wonder if THX should be used instead of SRSLY to end the if block?
— GandalfDaGraay (2007/05/30) 22:00
Much better would be to use IZ IT CAN BE x TIEM PLEES to declare the goto statement. So the example would be
HAI WUZ DAT noisez VISIBLE "LOLCAT HAS WETZ HIS BEDZ" IZ IT CAN BE noisez TIEM PLEES KTHXBAI
— danb (2007/05/31) 14:11
Heartily agreed, danb.
— David Tombs, 2007/05/31 21:18
I also agree with danb.
— Cerberus, 2007/05/31