From 93103eeca4e41ecaa874069b10f2a3de8c392435 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 7 Apr 2008 15:56:42 +0000 Subject: Substantial reworking of Solo so that it implements both Sudoku-X (require both main diagonals to have one of every digit in addition to all the usual constraints) and Jigsaw Sudoku (replace the array of rectangular sub-blocks with the sub-blocks being random polyominoes). To implement the latter, I've moved my `divvy.c' library routine out of the `unfinished' subdirectory. Jigsaw mode is currently an undocumented feature: you enable it by setting the rows parameter to 1 (and the columns parameter to your desired grid size, which unlike normal Sudoku can be anything you like including a prime number). The reason it's undocumented is because generation times are not yet reliably short: sometimes generating a jigsaw-type puzzle can hang for hours and still get nowhere. (The algorithm should terminate in principle, but not in any time you're prepared to wait.) I _think_ I know how to solve this, but have yet to try it. Until then, jigsaw mode will remain a hidden feature. Printing of X-type puzzles is also substandard at present, because the current print-colour API replaces the desired light shading of the X-cells with heavy diagonal hatching. I plan to adjust the API imminently to address this. [originally from svn r7974] --- puzzles.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'puzzles.h') diff --git a/puzzles.h b/puzzles.h index 5c967f2..ba8c4f5 100644 --- a/puzzles.h +++ b/puzzles.h @@ -382,6 +382,12 @@ combi_ctx *next_combi(combi_ctx *combi); /* returns NULL for end */ void free_combi(combi_ctx *combi); /* + * divvy.c + */ +/* divides w*h rectangle into pieces of size k. Returns w*h dsf. */ +int *divvy_rectangle(int w, int h, int k, random_state *rs); + +/* * Data structure containing the function calls and data specific * to a particular game. This is enclosed in a data structure so * that a particular platform can choose, if it wishes, to compile -- cgit v1.1