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