The main grid outline in Pattern was asymmetric between the top/left
[sgt/puzzles] / puzzles.but
1 \title Simon Tatham's Portable Puzzle Collection
2
3 \cfg{winhelp-filename}{puzzles.hlp}
4 \cfg{winhelp-contents-titlepage}{Contents}
5
6 \cfg{text-filename}{puzzles.txt}
7
8 \cfg{xhtml-contents-filename}{index.html}
9 \cfg{xhtml-leaf-level}{1}
10 \cfg{xhtml-contents-depth-0}{1}
11 \cfg{xhtml-contents-depth-1}{2}
12 \cfg{xhtml-leaf-contains-contents}{true}
13
14 \cfg{info-filename}{puzzles.info}
15
16 \cfg{ps-filename}{puzzles.ps}
17 \cfg{pdf-filename}{puzzles.pdf}
18
19 This is a collection of small one-player puzzle games.
20
21 \copyright This manual is copyright 2004 Simon Tatham. All rights
22 reserved. You may distribute this documentation under the MIT licence.
23 See \k{licence} for the licence text in full.
24
25 \versionid $Id$
26
27
28 \C{intro} Introduction
29
30 I wrote this collection because I thought there should be more small
31 desktop toys available: little games you can pop up in a window and
32 play for two or three minutes while you take a break from whatever
33 else you were doing. And I was also annoyed that every time I found a
34 good game on (say) \i{Unix}, it wasn't available the next time I was
35 sitting at a \i{Windows} machine, or vice versa; so I arranged that
36 everything in my personal puzzle collection will happily run on both.
37 When I find (or perhaps invent) further puzzle games that I like,
38 they'll be added to this collection and will immediately be available
39 on both platforms. And if anyone feels like writing any other front
40 ends - Mac OS, PocketPC, or whatever it might be - then all the games
41 in this framework will immediately become available on another
42 platform as well.
43
44 The actual games in this collection were mostly not my invention; I
45 saw them elsewhere, and rewrote them in a form that was more
46 convenient for me. I do not claim credit, in general, for inventing
47 the rules of any of these puzzles; all I claim is authorship of the
48 code (or at least those parts of the code that weren't contributed
49 by other people!).
50
51 This collection is distributed under the \i{MIT licence} (see
52 \k{licence}). This means that you can do pretty much anything you like
53 with the game binaries or the code, except pretending you wrote them
54 yourself, or suing me if anything goes wrong.
55
56 The most recent versions, and \i{source code}, can be found at
57 \I{website}\W{http://www.chiark.greenend.org.uk/~sgtatham/puzzles/}\cw{http://www.chiark.greenend.org.uk/~sgtatham/puzzles/}.
58
59 Please report \I{feedback}\i{bugs} to
60 \W{mailto:anakin@pobox.com}\cw{anakin@pobox.com}.
61 You might find it helpful to read this article before reporting a bug:
62
63 \W{http://www.chiark.greenend.org.uk/~sgtatham/bugs.html}\cw{http://www.chiark.greenend.org.uk/~sgtatham/bugs.html}
64
65 \ii{Patches} are welcome. Especially if they provide a new front end
66 (to make all these games run on another platform), or a new game.
67
68
69 \C{common} \ii{Common features}
70
71 This chapter describes features that are common to all the games.
72
73 \H{common-actions} \I{controls}Common actions
74
75 These actions are all available from the \I{Game menu}\q{Game} menu
76 and via \I{keys}keyboard shortcuts, in addition to any game-specific
77 actions.
78
79 \dt \ii\e{New game} (\q{N}, Ctrl+\q{N})
80
81 \dd Starts a new game, with a random initial state.
82
83 \dt \ii\e{Restart game} (\q{R})
84
85 \dd Resets the current game to its initial state. Undo is lost.
86
87 \dt \ii\e{Undo} (\q{U}, Ctrl+\q{Z}, Ctrl+\q{_})
88
89 \dd Undoes a single move. (You can undo moves back to the start of the
90 game.)
91
92 \dt \ii\e{Redo} (Ctrl+\q{R})
93
94 \dd Redoes a previous undone move.
95
96 \dt \I{exit}\ii\e{Quit} (\q{Q}, Ctrl+\q{Q})
97
98 \dd Closes the application entirely.
99
100 \H{common-id} Recreating games with the \ii{game ID}
101
102 The \q{\i{Specific...}} option from the \I{Game menu}\q{Game} menu
103 lets you see a short string (the \q{game ID}) that captures the
104 initial state of the current game.
105
106 The precise \I{ID format}format of the ID is specific to each game.
107 It consists of two parts delimited by a colon (e.g., \c{c4x4:4F01,0});
108 the first part encodes \i\e{parameters} (such as grid size), while the
109 second part encodes a \i\e{seed}, which determines the \i{initial
110 state} of the game within those parameters.
111
112 You can specify a new ID (or just a seed) here. Pressing \q{OK} starts
113 a new game with the specified ID (whether you changed it or not).
114 Pressing \q{Cancel} returns to the current game.
115
116 You can also use the game ID (or just the encoded parameters) as a
117 \i{command line} argument; see \k{common-cmdline} for more detail.
118
119 Game IDs are portable across platforms; you can use a game ID
120 generated by the Windows version of a game on the Unix version, etc.
121
122 \H{common-type} The \q{Type} menu
123
124 The \I{Type menu}\q{Type} menu, if present, may contain a list of
125 \i{preset} game settings. Selecting one of these will start a new
126 random game with the parameters specified.
127
128 The \q{Type} menu may also contain a \q{\i{Custom...}} option which
129 allows you to fine-tune game \i{parameters}. The parameters available
130 are specific to each game and are described in the following sections.
131
132 \H{common-cmdline} Specifying game parameters on the \i{command line}
133
134 The games in this collection deliberately do not ever save
135 information on to the computer they run on: they have no high score
136 tables and no saved preferences. (This is because I expect at least
137 some people to play them at work, and those people will probably
138 appreciate leaving as little evidence as possible!)
139
140 However, if you do want to arrange for one of these games to default
141 to a particular set of parameters, you can specify them on the
142 command line.
143
144 The easiest way to do this is to set up the parameters you want
145 using the \q{Type} menu (see \k{common-type}), and then to select
146 \q{Specific} from the \q{Game} menu (see \k{common-id}). The text in
147 the \q{Game ID} box will be composed of two parts, separated by a
148 colon. The first of these parts represents the game parameters (the
149 size of the playing area, for example, and anything else you set
150 using the \q{Type} menu).
151
152 If you run the game with just that parameter text on the command
153 line, it will start up with the settings you specified.
154
155 For example: if you run Cube (see \k{cube}), select \q{Octahedron}
156 from the \q{Type} menu, and then go to the game ID selection, you
157 will see a string of the form \cq{o2x2:911A81,10}. Take only the
158 part before the colon (\cq{o2x2}), and start Cube with that text on
159 the command line: \cq{cube o2x2}.
160
161 If you copy the \e{entire} game ID on to the command line, the game
162 will start up in the specific game that was described. This is
163 occasionally a more convenient way to start a particular game ID
164 than by pasting it into the game ID selection box.
165
166 \C{net} \i{Net}
167
168 \cfg{winhelp-topic}{games.net}
169
170 (\e{Note:} the \i{Windows} version of this game is called
171 \i\cw{NETGAME.EXE} to avoid clashing with Windows's own \cw{NET.EXE}.)
172
173 I originally saw this in the form of a Flash game called \i{FreeNet}
174 \k{FreeNet}, written by Pavils Jurjans. The computer prepares a
175 network by connecting up the centres of squares in a grid, and then
176 shuffles the network by rotating every tile randomly. Your job is to
177 rotate it all back into place. The successful solution will be an
178 entirely connected network, with no closed loops. \#{Is it also true
179 that a correct solution will not contain any cycles?} As a visual aid,
180 all tiles which are connected to the one in the middle are
181 highlighted.
182
183 \B{FreeNet} \W{http://www.jurjans.lv/stuff/net/FreeNet.htm}\cw{http://www.jurjans.lv/stuff/net/FreeNet.htm}
184
185 \H{net-controls} \i{Net controls}
186
187 \IM{Net controls} controls, for Net
188 \IM{Net controls} keys, for Net
189 \IM{Net controls} shortcuts (keyboard), for Net
190
191 This game can be played with either the keyboard or the mouse. The
192 controls are:
193
194 \dt \e{Select tile}: mouse pointer, arrow keys
195
196 \dt \e{Rotate tile anticlockwise}: left mouse button, \q{A} key
197
198 \dt \e{Rotate tile clockwise}: right mouse button, \q{D} key
199
200 \dt \e{Lock (or unlock) tile}: middle mouse button, shift-click, \q{S} key
201
202 \dd You can lock a tile once you're sure of its orientation. You can
203 also unlock it again, but while it's locked you can't accidentally
204 turn it.
205
206 \dt \e{Jumble tiles}: \q{J} key
207
208 \dd This key turns all tiles that are not locked to random
209 orientations.
210
211 (All the actions described in \k{common-actions} are also available.)
212
213 \H{net-params} \I{parameters, for Net}Net parameters
214
215 These parameters are available from the \q{Custom...} option on the
216 \q{Type} menu.
217
218 \dt \e{Width}, \e{Height}
219
220 \dd Size of grid in tiles.
221
222 \dt \e{Walls wrap around}
223
224 \dd If checked, flow can pass from the left edge to the right edge,
225 and from top to bottom, and vice versa.
226
227 \dt \e{Barrier probability}
228
229 \dd A number between 0.0 and 1.0 controlling whether an immovable
230 barrier is placed between two tiles to prevent flow between them (a
231 higher number gives more barriers). Since barriers are immovable, they
232 act as constraints on the solution (i.e., hints).
233
234 \lcont{
235
236 The grid generation in Net has been carefully arranged so that the
237 barriers are independent of the rest of the grid. This means that if
238 you change the \e{Barrier probability} parameter, and then re-enter
239 the same game ID you were playing before (see \k{common-id}), you
240 should see exactly the same starting grid, with the only change
241 being the number of barriers. So if you're stuck on a particular
242 grid and need a hint, you could start up another instance of Net,
243 set up the same parameters but a higher barrier probability, and
244 enter the game seed from the original Net window.
245
246 }
247
248 \C{cube} \i{Cube}
249
250 \cfg{winhelp-topic}{games.cube}
251
252 This is another one I originally saw as a web game. This one was a
253 Java game \k{cube-java-game}, by Paul Scott. You have a grid of 16
254 squares, six of which are blue; on one square rests a cube. Your move
255 is to use the arrow keys to roll the cube through 90 degrees so that
256 it moves to an adjacent square. If you roll the cube on to a blue
257 square, the blue square is picked up on one face of the cube; if you
258 roll a blue face of the cube on to a non-blue square, the blueness is
259 put down again. (In general, whenever you roll the cube, the two faces
260 that come into contact swap colours.) Your job is to get all six blue
261 squares on to the six faces of the cube at the same time. Count your
262 moves and try to do it in as few as possible.
263
264 Unlike the original Java game, my version has an additional feature:
265 once you've mastered the game with a cube rolling on a square grid,
266 you can change to a triangular grid and roll any of a tetrahedron, an
267 octahedron or an icosahedron.
268
269 \B{cube-java-game} \W{http://www3.sympatico.ca/paulscott/cube/cube.htm}\cw{http://www3.sympatico.ca/paulscott/cube/cube.htm}
270
271 \H{cube-controls} \i{Cube controls}
272
273 \IM{Cube controls} controls, for Cube
274 \IM{Cube controls} keys, for Cube
275 \IM{Cube controls} shortcuts (keyboard), for Cube
276
277 This game is played with the keyboard. The arrow keys are used to roll the
278 cube (or other solid).
279
280 On the triangular grids, the mapping of arrow keys to directions is
281 more approximate. Vertical movement is disallowed where it doesn't
282 make sense. The four keys surrounding the arrow keys on the numeric
283 keypad (\q{7}, \q{9}, \q{1}, \q{3}) can be used for diagonal movement.
284
285 (All the actions described in \k{common-actions} are also available.)
286
287 \H{cube-params} \I{parameters, for Cube}Cube parameters
288
289 These parameters are available from the \q{Custom...} option on the
290 \q{Type} menu.
291
292 \dt \e{Type of solid}
293
294 \dd Selects the solid to roll (and hence the shape of the grid):
295 tetrahedron, cube, octahedron, or icosahedron.
296
297 \dt \e{Width / top}, \e{Height / bottom}
298
299 \dd On a square grid, horizontal and vertical dimensions. On a
300 triangular grid, the number of triangles on the top and bottom rows
301 respectively.
302
303
304 \C{fifteen} \i{Fifteen}
305
306 \cfg{winhelp-topic}{games.fifteen}
307
308 The old ones are the best: this is the good old \q{\i{15-puzzle}} with
309 sliding tiles. You have a 4x4 square grid; 15 squares contain numbered
310 tiles, and the sixteenth is empty. Your move is to choose a tile next
311 to the empty space, and slide it into the space. The aim is to end up
312 with the tiles in numerical order, with the space in the bottom right
313 (so that the top row reads 1,2,3,4 and the bottom row reads
314 13,14,15,\e{space}).
315
316 \H{fifteen-controls} \i{Fifteen controls}
317
318 \IM{Fifteen controls} controls, for Fifteen
319 \IM{Fifteen controls} keys, for Fifteen
320 \IM{Fifteen controls} shortcuts (keyboard), for Fifteen
321
322 This game can be controlled with the mouse or the keyboard.
323
324 A left-click with the mouse in the row or column containing the empty
325 space will move as many tiles as necessary to move the space to the
326 mouse pointer.
327
328 The arrow keys will move a tile adjacent to the space in the direction
329 indicated (moving the space in the \e{opposite} direction).
330
331 (All the actions described in \k{common-actions} are also available.)
332
333 \H{fifteen-params} \I{parameters, for Fifteen}Fifteen parameters
334
335 The only options available from the \q{Custom...} option on the \q{Type}
336 menu are \e{Width} and \e{Height}, which are self-explanatory. (Once
337 you've changed these, it's not a \q{15-puzzle} any more, of course!)
338
339
340 \C{sixteen} \i{Sixteen}
341
342 \cfg{winhelp-topic}{games.sixteen}
343
344 Another sliding tile puzzle, visually similar to Fifteen (see
345 \k{fifteen}) but with a different type of move. This time, there is no
346 hole: all 16 squares on the grid contain numbered squares. Your move
347 is to shift an entire row left or right, or shift an entire column up
348 or down; every time you do that, the tile you shift off the grid
349 re-appears at the other end of the same row, in the space you just
350 vacated. To win, arrange the tiles into numerical order (1,2,3,4 on
351 the top row, 13,14,15,16 on the bottom). When you've done that, try
352 playing on different sizes of grid.
353
354 I \e{might} have invented this game myself, though only by accident if
355 so (and I'm sure other people have independently invented it). I
356 thought I was imitating a screensaver I'd seen, but I have a feeling
357 that the screensaver might actually have been a Fifteen-type puzzle
358 rather than this slightly different kind. So this might be the one
359 thing in my puzzle collection which represents creativity on my part
360 rather than just engineering.
361
362 \H{sixteen-controls} \I{controls, for Sixteen}Sixteen controls
363
364 This game is played with the mouse. Left-clicking on an arrow will
365 move the appropriate row or column in the direction indicated.
366 Right-clicking will move it in the opposite direction.
367
368 (All the actions described in \k{common-actions} are also available.)
369
370 \H{sixteen-params} \I{parameters, for Sixteen}Sixteen parameters
371
372 The only parameters available from the \q{Custom...} option on the
373 \q{Type} menu are \e{Width} and \e{Height}, which are
374 self-explanatory.
375
376
377 \C{rectangles} \i{Rectangles}
378
379 \cfg{winhelp-topic}{games.rectangles}
380
381 You have a grid of squares, with numbers written in some (but not all)
382 of the squares. Your task is to subdivide the grid into rectangles of
383 various sizes, such that (a) every rectangle contains exactly one
384 numbered square, and (b) the area of each rectangle is equal to the
385 number written in its numbered square.
386
387 Credit for this game goes to the Japanese puzzle magazine \i{Nikoli}
388 \k{nikoli}; I've also seen a Palm implementation at \i{Puzzle Palace}
389 \k{puzzle-palace}. Unlike Puzzle Palace's implementation, my version
390 automatically generates random grids of any size you like. The quality
391 of puzzle design is therefore not quite as good as hand-crafted
392 puzzles would be (in particular, a unique solution cannot be
393 guaranteed), but on the plus side you get an inexhaustible supply of
394 puzzles tailored to your own specification.
395
396 \B{nikoli} \W{http://www.nikoli.co.jp/puzzles/7/index_text-e.htm}\cw{http://www.nikoli.co.jp/puzzles/7/index_text-e.htm}
397
398 \B{puzzle-palace} \W{http://www.puzzle.gr.jp/puzzle/sikaku/palm/index.html.en}\cw{http://www.puzzle.gr.jp/puzzle/sikaku/palm/index.html.en}
399
400 \H{rectangles-controls} \I{controls, for Rectangles}Rectangles controls
401
402 This game is played with the mouse.
403
404 Left-click any edge to toggle it on or off, or click and drag to draw
405 an entire rectangle (or line) on the grid in one go (removing any
406 existing edges within that rectangle).
407
408 When a rectangle of the correct size is completed, it will be shaded.
409
410 (All the actions described in \k{common-actions} are also available.)
411
412 \H{rectangles-params} \I{parameters, for Rectangles}Rectangles parameters
413
414 The \q{Custom...} option on the \q{Type} menu offers you \e{Width}
415 and \e{Height} parameters, which are self-explanatory.
416
417 \q{Expansion factor} is a mechanism for changing the type of grids
418 generated by the program. Some people prefer a grid containing a few
419 large rectangles to one containing many small ones. So you can ask
420 Rectangles to essentially generate a \e{smaller} grid than the size
421 you specified, and then to expand it by adding rows and columns.
422
423 The default expansion factor of zero means that Rectangles will
424 simply generate a grid of the size you ask for, and do nothing
425 further. If you set an expansion factor of (say) 0.5, it means that
426 each dimension of the grid will be expanded to half again as big
427 after generation. In other words, the initial grid will be 2/3 the
428 size in each dimension, and will be expanded to its full size
429 without adding any more rectangles.
430
431 Setting an expansion factor of around 0.5 tends to make the game
432 more difficult, and also (in my experience) rewards a less deductive
433 and more intuitive playing style. If you set it \e{too} high,
434 though, the game simply cannot generate more than a few rectangles
435 to cover the entire grid, and the game becomes trivial.
436
437 \H{rectangles-cmdline} \I{command line, for Rectangles}Additional
438 command-line configuration
439
440 The expansion factor parameter, described in \k{rectangles-params},
441 is not mentioned by default in the game ID (see \k{common-id}). So
442 if you set your expansion factor to (say) 0.75, and then you
443 generate an 11x11 grid, then the game ID will simply say
444 \c{11x11:}\e{numbers}. This means that if you send the game ID to
445 another player and they paste it into their copy of Rectangles,
446 their game will not be automatically configured to use the same
447 expansion factor in any subsequent grids it generates. (I don't
448 think the average person examining a single grid sent to them by
449 another player would want their configuration modified to that
450 extent.)
451
452 If you are specifying a game ID or game parameters on the command
453 line (see \k{common-cmdline}) and you do want to configure the
454 expansion factor, you can do it by suffixing the letter \cq{e} to
455 the parameters, followed by the expansion factor as a decimal
456 number. For example:
457
458 \b \cq{rect 11x11e0.75} starts Rectangles with a grid size of
459 11\u00d7{x}11 and an expansion factor of 0.75.
460
461 \b \cq{rect 11x11e0.75:g11c6e5e4a2_4e9c3b3d3b5g2b6c4k4g30a8n3j1g6a2}
462 starts Rectangles with a grid size of 11\u00d7{x}11, an expansion
463 factor of 0.75, \e{and} a specific game selected.
464
465 \C{netslide} \i{Netslide}
466
467 \cfg{winhelp-topic}{games.netslide}
468
469 This game was submitted by Richard Boulton. It combines the grid
470 generation of Net (see \k{net}) with the movement of Sixteen (see
471 \k{sixteen}): you have a Net grid, but instead of rotating tiles back
472 into place you have to slide them into place by moving a whole row at
473 a time.
474
475 As in Sixteen, \I{controls, for Netslide}control is with the mouse.
476 See \k{sixteen-controls}.
477
478 \I{parameters, for Netslide}Game parameters are the same as for Net
479 (see \k{net-params}).
480
481 \C{pattern} \i{Pattern}
482
483 \cfg{winhelp-topic}{games.pattern}
484
485 You have a grid of squares, which must all be filled in either black
486 or white. Beside each row of the grid are listed the lengths of the
487 runs of black squares on that row; above each column are listed the
488 lengths of the runs of black squares in that column. Your aim is to
489 fill in the entire grid black or white.
490
491 I first saw this puzzle form around 1995, under the name
492 \q{\i{nonograms}}. I've seen it in various places since then, under
493 different names.
494
495 Normally, puzzles of this type turn out to be a meaningful picture
496 of something once you've solved them. However, since this version
497 generates the puzzles automatically, they will just look like random
498 groupings of squares. (One user has suggested that this is actually
499 a \e{good} thing, since it prevents you from guessing the colour of
500 squares based on the picture, and forces you to use logic instead.)
501 The advantage, though, is that you never run out of them.
502
503 \H{pattern-controls} \I{controls, for Pattern}Pattern controls
504
505 This game is played with the mouse.
506
507 Left-click in a square to colour it black. Right-click to colour it
508 white. If you make a mistake, you can middle-click, or hold down
509 Shift while clicking with any button, to colour the square in the
510 default grey (meaning \q{undecided}) again.
511
512 You can click and drag with the left or right mouse button to colour
513 a vertical or horizontal line of squares black or white at a time
514 (respectively). If you click and drag with the middle button, or
515 with Shift held down, you can colour a whole rectangle of squares
516 grey.
517
518 (All the actions described in \k{common-actions} are also available.)
519
520 \H{pattern-parameters} \I{parameters, for Pattern}Pattern parameters
521
522 The only options available from the \q{Custom...} option on the \q{Type}
523 menu are \e{Width} and \e{Height}, which are self-explanatory.
524
525 \A{licence} \I{MIT licence}\ii{Licence}
526
527 This software is \i{copyright} 2004 Simon Tatham.
528
529 Portions copyright Richard Boulton.
530
531 Permission is hereby granted, free of charge, to any person
532 obtaining a copy of this software and associated documentation files
533 (the "Software"), to deal in the Software without restriction,
534 including without limitation the rights to use, copy, modify, merge,
535 publish, distribute, sublicense, and/or sell copies of the Software,
536 and to permit persons to whom the Software is furnished to do so,
537 subject to the following conditions:
538
539 The above copyright notice and this permission notice shall be
540 included in all copies or substantial portions of the Software.
541
542 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
543 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
544 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
545 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
546 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
547 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
548 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
549 SOFTWARE.
550
551 \IM{specific...} Specific..., menu option
552 \IM{custom...} Custom..., menu option
553
554 \IM{game ID} game ID
555 \IM{game ID} ID, game
556 \IM{ID format} ID format
557 \IM{ID format} format, ID
558 \IM{ID format} game ID, format
559
560 \IM{keys} keys
561 \IM{keys} shortcuts (keyboard)
562
563 \IM{initial state} initial state
564 \IM{initial state} state, initial
565
566 \IM{MIT licence} MIT licence
567 \IM{MIT licence} licence, MIT