LOLCODE C++ Header

I have created a C++ header that contains #define preprocessor commands to allow you to program in something very much like LOLCODE by Adam Lindsay, using normal C++ compilers. I tried to keep to the accepted specifications for LOLCODE where possible, but the two languages have some differences that made it impossible to create perfect equivalents in all cases. I also included definitions for C++ features like classes, so this implementation of LOLCODE is object-oriented. Up to this point, most of the development surrounding LOLCODE has been focused on simple text based programs, and as far as I know, there is very little support for much else. This opens the door for LOLCODE users to access all the libraries, functions, etc. designed for C or C++.

LOLCODE Header file v1.0

This code is released under the BSD License. Please contact me to discuss any other license arrangements.

Example code:

#include "lolcode.h"

OHHAI
HAI
	I HAS A NUMBR CALLED VAR R 5 K
	I HAS A NUMBR CALLED LIST THISBIG 10 WOW K
	VISIBLE "OH HAI WORLD!\n" KDONE
	VISIBLE "O BTW VAR R %i\n" ALSO VAR KDONE
	I HAS A NUMBR CALLED COUNT R 0 K

	IM IN YR LOOP
		IZ COUNT LIEK 10 ORLY
		YARLY
			OKBYE
		NOWAI
			LOL LIST WHICH COUNT OKAI R rand WIF DONE LEFTOVRZ 10 UP 1 K
			COUNT UPD K
		KTHX
	KTHX

	VISIBLE "NUMBRS FROM 1 TO 10 K?\n" KDONE
	LOL COUNT R 0 K
	IM IN YR LOOP
		IZ COUNT LIEK 10 ORLY
		YARLY
			OKBYE
		NOWAI
			VISIBLE "LIST #%i R %i\n" ALSO COUNT ALSO LIST WHICH COUNT OKAI KDONE
			COUNT UPD K
		KTHX
	KTHX

	FOUNDYR 0 MKAY
KTHXBYE
Advertisements
%d bloggers like this: