Skip to main content
Commonmark migration
Source Link

Backhand, 6 5 bytes

I@-Ov

Try it online! Try it doubled!

Made a little complex due to the nature of the pointer in Backhand. I don't think it's possible to get any shorter haha, turns out I was wrong. This duplicates no instruction and reuses both the input, output and terminate commands between the two programs. Now I think it is optimal, since you need all of the IO-@ commands to work, and in a 4 byte program you can only execute two of those commands.

###Explanation:

Explanation:

The pointer in Backhand moves at three cells a tick and bounces off the boundaries of the cell, which means the general logic is overlapping. However you can manipulate this speed with the v and ^ commands.

The original program executes the instructions IO-@, which is input as number, output as number, subtract, terminate. Obviously the subtract is superfluous. In the code these are:

I@-Ov
^  ^    Reflect
  ^     Reflect again
 ^

The reversed program executes v-I-vO-@. The v reduces the pointer steps between ticks, and the - subtracts from the bottom of the stack, which is implicitly zero. The extra - commands do nothing. The program executes like

vO-@I
v       Reduce pointer speed to 2
  -     Subtract zero from zero
    I   Get input as number and reflect off boundary
  -     Subtract input from zero
v       Reduce pointer speed to 1
 O      Output as number
  -     Subtract zero from zero
   @    Terminate

Backhand, 6 5 bytes

I@-Ov

Try it online! Try it doubled!

Made a little complex due to the nature of the pointer in Backhand. I don't think it's possible to get any shorter haha, turns out I was wrong. This duplicates no instruction and reuses both the input, output and terminate commands between the two programs. Now I think it is optimal, since you need all of the IO-@ commands to work, and in a 4 byte program you can only execute two of those commands.

###Explanation:

The pointer in Backhand moves at three cells a tick and bounces off the boundaries of the cell, which means the general logic is overlapping. However you can manipulate this speed with the v and ^ commands.

The original program executes the instructions IO-@, which is input as number, output as number, subtract, terminate. Obviously the subtract is superfluous. In the code these are:

I@-Ov
^  ^    Reflect
  ^     Reflect again
 ^

The reversed program executes v-I-vO-@. The v reduces the pointer steps between ticks, and the - subtracts from the bottom of the stack, which is implicitly zero. The extra - commands do nothing. The program executes like

vO-@I
v       Reduce pointer speed to 2
  -     Subtract zero from zero
    I   Get input as number and reflect off boundary
  -     Subtract input from zero
v       Reduce pointer speed to 1
 O      Output as number
  -     Subtract zero from zero
   @    Terminate

Backhand, 6 5 bytes

I@-Ov

Try it online! Try it doubled!

Made a little complex due to the nature of the pointer in Backhand. I don't think it's possible to get any shorter haha, turns out I was wrong. This duplicates no instruction and reuses both the input, output and terminate commands between the two programs. Now I think it is optimal, since you need all of the IO-@ commands to work, and in a 4 byte program you can only execute two of those commands.

Explanation:

The pointer in Backhand moves at three cells a tick and bounces off the boundaries of the cell, which means the general logic is overlapping. However you can manipulate this speed with the v and ^ commands.

The original program executes the instructions IO-@, which is input as number, output as number, subtract, terminate. Obviously the subtract is superfluous. In the code these are:

I@-Ov
^  ^    Reflect
  ^     Reflect again
 ^

The reversed program executes v-I-vO-@. The v reduces the pointer steps between ticks, and the - subtracts from the bottom of the stack, which is implicitly zero. The extra - commands do nothing. The program executes like

vO-@I
v       Reduce pointer speed to 2
  -     Subtract zero from zero
    I   Get input as number and reflect off boundary
  -     Subtract input from zero
v       Reduce pointer speed to 1
 O      Output as number
  -     Subtract zero from zero
   @    Terminate

-1 byte
Source Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186

Backhand, 66 5 bytes

IOI@-O@IOv

Try it online!Try it online! Try it reversed!Try it doubled!

