summaryrefslogtreecommitdiff
path: root/macros/context/contrib/context-sudoku/sudoku/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'macros/context/contrib/context-sudoku/sudoku/README.md')
-rw-r--r--macros/context/contrib/context-sudoku/sudoku/README.md40
1 files changed, 40 insertions, 0 deletions
diff --git a/macros/context/contrib/context-sudoku/sudoku/README.md b/macros/context/contrib/context-sudoku/sudoku/README.md
new file mode 100644
index 0000000000..f9ffa7b04e
--- /dev/null
+++ b/macros/context/contrib/context-sudoku/sudoku/README.md
@@ -0,0 +1,40 @@
+# sudoku
+
+This is a ConTeXt port of a famous sudoku solver by Peter Norvig. It
+provides four commands, as well as a command handler:
+
+1. `\sudoku` typesets a sudoku if valid.
+2. `\sudokufile` typesets a sudoku from a file if valid.
+3. `\solvesudoku` solves a sudoku if valid.
+3. `\solvesudokufile` solves a sudoku from a file if valid.
+5. `\setupsudoku` is the command handler for commands above.
+
+`\setupsudoku` understands the following parameters:
+
+```tex
+\setupsudoku
+ [size=2em,
+ align={middle,lohi},
+ evenbackground=color,
+ oddbackground=color,
+ evenbackgroundcolor=darkred,
+ oddbackgroundcolor=darkblue]
+```
+
+As you might notice, sudokus are just `TABLE`'s in disguise, but only
+certain parameters are passed in order to enforce constraints and keep
+a sudoku in square shape.
+
+If an invalid sudoku or sudoku file is provided, a placeholder with an
+error message is printed instead. To change message errors, set
+something like this:
+
+```tex
+\setupsudoku
+ [placeholdercommand=\inframed,
+ placeholderlabela=First error,
+ placeholderlabelb=Second error,
+ placeholderlabelc=Third error]
+```
+
+For actual examples, check `t-sudoku.mkvi`.