Much better! All that's left to do is deleting the first space of the first row (shifting all underscores in the first row one character left), moving the misplaced underscoredunderscores in E and C one row up and discarding the underscore over T.
Much better! All that's left to do is deleting the first space of the first row (shifting all underscores in the first row one character left), moving the misplaced underscored in E and C one row up and discarding the underscore over T.
Much better! All that's left to do is deleting the first space of the first row (shifting all underscores in the first row one character left), moving the misplaced underscores in E and C one row up and discarding the underscore over T.
Idea
Instead of encoding the MINECRAFT string (padded to achieve a constant line length) directly, we'll encode a "zipped" version of it, where rows and columns have been transposed.
After zipping and removing the linefeeds, this string (let's call it R) has to be encoded:
/ / / \ \ / / \ \ \ ||| ||| \ \ \ ||| |||_ -__ -_ | / \_ __ _ |||_ - _ - |\ \ / / /_ \_ \ \ |||_ - _ - _ _|||_ There are many runs of spaces, so we'll replace each occurrence of a space triplet with a linefeed.
This leaves us with seven different characters (\n -/\_|), so we assign each of them a number from 0 to 6 and consider the resulting array digits of a base 7 number, which we then encode as a byte string.
Decoding works by reversing the steps from above.
The mirrored string can be constructed from the original one.
If we reverse the order of the four rows and swap the soliduses, we obtain the following:
\ / | | /| |__ /__ | / \ / | | \ /\ / | | / | |-- | |--/ \__/ |-- | \/ \/ | |/ | | \ | | \/ | | __ __ __ __ ___ Somehow similar, but we'll clearly have to rotate the rows to bring the bottom row to the top:
__ __ __ __ ___ \ / | | /| |__ /__ | / \ / | | \ /\ / | | / | |-- | |--/ \__/ |-- | \/ \/ | |/ | | \ | | \/ | | That would be it if it wasn't for those pesky underscores.
If we read the original string from top to bottom and ignore linefeeds (thus obtaining R) and replace each underscore followed by space with a space followed by an underscore before shifting the rows, this is the result:
_ _ _ \ / | | /| |_ /_ | / \ __ / | | \ /\ / | | / | |-- | |--/ \ / |-- | \/ \/ | |/ | |__ \__ |__| \/ |__ _|_ Much better! All that's left to do is deleting the first space of the first row (shifting all underscores in the first row one character left), moving the misplaced underscored in E and C one row up and discarding the underscore over T.
Code
li2% e# Read an integer from STDIN and push its parity. "A+×rµ^ÅÆÿ»£ºoU#ü T^U^ÝZe<ÄÊKÞÒ£^ÛWWø5Úí§¹T^Úêer^^°^Ã}Ã^A0R2" 281b7b e# Convert the byte string from base 281 to base 7. "/\n -_\\|"f= e# Replace each digit by its corresponding character. N/S3** e# Turn linefeeds into three spaces. _ e# Copy the resulting string. "_ ":T e# Define T. /TW%* e# Replace occurrences of T with T reversed. 4/z e# Split into chunks of length 4 and zip. W%1m> e# Reverse and rotate the rows. N* e# Join the rows, separating by linefeeds. 1> e# Discard the first character. "\/"_W%er e# Swap the soliduses. "^W^]5OU" e# Push the string that corresponds to [23 29 53 79 85]. { e# For each character: i e# Push its code point. _32> e# Push 1 iff the code point is larger than 32. T= e# Select the element at that index from T = "_ ". t e# Replace the element at the code point's index with that char. }/ e# \ e# Swap the partially generated MINECARFT string on top. 4/z e# Split into chunks of length 4 and zip. N* e# Join the rows, separating by linefeeds. ? e# Select the first string iff the input was odd. Idea
Instead of encoding the MINECRAFT string (padded to achieve a constant line length) directly, we'll encode a "zipped" version of it, where rows and columns have been transposed.
After zipping and removing the linefeeds, this string (let's call it R) has to be encoded:
/ / / \ \ / / \ \ \ ||| ||| \ \ \ ||| |||_ -__ -_ | / \_ __ _ |||_ - _ - |\ \ / / /_ \_ \ \ |||_ - _ - _ _|||_ There are many runs of spaces, so we'll replace each occurrence of a space triplet with a linefeed.
This leaves us with seven different characters (\n -/\_|), so we assign each of them a number from 0 to 6 and consider the resulting array digits of a base 7 number, which we then encode as a byte string.
Decoding works by reversing the steps from above.
The mirrored string can be constructed from the original one.
If we reverse the order of the four rows and swap the soliduses, we obtain the following:
\ / | | /| |__ /__ | / \ / | | \ /\ / | | / | |-- | |--/ \__/ |-- | \/ \/ | |/ | | \ | | \/ | | __ __ __ __ ___ Somehow similar, but we'll clearly have to rotate the rows to bring the bottom row to the top:
__ __ __ __ ___ \ / | | /| |__ /__ | / \ / | | \ /\ / | | / | |-- | |--/ \__/ |-- | \/ \/ | |/ | | \ | | \/ | | That would be it if it wasn't for those pesky underscores.
If we read the original string from top to bottom and ignore linefeeds (thus obtaining R) and replace each underscore followed by space with a space followed by an underscore before shifting the rows, this is the result:
_ _ _ \ / | | /| |_ /_ | / \ __ / | | \ /\ / | | / | |-- | |--/ \ / |-- | \/ \/ | |/ | |__ \__ |__| \/ |__ _|_ Much better! All that's left to do is deleting the first space of the first row (shifting all underscores in the first row one character left), moving the misplaced underscored in E and C one row up and discarding the underscore over T.
Code
li2% e# Read an integer from STDIN and push its parity. "A+×rµ^ÅÆÿ»£ºoU#ü T^U^ÝZe<ÄÊKÞÒ£^ÛWWø5Úí§¹T^Úêer^^°^Ã}Ã^A0R2" 281b7b e# Convert the byte string from base 281 to base 7. "/\n -_\\|"f= e# Replace each digit by its corresponding character. N/S3** e# Turn linefeeds into three spaces. _ e# Copy the resulting string. "_ ":T e# Define T. /TW%* e# Replace occurrences of T with T reversed. 4/z e# Split into chunks of length 4 and zip. W%1m> e# Reverse and rotate the rows. N* e# Join the rows, separating by linefeeds. 1> e# Discard the first character. "\/"_W%er e# Swap the soliduses. "^W^]5OU" e# Push the string that corresponds to [23 29 53 79 85]. { e# For each character: i e# Push its code point. _32> e# Push 1 iff the code point is larger than 32. T= e# Select the element at that index from T = "_ ". t e# Replace the element at the code point's index with that char. }/ e# \ e# Swap the partially generated MINECARFT string on top. 4/z e# Split into chunks of length 4 and zip. N* e# Join the rows, separating by linefeeds. ? e# Select the first string iff the input was odd. CJam, 158 149 145145 138 bytes
0000000li2%"A+×rµ^ÅÆÿ»£ºoU#ü T^U^ÝZe<ÄÊKÞÒ£^ÛWWø5Úí§¹T^Úêer^^°^Ã}Ã^A0R2"281b7b"/ -_\|"f=N/S3**_"_ ":T/TW%*4/zW%1m>N*1>"\/"_W%er"^W^]5OU"{i_32>T=t}/\4/zN*? The above uses caret notation, since the code contains unprintable characters.
Try it online in the N*1>"\/"_W%er"5OU"{i_32>T=t}/\4/zN*?&input=1" rel="nofollow noreferrer">CJam interpreter.
If the permalink doesn't work in your browser, you can copy the code from this paste.
Example run
$ 6c69322522a56048270af9a48d98814c9ba9d8291ddc411cLANG=en_US $ xxd li2%".`H'......L...).-ps -r > minecraft.Acjam <<< 6c69322522412bd772b585c6ffbba3ba6f5523fc2054159d5a653cc4ca4bded2a39b5757f835daeda7b9549aea65721eb0837dc30130523222323831623762222f0a202d5f5c7c22663d4e2f53332a2a5f225f20223a542f5457252a342f7a5725316d3e4e2a313e225c2f225f5725657222171d354f55227b695f33323e543d747d2f5c342f7a4e2a3f $ cjam minecraft.cjam <<< 2; echo 0000018: 36faab6a55ea2f61babc6b8d1293109b4bee1fd229f93018 6..jU./a..k.....K...).0. __ __ __ __ ___ 0000030: 6540040c6fab97b369a22b2232363062376222200a5f2f5c /\ [email protected].+"260b7b" ._/\ 0000048: 7c2d22663d4e2f53322a2a35362f5f57257a7b22205f223a |-"f=N |\ | | /S2**56 | | /_W%z{"\ _": | | 0000060: 542f5457252a7d257a316d3e4e2a225c2f225f5725657222/ T\/TW%*}%z1m>N*"\ \ | | \ | |-- | |--\ /"_W%er"__\ |-- | 0000078:/ 17181d1e3650515657227b695f33323c543d747d2f5c4e2a ... \ | | \| |__ \__ | \ / \ | | $ cjam minecraft.6PQVW"{i_32<T=t}cjam <<< 1; echo __ __ \ /\N* | | /| | / | / \ __ / | | 0000090: 3f\ /\ / | | / | |-- | |--/ \ / |-- | \/ \/ | |/ | |__ \__ |__| ?\/ |__ _|_ Try it online in the [CJam interpreter][1].
If the permalink doesn't work in your browser, you can copy the code from [this paste][2].
[1]: http://cjam.aditsu.net/#code=li2%25%22%C2%A5%60H'%0A%C3%B9%C2%A4%C2%8D%C2%98%C2%81L%C2%9B%C2%A9%C3%98)%1D%C3%9CA%1C6%C3%BA%C2%ABjU%C3%AA%2Fa%C2%BA%C2%BCk%C2%8D%12%C2%93%10%C2%9BK%C3%AE%1F%C3%92)%C3%B90%18e%40%04%0Co%C2%AB%C2%97%C2%B3i%C2%A2%2B%22260b7b%22%20%0A_%2F%5C%7C-%22f%3DN%2FS2**56%2F_W%25z%7B%22%20_%22%3AT%2FTW%25*%7D%25z1m%3EN*%22%5C%2F%22_W%25er%22%17%18%1D%1E6PQVW%22%7Bi_32%3CT%3Dt%7D%2F%5CN*%3F&input=1 [2]: http://pastebin.com/kJas2pdN
CJam, 158 149 145 bytes
0000000: 6c69322522a56048270af9a48d98814c9ba9d8291ddc411c li2%".`H'......L...)..A. 0000018: 36faab6a55ea2f61babc6b8d1293109b4bee1fd229f93018 6..jU./a..k.....K...).0. 0000030: 6540040c6fab97b369a22b2232363062376222200a5f2f5c [email protected].+"260b7b" ._/\ 0000048: 7c2d22663d4e2f53322a2a35362f5f57257a7b22205f223a |-"f=N/S2**56/_W%z{" _": 0000060: 542f5457252a7d257a316d3e4e2a225c2f225f5725657222 T/TW%*}%z1m>N*"\/"_W%er" 0000078: 17181d1e3650515657227b695f33323c543d747d2f5c4e2a ....6PQVW"{i_32<T=t}/\N* 0000090: 3f ? Try it online in the [CJam interpreter][1].
If the permalink doesn't work in your browser, you can copy the code from [this paste][2].
[1]: http://cjam.aditsu.net/#code=li2%25%22%C2%A5%60H'%0A%C3%B9%C2%A4%C2%8D%C2%98%C2%81L%C2%9B%C2%A9%C3%98)%1D%C3%9CA%1C6%C3%BA%C2%ABjU%C3%AA%2Fa%C2%BA%C2%BCk%C2%8D%12%C2%93%10%C2%9BK%C3%AE%1F%C3%92)%C3%B90%18e%40%04%0Co%C2%AB%C2%97%C2%B3i%C2%A2%2B%22260b7b%22%20%0A_%2F%5C%7C-%22f%3DN%2FS2**56%2F_W%25z%7B%22%20_%22%3AT%2FTW%25*%7D%25z1m%3EN*%22%5C%2F%22_W%25er%22%17%18%1D%1E6PQVW%22%7Bi_32%3CT%3Dt%7D%2F%5CN*%3F&input=1 [2]: http://pastebin.com/kJas2pdN
CJam, 158 149 145 138 bytes
li2%"A+×rµ^ÅÆÿ»£ºoU#ü T^U^ÝZe<ÄÊKÞÒ£^ÛWWø5Úí§¹T^Úêer^^°^Ã}Ã^A0R2"281b7b"/ -_\|"f=N/S3**_"_ ":T/TW%*4/zW%1m>N*1>"\/"_W%er"^W^]5OU"{i_32>T=t}/\4/zN*? The above uses caret notation, since the code contains unprintable characters.
Try it online in the N*1>"\/"_W%er"5OU"{i_32>T=t}/\4/zN*?&input=1" rel="nofollow noreferrer">CJam interpreter.
If the permalink doesn't work in your browser, you can copy the code from this paste.
Example run
$ LANG=en_US $ xxd -ps -r > minecraft.cjam <<< 6c69322522412bd772b585c6ffbba3ba6f5523fc2054159d5a653cc4ca4bded2a39b5757f835daeda7b9549aea65721eb0837dc30130523222323831623762222f0a202d5f5c7c22663d4e2f53332a2a5f225f20223a542f5457252a342f7a5725316d3e4e2a313e225c2f225f5725657222171d354f55227b695f33323e543d747d2f5c342f7a4e2a3f $ cjam minecraft.cjam <<< 2; echo __ __ __ __ ___ /\ /\ | |\ | | / | | /\ | | / \/ \ | | \ | |-- | |--\ /__\ |-- | / \ | | \| |__ \__ | \ / \ | | $ cjam minecraft.cjam <<< 1; echo __ __ \ / | | /| | / | / \ __ / | | \ /\ / | | / | |-- | |--/ \ / |-- | \/ \/ | |/ | |__ \__ |__| \/ |__ _|_