Modern technology gives us many things.

Learning to Code with LOLCODE!!!

0 283

A night full of tears and code that was tickling

Today, I’ve been looking at various programming languages such as C,C++,FORTRAN,LOLCODE,JAVASCRIPT, etc. since I’ve focused a lot of my time into IT operations and had learned almost nothing in development. So i’ve been messing my head around by considering the time as a serious issue into searching the first programming language to begin with.

One more time god has proved his existence and showed me a path for LOLCODE!! It has a fun name but still I thought about exploring the language and see what I could find out. At the end of 2 hours I am turned into a LOLCAT. Possibly even it’s becoming harder to write proper english in this article. Anyways, let’s look at what I find out and how you should too give a try to this joke programming language.

All the tears aside, let’s begin!

First of all, you can find the compiler for LOLCODE at aasgard.co.uk/misc/loljs or just search on Google. Now to begin with let me write a simple “hello world!” program since this is where we all begin with!

HAI
CAN HAS STDIO?
VISIBLE “hello world!!”
KTHXBYE

Okay, FIne. How about storing some data into variables? Well, here goes the code:
Let’s create a DAY variable and put “today is catday” into it.

HAI
I HAS A DAY ITZ “today is catday”
VISIBLE DAY
KTHXBYE

Here ITZ is equivalent to “=” or “assignment operator” in other programming languages.

Uhh.. What if its not catday? Let me ask the user to tell me what day is it! So to do it we’ll use GIMMEH to ask for input from stdin. But before initializing a stdin we need to create a variable to store the day users tells us.

HAI
I HAS A NEWDAY
GIMMEH NEWDAY
VISIBLE NEWDAY
KTHXBYE

Now, let’s take a step forward and print statements based on user’s inputs. So in this example I’m going to ask user what day is it? If the user replies catday than i’ll print out catday and if the input turns out to be something else than I’m going to say.. Noohhh I know u don’t love meh :’(
Lol, let’s see the code. Lolcode.

HAI
I HAS A NEWDAY
GIMMEH NEWDAY
BOTH SAEM NEWDAY AN “catday”, O RLY?
YA RLY
VISIBLE NEWDAY
NO WAI
VISIBLE “Noohh I know u don’t love meh :-(“
OIC
KTHXBYE

Now think that you’re a cat. Aren’t you? And your cat day has finally arrived! It’s time to celebrate by printing out the same statement multiple times without writing it again n again. (nor even using copy n paste, mind it. k?)

HAI
I HAS A COUNT
I HAS A MYDAY ITZ “huuuraaayyyyy daaaayyyyyy!!!”
IM IN YR LOOP
UPZ COUNT!!1
VISIBLE MYDAY
IZ COUNT BIGR THAN 5, GTFO, KTHX
IM OUTTA YR LOOP
KTHXBYE

Let’s understand this code a bit. The COUNT variable is going to count through the loop and begins from 1 goes to the 5 and ends with a polite statement “GTFO”. It’ll show us the output something as this:

1. huuuraaayyyyy daaaayyyyyy!!!
2. huuuraaayyyyy daaaayyyyyy!!!
3. huuuraaayyyyy daaaayyyyyy!!!
4. huuuraaayyyyy daaaayyyyyy!!!
5. huuuraaayyyyy daaaayyyyyy!!!

And as it reaches the end of the loop the statement will terminate and we’ll be kicked out from the loop with another generous statement, “KTHX”.

CONCLUSION

Might seem crazy post but you’ve (even I) just learned the basics of programming using LOLCODE and turned into a LOLCAT. Congratulations! We’ve just learned variables, conditions, loops and it makes easier to pickup other programming languages. Now go and get your hands dirty on other languages since this ain’t going to help you develop the most sophisticated funny software that you’re probably thinking in your head. (Sarcasm, okay?).

I HAS REFERENCES
  1. The Ultimate Language
  2. Wikipedia

If you liked this article, then comment and let us know and also give if any suggestions are there feel free to comment, also don’t forget to check our other blogs and subscribe us to get notified for our latest blogs and news. Donate to Malc0de.


Recommended Read

Leave A Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.