Weirdest Practical Programming Language

How 'bout I make that harder for you.


 HAI
 CAN HAS STDIO?
 PLZ OPEN FILE "LOLCATS.TXT"?
     AWSUM THX
         VISIBLE FILE
     O NOES
         INVISIBLE "ERRROR!"
 KTHXBYE


HAI
CAN HAS STDIO?
I HAS A VAR
IM IN YR LOOP
   UP VAR!!1
   VISIBLE VAR
   IZ VAR BIGGER THAN 10? KTHX
IM OUTTA YR LOOP
KTHXBYE

Wow never seen LOLCODE before.

Strangely it is quite readable, I guess it prints 1 to 10?

Amazing! :slight_smile:

1-11 I think. The >10 check happens after the increment and print.

It seems like it checks to see if the variable is greater than 10, then it gets out of the method.

Yes. [icode]KTHX[/icode] seems to be like the [icode]break[/icode] in java… translated into java that code looks like this (with never ever having known LOLCODE before…):


// HAI
// sth. like #include<stdio.h>
int var = 0;
while (true) {
    var++;
    System.out.println(var);
    if (var > 10) break;
}
// KTHXBYE

Somewhere near that.
The other one is this maybe:


// HAI
// again, #include<stdio.h>
File file = new File("LOLCATS.TXT");
if (file.isReadable()) {
    System.out.println(/* files content actually */ file);
} else {
    System.err.println("ERRROR!");
}
// KTHXBYE

Yes. [icode]KTHX[/icode] seems to be like the [icode]break[/icode] in java… translated into java that code looks like this (with never ever having known LOLCODE before…):


// HAI
// sth. like #include<stdio.h>
int var = 0;
while (true) {
    var++;
    System.out.println(var);
    if (var > 10) break;
}
// KTHXBYE

Somewhere near that.
The other one is this maybe:


// HAI
// again, #include<stdio.h>
File file = new File("LOLCATS.TXT");
if (file.isReadable()) {
    System.out.println(/* files content actually */ file);
} else {
    System.err.println("ERRROR!");
}
// KTHXBYE

I think that HAI maybe just defines that it is a file? I can’t see it being the starting point because in the hello world example it says [icode]CAN HAS STDIO?[/icode] which would obviously equate to [icode]#include <stdio.h>[/icode]. So I don’t actually know what HAI is anymore.

HAI

Yeah. I think it’s just that the author thought it’s more funny.
KTHXBYE

[icode]HAI[/icode] is like the opening of the program, all LOLCODE words represent pretty much there meaning

HAI - hello, like a new coversation
CAN HAS - Can I have
KTHXBYE - Ok i am done now, thanks bye
AWSUM THX - it returned true, in this case, the file “LOLCATS.txt” was found
O NOES - something returned false - in this case, the file “LOLCATS.txt” was invalid
VISIBLE - make this visible for the user
INVISIBLE - like a System.out.println(); in your code for debugging purposes

in other words, try and translate it to engligh
before


HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE

translated


new program
import STDIO
display message box "HAI WORLD"
terminate program.

I think that HAI maybe just defines that it is a file? I can’t see it being the starting point because in the hello world example it says [icode]CAN HAS STDIO?[/icode] which would obviously equate to [icode]#include <stdio.h>[/icode]. So I don’t actually know what HAI is anymore.

HAI

Yeah. I think it’s just that the author thought it’s more funny.
KTHXBYE

[icode]HAI[/icode] is like the opening of the program, all LOLCODE words represent pretty much there meaning

HAI - hello, like a new coversation
CAN HAS - Can I have
KTHXBYE - Ok i am done now, thanks bye
AWSUM THX - it returned true, in this case, the file “LOLCATS.txt” was found
O NOES - something returned false - in this case, the file “LOLCATS.txt” was invalid
VISIBLE - make this visible for the user
INVISIBLE - like a System.out.println(); in your code for debugging purposes

in other words, try and translate it to engligh
before


HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE

translated


new program
import STDIO
display message box "HAI WORLD"
terminate program.