Chaos Sudoku Documentation

Chaos Sudoku

The puzzle

Fill the cells of an area with numbers from 1 to N of the N*N grid. Each number can appear only once – in each area, column, row or diagonal if indicated. Here’s a little self-explanatory example:

Chaos Sudoku

Options

  • rows (5) defines the number of rows in the grid

  • columns (5) specifies the number of columns in the grid

  • width (5.1cm) sets the width of the minipage, in which the grid is typeset

  • scale (1) scales the size of the grid in the minipage

  • fontsize (Large) specifies the size of the numbers next to the grid. Here, the usual LaTeX sizes are used. Possible values: tiny, scriptsize, footnotesize, small, normalsize, large, Large, LARGE, huge, Huge

  • title () sets the title of a puzzle

  • titleindent (0cm) defines the indent of the title

  • titlewidth (5.1cm) specifies the width of the box the title is set in

  • bgcolor () sets the background color of the grid

  • counterstyle (none) defines the counter style. Predefined styles: none, left, right

  • cvoffset (-22pt) sets the vertical offset of the counters in the margin

Environments

chaossudoku

The environment chaossudoku 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.

puzzlebackground

The puzzlebackground environment allows you to place elements behind the main layer. This is for example usefull for the fillarea command.

puzzleforeground

The puzzleforeground environment allows you to place elements in front of the main layer. This is for example usefull for the framearea command.

Commands

In the grid and around

chaossudokucell

chaossudokucell{column}{row}{number}

The command sets the {number} of the grid cell {column}{row}.

setrow

setrow{row}{csv list}

The command sets the contents of {row}. It expects a comma-separated list.

setcolumn

setcolumn{column}{csv list}

The command sets the contents of {column}.

framearea

framearea{color}{tikz path}

The command frames the area given by {tikz path} with color {color}. The reference for coordinates is the bottom left corner of the cell.

framearea{green}{(2,2)--(2,3)--(3,3)--(3,2)--(2,2)}

This command will color the frame of the grid cell (2,2) green. You should consider using this command in the puzzleforeground environment.

fillarea

fillarea{color}{tikz path}

The command fills the area given by {tikz path} with color {color}. The reference for coordinates is the bottom left corner of the cell. You should consider using this command in the puzzlebackground environment.

Presentation

definecounterstyle

The command allows you to define your own styles. For example, the style left is defined as follows:

To typeset the counter into the margin we use the command marginnote. We need to use the command 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 puzzlecounter in a tikz node with a vertical offset set with the option cvoffset.

puzzlecounter

puzzlecounter

The command provides the counter in textual form to use it for example in definecounterstyle.

titleformat

titleformat{format}

With the command titleformat, you can define the format of the title. By default, the definition is as follows:

titleformat{centeringLargecolor{blue}}

Miscellaneous

chaossudokusetup

chaossudokusetup{options}

With the command chaossudokusetup you can reset the options with global scope.

setpuzzlecounter

setpuzzlecounter{number}

With the command setpuzzlecounter, you can reset the puzzle counter, for example before the solutions.

Examples & Solutions

You can download application examples and their solutions from the project page. The puzzles are originally licensed under CC-BY-NC-SA.

qrcode

Kommentar verfassen

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.