Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Lolcode Mathematical Operations

HAI 1.2
   I HAS A m ITZ 4
   I HAS A n ITZ 2
VISIBLE SUM OF m AN n      BTW +
VISIBLE DIFF OF m AN n     BTW -
VISIBLE PRODUKT OF m AN n  BTW *
VISIBLE QUOSHUNT OF m AN n BTW /
VISIBLE MOD OF m AN n      BTW modulo
VISIBLE BIGGR OF m AN n    BTW max
VISIBLE SMALLR OF m AN n   BTW min
KTHXBYE

Lolcode BUKKIT

HAI 1.2
   I HAS A VAR6 ITZ A BUKKIT
   BTW DECLARING AN ARRAY
   VAR6 HAS A VAR7 ITZ "DOGE"
   
   BTW VAR7 IS A STRING VARIABLE THAT IS INSERTED  INTO ARRAY VAR6
   VISIBLE VAR6'Z VAR7
   BTW GET THE ELEMENT OF ARRAY
KTHXBYE

Lolcode Strings (YARN)

HAI 1.2
I HAS A VAR3 ITZ A YARN
VAR3 R "XYZ"
   VISIBLE VAR3
KTHXBYE

Lolcode Numerical Types (NUMBR)

HAI 1.2
I HAS A VAR3 ITZ A NUMBR
   VISIBLE VAR3
KTHXBYE

Lolcode Booleans (TROOFS)

HAI 1.2
I HAS A VAR3 ITZ A TROOF
VAR3 R "FAIL"
   VISIBLE VAR3
KTHXBYE

Lolcode Untyped (NOOB)

HAI 1.2
I HAS A VAR3
VAR3 R "ANYVALUE"
VISIBLE VAR3

BTW Or declare in same line
I HAS A VAR4 ITZ 44
VISIBLE VAR4
KTHXBYE

Lolcode Type Casting

HAI 1.2
I HAS A food ITZ "111.00033"
VISIBLE food

BTW this is how we do type casting
MAEK food A NUMBAR
VISIBLE food
KTHXBYE

Lolcode Declaration and Assignment of Variables

HAI 1.2
BTW this is how we declare variables
I HAS A food
I HAS A bird

BTW this is how we assign variables
food R 1
bird R 5

BTW this is how initialize variables
I HAS A biz ITZ "OMG!"
VISIBLE food
VISIBLE biz
VISIBLE bird
KTHXBYE

Lolcode Variables

HAI 1.2
I HAS A food ITZ "111.00033"
I HAS A food2 ITZ "111"
I HAS A fo_od ITZ "1"
VISIBLE food
VISIBLE food2
VISIBLE fo_od
KTHXBYE

LOLCODE Functions

HAI 1.2
I HAS A STRINGARRAY ITZ A BUKKIT
   STRINGARRAY HAS A VAR17 ITZ "OBJECT1"
   STRINGARRAY HAS A VAR18 ITZ "OBJECT2"
   HOW IZ STRINGARRAY ACCESS YR VARIABLE
      FOUND YR STRINGARRAY'Z SRS VARIABLE
   IF U SAY SO
   I HAS A STRING ITZ "VAR17"
   VISIBLE STRINGARRAY IZ ACCESS YR STRING MKAY
KTHXBYE

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.