Skip to main content
added 1254 characters in body
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

CJam, 13 bytes (safe)

J{m!_)mQ%2b}/

[Try it online.][1]

Original output

000010010101001010001101111000111011100110100100001011101101010100011111110010010010001111111111010000010011001110001010011111000010001001110111100000010110000010000111011011110101110010000011100111100

Modified output

11101101100011110001011010000100111011000010011101100000001010100111011010011011010111101000000011101111100000000110001000111110110110101111110100101110000101110100110011110000010101110

Solution

J{m!_)ci%2b}/

[Try it online.][2]

How it works

This takes advantage of how CJam implicitly prints the entire stack after executing the program.

Simply dumping the base-2 representations of a few integers on the stack causes them to be printed without any separator, so it should be hard to figure out where one of them begins and another one ends.

The original code does the following:

J{   e# For each I from 0 to 18, do the following:
  m! e#   Calculate the factorial of I.
  _) e#   Push a copy and add 1.
  mQ e#   Compute the result's integer square root.
  %  e#   Calculate the residue of the factorial divided by the square root.
  2b e#   Push the array of base 2-digits of the resulting integer.
}/   e#

As @AndreaBiondo notes in the comments, the binary representations of 0! to 8! can be found at the beginning of the output (spaces added for clarity):

1 1 10 110 11000 1111000 1011010000 1001110110000 1001110110000000

The intended change was to replace mQ with ci, which takes the integer modulo 65536, using 16-bit character arithmetic (casting to an unsigned 16-bit character, then back to integer).

I hoped the idea of using c to replace a mathematical operator would be obscure enough.

[1]: http://cjam.aditsu.net/#code=J%7Bm!_)mQ%252b%7D%2F [2]: http://cjam.aditsu.net/#code=J%7Bm!_)ci%252b%7D%2F

CJam, 13 bytes (safe)

J{m!_)mQ%2b}/

[Try it online.][1]

Original output

000010010101001010001101111000111011100110100100001011101101010100011111110010010010001111111111010000010011001110001010011111000010001001110111100000010110000010000111011011110101110010000011100111100

Modified output

11101101100011110001011010000100111011000010011101100000001010100111011010011011010111101000000011101111100000000110001000111110110110101111110100101110000101110100110011110000010101110

Solution

J{m!_)ci%2b}/

[Try it online.][2]

[1]: http://cjam.aditsu.net/#code=J%7Bm!_)mQ%252b%7D%2F [2]: http://cjam.aditsu.net/#code=J%7Bm!_)ci%252b%7D%2F

CJam, 13 bytes (safe)

J{m!_)mQ%2b}/

[Try it online.][1]

Original output

000010010101001010001101111000111011100110100100001011101101010100011111110010010010001111111111010000010011001110001010011111000010001001110111100000010110000010000111011011110101110010000011100111100

Modified output

11101101100011110001011010000100111011000010011101100000001010100111011010011011010111101000000011101111100000000110001000111110110110101111110100101110000101110100110011110000010101110

Solution

J{m!_)ci%2b}/

[Try it online.][2]

How it works

This takes advantage of how CJam implicitly prints the entire stack after executing the program.

Simply dumping the base-2 representations of a few integers on the stack causes them to be printed without any separator, so it should be hard to figure out where one of them begins and another one ends.

The original code does the following:

J{   e# For each I from 0 to 18, do the following:
  m! e#   Calculate the factorial of I.
  _) e#   Push a copy and add 1.
  mQ e#   Compute the result's integer square root.
  %  e#   Calculate the residue of the factorial divided by the square root.
  2b e#   Push the array of base 2-digits of the resulting integer.
}/   e#

As @AndreaBiondo notes in the comments, the binary representations of 0! to 8! can be found at the beginning of the output (spaces added for clarity):

1 1 10 110 11000 1111000 1011010000 1001110110000 1001110110000000

The intended change was to replace mQ with ci, which takes the integer modulo 65536, using 16-bit character arithmetic (casting to an unsigned 16-bit character, then back to integer).

I hoped the idea of using c to replace a mathematical operator would be obscure enough.

[1]: http://cjam.aditsu.net/#code=J%7Bm!_)mQ%252b%7D%2F [2]: http://cjam.aditsu.net/#code=J%7Bm!_)ci%252b%7D%2F

added 124 characters in body
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

CJam, 13 bytes (safe)

J{m!_)mQ%2b}/

[Try it online.][1]

Original output

000010010101001010001101111000111011100110100100001011101101010100011111110010010010001111111111010000010011001110001010011111000010001001110111100000010110000010000111011011110101110010000011100111100

Modified output

11101101100011110001011010000100111011000010011101100000001010100111011010011011010111101000000011101111100000000110001000111110110110101111110100101110000101110100110011110000010101110

Solution

J{m!_)ci%2b}/

[Try it online.][2]

[1]: http://cjam.aditsu.net/#code=J%7Bm!_)mQ%252b%7D%2F [2]: http://cjam.aditsu.net/#code=J%7Bm!_)ci%252b%7D%2F

CJam, 13 bytes

J{m!_)mQ%2b}/

[Try it online.][1]

Original output

000010010101001010001101111000111011100110100100001011101101010100011111110010010010001111111111010000010011001110001010011111000010001001110111100000010110000010000111011011110101110010000011100111100

Modified output

11101101100011110001011010000100111011000010011101100000001010100111011010011011010111101000000011101111100000000110001000111110110110101111110100101110000101110100110011110000010101110

[1]: http://cjam.aditsu.net/#code=J%7Bm!_)mQ%252b%7D%2F

CJam, 13 bytes (safe)

J{m!_)mQ%2b}/

[Try it online.][1]

Original output

000010010101001010001101111000111011100110100100001011101101010100011111110010010010001111111111010000010011001110001010011111000010001001110111100000010110000010000111011011110101110010000011100111100

Modified output

11101101100011110001011010000100111011000010011101100000001010100111011010011011010111101000000011101111100000000110001000111110110110101111110100101110000101110100110011110000010101110

Solution

J{m!_)ci%2b}/

[Try it online.][2]

[1]: http://cjam.aditsu.net/#code=J%7Bm!_)mQ%252b%7D%2F [2]: http://cjam.aditsu.net/#code=J%7Bm!_)ci%252b%7D%2F

Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

CJam, 13 bytes

J{m!_)mQ%2b}/

[Try it online.][1]

Original output

000010010101001010001101111000111011100110100100001011101101010100011111110010010010001111111111010000010011001110001010011111000010001001110111100000010110000010000111011011110101110010000011100111100

Modified output

11101101100011110001011010000100111011000010011101100000001010100111011010011011010111101000000011101111100000000110001000111110110110101111110100101110000101110100110011110000010101110

[1]: http://cjam.aditsu.net/#code=J%7Bm!_)mQ%252b%7D%2F