Today I tried to make an account on Esolangs.org, the esoteric programming languages wiki. I'd contributed to a few wikis before, and I had one or two minor page edits I wanted to contribute.
...that is, until I saw the CAPTCHA verification puzzle used to create a new account.
Using an obscure language for the CAPTCHA was most likely intended as a silly in-joke. However, I spent nearly half an hour trying to understand the language so I could create a new account.
Eventually I gave up and used an online Befunge interpreter, which gave me the answer 52256370
.
What I don't understand is why the output of 9332682811>\#+:#*9-#\_$.@
is 52256370
.
I've seen a few comments suggesting it's a conversion from base-10 to base-9. However, when I tried to verify by converting 9332682811
with an online base converter, I got a result of 26072072027
.
This program parses
332682811
as a little-endian base-9 integer and prints it in base-10.Befunge interprets instructions on a 2D grid (or torus, depending on version), with an instruction pointer that can move freely in two dimensions. This program is a one-liner, so the instruction pointer only moves forward and backward.
9332682811
pushes those digits individually onto Befunge's value stack, and then the following instructions perform a simple loop. In a normal iteration of the loop, things look like this:So unless the second value on the stack at the start of an iteration is 9, the iteration pops two values
b
anda
and pushesb*9 + a
.If the second value is 9, the loop terminates and prints the top value:
So, in summary, the program pushes a bunch of digits and repeatedly replaces
a
andb
withb*9+a
until it hits 9, the signal to stop. This is a base 9 converter.If you try to verify this with another base converter, make sure you get the endianness right.
332682811
is little-endian, so you may need to reverse it.