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