Skip to main content
Add a few more images
Source Link
  • Using \Corners

    Level 14 dragon - angled corners

  • Using \RoundCorners

    Level 14 dragon - rounded corners

  • Using \TransparentBlocks

    Level 14 dragon - transparent colored blocks

  • Using \Diagonals

    Level 14 dragon - diagonal corners

  • Using \BlackTriangles

    enter image description here

  • Using \OpenTriangles

    enter image description here

  • Using \Paths.

    enter image description here

  • 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 idea

    enter image description here

  • Using \RedBlueDots. This makes dotted paths along both sets of what is happeningpaths, one set colored red, the other blue.

    enter image description hereenter image description here

$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  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) $
  • Using \Corners

    Level 14 dragon - angled corners

  • Using \RoundCorners

    Level 14 dragon - rounded corners

  • Using \TransparentBlocks

    Level 14 dragon - transparent colored blocks

  • Using \Diagonals

    Level 14 dragon - diagonal corners

  • Using \BlackTriangles

    enter image description here

  • Using \OpenTriangles

    enter image description here

  • Using \Paths. This is as close to being able to render in MathJax the paths from the two sides of the line that forms the dragon. It isn't perfect, but gives you an idea of what is happening.

    enter image description here

$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  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}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$

$\NextDragon\NextDragon\NextDragon\NextDragon\NextDragon$
$\NextDragon\NextDragon\NextDragon\NextDragon$
$\NextBigDragon\NextBigDragon\NextBigDragon$
$\RoundCorners$
$\BigDragon{113}{095} {132}{132} % Level 14 (9 sec) $
  • Using \Corners

    Level 14 dragon - angled corners

  • Using \RoundCorners

    Level 14 dragon - rounded corners

  • Using \TransparentBlocks

    Level 14 dragon - transparent colored blocks

  • Using \Diagonals

    Level 14 dragon - diagonal corners

  • Using \BlackTriangles

    enter image description here

  • Using \OpenTriangles

    enter image description here

  • Using \Paths.

    enter image description here

  • Using \RedDots. This highlights the paths from one "side" of the dragon line.

    enter image description here

  • Using \RedBlueDots. This makes dotted paths along both sets of paths, one set colored red, the other blue.

    enter image description here

$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  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) $
Add more decorations (triangles, paths).
Source Link
  • Using \Corners

    Level 14 dragon - angled corners

  • Using \RoundCorners

    Level 14 dragon - rounded corners

  • Using \TransparentBlocks

    Level 14 dragon - transparent colored blocks

  • Using \Diagonals

    Level 14 dragon - diagonal corners

  • Using \BlackTriangles

    enter image description here

  • Using \OpenTriangles

    enter image description here

  • Using \Paths. This is as close to being able to render in MathJax the paths from the two sides of the line that forms the dragon. It isn't perfect, but gives you an idea of what is happening.

    enter image description here

$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  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\SE{\kern.47ex\Rule{.06ex}{.53ex}{0ex}\raise.47ex{\Rule{.47ex}{.06ex}{0ex}}}
  \def\SW{\raise.47ex{\Rule{.47ex}{.06ex}{0ex}}\Rule{.06ex}{.53ex}{0ex}}
  \def\NE{\kern.47ex\raise.47ex{\Rule{.06ex}{.53ex}{0ex}\Rule{.47ex}{.06ex}{0ex}}}
  \def\NW{\raise.47ex{\Rule{.47ex}{.06ex}{0ex}\Rule{.06ex}{.53ex}{0ex}}}
}
\def\HalfBlocks{
  \def\SE{\kern.47ex\Rule{.53ex}{.53ex}{0ex}}
  \def\SW{\Rule{.53ex}{.53ex}{0ex}}
  \def\NE{\kern.47ex\raise.47ex{\Rule{.53ex}{.53ex}{0ex}}}
  \def\NW{\raise.47ex{\Rule{.53ex}{.53ex}{0ex}}}
}
\def\TwoThirdBlocks{
  \def\SE{\kern.33ex\Rule{.67ex}{.67ex}{0ex}}
  \def\SW{\Rule{.67ex}{.67ex}{0ex}}
  \def\NE{\kern.33ex\raise.33ex{\Rule{.67ex}{.67ex}{0ex}}}
  \def\NW{\raise.33ex{\Rule{.67ex}{.67ex}{0ex}}}
}
\def\FullBlocks{
  \def\SE{\Rule{1ex}{1ex}{0ex}}
  \let\SW=\SE \let\NW=\SE \let\NE=\SE
}
\def\ColoredBlocks{
  \def\SE{\kern.47ex\color{red}{\Rule{.53ex}{.53ex}{0ex}}}
  \def\SW{\color{blue}{\Rule{.53ex}{.53ex}{0ex}}}
  \def\NE{\kern.47ex\raise.47ex{\color{green}{\Rule{.53ex}{.53ex}{0ex}}}}
  \def\NW{\raise.47ex{\color{orange}{\Rule{.53ex}{.53ex}{0ex}}}}
}
\def\ColoredTwoThirdBlocks{
  \def\SE{\kern.33ex\color{red}{\Rule{.67ex}{.67ex}{0ex}}}
  \def\SW{\color{blue}{\Rule{.67ex}{.67ex}{0ex}}}
  \def\NE{\kern.33ex\raise.33ex{\color{green}{\Rule{.67ex}{.67ex}{0ex}}}}
  \def\NW{\raise.33ex{\color{orange}{\Rule{.67ex}{.67ex}{0ex}}}}
}
\def\ColoredFullBlocks{
  \def\SE{\color{red}{\Rule{1ex}{1ex}{0ex}}}
  \def\SW{\color{blue}{\Rule{1ex}{1ex}{0ex}}}
  \def\NE{\color{green}{\Rule{1ex}{1ex}{0ex}}}
  \def\NW{\color{orange}{\Rule{1ex}{1ex}{0ex}}}
}
\def\TransparentBlocks{
  \def\SE{\style{opacity:.5}{\color{red}{\Rule{1ex}{1ex}{0ex}}}}
  \def\SW{\style{opacity:.5}{\color{blue}{\Rule{1ex}{1ex}{0ex}}}}
  \def\NE{\style{opacity:.5}{\color{green}{\Rule{1ex}{1ex}{0ex}}}}
  \def\NW{\style{opacity:.5}{\color{orange}{\Rule{1ex}{1ex}{0ex}}}}
}
\def\RoundCorners{
  \def\SE{\style{font-size:85%}{\unicode{x256D}}}
  \def\SW{\style{font-size:85%}{\unicode{x256E}}}
  \def\NE{\style{font-size:85%}{\unicode{x2570}}}
  \def\NW{\style{font-size:85%}{\unicode{x256F}}}
}
\def\RoundCorners{
  \def\SE{\style{font-size:85%}{\unicode{x256D}}}
  \def\SW{\style{font-size:85%}{\unicode{x256E}}}
  \def\NE{\style{font-size:85%}{\unicode{x2570}}}
  \def\NW{\style{font-size:85%}{\unicode{x256F}}}
}
\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\NW  R\E \S\SW  L\S \E\NE  R\S \W\NW  L\W \S\SE  R\W \N\NE  L\N \W\SW  R\N \E\SE  \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\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}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$

