Using
\Corners
Using
\RoundCorners
Using
\TransparentBlocks
Using
\Diagonals
Using
\BlackTriangles
Using
\OpenTriangles
Using
\Paths
.Using
\RedDots
. This is as close to being able to render in MathJaxhighlights the paths from the two sidesone "side" of the line that forms the dragon line. It isn't perfect, but gives you an ideaUsing
\RedBlueDots
. This makes dotted paths along both sets of what is happeningpaths, one set colored red, the other blue.
$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Some utility functions:
%
%
% Make a large rectangle to surround the dragon.
%
\def\Board#1#2{\bbox[border:1px solid black]{\hskip#1ex\Rule{0ex}{#2ex}{0ex}}}
%
% Place a letter at the right location on the board.
%
\def\Place#1#2#3{\smash{\rlap{\hskip #1ex\raise{#2ex}{#3}}}}
%
% Place a marker with a given color at the correct place.
%
%\def\Marker#1#2#3{\Place{#2}{#3}{\color{#1}{\kern-2.25pt\raise.25pt\bigcirc}}} % for \small
%\def\Marker#1#2#3{\Place{#2}{#3}{\color{#1}{\kern2.1pt\raise.5pt\bigcirc}}} % for \tiny
\def\Marker#1#2#3{} % don't put in markers -- comment out to show them
%
% The shape of the corners
%
\def\Corners{
\def\SEs{\kern.47ex\Rule{.06ex}{.53ex}{0ex}\raise.47ex{\Rule{.47ex}{.06ex}{0ex}}}
\def\SWs{\raise.47ex{\Rule{.47ex}{.06ex}{0ex}}\Rule{.06ex}{.53ex}{0ex}}
\def\NEn{\kern.47ex\raise.47ex{\Rule{.06ex}{.53ex}{0ex}\Rule{.47ex}{.06ex}{0ex}}}
\def\NWn{\raise.47ex{\Rule{.47ex}{.06ex}{0ex}\Rule{.06ex}{.53ex}{0ex}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\HalfBlocks{
\def\SEs{\kern.47ex\Rule{.53ex}{.53ex}{0ex}}
\def\SWs{\Rule{.53ex}{.53ex}{0ex}}
\def\NEn{\kern.47ex\raise.47ex{\Rule{.53ex}{.53ex}{0ex}}}
\def\NWn{\raise.47ex{\Rule{.53ex}{.53ex}{0ex}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\TwoThirdBlocks{
\def\SEs{\kern.33ex\Rule{.67ex}{.67ex}{0ex}}
\def\SWs{\Rule{.67ex}{.67ex}{0ex}}
\def\NEn{\kern.33ex\raise.33ex{\Rule{.67ex}{.67ex}{0ex}}}
\def\NWn{\raise.33ex{\Rule{.67ex}{.67ex}{0ex}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\FullBlocks{
\def\SEs{\Rule{1ex}{1ex}{0ex}}
\let\SWs=\SEs \let\NWn=\SEs \let\NEw=\SEs
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\ColoredBlocks{
\def\SEs{\kern.47ex\color{red}{\Rule{.53ex}{.53ex}{0ex}}}
\def\SWs{\color{blue}{\Rule{.53ex}{.53ex}{0ex}}}
\def\NEn{\kern.47ex\raise.47ex{\color{green}{\Rule{.53ex}{.53ex}{0ex}}}}
\def\NWn{\raise.47ex{\color{orange}{\Rule{.53ex}{.53ex}{0ex}}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\ColoredTwoThirdBlocks{
\def\SEs{\kern.33ex\color{red}{\Rule{.67ex}{.67ex}{0ex}}}
\def\SWs{\color{blue}{\Rule{.67ex}{.67ex}{0ex}}}
\def\NEn{\kern.33ex\raise.33ex{\color{green}{\Rule{.67ex}{.67ex}{0ex}}}}
\def\NWn{\raise.33ex{\color{orange}{\Rule{.67ex}{.67ex}{0ex}}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\ColoredFullBlocks{
\def\SEs{\color{red}{\Rule{1ex}{1ex}{0ex}}}
\def\SWs{\color{blue}{\Rule{1ex}{1ex}{0ex}}}
\def\NEn{\color{green}{\Rule{1ex}{1ex}{0ex}}}
\def\NWn{\color{orange}{\Rule{1ex}{1ex}{0ex}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\TransparentBlocks{
\def\SEs{\style{opacity:.5}{\color{red}{\Rule{1ex}{1ex}{0ex}}}}
\def\SWs{\style{opacity:.5}{\color{blue}{\Rule{1ex}{1ex}{0ex}}}}
\def\NEn{\style{opacity:.5}{\color{green}{\Rule{1ex}{1ex}{0ex}}}}
\def\NWn{\style{opacity:.5}{\color{orange}{\Rule{1ex}{1ex}{0ex}}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\RoundCorners{
\def\SEs{\style{font-size:85%}{\unicode{x256D}}}
\def\SWs{\style{font-size:85%}{\unicode{x256E}}}
\def\NEn{\style{font-size:85%}{\unicode{x2570}}}
\def\NWn{\style{font-size:85%}{\unicode{x256F}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\Diagonals{
\def\SEs{\hskip.5ex\style{font-size:28%}{\unicode{x2571}}}
\def\SWs{\style{font-size:28%}{\unicode{x2572}}}
\def\NEn{\hskip.5ex\raise.5ex{\style{font-size:28%}{\unicode{x2572}}}}
\def\NWn{\raise.5ex{\style{font-size:28%}{\unicode{x2571}}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\OpenTriangles{
\def\SEs{\hskip.5ex\style{font-size:25%}{\unicode{x25FF}}}
\def\SWs{\style{font-size:25%}{\unicode{x25FA}}}
\def\NEn{\hskip.5ex\raise.5ex{\style{font-size:25%}{\unicode{x25F9}}}}
\def\NWn{\raise.5ex{\style{font-size:25%}{\unicode{x25F8}}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\BlackTriangles{
\def\SEs{\hskip.5ex\style{font-size:25%}{\unicode{x25E2}}}
\def\SWs{\style{font-size:25%}{\unicode{x25E3}}}
\def\NEn{\hskip.5ex\raise.5ex{\style{font-size:25%}{\unicode{x25E5}}}}
\def\NWn{\raise.5ex{\style{font-size:25%}{\unicode{x25E4}}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\Paths{
\def\SEs{
\style{opacity:.25}{\color{red}{\Rule{1ex}{1ex}{0ex}}}
\hskip-.5ex\raise.08ex{\style{font-size:25%; opacity:.25}{\color{blue}{\unicode{x25E2}}}}
}
\def\SWs{
\style{opacity:.25}{\color{blue}{\Rule{1ex}{1ex}{0ex}}}
\hskip-1ex\raise.08ex{\style{font-size:25%; opacity:.25}{\color{red}{\unicode{x25E3}}}}
}
\def\NEn{
\style{opacity:.25}{\color{blue}{\Rule{1ex}{1ex}{0ex}}}
\hskip-.5ex\raise.58ex{\style{font-size:25%; opacity:.25}{\color{red}{\unicode{x25E5}}}}
}
\def\NWn{
\style{opacity:.25}{\color{red}{\Rule{1ex}{1ex}{0ex}}}
\hskip-1ex\raise.58ex{\style{font-size:25%; opacity:.25}{\color{blue}{\unicode{x25E4}}}}
}
\def\SEe{
\style{opacity:.25}{\color{blue}{\Rule{1ex}{1ex}{0ex}}}
\hskip-.5ex\raise.08ex{\style{font-size:25%; opacity:.25}{\color{red}{\unicode{x25E2}}}}
}
\def\SWw{
\style{opacity:.25}{\color{red}{\Rule{1ex}{1ex}{0ex}}}
\hskip-1ex\raise.08ex{\style{font-size:25%; opacity:.25}{\color{blue}{\unicode{x25E3}}}}
}
\def\NEe{
\style{opacity:.25}{\color{red}{\Rule{1ex}{1ex}{0ex}}}
\hskip-.5ex\raise.58ex{\style{font-size:25%; opacity:.25}{\color{blue}{\unicode{x25E5}}}}
}
\def\NWw{
\style{opacity:.25}{\color{blue}{\Rule{1ex}{1ex}{0ex}}}
\hskip-1ex\raise.58ex{\style{font-size:25%; opacity:.25}{\color{red}{\unicode{x25E4}}}}
}
}
\def\Arrows{
\def\SEs{\hskip.5ex\raise.08ex{\style{font-size:25%; opacity:.25}{\unicode{x21D7}}}}
\def\SWs{\raise.08ex{\style{font-size:25%; opacity:.25}{\unicode{x21D6}}}}
\def\NEn{\hskip.5ex\raise.58ex{\style{font-size:25%; opacity:.25}{\unicode{x21D8}}}}
\def\NWn{\raise.58ex{\style{font-size:25%; opacity:.25}{\unicode{x21D9}}}}
\def\SEe{\hskip.5ex\raise.08ex{\style{font-size:25%; opacity:.25}{\unicode{x21D9}}}}
\def\SWw{\raise.08ex{\style{font-size:25%; opacity:.25}{\unicode{x21D8}}}}
\def\NEe{\hskip.5ex\raise.58ex{\style{font-size:25%; opacity:.25}{\unicode{x21D6}}}}
\def\NWw{\raise.58ex{\style{font-size:25%; opacity:.25}{\unicode{x21D7}}}}
}
\RoundCorners
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Create a dragon from the currently saved dragon string starting
% at the given location on the board, or a big dragon from
% the last big dragon collections.
%
\def\Dragon#1#2{\Start{#1}{#2}\E \Continue\Db \End}
\def\BigDragon#1#2{\Start{#1}{#2}\E \Bq{}\Bb{}\Ba{} \End}
%
% Check if there are more letters and call \P if so and \X if not.
%
\def\D#1 #2#3 #4{#4#1 #2#3 #4}
%
% Place the letter at the current location.
% Then define \T to determine the new orientation from
% the current one and the current letter.
% Perform the orientation command in order to move to the new location.
%
\def\P#1#2#3#4{
\def\T##1#4#3 ##2##3##4\T{\Place{#1}{#2}##3 ##2{#1}{#2}##2 }
\T L\E \N\NWw R\E \S\SWw L\S \E\NEn R\S \W\NWn L\W \S\SEe
R\W \N\NEe L\N \W\SWs R\N \E\SEs \T
}
%
% These are the commands to move in the given direction.
%
\def\N#1#2{\def\n##1##2##3{\D{#1}{##1##2##3}}\p\n#2}
\def\E#1#2{\def\n##1##2##3{\D{##1##2##3}{#2}}\p\n#1}
\def\S#1#2{\def\n##1##2##3{\D{#1}{##1##2##3}}\m\n#2}
\def\W#1#2{\def\n##1##2##3{\D{##1##2##3}{#2}}\m\n#1}
%
% Routines to add or subtract (plus or minus) 1 from
% a three-digit number, so we can handle 000 to 999.
% These roll over if they go too far.
%
\def\p#1#2#3#4{
\def\:##1#4##2##3 ##4#4 ##5##6\:{##5#1#2#3##2}
\: 01234567890 9 \pp #4 {} \:
}
\def\pp#1#2#3{\p\drop0#2#3#1}
\def\m#1#2#3#4{
\def\:##1#4##2##3 ##4#4 ##5##6\:{##5#1#2#3##2}
\: 98765432109 0 \mm #4 {} \:
}
\def\mm#1#2#3{\m\drop9#2#3#1}
\def\drop#1#2#3#4{#4#2#3}
%
% Start a dragon by placing a marker and creating the \Continue function.
% End a dragon by continuing with the end marker, cleaning up, and then
% placing the board boundary.
%
\def\Start#1#2#3{\Marker{green}{#1}{#2}\X{#1}{#2}#3\X}
\def\End{\C\EndMarker\Board}
\def\EndMarker#1#2\X{\EndPlace#1}
\def\EndPlace#1#2#3#4{\Marker{red}{#2}{#3}}
%
% End the current portion of the dragon by defining a continuation
% function that records the current location and orientation.
% Each continuation is done in \text{$...$} so that it gets its own
% equation environment with its own MAXMACROS and MAXBUFFER space.
% This lets us do multiple pieces without exceeding the limitations.
%
\def\X#1#2#3#4\X{\def\C##1{\text{$##1{\D{#1}{#2}#3} \P \X$}}\let\Continue=\C}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% These functions produce new dragons from old ones.
% We keep a separate reversed copy so that we don't have
% to reverse them later.
%
\def\NextDragon{\Next\Da\Db\Dq\Dr}
\def\NextBigDragon{\Next\Ba\Bb\Bq\Br}
\def\Next#1#2#3#4{
#3\Copy\It #2\Copy\It #1\Copy\It \Define \EndD \tmpA
#3\Copy\It #4\Copy\It #1\Copy\It \Define \EndD \tmpB
\let#1=#2 \let#2=\tmpA
\let#3=#4 \let#4=\tmpB
\def\tmpA{} \let\tmpB=\tmpA
}
\def\Define#1\EndD#2{\def#2##1{##1 #1}}
\def\Copy#1\It#2\EndD{#2#1\EndD}
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The initial two dragons (D_0 and D_1) and their reversed versions,
% and the initial two Big Dragons, based on them. Big Dragons use
% \C (\Continue) to do multiple pieces (based on the largest small
% Dragon that can be processed within the MathJax limits).
%
\def\Da#1{#1 R} \let\Db=\Da
\def\Dq#1{#1 L} \let\Dr=\Dq
%
\def\Ba#1{#1 \C\Da} \def\Bb#1{#1 \C\Db}
\def\Bq#1{#1 \C\Dq} \def\Br#1{#1 \C\Dr}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Some utility functions:
%
%
% Make a large rectangle to surround the dragon.
%
\def\Board#1#2{\bbox[border:1px solid black]{\hskip#1ex\Rule{0ex}{#2ex}{0ex}}}
%
% Place a letter at the right location on the board.
%
\def\Place#1#2#3{\smash{\rlap{\hskip #1ex\raise{#2ex}{#3}}}}
%
% Place a marker with a given color at the correct place.
%
%\def\Marker#1#2#3{\Place{#2}{#3}{\color{#1}{\kern-2.25pt\raise.25pt\bigcirc}}} % for \small
%\def\Marker#1#2#3{\Place{#2}{#3}{\color{#1}{\kern2.1pt\raise.5pt\bigcirc}}} % for \tiny
\def\Marker#1#2#3{} % don't put in markers -- comment out to show them
%
% The shape of the corners
%
\def\Corners{
\def\SEs{\kern.47ex\Rule{.06ex}{.53ex}{0ex}\raise.47ex{\Rule{.47ex}{.06ex}{0ex}}}
\def\SWs{\raise.47ex{\Rule{.47ex}{.06ex}{0ex}}\Rule{.06ex}{.53ex}{0ex}}
\def\NEn{\kern.47ex\raise.47ex{\Rule{.06ex}{.53ex}{0ex}\Rule{.47ex}{.06ex}{0ex}}}
\def\NWn{\raise.47ex{\Rule{.47ex}{.06ex}{0ex}\Rule{.06ex}{.53ex}{0ex}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\HalfBlocks{
\def\SEs{\kern.47ex\Rule{.53ex}{.53ex}{0ex}}
\def\SWs{\Rule{.53ex}{.53ex}{0ex}}
\def\NEn{\kern.47ex\raise.47ex{\Rule{.53ex}{.53ex}{0ex}}}
\def\NWn{\raise.47ex{\Rule{.53ex}{.53ex}{0ex}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\TransparentBlocks{
\def\SEs{\style{opacity:.5}{\color{red}{\Rule{1ex}{1ex}{0ex}}}}
\def\SWs{\style{opacity:.5}{\color{blue}{\Rule{1ex}{1ex}{0ex}}}}
\def\NEn{\style{opacity:.5}{\color{green}{\Rule{1ex}{1ex}{0ex}}}}
\def\NWn{\style{opacity:.5}{\color{orange}{\Rule{1ex}{1ex}{0ex}}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\RoundCorners{
\def\SEs{\style{font-size:85%}{\unicode{x256D}}}
\def\SWs{\style{font-size:85%}{\unicode{x256E}}}
\def\NEn{\style{font-size:85%}{\unicode{x2570}}}
\def\NWn{\style{font-size:85%}{\unicode{x256F}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\Diagonals{
\def\SEs{\hskip.5ex\style{font-size:28%}{\unicode{x2571}}}
\def\SWs{\style{font-size:28%}{\unicode{x2572}}}
\def\NEn{\hskip.5ex\raise.5ex{\style{font-size:28%}{\unicode{x2572}}}}
\def\NWn{\raise.5ex{\style{font-size:28%}{\unicode{x2571}}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\OpenTriangles{
\def\SEs{\hskip.5ex\style{font-size:25%}{\unicode{x25FF}}}
\def\SWs{\style{font-size:25%}{\unicode{x25FA}}}
\def\NEn{\hskip.5ex\raise.5ex{\style{font-size:25%}{\unicode{x25F9}}}}
\def\NWn{\raise.5ex{\style{font-size:25%}{\unicode{x25F8}}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\BlackTriangles{
\def\SEs{\hskip.5ex\style{font-size:25%}{\unicode{x25E2}}}
\def\SWs{\style{font-size:25%}{\unicode{x25E3}}}
\def\NEn{\hskip.5ex\raise.5ex{\style{font-size:25%}{\unicode{x25E5}}}}
\def\NWn{\raise.5ex{\style{font-size:25%}{\unicode{x25E4}}}}
\let\SEe=\SEs \let\SWw=\SWs \let\NEe=\NEn \let\NWw=\NWn
}
\def\Paths{
\def\SEs{
\style{opacity:.25}{\color{red}{\Rule{1ex}{1ex}{0ex}}}
\hskip-.5ex\raise.08ex{\style{font-size:25%; opacity:.25}{\color{blue}{\unicode{x25E2}}}}
}
\def\SWs{
\style{opacity:.25}{\color{blue}{\Rule{1ex}{1ex}{0ex}}}
\hskip-1ex\raise.08ex{\style{font-size:25%; opacity:.25}{\color{red}{\unicode{x25E3}}}}
}
\def\NEn{
\style{opacity:.25}{\color{blue}{\Rule{1ex}{1ex}{0ex}}}
\hskip-.5ex\raise.58ex{\style{font-size:25%; opacity:.25}{\color{red}{\unicode{x25E5}}}}
}
\def\NWn{
\style{opacity:.25}{\color{red}{\Rule{1ex}{1ex}{0ex}}}
\hskip-1ex\raise.58ex{\style{font-size:25%; opacity:.25}{\color{blue}{\unicode{x25E4}}}}
}
\def\SEe{
\style{opacity:.25}{\color{blue}{\Rule{1ex}{1ex}{0ex}}}
\hskip-.5ex\raise.08ex{\style{font-size:25%; opacity:.25}{\color{red}{\unicode{x25E2}}}}
}
\def\SWw{
\style{opacity:.25}{\color{red}{\Rule{1ex}{1ex}{0ex}}}
\hskip-1ex\raise.08ex{\style{font-size:25%; opacity:.25}{\color{blue}{\unicode{x25E3}}}}
}
\def\NEe{
\style{opacity:.25}{\color{red}{\Rule{1ex}{1ex}{0ex}}}
\hskip-.5ex\raise.58ex{\style{font-size:25%; opacity:.25}{\color{blue}{\unicode{x25E5}}}}
}
\def\NWw{
\style{opacity:.25}{\color{blue}{\Rule{1ex}{1ex}{0ex}}}
\hskip-1ex\raise.58ex{\style{font-size:25%; opacity:.25}{\color{red}{\unicode{x25E4}}}}
}
}
\def\BlueDots{
\def\SEs{\hskip.5ex\style{font-size:25%}{\unicode{x25FF}}}
\def\SWs{\color{blue}{\rlap{\hskip.45ex\raise.1ex.}}\style{font-size:25%}{\unicode{x25FA}}}
\def\NEn{\color{blue}{\rlap{\hskip.1ex\raise.5ex.}}\hskip.5ex\raise.45ex{\style{font-size:25%}{\unicode{x25F9}}}}
\def\NWn{\raise.5ex{\style{font-size:25%}{\unicode{x25F8}}}}
\def\SEe{\color{blue}{\rlap{\hskip.45ex\raise.5ex.}}\hskip.5ex\style{font-size:25%}{\unicode{x25FF}}}
\def\SWw{\style{font-size:25%}{\unicode{x25FA}}}
\def\NEe{\hskip.5ex\raise.5ex{\style{font-size:25%}{\unicode{x25F9}}}}
\def\NWw{\color{blue}{\rlap{\hskip.1ex\raise.1ex.}}\raise.5ex{\style{font-size:25%}{\unicode{x25F8}}}}
}
\def\RedDots{
\def\SEs{\hskip.5ex\style{font-size:25%}{\unicode{x25E2}}}
\def\SWs{\color{red}{\rlap{\hskip.45ex\raise.1ex.}}\style{font-size:25%}{\unicode{x25E3}}}
\def\NEn{\color{red}{\rlap{\hskip.1ex\raise.5ex.}}\hskip.5ex\raise.45ex{\style{font-size:25%}{\unicode{x25E5}}}}
\def\NWn{\raise.5ex{\style{font-size:25%}{\unicode{x25E4}}}}
\def\SEe{\color{red}{\rlap{\hskip.45ex\raise.5ex.}}\hskip.5ex\style{font-size:25%}{\unicode{x25E2}}}
\def\SWw{\style{font-size:25%}{\unicode{x25E3}}}
\def\NEe{\hskip.5ex\raise.5ex{\style{font-size:25%}{\unicode{x25E5}}}}
\def\NWw{\color{red}{\rlap{\hskip.1ex\raise.1ex.}}\raise.5ex{\style{font-size:25%}{\unicode{x25E4}}}}
}
\def\RedBlueDots{
\def\SEs{\color{blue}{\rlap{\hskip.1ex\raise.1ex.}}\hskip.5ex\style{font-size:25%}{\unicode{x25E2}}}
\def\SWs{\color{red}{\rlap{\hskip.45ex\raise.1ex.}}\style{font-size:25%}{\unicode{x25E3}}}
\def\NEn{\color{red}{\rlap{\hskip.1ex\raise.5ex.}}\hskip.5ex\raise.45ex{\style{font-size:25%}{\unicode{x25E5}}}}
\def\NWn{\color{blue}{\rlap{\hskip.45ex\raise.5ex.}}\raise.5ex{\style{font-size:25%}{\unicode{x25E4}}}}
\def\SEe{\color{red}{\rlap{\hskip.45ex\raise.5ex.}}\hskip.5ex\style{font-size:25%}{\unicode{x25E2}}}
\def\SWw{\color{blue}{\rlap{\hskip.1ex\raise.5ex.}}\style{font-size:25%}{\unicode{x25E3}}}
\def\NEe{\color{blue}{\rlap{\hskip.45ex\raise.1ex.}}\hskip.5ex\raise.5ex{\style{font-size:25%}{\unicode{x25E5}}}}
\def\NWw{\color{red}{\rlap{\hskip.1ex\raise.1ex.}}\raise.5ex{\style{font-size:25%}{\unicode{x25E4}}}}
}
\RoundCorners
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Create a dragon from the currently saved dragon string starting
% at the given location on the board, or a big dragon from
% the last big dragon collections.
%
\def\Dragon#1#2{\Start{#1}{#2}\E \Continue\Db \End}
\def\BigDragon#1#2{\Start{#1}{#2}\E \Bq{}\Bb{}\Ba{} \End}
%
% Check if there are more letters and call \P if so and \X if not.
%
\def\D#1 #2#3 #4{#4#1 #2#3 #4}
%
% Place the letter at the current location.
% Then define \T to determine the new orientation from
% the current one and the current letter.
% Perform the orientation command in order to move to the new location.
%
\def\P#1#2#3#4{
\def\T##1#4#3 ##2##3##4\T{\Place{#1}{#2}##3 ##2{#1}{#2}##2 }
\T L\E \N\NWw R\E \S\SWw L\S \E\NEn R\S \W\NWn L\W \S\SEe
R\W \N\NEe L\N \W\SWs R\N \E\SEs \T
}
%
% These are the commands to move in the given direction.
%
\def\N#1#2{\def\n##1##2##3{\D{#1}{##1##2##3}}\p\n#2}
\def\E#1#2{\def\n##1##2##3{\D{##1##2##3}{#2}}\p\n#1}
\def\S#1#2{\def\n##1##2##3{\D{#1}{##1##2##3}}\m\n#2}
\def\W#1#2{\def\n##1##2##3{\D{##1##2##3}{#2}}\m\n#1}
%
% Routines to add or subtract (plus or minus) 1 from
% a three-digit number, so we can handle 000 to 999.
% These roll over if they go too far.
%
\def\p#1#2#3#4{
\def\:##1#4##2##3 ##4#4 ##5##6\:{##5#1#2#3##2}
\: 01234567890 9 \pp #4 {} \:
}
\def\pp#1#2#3{\p\drop0#2#3#1}
\def\m#1#2#3#4{
\def\:##1#4##2##3 ##4#4 ##5##6\:{##5#1#2#3##2}
\: 98765432109 0 \mm #4 {} \:
}
\def\mm#1#2#3{\m\drop9#2#3#1}
\def\drop#1#2#3#4{#4#2#3}
%
% Start a dragon by placing a marker and creating the \Continue function.
% End a dragon by continuing with the end marker, cleaning up, and then
% placing the board boundary.
%
\def\Start#1#2#3{\Marker{green}{#1}{#2}\X{#1}{#2}#3\X}
\def\End{\C\EndMarker\Board}
\def\EndMarker#1#2\X{\EndPlace#1}
\def\EndPlace#1#2#3#4{\Marker{red}{#2}{#3}}
%
% End the current portion of the dragon by defining a continuation
% function that records the current location and orientation.
% Each continuation is done in \text{$...$} so that it gets its own
% equation environment with its own MAXMACROS and MAXBUFFER space.
% This lets us do multiple pieces without exceeding the limitations.
%
\def\X#1#2#3#4\X{\def\C##1{\text{$##1{\D{#1}{#2}#3} \P \X$}}\let\Continue=\C}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% These functions produce new dragons from old ones.
% We keep a separate reversed copy so that we don't have
% to reverse them later.
%
\def\NextDragon{\Next\Da\Db\Dq\Dr}
\def\NextBigDragon{\Next\Ba\Bb\Bq\Br}
\def\Next#1#2#3#4{
#3\Copy\It #2\Copy\It #1\Copy\It \Define \EndD \tmpA
#3\Copy\It #4\Copy\It #1\Copy\It \Define \EndD \tmpB
\let#1=#2 \let#2=\tmpA
\let#3=#4 \let#4=\tmpB
\def\tmpA{} \let\tmpB=\tmpA
}
\def\Define#1\EndD#2{\def#2##1{##1 #1}}
\def\Copy#1\It#2\EndD{#2#1\EndD}
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The initial two dragons (D_0 and D_1) and their reversed versions,
% and the initial two Big Dragons, based on them. Big Dragons use
% \C (\Continue) to do multiple pieces (based on the largest small
% Dragon that can be processed within the MathJax limits).
%
\def\Da#1{#1 R} \let\Db=\Da
\def\Dq#1{#1 L} \let\Dr=\Dq
%
\def\Ba#1{#1 \C\Da} \def\Bb#1{#1 \C\Db}
\def\Bq#1{#1 \C\Dq} \def\Br#1{#1 \C\Dr}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$
$\NextDragon\NextDragon\NextDragon\NextDragon\NextDragon$
$\NextDragon\NextDragon\NextDragon\NextDragon$
$\NextBigDragon\NextBigDragon\NextBigDragon$
$\RoundCorners$
$\BigDragon{113}{095} {132}{132} % Level 14 (9 sec) $