A night full of tears and code that was tickling
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!
CAN HAS STDIO?
VISIBLE “hello world!!”
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.
I HAS A DAY ITZ “today is catday”
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.
I HAS A NEWDAY
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.
I HAS A NEWDAY
BOTH SAEM NEWDAY AN “catday”, O RLY?
VISIBLE “Noohh I know u don’t love meh :-(“
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?)
I HAS A COUNT
I HAS A MYDAY ITZ “huuuraaayyyyy daaaayyyyyy!!!”
IM IN YR LOOP
IZ COUNT BIGR THAN 5, GTFO, KTHX
IM OUTTA YR LOOP
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”.
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
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.
- How to use theHarvester for Reconnaissance in Kali Linux
- How to Utilize Load Balancing in RHEL7
- 5 Phases of Ethical Hacking or Penetration Testing
- How to use CeWL tool in Kali Linux for Wordlist Generation?
- Top 15 must-know CLI commands for every Linux user.
- 4 Ways Big Businesses Can Protect Their Data