Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide


  1. 1. The best web language. language Which is the best programming language for you? Perl? PHP? OR Python? Ruby? ASP?
  2. 2. The one true answer is: LOL Code!!1one LOLCode is an esoteric language by geeks with too much free time. There are multiple lolcode interperters, parsers, and even compilers. “Laser Cats”
  3. 3. I wrote the first working lolcode parser And the first lolcode powered website. I am one of those geeks. “LOLCode By O'RLY”
  4. 4. Basic Usage CODE SNIPPET !BEWARE! HAI <- Opening tag MUST HAS STDIO <- Require File VISIBLE quot;HAI WORLD!quot; <- Print KTHXBYE <- Closing Tag
  5. 5. Variables CODE SNIPPET !BEWARE! I HAS COLOR1 <- Initiate Variable I HAS COLOR2 IZ GREEN ^- Initiate and Set Var COLOR1 IZ RED ^Set existing var
  6. 6. More Variables CODE SNIPPET !BEWARE! VISIBLE “COLOR IS &COLOR1&” ^- Print with Var replacement. IVAR IZ 1 < Set var to 1. IVAR UPUP!< Increment twice. IVAR UPUP! < IVAR is 3. BTW THIS IS A COMMENT ^- Use BTW to comment line.
  7. 7. Control Structures CODE SNIPPET !BEWARE! IZ &IVAR& == 1 < IF. BTW IF VISIBLE quot;YEAH RLYquot; VISIBLE __SKY__ <-Print Constant NOWAI BTW ELSE <- ELSE VISIBLE quot;NOWAIquot; KTHX
  8. 8. IF Control Structure CODE SNIPPET !BEWARE! IZ &IVAR& == 1 < IF. BTW IF VISIBLE quot;YA RLYquot; ORLY &IVAR& == 2 < ELSEIF VISIBLE quot;ORLYquot; ORLY &IVAR& == 2 < ELSEIF VISIBLE quot;ORLY RLYquot; NOWAI <- ELSE VISIBLE quot;NOWAIquot; KTHX
  9. 9. Arrays CODE SNIPPET !BEWARE! ARRAY IZ BUCKET < Create Bucket ^Variable Name 0 FISH quot;zeroquot; !! < Numerical 1 FISH quot;onequot; !! < Keys < String Keys two FISH quot;twoquot; !! BUCKET <- Prints “two” VISIBLE &ARRAY#two&
  10. 10. Multidemensional Arrays CODE SNIPPET !BEWARE! ARRAY IZ BUCKET < Create Bucket ^Variable Name 0 FISH quot;zeroquot; !! three FISH IZ BAG <- Use bag or buckets !! FISH quot;threequot; !! !! FISH quot;twoquot; !! ^New Dimension BAG BUCKET <- Prints “two” VISIBLE &ARRAY#two,1&
  11. 11. BAG Arrays CODE SNIPPET !BEWARE! ARRAY IZ BUCKET < Create Bucket ^Variable Name 0 FISH quot;zeroquot; !! three FISH IZ BAG <Create BAG !! FISH quot;threequot; !! !! FISH quot;twoquot; !! BAG ^BAG uses auto incremented keys. BUCKET <- Prints “two” VISIBLE &ARRAY#two,1&
  12. 12. Looping CODE SNIPPET ARRAY IZ BUCKET !BEWARE! < Create Bucket 0 FISH quot;zeroquot; !! 1 FISH quot;1quot; !! 2 FISH quot;2quot; !! BUCKET <- Foreach IM IN UR ARRAY ITZA NUMBA VISIBLE quot;&NUMBA&!quot; ^Prints “zero!1!2!” KTHX
  13. 13. Functions CODE SNIPPET !BEWARE! SO IM LIKE UPPING WITH VAR VAR2=0 ^Var Name ^Arguments ^Default Value VAR UPUP! <- Increment VAR I FOUND MAH VAR<- Return VAR KTHX <End Function VISIBLE quot;FOUR UP? ITZA quot;.UPPING(4) ^Prints “5”
  14. 14. Advanced Features CODE SNIPPET !BEWARE! THEVAR IZ GOLD VARNAME IZ THEVAR VISIBLE &&VARNAME&& <-Prints “GOLD” ^- Variable Variable ALWAYZ SKY IZ BLUE <- Set Constant VISIBLE __SKY__ <- Print Constant
  15. 15. Embed in HTML CODE SNIPPET <html> !BEWARE! <head> <title>LOL Power</title> <- HTML </head> <body> Subset of XML HAI MUST HAS STDIO VISIBLE quot;<!-- Copyright 2007 Jeff Jones, www.tetraboy.com -->nquot; VISIBLE quot;HAI WORLD!quot; KTHXBYE ^ Code in tags is parsed. </body> </html>
  16. 16. SQLite Databases CODE SNIPPET !BEWARE! CAN HAS SQL? <- Include SQL Lib DBASE IZ GETDB('lolz')<-Select DB File FUNNAHS IZ DBUCKET( ^Get Array from DB &DBASE&, quot;CAN I PLZ GET joke ALL UP IN funnahsquot; ) ^LOL-SQL. “Select joke from funnahs”
  17. 17. SQLite Databases, Part Deux CODE SNIPPET !BEWARE! CAN HAS SQL? <- Get Array from DB DBASE IZ GETDB('lolz') FUNNAHS IZ DBUCKET(&DBASE&,quot;CAN I PLZ GET joke ALL UP IN funnahsquot;) < Loop It IM IN UR FUNNAHS ITZA JOKE VISIBLE quot;<P>quot;.&JOKE#joke&.quot;</P>quot; ^Print each joke KTHX (dbucket returns assoc array)
  18. 18. Tetra LOLCode Parser How to make a new lang work? With little to no work? Convert it to PHP! How? preg_replace! function lol_core_parse($code) Takes incoming code and runs through 36 regular expressions /e is your new best friend.
  19. 19. Tetra LOLCode Works with apache! Easiest way to run .lol on apache? Set .lol to parse as PHP Use PHP's prepend/append Output Buffering to catch LOL Parse src Write source to temporary file Include temporary file
  20. 20. More info? http://www.lolcode.com Official Website http://www.tetraboy.com/lolcode/ My LOLCode website, powred by LOLCODE! irc.freenode.net #lolcode Community IRC Channel. (I Hope noone still goes there..) MailChimp LOL Parser Based on my lolcode parser, download their improved version.