Why is Befunge code 9332682811> \ # +: # * 9 - # \ _ $. @Output 52256370?

Today I tried to make an account Esolangs.org , esoteric wiki programming languages . I used to participate in several wikis, and I had one or two small edits that I wanted to make.

... that is, until I saw the CAPTCHA validation puzzle used to create a new account.

Captcha puzzle for Esolangs.org

Using an obscure language for CAPTCHA was most likely intended as a stupid joke. However, I spent almost half an hour trying to understand the language in order to create a new account.

An excerpt from the tag for describes it as "the cross between Fort and Lemming." The Esolang Wiki says Belunge was specifically created "with the goal of compiling the most complex compilation possible." I finally gave up and used the online translator Befunge , which gave me the answer 52256370.

I do not understand why the conclusion 9332682811>\#+:#*9-#\_$.@is equal 52256370.

I saw some comments suggesting converting from base-10 to base-9. However, when I tried to verify by converting 9332682811using

+6
source share
1 answer

This program analyzes 332682811as an unsigned integer-9 and prints it in the base-10.

Befunge 2D- ( , ), , . , .

9332682811 Befunge, . :

Instructions              Meaning                                       Top stack values

9332682811>\#+:#*9-#\_$.@
          >               Set the instruction pointer to travel         a b
                          to the right.
           \              Swap the top 2 values on the stack.           b a
            #+            Nothing, since # means                        b a
                          skip the next instruction.
              :           Duplicate the top value on the stack.         b a a
                 9        Push 9.                                       b a a 9
                  -       Pop two values and push their difference.     b a (a-9)
                     _    Pop the top value and set the instruction     b a
                          pointer traveling right if the value is 0
                          or left otherwise.
                    \     Swap the top 2 values.                        a b
                 9        Push 9.                                       a b 9
                *         Pop two values and push their product.        a (b*9)
             +            Pop two values and push their sum.            (b*9 + a)
          >               Set the instruction pointer traveling
                          right again.

, 9, b a b*9 + a.

9, :

Instructions              Meaning                                       Top stack values

9332682811>\#+:#*9-#\_$.@
                     _    Pop the top value and set the instruction     b a
                          pointer traveling right if the value is 0
                          or left otherwise.
                      $   Discard the top value.                        b
                       .  Pop and print the top value.
                        @

, , a b b*9+a , 9, . .

If you try to verify this with another basic converter , make sure you understand it correctly. 332682811is a small drive, so you may need to cancel it.

+4
source

All Articles