richardoneill.com.au » Articles » My LOLCode Interpreter

My LOLCode Interpreter

31 October 2007 Programming, PHP

LOLCode Book

I had 2 hours to kill so I thought I'd write a LOLCode interpreter.

I know there's already a few LOLCode interpreters around, but I couldn't help myself. Plus I've always been interested in interpreter design.

It's still a work in progress at this stage, so a lot of the language hasn't been fully implemented.

Here are two working programs...

Hello World


BTW the classic hello world program
HAI
VISIBLE "Hello world!"
KTHXBAI

Output:

LOLCode Hello World

Accepting User Input


HAI
VISIBLE "Hello there, what is your name?!"
I HAS A NAME ""

BTW ask for the users name
GIMMEH NAME

BTW welcome the user
VISIBLE "Welcome to LOLCode " N NAME N "!"
KTHXBAI

Output:

LOLCode Accepting User Input

Comment on this article
Name
Website
Canberra Web Design