Made a little complex due to the nature of the pointer in Backhand. I don't think it's possible to get any shorter haha, turns out I was wrong. This duplicates no instruction and reuses both the input, output and terminate commands between the two programs. Now I don't think it's possible to get any shorterit is optimal, even thoughsince you need all of the commands IO-@ are duplicatedcommands to work, since 5 byte and less programs are very restrictivein a 4 byte program you can only execute two of those commands.

###Explanation:

The pointer in Backhand moves at three cells a tick and bounces off the boundaries of the cell, which means the general logic is overlapping. However you can manipulate this speed with the v and ^ commands.

The original program executes the instructions IO@IO-@, which is input as number, output as number, subtract, terminate. Obviously the subtract is superfluous. In the code these are:

IOI@-O@IOv
^  ^    Reflect
  ^     Reflect again
 ^

The reversed program executes v-I-O@vO-@, which are input. The v reduces the pointer steps between ticks, subtractand the - subtracts from the bottom of the stack (implicitly zero), output and terminatewhich is implicitly zero. These are:The extra - commands do nothing. The program executes like

I@OvO-OI@I
^v  ^    Reflect Reduce pointer speed to 2
 ^ - ^    Subtract zero from zero
    I   Get input as number and reflect off boundary
  -     Subtract input from zero
v       Reduce pointer speed to 1
 O      Output as number
  -     Subtract zero from zero
   @    Terminate

Backhand, 6 bytes

IO-O@I

Try it online! Try it reversed!

Made a little complex due to the nature of the pointer in Backhand. I don't think it's possible to get any shorter, even though the commands IO are duplicated, since 5 byte and less programs are very restrictive.

###Explanation:

The pointer in Backhand moves at three cells a tick and bounces off the boundaries of the cell, which means the general logic is overlapping.

The original program executes the instructions IO@, which is input as number, output as number, terminate. In the code these are:

IO-O@I
^  ^    Reflect
    ^

The reversed program executes I-O@, which are input, subtract from the bottom of the stack (implicitly zero), output and terminate. These are:

I@O-OI
^  ^    Reflect
 ^  ^

Backhand, 6 5 bytes

I@-Ov

Try it online! Try it doubled!

Made a little complex due to the nature of the pointer in Backhand. I don't think it's possible to get any shorter haha, turns out I was wrong. This duplicates no instruction and reuses both the input, output and terminate commands between the two programs. Now I think it is optimal, since you need all of the IO-@ commands to work, and in a 4 byte program you can only execute two of those commands.

###Explanation:

The pointer in Backhand moves at three cells a tick and bounces off the boundaries of the cell, which means the general logic is overlapping. However you can manipulate this speed with the v and ^ commands.

The original program executes the instructions IO-@, which is input as number, output as number, subtract, terminate. Obviously the subtract is superfluous. In the code these are:

I@-Ov
^  ^    Reflect
  ^     Reflect again
 ^

The reversed program executes v-I-vO-@. The v reduces the pointer steps between ticks, and the - subtracts from the bottom of the stack, which is implicitly zero. The extra - commands do nothing. The program executes like

vO-@I
v       Reduce pointer speed to 2
  -     Subtract zero from zero
    I   Get input as number and reflect off boundary
  -     Subtract input from zero
v       Reduce pointer speed to 1
 O      Output as number
  -     Subtract zero from zero
   @    Terminate

Source Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186

Backhand, 6 bytes

IO-O@I

Try it online! Try it reversed!

Made a little complex due to the nature of the pointer in Backhand. I don't think it's possible to get any shorter, even though the commands IO are duplicated, since 5 byte and less programs are very restrictive.

###Explanation:

The pointer in Backhand moves at three cells a tick and bounces off the boundaries of the cell, which means the general logic is overlapping.

The original program executes the instructions IO@, which is input as number, output as number, terminate. In the code these are:

IO-O@I
^  ^    Reflect
    ^

The reversed program executes I-O@, which are input, subtract from the bottom of the stack (implicitly zero), output and terminate. These are:

I@O-OI
^  ^    Reflect
 ^  ^