1. Josef Kleber
  2. logicpuzzle

Wiki

Clone wiki

logicpuzzle / SunAndMoon

Sun and Moon

The environment enables the user to typeset 'Sun and Moon' logic puzzles (aka Sternenhaufen, Munraito, ...)
Enter exactly one star and one dark cloud in each row and each column of the grid, so that the planets are illuminated as specified. The stars shine horizontally or vertically arbitrarily far, but not through a planet or a dark cloud.

sun and moon puzzle

\begin{center}
  \begin{sunandmoon}
    \framepuzzle
    \setrow{5}{{},{},{},{},\Moon}
    \setrow{4}{{},{},\MoonTL}
    \setrow{3}{\Moon}
    \setrow{2}{{},\MoonR}
    \setrow{1}{{},{},{},\MoonT}
  \end{sunandmoon}
  \hspace{1.5cm}
  \begin{sunandmoon}
    \framepuzzle
    \setrow{5}{{},{},\Star,\Cloud,\Moon}
    \setrow{4}{{},\Star,\MoonTL,{},\Cloud}
    \setrow{3}{\Moon,\Cloud,{},{},\Star}
    \setrow{2}{\Cloud,\MoonR,{},\Star}
    \setrow{1}{\Star,{},\Cloud,\MoonT}
  \end{sunandmoon}
\end{center}

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

Documentation (PDF)

Examples & Solutions (PDF)


[Home]

Updated