/o.z/#Q/
@in.*.L\
在线尝试!
不输出任何内容(在“序数”模式下是虚假的)或Jabberwocky
(在“序数”模式下是非空的,因此是真值的;它也是规范的真值字符串值)。
说明
/.../#./
....*..\
这是对线性序数模式程序的通用框架的略微修改。在/
中间是用来在红衣主教模式单一运营商之间(的*
),然后我们需要#
跳过它在序模式在回来的路上。线性程序为:
i..*.QLzno@
让我们来看一下:
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.