/o.z/#Q/
@in.*.L\
Cobalah online!
Tidak menghasilkan apa-apa (yang salah dalam mode Ordinal) atau Jabberwocky
(yang tidak kosong dan karenanya benar dalam mode Ordinal; ini juga merupakan nilai string kebenaran kanonik).
Penjelasan
/.../#./
....*..\
Ini adalah sedikit modifikasi dari kerangka umum untuk program mode ordinal linier. Di /
tengah digunakan untuk memiliki satu operator dalam mode Kardinal di antara (yang *
) dan kemudian kita perlu #
melewati itu dalam mode Ordinal dalam perjalanan kembali. Program linear adalah:
i..*.QLzno@
Mari kita lalui itu:
i Read all input as a string and push it to the stack.
.. Make two copies.
* This is run in Cardinal mode, so it implicitly converts the top two
copies to their integer value and multiplies them to compute the square.
. Implicitly convert the square back to a string and make a copy of it.
Q Reverse the stack to bring the input on top of the two copies of its square.
L Shortest common supersequence. This pops the input and the square from
the top of the stack and pushes the shortest string which begins with
the square and ends with the input. Iff the square already ends with the
input, this gives us the square, otherwise it gives us some longer string.
z Drop. Pop the SCS and the square. If the square contains the SCS (which
would mean they're equal), this removes everything up to the SCS from
the square. In other words, if the SCS computation left the square
unchanged, this gives us an empty string. Otherwise, it gives us back
the square.
n Logical not. Turns the empty string into "Jabberwocky" and everything
else into an empty string.
o Print the result.
@ Terminate the program.