$\NextDragon\NextDragon\NextDragon\NextDragon\NextDragon$
$\NextDragon\NextDragon\NextDragon\NextDragon$
$\NextBigDragon\NextBigDragon\NextBigDragon$
$\RoundCorners$
$\BigDragon{113}{095} {132}{132} % Level 14 (9 sec) $
  • Using \Corners

    Level 14 dragon - angled corners

  • Using \RoundCorners

    Level 14 dragon - rounded corners

  • Using \TransparentBlocks

    Level 14 dragon - transparent colored blocks

  • Using \Diagonals

    Level 14 dragon - diagonal corners

$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  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\SE{\kern.47ex\Rule{.06ex}{.53ex}{0ex}\raise.47ex{\Rule{.47ex}{.06ex}{0ex}}}
  \def\SW{\raise.47ex{\Rule{.47ex}{.06ex}{0ex}}\Rule{.06ex}{.53ex}{0ex}}
  \def\NE{\kern.47ex\raise.47ex{\Rule{.06ex}{.53ex}{0ex}\Rule{.47ex}{.06ex}{0ex}}}
  \def\NW{\raise.47ex{\Rule{.47ex}{.06ex}{0ex}\Rule{.06ex}{.53ex}{0ex}}}
}
\def\HalfBlocks{
  \def\SE{\kern.47ex\Rule{.53ex}{.53ex}{0ex}}
  \def\SW{\Rule{.53ex}{.53ex}{0ex}}
  \def\NE{\kern.47ex\raise.47ex{\Rule{.53ex}{.53ex}{0ex}}}
  \def\NW{\raise.47ex{\Rule{.53ex}{.53ex}{0ex}}}
}
\def\TwoThirdBlocks{
  \def\SE{\kern.33ex\Rule{.67ex}{.67ex}{0ex}}
  \def\SW{\Rule{.67ex}{.67ex}{0ex}}
  \def\NE{\kern.33ex\raise.33ex{\Rule{.67ex}{.67ex}{0ex}}}
  \def\NW{\raise.33ex{\Rule{.67ex}{.67ex}{0ex}}}
}
\def\FullBlocks{
  \def\SE{\Rule{1ex}{1ex}{0ex}}
  \let\SW=\SE \let\NW=\SE \let\NE=\SE
}
\def\ColoredBlocks{
  \def\SE{\kern.47ex\color{red}{\Rule{.53ex}{.53ex}{0ex}}}
  \def\SW{\color{blue}{\Rule{.53ex}{.53ex}{0ex}}}
  \def\NE{\kern.47ex\raise.47ex{\color{green}{\Rule{.53ex}{.53ex}{0ex}}}}
  \def\NW{\raise.47ex{\color{orange}{\Rule{.53ex}{.53ex}{0ex}}}}
}
\def\ColoredTwoThirdBlocks{
  \def\SE{\kern.33ex\color{red}{\Rule{.67ex}{.67ex}{0ex}}}
  \def\SW{\color{blue}{\Rule{.67ex}{.67ex}{0ex}}}
  \def\NE{\kern.33ex\raise.33ex{\color{green}{\Rule{.67ex}{.67ex}{0ex}}}}
  \def\NW{\raise.33ex{\color{orange}{\Rule{.67ex}{.67ex}{0ex}}}}
}
\def\ColoredFullBlocks{
  \def\SE{\color{red}{\Rule{1ex}{1ex}{0ex}}}
  \def\SW{\color{blue}{\Rule{1ex}{1ex}{0ex}}}
  \def\NE{\color{green}{\Rule{1ex}{1ex}{0ex}}}
  \def\NW{\color{orange}{\Rule{1ex}{1ex}{0ex}}}
}
\def\TransparentBlocks{
  \def\SE{\style{opacity:.5}{\color{red}{\Rule{1ex}{1ex}{0ex}}}}
  \def\SW{\style{opacity:.5}{\color{blue}{\Rule{1ex}{1ex}{0ex}}}}
  \def\NE{\style{opacity:.5}{\color{green}{\Rule{1ex}{1ex}{0ex}}}}
  \def\NW{\style{opacity:.5}{\color{orange}{\Rule{1ex}{1ex}{0ex}}}}
}
\def\RoundCorners{
  \def\SE{\style{font-size:85%}{\unicode{x256D}}}
  \def\SW{\style{font-size:85%}{\unicode{x256E}}}
  \def\NE{\style{font-size:85%}{\unicode{x2570}}}
  \def\NW{\style{font-size:85%}{\unicode{x256F}}}
}
\def\RoundCorners{
  \def\SE{\style{font-size:85%}{\unicode{x256D}}}
  \def\SW{\style{font-size:85%}{\unicode{x256E}}}
  \def\NE{\style{font-size:85%}{\unicode{x2570}}}
  \def\NW{\style{font-size:85%}{\unicode{x256F}}}
}
\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\NW  R\E \S\SW  L\S \E\NE  R\S \W\NW  L\W \S\SE  R\W \N\NE  L\N \W\SW  R\N \E\SE  \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) $
  • Using \Corners

    Level 14 dragon - angled corners

  • Using \RoundCorners

    Level 14 dragon - rounded corners

  • Using \TransparentBlocks

    Level 14 dragon - transparent colored blocks

  • Using \Diagonals

    Level 14 dragon - diagonal corners

  • Using \BlackTriangles

    enter image description here

  • Using \OpenTriangles

    enter image description here

  • Using \Paths. This is as close to being able to render in MathJax the paths from the two sides of the line that forms the dragon. It isn't perfect, but gives you an idea of what is happening.

    enter image description here

