Several Ways to Congratulate a Programmer
Posted by Mariia Mykhailova on September 20, 2010- Hey, it's really Programmers' Day, - realized I about two hours prior to it coming. Then I imagined tomorrow's congratulations - boring commonplace phrases, not a bit different from things said on any other day. And I yearned for something professional, with zest in it! I got to work immediately, and here is the result. This article suggests several methods to represent any trivial greetings in a special way, with respect to our profession and this encyclopedia.
Method 1. Classic
The first thing that jumps to one's head when esoteric programming is mentioned is the infamous Brainfuck. The language is convenient for multiple reasons:
- it is famous, especially when compared to other esoteric languages;
- it has plenty interpreters, including on-line ones, while most esoteric languages are either not implemented or have one or two interpreters, which in turn require quite an effort to install and run them before ever starting coding in the actual language;
- it features particular simplicity and variability of the ways to output text messages;
- it ignores any characters of code except for 8 command ones, so the code can be formatted as one likes, concealed in ASCII-art or borders around some other text etc.
So, the simplest loop-less code to output "Happy Programmers' Day!" in Brainfuck looks like this:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++
++++++++++++++++++.+++++++++++++++..+++++++++.>++++++++++++++++++++++++++++++++.
<-----------------------------------------.++++++++++++++++++++++++++++++++++.--
-.--------.+++++++++++.-----------------.++++++++++++..--------.+++++++++++++.+.
>>+++++++++++++++++++++++++++++++++++++++.<.<-----------------------------------
------------.+++++++++++++++++++++++++++++.++++++++++++++++++++++++.>>------.
Looks not much fun, right? We can rearrange it like this:
+++++++++ ++++++++++ +++ +++ ++++++++++ +++ ++++++++ +++++++++ ++++++++++ +++++++.+ ++++++++
+++ +++ +++ +++ +++ +.+ +++ +++ +++ +++ ++. .++ +++ +++ +.> +++
+++ +++ +++ +++ +++ +++ +++ +++ +++ ++. <-- --- --- --- ---
--- --- ---------- --- --- -----.++++ +++ +++ +++ +++++++++ ++++++++++ ++.---.-- ------.+
+++ +++ ++++.----- --- --- ------.+++ +++ +++ +++ ..------ --.+++++++ ++++++.+ .>>+++++
+++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +.< .<-- ---
--- --- --- --- --- --- --- --- --- --- --- --- --- --- .++
+++++++++ ++++++++++ +++++ +++.++++++ +++++++++ ++++++++ +.> >------.++ +++ +++ ++++++++
If we take next most known esoteric language (popular mostly among esolangs addicts and inventors), Befunge, if also has a lot of ways to output a text message, but the simplest one is too evident to be of any interest at all: it's just the characters of the message in reverse order, taken in brackets of command characters:
0"!yaD 'sremmargorP yppaH">,:#<_@
Method 2. Dramatic
A popular way to greet someone is to create a themed piece of art - a poem, a fairy tale, whatever you have time and inspiration for. The best language to implement this is Shakespeare programming language. In it the code is represented as a play, the variables are named after Shakespeare characters, and the programmer might not be a playwright, but he must know the King's English :-) Because the more ornate and luxuriant the bunch of adjectives prior to a noun is, the larger is the numerical constant denoted with it, and all operations are described in variables' monologues. Outputting "congrats" in this fabulous language looks like this:
The Shakespeare-Style Congratulations
Ariel, the genie to store values of o,n,r,t,s
Caliban, the ugly creature to store values of c, g, a
Prospero, the hero to operate on them
Act I.
Scene I.
[Enter Prospero and Ariel]
Prospero:
You peaceful mighty proud handsome white-winged overweight overpraised overnice angel!
You are as good as the difference between you and an ill naughty crying underage child!
[Exit Ariel]
[Enter Caliban]
Prospero:
You are as ugly as the difference between Ariel and sum of his white fluffy wings and his bored smile!
Speak your mind!
[Exit Caliban]
[Enter Ariel]
Prospero:
Speak your mind.
You are as worried as the sum of you and a spider!
Speak your mind!
[Exit Ariel]
[Enter Caliban]
Prospero:
You are as disgusting as the sum of you and a drunken vomiting idiot.
Speak your mind!
[Exit Caliban]
[Enter Ariel]
Prospero:
You as as sweet as the sum of you and reddest royal roses.
Speak your mind.
[Exit Ariel]
[Enter Caliban]
Prospero:
You are as silent as the difference between you and the sum of your dirty feet and your unkempt greasy hair.
Speak your mind!
[Exit Caliban]
[Enter Ariel]
Prospero:
You are as prominent as the sum of you and a sparkling diamond.
Speak your mind.
You are as lovely as the sum of you and a guinea-pig.
Speak your mind!
[Exit Ariel]
Prospero:
What the hell is wrong about these guys walking here and there in silence?
[Exit Prospero]
Method 3. Magical
A little professional hocus-pocus to surprise your colleague is: run shell (for example, Bash), and type the following:
echo 1774767685848640863781394195195183398747095833456108183818P | dc
Unexpected, eh? This is so-called dc-magic, simple but quite unevident. dc is Desktop Calculator, a tool that allows to process arbitrary-precision numbers. In this case command P prints the preceding number, but (that's the trick!) as a string. To do this, the number is translated to hexadecimal format: 0x48617070792050726F6772616D6D6572732720446179210A broken into pairs of digits, and each pair of digits is printed as a character with corresponding ASCII-code.
Method 4. Cloak-and-dagger
People who don't own a printer have a language of their own - Whitespace. It is notable that an empty piece of paper from a Whitespace programmer can mean literally anything - from love letter to a cartel. This magnificent language understands not visible characters but blanks between them - spaces, tabs and line feeds. Thus, an uncommented code looks like a void document, and produces a blank piece of paper when printed.
Following is a code to output "congrats", in which spaces are replaced with S, and tabs with T. Squiggle brackets denote start and end of numbers (to improve readability), and last period delineates three new lines in the end of code.
SS{STTSSSTT}
T
SSSS{STTSTTTT}
T
SSSS{STTSTTTS}
T
SSSS{STTSSTTT}
T
SSSS{STTTSSTS}
T
SSSS{STTSSSST}
T
SSSS{STTTSTSS}
T
SSSS{STTTSSTT}
T
SASS{STATS}
T
SS
.
Method 5. Ornamental
Finally, there are plenty of ways to embed the message into an image - here are just a few of them.
Happy Programmers' Day as QR-code
Happy Programmers' Day in Brainloller
And what special methods of encoding messages do you know?