diff options
-rw-r--r-- | Master/texmf-dist/doc/latex/battleship/CHANGES | 22 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/battleship/README | 17 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/battleship/battleship.pdf | bin | 82204 -> 75083 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/battleship/battleship.tex | 309 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/battleship/battleship.sty | 135 | ||||
-rwxr-xr-x | Master/tlpkg/libexec/ctan2tds | 2 |
6 files changed, 202 insertions, 283 deletions
diff --git a/Master/texmf-dist/doc/latex/battleship/CHANGES b/Master/texmf-dist/doc/latex/battleship/CHANGES index 2befa86e7c1..72fcddffa39 100644 --- a/Master/texmf-dist/doc/latex/battleship/CHANGES +++ b/Master/texmf-dist/doc/latex/battleship/CHANGES @@ -1,3 +1,25 @@ +-- battleship.sty (v1.1) -- + +12/02/2013 added \placewater [jk] + puts a water marker into the grid + +12/02/2013 added \placeisland [jk] + puts an island with random outline into the grid + +12/02/2013 renamed \ship -> \placesegment [jk] + added \let\ship\placesegment + +11/02/2013 implemented \placeship{direction}{column}{row}{length} [jk] + placement of complete ship at (column,row) in direction {V|H} + with length length. + +11/02/2013 implemented \BS@ingrid [jk] + checks if coordinate is in the grid + -> PackageError + +10/02/2013 added \battleshipsetup [jk] + for resetting global options + -- battleship bundle -- 2013/02/09 IPO of battleship on CTAN diff --git a/Master/texmf-dist/doc/latex/battleship/README b/Master/texmf-dist/doc/latex/battleship/README index 2cb5783ce36..941e5abc6e0 100644 --- a/Master/texmf-dist/doc/latex/battleship/README +++ b/Master/texmf-dist/doc/latex/battleship/README @@ -5,3 +5,20 @@ Numbers next to the grid reveal the number of ship segments in the respective columns and rows. License: LPPL + +Changes in v1.1: + +- added \placeship + place a complete ship at (column,row) in direction {V|H} + with length (length) + +- added \placewater + puts a water marker into the grid + +- added \placeisland + puts an island with random outline into the grid + +- renamed \ship -> \placesegment + +- added \battleshipsetup + resetting global options
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/battleship/battleship.pdf b/Master/texmf-dist/doc/latex/battleship/battleship.pdf Binary files differindex 74dca35d93f..fe67f807ed3 100644 --- a/Master/texmf-dist/doc/latex/battleship/battleship.pdf +++ b/Master/texmf-dist/doc/latex/battleship/battleship.pdf diff --git a/Master/texmf-dist/doc/latex/battleship/battleship.tex b/Master/texmf-dist/doc/latex/battleship/battleship.tex index 5a804676563..acf15a6a2fd 100644 --- a/Master/texmf-dist/doc/latex/battleship/battleship.tex +++ b/Master/texmf-dist/doc/latex/battleship/battleship.tex @@ -5,6 +5,7 @@ \usepackage{textcomp}% \usepackage{lmodern}% \usepackage{bera}% +\usepackage{ccicons} \usepackage{microtype}% \usepackage{ltxdocext}% \usepackage{listings} @@ -19,7 +20,7 @@ sbindent=0.6cm,sbwidth=3.4cm]{battleship}% \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={mathstyle,style}, emphstyle=\color{Tomato},emph={[2]rows,columns,width,shipcolor,fontsize,scale,sbindent,sbwidth,sbshipscale},emphstyle={[2]\color{SeaGreen}},morekeywords={battleship,ship,shipH,shipV,shipbox,Ship,ShipC,ShipL,ShipR,ShipB,ShipT,[,]}} +\lstset{language=[LaTeX]TeX,numbers=left,numberstyle=\tiny,basicstyle=\ttfamily\small,frame=single,backgroundcolor=\color{LightGoldenrodYellow},keywordstyle=\color{Blue},emph={mathstyle,style}, emphstyle=\color{Tomato},emph={[2]rows,columns,width,shipcolor,fontsize,scale,sbindent,sbwidth,sbshipscale},emphstyle={[2]\color{SeaGreen}},morekeywords={battleship,,placeship,placesegment,ship,shipH,shipV,shipbox,Ship,ShipC,ShipL,ShipR,ShipB,ShipT,[,]}} \renewcommand{\maketitle}% {% \thispagestyle{empty}% @@ -38,7 +39,7 @@ sbindent=0.6cm,sbwidth=3.4cm]{battleship}% \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]{battleship.png}};% + {\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% @@ -128,13 +129,13 @@ sbindent=0.6cm,sbwidth=3.4cm]{battleship}% \makeatother % \setlength\parindent{0pt}% -\hypersetup{pdfauthor={Josef Kleber},pdftitle={A style file for typesetting navy games},pdfsubject={Documentation for LaTeX style \filename}}% +\hypersetup{pdfauthor={Josef Kleber},pdftitle={A style file for typesetting Battleship logic puzzles},pdfsubject={Documentation for LaTeX style \filename}}% % \begin{document} \title{\filename}% \Subtitle{A style file for typesetting Battleship logic puzzles}% \author{Josef Kleber} -\Fileversion{v1.0} +\Fileversion{v1.1} \Refline{\href{mailto:josef.kleber@gmx.de}{\texttt{josef.kleber@gmx.de}}\\\href{https://bitbucket.org/kleberj/battleship/}{\texttt{https://bitbucket.org/kleberj/battleship/}}} \maketitle @@ -147,49 +148,39 @@ Try to find the positions of the ships listed below the puzzle. The numbers on t \begin{center} \begin{battleship} -\ship{4}{5}{\ShipR} -\shipH{3,2,2,1,3} +\placesegment{4}{1}{\ShipR} +\shipH{4,1,2,2,2} \shipV{3,1,4,0,3} \shipbox{3,3,2,2,1} \end{battleship} -\hspace{1.2cm} +\hspace{1cm} \begin{battleship} -\ship{1}{5}{\Ship} -\ship{2}{3}{\ShipC} -\ship{5}{2}{\ShipC} -\ship{5}{1}{\ShipB} -\ship{5}{3}{\ShipT} -\ship{1}{1}{\ShipL} -\ship{1}{3}{\ShipL} -\ship{3}{5}{\ShipL} -\ship{2}{1}{\ShipR} -\ship{3}{3}{\ShipR} -\ship{4}{5}{\ShipR} -\shipH{3,2,2,1,3} +\placeship{V}{1}{1}{3} +\placeship{H}{1}{5}{2} +\placeship{H}{3}{1}{2} +\placeship{H}{3}{3}{3} +\placeship{H}{5}{5}{1} +\shipH{4,1,2,2,2} \shipV{3,1,4,0,3} \end{battleship} \end{center} + +\bigskip \begin{lstlisting} \begin{battleship} -\ship{4}{5}{\ShipR} -\shipH{3,2,2,1,3} +\placesegment{4}{1}{\ShipR} +\shipH{4,1,2,2,2} \shipV{3,1,4,0,3} \shipbox{3,3,2,2,1} \end{battleship} -\hspace{1.2cm} +\hspace{1cm} \begin{battleship} -\ship{1}{5}{\Ship} -\ship{2}{3}{\ShipC} -\ship{5}{2}{\ShipC} -\ship{5}{1}{\ShipB} -\ship{5}{3}{\ShipT} -\ship{1}{1}{\ShipL} -\ship{1}{3}{\ShipL} -\ship{3}{5}{\ShipL} -\ship{2}{1}{\ShipR} -\ship{3}{3}{\ShipR} -\ship{4}{5}{\ShipR} -\shipH{3,2,2,1,3} +\placeship{V}{1}{1}{3} +\placeship{H}{1}{5}{2} +\placeship{H}{3}{1}{2} +\placeship{H}{3}{3}{3} +\placeship{H}{5}{5}{1} +\shipH{4,1,2,2,2} \shipV{3,1,4,0,3} \end{battleship} \end{lstlisting} @@ -206,7 +197,7 @@ With the option \styleoption{width}, you can set the width of the minipage, in w \subsection[\texttt{scale}]{\styleoption{scale} (\underline{\texttt{1}})} With the option \styleoption{scale}, you can scale the size of the grid in the minipage. \subsection[\texttt{fontsize}]{\styleoption{fontsize} (\underline{\texttt{Large}})} -With the option \styleoption{fontsize}, you can specify 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}) +With the option \styleoption{fontsize}, you can specify 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}) \subsection[\texttt{sbindent}]{\styleoption{sbindent} (\underline{\texttt{0.75cm}})} With the option \styleoption{sbindent}, you can define the indent of the ship box below the grid. \subsection[\texttt{sbwidth}]{\styleoption{sbwidth} (\underline{\texttt{5.15cm}})} @@ -217,8 +208,10 @@ With the option \styleoption{sbshipscale}, you can scale the size of the ships i \subsection{\texttt{battleship}} The \env{battleship} environment\marginnote{\hbadness=10000\RaggedLeft\scriptsize\envb{battleship}\oarg{options}\\\dots\\\enve{battleship}} 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 that you can fill with ships using other commands. \section{Commands} -\subsection{\texttt{ship}} -The command \cs{ship}\margcs{\cmd\ship\{\marg{column}\}\{\marg{row}\}\\\{\marg{ship segment}\}} is used for the placement of ship segments in the grid. In the mandatory argument \marg{ship segment}, you can use the following commands: +\subsection{\texttt{placeship}} +With the command \cs{placeship}\margcs{\cmd\placeship\{\marg{direction}\}\\\{\marg{column}\}\{\marg{row}\}\{\marg{length}\}} you can place complete ships in the grid. It expects the specification of the direction as horizontal (H) or vertical (V). Furthermore, it requires the starting coordinates and the length of the ship. +\subsection{\texttt{placesegment}} +The command \cs{placesegment}\margcs{\cmd\placesegment\{\marg{column}\}\{\marg{row}\}\\\{\marg{ship segment}\}} is used for the placement of ship segments in the grid. In the mandatory argument \marg{ship segment}, you can use the following commands: \begin{center} \begin{tabular}{lccl} @@ -227,242 +220,20 @@ The command \cs{ship}\margcs{\cmd\ship\{\marg{column}\}\{\marg{row}\}\\\{\marg{s \cs{ShipB} & \scalebox{.5}{\ShipB} & \scalebox{.5}{\ShipT} & \cs{ShipT} \\ \end{tabular} \end{center} +\subsection{\texttt{ship}} +The command \cs{ship} was replaced by the \cs{placesegment} command. The command \cs{ship} is deprecated and should not be used longer. It may still be used, but it is not recommended. +\subsection{\texttt{placewater}} +With the command \cs{placewater}\margcs{\cmd\placewater\{\marg{column}\}\{\marg{row}\}} you can place water markers ( \raisebox{2pt}{\Water} ) in the grid. +\subsection{\texttt{placeisland}} +With the command \cs{placeisland}\margcs{\cmd\placeisland\{\marg{column}\}\{\marg{row}\}} you can place islands ( \raisebox{-2pt}{\resizebox{!}{10pt}{\Island}} ) in the grid. The island outlines are created randomly: \raisebox{-2pt}{\resizebox{!}{10pt}{\Island}}, \raisebox{-2pt}{\resizebox{!}{10pt}{\Island}}, \raisebox{-2pt}{\resizebox{!}{10pt}{\Island}}, ... \subsection{\texttt{shipH}} The command \cs{shipH}\margcs{\cmd\shipH\{\marg{csv list}\}} typesets the horizontal numbers above the grid. It expects a comma-separated list as an argument. \subsection{\texttt{shipV}} The command \cs{shipV}\margcs{\cmd\shipV\{\marg{csv list}\}} typesets the vertical numbers beside the grid. It also expects a comma separated list. \subsection{\texttt{shipbox}} The command \cs{shipbox}\margcs{\cmd\shipbox\{\marg{csv list}\}} defines the number and size of the ships, which are typeset under the grid. -\clearpage -\section{Puzzles} -\begin{center} -\begin{battleship}[width=5cm,rows=8,columns=11,scale=0.41,sbindent=0.5cm,sbwidth=4.5cm,fontsize=normalsize] -\ship{11}{6}{\Ship} -\shipH{4,0,2,2,4,0,0,0,3,3,3} -\shipV{4,2,0,4,2,1,5,3} -\shipbox{3,3,3,2,2,2,2,1,1,1,1} -\end{battleship} -\hspace{1cm} -\begin{battleship}[width=5cm,rows=8,columns=11,scale=0.41,sbindent=0.5cm,sbwidth=4.5cm,fontsize=normalsize] -\ship{10}{6}{\ShipC} -\shipH{4,0,0,0,5,0,5,1,2,3,2} -\shipV{2,3,6,2,2,1,4,2} -\shipbox{3,3,3,3,2,2,2,1,1,1,1} -\end{battleship} -\end{center} - -\begin{center} -\begin{battleship}[width=5cm,rows=8,columns=11,scale=0.41,sbindent=0.5cm,sbwidth=4.5cm,fontsize=normalsize] -\ship{1}{6}{\Ship} -\shipH{1,0,4,1,2,0,0,6,0,1,6} -\shipV{2,5,0,2,4,4,0,4} -\shipbox{3,3,3,2,2,2,2,1,1,1,1} -\end{battleship} -\hspace{1cm} -\begin{battleship}[width=5cm,rows=8,columns=11,scale=0.41,sbindent=0.5cm,sbwidth=4.5cm,fontsize=normalsize] -\ship{6}{6}{\ShipC} -\shipH{1,1,2,3,2,4,3,3,4,1,1} -\shipV{4,3,2,2,6,1,5,2} -\shipbox{4,4,3,3,3,2,2,2,1,1} -\end{battleship} -\end{center} - -\begin{center} -\begin{battleship}[width=11cm,rows=13,columns=24,scale=0.43,sbindent=0.4cm,sbwidth=10.5cm,fontsize=normalsize] -\ship{9}{9}{\ShipL} -\ship{22}{3}{\ShipL} -\ship{23}{1}{\ShipL} -\ship{16}{8}{\ShipR} -\ship{21}{11}{\ShipR} -\ship{6}{5}{\ShipC} -\ship{8}{2}{\ShipC} -\ship{18}{12}{\ShipC} -\ship{19}{7}{\ShipC} -\ship{1}{10}{\ShipB} -\ship{2}{4}{\ShipT} -\shipH{4,5,7,1,1,1,7,5,1,1,2,2,1,2,1,1,1,5,3,2,1,1,2,2} -\shipV{4,2,6,1,8,4,3,6,6,4,6,1,8} -\shipbox{6,5,4,4,4,4,4,4,3,3,3,3,2,2,2,2,1,1,1,1} -\end{battleship} -\end{center} -\clearpage -\section{Solutions} -\begin{center} -\begin{battleship}[width=5cm,rows=8,columns=11,scale=0.41,sbindent=0.5cm,sbwidth=4.5cm,fontsize=normalsize] -\ship{1}{2}{\Ship} -\ship{1}{5}{\Ship} -\ship{11}{6}{\Ship} -\ship{11}{8}{\Ship} -\ship{3}{1}{\ShipL} -\ship{3}{7}{\ShipL} -\ship{9}{4}{\ShipL} -\ship{5}{1}{\ShipR} -\ship{5}{7}{\ShipR} -\ship{11}{4}{\ShipR} -\ship{4}{1}{\ShipC} -\ship{4}{7}{\ShipC} -\ship{10}{4}{\ShipC} -\ship{1}{7}{\ShipB} -\ship{5}{4}{\ShipB} -\ship{9}{7}{\ShipB} -\ship{10}{1}{\ShipB} -\ship{1}{8}{\ShipT} -\ship{5}{5}{\ShipT} -\ship{9}{8}{\ShipT} -\ship{10}{2}{\ShipT} -\shipH{4,0,2,2,4,0,0,0,3,3,3} -\shipV{4,2,0,4,2,1,5,3} -\end{battleship} -\hspace{1cm} -\begin{battleship}[width=5cm,rows=8,columns=11,scale=0.41,sbindent=0.5cm,sbwidth=4.5cm,fontsize=normalsize] -\ship{1}{7}{\Ship} -\ship{7}{1}{\Ship} -\ship{7}{5}{\Ship} -\ship{9}{1}{\Ship} -\ship{7}{3}{\ShipL} -\ship{9}{3}{\ShipR} -\ship{1}{3}{\ShipC} -\ship{5}{3}{\ShipC} -\ship{8}{3}{\ShipC} -\ship{10}{6}{\ShipC} -\ship{1}{2}{\ShipB} -\ship{5}{2}{\ShipB} -\ship{5}{7}{\ShipB} -\ship{7}{7}{\ShipB} -\ship{10}{5}{\ShipB} -\ship{11}{2}{\ShipB} -\ship{1}{4}{\ShipT} -\ship{5}{4}{\ShipT} -\ship{5}{8}{\ShipT} -\ship{7}{8}{\ShipT} -\ship{10}{7}{\ShipT} -\ship{11}{3}{\ShipT} -\shipH{4,0,0,0,5,0,5,1,2,3,2} -\shipV{2,3,6,2,2,1,4,2} -\end{battleship} -\end{center} - -\begin{center} -\begin{battleship}[width=5cm,rows=8,columns=11,scale=0.41,sbindent=0.5cm,sbwidth=4.5cm,fontsize=normalsize] -\ship{1}{6}{\Ship} -\ship{5}{5}{\Ship} -\ship{3}{8}{\Ship} -\ship{8}{8}{\Ship} -\ship{3}{2}{\ShipL} -\ship{10}{8}{\ShipL} -\ship{5}{2}{\ShipR} -\ship{11}{8}{\ShipR} -\ship{4}{2}{\ShipC} -\ship{8}{5}{\ShipC} -\ship{11}{5}{\ShipC} -\ship{3}{5}{\ShipB} -\ship{8}{1}{\ShipB} -\ship{8}{4}{\ShipB} -\ship{11}{1}{\ShipB} -\ship{11}{4}{\ShipB} -\ship{3}{6}{\ShipT} -\ship{8}{2}{\ShipT} -\ship{8}{6}{\ShipT} -\ship{11}{2}{\ShipT} -\ship{11}{6}{\ShipT} -\shipH{1,0,4,1,2,0,0,6,0,1,6} -\shipV{2,5,0,2,4,4,0,4} -\end{battleship} -\hspace{1cm} -\begin{battleship}[width=5cm,rows=8,columns=11,scale=0.41,sbindent=0.5cm,sbwidth=4.5cm,fontsize=normalsize] -\ship{1}{4}{\Ship} -\ship{3}{1}{\Ship} -\ship{2}{7}{\ShipL} -\ship{8}{5}{\ShipL} -\ship{4}{7}{\ShipR} -\ship{11}{5}{\ShipR} -\ship{3}{7}{\ShipC} -\ship{6}{6}{\ShipC} -\ship{6}{7}{\ShipC} -\ship{7}{2}{\ShipC} -\ship{9}{2}{\ShipC} -\ship{9}{5}{\ShipC} -\ship{10}{5}{\ShipC} -\ship{4}{4}{\ShipB} -\ship{5}{1}{\ShipB} -\ship{6}{5}{\ShipB} -\ship{7}{1}{\ShipB} -\ship{9}{1}{\ShipB} -\ship{8}{7}{\ShipB} -\ship{4}{5}{\ShipT} -\ship{5}{2}{\ShipT} -\ship{6}{8}{\ShipT} -\ship{7}{3}{\ShipT} -\ship{9}{3}{\ShipT} -\ship{8}{8}{\ShipT} -\shipH{1,1,2,3,2,4,3,3,4,1,1} -\shipV{4,3,2,2,6,1,5,2} -\end{battleship} -\end{center} - -\begin{center} -\begin{battleship}[width=11cm,rows=13,columns=24,scale=0.43,sbindent=0.4cm,sbwidth=10.5cm,fontsize=normalsize] -\ship{1}{6}{\Ship} -\ship{18}{3}{\Ship} -\ship{17}{6}{\Ship} -\ship{20}{13}{\Ship} -\ship{1}{13}{\ShipL} -\ship{5}{5}{\ShipL} -\ship{7}{13}{\ShipL} -\ship{9}{9}{\ShipL} -\ship{11}{5}{\ShipL} -\ship{14}{8}{\ShipL} -\ship{20}{11}{\ShipL} -\ship{22}{3}{\ShipL} -\ship{23}{1}{\ShipL} -\ship{4}{13}{\ShipR} -\ship{8}{5}{\ShipR} -\ship{8}{13}{\ShipR} -\ship{12}{9}{\ShipR} -\ship{14}{5}{\ShipR} -\ship{16}{8}{\ShipR} -\ship{21}{11}{\ShipR} -\ship{24}{3}{\ShipR} -\ship{24}{1}{\ShipR} -\ship{2}{13}{\ShipC} -\ship{3}{13}{\ShipC} -\ship{2}{2}{\ShipC} -\ship{2}{3}{\ShipC} -\ship{3}{7}{\ShipC} -\ship{3}{8}{\ShipC} -\ship{3}{9}{\ShipC} -\ship{3}{10}{\ShipC} -\ship{6}{5}{\ShipC} -\ship{7}{5}{\ShipC} -\ship{8}{2}{\ShipC} -\ship{7}{8}{\ShipC} -\ship{7}{9}{\ShipC} -\ship{7}{10}{\ShipC} -\ship{11}{9}{\ShipC} -\ship{10}{9}{\ShipC} -\ship{12}{5}{\ShipC} -\ship{13}{5}{\ShipC} -\ship{15}{8}{\ShipC} -\ship{18}{11}{\ShipC} -\ship{18}{12}{\ShipC} -\ship{19}{7}{\ShipC} -\ship{23}{3}{\ShipC} -\ship{1}{10}{\ShipB} -\ship{2}{1}{\ShipB} -\ship{3}{6}{\ShipB} -\ship{7}{7}{\ShipB} -\ship{8}{1}{\ShipB} -\ship{18}{10}{\ShipB} -\ship{19}{6}{\ShipB} -\ship{1}{11}{\ShipT} -\ship{2}{4}{\ShipT} -\ship{3}{11}{\ShipT} -\ship{7}{11}{\ShipT} -\ship{8}{3}{\ShipT} -\ship{18}{13}{\ShipT} -\ship{19}{8}{\ShipT} -\shipH{4,5,7,1,1,1,7,5,1,1,2,2,1,2,1,1,1,5,3,2,1,1,2,2} -\shipV{4,2,6,1,8,4,3,6,6,4,6,1,8} -\end{battleship} -\end{center} +\subsection{\texttt{battleshipsetup}} +With the command \cs{battleshipsetup}\margcs{\cmd\battleshipsetup\{\marg{options}\}} you can reset the options with global scope. +\section{Examples \& Solutions} +You\marginnote{\includegraphics[height=2cm]{qrcode.png}} can download application examples and their solutions from the \href{https://bitbucket.org/kleberj/battleship/}{project site}. 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/tex/latex/battleship/battleship.sty b/Master/texmf-dist/tex/latex/battleship/battleship.sty index 2d279912e8a..2195ddb8e84 100644 --- a/Master/texmf-dist/tex/latex/battleship/battleship.sty +++ b/Master/texmf-dist/tex/latex/battleship/battleship.sty @@ -23,13 +23,15 @@ % http://en.wikipedia.org/wiki/Battleship_%28puzzle%29 % http://de.wikipedia.org/wiki/Bimaru % -\ProvidesPackage{battleship}[2013/02/08 battleship.sty v1.0 - Josef Kleber (C) 2013]% +\ProvidesPackage{battleship}[2013/02/16 battleship.sty v1.1 - Josef Kleber (C) 2013]% % \RequirePackage{xkeyval}% \RequirePackage{ifthen}% \RequirePackage{ragged2e}% -\RequirePackage{tikz}% \RequirePackage{etoolbox}% +\RequirePackage{tikz}% +\usetikzlibrary{decorations.pathmorphing} +\tikzstyle{island} = [fill=yellow!30,draw, decorate, decoration={random steps,segment length=2.7pt,amplitude=1.7pt}] % % options \newcommand*\BS@width{6cm}% @@ -44,8 +46,11 @@ % \newcounter{BS@rows}% \newcounter{BS@columns}% -\newcounter{BS@shipH}% -\newcounter{BS@shipV}% +\newcounter{BS@counti}% +\newcounter{BS@countii}% +\newcounter{BS@countiii}% +\newcounter{BS@countiv}% +\newcounter{BS@whiledo}% % \setcounter{BS@rows}{\BS@rows}% \setcounter{BS@columns}{\BS@columns}% @@ -195,6 +200,8 @@ \newcommand*\ShipB{\tikz[scale=\BS@scale]\draw[scale=.36,fill=\BS@shipcolor](2,1)--(2,2)--(0,2)--(0,1) arc (180:360:1);}% \newcommand*\ShipL{\tikz[scale=\BS@scale]\draw[scale=.36,fill=\BS@shipcolor](1,2)--(2,2)--(2,0)--(1,0) arc (270:90:1);}% \newcommand*\ShipR{\tikz[scale=\BS@scale]\draw[scale=.36,fill=\BS@shipcolor](1,2)--(0,2)--(0,0)--(1,0) arc (270:450:1);}% +\newcommand*\Island{\tikz[scale=\BS@scale]\draw[scale=.36,island] (0,0) rectangle (2,2);}% +\newcommand*\Water{\tikz[scale=\BS@scale]\draw[scale=.36,fill,blue!40] (1,1) circle (0.2);}% % versions for \shipbox without second scale \newcommand*\@Ship{\tikz\draw[scale=.144,fill=\BS@shipcolor] (0,0) circle (1);}% \newcommand*\@ShipC{\tikz\draw[scale=.144,fill=\BS@shipcolor] (0,0)--(0,2)--(2,2)--(2,0)--cycle;}% @@ -210,14 +217,43 @@ % \newcommand*\BS@printpartsH[1]% {% - \stepcounter{BS@shipH}% - \BS@shipparts{\arabic{BS@shipH}}{\arabic{BS@shipV}}{#1}% + \stepcounter{BS@counti}% + \BS@shipparts{\arabic{BS@counti}}{\arabic{BS@countii}}{#1}% }% % \newcommand*\BS@printpartsV[1]% {% - \stepcounter{BS@shipV}% - \BS@shipparts{\arabic{BS@shipH}}{\arabic{BS@shipV}}{#1}% + \stepcounter{BS@countii}% + \BS@shipparts{\arabic{BS@counti}}{\arabic{BS@countii}}{#1}% +}% +% +\newcommand*\BS@ingrid[2]% +{% + \setcounter{BS@countiii}{#1}% column + \setcounter{BS@countiv}{#2}% row + \ifnum\value{BS@countiii}<1% + \PackageError{battleship}% + {ship segment outside of the grid}% + {You tried to set a ship segment at (#1,#2),\MessageBreak which is outside the grid (1,1) .. (\BS@columns,\BS@rows)}% + \fi% + \ifnum\value{BS@countiv}<1% + \PackageError{battleship}% + {ship segment outside of the grid}% + {You tried to set a ship segment at (#1,#2),\MessageBreak which is outside the grid (1,1) .. (\BS@columns,\BS@rows)}% + \fi% + % BS@columns = \BS@columns + 1 + \stepcounter{BS@countiii}% + \stepcounter{BS@countiv}% + \ifnum\value{BS@countiii}>\value{BS@columns}% + \PackageError{battleship}% + {ship segment outside of the grid}% + {You tried to set a ship segment at (#1,#2),\MessageBreak which is outside the grid (1,1) .. (\BS@columns,\BS@rows)}% + \fi% + \ifnum\value{BS@countiv}>\value{BS@rows}% + \PackageError{battleship}% + {ship segment outside of the grid}% + {You tried to set a ship segment at (#1,#2),\MessageBreak which is outside the grid (1,1) .. (\BS@columns,\BS@rows)}% + \fi% }% % \newcommand*\BS@printship[1]% @@ -241,29 +277,102 @@ % \newcommand*\shipH[1]% {% - \setcounter{BS@shipV}{\value{BS@rows}}% - \setcounter{BS@shipH}{0}% + \setcounter{BS@countii}{\value{BS@rows}}% + \setcounter{BS@counti}{0}% \forcsvlist\BS@printpartsH{#1}% }% % \newcommand*\shipV[1]% {% - \setcounter{BS@shipV}{0}% - \setcounter{BS@shipH}{0}% + \setcounter{BS@countii}{0}% + \setcounter{BS@counti}{0}% \forcsvlist\BS@printpartsV{#1}% }% % -\newcommand*\ship[3]% +\newcommand*\placesegment[3]% {% + \BS@ingrid{#1}{#2}% \node at (#1\BS@Pfive,#2\BS@Pfive){#3};% }% % +\let\ship\placesegment% +% +\newcommand*\placeisland[2]% +{% + \BS@ingrid{#1}{#2}% + \node at (#1\BS@Pfive,#2\BS@Pfive){\Island};% +}% +% +\newcommand*\placewater[2]% +{% + \BS@ingrid{#1}{#2}% + \node at (#1\BS@Pfive,#2\BS@Pfive){\Water};% +}% +% \newcommand*\shipbox[2][]% {% \setkeys{shipbox}{#1}% \gdef\BS@shipbox{#2}% }% % +\newcommand*\placeship[4]% +{% + \setcounter{BS@counti}{#4}% length + \ifnum\value{BS@counti}<1% + \PackageError{battleship}% + {ship length < 1}% + {The length of your ship should be at least 1}% + \fi% + \ifnum\value{BS@counti}>10% + \PackageError{battleship}% + {ship length > 10}% + {The supported max length of ships is 10!}% + \fi% + \ifnum\value{BS@counti}=1% + \placesegment{#2}{#3}{\Ship}% + \else% + \setcounter{BS@whiledo}{\value{BS@counti}}% + \addtocounter{BS@whiledo}{-2}% length of middle ship + \ifthenelse{\equal{#1}{V}}% + {% + \placesegment{#2}{#3}{\ShipB}% + \setcounter{BS@countii}{#3}% + \whiledo{\value{BS@whiledo}>0}% + {% + \addtocounter{BS@whiledo}{-1}% + \stepcounter{BS@countii}% + \placesegment{#2}{\theBS@countii}{\ShipC}% + }% + \stepcounter{BS@countii}% + \placesegment{#2}{\theBS@countii}{\ShipT}% + }% + {% + \ifthenelse{\equal{#1}{H}}% + {% + \placesegment{#2}{#3}{\ShipL}% + \setcounter{BS@counti}{#2}% + \whiledo{\value{BS@whiledo}>0}% + {% + \addtocounter{BS@whiledo}{-1}% + \stepcounter{BS@counti}% + \placesegment{\theBS@counti}{#3}{\ShipC}% + }% + \stepcounter{BS@counti}% + \placesegment{\theBS@counti}{#3}{\ShipR}% + }% + {\PackageError{battleship}% + {invalid direction (H/V)}% + {You can place your ship only\MessageBreak% + horizontally (H) or vertically (V)!}}% + }% + \fi% +}% +% +\newcommand*\battleshipsetup[1]% +{% + \setkeys{battleship.sty}{#1}% +}% +% \newenvironment{battleship}[1][]% {% \setkeys{battleship}{#1}% diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index c3095cc14da..4cb171052e3 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -2305,7 +2305,7 @@ $standardxmt='\.xmt'; 'fragmaster' => 'fragmaster\.pl$', 'fontools' => '(afm2afm|autoinst|ot2kpx)$', 'installfont' => 'installfont-tl', - 'jfontmaps' => 'updmap-setup-kanji\.pl|updmap-setup-kanji-sys.sh', + 'jfontmaps' => 'kanji-fontmap-creator|updmap-setup-kanji\.pl|updmap-setup-kanji-sys.sh', 'latex2man' => 'latex2man$', 'latexdiff' => 'latex(diff|diff-vc|revise)\.pl$', 'latexmk' => '\.pl$', |