From 5bdf51514141e1698e3ad64a72778cec9d47f3a2 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 10 May 2013 21:48:09 +0000 Subject: logicpuzzle (10may13) git-svn-id: svn://tug.org/texlive/trunk@30379 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/logicpuzzle/logicpuzzle.sty | 152 ++++++++-- Master/texmf-dist/tex/latex/logicpuzzle/lpenv.sty | 316 +++++++++++++++------ 2 files changed, 354 insertions(+), 114 deletions(-) (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty b/Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty index dbbc3e0b7a7..d16df95b6c8 100644 --- a/Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty +++ b/Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty @@ -19,7 +19,7 @@ %% %% This work consists of all files listed in manifest.txt. %% -\ProvidesPackage{logicpuzzle}[2013/05/03 logicpuzzle.sty v2.0 - Josef Kleber (C) 2013]% +\ProvidesPackage{logicpuzzle}[2013/05/10 logicpuzzle.sty v2.1 - Josef Kleber (C) 2013]% % \RequirePackage{xkeyval}% \RequirePackage{ifthen}% @@ -36,6 +36,8 @@ \pgfdeclarelayer{LPforegroundtwo}% \pgfsetlayers{LPdump,LPbgcolor,LPbackgroundtwo,LPbackground,main,LPforeground,LPforegroundtwo}% % +\newcounter{LP@rows}% +\newcounter{LP@columns}% \newcounter{LP@counter@unique}% \newcounter{LP@counti}% \newcounter{LP@countii}% @@ -69,17 +71,6 @@ % % init % -% #1 prefix -\newcommand*\LP@init@counter[1]% -{% - \newcounter{#1@rows}% - \newcounter{#1@columns}% - \setcounter{#1@rows}{\csname #1@rows\endcsname}% - \setcounter{#1@columns}{\csname #1@columns\endcsname}% - \stepcounter{#1@rows}% - \stepcounter{#1@columns}% -}% -% % #1 package prefix % #2 package % #3 option @@ -284,7 +275,7 @@ \stepcounter{LP@counter@unique}% \begin{pgfonlayer}{LPdump}% \node [shape=rectangle,inner sep=0pt] (A_\theLP@counter@unique) at (#1\LP@Pfive,#2\LP@Pfive) {\tikz\draw[scale=\LP@scale,color=\LP@sr@bgcolor] (0.08,0.1) rectangle (0.92,0.9);};% - \end{pgfonlayer}{LPdump} + \end{pgfonlayer}% \node [shape=rectangle,inner sep=0pt,anchor=north west,scale=\LP@scale,font=\tiny] at (A_\theLP@counter@unique.north west) {$#3$};% }% % @@ -484,6 +475,40 @@ \stepcounter{LP@countii}% }% % +\def\LP@KKR@print@element#1% +{% + \if!\ifnum9<1#1!\else_\fi% + \ifLP@KKR@solution% + \setcell{\arabic{LP@counti}}{\arabic{LP@countii}}{#1}% + \else% + \fi% + \else% + #1% + \fi% +}% +% +\newcommand*\kakurorow[2]% +{% + \setcounter{LP@counti}{1}% + \setcounter{LP@countii}{#1}% + \foreach \LP@element in {#2}% + {% + \LP@KKR@print@element{\LP@element}% + \stepcounter{LP@counti}% + };% +}% +% +\newcommand*\kakurocolumn[2]% +{% + \setcounter{LP@counti}{#1}% + \setcounter{LP@countii}{1}% + \foreach \LP@element in {#2}% + {% + \LP@KKR@print@element{\LP@element}% + \stepcounter{LP@countii}% + };% +}% +% \newcommand*\fillcell[2]% {% \LP@set@LP@scale{\LP@env@prefix}% @@ -675,7 +700,7 @@ % \newcommand*\LP@toprow@i[2]% {% - \LP@setrowcontents{#1}{1}{\csname the#2@rows\endcsname}% + \LP@setrowcontents{#1}{1}{\theLP@rows}% }% % \newcommand*\LP@rightcolumn[1]% @@ -685,7 +710,7 @@ % \newcommand*\LP@rightcolumn@i[2]% {% - \LP@setcolumncontents{#1}{\csname the#2@columns\endcsname}{1}% + \LP@setcolumncontents{#1}{\theLP@columns}{1}% }% % \newcommand*\LP@rightcolumn@edge[1]% @@ -695,7 +720,7 @@ % \newcommand*\LP@rightcolumn@edge@i[2]% {% - \LP@setcolumncontents@edge{#1}{\csname the#2@columns\endcsname}{1}% + \LP@setcolumncontents@edge{#1}{\theLP@columns}{1}% }% % % Presentation @@ -745,12 +770,12 @@ \newcommand*\LP@Cross% {% \LP@set@LP@scale{\LP@env@prefix}% - \begin{tikzpicture} - \begin{pgfonlayer}{LPforeground} + \begin{tikzpicture}% + \begin{pgfonlayer}{LPforeground}% \pgfmathsetmacro{\LPlinewidth}{3pt*\LP@scale}% \draw[line width=\LPlinewidth,scale=\LP@scale,color=LP@c@cross] (.35,.35) -- (0.65,.65) -- (.5,.5) -- (.65,.35)-- (.35,.65);% - \end{pgfonlayer} - \end{tikzpicture} + \end{pgfonlayer}% + \end{tikzpicture}% }% % \newcommand*\LP@Mirror[1]% @@ -768,7 +793,7 @@ % \newcommand*\LP@Mine% {% - \begin{tikzpicture}[scale=\LP@scale]% + \begin{tikzpicture}[scale=\LP@scale]% \fill[color=black] (.2,.5) -- (.5,.6) -- (.5,.4) -- cycle;% \fill[color=black] (.8,.5) -- (.5,.6) -- (.5,.4) -- cycle;% \fill[color=black] (.5,.8) -- (.4,.5) -- (.6,.5) -- cycle;% @@ -814,6 +839,81 @@ \egroup% }% % +\newcommand*\LP@Tree% +{% + \begin{tikzpicture}[scale=.07*\LP@scale]% + \draw[fill=brown!95!black!95,line width=.1pt*\LP@scale]% + (.75,-1) .. controls (.5,.5) and (.5,3) .. (0.5,4) --% + (-0.5,4) .. controls (-.5,3) and (-.5,.5) .. (-.75,-1);% + \shade[top color=green!50!black!60,draw=black,line width=.1pt*\LP@scale,bottom color=green!50!black]% + (0,10) .. controls (0,8) and (1,7) .. (1.5,7)% + .. controls (1,7) and (1,7) .. (0.5,7.25)% + .. controls (1.5,5) and (2.5,4) .. (3,4)% + .. controls (2,4) and (1.25,4) .. (1,4.5)% + .. controls (2,2) and (3.5,2) .. (4,2)% + .. controls (1,1) and (-1,1) .. (-4,2)% + .. controls (-3.5,2) and (-2,2) .. (-1,4.5)% + .. controls (-1.25,4) and (-2,4) .. (-3,4)% + .. controls (-2.5,4) and (-1.5,5) .. (-0.5,7.25)% + .. controls (-1,7) and (-1,7) .. (-1.5,7)% + .. controls (-1,7) and (0,8) .. (0,10);% + \end{tikzpicture}% +}% +% +\let\Tree\LP@Tree% +% +\newcommand*\LP@Tent% +{% + \begin{tikzpicture}[scale=\LP@scale]% + \draw[fill=yellow!50,line width=.1pt*\LP@scale] (.1,.1) -- (.6,.1) -- (.9,.5) -- (.75,.8) -- (.35,.6) -- cycle;% + \draw[line width=.1pt*\LP@scale] (.35,.6) -- (.35,.1);% + \draw[line width=.1pt*\LP@scale] (.35,.6) -- (.6,.1);% + \end{tikzpicture}% +}% +% +\let\Tent\LP@Tent% +% +\newcommand*\KKR[2]% +{% + \LP@set@LP@scale{\LP@env@prefix}% + \LP@set@LP@bgcolor{\LP@env@prefix}% + \LP@set@LP@color{\LP@env@prefix}% + \ifthenelse{\equal{\LP@bgcolor}{}}% + {\gdef\LP@sr@bgcolor{white}}% + {\gdef\LP@sr@bgcolor{\LP@bgcolor}}% + \stepcounter{LP@counter@unique}% + \begin{pgfonlayer}{LPdump}% + \node [shape=rectangle,inner sep=0pt] (A_\theLP@counter@unique) at (\arabic{LP@counti}\LP@Pfive,\arabic{LP@countii}\LP@Pfive) {\tikz\draw[scale=\LP@scale,color=\LP@sr@bgcolor] (0.08,0.1) rectangle (0.92,0.9);};% + \end{pgfonlayer}% + \begin{puzzlebackground}% + \fill[color=\LP@color] (\arabic{LP@counti},\arabic{LP@countii}) rectangle ++(1,1);% + \draw[line width=\LP@normallines] (\arabic{LP@counti},\arabic{LP@countii}) -- ++(0,1) -- ++(1,-1);% + \end{puzzlebackground}% + \node [shape=rectangle,inner sep=0pt,anchor=south west,scale=\LP@scale,font=\small] at (A_\theLP@counter@unique.south west) {#1};% + \node [shape=rectangle,inner sep=0pt,anchor=north east,scale=\LP@scale,font=\small] at (A_\theLP@counter@unique.north east) {#2};% +}% +% +\newcommand*\Black% +{% + \LP@set@LP@scale{\LP@env@prefix}% + \begin{puzzlebackground}% + \fill[color=black] (\arabic{LP@counti},\arabic{LP@countii}) rectangle ++(1,1);% + \end{puzzlebackground}% +}% +% +\newcommand*\LP@Diamond% +{% + \begin{tikzpicture}[scale=\LP@scale*.9]% + \clip (.05,.905) rectangle (.95,.1);% + \draw[line width=\LP@normallines,fill=yellow!20] (.5,.1) -- (.7,.9) -- (.3,.9) -- cycle;% + \draw[line width=\LP@normallines,fill=orange!20] (.5,.1) -- (.7,.9) -- (.9,.8) -- cycle;% + \draw[line width=\LP@normallines,fill=orange!20] (.5,.1) -- (.3,.9) -- (.1,.8) -- cycle;% + \draw[line width=\LP@normallines] (.1,.8) -- (.9,.8);% +\end{tikzpicture}% +}% +% +\let\Diamond\LP@Diamond% +% % get package options with prefix % \newcommand*\LP@set@LP@scale[1]% @@ -899,8 +999,6 @@ % \ProcessOptionsX\relax% % -\LP@init@counter{\LP@LP@init@prefix}% -% \let\logicpuzzlecell\setcell% % \newcommand*\logicpuzzlesetup[1]% @@ -913,10 +1011,10 @@ \setkeys{logicpuzzle}{#1}% \LP@set@package{logicpuzzle}% \LP@set@env@prefix{LP@LP}% - \setcounter{LP@LP@rows}{\LP@LP@rows}% - \setcounter{LP@LP@columns}{\LP@LP@columns}% - \stepcounter{LP@LP@rows}% - \stepcounter{LP@LP@columns}% + \setcounter{LP@rows}{\LP@LP@rows}% + \setcounter{LP@columns}{\LP@LP@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% \begin{minipage}[t]{\LP@LP@width}% \ifthenelse{\equal{\LP@LP@title}{}}% {\par\enspace\par}% empty diff --git a/Master/texmf-dist/tex/latex/logicpuzzle/lpenv.sty b/Master/texmf-dist/tex/latex/logicpuzzle/lpenv.sty index dc5ff8c261f..24bc8cfa2bd 100644 --- a/Master/texmf-dist/tex/latex/logicpuzzle/lpenv.sty +++ b/Master/texmf-dist/tex/latex/logicpuzzle/lpenv.sty @@ -20,7 +20,7 @@ %% This work consists of all files listed in manifest.txt. %% % -\ProvidesPackage{lpenv}[2013/05/03 lpenv.sty v2.0 - Josef Kleber (C) 2013]% +\ProvidesPackage{lpenv}[2013/05/10 lpenv.sty v2.1 - Josef Kleber (C) 2013]% % % battleship environment and options % @@ -43,8 +43,6 @@ \LP@define@key{\LP@BS@init@prefix}{\LP@BS@init@package}{sbshipscale}{1}% \LP@define@choicekey@fontsize{\LP@BS@init@prefix}{\LP@BS@init@package}{{Large}}% % -\LP@init@counter{\LP@BS@init@prefix}% -% \gdef\LP@BS@shipbox{}% \tikzstyle{island} = [fill=yellow!30,draw, decorate, decoration={random steps,segment length=2.7pt,amplitude=1.7pt}]% % @@ -85,7 +83,7 @@ % \newcommand*\shipH[1]% {% - \LP@setrowcontents{#1}{1}{\value{LP@BS@rows}}% + \LP@setrowcontents{#1}{1}{\value{LP@rows}}% }% % \newcommand*\shipV[1]% @@ -213,10 +211,10 @@ \LP@set@package{battleship}% \LP@set@env@prefix{LP@BS}% \shipbox{}% clear shipbox - \setcounter{LP@BS@rows}{\LP@BS@rows}% - \setcounter{LP@BS@columns}{\LP@BS@columns}% - \stepcounter{LP@BS@rows}% - \stepcounter{LP@BS@columns}% + \setcounter{LP@rows}{\LP@BS@rows}% + \setcounter{LP@columns}{\LP@BS@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% \begin{minipage}[t]{\LP@BS@width}% \ifthenelse{\equal{\LP@BS@title}{}}% {\par\enspace\par}% empty @@ -251,8 +249,6 @@ \LP@define@key{\LP@BK@init@prefix}{\LP@BK@init@package}{titlewidth}{5.85cm}% \LP@define@choicekey@fontsize{\LP@BK@init@prefix}{\LP@BK@init@package}{Large}% % -\LP@init@counter{\LP@BK@init@prefix}% -% \let\valueH\LP@bottomrow% \let\valueV\LP@leftcolumn% \let\sumH\LP@toprow% @@ -268,10 +264,10 @@ \setkeys{bokkusu}{#1}% \LP@set@package{bokkusu}% \LP@set@env@prefix{LP@BK}% - \setcounter{LP@BK@rows}{\LP@BK@rows}% - \setcounter{LP@BK@columns}{\LP@BK@columns}% - \stepcounter{LP@BK@rows}% - \stepcounter{LP@BK@columns}% + \setcounter{LP@rows}{\LP@BK@rows}% + \setcounter{LP@columns}{\LP@BK@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% \begin{minipage}[t]{\LP@BK@width}% \ifthenelse{\equal{\LP@BK@title}{}}% {\par\enspace\par}% empty @@ -304,8 +300,6 @@ \LP@define@key{\LP@CS@init@prefix}{\LP@CS@init@package}{titlewidth}{5.1cm}% \LP@define@choicekey@fontsize{\LP@CS@init@prefix}{\LP@CS@init@package}{Large}% % -\LP@init@counter{\LP@CS@init@prefix}% -% \let\chaossudokucell\setcell% % \newcommand*\chaossudokusetup[1]% @@ -318,10 +312,10 @@ \setkeys{chaossudoku}{#1}% \LP@set@package{chaossudoku}% \LP@set@env@prefix{LP@CS}% - \setcounter{LP@CS@rows}{\LP@CS@rows}% - \setcounter{LP@CS@columns}{\LP@CS@columns}% - \stepcounter{LP@CS@rows}% - \stepcounter{LP@CS@columns}% + \setcounter{LP@rows}{\LP@CS@rows}% + \setcounter{LP@columns}{\LP@CS@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% \begin{minipage}[t]{\LP@CS@width}% \ifthenelse{\equal{\LP@CS@title}{}}% {\par\enspace\par}% empty @@ -354,8 +348,6 @@ \LP@define@key{\LP@DDS@init@prefix}{\LP@DDS@init@package}{titlewidth}{5.1cm}% \LP@define@choicekey@fontsize{\LP@DDS@init@prefix}{\LP@DDS@init@package}{Large}% % -\LP@init@counter{\LP@DDS@init@prefix}% -% \let\ddsudokucell\setcell% % \newcommand*\ddsudokusetup[1]% @@ -368,10 +360,10 @@ \setkeys{ddsudoku}{#1}% \LP@set@package{ddsudoku}% \LP@set@env@prefix{LP@DDS}% - \setcounter{LP@DDS@rows}{\LP@DDS@rows}% - \setcounter{LP@DDS@columns}{\LP@DDS@columns}% - \stepcounter{LP@DDS@rows}% - \stepcounter{LP@DDS@columns}% + \setcounter{LP@rows}{\LP@DDS@rows}% + \setcounter{LP@columns}{\LP@DDS@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% \begin{minipage}[t]{\LP@DDS@width}% \ifthenelse{\equal{\LP@DDS@title}{}}% {\par\enspace\par}% empty @@ -404,8 +396,6 @@ \LP@define@key{\LP@HY@init@prefix}{\LP@HY@init@package}{titlewidth}{5.1cm}% \LP@define@choicekey@fontsize{\LP@HY@init@prefix}{\LP@HY@init@package}{Large}% % -\LP@init@counter{\LP@HY@init@prefix}% -% \let\hakyuucell\setcell% % \newcommand*\hakyuusetup[1]% @@ -418,10 +408,10 @@ \setkeys{hakyuu}{#1}% \LP@set@package{hakyuu}% \LP@set@env@prefix{LP@HY}% - \setcounter{LP@HY@rows}{\LP@HY@rows}% - \setcounter{LP@HY@columns}{\LP@HY@columns}% - \stepcounter{LP@HY@rows}% - \stepcounter{LP@HY@columns}% + \setcounter{LP@rows}{\LP@HY@rows}% + \setcounter{LP@columns}{\LP@HY@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% \begin{minipage}[t]{\LP@HY@width}% \ifthenelse{\equal{\LP@HY@title}{}}% {\par\enspace\par}% empty @@ -454,8 +444,6 @@ \LP@define@key{\LP@HT@init@prefix}{\LP@HT@init@package}{titlewidth}{5.1cm}% \LP@define@choicekey@fontsize{\LP@HT@init@prefix}{\LP@HT@init@package}{Large}% % -\LP@init@counter{\LP@HT@init@prefix}% -% \let\hitoricell\setcell% % \newcommand*\hitorisetup[1]% @@ -468,10 +456,10 @@ \setkeys{hitori}{#1}% \LP@set@package{hitori}% \LP@set@env@prefix{LP@HT}% - \setcounter{LP@HT@rows}{\LP@HT@rows}% - \setcounter{LP@HT@columns}{\LP@HT@columns}% - \stepcounter{LP@HT@rows}% - \stepcounter{LP@HT@columns}% + \setcounter{LP@rows}{\LP@HT@rows}% + \setcounter{LP@columns}{\LP@HT@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% \begin{minipage}[t]{\LP@HT@width}% \ifthenelse{\equal{\LP@HT@title}{}}% {\par\enspace\par}% empty @@ -487,6 +475,79 @@ \end{minipage}% }% % +% kakuro environment and options +% +\newcommand*\LP@KKR@init@prefix{LP@KKR}% +\newcommand*\LP@KKR@init@package{kakuro}% +% +\LP@define@key{\LP@KKR@init@prefix}{\LP@KKR@init@package}{rows}{5}% +\LP@define@key{\LP@KKR@init@prefix}{\LP@KKR@init@package}{columns}{5}% +\LP@define@key{\LP@KKR@init@prefix}{\LP@KKR@init@package}{scale}{1}% +\LP@define@key{\LP@KKR@init@prefix}{\LP@KKR@init@package}{counterstyle}{none}% +\LP@define@key{\LP@KKR@init@prefix}{\LP@KKR@init@package}{bgcolor}{}% +\LP@define@key{\LP@KKR@init@prefix}{\LP@KKR@init@package}{color}{green}% +\LP@define@key{\LP@KKR@init@prefix}{\LP@KKR@init@package}{width}{5.1cm}% +\LP@define@key{\LP@KKR@init@prefix}{\LP@KKR@init@package}{cvoffset}{-23pt}% +\LP@define@key{\LP@KKR@init@prefix}{\LP@KKR@init@package}{title}{}% +\LP@define@key{\LP@KKR@init@prefix}{\LP@KKR@init@package}{titleindent}{0cm}% +\LP@define@key{\LP@KKR@init@prefix}{\LP@KKR@init@package}{titlewidth}{5.1cm}% +\LP@define@choicekey@fontsize{\LP@KKR@init@prefix}{\LP@KKR@init@package}{Large}% +% +\newif\ifLP@KKR@solution\LP@KKR@solutionfalse% +% +\define@choicekey*{kakuro.sty}{solution}[\LP@KKR@solution\nr]{true,false}[true]% +{% + \ifcase\nr\relax% + \renewcommand*\LP@KKR@solution{true}% + \LP@KKR@solutiontrue% + \or% + \renewcommand*\LP@KKR@solution{false}% + \LP@KKR@solutionfalse% + \fi% +}% +% +\define@choicekey*{kakuro}{solution}[\LP@KKR@solution\nr]{true,false}[true]% +{% + \ifcase\nr\relax% + \renewcommand*\LP@KKR@solution{true}% + \LP@KKR@solutiontrue% + \or% + \renewcommand*\LP@KKR@solution{false}% + \LP@KKR@solutionfalse% + \fi% +}% +% +\let\kakurocell\setcell% +% +\newcommand*\kakurosetup[1]% +{% + \setkeys{kakuro.sty}{#1}% +}% +% +\newenvironment{kakuro}[1][]% +{% + \setkeys{kakuro}{#1}% + \LP@set@package{kakuro}% + \LP@set@env@prefix{LP@KKR}% + \setcounter{LP@rows}{\LP@KKR@rows}% + \setcounter{LP@columns}{\LP@KKR@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% + \begin{minipage}[t]{\LP@KKR@width}% + \ifthenelse{\equal{\LP@KKR@title}{}}% + {\par\enspace\par}% empty + {\enspace\par\noindent\hspace{\LP@KKR@titleindent}\parbox{\LP@KKR@titlewidth}{\strut\LP@titleformat\LP@KKR@title}\vspace{3mm}\par}% + \begin{tikzpicture}[scale=\LP@KKR@scale]% + \LP@drawbackground{1}{1}{\LP@KKR@columns}{\LP@KKR@rows}{\LP@KKR@bgcolor}% + \LP@drawgrid{1}{1}{\LP@KKR@columns}{\LP@KKR@rows}{1cm}% +}% +{% + \end{tikzpicture}% + \LP@drawcounter{\LP@KKR@counterstyle}% + \stepcounter{LP@puzzlecounter}% + \end{minipage}% +}% +% % kendoku environment and options % \newcommand*\LP@KD@init@prefix{LP@KD}% @@ -504,8 +565,6 @@ \LP@define@key{\LP@KD@init@prefix}{\LP@KD@init@package}{titlewidth}{5.1cm}% \LP@define@choicekey@fontsize{\LP@KD@init@prefix}{\LP@KD@init@package}{Large}% % -\LP@init@counter{\LP@KD@init@prefix}% -% \let\kendokucell\setcell% % \newcommand*\kendokusetup[1]% @@ -518,10 +577,10 @@ \setkeys{kendoku}{#1}% \LP@set@package{kendoku}% \LP@set@env@prefix{LP@KD}% - \setcounter{LP@KD@rows}{\LP@KD@rows}% - \setcounter{LP@KD@columns}{\LP@KD@columns}% - \stepcounter{LP@KD@rows}% - \stepcounter{LP@KD@columns}% + \setcounter{LP@rows}{\LP@KD@rows}% + \setcounter{LP@columns}{\LP@KD@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% \begin{minipage}[t]{\LP@KD@width}% \ifthenelse{\equal{\LP@KD@title}{}}% {\par\enspace\par}% empty @@ -554,8 +613,6 @@ \LP@define@key{\LP@KSDK@init@prefix}{\LP@KSDK@init@package}{titlewidth}{5.1cm}% \LP@define@choicekey@fontsize{\LP@KSDK@init@prefix}{\LP@KSDK@init@package}{Large}% % -\LP@init@counter{\LP@KSDK@init@prefix}% -% \let\killersudokucell\setcell% % \newcommand*\killersudokusetup[1]% @@ -568,10 +625,10 @@ \setkeys{killersudoku}{#1}% \LP@set@package{killersudoku}% \LP@set@env@prefix{LP@KSDK}% - \setcounter{LP@KSDK@rows}{\LP@KSDK@rows}% - \setcounter{LP@KSDK@columns}{\LP@KSDK@columns}% - \stepcounter{LP@KSDK@rows}% - \stepcounter{LP@KSDK@columns}% + \setcounter{LP@rows}{\LP@KSDK@rows}% + \setcounter{LP@columns}{\LP@KSDK@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% \begin{minipage}[t]{\LP@KSDK@width}% \ifthenelse{\equal{\LP@KSDK@title}{}}% {\par\enspace\par}% empty @@ -604,8 +661,6 @@ \LP@define@key{\LP@LB@init@prefix}{\LP@LB@init@package}{titlewidth}{6.5cm}% \LP@define@choicekey@fontsize{\LP@LB@init@prefix}{\LP@LB@init@package}{Large}% % -\LP@init@counter{\LP@LB@init@prefix}% -% \let\laserH\LP@toprow% \let\laserV\LP@leftcolumn% \let\mirrorH\LP@bottomrow@edge% @@ -614,7 +669,7 @@ \newcommand*\laser[2][red]% {% % avoid little laser peaks outside grid - \clip (1,1) rectangle (\arabic{LP@LB@columns},\arabic{LP@LB@rows}); + \clip (1,1) rectangle (\arabic{LP@columns},\arabic{LP@rows});% \framearea{#1}{#2}% }% % @@ -628,10 +683,10 @@ \setkeys{laserbeam}{#1}% \LP@set@package{laserbeam}% \LP@set@env@prefix{LP@LB}% - \setcounter{LP@LB@rows}{\LP@LB@rows}% - \setcounter{LP@LB@columns}{\LP@LB@columns}% - \stepcounter{LP@LB@rows}% - \stepcounter{LP@LB@columns}% + \setcounter{LP@rows}{\LP@LB@rows}% + \setcounter{LP@columns}{\LP@LB@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% \begin{minipage}[t]{\LP@LB@width}% \ifthenelse{\equal{\LP@LB@title}{}}% {\par\enspace\par}% empty @@ -664,8 +719,6 @@ \LP@define@key{\LP@SDK@init@prefix}{\LP@SDK@init@package}{titlewidth}{9.1cm}% \LP@define@choicekey@fontsize{\LP@SDK@init@prefix}{\LP@SDK@init@package}{Large}% % -\LP@init@counter{\LP@SDK@init@prefix}% -% \let\lpsudokucell\setcell% % \newcommand*\lpsudokusetup[1]% @@ -678,10 +731,10 @@ \setkeys{lpsudoku}{#1}% \LP@set@package{lpsudoku}% \LP@set@env@prefix{LP@SDK}% - \setcounter{LP@SDK@rows}{\LP@SDK@rows}% - \setcounter{LP@SDK@columns}{\LP@SDK@columns}% - \stepcounter{LP@SDK@rows}% - \stepcounter{LP@SDK@columns}% + \setcounter{LP@rows}{\LP@SDK@rows}% + \setcounter{LP@columns}{\LP@SDK@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% \begin{minipage}[t]{\LP@SDK@width}% \ifthenelse{\equal{\LP@SDK@title}{}}% {\par\enspace\par}% empty @@ -715,8 +768,6 @@ \LP@define@key{\LP@MS@init@prefix}{\LP@MS@init@package}{titlewidth}{5.1cm}% \LP@define@choicekey@fontsize{\LP@MS@init@prefix}{\LP@MS@init@package}{Large}% % -\LP@init@counter{\LP@MS@init@prefix}% -% \let\minesweepercell\setcell% % \newcommand*\minesweepersetup[1]% @@ -729,10 +780,10 @@ \setkeys{minesweeper}{#1}% \LP@set@package{minesweeper}% \LP@set@env@prefix{LP@MS}% - \setcounter{LP@MS@rows}{\LP@MS@rows}% - \setcounter{LP@MS@columns}{\LP@MS@columns}% - \stepcounter{LP@MS@rows}% - \stepcounter{LP@MS@columns}% + \setcounter{LP@rows}{\LP@MS@rows}% + \setcounter{LP@columns}{\LP@MS@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% \begin{minipage}[t]{\LP@MS@width}% \ifthenelse{\equal{\LP@MS@title}{}}% {\par\enspace\par}% empty @@ -748,6 +799,54 @@ \end{minipage}% }% % +% schatzsuche environment and options +% +\newcommand*\LP@SS@init@prefix{LP@SS}% +\newcommand*\LP@SS@init@package{schatzsuche}% +% +\LP@define@key{\LP@SS@init@prefix}{\LP@SS@init@package}{rows}{5}% +\LP@define@key{\LP@SS@init@prefix}{\LP@SS@init@package}{columns}{5}% +\LP@define@key{\LP@SS@init@prefix}{\LP@SS@init@package}{scale}{1}% +\LP@define@key{\LP@SS@init@prefix}{\LP@SS@init@package}{counterstyle}{none}% +\LP@define@key{\LP@SS@init@prefix}{\LP@SS@init@package}{bgcolor}{}% +\LP@define@key{\LP@SS@init@prefix}{\LP@SS@init@package}{width}{5.1cm}% +\LP@define@key{\LP@SS@init@prefix}{\LP@SS@init@package}{cvoffset}{-23pt}% +\LP@define@key{\LP@SS@init@prefix}{\LP@SS@init@package}{title}{}% +\LP@define@key{\LP@SS@init@prefix}{\LP@SS@init@package}{titleindent}{0cm}% +\LP@define@key{\LP@SS@init@prefix}{\LP@SS@init@package}{titlewidth}{5.1cm}% +\LP@define@choicekey@fontsize{\LP@SS@init@prefix}{\LP@SS@init@package}{Large}% +% +\let\schatzsuchecell\setcell% +% +\newcommand*\schatzsuchesetup[1]% +{% + \setkeys{schatzsuche.sty}{#1}% +}% +% +\newenvironment{schatzsuche}[1][]% +{% + \setkeys{schatzsuche}{#1}% + \LP@set@package{schatzsuche}% + \LP@set@env@prefix{LP@SS}% + \setcounter{LP@rows}{\LP@SS@rows}% + \setcounter{LP@columns}{\LP@SS@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% + \begin{minipage}[t]{\LP@SS@width}% + \ifthenelse{\equal{\LP@SS@title}{}}% + {\par\enspace\par}% empty + {\enspace\par\noindent\hspace{\LP@SS@titleindent}\parbox{\LP@SS@titlewidth}{\strut\LP@titleformat\LP@SS@title}\vspace{3mm}\par}% + \begin{tikzpicture}[scale=\LP@SS@scale]% + \LP@drawbackground{1}{1}{\LP@SS@columns}{\LP@SS@rows}{\LP@SS@bgcolor}% + \LP@drawgrid{1}{1}{\LP@SS@columns}{\LP@SS@rows}{1cm}% +}% +{% + \end{tikzpicture}% + \LP@drawcounter{\LP@SS@counterstyle}% + \stepcounter{LP@puzzlecounter}% + \end{minipage}% +}% +% % skyline environment and options % \newcommand*\LP@SL@init@prefix{LP@SL}% @@ -789,8 +888,6 @@ \fi% }% % -\LP@init@counter{\LP@SL@init@prefix}% -% \let\skylineB\LP@bottomrow% \let\skylineT\LP@toprow% \let\skylineL\LP@leftcolumn% @@ -807,10 +904,10 @@ \setkeys{skyline}{#1}% \LP@set@package{skyline}% \LP@set@env@prefix{LP@SL}% - \setcounter{LP@SL@rows}{\LP@SL@rows}% - \setcounter{LP@SL@columns}{\LP@SL@columns}% - \stepcounter{LP@SL@rows}% - \stepcounter{LP@SL@columns}% + \setcounter{LP@rows}{\LP@SL@rows}% + \setcounter{LP@columns}{\LP@SL@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% \begin{minipage}[t]{\LP@SL@width}% \ifthenelse{\equal{\LP@SL@title}{}}% {\par\enspace\par}% empty @@ -846,8 +943,6 @@ \LP@define@key{\LP@SK@init@prefix}{\LP@SK@init@package}{titlewidth}{5.2cm}% \LP@define@choicekey@fontsize{\LP@SK@init@prefix}{\LP@SK@init@package}{Large}% % -\LP@init@counter{\LP@SK@init@prefix}% -% \let\slitherlinkcell\setcell% % \newcommand*\slitherlinksetup[1]% @@ -862,10 +957,10 @@ \LP@set@env@prefix{LP@SK}% \ifthenelse{\equal{\LP@grid@linestyle}{}}% {\setgridlinestyle{dashed}}{}% - \setcounter{LP@SK@rows}{\LP@SK@rows}% - \setcounter{LP@SK@columns}{\LP@SK@columns}% - \stepcounter{LP@SK@rows}% - \stepcounter{LP@SK@columns}% + \setcounter{LP@rows}{\LP@SK@rows}% + \setcounter{LP@columns}{\LP@SK@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% \begin{minipage}[t]{\LP@SK@width}% \ifthenelse{\equal{\LP@SK@title}{}}% {\par\enspace\par}% empty @@ -882,6 +977,55 @@ \end{minipage}% }% % +% tentsandtrees environment and options +% +\newcommand*\LP@TAT@init@prefix{LP@TAT}% +\newcommand*\LP@TAT@init@package{tentsandtrees}% +% +\LP@define@key{\LP@TAT@init@prefix}{\LP@TAT@init@package}{rows}{5}% +\LP@define@key{\LP@TAT@init@prefix}{\LP@TAT@init@package}{columns}{5}% +\LP@define@key{\LP@TAT@init@prefix}{\LP@TAT@init@package}{scale}{1}% +\LP@define@key{\LP@TAT@init@prefix}{\LP@TAT@init@package}{counterstyle}{none}% +\LP@define@key{\LP@TAT@init@prefix}{\LP@TAT@init@package}{bgcolor}{}% +\LP@define@key{\LP@TAT@init@prefix}{\LP@TAT@init@package}{width}{5.9cm}% +\LP@define@key{\LP@TAT@init@prefix}{\LP@TAT@init@package}{cvoffset}{-23pt}% +\LP@define@key{\LP@TAT@init@prefix}{\LP@TAT@init@package}{title}{}% +\LP@define@key{\LP@TAT@init@prefix}{\LP@TAT@init@package}{titleindent}{0cm}% +\LP@define@key{\LP@TAT@init@prefix}{\LP@TAT@init@package}{titlewidth}{5.9cm}% +\LP@define@choicekey@fontsize{\LP@TAT@init@prefix}{\LP@TAT@init@package}{Large}% +% +\let\tentH\LP@toprow% +\let\tentV\LP@leftcolumn% +% +\newcommand*\tentsandtreessetup[1]% +{% + \setkeys{tentsandtrees.sty}{#1}% +}% +% +\newenvironment{tentsandtrees}[1][]% +{% + \setkeys{tentsandtrees}{#1}% + \LP@set@package{tentsandtrees}% + \LP@set@env@prefix{LP@TAT}% + \setcounter{LP@rows}{\LP@TAT@rows}% + \setcounter{LP@columns}{\LP@TAT@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% + \begin{minipage}[t]{\LP@TAT@width}% + \ifthenelse{\equal{\LP@TAT@title}{}}% + {\par\enspace\par}% empty + {\enspace\par\noindent\hspace{\LP@TAT@titleindent}\parbox{\LP@TAT@titlewidth}{\strut\LP@titleformat\LP@TAT@title}\vspace{3mm}\par}% + \begin{tikzpicture}[scale=\LP@TAT@scale]% + \LP@drawbackground{1}{1}{\LP@TAT@columns}{\LP@TAT@rows}{\LP@TAT@bgcolor}% + \LP@drawgrid{1}{1}{\LP@TAT@columns}{\LP@TAT@rows}{1cm}% +}% +{% + \end{tikzpicture}% + \LP@drawcounter{\LP@TAT@counterstyle}% + \stepcounter{LP@puzzlecounter}% + \end{minipage}% +}% +% % tunnel environment and options % \newcommand*\LP@TN@init@prefix{LP@TN}% @@ -899,8 +1043,6 @@ \LP@define@key{\LP@TN@init@prefix}{\LP@TN@init@package}{titlewidth}{5.9cm}% \LP@define@choicekey@fontsize{\LP@TN@init@prefix}{\LP@TN@init@package}{Large}% % -\LP@init@counter{\LP@TN@init@prefix}% -% \let\tunnelH\LP@toprow% \let\tunnelV\LP@leftcolumn% % @@ -914,10 +1056,10 @@ \setkeys{tunnel}{#1}% \LP@set@package{tunnel}% \LP@set@env@prefix{LP@TN}% - \setcounter{LP@TN@rows}{\LP@TN@rows}% - \setcounter{LP@TN@columns}{\LP@TN@columns}% - \stepcounter{LP@TN@rows}% - \stepcounter{LP@TN@columns}% + \setcounter{LP@rows}{\LP@TN@rows}% + \setcounter{LP@columns}{\LP@TN@columns}% + \stepcounter{LP@rows}% + \stepcounter{LP@columns}% \begin{minipage}[t]{\LP@TN@width}% \ifthenelse{\equal{\LP@TN@title}{}}% {\par\enspace\par}% empty -- cgit v1.2.3