You know the Hello World program. It takes different numbers of "lines" of code in different languages, to execute instructions printing the text "
Hello World" to the screen. In C, for example, you had to #include "stdio.h" whereas in VB you just start printing.
I found out about INTERCAL, perhaps the most accurate, real world programming language of all.
Code:
DO ,1 <- #13
PLEASE DO ,1 SUB #1 <- #234
DO ,1 SUB #2 <- #112
DO ,1 SUB #3 <- #112
DO ,1 SUB #4 <- #0
DO ,1 SUB #5 <- #64
DO ,1 SUB #6 <- #194
DO ,1 SUB #7 <- #48
PLEASE DO ,1 SUB #8 <- #22
DO ,1 SUB #9 <- #248
Note that if you don't say "please," the compiler will think your code is rude, and not run it.
DO ,1 SUB #10 <- #168
DO ,1 SUB #11 <- #24
DO ,1 SUB #12 <- #16
DO ,1 SUB #13 <- #214
PLEASE READ OUT ,1
PLEASE GIVE UP
Anything the compiler doesn't understand, it ignores. Purists (
like me) say this is bad, because it makes finding the source of a bug very difficult. But, hey, it's easier to program like that. But this has the side effect that, if you want to comment your code, you just write stuff the compiler won't understand right into the code.
Some of the keywords are IGNORE, REMEMBER, FORGET, ABSTAIN. There can be modifiers, like PLEASE, MAYBE, and I think my favorite is that you can put a percentage at the end of a line of code - this becomes the chance that that line will be run. If you give an instruction followed by %50, that translates to 100 % chance of that line running. The XOR operator is coded as
? because, frankly, this is how most people react when exclusive or is explained to them. The MINGLE operator is represented as
$, naturally. ' is a spark, and " is (
are?) rabbit ears.
I prefer this style of code to
Malbolge (
named, appropriately, for the 8th layer of Hell in Dante's Inferno), whose Hello World is written as
Code:
(=<`:9876Z4321UT.-Q+*)M'&%$H"!~}|Bzy?=|{z]KwZY44Eq0/{mlk**
hKs_dG5[m_BA{?-Y;;Vb'rR5431M}/.zHGwEDCAA@98\6543W10/.R,+O<
Makes PHP not seem so bad!
