What is LOLCODE?

LOLCODE is an esoteric programming language inspired by kitty pidgin. It was first introduced on 25 May 2007 by Adam Lindsay, and it now has its own website dedicated to bringing the language up to v1.0.

The first program to be written in LOLCODE was, of course, "Hello world!", or more appropriately "HAI WORLD!". Since that point, a number of ideas have been put forward as the language grows.

After stumbling upon 99 Bottles of Beer, I noticed it was gloriously lacking in a LOLCODE implementation. This is the code that was submitted, after being tested in sjlol:

  1. HAI
  2. BTW http://lolcode.com/implementations/sjlol
  3.  
  4. CAN HAS STDIO?
  5. I HAS A BEERZ
  6. LOL BEERZ R 99
  7.  
  8. I HAS A BOTL
  9. LOL BOTL R "bottle"
  10.  
  11. I HAS A DRINK
  12.  
  13. IM IN YR LOOP
  14. VISIBLE BEERZ N BOTL!
  15. IZ BEERZ LIEK 1?
  16. YARLY
  17. VISIBLE ""!
  18. NOWAI
  19. VISIBLE "s"!
  20. KTHX
  21. VISIBLE " of beer on the wall," N BEERZ N BOTL!
  22. IZ BEERZ LIEK 1?
  23. YARLY
  24. VISIBLE ""!
  25. NOWAI
  26. VISIBLE "s"!
  27. KTHX
  28. VISIBLE " of beer,"
  29.  
  30. VISIBLE "Take one down and pass it around, "!
  31. LOL DRINK R BEERZ NERF 1
  32.  
  33. IZ DRINK LIEK 0?
  34. YARLY
  35. VISIBLE "no more bottles of beer on the wall."
  36. VISIBLE ""
  37. VISIBLE "No more bottles of beer on the wall, no more bottles of beer."
  38. VISIBLE "Go to the store and buy some more, 99 bottles of beer on the wall."
  39. GTFO
  40. NOWAI
  41. VISIBLE DRINK N BOTL!
  42.  
  43. IZ DRINK LIEK 1?
  44. YARLY
  45. VISIBLE ""!
  46. NOWAI
  47. VISIBLE "s"!
  48. KTHX
  49. KTHX
  50.  
  51. VISIBLE " of beer on the wall."
  52. VISIBLE ""
  53.  
  54. IZ BEERZ LIEK 1?
  55. YARLY
  56. GTFO
  57. NOWAI
  58. NERFZ BEERZ!!
  59. KTHX
  60. KTHX
  61. KTHXBYE

The following slightly modified code should also run, but fails to compile in sjlol:

  1. HAI
  2.  
  3. CAN HAS STDIO?
  4. I HAS A BEERZ ITZ 99
  5. I HAS A BOTL ITZ "bottle"
  6. I HAS A DRINK
  7.  
  8. IM IN YR LOOP
  9. VISIBLE BEERZ N BOTL!
  10. IZ BEERZ BIGR THAN 1?
  11. VISIBLE "s"!
  12. KTHX
  13. VISIBLE " of beer on the wall," N BEERZ N BOTL!
  14. IZ BEERZ BIGR THAN 1?
  15. VISIBLE "s"!
  16. KTHX
  17. VISIBLE " of beer,"
  18.  
  19. VISIBLE "Take one down and pass it around, "!
  20. LOL DRINK R BEERZ NERF 1
  21.  
  22. IZ DRINK LIEK 0?
  23. YARLY
  24. VISIBLE "no more bottles of beer on the wall."
  25. VISIBLE ""
  26. VISIBLE "No more bottles of beer on the wall, no more bottles of beer."
  27. VISIBLE "Go to the store and buy some more, 99 bottles of beer on the wall."
  28. GTFO
  29. NOWAI
  30. VISIBLE DRINK N BOTL!
  31.  
  32. IZ DRINK BIGR THAN 1?
  33. VISIBLE "s"!
  34. KTHX
  35. KTHX
  36.  
  37. VISIBLE " of beer on the wall."
  38. VISIBLE ""
  39.  
  40. NERFZ BEERZ!!
  41. KTHX
  42. KTHXBYE