6
$\begingroup$

(This puzzle relies on familiarity with MathJax, the mathematics renderer that is automatically available for use in answers here at Puzzling Stack Exchange. Examples and more information can be found in related puzzles.)


[Spejlet] fór dem ud af hænderne og styrtede ned mod jorden, hvor det gik i hundrede millioner, billioner og endnu flere stykker, ...
               — from Snedronningen (The Snow Queen) by Hans Christian Andersen

The $\small\texttt{\mirror} \raise2.5ex\strut$ code flew out of their hands and crashed to earth, where it broke into hundreds of millions, billions and even —well, actually just fifteen in all — pieces:

\mirror\mirror\mirror{}%#1#1#1#2#2

      $$\require{begingroup}\begingroup\def|look|\endgroup$$

               — translated to MathJax


Please help fit these pieces back together, like a jigsaw puzzle, for a reflective result:

$$|look|kool| \huge\raise-.5ex\strut$$

Spaces and multiple lines are allowed. For a hint and a half, see Davide Cervone’s solution to MathJax reflex. Your browser page might need to be reloaded in order to reset MathJax after errors while testing. A solution should render the result and need not display the assemblage.

$\endgroup$
8
$\begingroup$

$$\require{begingroup}\begingroup
\def\mirror#1#2
{
#1\mirror#2
%
#1}
\mirror|look|
\endgroup$$


$$\require{begingroup}\begingroup \def\mirror#1#2 { #1\mirror#2 % #1} \mirror|look| \endgroup$$


Trace, with $\, \raise-.4ex{\unicode{8629}} \:$ for line breaks: $$\require{begingroup}\begingroup \def \Type #1#2#3{ \def \Typf % ##1#1##2#1%\Typf##3{\texttt{##1}##3\Typf % ##2#1%\Typf{##3}} \Typf % #3#1%\Typf{#2}#1%\Typf% } \def \RETURN #1 #2\strut{ \texttt{#1} & \kern-1em \Type { } {\kern.3em\raise-.4ex{\unicode{8629}}\kern.2em} { #2} \\[.5ex] \normalsize #1 #2\strut } % \def\mirror#1#2 { & \kern-2em \texttt{\mirror} \, \underline { \texttt {#1} \tiny\strut } \, \underline{ \texttt{#2} \tiny\strut } & \longrightarrow & \RETURN #1\mirror#2 % #1} \small\begin{array}{lrcrl} \mirror|look| \strut \end{array} \endgroup$$

$\endgroup$
  • 1
    $\begingroup$ $|hur|rah|\kern.1em ! ~$ Mind if I add a live trace that renders like this? $\endgroup$ – humn Sep 5 '16 at 18:32
  • $\begingroup$ @humn Not at all! $\endgroup$ – Robin Houston Sep 6 '16 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.