Skip to main content
Post-fix
Source Link
Addison Crump
  • 11.3k
  • 1
  • 45
  • 91

Vitsy, 26 bytes

Expects inputs as 1s or 0s through STDIN with a newline separating.

W([1m;]'DCA'W)(Zr1+rZ
'BA'Z

I actually discovered a serious problem with if statements during this challenge. D: This is posted with the broken version, but it works just fine. (I'll update this after I fix the problem) Please note that I actually discovered a serious problemhave updated Vitsy with a fix of if statements during this challenge/ifnot. D: This is posted with the broken versionchange does not grant me any advantage, but it works just fineonly clarification. (I'll update this after I fix the problem)

Explanation:

W([1m;]'DCA'W)(Zr1+rZ
W                      Get one line from STDIN (evaluate it, if possible)
 ([1m;]                If not zero, go to the first index of lines of code (next line)
                       and then end execution.
       'DCA'           Push character literals "ACD" to the stack.
            W          Get another (the second) line from STDIN.
             )(         If not zero (this command is actually backwards at time of, posting)
                       do the next instruction.
              Z        Output all of the stack.
               r1+r    Reverse the stack, add one (will error out on input 0, 1), reverse.
                   Z   Output everything in the stack.

'BA'Z
'BA'                   Push character literals "AB" to the stack.
    Z                  Output everything in the stack.

Try it Online!Try it Online!

Vitsy, 26 bytes

Expects inputs as 1s or 0s through STDIN with a newline separating.

W([1m;]'DCA'W)Zr1+rZ
'BA'Z

I actually discovered a serious problem with if statements during this challenge. D: This is posted with the broken version, but it works just fine. (I'll update this after I fix the problem)

Explanation:

W([1m;]'DCA'W)Zr1+rZ
W                      Get one line from STDIN (evaluate it, if possible)
 ([1m;]                If not zero, go to the first index of lines of code (next line)
                       and then end execution.
       'DCA'           Push character literals "ACD" to the stack.
            W          Get another (the second) line from STDIN.
             )         If not zero (this command is actually backwards at time of posting)
                       do the next instruction.
              Z        Output all of the stack.
               r1+r    Reverse the stack, add one (will error out on input 0, 1), reverse.
                   Z   Output everything in the stack.

'BA'Z
'BA'                   Push character literals "AB" to the stack.
    Z                  Output everything in the stack.

Try it Online!

Vitsy, 26 bytes

Expects inputs as 1s or 0s through STDIN with a newline separating.

W([1m;]'DCA'W(Zr1+rZ
'BA'Z

I actually discovered a serious problem with if statements during this challenge. D: This is posted with the broken version, but it works just fine. (I'll update this after I fix the problem) Please note that I have updated Vitsy with a fix of if/ifnot. This change does not grant me any advantage, only clarification.

Explanation:

W([1m;]'DCA'W(Zr1+rZ
W                      Get one line from STDIN (evaluate it, if possible)
 ([1m;]                If not zero, go to the first index of lines of code (next line)
                       and then end execution.
       'DCA'           Push character literals "ACD" to the stack.
            W          Get another (the second) line from STDIN.
             (         If not zero, 
do the next instruction.
              Z        Output all of the stack.
               r1+r    Reverse the stack, add one (will error out on input 0, 1), reverse.
                   Z   Output everything in the stack.

'BA'Z
'BA'                   Push character literals "AB" to the stack.
    Z                  Output everything in the stack.

Try it Online!

Source Link
Addison Crump
  • 11.3k
  • 1
  • 45
  • 91

Vitsy, 26 bytes

Expects inputs as 1s or 0s through STDIN with a newline separating.

W([1m;]'DCA'W)Zr1+rZ
'BA'Z

I actually discovered a serious problem with if statements during this challenge. D: This is posted with the broken version, but it works just fine. (I'll update this after I fix the problem)

Explanation:

W([1m;]'DCA'W)Zr1+rZ
W                      Get one line from STDIN (evaluate it, if possible)
 ([1m;]                If not zero, go to the first index of lines of code (next line)
                       and then end execution.
       'DCA'           Push character literals "ACD" to the stack.
            W          Get another (the second) line from STDIN.
             )         If not zero (this command is actually backwards at time of posting)
                       do the next instruction.
              Z        Output all of the stack.
               r1+r    Reverse the stack, add one (will error out on input 0, 1), reverse.
                   Z   Output everything in the stack.

'BA'Z
'BA'                   Push character literals "AB" to the stack.
    Z                  Output everything in the stack.

Try it Online!