|>I|
Cobalah online!
Coba terbalik!
Ini berfungsi untuk input apa pun yang tidak mengandung byte nol.
Penjelasan
Wow, saya telah mencapai titik di mana saya menulis ini dengan tangan ...
Program lengkapnya adalah |>I|I<|
.
| Reverse the entire stack down to the EOF marker -1 (since there are no zeros in the input).
> Move one stack over to the right (which only contains zeros).
I Does nothing on zero.
| Does nothing on zero.
I Does nothing on zero.
< Move back to the initial stack.
| Reverse the input once more.
Seperti dalam solusi untuk tantangan sebelumnya, karena perintah pusat |
tidak melakukan apa pun, demikian pula seluruh program.
Program yang terbalik itu |I>|<I|
.
| Reverse the entire stack down to the EOF marker -1 (since there are no zeros in the input).
I Move the -1 one stack to the left and turn it into a +1.
> Move back to the initial stack.
| Reverse it again, but this time without the EOF marker.
< Move back to the left.
I Move the +1 back onto the initial stack and turn it into a -1 again.
| Reverse the entire stack. We now have the -1 as an EOF marker again at the bottom
and the rest of the stack has been reversed three times, i.e. one net reversal.
Menariknya, jika kita menggunakan program pembalikan ini tanpa -m
kita masih mendapatkan solusi yang berfungsi saat ini, sehingga satu-satunya byte tambahan yang ditimbulkan oleh penghilangan -m
adalah yang kita dapatkan dari mirroring the code.
|I<|>I|
Cobalah online!
Coba terbalik!
Penjelasan
Versi terbalik dari program ini adalah |I>|<I|
, sama seperti di atas sehingga kita dapat mengabaikannya. Tetapi versi non-terbalik berbeda. Karena <>
titik sekarang sebaliknya, perintah pusat akhirnya tidak melakukan apa-apa, sehingga program menjadi kucing:
| Reverse the entire stack down to the EOF marker -1 (since there are no zeros in the input).
I Move the -1 one stack to the left and turn it into a +1.
< Move another stack to the left, which contains only zeros.
| Does nothing on zero.
Dan dengan demikian, >I|
justru membatalkan paruh pertama program.