From 55abc0a885624841a26fa138113ac14705581ec9 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 13 Jan 2006 00:08:10 +0000 Subject: sudoku git-svn-id: svn://tug.org/texlive/trunk@1358 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/sudoku/sudoku.sty | 94 +++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/sudoku/sudoku.sty diff --git a/Master/texmf-dist/tex/latex/sudoku/sudoku.sty b/Master/texmf-dist/tex/latex/sudoku/sudoku.sty new file mode 100644 index 00000000000..bd3121d4a1c --- /dev/null +++ b/Master/texmf-dist/tex/latex/sudoku/sudoku.sty @@ -0,0 +1,94 @@ +%% +%% This is file `sudoku.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sudoku.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright 2005 Paul Abraham +%% +%% This work 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 "maintained". +%% +%% This Current Maintainer of this work is Paul Abraham. +%% +%% This work consists of the files sudoku.dtx, sudoku.ins +%% README, CHANGES and the derived file sudoku.sty. +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{sudoku} + [2005/06/29 v1.0 Sudoku grid] +\newcounter{@sudoku@row} +\newcounter{@sudoku@col} +\newcommand*\@sudoku@separator[1]{% + \stepcounter{@sudoku@col}% + \ifx#1\@sudoku@separator + \expandafter#1% + \else + \ifx.#1% + \setcounter{@sudoku@col}{-1}% + \addtocounter{@sudoku@row}{-1}% + \else + \put(\value{@sudoku@col},\value{@sudoku@row})% + {\makebox(1,1){\sudokuformat{#1}}}% + \fi + \fi +} +\begingroup + \catcode`\|=\active + \gdef\@sudoku@activate{\let|=\@sudoku@separator} +\endgroup +\newcommand*\@sudoku@grid{% + \thinlines + \multiput(0,0)(1,0){10}{\line(0,1){9}}% + \multiput(0,0)(0,1){10}{\line(1,0){9}} + \thicklines + \multiput(0,0)(3,0){4}{\line(0,1){9}}% + \multiput(0,0)(0,3){4}{\line(1,0){9}} +} +\newcommand*\sudokuformat[1]{\Huge\sffamily#1} +\newdimen\sudokusize +\setlength\sudokusize{10cm} +\newenvironment{sudoku-block}{% + \catcode`\|=\active + \@sudoku@activate + \setcounter{@sudoku@col}{-1}% + \setcounter{@sudoku@row}{8}% + \setlength\unitlength{.111111\sudokusize}% + \begin{picture}(9,9)% + \@sudoku@grid\@sudoku@grab@arguments + }{\end{picture}} + \begingroup + \@ifundefined{eTeXversion}{\endgroup + \def\@sudoku@grab@arguments#1{% + \ifx#1\@sudoku@separator + \expandafter#1% + \else + \PackageError{sudoku}{% + Sudoku puzzles are not allowed in the arguments\MessageBreak + of other commands}{% + Either fix this in your source (possibly using the `lrbox' + environment) or use an eTeX based LaTeX format} + \fi + }% + }{\endgroup + \def\@sudoku@grab@arguments#1.#2.#3.#4.#5.#6.#7.#8.#9.{% + \scantokens{#1.#2.#3.#4.#5.#6.#7.#8.#9.}}% + } +\newenvironment{sudoku}{% + \begin{center}% + \begin{sudoku-block}}{\end{sudoku-block}\end{center}} +\endinput +%% +%% End of file `sudoku.sty'. -- cgit v1.2.3