$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  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}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$

$\NextDragon\NextDragon\NextDragon\NextDragon\NextDragon$
$\NextDragon\NextDragon\NextDragon\NextDragon$
$\NextBigDragon\NextBigDragon\NextBigDragon$
$\RoundCorners$
$\BigDragon{113}{095} {132}{132} % Level 14 (9 sec) $
Add diagonal corners, and reformat code for readability
Source Link
$\require{begingroup}\begingroup \def\safe{\text{\endgroup error}}$
$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  Some utility functions:
%
%
%  Make a large rectangle to surround the dragon.
%
\def\Board#1#2{\bbox[border:1px solid black]{\xspace{#1}\Rule{0em}{#2em}{0em}}}
%
%  Place a letter at the right location on the board.
%
\def\Place#1#2#3{\smash{\rlap{\xspace{#1}\raise{#2em}{#3}}}}
%
%  Do the horizontal space (the letters are a bit bigger than an ex at 
%  \small size, so add extra space via pts).
%
\def\init{\sf\small}
\def\xspace#1{\hskip #1ex\hskip #1pt \hskip #1pt \hskip #1pt}
%\def\init{\sf\tiny}           %  for \BigDragons, use these two lines
%\def\xspace#1{\hskip #1ex}    %    and comment out the previous two
%
%  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}{\kern-1.25pt\raise2pt\bigcirc}}}    % for \tiny
\def\Marker#1#2#3{} % don't put in markers -- comment out to show them
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  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{
\Place{#1}{#2}#4
\def\T##1#4#3 ##2##3\T{##2{#1}{#2}##2 }
\T L\E \N  R\E \S  L\S \E  R\S \W  L\W \S  R\W \N  L\N \W  R\N \E  \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{\init\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{$\init ##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]{\xspace{#1}\Rule{0em}{#2em}{0em}}}
%
%  Place a letter at the right location on the board.
%
\def\Place#1#2#3{\smash{\rlap{\xspace{#1}\raise{#2em}{#3}}}}
%
%  Do the horizontal space (the letters are a bit bigger than an ex at 
%  \small size, so add extra space via pts).
%
\def\init{\sf\small}
\def\xspace#1{\hskip #1ex\hskip #1pt \hskip #1pt \hskip #1pt}
%\def\init{\sf\tiny}           %  for \BigDragons, use these two lines
%\def\xspace#1{\hskip #1ex}    %    and comment out the previous two
%
%  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}{\kern-1.25pt\raise2pt\bigcirc}}}    % for \tiny
\def\Marker#1#2#3{} % don't put in markers -- comment out to show them
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  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{
  \Place{#1}{#2}#4
  \def\T##1#4#3 ##2##3\T{##2{#1}{#2}##2 }
  \T L\E \N  R\E \S  L\S \E  R\S \W  L\W \S  R\W \N  L\N \W  R\N \E  \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{\init\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{$\init ##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}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$

$\Dragon{002}{002} {5}{5} % Level 1 $
$\NextDragon\Dragon{002}{002} {6}{6} % Level 2 $
$\NextDragon\Dragon{003}{002} {6}{7} % Level 3 $
$\NextDragon\Dragon{005}{002} {8}{8} % Level 4 $
$\NextDragon\Dragon{007}{004} {10}{9} % Level 5 $
<br/>
$\NextDragon\Dragon{009}{007} {12}{12} % Level 6 $
$\NextDragon\Dragon{007}{012} {13}{16} % Level 7 $
$\NextDragon\Dragon{006}{015} {20}{20} % Level 8 $
<br/>
$\NextDragon\Dragon{006}{012} {28}{23} % Level 9 $
<br/>
$\NextDragon\Dragon{006}{010} {36}{36} % Level 10 $
<br/>
$\NextBigDragon$$\BigDragon{019}{009} {41}{52} % Level 11 $
<br/>
$\NextBigDragon$$\BigDragon{049}{010} {68}{68} % level 12 $
$\NextBigDragon$$\BigDragon{085}{036} {102}{79} % Level 13 $
$\NextBigDragon$$\BigDragon{113}{095} {132}{132} % Level 14 $
$\NextBigDragon$$\BigDragon{083}{164} {153}{196} % Level 15 $
$\NextBigDragon$$\BigDragon{071}{223} {262}{260} % Level 16 $
$\NextBigDragon$$\BigDragon{062}{164} {389}{302} % Level 17 $
$\NextBigDragon$$\BigDragon{071}{138} {518}{516} % Level 18 $
$\NextBigDragon$$\BigDragon{277}{121} {604}{771} % Level 19 $

$\endgroup\safe$
  • Using \Corners

    Level 14 dragon - angled corners

  • Using \RoundCorners

    Level 14 dragon - rounded corners

  • Using \TransparentBlocks

    Level 14 dragon - transparent colored blocks

  • Using \Diagonals

    Level 14 dragon - diagonal corners

$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  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\SE{\kern.47ex\Rule{.06ex}{.53ex}{0ex}\raise.47ex{\Rule{.47ex}{.06ex}{0ex}}}
\def\SW{\raise.47ex{\Rule{.47ex}{.06ex}{0ex}}\Rule{.06ex}{.53ex}{0ex}}
\def\NE{\kern.47ex\raise.47ex{\Rule{.06ex}{.53ex}{0ex}\Rule{.47ex}{.06ex}{0ex}}}
\def\NW{\raise.47ex{\Rule{.47ex}{.06ex}{0ex}\Rule{.06ex}{.53ex}{0ex}}}
}
\def\HalfBlocks{
\def\SE{\kern.47ex\Rule{.53ex}{.53ex}{0ex}}
\def\SW{\Rule{.53ex}{.53ex}{0ex}}
\def\NE{\kern.47ex\raise.47ex{\Rule{.53ex}{.53ex}{0ex}}}
\def\NW{\raise.47ex{\Rule{.53ex}{.53ex}{0ex}}}
}
\def\TwoThirdBlocks{
\def\SE{\kern.33ex\Rule{.67ex}{.67ex}{0ex}}
\def\SW{\Rule{.67ex}{.67ex}{0ex}}
\def\NE{\kern.33ex\raise.33ex{\Rule{.67ex}{.67ex}{0ex}}}
\def\NW{\raise.33ex{\Rule{.67ex}{.67ex}{0ex}}}
}
\def\FullBlocks{
\def\SE{\Rule{1ex}{1ex}{0ex}}
\let\SW=\SE \let\NW=\SE \let\NE=\SE
}
\def\ColoredBlocks{
\def\SE{\kern.47ex\color{red}{\Rule{.53ex}{.53ex}{0ex}}}
\def\SW{\color{blue}{\Rule{.53ex}{.53ex}{0ex}}}
\def\NE{\kern.47ex\raise.47ex{\color{green}{\Rule{.53ex}{.53ex}{0ex}}}}
\def\NW{\raise.47ex{\color{orange}{\Rule{.53ex}{.53ex}{0ex}}}}
}
\def\ColoredTwoThirdBlocks{
\def\SE{\kern.33ex\color{red}{\Rule{.67ex}{.67ex}{0ex}}}
\def\SW{\color{blue}{\Rule{.67ex}{.67ex}{0ex}}}
\def\NE{\kern.33ex\raise.33ex{\color{green}{\Rule{.67ex}{.67ex}{0ex}}}}
\def\NW{\raise.33ex{\color{orange}{\Rule{.67ex}{.67ex}{0ex}}}}
}
\def\ColoredFullBlocks{
\def\SE{\color{red}{\Rule{1ex}{1ex}{0ex}}}
\def\SW{\color{blue}{\Rule{1ex}{1ex}{0ex}}}
\def\NE{\color{green}{\Rule{1ex}{1ex}{0ex}}}
\def\NW{\color{orange}{\Rule{1ex}{1ex}{0ex}}}
}
\def\TransparentBlocks{
\def\SE{\style{opacity:.5}{\color{red}{\Rule{1ex}{1ex}{0ex}}}}
\def\SW{\style{opacity:.5}{\color{blue}{\Rule{1ex}{1ex}{0ex}}}}
\def\NE{\style{opacity:.5}{\color{green}{\Rule{1ex}{1ex}{0ex}}}}
\def\NW{\style{opacity:.5}{\color{orange}{\Rule{1ex}{1ex}{0ex}}}}
}
\def\RoundCorners{
\def\SE{\style{font-size:85%}{\unicode{x256D}}}
\def\SW{\style{font-size:85%}{\unicode{x256E}}}
\def\NE{\style{font-size:85%}{\unicode{x2570}}}
\def\NW{\style{font-size:85%}{\unicode{x256F}}}
}
\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\NW  R\E \S\SW  L\S \E\NE  R\S \W\NW  L\W \S\SE  R\W \N\NE  L\N \W\SW  R\N \E\SE  \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\SE{\kern.47ex\Rule{.06ex}{.53ex}{0ex}\raise.47ex{\Rule{.47ex}{.06ex}{0ex}}}
  \def\SW{\raise.47ex{\Rule{.47ex}{.06ex}{0ex}}\Rule{.06ex}{.53ex}{0ex}}
  \def\NE{\kern.47ex\raise.47ex{\Rule{.06ex}{.53ex}{0ex}\Rule{.47ex}{.06ex}{0ex}}}
  \def\NW{\raise.47ex{\Rule{.47ex}{.06ex}{0ex}\Rule{.06ex}{.53ex}{0ex}}}
}
\def\HalfBlocks{
  \def\SE{\kern.47ex\Rule{.53ex}{.53ex}{0ex}}
  \def\SW{\Rule{.53ex}{.53ex}{0ex}}
  \def\NE{\kern.47ex\raise.47ex{\Rule{.53ex}{.53ex}{0ex}}}
  \def\NW{\raise.47ex{\Rule{.53ex}{.53ex}{0ex}}}
}
\def\TwoThirdBlocks{
  \def\SE{\kern.33ex\Rule{.67ex}{.67ex}{0ex}}
  \def\SW{\Rule{.67ex}{.67ex}{0ex}}
  \def\NE{\kern.33ex\raise.33ex{\Rule{.67ex}{.67ex}{0ex}}}
  \def\NW{\raise.33ex{\Rule{.67ex}{.67ex}{0ex}}}
}
\def\FullBlocks{
  \def\SE{\Rule{1ex}{1ex}{0ex}}
  \let\SW=\SE \let\NW=\SE \let\NE=\SE
}
\def\ColoredBlocks{
  \def\SE{\kern.47ex\color{red}{\Rule{.53ex}{.53ex}{0ex}}}
  \def\SW{\color{blue}{\Rule{.53ex}{.53ex}{0ex}}}
  \def\NE{\kern.47ex\raise.47ex{\color{green}{\Rule{.53ex}{.53ex}{0ex}}}}
  \def\NW{\raise.47ex{\color{orange}{\Rule{.53ex}{.53ex}{0ex}}}}
}
\def\ColoredTwoThirdBlocks{
  \def\SE{\kern.33ex\color{red}{\Rule{.67ex}{.67ex}{0ex}}}
  \def\SW{\color{blue}{\Rule{.67ex}{.67ex}{0ex}}}
  \def\NE{\kern.33ex\raise.33ex{\color{green}{\Rule{.67ex}{.67ex}{0ex}}}}
  \def\NW{\raise.33ex{\color{orange}{\Rule{.67ex}{.67ex}{0ex}}}}
}
\def\ColoredFullBlocks{
  \def\SE{\color{red}{\Rule{1ex}{1ex}{0ex}}}
  \def\SW{\color{blue}{\Rule{1ex}{1ex}{0ex}}}
  \def\NE{\color{green}{\Rule{1ex}{1ex}{0ex}}}
  \def\NW{\color{orange}{\Rule{1ex}{1ex}{0ex}}}
}
\def\TransparentBlocks{
  \def\SE{\style{opacity:.5}{\color{red}{\Rule{1ex}{1ex}{0ex}}}}
  \def\SW{\style{opacity:.5}{\color{blue}{\Rule{1ex}{1ex}{0ex}}}}
  \def\NE{\style{opacity:.5}{\color{green}{\Rule{1ex}{1ex}{0ex}}}}
  \def\NW{\style{opacity:.5}{\color{orange}{\Rule{1ex}{1ex}{0ex}}}}
}
\def\RoundCorners{
  \def\SE{\style{font-size:85%}{\unicode{x256D}}}
  \def\SW{\style{font-size:85%}{\unicode{x256E}}}
  \def\NE{\style{font-size:85%}{\unicode{x2570}}}
  \def\NW{\style{font-size:85%}{\unicode{x256F}}}
}
\def\RoundCorners{
  \def\SE{\style{font-size:85%}{\unicode{x256D}}}
  \def\SW{\style{font-size:85%}{\unicode{x256E}}}
  \def\NE{\style{font-size:85%}{\unicode{x2570}}}
  \def\NW{\style{font-size:85%}{\unicode{x256F}}}
}
\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\NW  R\E \S\SW  L\S \E\NE  R\S \W\NW  L\W \S\SE  R\W \N\NE  L\N \W\SW  R\N \E\SE  \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) $
$\require{begingroup}\begingroup \def\safe{\text{\endgroup error}}$
$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  Some utility functions:
%
%
%  Make a large rectangle to surround the dragon.
%
\def\Board#1#2{\bbox[border:1px solid black]{\xspace{#1}\Rule{0em}{#2em}{0em}}}
%
%  Place a letter at the right location on the board.
%
\def\Place#1#2#3{\smash{\rlap{\xspace{#1}\raise{#2em}{#3}}}}
%
%  Do the horizontal space (the letters are a bit bigger than an ex at 
%  \small size, so add extra space via pts).
%
\def\init{\sf\small}
\def\xspace#1{\hskip #1ex\hskip #1pt \hskip #1pt \hskip #1pt}
%\def\init{\sf\tiny}           %  for \BigDragons, use these two lines
%\def\xspace#1{\hskip #1ex}    %    and comment out the previous two
%
%  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}{\kern-1.25pt\raise2pt\bigcirc}}}    % for \tiny
\def\Marker#1#2#3{} % don't put in markers -- comment out to show them
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  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{
\Place{#1}{#2}#4
\def\T##1#4#3 ##2##3\T{##2{#1}{#2}##2 }
\T L\E \N  R\E \S  L\S \E  R\S \W  L\W \S  R\W \N  L\N \W  R\N \E  \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{\init\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{$\init ##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}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$

$\Dragon{002}{002} {5}{5} % Level 1 $
$\NextDragon\Dragon{002}{002} {6}{6} % Level 2 $
$\NextDragon\Dragon{003}{002} {6}{7} % Level 3 $
$\NextDragon\Dragon{005}{002} {8}{8} % Level 4 $
$\NextDragon\Dragon{007}{004} {10}{9} % Level 5 $
<br/>
$\NextDragon\Dragon{009}{007} {12}{12} % Level 6 $
$\NextDragon\Dragon{007}{012} {13}{16} % Level 7 $
$\NextDragon\Dragon{006}{015} {20}{20} % Level 8 $
<br/>
$\NextDragon\Dragon{006}{012} {28}{23} % Level 9 $
<br/>
$\NextDragon\Dragon{006}{010} {36}{36} % Level 10 $
<br/>
$\NextBigDragon$$\BigDragon{019}{009} {41}{52} % Level 11 $
<br/>
$\NextBigDragon$$\BigDragon{049}{010} {68}{68} % level 12 $
$\NextBigDragon$$\BigDragon{085}{036} {102}{79} % Level 13 $
$\NextBigDragon$$\BigDragon{113}{095} {132}{132} % Level 14 $
$\NextBigDragon$$\BigDragon{083}{164} {153}{196} % Level 15 $
$\NextBigDragon$$\BigDragon{071}{223} {262}{260} % Level 16 $
$\NextBigDragon$$\BigDragon{062}{164} {389}{302} % Level 17 $
$\NextBigDragon$$\BigDragon{071}{138} {518}{516} % Level 18 $
$\NextBigDragon$$\BigDragon{277}{121} {604}{771} % Level 19 $

$\endgroup\safe$
  • Using \Corners

    Level 14 dragon - angled corners

  • Using \RoundCorners

    Level 14 dragon - rounded corners

  • Using \TransparentBlocks

    Level 14 dragon - transparent colored blocks

$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  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\SE{\kern.47ex\Rule{.06ex}{.53ex}{0ex}\raise.47ex{\Rule{.47ex}{.06ex}{0ex}}}
\def\SW{\raise.47ex{\Rule{.47ex}{.06ex}{0ex}}\Rule{.06ex}{.53ex}{0ex}}
\def\NE{\kern.47ex\raise.47ex{\Rule{.06ex}{.53ex}{0ex}\Rule{.47ex}{.06ex}{0ex}}}
\def\NW{\raise.47ex{\Rule{.47ex}{.06ex}{0ex}\Rule{.06ex}{.53ex}{0ex}}}
}
\def\HalfBlocks{
\def\SE{\kern.47ex\Rule{.53ex}{.53ex}{0ex}}
\def\SW{\Rule{.53ex}{.53ex}{0ex}}
\def\NE{\kern.47ex\raise.47ex{\Rule{.53ex}{.53ex}{0ex}}}
\def\NW{\raise.47ex{\Rule{.53ex}{.53ex}{0ex}}}
}
\def\TwoThirdBlocks{
\def\SE{\kern.33ex\Rule{.67ex}{.67ex}{0ex}}
\def\SW{\Rule{.67ex}{.67ex}{0ex}}
\def\NE{\kern.33ex\raise.33ex{\Rule{.67ex}{.67ex}{0ex}}}
\def\NW{\raise.33ex{\Rule{.67ex}{.67ex}{0ex}}}
}
\def\FullBlocks{
\def\SE{\Rule{1ex}{1ex}{0ex}}
\let\SW=\SE \let\NW=\SE \let\NE=\SE
}
\def\ColoredBlocks{
\def\SE{\kern.47ex\color{red}{\Rule{.53ex}{.53ex}{0ex}}}
\def\SW{\color{blue}{\Rule{.53ex}{.53ex}{0ex}}}
\def\NE{\kern.47ex\raise.47ex{\color{green}{\Rule{.53ex}{.53ex}{0ex}}}}
\def\NW{\raise.47ex{\color{orange}{\Rule{.53ex}{.53ex}{0ex}}}}
}
\def\ColoredTwoThirdBlocks{
\def\SE{\kern.33ex\color{red}{\Rule{.67ex}{.67ex}{0ex}}}
\def\SW{\color{blue}{\Rule{.67ex}{.67ex}{0ex}}}
\def\NE{\kern.33ex\raise.33ex{\color{green}{\Rule{.67ex}{.67ex}{0ex}}}}
\def\NW{\raise.33ex{\color{orange}{\Rule{.67ex}{.67ex}{0ex}}}}
}
\def\ColoredFullBlocks{
\def\SE{\color{red}{\Rule{1ex}{1ex}{0ex}}}
\def\SW{\color{blue}{\Rule{1ex}{1ex}{0ex}}}
\def\NE{\color{green}{\Rule{1ex}{1ex}{0ex}}}
\def\NW{\color{orange}{\Rule{1ex}{1ex}{0ex}}}
}
\def\TransparentBlocks{
\def\SE{\style{opacity:.5}{\color{red}{\Rule{1ex}{1ex}{0ex}}}}
\def\SW{\style{opacity:.5}{\color{blue}{\Rule{1ex}{1ex}{0ex}}}}
\def\NE{\style{opacity:.5}{\color{green}{\Rule{1ex}{1ex}{0ex}}}}
\def\NW{\style{opacity:.5}{\color{orange}{\Rule{1ex}{1ex}{0ex}}}}
}
\def\RoundCorners{
\def\SE{\style{font-size:85%}{\unicode{x256D}}}
\def\SW{\style{font-size:85%}{\unicode{x256E}}}
\def\NE{\style{font-size:85%}{\unicode{x2570}}}
\def\NW{\style{font-size:85%}{\unicode{x256F}}}
}
\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\NW  R\E \S\SW  L\S \E\NE  R\S \W\NW  L\W \S\SE  R\W \N\NE  L\N \W\SW  R\N \E\SE  \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) $
$\require{begingroup}\begingroup \def\safe{\text{\endgroup error}}$
$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  Some utility functions:
%
%
%  Make a large rectangle to surround the dragon.
%
\def\Board#1#2{\bbox[border:1px solid black]{\xspace{#1}\Rule{0em}{#2em}{0em}}}
%
%  Place a letter at the right location on the board.
%
\def\Place#1#2#3{\smash{\rlap{\xspace{#1}\raise{#2em}{#3}}}}
%
%  Do the horizontal space (the letters are a bit bigger than an ex at 
%  \small size, so add extra space via pts).
%
\def\init{\sf\small}
\def\xspace#1{\hskip #1ex\hskip #1pt \hskip #1pt \hskip #1pt}
%\def\init{\sf\tiny}           %  for \BigDragons, use these two lines
%\def\xspace#1{\hskip #1ex}    %    and comment out the previous two
%
%  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}{\kern-1.25pt\raise2pt\bigcirc}}}    % for \tiny
\def\Marker#1#2#3{} % don't put in markers -- comment out to show them
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  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{
  \Place{#1}{#2}#4
  \def\T##1#4#3 ##2##3\T{##2{#1}{#2}##2 }
  \T L\E \N  R\E \S  L\S \E  R\S \W  L\W \S  R\W \N  L\N \W  R\N \E  \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{\init\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{$\init ##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}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$

$\Dragon{002}{002} {5}{5} % Level 1 $
$\NextDragon\Dragon{002}{002} {6}{6} % Level 2 $
$\NextDragon\Dragon{003}{002} {6}{7} % Level 3 $
$\NextDragon\Dragon{005}{002} {8}{8} % Level 4 $
$\NextDragon\Dragon{007}{004} {10}{9} % Level 5 $
<br/>
$\NextDragon\Dragon{009}{007} {12}{12} % Level 6 $
$\NextDragon\Dragon{007}{012} {13}{16} % Level 7 $
$\NextDragon\Dragon{006}{015} {20}{20} % Level 8 $
<br/>
$\NextDragon\Dragon{006}{012} {28}{23} % Level 9 $
<br/>
$\NextDragon\Dragon{006}{010} {36}{36} % Level 10 $
<br/>
$\NextBigDragon$$\BigDragon{019}{009} {41}{52} % Level 11 $
<br/>
$\NextBigDragon$$\BigDragon{049}{010} {68}{68} % level 12 $
$\NextBigDragon$$\BigDragon{085}{036} {102}{79} % Level 13 $
$\NextBigDragon$$\BigDragon{113}{095} {132}{132} % Level 14 $
$\NextBigDragon$$\BigDragon{083}{164} {153}{196} % Level 15 $
$\NextBigDragon$$\BigDragon{071}{223} {262}{260} % Level 16 $
$\NextBigDragon$$\BigDragon{062}{164} {389}{302} % Level 17 $
$\NextBigDragon$$\BigDragon{071}{138} {518}{516} % Level 18 $
$\NextBigDragon$$\BigDragon{277}{121} {604}{771} % Level 19 $

$\endgroup\safe$
  • Using \Corners

    Level 14 dragon - angled corners

  • Using \RoundCorners

    Level 14 dragon - rounded corners

  • Using \TransparentBlocks

    Level 14 dragon - transparent colored blocks

  • Using \Diagonals

    Level 14 dragon - diagonal corners

$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  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\SE{\kern.47ex\Rule{.06ex}{.53ex}{0ex}\raise.47ex{\Rule{.47ex}{.06ex}{0ex}}}
  \def\SW{\raise.47ex{\Rule{.47ex}{.06ex}{0ex}}\Rule{.06ex}{.53ex}{0ex}}
  \def\NE{\kern.47ex\raise.47ex{\Rule{.06ex}{.53ex}{0ex}\Rule{.47ex}{.06ex}{0ex}}}
  \def\NW{\raise.47ex{\Rule{.47ex}{.06ex}{0ex}\Rule{.06ex}{.53ex}{0ex}}}
}
\def\HalfBlocks{
  \def\SE{\kern.47ex\Rule{.53ex}{.53ex}{0ex}}
  \def\SW{\Rule{.53ex}{.53ex}{0ex}}
  \def\NE{\kern.47ex\raise.47ex{\Rule{.53ex}{.53ex}{0ex}}}
  \def\NW{\raise.47ex{\Rule{.53ex}{.53ex}{0ex}}}
}
\def\TwoThirdBlocks{
  \def\SE{\kern.33ex\Rule{.67ex}{.67ex}{0ex}}
  \def\SW{\Rule{.67ex}{.67ex}{0ex}}
  \def\NE{\kern.33ex\raise.33ex{\Rule{.67ex}{.67ex}{0ex}}}
  \def\NW{\raise.33ex{\Rule{.67ex}{.67ex}{0ex}}}
}
\def\FullBlocks{
  \def\SE{\Rule{1ex}{1ex}{0ex}}
  \let\SW=\SE \let\NW=\SE \let\NE=\SE
}
\def\ColoredBlocks{
  \def\SE{\kern.47ex\color{red}{\Rule{.53ex}{.53ex}{0ex}}}
  \def\SW{\color{blue}{\Rule{.53ex}{.53ex}{0ex}}}
  \def\NE{\kern.47ex\raise.47ex{\color{green}{\Rule{.53ex}{.53ex}{0ex}}}}
  \def\NW{\raise.47ex{\color{orange}{\Rule{.53ex}{.53ex}{0ex}}}}
}
\def\ColoredTwoThirdBlocks{
  \def\SE{\kern.33ex\color{red}{\Rule{.67ex}{.67ex}{0ex}}}
  \def\SW{\color{blue}{\Rule{.67ex}{.67ex}{0ex}}}
  \def\NE{\kern.33ex\raise.33ex{\color{green}{\Rule{.67ex}{.67ex}{0ex}}}}
  \def\NW{\raise.33ex{\color{orange}{\Rule{.67ex}{.67ex}{0ex}}}}
}
\def\ColoredFullBlocks{
  \def\SE{\color{red}{\Rule{1ex}{1ex}{0ex}}}
  \def\SW{\color{blue}{\Rule{1ex}{1ex}{0ex}}}
  \def\NE{\color{green}{\Rule{1ex}{1ex}{0ex}}}
  \def\NW{\color{orange}{\Rule{1ex}{1ex}{0ex}}}
}
\def\TransparentBlocks{
  \def\SE{\style{opacity:.5}{\color{red}{\Rule{1ex}{1ex}{0ex}}}}
  \def\SW{\style{opacity:.5}{\color{blue}{\Rule{1ex}{1ex}{0ex}}}}
  \def\NE{\style{opacity:.5}{\color{green}{\Rule{1ex}{1ex}{0ex}}}}
  \def\NW{\style{opacity:.5}{\color{orange}{\Rule{1ex}{1ex}{0ex}}}}
}
\def\RoundCorners{
  \def\SE{\style{font-size:85%}{\unicode{x256D}}}
  \def\SW{\style{font-size:85%}{\unicode{x256E}}}
  \def\NE{\style{font-size:85%}{\unicode{x2570}}}
  \def\NW{\style{font-size:85%}{\unicode{x256F}}}
}
\def\RoundCorners{
  \def\SE{\style{font-size:85%}{\unicode{x256D}}}
  \def\SW{\style{font-size:85%}{\unicode{x256E}}}
  \def\NE{\style{font-size:85%}{\unicode{x2570}}}
  \def\NW{\style{font-size:85%}{\unicode{x256F}}}
}
\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\NW  R\E \S\SW  L\S \E\NE  R\S \W\NW  L\W \S\SE  R\W \N\NE  L\N \W\SW  R\N \E\SE  \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) $
Move most images to links. Add decorated dragons.
Source Link
Loading
Fix typos and fix image for level 18
Source Link
Loading
Adjust to level 19 (level 20 is requires 4-digit positions). Add images.
Source Link
Loading
Adjust to level 19 (level 20 is requires 4-digit positions). Add images.
Source Link
Loading
Update to handle \BigDragon up to level 20
Source Link
Loading
Change larger levels to images.
Source Link
Loading
Add solution to part 2.
Source Link
Loading
Renumber level #s to reflect renumbering in puzzle statement
Source Link
humn
  • 22k
  • 4
  • 60
  • 161
Loading
fix typo
Source Link
Loading
Source Link
Loading