Wiki

Clone wiki

logicpuzzle / Bridges

Bridges

The environment enables the user to typeset Bridges logic puzzles (aka Brückenbau, Hashi, ...)
Connect all the islands (circles) located in the grid by bridges. The bridges may only be routed horizontally and vertically. Islands may be connected by a maximum of two bridges. The bridges must neither overlap nor cross. They may also not be built over islands. The numbers in the islands indicate how many bridges originate from this island. All islands must be fully connected.

bridges puzzle

#!TeX
\colorlet{LP@c@bridge}{Teal}
\begin{center}
  \begin{bridges}
    \framepuzzle
    \bridgesrow{8}{{},4,{},{},{},5,{},2}
    \bridgesrow{7}{{},{},1}
    \bridgesrow{5}{{},{},3,{},4}
    \bridgesrow{4}{{},3,{},1,{},2}
    \bridgesrow{3}{{},{},{},{},{},{},{}}
    \bridgesrow{2}{{},2,{},{},5,{},{},2}
  \end{bridges}
  \hspace{1.5cm}
  \begin{bridges}[grid=none]
    \framepuzzle
    \bridgesrow{8}{{},4,{},{},{},5,{},2}
    \bridgesrow{7}{{},{},1}
    \bridgesrow{5}{{},{},3,{},4}
    \bridgesrow{4}{{},3,{},1,{},2}
    \bridgesrow{3}{{},{},{},{},{},{},{}}
    \bridgesrow{2}{{},2,{},{},5,{},{},2}
    \bridge[double]{\tikzpath{2}{4}{8,8,8,8,6,6,6,6,2,2,2,2}}
    \bridge[double]{\tikzpath{2}{2}{6,6,6,8,8,8,4,4}}
    \bridge{\tikzpath{2}{4}{6,6}}
    \bridge{\tikzpath{3}{5}{8,8}}
    \bridge{\tikzpath{5}{2}{6,6,6,8,8,8,8,8,8,4,4}}
  \end{bridges}
\end{center}

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

Documentation (PDF)

Examples & Solutions (PDF)


[Home]

Updated