summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/src/html
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/puzzles/src/html')
-rw-r--r--apps/plugins/puzzles/src/html/blackbox.html16
-rw-r--r--apps/plugins/puzzles/src/html/bridges.html13
-rw-r--r--apps/plugins/puzzles/src/html/cube.html14
-rw-r--r--apps/plugins/puzzles/src/html/dominosa.html10
-rw-r--r--apps/plugins/puzzles/src/html/fifteen.html6
-rw-r--r--apps/plugins/puzzles/src/html/filling.html12
-rw-r--r--apps/plugins/puzzles/src/html/flip.html10
-rw-r--r--apps/plugins/puzzles/src/html/flood.html8
-rw-r--r--apps/plugins/puzzles/src/html/galaxies.html11
-rw-r--r--apps/plugins/puzzles/src/html/group.html52
-rw-r--r--apps/plugins/puzzles/src/html/guess.html12
-rw-r--r--apps/plugins/puzzles/src/html/inertia.html14
-rwxr-xr-xapps/plugins/puzzles/src/html/javapage.pl104
-rwxr-xr-xapps/plugins/puzzles/src/html/jspage.pl242
-rw-r--r--apps/plugins/puzzles/src/html/keen.html15
-rw-r--r--apps/plugins/puzzles/src/html/lightup.html10
-rw-r--r--apps/plugins/puzzles/src/html/loopy.html13
-rw-r--r--apps/plugins/puzzles/src/html/magnets.html17
-rw-r--r--apps/plugins/puzzles/src/html/map.html15
-rw-r--r--apps/plugins/puzzles/src/html/mines.html18
-rw-r--r--apps/plugins/puzzles/src/html/net.html17
-rw-r--r--apps/plugins/puzzles/src/html/netslide.html14
-rw-r--r--apps/plugins/puzzles/src/html/palisade.html11
-rw-r--r--apps/plugins/puzzles/src/html/pattern.html12
-rw-r--r--apps/plugins/puzzles/src/html/pearl.html13
-rw-r--r--apps/plugins/puzzles/src/html/pegs.html8
-rw-r--r--apps/plugins/puzzles/src/html/range.html21
-rw-r--r--apps/plugins/puzzles/src/html/rect.html10
-rw-r--r--apps/plugins/puzzles/src/html/samegame.html14
-rw-r--r--apps/plugins/puzzles/src/html/signpost.html14
-rw-r--r--apps/plugins/puzzles/src/html/singles.html11
-rw-r--r--apps/plugins/puzzles/src/html/sixteen.html8
-rw-r--r--apps/plugins/puzzles/src/html/slant.html9
-rw-r--r--apps/plugins/puzzles/src/html/solo.html20
-rw-r--r--apps/plugins/puzzles/src/html/tents.html20
-rw-r--r--apps/plugins/puzzles/src/html/towers.html22
-rw-r--r--apps/plugins/puzzles/src/html/tracks.html19
-rw-r--r--apps/plugins/puzzles/src/html/twiddle.html15
-rw-r--r--apps/plugins/puzzles/src/html/undead.html22
-rw-r--r--apps/plugins/puzzles/src/html/unequal.html14
-rw-r--r--apps/plugins/puzzles/src/html/unruly.html11
-rw-r--r--apps/plugins/puzzles/src/html/untangle.html5
42 files changed, 922 insertions, 0 deletions
diff --git a/apps/plugins/puzzles/src/html/blackbox.html b/apps/plugins/puzzles/src/html/blackbox.html
new file mode 100644
index 0000000000..f98604f12f
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/blackbox.html
@@ -0,0 +1,16 @@
1Black Box
2<p>
3Determine where the hidden balls are in the box, by observing the
4behaviour of light beams fired into the box from the sides.
5<p>
6Click in a square around the edge of the box to send a beam into the
7box. Possible results are 'H' (the beam hit a ball dead-on and
8stopped), 'R' (the beam was either reflected back the way it came or
9there was a ball just to one side of its entry point) or a number
10appearing in two squares (indicating that the beam entered one of
11those squares and emerged from the other).
12<p>
13Click in the middle of the box to place your guessed ball positions.
14When you have placed enough, a green button will appear in the top
15left; click that to indicate that you think you have the answer.
16You can also right-click to mark squares as definitely known.
diff --git a/apps/plugins/puzzles/src/html/bridges.html b/apps/plugins/puzzles/src/html/bridges.html
new file mode 100644
index 0000000000..06ec2d4d4b
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/bridges.html
@@ -0,0 +1,13 @@
1Bridges
2<p>
3Draw horizontal or vertical bridges to link up all the islands.
4Bridges may be single or double; they may not cross; the islands
5must all end up connected to each other; the number in each island
6must match the number of bridges that end at that island (counting
7double bridges as two). Note that loops of bridges are permitted.
8<p>
9Click on an island and drag left, right, up or down to draw a bridge
10to the next island in that direction. Do the same again to create a
11double bridge, and again to remove the bridge if you change your
12mind. Click on an island without dragging to mark the island as
13completed once you think you have placed all its bridges.
diff --git a/apps/plugins/puzzles/src/html/cube.html b/apps/plugins/puzzles/src/html/cube.html
new file mode 100644
index 0000000000..f08e16c38d
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/cube.html
@@ -0,0 +1,14 @@
1Cube
2<p>
3Roll the cube around the grid, picking up the blue squares on its
4faces. Try to get all the blue squares on to the object at the same
5time, in as few moves as possible.
6<p>
7Use the arrow keys to roll the cube, or click the mouse where you
8want it to roll towards. After every roll, the grid square and cube
9face that you brought into contact swap their colours, so that a
10non-blue cube face can pick up a blue square, but a blue face rolled
11on to a non-blue square puts it down again.
12<p>
13When you have mastered the cube, use the Type menu to select other
14regular solids!
diff --git a/apps/plugins/puzzles/src/html/dominosa.html b/apps/plugins/puzzles/src/html/dominosa.html
new file mode 100644
index 0000000000..d2f672806a
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/dominosa.html
@@ -0,0 +1,10 @@
1Dominosa
2<p>
3Tile the rectangle with dominoes (1&times;2 rectangles) so that
4every possible domino appears exactly once (that is, every possible
5pair of numbers, including doubles).
6<p>
7Click between two adjacent numbers to place or remove a domino.
8Right-click to place a line between numbers if you think a domino
9definitely cannot go there. Dominoes light up red if two identical
10ones appear on the grid.
diff --git a/apps/plugins/puzzles/src/html/fifteen.html b/apps/plugins/puzzles/src/html/fifteen.html
new file mode 100644
index 0000000000..53053b440d
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/fifteen.html
@@ -0,0 +1,6 @@
1Fifteen
2<p>
3Slide the tiles around the box until they appear in numerical order
4from the top left, with the hole in the bottom right corner.
5<p>
6Click on a tile to slide it towards the hole.
diff --git a/apps/plugins/puzzles/src/html/filling.html b/apps/plugins/puzzles/src/html/filling.html
new file mode 100644
index 0000000000..70ce16d4a9
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/filling.html
@@ -0,0 +1,12 @@
1Filling
2<p>
3Write a number in every blank square of the grid. When the grid is
4full, every orthogonally connected group of identical numbers should
5have an area equal to that number: so 1s always appear alone, 2s in
6pairs, and so on.
7<p>
8To place a number, click the mouse in a blank square to select it,
9then type the number you want on the keyboard. You can also drag to
10select multiple squares, and then type a number to place it in all
11of them. To erase numbers, select one or more squares in the same
12way and then press Backspace.
diff --git a/apps/plugins/puzzles/src/html/flip.html b/apps/plugins/puzzles/src/html/flip.html
new file mode 100644
index 0000000000..404aae6b9a
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/flip.html
@@ -0,0 +1,10 @@
1Flip
2<p>
3Try to light up all the squares in the grid by flipping combinations
4of them.
5<p>
6Click in a square to flip it and some of its neighbours. The diagram
7in each square indicates which other squares will flip.
8<p>
9Select one of the 'Random' settings from the Type menu for more
10varied puzzles.
diff --git a/apps/plugins/puzzles/src/html/flood.html b/apps/plugins/puzzles/src/html/flood.html
new file mode 100644
index 0000000000..cf09eac766
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/flood.html
@@ -0,0 +1,8 @@
1Flood
2<p>
3Try to get the whole grid to be the same colour within the given
4number of moves, by repeatedly flood-filling the top left corner in
5different colours.
6<p>
7Click in a square to flood-fill the top left corner with that square's
8colour.
diff --git a/apps/plugins/puzzles/src/html/galaxies.html b/apps/plugins/puzzles/src/html/galaxies.html
new file mode 100644
index 0000000000..8041a95cee
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/galaxies.html
@@ -0,0 +1,11 @@
1Galaxies
2<p>
3Draw lines along grid edges so as to divide the grid up into
4regions. Every region should have two-way rotational symmetry, and
5should contain exactly one dot which is in its centre.
6<p>
7Click on a grid edge to add or remove a line. Right-click on a dot
8and drag the mouse to place an arrow in a grid square pointing to
9that dot, to indicate that you think that square must belong in the
10same region as that dot. Right-drag an existing arrow to move it, or
11drop it off the edge of the grid to remove it.
diff --git a/apps/plugins/puzzles/src/html/group.html b/apps/plugins/puzzles/src/html/group.html
new file mode 100644
index 0000000000..c0f52de629
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/group.html
@@ -0,0 +1,52 @@
1unfinished:Group
2<p>
3Fill in the grid with the letters shown to the top and left of it, so
4that the full grid is a valid
5<a href="http://en.wikipedia.org/wiki/Cayley_table">Cayley table</a>
6for a
7<a href="http://en.wikipedia.org/wiki/Group_(mathematics)">group</a>.
8<p>
9If you don't already know what a group is, I don't really recommend
10trying to play this game. But if you want to try anyway, the above is
11equivalent to saying that the following conditions must be satisfied:
12<ul>
13<li>
14<strong>Latin square</strong>. Every row and column must contain
15exactly one of each letter.
16<li>
17<strong>Identity</strong>. There must be some letter <i>e</i> such
18that, for all <i>a</i>, the letter in row <i>e</i> column <i>a</i> and
19the one in row <i>a</i> column <i>e</i> are both <i>a</i>. In the
20default mode, this letter is always <i>e</i> and its row and column
21are filled in for you; by reconfiguring the game using the Type menu,
22you can select a mode in which you have to work out which letter is
23the identity.
24<li>
25<strong>Inverses</strong>. For every letter <i>a</i>, there must be
26some letter <i>b</i> (which may sometimes be the same letter
27as <i>a</i>) such that the letters in row <i>a</i> column <i>b</i> and
28in row <i>b</i> column <i>a</i> are both the identity letter (as
29defined above).
30<li>
31<strong>Associativity</strong>. For every combination of
32letters <i>a</i>, <i>b</i>, and <i>c</i>, denote the letter in
33row <i>a</i> column <i>b</i> by <i>d</i>, and the one in row <i>b</i>
34column <i>c</i> by <i>e</i>. Then the letters in row <i>d</i>
35column <i>c</i> and in row <i>a</i> column <i>e</i> must be the same.
36</ul>
37<p>
38To place a letter, click in a square to select it, then type the
39letter on the keyboard. To erase a letter, click to select a square
40and then press Backspace.
41<p>
42Right-click in a square and then type a letter to add or remove the
43number as a pencil mark, indicating letters that you think
44<em>might</em> go in that square.
45<p>
46You can rearrange the order of elements in the rows and columns by
47dragging the column or row headings back and forth. (The rows and
48columns will stay in sync with each other.) Also,
49left-clicking <em>between</em> two row or column headings will add or
50remove a thick line between those two rows and the corresponding pair
51of columns (which is useful if you're considering a subgroup and its
52cosets).
diff --git a/apps/plugins/puzzles/src/html/guess.html b/apps/plugins/puzzles/src/html/guess.html
new file mode 100644
index 0000000000..1e4fc1ed04
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/guess.html
@@ -0,0 +1,12 @@
1Guess
2<p>
3Try to guess the hidden combination of colours. You will be given
4limited information about each guess you make, enabling you to
5refine the next guess.
6<p>
7Drag from the colours on the left into the topmost unfilled row to
8make a guess; then click on the small circles to submit that guess.
9The small circles give you your feedback: black pegs indicate how
10many of the colours you guessed were the right colour in the right
11place, and white pegs indicate how many of the rest were the right
12colours but in the wrong place.
diff --git a/apps/plugins/puzzles/src/html/inertia.html b/apps/plugins/puzzles/src/html/inertia.html
new file mode 100644
index 0000000000..20077c0048
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/inertia.html
@@ -0,0 +1,14 @@
1Inertia
2<p>
3Slide the ball around the grid picking up the gems. Every time the
4ball moves, it will keep sliding until it either hits a wall, or
5stops on a stop square (the broken circles). Try to collect every
6gem without running into any of the mines.
7<p>
8Use the numeric keypad to slide the ball horizontally, vertically or
9diagonally. Alternatively, click on the grid to make the ball move
10towards where you clicked.
11<p>
12If you hit a mine and explode, you can select Undo from the Game
13menu and continue playing; the game will track how many times you
14died.
diff --git a/apps/plugins/puzzles/src/html/javapage.pl b/apps/plugins/puzzles/src/html/javapage.pl
new file mode 100755
index 0000000000..cd5e6a1669
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/javapage.pl
@@ -0,0 +1,104 @@
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6open my $footerfile, "<", shift @ARGV or die "footer: open: $!\n";
7my $footer = "";
8$footer .= $_ while <$footerfile>;
9close $footerfile;
10
11for my $arg (@ARGV) {
12 $arg =~ /(.*\/)?([^\/]+)\.html$/ or die;
13 my $filename = $2;
14 open my $gamefile, "<", $arg or die "$arg: open: $!\n";
15 my $unfinished = 0;
16 my $docname = $filename;
17 chomp(my $puzzlename = <$gamefile>);
18 while ($puzzlename =~ s/^([^:=]+)(=([^:]+))?://) {
19 if ($1 eq "unfinished") {
20 $unfinished = 1;
21 } elsif ($1 eq "docname") {
22 $docname = $3;
23 } else {
24 die "$arg: unknown keyword '$1'\n";
25 }
26 }
27 my $instructions = "";
28 $instructions .= $_ while <$gamefile>;
29 close $gamefile;
30
31 open my $outpage, ">", "${filename}.html";
32
33 my $unfinishedtitlefragment = $unfinished ? "an unfinished puzzle " : "";
34 my $unfinishedheading = $unfinished ? "<h2 align=center>an unfinished puzzle</h2>\n" : "";
35 my $unfinishedpara;
36 my $links;
37 if ($unfinished) {
38 $unfinishedpara = <<EOF;
39<p>
40You have found your way to a page containing an <em>unfinished</em>
41puzzle in my collection, not linked from the <a href="../">main
42puzzles page</a>. Don't be surprised if things are hard to understand
43or don't work as you expect.
44EOF
45 $links = <<EOF;
46<p align="center">
47<a href="../">Back to main puzzles page</a> (which does not link to this)
48EOF
49 } else {
50 $unfinishedpara = "";
51 $links = <<EOF;
52<p align="center">
53<a href="../doc/${docname}.html#${docname}">Full instructions</a>
54|
55<a href="../">Back to main puzzles page</a>
56EOF
57 }
58
59 print $outpage <<EOF;
60<html>
61<head>
62<title>${puzzlename}, ${unfinishedtitlefragment}from Simon Tatham's Portable Puzzle Collection</title>
63<link rel="stylesheet" type="text/css" href="../../sitestyle.css" name="Simon Tatham's Home Page Style">
64<script type="text/javascript" src="resize-puzzle-applet.js"></script>
65</head>
66<body onLoad="initResizablePuzzleApplet();">
67<h1 align=center>${puzzlename}</h1>
68${unfinishedheading}
69<h2 align=center>from Simon Tatham's Portable Puzzle Collection</h2>
70
71${unfinishedpara}
72
73<p align="center">
74<table cellpadding="0">
75<tr>
76<td>
77<applet id="applet" archive="${filename}.jar" code="PuzzleApplet"
78 width="700" height="500">
79</applet>
80</td>
81<td>
82<div id="eresize" style="width:5px;height:500px;cursor:e-resize;"></div>
83</td>
84</tr>
85<td>
86<div id="sresize" style="width:700px;height:5px;cursor:s-resize;"></div>
87</td>
88<td>
89<div id="seresize" style="width:5px;height:5px;cursor:se-resize;"></div>
90</td>
91</tr>
92</table>
93
94${instructions}
95
96${links}
97
98${footer}
99</body>
100</html>
101EOF
102
103 close $outpage;
104}
diff --git a/apps/plugins/puzzles/src/html/jspage.pl b/apps/plugins/puzzles/src/html/jspage.pl
new file mode 100755
index 0000000000..a21f977166
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/jspage.pl
@@ -0,0 +1,242 @@
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6open my $footerfile, "<", shift @ARGV or die "footer: open: $!\n";
7my $footer = "";
8$footer .= $_ while <$footerfile>;
9close $footerfile;
10
11for my $arg (@ARGV) {
12 $arg =~ /(.*\/)?([^\/]+)\.html$/ or die;
13 my $filename = $2;
14 open my $gamefile, "<", $arg or die "$arg: open: $!\n";
15 my $unfinished = 0;
16 my $docname = $filename;
17 chomp(my $puzzlename = <$gamefile>);
18 while ($puzzlename =~ s/^([^:=]+)(=([^:]+))?://) {
19 if ($1 eq "unfinished") {
20 $unfinished = 1;
21 } elsif ($1 eq "docname") {
22 $docname = $3;
23 } else {
24 die "$arg: unknown keyword '$1'\n";
25 }
26 }
27 my $instructions = "";
28 $instructions .= $_ while <$gamefile>;
29 close $gamefile;
30
31 open my $outpage, ">", "${filename}.html";
32
33 my $unfinishedtitlefragment = $unfinished ? "an unfinished puzzle " : "";
34 my $unfinishedheading = $unfinished ? "<h2 align=center>an unfinished puzzle</h2>\n" : "";
35 my $unfinishedpara;
36 my $links;
37 if ($unfinished) {
38 $unfinishedpara = <<EOF;
39<p>
40You have found your way to a page containing an <em>unfinished</em>
41puzzle in my collection, not linked from the <a href="../">main
42puzzles page</a>. Don't be surprised if things are hard to understand
43or don't work as you expect.
44EOF
45 $links = <<EOF;
46<p align="center">
47<a href="../">Back to main puzzles page</a> (which does not link to this)
48EOF
49 } else {
50 $unfinishedpara = "";
51 $links = <<EOF;
52<p align="center">
53<a href="../doc/${docname}.html#${docname}">Full instructions</a>
54|
55<a href="../">Back to main puzzles page</a>
56EOF
57 }
58
59 print $outpage <<EOF;
60<!DOCTYPE html>
61<html>
62<head>
63<meta http-equiv="Content-Type" content="text/html; charset=ASCII" />
64<title>${puzzlename}, ${unfinishedtitlefragment}from Simon Tatham's Portable Puzzle Collection</title>
65<script type="text/javascript" src="${filename}.js"></script>
66<style class="text/css">
67/* Margins and centring on the top-level div for the game menu */
68#gamemenu { margin-top: 0; margin-bottom: 0.5em; text-align: center }
69
70/* Inside that div, the main menu bar and every submenu inside it is a <ul> */
71#gamemenu ul {
72 list-style: none; /* get rid of the normal unordered-list bullets */
73 display: inline; /* make top-level menu bar items appear side by side */
74 position: relative; /* allow submenus to position themselves near parent */
75 margin: 0;
76 margin-bottom: 0.5em;
77 padding: 0;
78}
79
80/* Individual menu items are <li> elements within such a <ul> */
81#gamemenu ul li {
82 /* Add a little mild text formatting */
83 font-weight: bold; font-size: 0.8em;
84 /* Line height and padding appropriate to top-level menu items */
85 padding-left: 0.75em; padding-right: 0.75em;
86 padding-top: 0.2em; padding-bottom: 0.2em;
87 margin: 0;
88 /* Make top-level menu items appear side by side, not vertically stacked */
89 display: inline;
90 /* Suppress the text-selection I-beam pointer */
91 cursor: default;
92 /* Surround each menu item with a border. The left border is removed
93 * because it will abut the right border of the previous item. (A rule
94 * below will reinstate the left border for the leftmost menu item.) */
95 border-left: 0;
96 border-right: 1px solid rgba(0,0,0,0.3);
97 border-top: 1px solid rgba(0,0,0,0.3);
98 border-bottom: 1px solid rgba(0,0,0,0.3);
99}
100
101#gamemenu ul li.disabled {
102 /* Grey out menu items with the "disabled" class */
103 color: rgba(0,0,0,0.5);
104}
105
106#gamemenu ul li:first-of-type {
107 /* Reinstate the left border for the leftmost top-level menu item */
108 border-left: 1px solid rgba(0,0,0,0.3);
109}
110
111#gamemenu ul li:hover {
112 /* When the mouse is over a menu item, highlight it */
113 background: rgba(0,0,0,0.3);
114 /* Set position:relative, so that if this item has a submenu it can
115 * position itself relative to the parent item. */
116 position: relative;
117}
118
119#gamemenu ul li.disabled:hover {
120 /* Disabled menu items don't get a highlight on mouse hover */
121 background: inherit;
122}
123
124#gamemenu ul ul {
125 /* Second-level menus and below are not displayed by default */
126 display: none;
127 /* When they are displayed, they are positioned immediately below
128 * their parent <li>, and with the left edge aligning */
129 position: absolute;
130 top: 100%;
131 left: 0;
132 /* We must specify an explicit background colour for submenus, because
133 * they must be opaque (don't want other page contents showing through
134 * them). */
135 background: white;
136 /* And make sure they appear in front. */
137 z-index: 1;
138}
139
140#gamemenu ul ul.left {
141 /* A second-level menu with class "left" aligns its right edge with
142 * its parent, rather than its left edge */
143 left: inherit; right: 0;
144}
145
146/* Menu items in second-level menus and below */
147#gamemenu ul ul li {
148 /* Go back to vertical stacking, for drop-down submenus */
149 display: block;
150 /* Inhibit wrapping, so the submenu will expand its width as needed. */
151 white-space: nowrap;
152 /* Override the text-align:center from above */
153 text-align: left;
154 /* Don't make the text any smaller than the previous level of menu */
155 font-size: 100%;
156 /* This time it's the top border that we omit on all but the first
157 * element in the submenu, since now they're vertically stacked */
158 border-left: 1px solid rgba(0,0,0,0.3);
159 border-right: 1px solid rgba(0,0,0,0.3);
160 border-top: 0;
161 border-bottom: 1px solid rgba(0,0,0,0.3);
162}
163
164#gamemenu ul ul li:first-of-type {
165 /* Reinstate top border for first item in a submenu */
166 border-top: 1px solid rgba(0,0,0,0.3);
167}
168
169#gamemenu ul ul ul {
170 /* Third-level submenus are drawn to the side of their parent menu
171 * item, not below it */
172 top: 0; left: 100%;
173}
174
175#gamemenu ul ul ul.left {
176 /* A submenu with class "left" goes to the left of its parent,
177 * not the right */
178 left: inherit; right: 100%;
179}
180
181#gamemenu ul li:hover > ul {
182 /* Last but by no means least, the all-important line that makes
183 * submenus be displayed! Any <ul> whose parent <li> is being
184 * hovered over gets display:block overriding the display:none
185 * from above. */
186 display: block;
187}
188</style>
189</head>
190<body onLoad="initPuzzle();">
191<h1 align=center>${puzzlename}</h1>
192${unfinishedheading}
193<h2 align=center>from Simon Tatham's Portable Puzzle Collection</h2>
194
195${unfinishedpara}
196
197<hr>
198<div id="puzzle" style="display: none">
199<div id="gamemenu"><ul><li id="new">New game</li
200><li id="restart">Restart game</li
201><li id="undo">Undo move</li
202><li id="redo">Redo move</li
203><li id="solve">Solve game</li
204><li id="specific">Enter game ID</li
205><li id="random">Enter random seed</li
206><li>Select game type<ul id="gametype" class="left"></ul></li
207></ul></div>
208<div align=center>
209 <div id="resizable" style="position:relative; left:0; top:0">
210 <canvas style="display: block" id="puzzlecanvas" width="1px" height="1px" tabindex="1">
211 </canvas>
212 <div id="statusbarholder" style="display: block">
213 </div>
214 </div>
215 <p>
216 Link to this puzzle:
217 <a id="permalink-desc">by game ID</a>
218 <a id="permalink-seed">by random seed</a>
219 </p>
220</div>
221</div>
222<div id="apology">
223Sorry, this Javascript puzzle doesn't seem to work in your web
224browser. Perhaps you have Javascript disabled, or perhaps your browser
225doesn't provide a feature that the puzzle code requires (such as
226<a href="https://developer.mozilla.org/en-US/docs/JavaScript/Typed_arrays">typed arrays</a>).
227These puzzles have been successfully run in Firefox 19, Chrome 26,
228Internet Explorer 10 and Safari 6.
229</div>
230<hr>
231
232${instructions}
233
234${links}
235
236${footer}
237</body>
238</html>
239EOF
240
241 close $outpage;
242}
diff --git a/apps/plugins/puzzles/src/html/keen.html b/apps/plugins/puzzles/src/html/keen.html
new file mode 100644
index 0000000000..bd0eb3644d
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/keen.html
@@ -0,0 +1,15 @@
1Keen
2<p>
3Fill in the grid with digits from 1 to the grid size, so that every
4digit appears exactly once in each row and column, and so that all
5the arithmetic clues are satisfied (i.e. the clue number in each
6thick box should be possible to construct from the digits in the box
7using the specified arithmetic operation).
8<p>
9To place a number, click in a square to select it, then type the
10number on the keyboard. To erase a number, click to select a square
11and then press Backspace.
12<p>
13Right-click in a square and then type a number to add or remove the
14number as a pencil mark, indicating numbers that you think
15<em>might</em> go in that square.
diff --git a/apps/plugins/puzzles/src/html/lightup.html b/apps/plugins/puzzles/src/html/lightup.html
new file mode 100644
index 0000000000..2de2f91bb9
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/lightup.html
@@ -0,0 +1,10 @@
1Light Up
2<p>
3Place light bulbs in the grid so as to light up all the blank
4squares. A light illuminates its own square and all the squares in
5the same row or column unless blocked by walls (black squares).
6Lights may not illuminate each other. Each numbered square must be
7orthogonally adjacent to exactly the given number of lights.
8<p>
9Click on a square to place or remove a light. Right-click to place a
10dot indicating that you think there is no light in that square.
diff --git a/apps/plugins/puzzles/src/html/loopy.html b/apps/plugins/puzzles/src/html/loopy.html
new file mode 100644
index 0000000000..96f3a9d908
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/loopy.html
@@ -0,0 +1,13 @@
1Loopy
2<p>
3Form a single closed loop out of the grid edges, in such a way that
4every numbered square has exactly that many of its edges included in
5the loop.
6<p>
7Click on a grid edge to mark it as part of the loop (black), and
8again to return to marking it as undecided (yellow). Right-click on
9a grid edge to mark it as definitely not part of the loop (faint
10grey), and again to mark it as undecided again.
11<p>
12When you have mastered the square grid, look in the Type menu for
13many other types of tiling!
diff --git a/apps/plugins/puzzles/src/html/magnets.html b/apps/plugins/puzzles/src/html/magnets.html
new file mode 100644
index 0000000000..2807569a6c
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/magnets.html
@@ -0,0 +1,17 @@
1Magnets
2<p>
3Fill each domino shape with either a magnet (consisting of a + and
4&#8722; pole) or a neutral domino (green).
5<p>
6The number of + poles that in each row and column must match the
7numbers along the top and left; the number of &#8722; poles must
8match the numbers along the bottom and right. Two + poles may not be
9orthogonally adjacent to each other, and similarly two &#8722; poles.
10<p>
11Left-click a domino to toggle it between being empty and being a
12magnet (the + is placed in the end you click). Right-click to toggle
13between empty, neutral, and a ?? mark indicating that you're sure
14it's a magnet but don't yet know which way round it goes.
15<p>
16Left-click a clue to mark it as done (grey it out). To unmark a clue
17as done, left-click it again.
diff --git a/apps/plugins/puzzles/src/html/map.html b/apps/plugins/puzzles/src/html/map.html
new file mode 100644
index 0000000000..5f81793054
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/map.html
@@ -0,0 +1,15 @@
1Map
2<p>
3Colour the map with four colours, so that no two adjacent regions
4have the same colour. (Regions touching at only one corner do not
5count as adjacent.) There is a unique colouring consistent with the
6coloured regions you are already given.
7<p>
8Drag from a coloured region to a blank one to colour the latter the
9same colour as the former. Drag from outside the grid into a region
10to erase its colour. (You cannot change the colours of the regions
11you are given at the start of the game.)
12<p>
13Right-drag from a coloured region to a blank one to add dots marking
14the latter region as <em>possibly</em> the same colour as the
15former, or to remove those dots again.
diff --git a/apps/plugins/puzzles/src/html/mines.html b/apps/plugins/puzzles/src/html/mines.html
new file mode 100644
index 0000000000..d17d6ffa80
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/mines.html
@@ -0,0 +1,18 @@
1Mines
2<p>
3Try to expose every square in the grid that is not one of the hidden
4mines, without opening any square that is a mine.
5<p>
6Click in a square to open it. Every opened square are marked with
7the number of mines in the surrounding 8 squares, if there are any;
8if not, all the surrounding squares are automatically opened.
9<p>
10Right-click in a square to mark it with a flag if you think it is a
11mine. If a numbered square has exactly the right number of flags
12around it, you can click in it to open all the squares around it
13that are not flagged.
14<p>
15The first square you open is guaranteed to be safe, and (by default)
16you are guaranteed to be able to solve the whole grid by deduction
17rather than guesswork. (Deductions may require you to think about
18the total number of mines.)
diff --git a/apps/plugins/puzzles/src/html/net.html b/apps/plugins/puzzles/src/html/net.html
new file mode 100644
index 0000000000..08bffbac3e
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/net.html
@@ -0,0 +1,17 @@
1Net
2<p>
3Rotate the grid squares so that they all join up into a single
4connected network with no loops.
5<p>
6Left-click in a square to rotate it anticlockwise. Right-click to
7rotate it clockwise. Middle-click, or shift-left-click if you have
8no middle mouse button, to lock a square once you think it is
9correct (so you don't accidentally rotate it again); do the same
10again to unlock it if you change your mind.
11<p>
12Squares connected to the middle square are lit up. Aim to light up
13every square in the grid (not just the endpoint blobs).
14<p>
15When this gets too easy, select a 'wrapping' variant from the Type
16menu to enable grid lines to run off one edge of the playing area
17and come back on the opposite edge!
diff --git a/apps/plugins/puzzles/src/html/netslide.html b/apps/plugins/puzzles/src/html/netslide.html
new file mode 100644
index 0000000000..f1877417d4
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/netslide.html
@@ -0,0 +1,14 @@
1Netslide
2<p>
3Slide the grid squares around so that they all join up into a single
4connected network with no loops.
5<p>
6Click on the arrows at the edges of the grid to move a row or column
7left, right, up or down. The square that falls off the end of the
8row comes back on the other end.
9<p>
10Squares connected to the middle square are lit up. Aim to light up
11every square in the grid (not just the endpoint blobs).
12<p>
13Connecting across a red barrier line is forbidden. On harder levels,
14there are fewer barriers, which makes it harder rather than easier!
diff --git a/apps/plugins/puzzles/src/html/palisade.html b/apps/plugins/puzzles/src/html/palisade.html
new file mode 100644
index 0000000000..5b6b933104
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/palisade.html
@@ -0,0 +1,11 @@
1Palisade
2<p>
3Draw lines along the grid edges, in such a way that the grid is
4divided into connected regions, all of the size shown in the status
5line. Also, each square containing a number should have that many of
6its edges drawn in.
7<p>
8Click on a grid edge to mark it as a division between regions (black),
9and again to return to marking it as undecided (yellow). Right-click
10on a grid edge to mark it as definitely not part of the loop (faint
11grey), and again to mark it as undecided again.
diff --git a/apps/plugins/puzzles/src/html/pattern.html b/apps/plugins/puzzles/src/html/pattern.html
new file mode 100644
index 0000000000..54e05d6416
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/pattern.html
@@ -0,0 +1,12 @@
1Pattern
2<p>
3Fill in the grid with a pattern of black and white squares, so that
4the numbers in each row and column match the lengths of consecutive
5runs of black squares.
6<p>
7Left-click in a square to mark it black; right-click (or hold Ctrl
8while left-clicking) to mark it white. Click and drag along a row or
9column to mark multiple squares black or white at once. Middle-click
10(or hold Shift while left-clicking) to return a square to grey
11(meaning undecided): dragging like that can erase a whole rectangle,
12not just a row or column.
diff --git a/apps/plugins/puzzles/src/html/pearl.html b/apps/plugins/puzzles/src/html/pearl.html
new file mode 100644
index 0000000000..2ca25a5ee0
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/pearl.html
@@ -0,0 +1,13 @@
1Pearl
2<p>
3Draw a single closed loop by connecting together the centres of
4adjacent grid squares, so that some squares end up as corners, some as
5straights (horizontal or vertical), and some may be empty. Every
6square containing a black circle must be a corner not connected
7directly to another corner; every square containing a white circle
8must be a straight which is connected to <em>at least one</em> corner.
9<p>
10Drag between squares to draw or undraw pieces of the loop.
11Alternatively, left-click the edge between two squares to turn it on
12or off. Right-click an edge to mark it with a cross indicating that
13you are sure the loop does not go through it.
diff --git a/apps/plugins/puzzles/src/html/pegs.html b/apps/plugins/puzzles/src/html/pegs.html
new file mode 100644
index 0000000000..4a2378873e
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/pegs.html
@@ -0,0 +1,8 @@
1Pegs
2<p>
3Jump one peg over another to remove the one you jumped over. Try to
4remove all but one peg.
5<p>
6Drag a peg into an empty space to make a move. The target space must
7be exactly two holes away from the starting peg, in an orthogonal
8direction, and there must be a peg in the hole in between.
diff --git a/apps/plugins/puzzles/src/html/range.html b/apps/plugins/puzzles/src/html/range.html
new file mode 100644
index 0000000000..bb5b59c4d2
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/range.html
@@ -0,0 +1,21 @@
1Range
2<p>
3Colour some squares black, so as to meet the following conditions:
4<ul>
5<li>
6No two black squares are orthogonally adjacent.
7<li>
8No group of white squares is separated from the rest of the grid by
9black squares.
10<li>
11Each numbered cell can see precisely that many white squares in
12total by looking in all four orthogonal directions, counting itself.
13(Black squares block the view. So, for example, a 2 clue must be
14adjacent to three black squares or grid edges, and in the fourth
15direction there must be one white square and then a black one beyond
16it.)
17</ul>
18
19<p>
20Left-click to colour a square black. Right-click to mark a square
21with a dot, if you know it should not be black.
diff --git a/apps/plugins/puzzles/src/html/rect.html b/apps/plugins/puzzles/src/html/rect.html
new file mode 100644
index 0000000000..d23d827663
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/rect.html
@@ -0,0 +1,10 @@
1docname=rectangles:Rectangles
2<p>
3Draw lines along the grid edges to divide the grid into rectangles,
4so that each rectangle contains exactly one numbered square and its
5area is equal to the number written in that square.
6<p>
7Click and drag from one grid corner to another, or from one square
8centre to another, to draw a rectangle. You can also drag along a
9grid line to just draw a line at a time, or just click on a single
10grid edge to draw or erase it.
diff --git a/apps/plugins/puzzles/src/html/samegame.html b/apps/plugins/puzzles/src/html/samegame.html
new file mode 100644
index 0000000000..e6de095210
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/samegame.html
@@ -0,0 +1,14 @@
1Same Game
2<p>
3Try to empty the playing area completely, by removing connected
4groups of two or more squares of the same colour. Then try to score
5as much as possible, by removing large groups at a time instead of
6small ones.
7<p>
8Click on a coloured square to highlight the rest of its connected
9group. The status line will print the number of squares selected,
10and the score you would gain by removing them. Click again to remove
11the group; other squares will fall down to fill the space, and if
12you empty a whole column then the other columns will move up. You
13cannot remove a single isolated square: try to avoid dead-end
14positions where all remaining squares are isolated.
diff --git a/apps/plugins/puzzles/src/html/signpost.html b/apps/plugins/puzzles/src/html/signpost.html
new file mode 100644
index 0000000000..fa23e99de0
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/signpost.html
@@ -0,0 +1,14 @@
1Signpost
2<p>
3Connect all the squares together into a sequence, so that every
4square's arrow points towards the square that follows it (though the
5next square can be any distance away in that direction).
6
7<p>
8Left-drag from a square to the square that should follow it, or
9right-drag from a square to the square that should precede it.
10
11<p>
12Left-drag a square off the grid to break all links to it. Right-drag
13a square off the grid to break all links to it and everything else
14in its connected chain.
diff --git a/apps/plugins/puzzles/src/html/singles.html b/apps/plugins/puzzles/src/html/singles.html
new file mode 100644
index 0000000000..252bffb380
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/singles.html
@@ -0,0 +1,11 @@
1Singles
2<p>
3Black out some of the squares, in such a way that:
4<ul><li>no number appears twice in any row or column
5<li>no two black squares are adjacent
6<li>the white squares form a single connected group (connections
7along diagonals do not count).</ul>
8<p>
9Click in a square to black it out, and again to uncover it.
10Right-click in a square to mark it with a circle, indicating that
11you're sure it should <em>not</em> be blacked out.
diff --git a/apps/plugins/puzzles/src/html/sixteen.html b/apps/plugins/puzzles/src/html/sixteen.html
new file mode 100644
index 0000000000..4530469fe6
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/sixteen.html
@@ -0,0 +1,8 @@
1Sixteen
2<p>
3Slide the grid squares around so that the numbers end up in
4consecutive order from the top left corner.
5<p>
6Click on the arrows at the edges of the grid to move a row or column
7left, right, up or down. The square that falls off the end of the
8row comes back on the other end.
diff --git a/apps/plugins/puzzles/src/html/slant.html b/apps/plugins/puzzles/src/html/slant.html
new file mode 100644
index 0000000000..d6d31aa302
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/slant.html
@@ -0,0 +1,9 @@
1Slant
2<p>
3Fill in a diagonal line in every grid square so that there are no
4loops in the grid, and so that every numbered point has that many
5lines meeting at it.
6<p>
7Left-click in a square to mark it with a <code>\</code>; right-click
8to mark it with a <code>/</code>. Keep clicking in a square to
9cycle it between <code>\</code>, <code>/</code> and empty.
diff --git a/apps/plugins/puzzles/src/html/solo.html b/apps/plugins/puzzles/src/html/solo.html
new file mode 100644
index 0000000000..88ebd5cb29
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/solo.html
@@ -0,0 +1,20 @@
1Solo
2<p>
3Fill in a number in every square so that every number appears
4exactly once in each row, each column and each block marked by thick
5lines.
6<p>
7To place a number, click in a square to select it, then type the
8number on the keyboard. To erase a number, click to select a square
9and then press Backspace.
10<p>
11Right-click in a square and then type a number to add or remove the
12number as a pencil mark, indicating numbers that you think
13<em>might</em> go in that square.
14<p>
15When you master the basic game, try Jigsaw mode (irregularly shaped
16blocks), X mode (the two main diagonals of the grid must also
17contain every number once), Killer mode (instead of single-cell
18clues you are given regions of the grid each of which must add up to
19a given total, again without reusing any digits), or all of those at
20once!
diff --git a/apps/plugins/puzzles/src/html/tents.html b/apps/plugins/puzzles/src/html/tents.html
new file mode 100644
index 0000000000..e3f6d5f0ea
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/tents.html
@@ -0,0 +1,20 @@
1Tents
2<p>
3Place tents in the empty squares in such a way that:
4<ul>
5<li>no two tents are adjacent, even diagonally
6<li>the number of tents in each row and column matches the numbers
7around the edge of the grid
8<li>it is possible to match tents to trees so that each tree is
9orthogonally adjacent to its own tent (but may also be adjacent to
10other tents).
11</ul>
12<p>
13Click in a square to place or remove a tent. Right-click to mark a
14square as empty (not a tent). Right-click and drag along a row or
15column to mark many squares at once as empty.
16<p>
17Warning '!' marks appear to indicate adjacent tents. Numbers round
18the edge of the grid light up red to indicate they do not match the
19number of tents in the row. Groups of tents light up red to indicate
20that they have too few trees between them, and vice versa.
diff --git a/apps/plugins/puzzles/src/html/towers.html b/apps/plugins/puzzles/src/html/towers.html
new file mode 100644
index 0000000000..a710e0ab6e
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/towers.html
@@ -0,0 +1,22 @@
1Towers
2<p>
3Fill in the grid with towers whose heights range from 1 to the grid
4size, so that every possible height appears exactly once in each row
5and column, and so that each clue around the edge counts the number
6of towers that are visible when looking into the grid from that
7direction. (Taller towers hide shorter ones behind them. So the
8sequence 2,1,4,3,5 would match a clue of 3 on the left, because the
91 is hidden behind the 2 and the 3 is hidden behind the 4. On the
10right, it would match a clue of 1 because the 5 hides everything
11else.)
12<p>
13To place a tower, click in a square to select it, then type the
14desired height on the keyboard. To erase a tower, click to select a
15square and then press Backspace.
16<p>
17Right-click in a square and then type a number to add or remove the
18number as a pencil mark, indicating tower heights that you think
19<em>might</em> go in that square.
20<p>
21Left-click on a clue to mark it as done (grey it out). To unmark a
22clue as done, left-click on it again. \ No newline at end of file
diff --git a/apps/plugins/puzzles/src/html/tracks.html b/apps/plugins/puzzles/src/html/tracks.html
new file mode 100644
index 0000000000..afabed37ac
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/tracks.html
@@ -0,0 +1,19 @@
1Tracks
2<p>
3Complete the track from A to B so that the rows and
4columns contain the same number of track segments as are indicated in the
5clues to the top and right of the grid. There are only straight and
690-degree curved rail sections, and the track may not cross itself.
7<p>
8Left-click on an edge between two squares to add a track segment between
9the two squares. Right-click on an edge to add a cross on the edge,
10indicating no track is possible there.
11<p>
12Left-click in a square to add a colour indicator showing that you know the
13square must contain a track, even if you don't know which edges it crosses
14yet. Right-click in a square to add a cross indicating it contains no
15track segment.
16<p>
17Left- or right-drag between squares to lay a straight line of is-track or
18is-not-track indicators, useful for filling in rows or columns to match the
19clue.
diff --git a/apps/plugins/puzzles/src/html/twiddle.html b/apps/plugins/puzzles/src/html/twiddle.html
new file mode 100644
index 0000000000..5f94e4e120
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/twiddle.html
@@ -0,0 +1,15 @@
1Twiddle
2<p>
3Rotate square sections of the grid to arrange the squares into
4numerical order starting from the top left.
5<p>
6In the basic game, you rotate a 2&times;2 square section. Left-click
7in the centre of that section (i.e. on a corner point between four
8squares) to rotate the whole section anticlockwise. Right-click to
9rotate the section clockwise.
10<p>
11When you master the basic game, go to the Type menu to try it with
12larger rotating groups (for a 3&times;3 group you must click in the
13centre of a square to rotate the block around it). Or select the
14'orientable' mode in which every square must end up the right way
15round as well as in the right place. Or both!
diff --git a/apps/plugins/puzzles/src/html/undead.html b/apps/plugins/puzzles/src/html/undead.html
new file mode 100644
index 0000000000..c21374f6dc
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/undead.html
@@ -0,0 +1,22 @@
1Undead
2<p>
3Fill in every grid square which doesn't contain a mirror with either a
4ghost, a vampire, or a zombie. The numbers round the grid edges show
5how many monsters must be visible along your line of sight if you look
6directly into the grid from that position, along a row or column.
7Zombies are always visible; ghosts are only visible when reflected in
8at least one mirror; vampires are only visible when not reflected in
9any mirror.
10
11<p>
12To place a monster, click in a square to select it, then type the
13monster's letter on the keyboard: G for a ghost, V for a vampire or Z
14for a zombie. To erase a monster, click to select a square and then
15press Backspace.
16<p>
17Right-click in a square and then type a letter to add or remove the
18monster as a pencil mark, indicating monsters that you think
19<em>might</em> go in that square.
20<p>
21Left-click on a clue to mark it as done (grey it out). To unmark a
22clue as done, left-click on it again.
diff --git a/apps/plugins/puzzles/src/html/unequal.html b/apps/plugins/puzzles/src/html/unequal.html
new file mode 100644
index 0000000000..085f82effc
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/unequal.html
@@ -0,0 +1,14 @@
1Unequal
2<p>
3Fill in the grid with numbers from 1 to the grid size, so that every
4number appears exactly once in each row and column, and so that all
5the <code>&lt;</code> signs represent true inequalities (i.e. the
6number at the pointed end is smaller than the number at the open end).
7<p>
8To place a number, click in a square to select it, then type the
9number on the keyboard. To erase a number, click to select a square
10and then press Backspace.
11<p>
12Right-click in a square and then type a number to add or remove the
13number as a pencil mark, indicating numbers that you think
14<em>might</em> go in that square.
diff --git a/apps/plugins/puzzles/src/html/unruly.html b/apps/plugins/puzzles/src/html/unruly.html
new file mode 100644
index 0000000000..2cd3fb25f5
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/unruly.html
@@ -0,0 +1,11 @@
1Unruly
2<p>
3Colour every square either black or white, in such a way that:
4<ul><li>no three consecutive squares, horizontally or vertically, are
5the same colour
6<li>each row and column contains the same number of black and white
7squares.</ul>
8<p>
9Left-click in an empty square to turn it black, or right-click to turn
10it white. Click again in an already-filled square to cycle it between
11black and white and empty; middle-click to reset any square to empty.
diff --git a/apps/plugins/puzzles/src/html/untangle.html b/apps/plugins/puzzles/src/html/untangle.html
new file mode 100644
index 0000000000..7171a3d55d
--- /dev/null
+++ b/apps/plugins/puzzles/src/html/untangle.html
@@ -0,0 +1,5 @@
1Untangle
2<p>
3Move the points around so that none of the lines cross.
4<p>
5Click on a point and drag it to move it.