Skip to main content
Commonmark migration
Source Link

#11. Befunge 98, 102 bytes

11. Befunge 98, 102 bytes

#11. Befunge 98, 102 bytes

11. Befunge 98, 102 bytes

added 102 characters in body
Source Link
MercyBeaucou
  • 3.1k
  • 13
  • 30

#11. Befunge 98, 102 bytes

#v;2^0;7||"<+0+0+0+<;n4
#v0#_q@
#>3N.
#|\w*
#8  ^1b0<
#|
#M`
print(None and 9or 1/2and 1or 5)
#jd5ki2

Prints:

To be perfectly honest, I have no clue why the Vim code takes 1 min to output. Also, no clue how Retina works.

Explanation:

#v          Skips the v, which would send the IP down
  ;         Unlike '93, where ; is a no-op, '98 skips to the next ;
            and doesn't execute anything in between
   2^0;     Not executed, unlike Befunge 93
       7|   Pushes 7 onto the stack, and then sends the IP up, because 7 is not 0
n0b1        n clears the stack, and #s are pushed until the stack is [0, 11, 1
    *.      multiplies the top 2 values of the stack to give 11, and prints it (yay!)
      _     Sends the IP right, because the top value of the stack is 0
       q    Ends the program (no-op for '93, which continues to @)

Things to note:

  • The 0 next to the b isn't strictly necessary in the code's current state, and the stack has been cleared. It can be removed if necessary, but allows for other stack manipulation beforehand as part of a possible future program.
  • The _q@ is there as part of Retina (It doesn't work without it, don't ask me why). The addition of q also lets the '98 code run a t operation, which splits the IP (along with making the Retina program print 8 instead of 7)
  • The _ is not a simple > because that would mess the SMBF part up.

Edit: Just realized that the _q@ should probably be @00 (Where 0s can be ~any char) to make the program more flexible in the future. I'm too lazy (and tired) to change all the links right now though. Will get around to it eventually...

Edit 2: I Didn't expect 6 more answers this quickly. I guess it's staying as is. Great job everyone!

#11. Befunge 98, 102 bytes

#v;2^0;7||"<+0+0+0+<;n4
#v0#_q@
#>3N.
#|\w*
#8  ^1b0<
#|
#M`
print(None and 9or 1/2and 1or 5)
#jd5ki2

Prints:

To be perfectly honest, I have no clue why the Vim code takes 1 min to output. Also, no clue how Retina works.

Explanation:

#v          Skips the v, which would send the IP down
  ;         Unlike '93, where ; is a no-op, '98 skips to the next ;
            and doesn't execute anything in between
   2^0;     Not executed, unlike Befunge 93
       7|   Pushes 7 onto the stack, and then sends the IP up, because 7 is not 0
n0b1        n clears the stack, and #s are pushed until the stack is [0, 11, 1
    *.      multiplies the top 2 values of the stack to give 11, and prints it (yay!)
      _     Sends the IP right, because the top value of the stack is 0
       q    Ends the program (no-op for '93, which continues to @)

Things to note:

  • The 0 next to the b isn't strictly necessary in the code's current state, and the stack has been cleared. It can be removed if necessary, but allows for other stack manipulation beforehand as part of a possible future program.
  • The _q@ is there as part of Retina (It doesn't work without it, don't ask me why). The addition of q also lets the '98 code run a t operation, which splits the IP (along with making the Retina program print 8 instead of 7)
  • The _ is not a simple > because that would mess the SMBF part up.

Edit: Just realized that the _q@ should probably be @00 (Where 0s can be ~any char) to make the program more flexible in the future. I'm too lazy (and tired) to change all the links right now though. Will get around to it eventually...

#11. Befunge 98, 102 bytes

#v;2^0;7||"<+0+0+0+<;n4
#v0#_q@
#>3N.
#|\w*
#8  ^1b0<
#|
#M`
print(None and 9or 1/2and 1or 5)
#jd5ki2

Prints:

To be perfectly honest, I have no clue why the Vim code takes 1 min to output. Also, no clue how Retina works.

Explanation:

#v          Skips the v, which would send the IP down
  ;         Unlike '93, where ; is a no-op, '98 skips to the next ;
            and doesn't execute anything in between
   2^0;     Not executed, unlike Befunge 93
       7|   Pushes 7 onto the stack, and then sends the IP up, because 7 is not 0
n0b1        n clears the stack, and #s are pushed until the stack is [0, 11, 1
    *.      multiplies the top 2 values of the stack to give 11, and prints it (yay!)
      _     Sends the IP right, because the top value of the stack is 0
       q    Ends the program (no-op for '93, which continues to @)

Things to note:

  • The 0 next to the b isn't strictly necessary in the code's current state, and the stack has been cleared. It can be removed if necessary, but allows for other stack manipulation beforehand as part of a possible future program.
  • The _q@ is there as part of Retina (It doesn't work without it, don't ask me why). The addition of q also lets the '98 code run a t operation, which splits the IP (along with making the Retina program print 8 instead of 7)
  • The _ is not a simple > because that would mess the SMBF part up.

Edit: Just realized that the _q@ should probably be @00 (Where 0s can be ~any char) to make the program more flexible in the future. I'm too lazy (and tired) to change all the links right now though. Will get around to it eventually...

Edit 2: I Didn't expect 6 more answers this quickly. I guess it's staying as is. Great job everyone!

Source Link
MercyBeaucou
  • 3.1k
  • 13
  • 30

#11. Befunge 98, 102 bytes

#v;2^0;7||"<+0+0+0+<;n4
#v0#_q@
#>3N.
#|\w*
#8  ^1b0<
#|
#M`
print(None and 9or 1/2and 1or 5)
#jd5ki2

Prints:

To be perfectly honest, I have no clue why the Vim code takes 1 min to output. Also, no clue how Retina works.

Explanation:

#v          Skips the v, which would send the IP down
  ;         Unlike '93, where ; is a no-op, '98 skips to the next ;
            and doesn't execute anything in between
   2^0;     Not executed, unlike Befunge 93
       7|   Pushes 7 onto the stack, and then sends the IP up, because 7 is not 0
n0b1        n clears the stack, and #s are pushed until the stack is [0, 11, 1
    *.      multiplies the top 2 values of the stack to give 11, and prints it (yay!)
      _     Sends the IP right, because the top value of the stack is 0
       q    Ends the program (no-op for '93, which continues to @)

Things to note:

  • The 0 next to the b isn't strictly necessary in the code's current state, and the stack has been cleared. It can be removed if necessary, but allows for other stack manipulation beforehand as part of a possible future program.
  • The _q@ is there as part of Retina (It doesn't work without it, don't ask me why). The addition of q also lets the '98 code run a t operation, which splits the IP (along with making the Retina program print 8 instead of 7)
  • The _ is not a simple > because that would mess the SMBF part up.

Edit: Just realized that the _q@ should probably be @00 (Where 0s can be ~any char) to make the program more flexible in the future. I'm too lazy (and tired) to change all the links right now though. Will get around to it eventually...