LOLCODE : The latest Gem to Programming

Status
Not open for further replies.

Zeeshan Quireshi

C# Be Sharp !
LOLCODE Website said:
Programming the LOL way.
All LOLCats, LOL, ALL CAPS.
*farm2.static.flickr.com/1292/531257569_5eb7850973_o.jpg

Examples :

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

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

FILEZORZ said:
HAI
CAN HAS STDIO?
PLZ OPEN FILE "LOLCATS.TXT"?
AWSUM THX
VISIBLE FILE
O NOES
INVISIBLE "ERROR!"
KTHXBYE
THe Last one had me in splits
*farm1.static.flickr.com/217/510658461_afdbb73060_o.gif*farm1.static.flickr.com/217/510658461_afdbb73060_o.gif*farm1.static.flickr.com/217/510658461_afdbb73060_o.gif
 
OP
Zeeshan Quireshi

Zeeshan Quireshi

C# Be Sharp !
CINTEL ENTRINO said:
can sum1 translate that to ordinary english so that we may hav a laugh too...... !?!

LOLCODE to Read a file :
Code:
[COLOR="Navy"]HAI
CAN HAS STDIO?
PLZ OPEN FILE "LOLCATS.TXT"?
	AWSUM THX
		VISIBLE FILE
	O NOES
		INVISIBLE "ERROR!"
KTHXBYE[/COLOR]

Notes:
  • PLZ … ? introduces a try/exception block
  • AWSUM THX introduces the block to execute on success with PLZ. It is implicitly closed by…
  • O NOES, which is the exception block. It should be closed with KTHX, but it hits the final KTHXBYE, which (I assert) is a bit of syntactic sugar that closes everything.
  • OPEN handles non-default-terminal-based I/O. FILE in this case is simply a variable, a file handle for the LOLCATS.TXT file.
  • INVISIBLE is a print command to the debug console, commonly known as STDERR.

C++ Equivalent:
Code:
[COLOR="Navy"]#include<iostream>
#include<fstream>

using namespace std;

int main()
{
  ifstream fin;
  fin.open("LOLCATS.TXT");
  if(fin)
      //Code to go through file n print it
  else
     cout << "Error !";
}[/COLOR]
 
Status
Not open for further replies.
Top Bottom