Wiki

Clone wiki

logicpuzzle / MagicLabyrinth

Magic Labyrinth

The environment enables the user to typeset Magic Labyrinth logic puzzles (aka Magic Spiral, Magisches Labyrinth, ...)
Enter the numbers 1 to N into the grid. Each number can appear only once in each column and row. Following the labyrinth from the outside inwards, then the given number sequence must be repeated continuously.

magiclabyrinth puzzle

#!TeX
\begin{magiclabyrinth}
  \mlline{\xtikzpath{1}{6}{6/5,2/5,4/5,8/4,6/4,2/3,4/3,8/2,6/2,2/1,4/1}}
  \setcells{1/1,2/4,4/5}{3}
  \magiclabyrinthcell{4}{2}{2}
  \magiclabyrinthcell{5}{4}{1}
\end{magiclabyrinth}
\hspace{1.5cm}
\begin{magiclabyrinth}
  \mlline{\xtikzpath{1}{6}{6/5,2/5,4/5,8/4,6/4,2/3,4/3,8/2,6/2,2/1,4/1}}
  \setrow{5}{{},1,2,3}
  \setrow{4}{2,3,{},{},1}
  \setrow{3}{{},{},3,1,2}
  \setrow{2}{1,{},{},2,3}
  \setrow{1}{3,2,1}
\end{magiclabyrinth}

You will find the current release in the Downloads tab and on CTAN.

Documentation (PDF)

Examples & Solutions (PDF)


[Home]

Updated