diff options
author | Karl Berry <karl@freefriends.org> | 2013-03-10 22:26:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-03-10 22:26:40 +0000 |
commit | db952596f9303b8c5f81d8cabbb87220c06308cc (patch) | |
tree | 868c220f6025a022274a939da896f674b4baab57 /Master | |
parent | ce491a1586dcdd7e3389230d2c83044fcec07b4b (diff) |
logicpuzzle (10mar13)
git-svn-id: svn://tug.org/texlive/trunk@29328 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/logicpuzzle/CHANGES | 36 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/logicpuzzle/README | 15 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/logicpuzzle/manifest.txt | 3 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/logicpuzzle/skyline/skyline.pdf | bin | 0 -> 110322 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/logicpuzzle/skyline/skyline.tex | 446 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/logicpuzzle/skyline/skyline_README | 12 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/logicpuzzle/bokkusu.sty | 7 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty | 86 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/logicpuzzle/skyline.sty | 262 |
9 files changed, 849 insertions, 18 deletions
diff --git a/Master/texmf-dist/doc/latex/logicpuzzle/CHANGES b/Master/texmf-dist/doc/latex/logicpuzzle/CHANGES index b74f78dfd9d..6334544da58 100644 --- a/Master/texmf-dist/doc/latex/logicpuzzle/CHANGES +++ b/Master/texmf-dist/doc/latex/logicpuzzle/CHANGES @@ -1,3 +1,37 @@ +== Logicpuzzle bundel (v1.4) == + +-- skyline.sty (v1.0) -- + +06/03/2013 added option sudoku [jk] + +05/03/2013 added \skylinecell [jk] + +05/03/2013 added skelton of skyline.sty [jk] + +-- bokkusu.sty (v1.1) -- + +05/03/2013 added \lets for \valueH, \valueV, + \sumH, \sumV [jk] + see: logicpuzzle.sty v1.2 (05/03/2012) + +-- logicpuzzle.sty (v1.2) -- + +06/03/2013 added \LP@drawsudokugrid [jk] + +06/03/2013 added \setcell [jk] + +06/03/2013 added \framearea, \fillarea [jk] + +06/03/2013 added environments puzzlebackground, puzzleforeground [jk] + -> added pgf layer LPbackground, LPforeground + +05/03/2013 deleted option color [jk] + +05/03/2013 added \setrow, \setcolumn [jk] + +05/03/2013 added \LP@bottomrow, \LP@toprow, + \LP@leftcolumn. \LP@leftcolumn [jk] + == Logicpuzzle bundel (v1.3) == -- bokkusu.sty (v1.0) -- @@ -9,7 +43,7 @@ 27/02/2013 added option cvoffset [jk] to set indiviual vertical counter offsets --- logicpuzzle.sty (v1.3) -- +-- logicpuzzle.sty (v1.1) -- 26/02/2013 added \LP@ingrid to \fillcell [jk] diff --git a/Master/texmf-dist/doc/latex/logicpuzzle/README b/Master/texmf-dist/doc/latex/logicpuzzle/README index 3adf9fcc758..fbe0ecf9a42 100644 --- a/Master/texmf-dist/doc/latex/logicpuzzle/README +++ b/Master/texmf-dist/doc/latex/logicpuzzle/README @@ -2,16 +2,17 @@ The logicpuzzle bundle allows you to typeset various logic puzzles. At the moment the following puzzles are supported: * Battleship (aka Bimaru, Marinespiel, Batalla Naval, ...) -* Bokkusu (aka Kakurasu, Feldersummenrätsel, ...) +* Bokkusu (aka Kakurasu, Feldersummenrätsel, ...) +* Skyline (aka Skycrapers, Wolkenkratzer, Hochhäuser, ...) + incl. Skyline Sudoku and Skyline Sudoku (N*N) variants * more to come License: LPPL -Changes in v1.3: +Changes in v1.4: -- the logicpuzzle bundle replaces the now obsolete - battleship package +- added support for Skyline puzzle + https://bitbucket.org/kleberj/logicpuzzle/wiki/Skyline -- added support for Bokkusu puzzle - -- added option cvoffset to battleship.sty
\ No newline at end of file +- added new commands to logicpuzzle.sty + see: CHANGES
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/logicpuzzle/manifest.txt b/Master/texmf-dist/doc/latex/logicpuzzle/manifest.txt index 27f44fb963f..f57337cafe9 100644 --- a/Master/texmf-dist/doc/latex/logicpuzzle/manifest.txt +++ b/Master/texmf-dist/doc/latex/logicpuzzle/manifest.txt @@ -6,6 +6,7 @@ This work consists of the following files: logicpuzzle.sty battleship.sty bokkusu.sty +skyline.sty -- Documentation -- @@ -13,6 +14,8 @@ battleship.pdf battleship.tex bokkusu.pdf bokkusu.tex +skyline.pdf +skyline.tex -- Misc. Files -- diff --git a/Master/texmf-dist/doc/latex/logicpuzzle/skyline/skyline.pdf b/Master/texmf-dist/doc/latex/logicpuzzle/skyline/skyline.pdf Binary files differnew file mode 100644 index 00000000000..bfaae93766e --- /dev/null +++ b/Master/texmf-dist/doc/latex/logicpuzzle/skyline/skyline.pdf diff --git a/Master/texmf-dist/doc/latex/logicpuzzle/skyline/skyline.tex b/Master/texmf-dist/doc/latex/logicpuzzle/skyline/skyline.tex new file mode 100644 index 00000000000..fe7201f9fe2 --- /dev/null +++ b/Master/texmf-dist/doc/latex/logicpuzzle/skyline/skyline.tex @@ -0,0 +1,446 @@ +\documentclass[a4paper]{ltxdoc}% +\usepackage[english]{babel}% +\usepackage[latin1]{inputenc}% +\usepackage[T1]{fontenc}% +\usepackage{textcomp}% +\usepackage{lmodern}% +\usepackage{bera}% +\usepackage{ccicons} +\usepackage{microtype}% +\usepackage{ltxdocext}% +\usepackage{listings} +\usepackage{marginnote}% +\usepackage[svgnames,rgb]{xcolor}% +\usepackage[automark,nouppercase]{scrpage2} +\usepackage[width=5cm,scale=0.73,fontsize=normalsize]{skyline}% +\usepackage{hyperref} +% +\setlength{\headheight}{1.1\baselineskip}% +% +\hypersetup{colorlinks=true,urlcolor=NavyBlue,linkcolor=NavyBlue,citecolor=CornflowerBlue,naturalnames=true,hypertexnames=false}% +\lstset{language=[LaTeX]TeX,numbers=left,numberstyle=\tiny,basicstyle=\ttfamily\small,frame=single,backgroundcolor=\color{LightGoldenrodYellow},keywordstyle=\color{Blue},emph={puzzlebackground,puzzleforeground,center,skyline,left,shape,fill,inner,sep,draw,rounded,corners,thick}, emphstyle=\color{Tomato},emph={[2]Wheat,HotPink,GreenYellow,LightBlue,LightSalmon,LightYellow,green,sudoku,rows,columns,scale},emphstyle={[2]\color{OliveDrab}},morekeywords={framearea,fillarea,skylineT,skylineB,skylineR,skylineL,skylinecell,setrow,LP@cvoffset,titleformat,definecounterstyle,marginnote,tikz,node,puzzlecounter,color,[,]}} +\makeatletter +\renewcommand{\maketitle}% +{% + \thispagestyle{empty}% + \pagecolor{Ivory}% + \begin{titlepage}% + \begin{tikzpicture}[remember picture,overlay]% + \node[yshift=-2cm] at (current page.north west)% + {% + \begin{tikzpicture}[remember picture, overlay]% + \draw[fill=CornflowerBlue,color=CornflowerBlue] (0,0) rectangle% + (\paperwidth,2cm);% + \draw[anchor=west,yshift=-4cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\RaggedRight\Huge\sffamily\textbf{\@title}}};% + \draw[anchor=west,yshift=-6cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\huge\sffamily\textbf{\@fileversion}}};% + \draw[anchor=west,yshift=-9cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\RaggedRight\huge\sffamily\textbf{\@subtitle}}};% + \draw[anchor=west,yshift=-13cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\includegraphics[height=5cm]{logo.png}};% + \draw[anchor=west,yshift=-17cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\huge\sffamily\textbf{\@date}}};% + \draw[anchor=west,yshift=-20cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\Large\sffamily{\@authorline\\\textbf{\@author}}}};% + \end{tikzpicture}% + };% + \node[yshift=0cm] at (current page.south west)% + {% + \begin{tikzpicture}[remember picture, overlay]% + \draw[fill=NavyBlue,color=NavyBlue,yshift=6cm,xshift=2cm] (0,0) rectangle (0.2cm,19cm);% + \draw[fill=CornflowerBlue,color=CornflowerBlue] (0,0) rectangle (\paperwidth,2cm);% + \draw[anchor=west,yshift=1cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\large\sffamily{\@refline}}};% + \end{tikzpicture}% + };% + \end{tikzpicture}% + \end{titlepage}% + \pagecolor{white}% +}% +% +\newcommand*{\@tikzhead}[1]% +{% + \begin{tikzpicture}[remember picture,overlay]% + \node[yshift=-2cm] at (current page.north west)% + {% + \begin{tikzpicture}[remember picture, overlay]% + \draw[fill=CornflowerBlue] (0,0) rectangle (\paperwidth,2cm);% + \draw[anchor=west,yshift=1cm,xshift=1.5cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\LARGE\sffamily\textbf{\@title}}};% + \node[anchor=east,xshift=.9\paperwidth,rectangle,% + rounded corners=15pt,inner sep=11pt,fill=NavyBlue]% + {\color{white}\textsc{#1}};% + \end{tikzpicture}% + };% + \end{tikzpicture}% +}% +\clearscrheadings% +\ihead{\@tikzhead{\headmark}}% +\cfoot{\upshape\thepage}% +\pagestyle{scrheadings}% +% +%\newcommand*{\headline}[1]{\@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}}% +\newcommand*{\Headline}[1]{\@mkboth{#1}{#1}}% +% +\renewcommand{\headfont}{\normalfont\mdseries\scshape} +% +\gdef\@subtitle{}% +\providecommand*{\Subtitle}[1]{\gdef\@subtitle{#1}}% +\gdef\@fileversion{}% +\providecommand*{\Fileversion}[1]{\gdef\@fileversion{#1}}% +\gdef\@author{}% +\providecommand*{\Author}[1]{\gdef\@author{#1}}% +\gdef\@authorline{Package author:}% +\providecommand*{\Authorline}[1]{\gdef\@authorline{#1}}% +\gdef\@refline{}% +\providecommand*{\Refline}[1]{\gdef\@refline{#1}}% +\gdef\and{\unskip{}, }% +\newcommand\doubledash{-\kern0.5pt-} +\def\enoteformat{\rightskip\z@ \leftskip\z@ \parindent=1em\leavevmode\llap{\makeenmark}} +\makeatother +% +\def\filename{skyline.sty}% +\def\XeLaTeX{Xe\LaTeX}% +% +\newenvironment{optionlist} +{\begin{trivlist}\setlength\leftskip{2em}} +{\end{trivlist}} +\newcommand\optitem[3]{\item [\texttt{\textbf{\textcolor{DodgerBlue}{#1}} \lbrack\textcolor{Crimson}{#2}\rbrack}] #3} +% +\makeatletter% +\renewcommand\tableofcontents% +{% + %\section*{\contentsname}% + \@mkboth{% + \MakeUppercase\contentsname}{\MakeUppercase\contentsname}% + \@starttoc{toc}% +}% +% +\newcommand\styleoption{\name@idx{style option}}% +\newcommand\stylename{\name@idx{document style}}% +\def\name@idx#1#2{% + {\ttfamily#2}% + \index{#2\space#1=\string\ttt{#2}\space#1}\index{#1>#2=\string\ttt{#2}}% +}% +\newcommand*\margcs[1]{\marginnote{\raggedleft\scriptsize #1}}% +\newcommand*\package[1]{\texttt{#1}\index{#1=\string\ttt{#1}}}% +\newcommand*\mco[1]{\mbox{\LANGLE\itshape#1\RANGLE}\index{#1, class option value}\index{class option value>#1}}% +% +\renewcommand\@biblabel[1]{\makebox[1.5cm][l]{[#1]}} +%\renewcommand*\l@subsection{\@dottedtocline{2}{1.2em}{2.8em}} +%\renewcommand*\l@subsubsection{\@dottedtocline{3}{2.4em}{3.7em}} +\makeatother +% +\setlength\parindent{0pt}% +\hypersetup{pdfauthor={Josef Kleber},pdftitle={A style file for typesetting Skyline logic puzzles},pdfsubject={Documentation for LaTeX style \filename}}% +% +\begin{document} +\title{\filename}% +\Subtitle{A style file for typesetting Skyline logic puzzles}% +\author{Josef Kleber} +\Fileversion{v1.0} +\Refline{\href{mailto:josef.kleber@gmx.de}{\texttt{josef.kleber@gmx.de}}\\\href{https://bitbucket.org/kleberj/logicpuzzle/}{\texttt{https://bitbucket.org/kleberj/logicpuzzle/}}} +\maketitle +\tableofcontents +\clearpage + +\section{The puzzle} + +There are skyscrapers located in each cell. Try to find out the height of the skyscraper in the respective cell. There are heights of 1 to MAX in every row, every column, and in each of the two diagonals if indicated. Some cells may be empty (parks). The numbers around the grid indicate how many buildings you can see from this position when you look at the skyscraper lineup. Bear in mind that only those skyscrapers are visible which are higher than the ones in front. Here's a little self-explanatory example: + +\begin{center} + \begin{skyline} + \skylineB{3,{},3,1,{}} + \skylineL{{},4,3,{},{}} + \skylineT{{},{},2,{},3} + \skylineR{{},1,3,{},{}} + \skylinecell{1}{3}{2} + \skylinecell{4}{2}{3} + \end{skyline} + \hspace{1cm} + \begin{skyline} + \skylineB{3,{},3,1,{}} + \skylineL{{},4,3,{},{}} + \skylineT{{},{},2,{},3} + \skylineR{{},1,3,{},{}} + \setrow{5}{5,4,3,1,2} + \setrow{4}{4,5,1,2,3} + \setrow{3}{2,3,5,4,1} + \setrow{2}{1,2,4,3,5} + \setrow{1}{3,1,2,5,4} + \end{skyline} +\end{center} + +\bigskip +\begin{lstlisting} +\begin{center} + \begin{skyline} + \skylineB{3,{},3,1,{}} + \skylineL{{},4,3,{},{}} + \skylineT{{},{},2,{},3} + \skylineR{{},1,3,{},{}} + \skylinecell{1}{3}{2} + \skylinecell{4}{2}{3} + \end{skyline} + \hspace{1cm} + \begin{skyline} + \skylineB{3,{},3,1,{}} + \skylineL{{},4,3,{},{}} + \skylineT{{},{},2,{},3} + \skylineR{{},1,3,{},{}} + \setrow{5}{5,4,3,1,2} + \setrow{4}{4,5,1,2,3} + \setrow{3}{2,3,5,4,1} + \setrow{2}{1,2,4,3,5} + \setrow{1}{3,1,2,5,4} + \end{skyline} +\end{center} +\end{lstlisting} +\clearpage + +\section{Options} +\begin{optionlist} + \optitem{\styleoption{rows}}{5}{defines the number of rows in the grid.} + \optitem{\styleoption{columns}}{5}{specifies the number of columns in the grid} + \optitem{\styleoption{sudoku}}{false}{sets \styleoption{rows} and \styleoption{columns} to 9, in case of \mco{true} is specified. Additionally the classic Sudoku grid is drawn.} + \optitem{\styleoption{width}}{6.7cm}{sets the width of the minipage, in which the grid is typeset.} + \optitem{\styleoption{scale}}{1}{scales the size of the grid in the minipage.} + \optitem{\styleoption{fontsize}}{Large}{specifies the size of the numbers next to the grid. Here, the usual \LaTeX\ sizes are used. Possible values: \texttt{tiny}, \texttt{scriptsize}, \texttt{footnotesize}, \texttt{small}, \texttt{normalsize}, \texttt{large}, \underline{\texttt{Large}}, \texttt{LARGE}, \texttt{huge}, \texttt{Huge}} + \optitem{\styleoption{title}}{}{sets the title of a puzzle.} + \optitem{\styleoption{titleindent}}{0.75cm}{defines the indent of the title.} + \optitem{\styleoption{titlewidth}}{5.85cm}{specifies the width of the box the title is set in.} + \optitem{\styleoption{bgcolor}}{}{sets the background color of the grid.} + \optitem{\styleoption{counterstyle}}{none}{defines the counter style. Predefined styles: none, left, right} + \optitem{\styleoption{cvoffset}}{-39pt}{sets the vertical offset of the counters in the margin.} +\end{optionlist} + +\section{Environments} +\subsection{\texttt{skyline}} +The \env{skyline} environment\marginnote{\hbadness=10000\RaggedLeft\scriptsize\envb{skyline}\oarg{options}\\\dots\\\enve{skyline}} is the central core of the style file. With the optional argument of the environment, you can reset the options with local scope. Here, a blank grid is created. +\subsection{\texttt{puzzlebackground}} +The \env{puzzlebackground} environment\marginnote{\hbadness=10000\RaggedLeft\scriptsize\envb{puzzlebackground}\\\dots\\\enve{puzzlebackground}} allows you to place elements behind the main layer. This is for example usefull for the \cmd\fillarea\ command. +\subsection{\texttt{puzzleforeground}} +The \env{puzzleforeground} environment\marginnote{\hbadness=10000\RaggedLeft\scriptsize\envb{puzzleforeground}\\\dots\\\enve{puzzleforeground}} allows you to place elements in front of the main layer. This is for example usefull for the \cmd\framearea\ command. +\section{Commands} +\subsection{In the grid and around} +\subsubsection{\texttt{skylineT}} +The command \cs{skylineT}\margcs{\cmd\skylineT\{\marg{csv list}\}} typesets the numbers above the grid indicating how many skycrapers are visible. It expects a comma-separated list as an argument. +\subsubsection{\texttt{skylineB}} +The command \cs{skylineB}\margcs{\cmd\skylineB\{\marg{csv list}\}} typesets the numbers below the grid. +\subsubsection{\texttt{skylineL}} +The command \cs{skylineL}\margcs{\cmd\skylineL\{\marg{csv list}\}} typesets the numbers left to the grid. +\subsubsection{\texttt{skylineR}} +The command \cs{skylineR}\margcs{\cmd\skylineR\{\marg{csv list}\}} typesets the numbers right to the grid. +\subsubsection{\texttt{skylinecell}} +The command \cs{skylinecell}\margcs{\cmd\skylinecell\{\marg{column}\}\{\marg{row}\}\\\{\marg{height}\}} sets the \marg{height} of the grid cell \marg{column}\marg{row}. +\subsubsection{\texttt{setrow}} +The command \cs{setrow}\margcs{\cmd\setrow\{\marg{row}\}\{\marg{csv list}\}} sets the heights of \marg{row}. It expects a comma-separated list. +\subsubsection{\texttt{setcolumn}} +The command \cs{setcolumn}\margcs{\cmd\setcolumn\{\marg{column}\}\{\marg{csv list}\}} sets the heights of \marg{column}. +\subsubsection{\texttt{framearea}} +The command \cs{framearea}\margcs{\cmd\framearea\{\marg{color}\}\{\marg{\cmd\tikz\ path}\}} frames the area given by \marg{\cmd\tikz\ path} with color \marg{color}. The reference for coordinates is the bottom left corner of the cell. + +\begin{lstlisting} +\framearea{green}{(2,2)--(2,3)--(3,3)--(3,2)--(2,2)} +\end{lstlisting} + +This command will color the frame of the grid cell \texttt{(2,2)} green. You should consider using this command in the \env{puzzleforeground} environment. + +\subsubsection{\texttt{fillarea}} +The command \cs{fillarea}\margcs{\cmd\fillarea\{\marg{color}\}\{\marg{\cmd\tikz\ path}\}} fills the area given by \marg{\cmd\tikz\ path} with color \marg{color}. The reference for coordinates is the bottom left corner of the cell. You should consider using this command in the \env{puzzlebackground} environment. +\subsection{Presentation} +\subsubsection{\texttt{definecounterstyle}} +The command \cs{definecounterstyle}\margcs{\cmd\definecounterstyle\{\marg{name}\}\\\{\marg{definition}\}} allows you to define your own styles. For example, the style \texttt{left} is defined as follows: + +\begin{lstlisting} +\definecounterstyle{left}{ + \begingroup\reversemarginpar\marginnote{ + \tikz\node[shape=rectangle,fill=yellow!40,inner sep=7pt, + draw,rounded corners=3pt,thick] + {\Huge\puzzlecounter};}[\LP@cvoffset]\endgroup} +} +\end{lstlisting} + +To typeset the counter into the margin we use the command \cmd\marginnote. We need to use the command \cmd\reversemarginpar\ to set the counter into the left margin. Of course, we must use this command in a group for local scope. Finally we use \cmd\puzzlecounter\ in a \cmd\tikz\ node with a vertical offset set with the option \styleoption{cvoffset}. +\subsubsection{\texttt{puzzlecounter}} +The command \cs{puzzlecounter}\margcs{\cmd\puzzlecounter} provides the counter in textual form to use it for example in \cmd\definecounterstyle. +\subsubsection{\texttt{titleformat}} +With the command \cs{titleformat}\margcs{\cmd\titleformat\{\marg{format}\}}, you can define the format of the title. By default, the definition is as follows: + +\begin{lstlisting} +\titleformat{\centering\Large\color{blue}} +\end{lstlisting} +\subsection{Miscellaneous} +\subsubsection{\texttt{skylinesetup}} +With the command \cs{skylinesetup}\margcs{\cmd\skylinesetup\{\marg{options}\}} you can reset the options with global scope. +\subsubsection{\texttt{setpuzzlecounter}} +With the command \cs{setpuzzlecounter}\margcs{\cmd\setpuzzlecounter\{\marg{number}\}}, you can reset the puzzle counter, for example before the solutions. +\section{Supported variants} +\subsection{Skyline Sudoku} +\begin{center} + \begin{skyline}[sudoku,scale=.46] + \skylineB{4,5,2,5,2,1,2,4,3} + \skylineL{4,2,2,2,1,3,3,3,2} + \skylineT{4,1,3,2,3,5,3,2,3} + \skylineR{3,3,1,3,4,2,3,2,4} + \setrow{9}{{},{},{},8,{},{},{},7} + \setrow{8}{{},{},4,{},{},6,{},{},8} + \setrow{7}{{},2,{},7,{},{},{},{},1} + \setrow{6}{{},{},{},{},8,2} + \setrow{5}{{},{},2,{},4,{},7} + \setrow{4}{{},{},{},3,{},{},4} + \setrow{3}{{},{},{},{},1} + \setrow{2}{{},3,{},{},{},{},1,2} + \setrow{1}{{},{},5} + \end{skyline} + \hspace{1cm} + \begin{skyline}[sudoku,scale=.46] + \skylineB{4,5,2,5,2,1,2,4,3} + \skylineL{4,2,2,2,1,3,3,3,2} + \skylineT{4,1,3,2,3,5,3,2,3} + \skylineR{3,3,1,3,4,2,3,2,4} + \setrow{9}{3,9,6,8,5,1,2,7,4} + \setrow{8}{1,7,4,9,2,6,3,5,8} + \setrow{7}{5,2,8,7,3,4,9,6,1} + \setrow{6}{7,4,3,1,8,2,6,9,5} + \setrow{5}{9,8,2,6,4,5,7,1,3} + \setrow{4}{6,5,1,3,9,7,4,8,2} + \setrow{3}{8,6,7,2,1,3,5,4,9} + \setrow{2}{4,3,9,5,6,8,1,2,7} + \setrow{1}{2,1,5,4,7,9,8,3,6} + \end{skyline} +\end{center} + +\begin{lstlisting} +\begin{center} + \begin{skyline}[sudoku,scale=.46] + \skylineB{4,5,2,5,2,1,2,4,3} + \skylineL{4,2,2,2,1,3,3,3,2} + \skylineT{4,1,3,2,3,5,3,2,3} + \skylineR{3,3,1,3,4,2,3,2,4} + \setrow{9}{{},{},{},8,{},{},{},7} + \setrow{8}{{},{},4,{},{},6,{},{},8} + \setrow{7}{{},2,{},7,{},{},{},{},1} + \setrow{6}{{},{},{},{},8,2} + \setrow{5}{{},{},2,{},4,{},7} + \setrow{4}{{},{},{},3,{},{},4} + \setrow{3}{{},{},{},{},1} + \setrow{2}{{},3,{},{},{},{},1,2} + \setrow{1}{{},{},5} + \end{skyline} + \hspace{1cm} + \begin{skyline}[sudoku,scale=.46] + \skylineB{4,5,2,5,2,1,2,4,3} + \skylineL{4,2,2,2,1,3,3,3,2} + \skylineT{4,1,3,2,3,5,3,2,3} + \skylineR{3,3,1,3,4,2,3,2,4} + \setrow{9}{3,9,6,8,5,1,2,7,4} + \setrow{8}{1,7,4,9,2,6,3,5,8} + \setrow{7}{5,2,8,7,3,4,9,6,1} + \setrow{6}{7,4,3,1,8,2,6,9,5} + \setrow{5}{9,8,2,6,4,5,7,1,3} + \setrow{4}{6,5,1,3,9,7,4,8,2} + \setrow{3}{8,6,7,2,1,3,5,4,9} + \setrow{2}{4,3,9,5,6,8,1,2,7} + \setrow{1}{2,1,5,4,7,9,8,3,6} + \end{skyline} +\end{center} +\end{lstlisting} + +\subsection{Skyline Sudoku (N*N)} +\begin{center} + \begin{skyline}[rows=6,columns=6,scale=.65] + \skylineB{4,2,1,3,3,2} + \skylineL{3,3,4,3,2,1} + \skylineT{1,2,3,3,2,4} + \skylineR{4,1,2,2,2,3} + \skylinecell{2}{4}{1} + \skylinecell{4}{1}{4} + \skylinecell{5}{2}{3} + \begin{puzzlebackground} + \fillarea{Wheat}{(1,1)--(1,3)--(4,3)--(4,1)--(1,1)} + \fillarea{HotPink!30}{(1,3)--(1,7)--(4,7)--(4,6)--(2,6)--(2,3)--(1,3)} + \fillarea{GreenYellow}{(2,3)--(2,6)--(4,6)--(4,3)--(2,3)} + \fillarea{LightBlue}{(4,1)--(7,1)--(7,5)--(6,5)--(6,2)--(4,2)--(4,1)} + \fillarea{LightSalmon!50}{(4,7)--(4,4)--(5,4)--(5,6)--(6,6)--(6,5)--(7,5)--(7,7)--(4,7)} + \fillarea{LightYellow}{(4,2)--(4,4)--(5,4)--(5,6)--(6,6)--(6,2)--(4,2)} + \end{puzzlebackground} + \end{skyline} + \hspace{1cm} + \begin{skyline}[rows=6,columns=6,scale=.65] + \skylineB{4,2,1,3,3,2} + \skylineL{3,3,4,3,2,1} + \skylineT{1,2,3,3,2,4} + \skylineR{4,1,2,2,2,3} + \setrow{6}{6,3,4,1,5,2} + \setrow{5}{5,6,2,3,1,4} + \setrow{4}{2,1,3,6,4,5} + \setrow{3}{1,4,5,2,6,3} + \setrow{2}{4,2,1,5,3,6} + \setrow{1}{3,5,6,4,2,1} + \begin{puzzlebackground} + \fillarea{Wheat}{(1,1)--(1,3)--(4,3)--(4,1)--(1,1)} + \fillarea{HotPink!30}{(1,3)--(1,7)--(4,7)--(4,6)--(2,6)--(2,3)--(1,3)} + \fillarea{GreenYellow}{(2,3)--(2,6)--(4,6)--(4,3)--(2,3)} + \fillarea{LightBlue}{(4,1)--(7,1)--(7,5)--(6,5)--(6,2)--(4,2)--(4,1)} + \fillarea{LightSalmon!50}{(4,7)--(4,4)--(5,4)--(5,6)--(6,6)--(6,5)--(7,5)--(7,7)--(4,7)} + \fillarea{LightYellow}{(4,2)--(4,4)--(5,4)--(5,6)--(6,6)--(6,2)--(4,2)} + \end{puzzlebackground} + \end{skyline} +\end{center} + +\begin{lstlisting} +\begin{center} + \begin{skyline}[rows=6,columns=6,scale=.65] + \skylineB{4,2,1,3,3,2} + \skylineL{3,3,4,3,2,1} + \skylineT{1,2,3,3,2,4} + \skylineR{4,1,2,2,2,3} + \skylinecell{2}{4}{1} + \skylinecell{4}{1}{4} + \skylinecell{5}{2}{3} + \begin{puzzlebackground} + \fillarea{Wheat}{(1,1)--(1,3)--(4,3)--(4,1)--(1,1)} + \fillarea{HotPink!30}{(1,3)--(1,7)--(4,7)--(4,6)--(2,6)--(2,3) + --(1,3)} + \fillarea{GreenYellow}{(2,3)--(2,6)--(4,6)--(4,3)--(2,3)} + \fillarea{LightBlue}{(4,1)--(7,1)--(7,5)--(6,5)--(6,2)--(4,2) + --(4,1)} + \fillarea{LightSalmon!50}{(4,7)--(4,4)--(5,4)--(5,6)--(6,6) + --(6,5)--(7,5)--(7,7)--(4,7)} + \fillarea{LightYellow}{(4,2)--(4,4)--(5,4)--(5,6)--(6,6)--(6,2) + --(4,2)} + \end{puzzlebackground} + \end{skyline} + \hspace{1cm} + \begin{skyline}[rows=6,columns=6,scale=.65] + \skylineB{4,2,1,3,3,2} + \skylineL{3,3,4,3,2,1} + \skylineT{1,2,3,3,2,4} + \skylineR{4,1,2,2,2,3} + \setrow{6}{6,3,4,1,5,2} + \setrow{5}{5,6,2,3,1,4} + \setrow{4}{2,1,3,6,4,5} + \setrow{3}{1,4,5,2,6,3} + \setrow{2}{4,2,1,5,3,6} + \setrow{1}{3,5,6,4,2,1} + \begin{puzzlebackground} + \fillarea{Wheat}{(1,1)--(1,3)--(4,3)--(4,1)--(1,1)} + \fillarea{HotPink!30}{(1,3)--(1,7)--(4,7)--(4,6)--(2,6)--(2,3) + --(1,3)} + \fillarea{GreenYellow}{(2,3)--(2,6)--(4,6)--(4,3)--(2,3)} + \fillarea{LightBlue}{(4,1)--(7,1)--(7,5)--(6,5)--(6,2)--(4,2) + --(4,1)} + \fillarea{LightSalmon!50}{(4,7)--(4,4)--(5,4)--(5,6)--(6,6) + --(6,5)--(7,5)--(7,7)--(4,7)} + \fillarea{LightYellow}{(4,2)--(4,4)--(5,4)--(5,6)--(6,6)--(6,2) + --(4,2)} + \end{puzzlebackground} + \end{skyline} +\end{center} +\end{lstlisting} + +\section{Examples \& Solutions} +You\marginnote{\href{https://bitbucket.org/kleberj/logicpuzzle/}{\includegraphics[height=2cm]{qrcode.png}}} can download application examples and their solutions from the \href{https://bitbucket.org/kleberj/logicpuzzle/}{project page}. The puzzles are originally licensed under \href{http://creativecommons.org/licenses/by-nc-sa/3.0/}{\ccbyncsa}. +\end{document} diff --git a/Master/texmf-dist/doc/latex/logicpuzzle/skyline/skyline_README b/Master/texmf-dist/doc/latex/logicpuzzle/skyline/skyline_README new file mode 100644 index 00000000000..60e4f0e3031 --- /dev/null +++ b/Master/texmf-dist/doc/latex/logicpuzzle/skyline/skyline_README @@ -0,0 +1,12 @@ +The package enables the user to typeset Skyline logic puzzles +(aka Skycrapers, Wolkenkratzer, Hochhäuser, ...), +incl. Skyline Sudoku and Skyline Sudoku (N*N) variants. + +There are skyscrapers located in each cell. Try to find out +the height of the skyscraper in the respective cell. There are +heights of 1 to MAX in every row, every column, and in each of +the two diagonals if indicated. Some cells may be empty (parks). +The numbers around the grid indicate how many buildings you can +see from this position when you look at the skyscraper lineup. +Bear in mind that only those skyscrapers are visible which are +higher than the ones in front. diff --git a/Master/texmf-dist/tex/latex/logicpuzzle/bokkusu.sty b/Master/texmf-dist/tex/latex/logicpuzzle/bokkusu.sty index 27857baaedc..f7712888537 100644 --- a/Master/texmf-dist/tex/latex/logicpuzzle/bokkusu.sty +++ b/Master/texmf-dist/tex/latex/logicpuzzle/bokkusu.sty @@ -20,7 +20,7 @@ %% This work consists of all files listed in manifest.txt. %% % -\ProvidesPackage{bokkusu}[2013/02/28 bokkusu.sty v1.0 - Josef Kleber (C) 2013]% +\ProvidesPackage{bokkusu}[2013/03/09 bokkusu.sty v1.1 - Josef Kleber (C) 2013]% % \RequirePackage{logicpuzzle}% % @@ -209,6 +209,11 @@ % \ProcessOptionsX\relax% % +\let\valueH\LP@bottomrow% +\let\valueV\LP@leftcolumn% +\let\sumH\LP@toprow% +\let\sumV\LP@rightcolumn% +% \newcommand*\bokkususetup[1]% {% \setkeys{bokkusu.sty}{#1}% diff --git a/Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty b/Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty index 47fb93c326a..1d2fa7358fb 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/02/28 logicpuzzle.sty v1.1 - Josef Kleber (C) 2013]% +\ProvidesPackage{logicpuzzle}[2013/03/09 logicpuzzle.sty v1.2 - Josef Kleber (C) 2013]% % \RequirePackage{xkeyval}% \RequirePackage{ifthen}% @@ -28,6 +28,9 @@ \RequirePackage{marginnote}% \RequirePackage{tikz}% \usetikzlibrary{decorations.pathmorphing}% +\pgfdeclarelayer{LPbackground} +\pgfdeclarelayer{LPforeground} +\pgfsetlayers{LPbackground,main,LPforeground} % \newcounter{LP@counti}% \newcounter{LP@countii}% @@ -47,6 +50,7 @@ \gdef\LP@columns{}% \gdef\LP@scale{1}% \gdef\LP@color{black}% +\gdef\LP@fontsize\Large% \gdef\LP@cvoffset{0pt}% % \newcommand*\LP@Pfive{.5}% @@ -95,6 +99,18 @@ \draw[step=#5] (#1,#2) grid (\value{LP@counti},\value{LP@countii});% }% % +\newcommand*\LP@drawsudokugrid% +{% + \draw[ultra thick] (1,1) -- (1,10); + \draw[ultra thick] (4,1) -- (4,10); + \draw[ultra thick] (7,1) -- (7,10); + \draw[ultra thick] (10,1) -- (10,10); + \draw[ultra thick] (1,1) -- (10,1); + \draw[ultra thick] (1,4) -- (10,4); + \draw[ultra thick] (1,7) -- (10,7); + \draw[ultra thick] (1,10) -- (10,10); +}% +% % #1 grid x min % #2 grid y min % #3 grid x max @@ -142,6 +158,11 @@ \stepcounter{LP@counti}% }% % +\newcommand*\setrow[2]% +{% + \LP@setrowcontents{#2}{1}{#1}% +}% +% % #1 csv list % #2 column % #3 row @@ -163,32 +184,47 @@ \stepcounter{LP@countii}% }% % -\newcommand*\valueH[1]% +\newcommand*\setcolumn[2]% +{% + \LP@setrowcontents{#2}{#1}{1}% +}% +% +\newcommand*\setcell[3]% +{% + \LP@set@LP@scale{\LP@env@prefix}% + \LP@set@LP@fontsize{\LP@env@prefix}% + \LP@set@LP@rows{\LP@env@prefix}% + \LP@set@LP@columns{\LP@env@prefix}% + \LP@ingrid{#1}{#2}{\LP@columns}{\LP@rows}{\LP@package}% + \LP@setcellcontent{#1}{#2}{\LP@fontsize#3}% +}% +% +\newcommand*\LP@bottomrow[1]% {% \LP@setrowcontents{#1}{1}{0}% }% % -\newcommand*\valueV[1]% +\newcommand*\LP@leftcolumn[1]% {% \LP@setcolumncontents{#1}{0}{1}% }% % -\newcommand*\sumH[1]% +\newcommand*\LP@toprow[1]% {% - \sumH@i{#1}{\LP@env@prefix}% + \LP@toprow@i{#1}{\LP@env@prefix}% }% % -\newcommand*\sumH@i[2]% +\newcommand*\LP@toprow@i[2]% {% \LP@setrowcontents{#1}{1}{\csname the#2@rows\endcsname}% }% % -\newcommand*\sumV[1]% +\newcommand*\LP@rightcolumn[1]% {% - \sumV@i{#1}{\LP@env@prefix}% + \LP@rightcolumn@i{#1}{\LP@env@prefix}% }% % -\newcommand*\sumV@i[2]% +\newcommand*\LP@rightcolumn@i[2]% {% \LP@setcolumncontents{#1}{\csname the#2@columns\endcsname}{1}% }% @@ -293,6 +329,12 @@ \expandafter\xdef\expandafter\LP@cvoffset{\csname #1@cvoffset\endcsname}% }% % +\newcommand*\LP@set@LP@fontsize[1]% +{% + % can't expand \Large + \expandafter\gdef\expandafter\LP@fontsize{\csname #1@fontsize\endcsname}% +}% +% \newcommand*\LP@set@env@prefix[1]% {% \gdef\LP@env@prefix{#1}% @@ -303,4 +345,30 @@ \gdef\LP@package{#1}% }% % +\newcommand*\framearea[2]% +{% + \draw[ultra thick,color=#1] #2; +}% +% +\newcommand*\fillarea[2]% +{% + \draw[ultra thick,fill=#1] #2 ; +}% +% +\newenvironment{puzzlebackground}% +{% + \begin{pgfonlayer}{LPbackground}% +}% +{% + \end{pgfonlayer}% +}% +% +\newenvironment{puzzleforeground}% +{% + \begin{pgfonlayer}{LPforeground}% +}% +{% + \end{pgfonlayer}% +}% +% \endinput%
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/logicpuzzle/skyline.sty b/Master/texmf-dist/tex/latex/logicpuzzle/skyline.sty new file mode 100644 index 00000000000..9cb2ae6bc8a --- /dev/null +++ b/Master/texmf-dist/tex/latex/logicpuzzle/skyline.sty @@ -0,0 +1,262 @@ +%% +%% Copyright (C) 2013 by: +%% Josef Kleber +%% <josef.kleber@gmx.de> +%% +%% This file may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License, either version 1.3 of this license +%% or (at your option) any later version. The latest version of this +%% license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of LaTeX version +%% 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "author-maintained". +%% +%% The Current Maintainer of this work is Josef Kleber. +%% +%% This work consists of all files listed in manifest.txt. +%% +% +\ProvidesPackage{skyline}[2013/03/09 skyline.sty v1.0 - Josef Kleber (C) 2013]% +% +\RequirePackage{logicpuzzle}% +% +% options +\newcommand*\SL@width{6.7cm}% +\newcommand*\SL@fontsize\Large% +\newcommand*\SL@rows{5}% +\newcommand*\SL@columns{5}% +\newcommand*\SL@scale{1}% +\newcommand*\SL@bgcolor{}% +\newcommand*\SL@sudoku{false}% +\newcommand*\SL@cvoffset{-39pt}% +\newcommand*\SL@title{}% +\newcommand*\SL@titleindent{0.75cm}% +\newcommand*\SL@titlewidth{5.85cm}% +% +\newcounter{SL@rows}% +\newcounter{SL@columns}% +% +\setcounter{SL@rows}{\SL@rows}% +\setcounter{SL@columns}{\SL@columns}% +\stepcounter{SL@rows}% +\stepcounter{SL@columns}% +% +\define@key{skyline.sty}{rows}[5]% +{% + \renewcommand*\SL@rows{#1}% +}% +% +\define@key{skyline.sty}{columns}[5]% +{% + \renewcommand*\SL@columns{#1}% +}% +% +\define@choicekey*{skyline.sty}{sudoku}[\SL@sudoku\nr]{true,false}[true]% +{% + \ifcase\nr\relax% + \renewcommand*\SL@sudoku{true}% + \renewcommand*\SL@rows{9}% + \renewcommand*\SL@columns{9}% + \or% + \renewcommand*\SL@sudoku{false}% + \fi% +}% +% +\define@key{skyline.sty}{scale}[1]% +{% + \renewcommand*\SL@scale{#1}% +}% +% +\define@key{skyline.sty}{counterstyle}[none]% +{% + \renewcommand*\LP@counterstyle{#1}% +}% +% +\define@key{skyline.sty}{bgcolor}[]% +{% + \renewcommand*\SL@bgcolor{#1}% +}% +% +\define@choicekey*{skyline.sty}{fontsize}[\SL@fontsize\nr]{tiny,scriptsize,footnotesize,small,normalsize,large,Large,LARGE,huge,Huge}[Large]% +{% + \ifcase\nr\relax% + \renewcommand*\SL@fontsize{\tiny}% + \or% + \renewcommand*\SL@fontsize{\scriptsize}% + \or% + \renewcommand*\SL@fontsize{\footnotesize}% + \or% + \renewcommand*\SL@fontsize{\small}% + \or% + \renewcommand*\SL@fontsize{\normalsize}% + \or% + \renewcommand*\SL@fontsize{\large}% + \or% + \renewcommand*\SL@fontsize{\Large}% + \or% + \renewcommand*\SL@fontsize{\LARGE}% + \or% + \renewcommand*\SL@fontsize{\huge}% + \or% + \renewcommand*\SL@fontsize{\Huge}% + \fi% +}% +% +\define@key{skyline.sty}{width}[6.7cm]% +{% + \renewcommand*\SL@width{#1}% +}% +% +\define@key{skyline.sty}{title}[]% +{% + \renewcommand*\SL@title{#1}% +}% +% +\define@key{skyline.sty}{cvoffset}[-39pt]% +{% + \renewcommand*\SL@cvoffset{#1}% +}% +% +\define@key{skyline.sty}{titleindent}[0.75cm]% +{% + \renewcommand*\SL@titleindent{#1}% +}% +% +\define@key{skyline.sty}{titlewidth}[5.85cm]% +{% + \renewcommand*\SL@titlewidth{#1}% +}% +% +\define@key{skyline}{rows}% +{% + \renewcommand*\SL@rows{#1}% +}% +% +\define@key{skyline}{columns}% +{% + \renewcommand*\SL@columns{#1}% +}% +% +\define@choicekey*{skyline}{sudoku}[\SL@sudoku\nr]{true,false}[true]% +{% + \ifcase\nr\relax% + \renewcommand*\SL@sudoku{true}% + \renewcommand*\SL@rows{9}% + \renewcommand*\SL@columns{9}% + \or% + \renewcommand*\SL@sudoku{false}% + \fi% +}% +% +\define@key{skyline}{scale}% +{% + \renewcommand*\SL@scale{#1}% +}% +% +\define@key{skyline}{bgcolor}% +{% + \renewcommand*\SL@bgcolor{#1}% +}% +% +\define@key{skyline}{counterstyle}% +{% + \renewcommand*\LP@counterstyle{#1}% +}% +% +\define@choicekey*{skyline}{fontsize}[\SL@fontsize\nr]{tiny,scriptsize,footnotesize,small,normalsize,large,Large,LARGE,huge,Huge}[Large]% +{% + \ifcase\nr\relax% + \renewcommand*\SL@fontsize{\tiny}% + \or% + \renewcommand*\SL@fontsize{\scriptsize}% + \or% + \renewcommand*\SL@fontsize{\footnotesize}% + \or% + \renewcommand*\SL@fontsize{\small}% + \or% + \renewcommand*\SL@fontsize{\normalsize}% + \or% + \renewcommand*\SL@fontsize{\large}% + \or% + \renewcommand*\SL@fontsize{\Large}% + \or% + \renewcommand*\SL@fontsize{\LARGE}% + \or% + \renewcommand*\SL@fontsize{\huge}% + \or% + \renewcommand*\SL@fontsize{\Huge}% + \fi% +}% +% +\define@key{skyline}{width}% +{% + \renewcommand*\SL@width{#1}% +}% +% +\define@key{skyline}{title}% +{% + \renewcommand*\SL@title{#1}% +}% +% +\define@key{skyline}{cvoffset}% +{% + \renewcommand*\SL@cvoffset{#1}% +}% +% +\define@key{skyline}{titleindent}% +{% + \renewcommand*\SL@titleindent{#1}% +}% +% +\define@key{skyline}{titlewidth}% +{% + \renewcommand*\SL@titlewidth{#1}% +}% +% +\ExecuteOptionsX{rows,columns,width,fontsize,scale,bgcolor,cvoffset,counterstyle,title,titleindent,titlewidth}% +% +\ProcessOptionsX\relax% +% +\let\skylineB\LP@bottomrow% +\let\skylineT\LP@toprow% +\let\skylineL\LP@leftcolumn% +\let\skylineR\LP@rightcolumn% +\let\skylinecell\setcell% +% +\newcommand*\skylinesetup[1]% +{% + \setkeys{skyline.sty}{#1}% +}% +% +\newenvironment{skyline}[1][]% +{% + \setkeys{skyline}{#1}% + \LP@set@package{skyline}% + \LP@set@env@prefix{SL}% + \setcounter{SL@rows}{\SL@rows}% + \setcounter{SL@columns}{\SL@columns}% + \stepcounter{SL@rows}% + \stepcounter{SL@columns}% + \begin{minipage}[t]{\SL@width}% + \ifthenelse{\equal{\SL@title}{}}% + {\par\enspace\par}% empty + {\enspace\par\noindent\hspace{\SL@titleindent}\parbox{\SL@titlewidth}{\strut\LP@titleformat\SL@title}\vspace{3mm}\par}% + \begin{tikzpicture}[scale=\SL@scale]% + \LP@drawbackground{1}{1}{\SL@columns}{\SL@rows}{\SL@bgcolor}% + \LP@drawgrid{1}{1}{\SL@columns}{\SL@rows}{1cm}% + \ifthenelse{\equal{\SL@sudoku}{true}}% + {\LP@drawsudokugrid}% + {}% +}% +{% + \end{tikzpicture}% + \LP@drawcounter{\LP@counterstyle}% + \stepcounter{LP@puzzlecounter}% + \end{minipage}% +}% +% +\endinput%
\ No newline at end of file |