Wiki

Clone wiki

logicpuzzle / TentsAndTrees

Tents and Trees

The environment enables the user to typeset Tents and Trees logic puzzles (aka Zeltlager, Zeltplatz, Camping, ...). Draw tents in the grid. Next to each tree, a tent must be entered in a horizontally or vertically adjacent cell, which is associated with this tree. The numbers next to the grid indicate the quantity of tents in each row or column. No tent can stand directly next to another one, not even diagonally. Here’s a little self-explanatory example:

Tents and Trees

\begin{center}
  \begin{tentsandtrees}
    \framepuzzle
    \tentH{1,2,1,1,2}
    \tentV{2,0,2,0,3}
    \setrow{4}{\Tree,{},\Tree,\Tree,\Tree}
    \setrow{2}{{},\Tree}
    \setrow{1}{\Tree,{},{},\Tree}
  \end{tentsandtrees}
  \hspace{1.5cm}
  \begin{tentsandtrees}
    \framepuzzle
    \tentH{1,2,1,1,2}
    \tentV{2,0,2,0,3}
    \setrow{5}{\Tent,{},\Tent,{},\Tent,}
    \setrow{4}{\Tree,{},\Tree,\Tree,\Tree}
    \setrow{3}{{},\Tent,{},\Tent}
    \setrow{2}{{},\Tree}
    \setrow{1}{\Tree,\Tent,{},\Tree,\Tent}
  \end{tentsandtrees}
\end{center}

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

Documentation (PDF)

Examples & Solutions (PDF)


[Home]

Updated