Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

2 fixed grammar

Stack Cats, 3 + 3 (-n) = 6 bytes

-*-


Try it online!

Needs the -n flag to work with numeric input and output.

Explanation

Stack Cats is usually far from competitive, because of it'sits limited set of commands (all of which are injections, and most of which are involutions) and because every program needs to have mirror symmetry. However, one of the involutions is to toggle the least-significant bit of a number, and we can offset the value with unary negation which also exists. Luckily, that gives us a symmetric program, so we don't need to worry about anything else:

-   Multiply the input by -1.
*   Toggle the least significant bit of the value (i.e. take it XOR 1).
-   Multiply the result by -1.


Input and output are implicit at the beginning and end of the program, because taking input and producing output is not a reversible operation, so they can't be commands.

Stack Cats, 3 + 3 (-n) = 6 bytes

-*-


Try it online!

Needs the -n flag to work with numeric input and output.

Explanation

Stack Cats is usually far from competitive, because of it's limited set of commands (all of which are injections, and most of which are involutions) and because every program needs to have mirror symmetry. However, one of the involutions is to toggle the least-significant bit of a number, and we can offset the value with unary negation which also exists. Luckily, that gives us a symmetric program, so we don't need to worry about anything else:

-   Multiply the input by -1.
*   Toggle the least significant bit of the value (i.e. take it XOR 1).
-   Multiply the result by -1.


Input and output are implicit at the beginning and end of the program, because taking input and producing output is not a reversible operation, so they can't be commands.

Stack Cats, 3 + 3 (-n) = 6 bytes

-*-


Try it online!

Needs the -n flag to work with numeric input and output.

Explanation

Stack Cats is usually far from competitive, because of its limited set of commands (all of which are injections, and most of which are involutions) and because every program needs to have mirror symmetry. However, one of the involutions is to toggle the least-significant bit of a number, and we can offset the value with unary negation which also exists. Luckily, that gives us a symmetric program, so we don't need to worry about anything else:

-   Multiply the input by -1.
*   Toggle the least significant bit of the value (i.e. take it XOR 1).
-   Multiply the result by -1.


Input and output are implicit at the beginning and end of the program, because taking input and producing output is not a reversible operation, so they can't be commands.

1

Stack Cats, 3 + 3 (-n) = 6 bytes

-*-


Try it online!

Needs the -n flag to work with numeric input and output.

Explanation

Stack Cats is usually far from competitive, because of it's limited set of commands (all of which are injections, and most of which are involutions) and because every program needs to have mirror symmetry. However, one of the involutions is to toggle the least-significant bit of a number, and we can offset the value with unary negation which also exists. Luckily, that gives us a symmetric program, so we don't need to worry about anything else:

-   Multiply the input by -1.
*   Toggle the least significant bit of the value (i.e. take it XOR 1).
-   Multiply the result by -1.


Input and output are implicit at the beginning and end of the program, because taking input and producing output is not a reversible operation, so they can't be commands.