summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/puzzles/README.rockbox2
-rw-r--r--apps/plugins/puzzles/help/blackbox.c488
-rw-r--r--apps/plugins/puzzles/help/bridges.c550
-rw-r--r--apps/plugins/puzzles/help/cube.c136
-rw-r--r--apps/plugins/puzzles/help/dominosa.c124
-rw-r--r--apps/plugins/puzzles/help/fifteen.c140
-rw-r--r--apps/plugins/puzzles/help/filling.c112
-rw-r--r--apps/plugins/puzzles/help/flip.c88
-rw-r--r--apps/plugins/puzzles/help/flood.c150
-rw-r--r--apps/plugins/puzzles/help/galaxies.c196
-rw-r--r--apps/plugins/puzzles/help/guess.c254
-rw-r--r--apps/plugins/puzzles/help/inertia.c164
-rw-r--r--apps/plugins/puzzles/help/keen.c446
-rw-r--r--apps/plugins/puzzles/help/lightup.c232
-rw-r--r--apps/plugins/puzzles/help/loopy.c129
-rw-r--r--apps/plugins/puzzles/help/magnets.c165
-rw-r--r--apps/plugins/puzzles/help/map.c366
-rw-r--r--apps/plugins/puzzles/help/mines.c300
-rw-r--r--apps/plugins/puzzles/help/net.c206
-rw-r--r--apps/plugins/puzzles/help/netslide.c2
-rw-r--r--apps/plugins/puzzles/help/palisade.c2
-rw-r--r--apps/plugins/puzzles/help/pattern.c2
-rw-r--r--apps/plugins/puzzles/help/pearl.c142
-rw-r--r--apps/plugins/puzzles/help/pegs.c2
-rw-r--r--apps/plugins/puzzles/help/range.c182
-rw-r--r--apps/plugins/puzzles/help/rect.c369
-rw-r--r--apps/plugins/puzzles/help/samegame.c256
-rw-r--r--apps/plugins/puzzles/help/signpost.c196
-rw-r--r--apps/plugins/puzzles/help/singles.c78
-rw-r--r--apps/plugins/puzzles/help/sixteen.c176
-rw-r--r--apps/plugins/puzzles/help/slant.c258
-rw-r--r--apps/plugins/puzzles/help/solo.c574
-rw-r--r--apps/plugins/puzzles/help/tents.c136
-rw-r--r--apps/plugins/puzzles/help/towers.c266
-rw-r--r--apps/plugins/puzzles/help/tracks.c124
-rw-r--r--apps/plugins/puzzles/help/twiddle.c220
-rw-r--r--apps/plugins/puzzles/help/undead.c316
-rw-r--r--apps/plugins/puzzles/help/unequal.c322
-rw-r--r--apps/plugins/puzzles/help/unruly.c80
-rw-r--r--apps/plugins/puzzles/help/untangle.c2
-rw-r--r--apps/plugins/puzzles/rockbox.c6
-rw-r--r--apps/plugins/puzzles/src/Buildscr2
-rw-r--r--apps/plugins/puzzles/src/blackbox.c170
-rw-r--r--apps/plugins/puzzles/src/bridges.c344
-rw-r--r--apps/plugins/puzzles/src/cube.c74
-rw-r--r--apps/plugins/puzzles/src/devel.but141
-rw-r--r--apps/plugins/puzzles/src/divvy.c17
-rw-r--r--apps/plugins/puzzles/src/dominosa.c115
-rw-r--r--apps/plugins/puzzles/src/drawing.c4
-rw-r--r--apps/plugins/puzzles/src/dsf.c20
-rw-r--r--apps/plugins/puzzles/src/emcc.c44
-rw-r--r--apps/plugins/puzzles/src/fifteen.c84
-rw-r--r--apps/plugins/puzzles/src/filling.c185
-rw-r--r--apps/plugins/puzzles/src/findloop.c25
-rw-r--r--apps/plugins/puzzles/src/flip.c82
-rw-r--r--apps/plugins/puzzles/src/flood.c68
-rw-r--r--apps/plugins/puzzles/src/galaxies.c293
-rw-r--r--apps/plugins/puzzles/src/grid.c41
-rw-r--r--apps/plugins/puzzles/src/grid.h2
-rw-r--r--apps/plugins/puzzles/src/gtk.c323
-rw-r--r--apps/plugins/puzzles/src/guess.c162
-rw-r--r--apps/plugins/puzzles/src/html/rect.html2
-rw-r--r--apps/plugins/puzzles/src/inertia.c118
-rw-r--r--apps/plugins/puzzles/src/keen.c177
-rw-r--r--apps/plugins/puzzles/src/latin.c52
-rw-r--r--apps/plugins/puzzles/src/latin.h14
-rw-r--r--apps/plugins/puzzles/src/lightup.c255
-rw-r--r--apps/plugins/puzzles/src/loopgen.c34
-rw-r--r--apps/plugins/puzzles/src/loopy.c278
-rw-r--r--apps/plugins/puzzles/src/magnets.c161
-rw-r--r--apps/plugins/puzzles/src/map.c194
-rw-r--r--apps/plugins/puzzles/src/matching.c8
-rw-r--r--apps/plugins/puzzles/src/midend.c149
-rw-r--r--apps/plugins/puzzles/src/mines.c255
-rw-r--r--apps/plugins/puzzles/src/misc.c4
-rwxr-xr-xapps/plugins/puzzles/src/mkfiles.pl11
-rw-r--r--apps/plugins/puzzles/src/nestedvm.c23
-rw-r--r--apps/plugins/puzzles/src/net.c229
-rw-r--r--apps/plugins/puzzles/src/netslide.c114
-rw-r--r--apps/plugins/puzzles/src/nullfe.c2
-rw-r--r--apps/plugins/puzzles/src/nullgame.c30
-rw-r--r--apps/plugins/puzzles/src/obfusc.c14
-rw-r--r--apps/plugins/puzzles/src/osx.m56
-rw-r--r--apps/plugins/puzzles/src/palisade.c132
-rw-r--r--apps/plugins/puzzles/src/pattern.c213
-rw-r--r--apps/plugins/puzzles/src/pearl.c161
-rw-r--r--apps/plugins/puzzles/src/pegs.c91
-rw-r--r--apps/plugins/puzzles/src/printing.c6
-rw-r--r--apps/plugins/puzzles/src/ps.c16
-rw-r--r--apps/plugins/puzzles/src/puzzles.h83
-rw-r--r--apps/plugins/puzzles/src/range.c105
-rw-r--r--apps/plugins/puzzles/src/rect.c182
-rw-r--r--apps/plugins/puzzles/src/samegame.c116
-rw-r--r--apps/plugins/puzzles/src/signpost.c260
-rw-r--r--apps/plugins/puzzles/src/singles.c163
-rw-r--r--apps/plugins/puzzles/src/sixteen.c101
-rw-r--r--apps/plugins/puzzles/src/slant.c169
-rw-r--r--apps/plugins/puzzles/src/solo.c424
-rw-r--r--apps/plugins/puzzles/src/tdq.c10
-rw-r--r--apps/plugins/puzzles/src/tents.c143
-rw-r--r--apps/plugins/puzzles/src/towers.c150
-rw-r--r--apps/plugins/puzzles/src/tracks.c237
-rw-r--r--apps/plugins/puzzles/src/tree234.c12
-rw-r--r--apps/plugins/puzzles/src/tree234.h8
-rw-r--r--apps/plugins/puzzles/src/twiddle.c111
-rw-r--r--apps/plugins/puzzles/src/undead.c572
-rw-r--r--apps/plugins/puzzles/src/unequal.c307
-rw-r--r--apps/plugins/puzzles/src/unfinished/group.c178
-rw-r--r--apps/plugins/puzzles/src/unfinished/numgame.c144
-rw-r--r--apps/plugins/puzzles/src/unfinished/path.c32
-rw-r--r--apps/plugins/puzzles/src/unfinished/separate.c59
-rw-r--r--apps/plugins/puzzles/src/unfinished/slide.c166
-rw-r--r--apps/plugins/puzzles/src/unfinished/sokoban.c61
-rw-r--r--apps/plugins/puzzles/src/unruly.c251
-rw-r--r--apps/plugins/puzzles/src/untangle.c91
-rw-r--r--apps/plugins/puzzles/src/windows.c179
116 files changed, 8845 insertions, 8423 deletions
diff --git a/apps/plugins/puzzles/README.rockbox b/apps/plugins/puzzles/README.rockbox
index 15bc550331..c69c4da50d 100644
--- a/apps/plugins/puzzles/README.rockbox
+++ b/apps/plugins/puzzles/README.rockbox
@@ -54,3 +54,5 @@ halibut.
54 54
55April 2018: Finished up the rest of the games. All work now! Surely 55April 2018: Finished up the rest of the games. All work now! Surely
56there's still bugs to fix, so stay tuned... 56there's still bugs to fix, so stay tuned...
57
58December 2018: Resync to 3ece3d6. Happy holidays!
diff --git a/apps/plugins/puzzles/help/blackbox.c b/apps/plugins/puzzles/help/blackbox.c
index f67ee28e62..938810a19f 100644
--- a/apps/plugins/puzzles/help/blackbox.c
+++ b/apps/plugins/puzzles/help/blackbox.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -19,7 +19,7 @@ struct style_text help_text_style[] = {
19 LAST_STYLE_ITEM 19 LAST_STYLE_ITEM
20}; 20};
21 21
22/* orig 5458 comp 3139 ratio 0.575119 level 11 saved 2319 */ 22/* orig 5458 comp 3139 ratio 0.575119 level 10 saved 2319 */
23const char help_text[] = { 23const char help_text[] = {
240xf0, 0x37, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 240xf0, 0x37, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
250x31, 0x39, 0x3a, 0x20, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x20, 250x31, 0x39, 0x3a, 0x20, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x20,
@@ -28,15 +28,15 @@ const char help_text[] = {
280x61, 0x6c, 0x6c, 0x73, 0x00, 0x61, 0x72, 0x65, 0x00, 0x68, 280x61, 0x6c, 0x6c, 0x73, 0x00, 0x61, 0x72, 0x65, 0x00, 0x68,
290x69, 0x64, 0x64, 0x65, 0x6e, 0x00, 0x69, 0x6e, 0x00, 0x61, 290x69, 0x64, 0x64, 0x65, 0x6e, 0x00, 0x69, 0x6e, 0x00, 0x61,
300x00, 0x72, 0x65, 0x63, 0x74, 0x61, 0x6e, 0x67, 0x75, 0x6c, 300x00, 0x72, 0x65, 0x63, 0x74, 0x61, 0x6e, 0x67, 0x75, 0x6c,
310x61, 0x72, 0x1c, 0x00, 0xf0, 0x18, 0x6e, 0x61, 0x2e, 0x00, 310x61, 0x72, 0x1c, 0x00, 0xf0, 0x15, 0x6e, 0x61, 0x2e, 0x00,
320x59, 0x6f, 0x75, 0x00, 0x68, 0x61, 0x76, 0x65, 0x00, 0x74, 320x59, 0x6f, 0x75, 0x00, 0x68, 0x61, 0x76, 0x65, 0x00, 0x74,
330x6f, 0x00, 0x64, 0x65, 0x64, 0x75, 0x63, 0x65, 0x00, 0x74, 330x6f, 0x00, 0x64, 0x65, 0x64, 0x75, 0x63, 0x65, 0x00, 0x74,
340x68, 0x65, 0x00, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 340x68, 0x65, 0x00, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
350x6e, 0x73, 0x00, 0x6f, 0x66, 0x11, 0x00, 0x03, 0x51, 0x00, 350x6e, 0x73, 0x4d, 0x00, 0x00, 0x11, 0x00, 0x02, 0x51, 0x00,
360xf5, 0x01, 0x62, 0x79, 0x00, 0x66, 0x69, 0x72, 0x69, 0x6e, 360xf5, 0x01, 0x62, 0x79, 0x00, 0x66, 0x69, 0x72, 0x69, 0x6e,
370x67, 0x00, 0x6c, 0x61, 0x73, 0x65, 0x72, 0x73, 0x28, 0x00, 370x67, 0x00, 0x6c, 0x61, 0x73, 0x65, 0x72, 0x73, 0x28, 0x00,
380x51, 0x65, 0x64, 0x00, 0x61, 0x74, 0x29, 0x00, 0x44, 0x65, 380x51, 0x65, 0x64, 0x00, 0x61, 0x74, 0x29, 0x00, 0x45, 0x65,
390x64, 0x67, 0x65, 0x36, 0x00, 0x02, 0x65, 0x00, 0xb0, 0x00, 390x64, 0x67, 0x65, 0x36, 0x00, 0x01, 0x65, 0x00, 0xb0, 0x00,
400x61, 0x6e, 0x64, 0x00, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 400x61, 0x6e, 0x64, 0x00, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76,
410x3a, 0x00, 0x30, 0x68, 0x6f, 0x77, 0x1c, 0x00, 0x72, 0x69, 410x3a, 0x00, 0x30, 0x68, 0x6f, 0x77, 0x1c, 0x00, 0x72, 0x69,
420x72, 0x00, 0x62, 0x65, 0x61, 0x6d, 0xa5, 0x00, 0xe1, 0x64, 420x72, 0x00, 0x62, 0x65, 0x61, 0x6d, 0xa5, 0x00, 0xe1, 0x64,
@@ -52,289 +52,289 @@ const char help_text[] = {
520x68, 0x00, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x38, 0x00, 0xf1, 520x68, 0x00, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x38, 0x00, 0xf1,
530x04, 0x65, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x29, 0x2c, 0x00, 530x04, 0x65, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x29, 0x2c, 0x00,
540x75, 0x6e, 0x6c, 0x65, 0x73, 0x73, 0x00, 0x61, 0x66, 0x66, 540x75, 0x6e, 0x6c, 0x65, 0x73, 0x73, 0x00, 0x61, 0x66, 0x66,
550x8c, 0x00, 0x32, 0x00, 0x62, 0x79, 0xf7, 0x00, 0x00, 0x3d, 550x8c, 0x00, 0x00, 0xee, 0x00, 0x02, 0xf7, 0x00, 0x55, 0x69,
560x01, 0x25, 0x6f, 0x6e, 0x4b, 0x00, 0x60, 0x66, 0x6f, 0x6c, 560x6e, 0x00, 0x6f, 0x6e, 0x4b, 0x00, 0x60, 0x66, 0x6f, 0x6c,
570x6c, 0x6f, 0x77, 0xcb, 0x00, 0xb0, 0x77, 0x61, 0x79, 0x73, 570x6c, 0x6f, 0x77, 0xcb, 0x00, 0xb1, 0x77, 0x61, 0x79, 0x73,
580x3a, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x41, 0xcd, 0x00, 0x00, 580x3a, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x41, 0xcd, 0x00, 0x50,
590x9b, 0x00, 0x20, 0x61, 0x74, 0x88, 0x00, 0x31, 0x73, 0x00, 590x00, 0x74, 0x68, 0x61, 0x74, 0x88, 0x00, 0x31, 0x73, 0x00,
600x61, 0x3b, 0x00, 0xf0, 0x05, 0x00, 0x68, 0x65, 0x61, 0x64, 600x61, 0x3b, 0x00, 0xf1, 0x05, 0x00, 0x68, 0x65, 0x61, 0x64,
610x2d, 0x6f, 0x6e, 0x00, 0x69, 0x73, 0x00, 0x61, 0x62, 0x73, 610x2d, 0x6f, 0x6e, 0x00, 0x69, 0x73, 0x00, 0x61, 0x62, 0x73,
620x6f, 0x72, 0x62, 0x65, 0x64, 0x0f, 0x01, 0x02, 0xde, 0x00, 620x6f, 0x72, 0x62, 0x65, 0x64, 0x0f, 0x01, 0x01, 0xde, 0x00,
630x93, 0x6e, 0x65, 0x76, 0x65, 0x72, 0x00, 0x72, 0x65, 0x2d, 630x93, 0x6e, 0x65, 0x76, 0x65, 0x72, 0x00, 0x72, 0x65, 0x2d,
640x83, 0x00, 0x50, 0x2e, 0x00, 0x54, 0x68, 0x69, 0x6e, 0x00, 640x83, 0x00, 0x50, 0x2e, 0x00, 0x54, 0x68, 0x69, 0x6e, 0x00,
650x62, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x20, 0x01, 0x02, 650x63, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x20, 0x01, 0x01,
660x54, 0x00, 0x44, 0x6d, 0x65, 0x65, 0x74, 0x54, 0x00, 0x22, 660x54, 0x00, 0x44, 0x6d, 0x65, 0x65, 0x74, 0x54, 0x00, 0x22,
670x6f, 0x6e, 0x87, 0x00, 0x99, 0x69, 0x72, 0x73, 0x74, 0x00, 670x6f, 0x6e, 0x87, 0x00, 0x99, 0x69, 0x72, 0x73, 0x74, 0x00,
680x72, 0x61, 0x6e, 0x6b, 0xe4, 0x00, 0x18, 0x2e, 0x90, 0x00, 680x72, 0x61, 0x6e, 0x6b, 0xe4, 0x00, 0x18, 0x2e, 0x90, 0x00,
690x43, 0x77, 0x69, 0x74, 0x68, 0x37, 0x00, 0x00, 0xc5, 0x00, 690x44, 0x77, 0x69, 0x74, 0x68, 0x37, 0x00, 0x30, 0x69, 0x6e,
700x30, 0x69, 0x74, 0x73, 0x43, 0x01, 0xe1, 0x6e, 0x74, 0x2d, 700x00, 0x99, 0x00, 0xe0, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x2d,
710x6c, 0x65, 0x66, 0x74, 0x00, 0x73, 0x71, 0x75, 0x61, 0x72, 710x6c, 0x65, 0x66, 0x74, 0x00, 0x73, 0x71, 0x75, 0x7d, 0x01,
720x65, 0x90, 0x00, 0x22, 0x6e, 0x6f, 0x25, 0x00, 0x10, 0x61, 720x00, 0x90, 0x00, 0x22, 0x6e, 0x6f, 0x25, 0x00, 0x10, 0x61,
730xb1, 0x00, 0x00, 0x50, 0x00, 0x76, 0x69, 0x74, 0x00, 0x67, 730xb1, 0x00, 0x00, 0x50, 0x00, 0x76, 0x69, 0x74, 0x00, 0x67,
740x65, 0x74, 0x73, 0x9a, 0x01, 0xe1, 0x00, 0x39, 0x30, 0x00, 740x65, 0x74, 0x73, 0x9a, 0x01, 0xb0, 0x00, 0x39, 0x30, 0x00,
750x64, 0x65, 0x67, 0x72, 0x65, 0x65, 0x73, 0x00, 0x74, 0x6f, 750x64, 0x65, 0x67, 0x72, 0x65, 0x65, 0x73, 0x2c, 0x02, 0x00,
760x70, 0x00, 0x10, 0x72, 0x94, 0x01, 0x0f, 0x70, 0x00, 0x13, 760x70, 0x00, 0x10, 0x72, 0x94, 0x01, 0x0f, 0x70, 0x00, 0x13,
770x00, 0x2b, 0x00, 0x0f, 0x71, 0x00, 0x13, 0x96, 0x73, 0x69, 770x01, 0x2b, 0x00, 0x0f, 0x71, 0x00, 0x12, 0x97, 0x73, 0x69,
780x6d, 0x69, 0x6c, 0x61, 0x72, 0x6c, 0x79, 0x7b, 0x00, 0x04, 780x6d, 0x69, 0x6c, 0x61, 0x72, 0x6c, 0x79, 0x7b, 0x00, 0x03,
790x70, 0x00, 0x00, 0xb5, 0x00, 0x1d, 0x2e, 0x6f, 0x01, 0x50, 790x70, 0x00, 0x00, 0xb5, 0x00, 0x1d, 0x2e, 0x6f, 0x01, 0x50,
800x77, 0x6f, 0x75, 0x6c, 0x64, 0x46, 0x01, 0x02, 0x45, 0x01, 800x77, 0x6f, 0x75, 0x6c, 0x64, 0x46, 0x01, 0x02, 0x45, 0x01,
810x01, 0x24, 0x02, 0x01, 0x7a, 0x00, 0xc2, 0x65, 0x6e, 0x74, 810x02, 0x24, 0x02, 0x00, 0x7a, 0x00, 0xc2, 0x65, 0x6e, 0x74,
820x72, 0x79, 0x00, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x83, 820x72, 0x79, 0x00, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x83,
830x01, 0x30, 0x63, 0x6f, 0x6e, 0x14, 0x02, 0x12, 0x72, 0x53, 830x01, 0x30, 0x63, 0x6f, 0x6e, 0x14, 0x02, 0x12, 0x72, 0x53,
840x00, 0x54, 0x62, 0x65, 0x00, 0x60, 0x72, 0x64, 0x00, 0x18, 840x00, 0x54, 0x62, 0x65, 0x00, 0x60, 0x72, 0x64, 0x00, 0x1a,
850x27, 0x59, 0x00, 0x02, 0x24, 0x02, 0x02, 0x5a, 0x00, 0x00, 850x27, 0xc8, 0x00, 0x01, 0x24, 0x02, 0x02, 0x5a, 0x00, 0x37,
860x96, 0x00, 0x07, 0x8b, 0x00, 0x60, 0x62, 0x65, 0x66, 0x6f, 860x67, 0x65, 0x74, 0x8b, 0x00, 0x60, 0x62, 0x65, 0x66, 0x6f,
870x72, 0x65, 0x5c, 0x00, 0x10, 0x65, 0x08, 0x03, 0x07, 0x5c, 870x72, 0x65, 0x5c, 0x00, 0x11, 0x65, 0x08, 0x03, 0x06, 0x5c,
880x02, 0x23, 0x62, 0x79, 0xfa, 0x00, 0x03, 0xaf, 0x00, 0x08, 880x02, 0x24, 0x62, 0x79, 0xfa, 0x00, 0x03, 0xaf, 0x00, 0x07,
890x6a, 0x01, 0x29, 0x6f, 0x72, 0x08, 0x01, 0x26, 0x6f, 0x66, 890x6a, 0x01, 0x29, 0x6f, 0x72, 0x08, 0x01, 0x27, 0x6f, 0x66,
900xa1, 0x00, 0x02, 0x8a, 0x02, 0x01, 0x21, 0x02, 0x3f, 0x6c, 900xa1, 0x00, 0x02, 0x8a, 0x02, 0x00, 0x21, 0x02, 0x3f, 0x6c,
910x73, 0x6f, 0xa3, 0x00, 0x0e, 0x15, 0x42, 0x14, 0x02, 0x01, 910x73, 0x6f, 0xa3, 0x00, 0x0e, 0x16, 0x42, 0x14, 0x02, 0x00,
920x39, 0x03, 0x15, 0x72, 0x99, 0x00, 0x40, 0x61, 0x70, 0x70, 920x4b, 0x01, 0x15, 0x72, 0x99, 0x00, 0x40, 0x61, 0x70, 0x70,
930x65, 0xd7, 0x03, 0x00, 0x7b, 0x02, 0x42, 0x60, 0x52, 0x27, 930x65, 0xd7, 0x03, 0x00, 0x7b, 0x02, 0x48, 0x60, 0x52, 0x27,
940x3b, 0x3e, 0x02, 0x05, 0x92, 0x02, 0x02, 0xca, 0x02, 0x02, 940x3b, 0x3e, 0x02, 0x00, 0x1a, 0x03, 0x02, 0xca, 0x02, 0x01,
950x90, 0x02, 0x37, 0x00, 0x6f, 0x6e, 0x2f, 0x00, 0xf3, 0x02, 950x90, 0x02, 0x00, 0x42, 0x02, 0x06, 0x2f, 0x00, 0xf4, 0x02,
960x60, 0x48, 0x27, 0x2e, 0x00, 0x4f, 0x74, 0x68, 0x65, 0x72, 960x60, 0x48, 0x27, 0x2e, 0x00, 0x4f, 0x74, 0x68, 0x65, 0x72,
970x77, 0x69, 0x73, 0x65, 0x2c, 0x00, 0x61, 0x47, 0x04, 0x03, 970x77, 0x69, 0x73, 0x65, 0x2c, 0x00, 0x61, 0x47, 0x04, 0x02,
980x23, 0x00, 0x13, 0x73, 0xd9, 0x03, 0x03, 0xf9, 0x03, 0x02, 980x23, 0x00, 0x14, 0x73, 0xd9, 0x03, 0x03, 0xf9, 0x03, 0x02,
990xaf, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x15, 0x00, 0x06, 0x5e, 990xaf, 0x00, 0x00, 0xc3, 0x01, 0x01, 0x93, 0x01, 0x04, 0x5e,
1000x01, 0x41, 0x77, 0x68, 0x65, 0x72, 0x3b, 0x04, 0x01, 0x78, 1000x01, 0x42, 0x77, 0x68, 0x65, 0x72, 0x3b, 0x04, 0x01, 0x41,
1010x00, 0x03, 0xd1, 0x02, 0x73, 0x73, 0x00, 0x28, 0x74, 0x68, 1010x01, 0x02, 0x8c, 0x01, 0x40, 0x73, 0x00, 0x28, 0x74, 0xd2,
1020x69, 0x73, 0x51, 0x00, 0x00, 0xe4, 0x00, 0x50, 0x75, 0x6e, 1020x02, 0x03, 0x51, 0x00, 0x81, 0x69, 0x73, 0x00, 0x75, 0x6e,
1030x69, 0x71, 0x75, 0x6d, 0x04, 0x02, 0x99, 0x00, 0x81, 0x73, 1030x69, 0x71, 0x75, 0x6d, 0x04, 0x01, 0x99, 0x00, 0x50, 0x73,
1040x68, 0x6f, 0x74, 0x29, 0x2e, 0x00, 0x00, 0x87, 0x04, 0xf0, 1040x68, 0x6f, 0x74, 0x29, 0xd7, 0x00, 0x00, 0x87, 0x04, 0xf5,
1050x04, 0x63, 0x61, 0x6e, 0x00, 0x70, 0x6c, 0x61, 0x63, 0x65, 1050x04, 0x63, 0x61, 0x6e, 0x00, 0x70, 0x6c, 0x61, 0x63, 0x65,
1060x00, 0x67, 0x75, 0x65, 0x73, 0x73, 0x65, 0x73, 0x00, 0x61, 1060x00, 0x67, 0x75, 0x65, 0x73, 0x73, 0x65, 0x73, 0x00, 0x61,
1070x6b, 0x02, 0x09, 0x68, 0x00, 0x09, 0x8f, 0x04, 0x73, 0x2c, 1070x6b, 0x02, 0x05, 0x68, 0x00, 0x08, 0x8f, 0x04, 0x74, 0x2c,
1080x00, 0x62, 0x61, 0x73, 0x65, 0x64, 0x11, 0x03, 0x02, 0x4f, 1080x00, 0x62, 0x61, 0x73, 0x65, 0x64, 0x11, 0x03, 0x02, 0x4f,
1090x01, 0x01, 0x9a, 0x00, 0xb5, 0x65, 0x78, 0x69, 0x74, 0x00, 1090x01, 0x00, 0x9a, 0x00, 0xb7, 0x65, 0x78, 0x69, 0x74, 0x00,
1100x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0xc2, 0x04, 0x02, 0x10, 1100x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0xc2, 0x04, 0x00, 0x10,
1110x01, 0x83, 0x3b, 0x00, 0x6f, 0x6e, 0x63, 0x65, 0x00, 0x79, 1110x01, 0x84, 0x3b, 0x00, 0x6f, 0x6e, 0x63, 0x65, 0x00, 0x79,
1120xf6, 0x04, 0x02, 0x70, 0x00, 0x84, 0x64, 0x00, 0x65, 0x6e, 1120xf6, 0x04, 0x01, 0x70, 0x00, 0x84, 0x64, 0x00, 0x65, 0x6e,
1130x6f, 0x75, 0x67, 0x68, 0x36, 0x05, 0x55, 0x00, 0x62, 0x75, 1130x6f, 0x75, 0x67, 0x68, 0x36, 0x05, 0x55, 0x00, 0x62, 0x75,
1140x74, 0x74, 0x24, 0x01, 0x00, 0xa8, 0x01, 0x61, 0x61, 0x62, 1140x74, 0x74, 0x24, 0x01, 0x00, 0xa8, 0x01, 0x30, 0x61, 0x62,
1150x6c, 0x69, 0x6e, 0x67, 0x37, 0x00, 0x20, 0x74, 0x6f, 0x3a, 1150x6c, 0xfc, 0x00, 0x00, 0x37, 0x00, 0x22, 0x74, 0x6f, 0x3a,
1160x00, 0x01, 0x43, 0x00, 0x15, 0x72, 0xa9, 0x00, 0x52, 0x63, 1160x00, 0x45, 0x79, 0x6f, 0x75, 0x72, 0xa9, 0x00, 0x52, 0x63,
1170x68, 0x65, 0x63, 0x6b, 0xbe, 0x04, 0x10, 0x48, 0x08, 0x01, 1170x68, 0x65, 0x63, 0x6b, 0xbe, 0x04, 0x10, 0x48, 0x08, 0x01,
1180x10, 0x69, 0x46, 0x00, 0x70, 0x64, 0x69, 0x61, 0x67, 0x72, 1180x10, 0x69, 0x46, 0x00, 0x70, 0x64, 0x69, 0x61, 0x67, 0x72,
1190x61, 0x6d, 0xe5, 0x00, 0x13, 0x77, 0xf9, 0x04, 0x0a, 0x5c, 1190x61, 0x6d, 0xe5, 0x00, 0x17, 0x77, 0xf9, 0x04, 0x0a, 0x5c,
1200x05, 0x05, 0xa9, 0x05, 0x01, 0xfb, 0x00, 0xb8, 0x63, 0x72, 1200x05, 0x02, 0x73, 0x00, 0x00, 0xfb, 0x00, 0xb8, 0x63, 0x72,
1210x65, 0x61, 0x74, 0x65, 0x00, 0x65, 0x61, 0x63, 0x68, 0xb3, 1210x65, 0x61, 0x74, 0x65, 0x00, 0x65, 0x61, 0x63, 0x68, 0xb3,
1220x00, 0xb1, 0x00, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 1220x00, 0xb1, 0x00, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f,
1230x75, 0x72, 0x73, 0x4a, 0x00, 0x70, 0x6e, 0x00, 0x61, 0x62, 1230x75, 0x72, 0x73, 0x4a, 0x00, 0x70, 0x6e, 0x00, 0x61, 0x62,
1240x6f, 0x76, 0x65, 0x77, 0x04, 0xf3, 0x09, 0x31, 0x52, 0x48, 1240x6f, 0x76, 0x65, 0x77, 0x04, 0xf3, 0x09, 0x31, 0x52, 0x48,
1250x52, 0x2d, 0x2d, 0x2d, 0x2d, 0x00, 0x00, 0x7c, 0x2e, 0x2e, 1250x52, 0x2d, 0x2d, 0x2d, 0x2d, 0x00, 0x00, 0x7c, 0x2e, 0x2e,
1260x4f, 0x2e, 0x4f, 0x2e, 0x2e, 0x2e, 0x7c, 0x00, 0x00, 0x32, 1260x4f, 0x2e, 0x4f, 0x2e, 0x2e, 0x2e, 0x7c, 0x00, 0x00, 0x32,
1270x2e, 0x01, 0x00, 0x44, 0x33, 0x00, 0x00, 0x7c, 0x0c, 0x00, 1270x2e, 0x01, 0x00, 0x11, 0x33, 0x18, 0x00, 0x02, 0x01, 0x00,
1280x1a, 0x7c, 0x0c, 0x00, 0x1e, 0x33, 0x18, 0x00, 0x10, 0x4f, 1280x1a, 0x7c, 0x0c, 0x00, 0x1e, 0x33, 0x18, 0x00, 0x10, 0x4f,
1290x0c, 0x00, 0x1d, 0x48, 0x18, 0x00, 0x11, 0x4f, 0x0c, 0x00, 1290x0c, 0x00, 0x1d, 0x48, 0x18, 0x00, 0x11, 0x4f, 0x0c, 0x00,
1300x50, 0x31, 0x32, 0x2d, 0x52, 0x52, 0x6a, 0x00, 0x00, 0x67, 1300x51, 0x31, 0x32, 0x2d, 0x52, 0x52, 0x6a, 0x00, 0x33, 0x00,
1310x06, 0x03, 0x88, 0x00, 0x10, 0x2c, 0xb3, 0x03, 0x11, 0x69, 1310x00, 0x41, 0x88, 0x00, 0x10, 0x2c, 0xb3, 0x03, 0x11, 0x69,
1320x03, 0x06, 0x40, 0x73, 0x69, 0x62, 0x6c, 0x18, 0x05, 0x33, 1320x03, 0x06, 0x40, 0x73, 0x69, 0x62, 0x6c, 0x18, 0x05, 0x33,
1330x72, 0x00, 0x61, 0x99, 0x03, 0x10, 0x6f, 0x6c, 0x06, 0xc4, 1330x72, 0x00, 0x61, 0x99, 0x03, 0x10, 0x6f, 0x6c, 0x06, 0xc5,
1340x65, 0x69, 0x76, 0x65, 0x00, 0x6d, 0x75, 0x6c, 0x74, 0x69, 1340x65, 0x69, 0x76, 0x65, 0x00, 0x6d, 0x75, 0x6c, 0x74, 0x69,
1350x70, 0x6c, 0xab, 0x02, 0x01, 0xf9, 0x00, 0x03, 0x46, 0x03, 1350x70, 0x6c, 0xab, 0x02, 0x01, 0xf9, 0x00, 0x03, 0x46, 0x03,
1360x05, 0xb5, 0x03, 0x00, 0x1e, 0x01, 0xf4, 0x00, 0x28, 0x73, 1360x04, 0xb5, 0x03, 0x00, 0x1e, 0x01, 0xf4, 0x00, 0x28, 0x73,
1370x65, 0x65, 0x00, 0x74, 0x75, 0x72, 0x6e, 0x00, 0x33, 0x29, 1370x65, 0x65, 0x00, 0x74, 0x75, 0x72, 0x6e, 0x00, 0x33, 0x29,
1380x2e, 0x00, 0x53, 0x06, 0x04, 0x14, 0x2c, 0x53, 0x00, 0x58, 1380x2e, 0x00, 0x53, 0x06, 0x04, 0x14, 0x2c, 0x53, 0x00, 0x58,
1390x6d, 0x61, 0x79, 0x00, 0x62, 0xf1, 0x02, 0x13, 0x28, 0x79, 1390x6d, 0x61, 0x79, 0x00, 0x62, 0xf1, 0x02, 0x13, 0x28, 0x79,
1400x00, 0x41, 0x79, 0x00, 0x6d, 0x6f, 0x7b, 0x02, 0x21, 0x61, 1400x00, 0x41, 0x79, 0x00, 0x6d, 0x6f, 0x7b, 0x02, 0x21, 0x61,
1410x6e, 0xdd, 0x01, 0x13, 0x29, 0x5e, 0x00, 0x02, 0x82, 0x00, 1410x6e, 0xdd, 0x01, 0x16, 0x29, 0x5e, 0x00, 0x00, 0x82, 0x00,
1420x01, 0x73, 0x06, 0x10, 0x61, 0x02, 0x03, 0x00, 0x8c, 0x02, 1420x00, 0x5c, 0x00, 0x11, 0x61, 0x02, 0x03, 0x10, 0x28, 0x53,
1430x10, 0x65, 0xee, 0x02, 0x35, 0x00, 0x6f, 0x6e, 0x4f, 0x04, 1430x01, 0x34, 0x60, 0x48, 0x27, 0x30, 0x02, 0x02, 0x04, 0x05,
1440x09, 0x24, 0x06, 0x71, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 1440x07, 0x24, 0x06, 0x71, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c,
1450x65, 0x91, 0x02, 0x43, 0x4e, 0x6f, 0x74, 0x65, 0x67, 0x03, 1450x65, 0x91, 0x02, 0x43, 0x4e, 0x6f, 0x74, 0x65, 0x67, 0x03,
1460x91, 0x6e, 0x79, 0x00, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 1460x92, 0x6e, 0x79, 0x00, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74,
1470xdf, 0x04, 0x07, 0x6e, 0x00, 0x12, 0x34, 0xbe, 0x01, 0x00, 1470xdf, 0x04, 0x06, 0x6e, 0x00, 0x13, 0x34, 0xbe, 0x01, 0x00,
1480x9b, 0x00, 0x01, 0x14, 0x02, 0x00, 0x3b, 0x03, 0x33, 0x6f, 1480x9b, 0x00, 0x01, 0x14, 0x02, 0x63, 0x61, 0x00, 0x6e, 0x6f,
1490x6e, 0x2d, 0xe4, 0x02, 0x40, 0x73, 0x6f, 0x6c, 0x75, 0xee, 1490x6e, 0x2d, 0xe4, 0x02, 0x40, 0x73, 0x6f, 0x6c, 0x75, 0xee,
1500x00, 0x38, 0x2e, 0x00, 0x54, 0x35, 0x06, 0x05, 0x17, 0x02, 1500x00, 0x00, 0xd6, 0x05, 0x08, 0x35, 0x06, 0x04, 0x17, 0x02,
1510x40, 0x69, 0x6c, 0x6c, 0x75, 0xd9, 0x06, 0x40, 0x74, 0x65, 1510x40, 0x69, 0x6c, 0x6c, 0x75, 0xd9, 0x06, 0x20, 0x74, 0x65,
1520x73, 0x00, 0x26, 0x03, 0x41, 0x3b, 0x00, 0x69, 0x66, 0x62, 1520xa6, 0x03, 0x61, 0x69, 0x73, 0x3b, 0x00, 0x69, 0x66, 0x62,
1530x02, 0x23, 0x6b, 0x6e, 0x29, 0x02, 0x50, 0x62, 0x6f, 0x61, 1530x02, 0x23, 0x6b, 0x6e, 0x29, 0x02, 0x50, 0x62, 0x6f, 0x61,
1540x72, 0x64, 0x12, 0x04, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x73, 1540x72, 0x64, 0x12, 0x04, 0x74, 0x74, 0x61, 0x69, 0x6e, 0x73,
1550x00, 0x35, 0x6f, 0x00, 0x04, 0x78, 0x01, 0x23, 0x69, 0x6d, 1550x00, 0x35, 0xf6, 0x02, 0x02, 0x78, 0x01, 0x25, 0x69, 0x6d,
1560x01, 0x01, 0x03, 0xbc, 0x07, 0x77, 0x74, 0x65, 0x72, 0x6d, 1560x7a, 0x01, 0x01, 0xbc, 0x07, 0x77, 0x74, 0x65, 0x72, 0x6d,
1570x69, 0x6e, 0x65, 0x8a, 0x03, 0x53, 0x66, 0x69, 0x66, 0x74, 1570x69, 0x6e, 0x65, 0x8a, 0x03, 0x53, 0x66, 0x69, 0x66, 0x74,
1580x68, 0x8d, 0x05, 0x15, 0x73, 0x30, 0x01, 0x08, 0x81, 0x02, 1580x68, 0x8d, 0x05, 0x15, 0x73, 0x30, 0x01, 0x08, 0x81, 0x02,
1590x63, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0xb7, 0x05, 0x41, 1590x63, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0xb7, 0x05, 0x41,
1600x6e, 0x00, 0x78, 0x29, 0xce, 0x06, 0x03, 0x01, 0x00, 0x0f, 1600x6e, 0x00, 0x78, 0x29, 0xce, 0x06, 0x03, 0x01, 0x00, 0x0f,
1610x3f, 0x02, 0x07, 0x11, 0x7c, 0x18, 0x02, 0x15, 0x4f, 0x18, 1610x3f, 0x02, 0x07, 0x11, 0x7c, 0x18, 0x02, 0x15, 0x4f, 0x18,
1620x00, 0x3b, 0x78, 0x78, 0x2e, 0x0c, 0x00, 0x0e, 0x24, 0x00, 1620x00, 0x3e, 0x78, 0x78, 0x2e, 0x0c, 0x00, 0x0b, 0x24, 0x00,
1630x0e, 0x48, 0x00, 0x08, 0x6a, 0x00, 0x61, 0x00, 0x00, 0x46, 1630x0e, 0x48, 0x00, 0x08, 0x6a, 0x00, 0x61, 0x00, 0x00, 0x46,
1640x6f, 0x72, 0x00, 0x2d, 0x04, 0x70, 0x72, 0x65, 0x61, 0x73, 1640x6f, 0x72, 0x00, 0x2d, 0x04, 0x70, 0x72, 0x65, 0x61, 0x73,
1650x6f, 0x6e, 0x2c, 0xc8, 0x00, 0x10, 0x6e, 0x10, 0x01, 0x0f, 1650x6f, 0x6e, 0x2c, 0xc8, 0x00, 0x16, 0x6e, 0xa9, 0x03, 0x0f,
1660x6f, 0x03, 0x07, 0x11, 0x2c, 0xe6, 0x00, 0x41, 0x67, 0x61, 1660x6f, 0x03, 0x01, 0x11, 0x2c, 0xe6, 0x00, 0x42, 0x67, 0x61,
1670x6d, 0x65, 0x50, 0x07, 0x02, 0x17, 0x00, 0x01, 0xb5, 0x01, 1670x6d, 0x65, 0x50, 0x07, 0x01, 0x17, 0x00, 0x02, 0xb5, 0x01,
1680x01, 0x2f, 0x00, 0x05, 0x82, 0x01, 0x40, 0x00, 0x70, 0x72, 1680x01, 0x2f, 0x00, 0x04, 0x82, 0x01, 0x40, 0x00, 0x70, 0x72,
1690x6f, 0xda, 0x08, 0xf0, 0x02, 0x73, 0x20, 0x74, 0x68, 0x65, 1690x6f, 0xda, 0x08, 0xf2, 0x02, 0x73, 0x20, 0x74, 0x68, 0x65,
1700x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x72, 0x65, 0x73, 0x75, 1700x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x72, 0x65, 0x73, 0x75,
1710x6c, 0x74, 0x62, 0x04, 0x01, 0x44, 0x00, 0xe0, 0x63, 0x6f, 1710x6c, 0x74, 0x62, 0x04, 0xf0, 0x02, 0x68, 0x65, 0x00, 0x63,
1720x6d, 0x70, 0x75, 0x74, 0x65, 0x72, 0x27, 0x73, 0x2c, 0x00, 1720x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x72, 0x27, 0x73, 0x2c,
1730x72, 0x61, 0x0c, 0x05, 0x02, 0xe2, 0x01, 0x0e, 0x4c, 0x00, 1730x00, 0x72, 0x61, 0x0c, 0x05, 0x02, 0xe2, 0x01, 0x0e, 0x4c,
1740x01, 0x7a, 0x01, 0x70, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x63, 1740x00, 0x01, 0x7a, 0x01, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x69,
1750x61, 0xea, 0x05, 0x0b, 0x3f, 0x00, 0x61, 0x2e, 0x00, 0x53, 1750x63, 0x61, 0xea, 0x05, 0x06, 0x3f, 0x00, 0x62, 0x2e, 0x00,
1760x6f, 0x00, 0x69, 0x60, 0x02, 0x01, 0xa8, 0x03, 0x05, 0x55, 1760x53, 0x6f, 0x00, 0x69, 0x60, 0x02, 0x01, 0xa8, 0x03, 0x04,
1770x02, 0x11, 0x2c, 0xcb, 0x00, 0x11, 0x63, 0x52, 0x06, 0x3c, 1770x55, 0x02, 0x11, 0x2c, 0xcb, 0x00, 0x11, 0x63, 0x52, 0x06,
1780x70, 0x75, 0x74, 0xa0, 0x01, 0x03, 0x68, 0x02, 0x29, 0x6f, 1780x3c, 0x70, 0x75, 0x74, 0xa0, 0x01, 0x03, 0x68, 0x02, 0x29,
1790x66, 0xee, 0x04, 0x0e, 0xa1, 0x01, 0x10, 0x2c, 0xe0, 0x04, 1790x6f, 0x66, 0xee, 0x04, 0x0e, 0xa1, 0x01, 0x11, 0x2c, 0xe0,
1800x00, 0x4b, 0x00, 0x03, 0x9d, 0x06, 0x20, 0x73, 0x74, 0xf9, 1800x04, 0x00, 0x4b, 0x00, 0x02, 0x9d, 0x06, 0x20, 0x73, 0x74,
1810x00, 0x30, 0x77, 0x69, 0x6e, 0xb4, 0x02, 0x01, 0x0e, 0x0a, 1810xf9, 0x00, 0x31, 0x77, 0x69, 0x6e, 0x1c, 0x06, 0x00, 0x0e,
1820x81, 0x00, 0x42, 0x6f, 0x78, 0x00, 0x77, 0x61, 0x73, 0x38, 1820x0a, 0x81, 0x00, 0x42, 0x6f, 0x78, 0x00, 0x77, 0x61, 0x73,
1830x02, 0x45, 0x72, 0x69, 0x62, 0x75, 0x41, 0x07, 0x01, 0x01, 1830x38, 0x02, 0x45, 0x72, 0x69, 0x62, 0x75, 0x41, 0x07, 0x01,
1840x07, 0x13, 0x6c, 0x84, 0x03, 0x00, 0xaf, 0x06, 0xd0, 0x4a, 1840x01, 0x07, 0x13, 0x6c, 0x84, 0x03, 0x00, 0xaf, 0x06, 0xd0,
1850x61, 0x6d, 0x65, 0x73, 0x00, 0x48, 0x61, 0x72, 0x76, 0x65, 1850x4a, 0x61, 0x6d, 0x65, 0x73, 0x00, 0x48, 0x61, 0x72, 0x76,
1860x79, 0x2e, 0x50, 0x04, 0x37, 0x39, 0x2e, 0x31, 0x53, 0x0a, 1860x65, 0x79, 0x2e, 0x50, 0x04, 0x37, 0x39, 0x2e, 0x31, 0x53,
1870x01, 0x41, 0x00, 0x30, 0x6f, 0x6c, 0x73, 0x5c, 0x0a, 0x50, 1870x0a, 0x01, 0x41, 0x00, 0x30, 0x6f, 0x6c, 0x73, 0x5c, 0x0a,
1880x54, 0x6f, 0x00, 0x66, 0x69, 0xbb, 0x07, 0x01, 0xf9, 0x09, 1880x20, 0x54, 0x6f, 0x00, 0x06, 0x00, 0xe2, 0x02, 0x01, 0xf9,
1890x02, 0xbb, 0x09, 0x11, 0x2c, 0x42, 0x03, 0x61, 0x2d, 0x63, 1890x09, 0x01, 0x93, 0x03, 0x11, 0x2c, 0x42, 0x03, 0x62, 0x2d,
1900x6c, 0x69, 0x63, 0x6b, 0x60, 0x0a, 0x05, 0xe0, 0x07, 0x54, 1900x63, 0x6c, 0x69, 0x63, 0x6b, 0x60, 0x0a, 0x04, 0xe0, 0x07,
1910x72, 0x6f, 0x75, 0x6e, 0x64, 0x0e, 0x0a, 0x0a, 0x83, 0x09, 1910x55, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x0e, 0x0a, 0x0b, 0x9f,
1920x02, 0x0e, 0x03, 0x02, 0x7f, 0x01, 0x02, 0xe5, 0x09, 0x00, 1920x08, 0x00, 0x0e, 0x03, 0x04, 0x7f, 0x01, 0x01, 0xb7, 0x01,
1930xd6, 0x03, 0xf0, 0x09, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 1930xf0, 0x0c, 0x62, 0x65, 0x00, 0x64, 0x69, 0x73, 0x70, 0x6c,
1940x79, 0x65, 0x64, 0x00, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 1940x61, 0x79, 0x65, 0x64, 0x00, 0x69, 0x6d, 0x6d, 0x65, 0x64,
1950x61, 0x74, 0x65, 0x6c, 0x79, 0x2e, 0x00, 0x43, 0x5b, 0x00, 1950x69, 0x61, 0x74, 0x65, 0x6c, 0x79, 0x2e, 0x00, 0x43, 0x5b,
1960x30, 0x69, 0x6e, 0x67, 0x40, 0x07, 0x75, 0x68, 0x6f, 0x6c, 1960x00, 0x00, 0x34, 0x03, 0x74, 0x6f, 0x72, 0x00, 0x68, 0x6f,
1970x64, 0x69, 0x6e, 0x67, 0xba, 0x03, 0x04, 0xa5, 0x05, 0x18, 1970x6c, 0x64, 0x71, 0x07, 0x01, 0xba, 0x03, 0x03, 0xa5, 0x05,
1980x6f, 0x9c, 0x09, 0x23, 0x73, 0x65, 0x84, 0x00, 0x03, 0x5b, 1980x18, 0x6f, 0x9c, 0x09, 0x23, 0x73, 0x65, 0x84, 0x00, 0x03,
1990x00, 0x50, 0x68, 0x69, 0x67, 0x68, 0x6c, 0x73, 0x07, 0x02, 1990x5b, 0x00, 0x51, 0x68, 0x69, 0x67, 0x68, 0x6c, 0x73, 0x07,
2000xa7, 0x01, 0xb1, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x00, 2000x01, 0xa7, 0x01, 0xb1, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74,
2010x67, 0x6f, 0x00, 0x28, 0xac, 0x04, 0x30, 0x70, 0x72, 0x65, 2010x00, 0x67, 0x6f, 0x00, 0x28, 0xac, 0x04, 0x30, 0x70, 0x72,
2020x5a, 0x05, 0x71, 0x73, 0x00, 0x67, 0x6f, 0x29, 0x00, 0x74, 2020x65, 0x5a, 0x05, 0x71, 0x73, 0x00, 0x67, 0x6f, 0x29, 0x00,
2030x7d, 0x07, 0x31, 0x66, 0x69, 0x72, 0x62, 0x0a, 0x01, 0x44, 2030x74, 0x7d, 0x07, 0x31, 0x66, 0x69, 0x72, 0x62, 0x0a, 0x03,
2040x06, 0x02, 0xed, 0x06, 0x00, 0xd9, 0x04, 0x01, 0x0a, 0x02, 2040x44, 0x06, 0x01, 0xed, 0x06, 0x00, 0xd9, 0x04, 0x01, 0x0a,
2050x02, 0xfc, 0x00, 0x40, 0x2c, 0x00, 0x69, 0x66, 0x1b, 0x06, 2050x02, 0x01, 0xfc, 0x00, 0x10, 0x2c, 0xa8, 0x03, 0xb2, 0x61,
2060x81, 0x6c, 0x69, 0x63, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x1e, 2060x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x62, 0x6c, 0x65, 0x2e,
2070x01, 0x02, 0x9b, 0x02, 0x0c, 0xab, 0x06, 0x03, 0x11, 0x08, 2070x1e, 0x01, 0x01, 0x9b, 0x02, 0x0d, 0xab, 0x06, 0x02, 0x11,
2080x08, 0x29, 0x01, 0x01, 0xcb, 0x01, 0x2a, 0x69, 0x6e, 0x1e, 2080x08, 0x09, 0x29, 0x01, 0x00, 0xcb, 0x01, 0x2b, 0x69, 0x6e,
2090x0b, 0x00, 0x28, 0x00, 0x01, 0xbc, 0x01, 0x52, 0x63, 0x69, 2090x1e, 0x0b, 0x31, 0x61, 0x00, 0x62, 0xbc, 0x01, 0x53, 0x63,
2100x72, 0x63, 0x6c, 0xce, 0x02, 0x03, 0x7e, 0x06, 0x01, 0x02, 2100x69, 0x72, 0x63, 0x6c, 0xce, 0x02, 0x03, 0xa2, 0x07, 0x00,
2110x02, 0x02, 0xf8, 0x00, 0x03, 0x18, 0x07, 0x22, 0x3b, 0x00, 2110x02, 0x02, 0x04, 0xf8, 0x00, 0x01, 0x65, 0x00, 0x22, 0x3b,
2120x49, 0x00, 0x52, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x6a, 0x05, 2120x00, 0x49, 0x00, 0x52, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x6a,
2130x46, 0x6d, 0x6f, 0x76, 0x65, 0x21, 0x00, 0x21, 0x65, 0x64, 2130x05, 0x10, 0x6d, 0x69, 0x02, 0x05, 0x21, 0x00, 0x21, 0x65,
2140x76, 0x00, 0x00, 0x99, 0x00, 0x15, 0x4c, 0x49, 0x02, 0x08, 2140x64, 0x76, 0x00, 0x00, 0x99, 0x00, 0x15, 0x4c, 0x49, 0x02,
2150x73, 0x00, 0x04, 0x4c, 0x05, 0x20, 0x6c, 0x6f, 0x46, 0x03, 2150x09, 0x73, 0x00, 0x03, 0x4c, 0x05, 0x20, 0x6c, 0x6f, 0x46,
2160x02, 0x49, 0x00, 0xb3, 0x73, 0x74, 0x00, 0x6d, 0x6f, 0x64, 2160x03, 0x02, 0x49, 0x00, 0xb4, 0x73, 0x74, 0x00, 0x6d, 0x6f,
2170x69, 0x66, 0x69, 0x63, 0x61, 0x1f, 0x02, 0x02, 0xdf, 0x09, 2170x64, 0x69, 0x66, 0x69, 0x63, 0x61, 0x1f, 0x02, 0x01, 0xac,
2180x33, 0x2d, 0x00, 0x63, 0x85, 0x01, 0x50, 0x3b, 0x00, 0x77, 2180x08, 0x33, 0x2d, 0x00, 0x63, 0x85, 0x01, 0x50, 0x3b, 0x00,
2190x68, 0x6f, 0xc8, 0x05, 0x30, 0x6f, 0x77, 0x73, 0xb5, 0x00, 2190x77, 0x68, 0x6f, 0xc8, 0x05, 0x31, 0x6f, 0x77, 0x73, 0xb5,
2200x00, 0x4d, 0x02, 0x43, 0x75, 0x6d, 0x6e, 0x73, 0x4e, 0x00, 2200x00, 0x74, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x4e,
2210x06, 0xb9, 0x09, 0x04, 0x58, 0x00, 0x0e, 0x43, 0x00, 0x03, 2210x00, 0x06, 0xb9, 0x09, 0x03, 0x58, 0x00, 0x0e, 0x43, 0x00,
2220x86, 0x00, 0x02, 0x48, 0x01, 0x02, 0xaa, 0x01, 0x03, 0x27, 2220x04, 0x86, 0x00, 0x02, 0x44, 0x02, 0x04, 0x2e, 0x02, 0x00,
2230x03, 0x61, 0x2f, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x66, 0x01, 2230x27, 0x03, 0x62, 0x2f, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x66,
2240x03, 0x58, 0x00, 0x48, 0x2c, 0x00, 0x6f, 0x72, 0xf9, 0x09, 2240x01, 0x02, 0x58, 0x00, 0x10, 0x2c, 0xf5, 0x01, 0x07, 0xf9,
2250x14, 0x2f, 0x3b, 0x09, 0x01, 0x25, 0x00, 0x00, 0x86, 0x00, 2250x09, 0x15, 0x2f, 0x3b, 0x09, 0x01, 0x25, 0x00, 0x31, 0x72,
2260x01, 0x7a, 0x01, 0x02, 0xd7, 0x01, 0x71, 0x73, 0x6f, 0x72, 2260x6f, 0x77, 0x7a, 0x01, 0x02, 0xd7, 0x01, 0x72, 0x73, 0x6f,
2270x00, 0x6b, 0x65, 0x79, 0x8c, 0x00, 0x00, 0x48, 0x09, 0x01, 2270x72, 0x00, 0x6b, 0x65, 0x79, 0x8c, 0x00, 0x01, 0x48, 0x09,
2280x3a, 0x09, 0x22, 0x75, 0x73, 0xfa, 0x02, 0x39, 0x6d, 0x6f, 2280x52, 0x62, 0x65, 0x00, 0x75, 0x73, 0xfa, 0x02, 0x01, 0x1e,
2290x76, 0x94, 0x02, 0xb4, 0x67, 0x72, 0x69, 0x64, 0x2e, 0x00, 2290x01, 0x07, 0x94, 0x02, 0xb4, 0x67, 0x72, 0x69, 0x64, 0x2e,
2300x50, 0x72, 0x65, 0x73, 0x73, 0x59, 0x01, 0x41, 0x45, 0x6e, 2300x00, 0x50, 0x72, 0x65, 0x73, 0x73, 0x59, 0x01, 0x10, 0x45,
2310x74, 0x65, 0x42, 0x00, 0x01, 0x7b, 0x01, 0x0a, 0xeb, 0x02, 2310xcf, 0x09, 0x00, 0x42, 0x00, 0x02, 0x7b, 0x01, 0x09, 0xeb,
2320x00, 0x2a, 0x02, 0x20, 0x64, 0x64, 0xdc, 0x05, 0x21, 0x65, 2320x02, 0x00, 0x2a, 0x02, 0x20, 0x64, 0x64, 0xdc, 0x05, 0x21,
2330x77, 0x59, 0x01, 0x14, 0x2d, 0xe2, 0x01, 0x02, 0x6f, 0x01, 2330x65, 0x77, 0x59, 0x01, 0x15, 0x2d, 0xe2, 0x01, 0x01, 0x6f,
2340x02, 0x93, 0x03, 0x14, 0x70, 0x4f, 0x00, 0x43, 0x53, 0x70, 2340x01, 0x02, 0x93, 0x03, 0x14, 0x70, 0x4f, 0x00, 0x43, 0x53,
2350x61, 0x63, 0xc2, 0x01, 0x20, 0x6c, 0x6f, 0xa7, 0x01, 0x60, 2350x70, 0x61, 0x63, 0xc2, 0x01, 0x20, 0x6c, 0x6f, 0xa7, 0x01,
2360x00, 0x63, 0x65, 0x6c, 0x6c, 0x2c, 0xb1, 0x00, 0x00, 0xd3, 2360x30, 0x00, 0x63, 0x65, 0x03, 0x02, 0x31, 0x72, 0x6f, 0x77,
2370x00, 0x02, 0xde, 0x00, 0x01, 0xaf, 0x03, 0x10, 0x57, 0xe1, 2370xd3, 0x00, 0x02, 0xde, 0x00, 0x00, 0xbc, 0x00, 0x10, 0x57,
2380x04, 0x11, 0x61, 0x67, 0x08, 0x40, 0x72, 0x6f, 0x70, 0x72, 2380xe1, 0x04, 0x11, 0x61, 0x67, 0x08, 0x40, 0x72, 0x6f, 0x70,
2390xf5, 0x02, 0x0c, 0xc2, 0x0d, 0x02, 0xfc, 0x04, 0x44, 0x62, 2390x72, 0xf5, 0x02, 0x0d, 0xc2, 0x0d, 0x01, 0xfc, 0x04, 0x44,
2400x65, 0x65, 0x6e, 0xdb, 0x01, 0x15, 0x2c, 0x9f, 0x08, 0x08, 2400x62, 0x65, 0x65, 0x6e, 0xdb, 0x01, 0x16, 0x2c, 0x9f, 0x08,
2410x26, 0x02, 0x04, 0xa4, 0x09, 0x32, 0x74, 0x6f, 0x70, 0x71, 2410x08, 0x26, 0x02, 0x03, 0xa4, 0x09, 0x32, 0x74, 0x6f, 0x70,
2420x0a, 0x41, 0x63, 0x6f, 0x72, 0x6e, 0x48, 0x00, 0x05, 0xf2, 2420x71, 0x0a, 0x42, 0x63, 0x6f, 0x72, 0x6e, 0x48, 0x00, 0x04,
2430x00, 0x15, 0x3b, 0x86, 0x01, 0x02, 0x41, 0x01, 0x13, 0x28, 2430xf2, 0x00, 0x16, 0x3b, 0x86, 0x01, 0x01, 0x41, 0x01, 0x13,
2440xcd, 0x06, 0x63, 0x75, 0x73, 0x65, 0x00, 0x6f, 0x72, 0x45, 2440x28, 0xcd, 0x06, 0x31, 0x75, 0x73, 0x65, 0x97, 0x00, 0x01,
2450x01, 0x17, 0x29, 0x49, 0x05, 0x09, 0x73, 0x05, 0x00, 0xb0, 2450x45, 0x01, 0x18, 0x29, 0x49, 0x05, 0x08, 0x73, 0x05, 0x00,
2460x00, 0x11, 0x49, 0x9f, 0x06, 0x03, 0x7e, 0x02, 0x01, 0x4c, 2460xb0, 0x00, 0x12, 0x49, 0x9f, 0x06, 0x02, 0x7e, 0x02, 0x01,
2470x07, 0x01, 0x28, 0x00, 0x15, 0x27, 0x2f, 0x09, 0x28, 0x6e, 2470x4c, 0x07, 0x01, 0x28, 0x00, 0x15, 0x27, 0x2f, 0x09, 0x2a,
2480x64, 0x34, 0x00, 0x02, 0xda, 0x0d, 0x21, 0x6e, 0x6f, 0x8d, 2480x6e, 0x64, 0xa7, 0x05, 0x00, 0xde, 0x01, 0x21, 0x6e, 0x6f,
2490x00, 0x00, 0x7a, 0x0e, 0x0b, 0xaf, 0x05, 0x01, 0x46, 0x08, 2490x8d, 0x00, 0x00, 0x7a, 0x0e, 0x0c, 0xaf, 0x05, 0x00, 0x46,
2500x00, 0x31, 0x00, 0x01, 0x17, 0x00, 0xe2, 0x6d, 0x69, 0x6e, 2500x08, 0x02, 0x53, 0x09, 0xf2, 0x02, 0x68, 0x65, 0x00, 0x6d,
2510x69, 0x6d, 0x75, 0x6d, 0x00, 0x69, 0x6e, 0x66, 0x6f, 0x72, 2510x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x00, 0x69, 0x6e, 0x66,
2520x6d, 0x5f, 0x01, 0x92, 0x6e, 0x65, 0x63, 0x65, 0x73, 0x73, 2520x6f, 0x72, 0x6d, 0x5f, 0x01, 0x92, 0x6e, 0x65, 0x63, 0x65,
2530x61, 0x72, 0x79, 0xe1, 0x06, 0x32, 0x6d, 0x6f, 0x6e, 0x30, 2530x73, 0x73, 0x61, 0x72, 0x79, 0xe1, 0x06, 0x32, 0x6d, 0x6f,
2540x07, 0x02, 0xcc, 0x04, 0x20, 0x74, 0x6f, 0x3d, 0x00, 0x42, 2540x6e, 0x30, 0x07, 0x02, 0xcc, 0x04, 0x20, 0x74, 0x6f, 0x3d,
2550x2c, 0x00, 0x73, 0x6f, 0x97, 0x00, 0x00, 0xaf, 0x05, 0x22, 2550x00, 0x31, 0x2c, 0x00, 0x73, 0x08, 0x00, 0x01, 0x43, 0x09,
2560x72, 0x79, 0xce, 0x02, 0x13, 0x2e, 0xad, 0x00, 0x11, 0x72, 2560x01, 0x00, 0x0a, 0x00, 0xce, 0x02, 0x13, 0x2e, 0xad, 0x00,
2570x47, 0x01, 0x05, 0xf1, 0x06, 0x05, 0x93, 0x00, 0x02, 0x67, 2570x12, 0x72, 0x5e, 0x05, 0x06, 0xf1, 0x06, 0x06, 0x93, 0x00,
2580x0b, 0x42, 0x73, 0x74, 0x65, 0x6e, 0xd5, 0x07, 0x05, 0x6e, 2580x73, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0xd5, 0x07,
2590x09, 0x00, 0x36, 0x0a, 0x21, 0x68, 0x73, 0x51, 0x00, 0x71, 2590x05, 0x6e, 0x09, 0x51, 0x70, 0x61, 0x74, 0x68, 0x73, 0x51,
2600x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x8f, 0x07, 0x00, 2600x00, 0x72, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x8f,
2610xa5, 0x02, 0x67, 0x75, 0x74, 0x2c, 0x00, 0x6f, 0x6e, 0x27, 2610x07, 0x61, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x2c, 0x6a, 0x04,
2620x00, 0x04, 0xbe, 0x04, 0x02, 0xb6, 0x03, 0x02, 0x6c, 0x02, 2620x05, 0x27, 0x00, 0x05, 0xbe, 0x04, 0x02, 0xb6, 0x03, 0x01,
2630x64, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x3b, 0x08, 0x20, 2630x6c, 0x02, 0x30, 0x69, 0x6e, 0x64, 0x42, 0x03, 0x03, 0x3b,
2640x69, 0x74, 0x7b, 0x06, 0x32, 0x76, 0x65, 0x73, 0xb2, 0x05, 2640x08, 0x20, 0x69, 0x74, 0x7b, 0x06, 0x32, 0x76, 0x65, 0x73,
2650x45, 0x72, 0x6f, 0x6e, 0x67, 0x9a, 0x00, 0x09, 0x86, 0x07, 2650xb2, 0x05, 0x46, 0x72, 0x6f, 0x6e, 0x67, 0x9a, 0x00, 0x08,
2660x74, 0x74, 0x63, 0x68, 0x00, 0x61, 0x6c, 0x6c, 0x79, 0x04, 2660x86, 0x07, 0x41, 0x74, 0x63, 0x68, 0x00, 0x3a, 0x0c, 0x02,
2670x58, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x90, 0x00, 0x21, 0x62, 2670x79, 0x04, 0x20, 0x73, 0x74, 0xa7, 0x01, 0x07, 0x90, 0x00,
2680x75, 0xef, 0x0b, 0x02, 0xef, 0x05, 0x02, 0x49, 0x00, 0x01, 2680x22, 0x62, 0x75, 0xef, 0x0b, 0x03, 0xef, 0x05, 0x00, 0x49,
2690x8d, 0x00, 0x01, 0x94, 0x02, 0x0e, 0x91, 0x00, 0x60, 0x72, 2690x00, 0x02, 0x8d, 0x00, 0x01, 0x94, 0x02, 0x0d, 0x91, 0x00,
2700x65, 0x76, 0x65, 0x61, 0x6c, 0x24, 0x09, 0x52, 0x77, 0x72, 2700x60, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x24, 0x09, 0x52,
2710x69, 0x74, 0x74, 0xff, 0x0f, 0x43, 0x72, 0x65, 0x64, 0x29, 2710x77, 0x72, 0x69, 0x74, 0x74, 0xff, 0x0f, 0x43, 0x72, 0x65,
2720xd9, 0x0c, 0x2f, 0x69, 0x73, 0x05, 0x01, 0x01, 0x01, 0x97, 2720x64, 0x29, 0xd9, 0x0c, 0x2f, 0x69, 0x73, 0x05, 0x01, 0x02,
2730x00, 0x05, 0x25, 0x05, 0x0e, 0xf9, 0x01, 0x51, 0x64, 0x65, 2730x01, 0x97, 0x00, 0x05, 0x25, 0x05, 0x0d, 0xf9, 0x01, 0x51,
2740x63, 0x69, 0x64, 0x6d, 0x08, 0x10, 0x67, 0xd9, 0x09, 0x21, 2740x64, 0x65, 0x63, 0x69, 0x64, 0x6d, 0x08, 0x10, 0x67, 0xd9,
2750x75, 0x70, 0xf8, 0x06, 0x20, 0x6c, 0x65, 0xac, 0x05, 0x15, 2750x09, 0x21, 0x75, 0x70, 0xf8, 0x06, 0x20, 0x6c, 0x65, 0xac,
2760x2c, 0x84, 0x01, 0x20, 0x73, 0x65, 0x62, 0x06, 0x41, 0x00, 2760x05, 0x15, 0x2c, 0x84, 0x01, 0x20, 0x73, 0x65, 0x62, 0x06,
2770x53, 0x6f, 0x6c, 0x55, 0x10, 0x03, 0x8c, 0x00, 0x02, 0x7d, 2770x42, 0x00, 0x53, 0x6f, 0x6c, 0x55, 0x10, 0x02, 0x8c, 0x00,
2780x04, 0x5b, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x93, 0x01, 0x41, 2780x02, 0x7d, 0x04, 0x5b, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x93,
2790x2e, 0x00, 0x41, 0x74, 0xd1, 0x01, 0x02, 0x6d, 0x05, 0x14, 2790x01, 0x42, 0x2e, 0x00, 0x41, 0x74, 0xd1, 0x01, 0x01, 0x6d,
2800x2c, 0x2e, 0x02, 0x32, 0x6c, 0x79, 0x2d, 0x9d, 0x0b, 0x02, 2800x05, 0x14, 0x2c, 0x2e, 0x02, 0x33, 0x6c, 0x79, 0x2d, 0x9d,
2810x0a, 0x03, 0x0e, 0x2b, 0x06, 0x00, 0xbc, 0x07, 0x69, 0x66, 2810x0b, 0x02, 0x0a, 0x03, 0x0e, 0x2b, 0x06, 0x60, 0x61, 0x73,
2820x69, 0x6c, 0x6c, 0x65, 0x64, 0x3d, 0x05, 0x00, 0x20, 0x09, 2820x00, 0x66, 0x69, 0x6c, 0xe7, 0x00, 0x08, 0x3d, 0x05, 0x00,
2830x1f, 0x6e, 0x44, 0x00, 0x03, 0x0f, 0x32, 0x00, 0x05, 0x02, 2830x20, 0x09, 0x1f, 0x6e, 0x44, 0x00, 0x04, 0x0f, 0x32, 0x00,
2840xfe, 0x00, 0x00, 0x73, 0x0d, 0x63, 0x63, 0x72, 0x6f, 0x73, 2840x04, 0x02, 0xfe, 0x00, 0x00, 0x73, 0x0d, 0x30, 0x63, 0x72,
2850x73, 0x65, 0xd3, 0x03, 0x21, 0x6d, 0x69, 0xd2, 0x03, 0x0c, 2850x6f, 0xf5, 0x00, 0x02, 0xd3, 0x03, 0x22, 0x6d, 0x69, 0xd2,
2860x3c, 0x00, 0x00, 0x29, 0x00, 0x04, 0x3a, 0x00, 0x40, 0x2e, 2860x03, 0x0c, 0x3c, 0x00, 0x01, 0x29, 0x00, 0x02, 0x3a, 0x00,
2870x00, 0x49, 0x6e, 0x1e, 0x04, 0x01, 0xcb, 0x00, 0x37, 0x2c, 2870x40, 0x2e, 0x00, 0x49, 0x6e, 0x1e, 0x04, 0x01, 0xcb, 0x00,
2880x00, 0x61, 0x1c, 0x00, 0x01, 0xb9, 0x05, 0x10, 0x73, 0xd6, 2880x00, 0x9b, 0x03, 0x06, 0x1c, 0x00, 0x01, 0xb9, 0x05, 0x13,
2890x07, 0x02, 0x48, 0x04, 0x03, 0xcb, 0x08, 0x14, 0x64, 0x58, 2890x73, 0x3e, 0x0a, 0x00, 0x48, 0x04, 0x02, 0xcb, 0x08, 0x15,
2900x02, 0x01, 0x65, 0x04, 0x1f, 0x64, 0x91, 0x01, 0x0a, 0x06, 2900x64, 0x58, 0x02, 0x00, 0x65, 0x04, 0x1f, 0x64, 0x91, 0x01,
2910xc2, 0x02, 0x04, 0x81, 0x0a, 0x85, 0x28, 0x6a, 0x75, 0x73, 2910x10, 0x01, 0x2f, 0x01, 0x03, 0x81, 0x0a, 0x50, 0x28, 0x6a,
2920x74, 0x00, 0x61, 0x73, 0x1d, 0x09, 0x02, 0x78, 0x04, 0x0f, 2920x75, 0x73, 0x74, 0x8b, 0x00, 0x05, 0x1d, 0x09, 0x01, 0x78,
2930x8e, 0x03, 0x00, 0x12, 0x29, 0xc4, 0x00, 0x01, 0x48, 0x0e, 2930x04, 0x0f, 0x8e, 0x03, 0x00, 0x12, 0x29, 0xc4, 0x00, 0x01,
2940x3c, 0x65, 0x78, 0x74, 0x8e, 0x00, 0x06, 0x8e, 0x08, 0x01, 2940x48, 0x0e, 0x3e, 0x65, 0x78, 0x74, 0x8e, 0x00, 0x05, 0x8e,
2950x63, 0x04, 0x02, 0x8d, 0x00, 0x01, 0xe8, 0x10, 0x41, 0x72, 2950x08, 0x01, 0x63, 0x04, 0x02, 0x8d, 0x00, 0x00, 0xe8, 0x10,
2960x64, 0x65, 0x72, 0x70, 0x03, 0x02, 0x86, 0x02, 0x3d, 0x75, 2960x41, 0x72, 0x64, 0x65, 0x72, 0x70, 0x03, 0x02, 0x86, 0x02,
2970x69, 0x73, 0x88, 0x00, 0x06, 0x88, 0x11, 0x04, 0xad, 0x01, 2970x3e, 0x75, 0x69, 0x73, 0x88, 0x00, 0x05, 0x88, 0x11, 0x04,
2980x31, 0x00, 0x6f, 0x6e, 0x09, 0x07, 0x33, 0x28, 0x41, 0x6c, 2980xad, 0x01, 0x00, 0x8c, 0x02, 0x00, 0x2a, 0x02, 0x35, 0x28,
2990xeb, 0x01, 0x03, 0xe9, 0x0b, 0x72, 0x64, 0x65, 0x73, 0x63, 2990x41, 0x6c, 0xeb, 0x01, 0x01, 0xdb, 0x02, 0x72, 0x64, 0x65,
3000x72, 0x69, 0x62, 0x5c, 0x00, 0x13, 0x73, 0x7b, 0x08, 0x30, 3000x73, 0x63, 0x72, 0x69, 0x62, 0x5c, 0x00, 0x13, 0x73, 0x7b,
3010x32, 0x2e, 0x31, 0xce, 0x02, 0x02, 0xa9, 0x05, 0x51, 0x61, 3010x08, 0x31, 0x32, 0x2e, 0x31, 0xce, 0x02, 0x01, 0xa9, 0x05,
3020x76, 0x61, 0x69, 0x6c, 0x49, 0x07, 0x12, 0x29, 0x83, 0x08, 3020x51, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x49, 0x07, 0x12, 0x29,
3030x17, 0x32, 0x83, 0x08, 0x50, 0x70, 0x61, 0x72, 0x61, 0x6d, 3030x83, 0x08, 0x17, 0x32, 0x83, 0x08, 0x50, 0x70, 0x61, 0x72,
3040xda, 0x0a, 0x02, 0x85, 0x08, 0x01, 0xe1, 0x07, 0x05, 0x14, 3040x61, 0x6d, 0xda, 0x0a, 0x02, 0x85, 0x08, 0x01, 0xe1, 0x07,
3050x00, 0x01, 0xce, 0x03, 0x06, 0x40, 0x00, 0x06, 0x95, 0x00, 3050x06, 0x14, 0x00, 0x02, 0x45, 0x00, 0x04, 0x40, 0x00, 0x06,
3060xe2, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 3060x95, 0x00, 0xe2, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d,
3070x2e, 0x27, 0x00, 0x6f, 0x70, 0x8c, 0x07, 0x12, 0x6e, 0x1a, 3070x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x8c, 0x07, 0x12,
3080x00, 0xa1, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 0x65, 3080x6e, 0x1a, 0x00, 0xa1, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00,
3090x6e, 0x75, 0x82, 0x05, 0x81, 0x69, 0x64, 0x74, 0x68, 0x2c, 3090x6d, 0x65, 0x6e, 0x75, 0x82, 0x05, 0x81, 0x69, 0x64, 0x74,
3100x00, 0x48, 0x65, 0x5b, 0x06, 0x50, 0x00, 0x00, 0x53, 0x69, 3100x68, 0x2c, 0x00, 0x48, 0x65, 0x5b, 0x06, 0x51, 0x00, 0x00,
3110x7a, 0x4a, 0x08, 0x00, 0x30, 0x05, 0x00, 0xb1, 0x00, 0x04, 3110x53, 0x69, 0x7a, 0x4a, 0x08, 0x00, 0x30, 0x05, 0x01, 0xb1,
3120x4c, 0x08, 0x01, 0xb4, 0x08, 0x21, 0x72, 0x65, 0x6f, 0x00, 3120x00, 0x02, 0x4c, 0x08, 0x01, 0xb4, 0x08, 0x21, 0x72, 0x65,
3130x32, 0x32, 0x00, 0x78, 0x37, 0x00, 0x23, 0x00, 0x78, 0x38, 3130x6f, 0x00, 0x32, 0x32, 0x00, 0x78, 0x37, 0x00, 0x24, 0x00,
3140x00, 0x05, 0x0b, 0x13, 0x20, 0x65, 0x72, 0x39, 0x00, 0x00, 3140x78, 0x38, 0x00, 0x04, 0x0b, 0x13, 0x21, 0x65, 0x72, 0x39,
3150x96, 0x0a, 0x20, 0x77, 0x6f, 0x0e, 0x00, 0x00, 0xf3, 0x05, 3150x00, 0x51, 0x2c, 0x00, 0x74, 0x77, 0x6f, 0x0e, 0x00, 0x32,
3160x00, 0x85, 0x01, 0x03, 0x10, 0x00, 0x08, 0xfb, 0x05, 0x71, 3160x72, 0x6f, 0x77, 0x29, 0x0f, 0x03, 0x10, 0x00, 0x06, 0xfb,
3170x4e, 0x6f, 0x2e, 0x20, 0x6f, 0x66, 0x20, 0x5a, 0x02, 0x00, 3170x05, 0x72, 0x4e, 0x6f, 0x2e, 0x20, 0x6f, 0x66, 0x20, 0x5a,
3180x0f, 0x00, 0x0b, 0xf6, 0x05, 0x23, 0x74, 0x6f, 0x09, 0x0f, 3180x02, 0x3b, 0x00, 0x00, 0x4e, 0xf6, 0x05, 0x23, 0x74, 0x6f,
3190x25, 0x69, 0x6e, 0xc0, 0x05, 0x01, 0x1d, 0x12, 0x02, 0x2a, 3190x09, 0x0f, 0x27, 0x69, 0x6e, 0xb2, 0x06, 0x01, 0x1d, 0x12,
3200x0e, 0x10, 0x62, 0x9d, 0x06, 0x00, 0x9b, 0x02, 0x14, 0x6c, 3200x00, 0x63, 0x03, 0x10, 0x62, 0x9d, 0x06, 0x00, 0x9b, 0x02,
3210x31, 0x06, 0x11, 0x2c, 0xa6, 0x06, 0x00, 0x0d, 0x12, 0x20, 3210x14, 0x6c, 0x31, 0x06, 0x11, 0x2c, 0xa6, 0x06, 0x00, 0x0d,
3220x67, 0x65, 0x4a, 0x0d, 0x00, 0x24, 0x01, 0x15, 0x74, 0x38, 3220x12, 0x20, 0x67, 0x65, 0x4a, 0x0d, 0x00, 0x24, 0x01, 0x15,
3230x0a, 0xf2, 0x04, 0x00, 0x68, 0x79, 0x70, 0x68, 0x65, 0x6e, 3230x74, 0x38, 0x0a, 0xf3, 0x04, 0x00, 0x68, 0x79, 0x70, 0x68,
3240x2c, 0x00, 0x6c, 0x69, 0x6b, 0x65, 0x00, 0x60, 0x32, 0x2d, 3240x65, 0x6e, 0x2c, 0x00, 0x6c, 0x69, 0x6b, 0x65, 0x00, 0x60,
3250x36, 0x27, 0x1f, 0x02, 0x06, 0x36, 0x0c, 0x02, 0x43, 0x02, 3250x32, 0x2d, 0x36, 0x27, 0x1f, 0x02, 0x05, 0x36, 0x0c, 0x02,
3260x1f, 0x6e, 0x88, 0x00, 0x05, 0x19, 0x6f, 0x88, 0x00, 0x00, 3260x43, 0x02, 0x1f, 0x6e, 0x88, 0x00, 0x05, 0x1a, 0x6f, 0x88,
3270x49, 0x01, 0x02, 0xd7, 0x03, 0x02, 0x6e, 0x02, 0x02, 0x16, 3270x00, 0x01, 0x96, 0x10, 0x00, 0xd7, 0x03, 0x05, 0xfc, 0x05,
3280x0b, 0x42, 0x6f, 0x6e, 0x6c, 0x79, 0x2b, 0x0f, 0x00, 0xee, 3280x72, 0x69, 0x73, 0x00, 0x6f, 0x6e, 0x6c, 0x79, 0x2b, 0x0f,
3290x01, 0x14, 0x66, 0xbb, 0x0b, 0x05, 0x95, 0x08, 0x0f, 0xeb, 3290x00, 0xee, 0x01, 0x16, 0x66, 0xbb, 0x0b, 0x04, 0x95, 0x08,
3300x06, 0x0c, 0x33, 0x3b, 0x00, 0x61, 0x45, 0x09, 0x10, 0x75, 3300x0f, 0xeb, 0x06, 0x0b, 0x33, 0x3b, 0x00, 0x61, 0x45, 0x09,
3310xdb, 0x00, 0x01, 0x40, 0x0f, 0x30, 0x66, 0x66, 0x65, 0x8c, 3310x11, 0x75, 0x76, 0x03, 0x00, 0x40, 0x0f, 0x31, 0x66, 0x66,
3320x04, 0x02, 0x2b, 0x00, 0x04, 0x0e, 0x08, 0x03, 0xfa, 0x13, 3320x65, 0x8c, 0x04, 0x03, 0x2b, 0x00, 0x03, 0x0e, 0x08, 0x02,
3330x28, 0x61, 0x6c, 0x94, 0x0b, 0x03, 0x1a, 0x05, 0x60, 0x61, 3330xfa, 0x13, 0x29, 0x61, 0x6c, 0x94, 0x0b, 0x02, 0x1a, 0x05,
3340x63, 0x63, 0x65, 0x70, 0x74, 0x83, 0x00, 0x02, 0xa6, 0x09, 3340x60, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x83, 0x00, 0x02,
3350x26, 0x6c, 0x6c, 0xda, 0x05, 0x62, 0x69, 0x6e, 0x70, 0x75, 3350xa6, 0x09, 0x26, 0x6c, 0x6c, 0xda, 0x05, 0x62, 0x69, 0x6e,
3360x74, 0x73, 0x8d, 0x14, 0xe0, 0x75, 0x74, 0x70, 0x75, 0x74, 3360x70, 0x75, 0x74, 0x73, 0x8d, 0x14, 0x21, 0x75, 0x74, 0x0c,
3370x73, 0x00, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x00, 3370x00, 0x70, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x00,
338}; 338};
339 339
340const unsigned short help_text_len = 5458; 340const unsigned short help_text_len = 5458;
diff --git a/apps/plugins/puzzles/help/bridges.c b/apps/plugins/puzzles/help/bridges.c
index 97fc5c6ab0..ed901c1309 100644
--- a/apps/plugins/puzzles/help/bridges.c
+++ b/apps/plugins/puzzles/help/bridges.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -19,7 +19,7 @@ struct style_text help_text_style[] = {
19 LAST_STYLE_ITEM 19 LAST_STYLE_ITEM
20}; 20};
21 21
22/* orig 5230 comp 3127 ratio 0.597897 level 11 saved 2103 */ 22/* orig 5230 comp 3126 ratio 0.597706 level 10 saved 2104 */
23const char help_text[] = { 23const char help_text[] = {
240xf3, 0x4b, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 240xf3, 0x4b, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
250x32, 0x36, 0x3a, 0x20, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 250x32, 0x36, 0x3a, 0x20, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65,
@@ -34,7 +34,7 @@ const char help_text[] = {
340x74, 0x61, 0x69, 0x6e, 0x73, 0x00, 0x61, 0x00, 0x6e, 0x75, 340x74, 0x61, 0x69, 0x6e, 0x73, 0x00, 0x61, 0x00, 0x6e, 0x75,
350x6d, 0x62, 0x65, 0x72, 0x2e, 0x5e, 0x00, 0xb0, 0x72, 0x00, 350x6d, 0x62, 0x65, 0x72, 0x2e, 0x5e, 0x00, 0xb0, 0x72, 0x00,
360x61, 0x69, 0x6d, 0x00, 0x69, 0x73, 0x00, 0x74, 0x6f, 0x22, 360x61, 0x69, 0x6d, 0x00, 0x69, 0x73, 0x00, 0x74, 0x6f, 0x22,
370x00, 0x40, 0x6e, 0x65, 0x63, 0x74, 0x48, 0x00, 0x05, 0x67, 370x00, 0x41, 0x6e, 0x65, 0x63, 0x74, 0x48, 0x00, 0x04, 0x67,
380x00, 0xf2, 0x00, 0x74, 0x6f, 0x67, 0x65, 0x74, 0x68, 0x65, 380x00, 0xf2, 0x00, 0x74, 0x6f, 0x67, 0x65, 0x74, 0x68, 0x65,
390x72, 0x00, 0x77, 0x69, 0x74, 0x68, 0x00, 0x62, 0x9a, 0x00, 390x72, 0x00, 0x77, 0x69, 0x74, 0x68, 0x00, 0x62, 0x9a, 0x00,
400xf3, 0x0b, 0x2c, 0x00, 0x69, 0x6e, 0x00, 0x73, 0x75, 0x63, 400xf3, 0x0b, 0x2c, 0x00, 0x69, 0x6e, 0x00, 0x73, 0x75, 0x63,
@@ -45,295 +45,295 @@ const char help_text[] = {
450x00, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63, 0x0e, 0x00, 0x11, 450x00, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63, 0x0e, 0x00, 0x11,
460x2e, 0x2c, 0x00, 0x33, 0x54, 0x68, 0x65, 0x8a, 0x00, 0x00, 460x2e, 0x2c, 0x00, 0x33, 0x54, 0x68, 0x65, 0x8a, 0x00, 0x00,
470xd8, 0x00, 0x13, 0x62, 0x3a, 0x00, 0x81, 0x74, 0x65, 0x72, 470xd8, 0x00, 0x13, 0x62, 0x3a, 0x00, 0x81, 0x74, 0x65, 0x72,
480x6d, 0x69, 0x6e, 0x61, 0x74, 0xc5, 0x00, 0x53, 0x74, 0x00, 480x6d, 0x69, 0x6e, 0x61, 0x74, 0xc5, 0x00, 0x54, 0x74, 0x00,
490x61, 0x6e, 0x79, 0x8c, 0x00, 0x00, 0xa5, 0x00, 0x50, 0x65, 490x61, 0x6e, 0x79, 0xc1, 0x00, 0x80, 0x69, 0x73, 0x00, 0x65,
500x71, 0x75, 0x61, 0x6c, 0xab, 0x00, 0x16, 0x74, 0x3c, 0x00, 500x71, 0x75, 0x61, 0x6c, 0xab, 0x00, 0x16, 0x74, 0x3c, 0x00,
510xa1, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x00, 0x69, 510x70, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x93, 0x00,
520x6e, 0x88, 0x00, 0x03, 0x2e, 0x00, 0x03, 0x63, 0x00, 0x25, 520x00, 0x88, 0x00, 0x03, 0x2e, 0x00, 0x03, 0x63, 0x00, 0x25,
530x77, 0x6f, 0x59, 0x00, 0x61, 0x6d, 0x61, 0x79, 0x00, 0x72, 530x77, 0x6f, 0x59, 0x00, 0x31, 0x6d, 0x61, 0x79, 0x97, 0x00,
540x75, 0x28, 0x00, 0xf1, 0x01, 0x70, 0x61, 0x72, 0x61, 0x6c, 540xf1, 0x04, 0x69, 0x6e, 0x00, 0x70, 0x61, 0x72, 0x61, 0x6c,
550x6c, 0x65, 0x6c, 0x00, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 550x6c, 0x65, 0x6c, 0x00, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65,
560x6e, 0x4f, 0x00, 0x84, 0x73, 0x61, 0x6d, 0x65, 0x00, 0x74, 560x6e, 0x4f, 0x00, 0x84, 0x73, 0x61, 0x6d, 0x65, 0x00, 0x74,
570x77, 0x6f, 0xfb, 0x00, 0xd0, 0x2c, 0x00, 0x62, 0x75, 0x74, 570x77, 0x6f, 0xfb, 0x00, 0xd0, 0x2c, 0x00, 0x62, 0x75, 0x74,
580x00, 0x6e, 0x6f, 0x00, 0x6d, 0x6f, 0x72, 0x65, 0x5b, 0x00, 580x00, 0x6e, 0x6f, 0x00, 0x6d, 0x6f, 0x72, 0x65, 0x5b, 0x00,
590x10, 0x6e, 0x1e, 0x00, 0x01, 0x47, 0x00, 0x52, 0x64, 0x6f, 590x11, 0x6e, 0x1e, 0x00, 0x00, 0x47, 0x00, 0x52, 0x64, 0x6f,
600x00, 0x73, 0x6f, 0x62, 0x00, 0x14, 0x4e, 0x61, 0x00, 0x11, 600x00, 0x73, 0x6f, 0x62, 0x00, 0x14, 0x4e, 0x61, 0x00, 0x11,
610x00, 0x84, 0x01, 0x60, 0x65, 0x73, 0x00, 0x61, 0x6e, 0x6f, 610x00, 0x84, 0x01, 0x61, 0x65, 0x73, 0x00, 0x61, 0x6e, 0x6f,
620x31, 0x01, 0x03, 0x17, 0x00, 0x02, 0x26, 0x00, 0x38, 0x41, 620x31, 0x01, 0x02, 0x17, 0x00, 0x02, 0x26, 0x00, 0x39, 0x41,
630x6c, 0x6c, 0x56, 0x01, 0x00, 0x9e, 0x01, 0x04, 0x6e, 0x01, 630x6c, 0x6c, 0x56, 0x01, 0x34, 0x61, 0x72, 0x65, 0x6e, 0x01,
640x25, 0x65, 0x64, 0x64, 0x01, 0x30, 0x2e, 0x00, 0x00, 0x15, 640x25, 0x65, 0x64, 0x64, 0x01, 0x00, 0x2c, 0x00, 0x51, 0x54,
650x01, 0x21, 0x72, 0x65, 0x20, 0x00, 0x31, 0x73, 0x6f, 0x6d, 650x68, 0x65, 0x72, 0x65, 0x20, 0x00, 0x31, 0x73, 0x6f, 0x6d,
660x25, 0x00, 0xf0, 0x00, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 660x25, 0x00, 0xf0, 0x00, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61,
670x62, 0x6c, 0x65, 0x00, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x1b, 670x62, 0x6c, 0x65, 0x00, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x1b,
680x01, 0x60, 0x76, 0x65, 0x00, 0x6d, 0x6f, 0x64, 0x88, 0x01, 680x01, 0x60, 0x76, 0x65, 0x00, 0x6d, 0x6f, 0x64, 0x88, 0x01,
690x30, 0x77, 0x68, 0x69, 0xe2, 0x01, 0xc0, 0x6e, 0x76, 0x6f, 690x30, 0x77, 0x68, 0x69, 0xe2, 0x01, 0xc0, 0x6e, 0x76, 0x6f,
700x6c, 0x76, 0x65, 0x00, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x39, 700x6c, 0x76, 0x65, 0x00, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x39,
710x01, 0x35, 0x74, 0x68, 0x65, 0xe5, 0x00, 0x13, 0x2d, 0xa0, 710x01, 0x01, 0x0a, 0x02, 0x03, 0xe5, 0x00, 0x13, 0x2d, 0xa0,
720x00, 0x81, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x00, 0x74, 0x6f, 720x00, 0x50, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x3c, 0x01, 0x00,
730x59, 0x00, 0x20, 0x74, 0x68, 0x27, 0x00, 0x01, 0xa9, 0x00, 730x59, 0x00, 0x20, 0x74, 0x68, 0x27, 0x00, 0x02, 0xa9, 0x00,
740x02, 0xdb, 0x00, 0x31, 0x32, 0x2c, 0x00, 0x64, 0x01, 0x74, 740x01, 0xdb, 0x00, 0x31, 0x32, 0x2c, 0x00, 0x64, 0x01, 0x74,
750x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x45, 0x00, 0xa0, 750x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x45, 0x00, 0xa0,
760x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 760x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,
770x8b, 0x00, 0x70, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 770x8b, 0x00, 0x72, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74,
780x32, 0x00, 0x01, 0x1a, 0x01, 0xb9, 0x73, 0x65, 0x71, 0x75, 780x68, 0x01, 0xb8, 0x6e, 0x6f, 0x00, 0x73, 0x65, 0x71, 0x75,
790x65, 0x6e, 0x63, 0x65, 0x00, 0x6f, 0x66, 0x67, 0x01, 0xf4, 790x65, 0x6e, 0x63, 0x65, 0xc0, 0x01, 0x00, 0x20, 0x01, 0xf4,
800x05, 0x66, 0x6f, 0x72, 0x6d, 0x00, 0x61, 0x00, 0x6c, 0x6f, 800x05, 0x66, 0x6f, 0x72, 0x6d, 0x00, 0x61, 0x00, 0x6c, 0x6f,
810x6f, 0x70, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x00, 0x6f, 0x6e, 810x6f, 0x70, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x00, 0x6f, 0x6e,
820x65, 0xc6, 0x01, 0x75, 0x62, 0x61, 0x63, 0x6b, 0x00, 0x74, 820x65, 0xc6, 0x01, 0x44, 0x62, 0x61, 0x63, 0x6b, 0xc2, 0x01,
830x6f, 0x73, 0x01, 0x04, 0xb0, 0x01, 0x01, 0x0f, 0x02, 0x91, 830x01, 0x73, 0x01, 0x04, 0xb0, 0x01, 0x00, 0x0f, 0x02, 0x91,
840x72, 0x75, 0x6c, 0x65, 0x73, 0x00, 0x73, 0x74, 0x61, 0xd6, 840x72, 0x75, 0x6c, 0x65, 0x73, 0x00, 0x73, 0x74, 0x61, 0xd6,
850x02, 0x31, 0x62, 0x6f, 0x76, 0x0b, 0x01, 0x01, 0x2c, 0x00, 850x02, 0x32, 0x62, 0x6f, 0x76, 0x0b, 0x01, 0x00, 0x2c, 0x00,
860x70, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4b, 0x00, 860x70, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4b, 0x00,
870x10, 0x73, 0x29, 0x01, 0x90, 0x43, 0x72, 0x65, 0x64, 0x69, 870x10, 0x73, 0x29, 0x01, 0x60, 0x43, 0x72, 0x65, 0x64, 0x69,
880x74, 0x00, 0x66, 0x6f, 0xc1, 0x00, 0xd1, 0x69, 0x73, 0x00, 880x74, 0x6b, 0x00, 0xf1, 0x01, 0x00, 0x74, 0x68, 0x69, 0x73,
890x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x00, 0x67, 0x6f, 0x65, 890x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x00, 0x67, 0x6f,
900xcc, 0x02, 0xe5, 0x4e, 0x69, 0x6b, 0x6f, 0x6c, 0x69, 0x00, 900x65, 0xcc, 0x02, 0xb0, 0x4e, 0x69, 0x6b, 0x6f, 0x6c, 0x69,
910x5b, 0x31, 0x32, 0x5d, 0x2e, 0x00, 0x00, 0x98, 0x02, 0x30, 910x00, 0x5b, 0x31, 0x32, 0x5d, 0x2e, 0x00, 0x04, 0x98, 0x02,
920x77, 0x61, 0x73, 0xc9, 0x00, 0x04, 0x3a, 0x03, 0x02, 0x89, 920x31, 0x77, 0x61, 0x73, 0x09, 0x03, 0x04, 0x3a, 0x03, 0x01,
930x00, 0x10, 0x69, 0x14, 0x00, 0x40, 0x6c, 0x6c, 0x65, 0x63, 930x89, 0x00, 0x10, 0x69, 0x14, 0x00, 0x40, 0x6c, 0x6c, 0x65,
940xea, 0x00, 0xf0, 0x00, 0x00, 0x62, 0x79, 0x00, 0x4a, 0x61, 940x63, 0xea, 0x00, 0xf1, 0x00, 0x00, 0x62, 0x79, 0x00, 0x4a,
950x6d, 0x65, 0x73, 0x00, 0x48, 0x61, 0x72, 0x76, 0x65, 0xac, 950x61, 0x6d, 0x65, 0x73, 0x00, 0x48, 0x61, 0x72, 0x76, 0x65,
960x02, 0x01, 0x46, 0x00, 0xd1, 0x00, 0x68, 0x74, 0x74, 0x70, 960xac, 0x02, 0x00, 0x46, 0x00, 0xd1, 0x00, 0x68, 0x74, 0x74,
970x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6e, 0x5d, 0x00, 970x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6e, 0x5d,
980xa2, 0x2e, 0x63, 0x6f, 0x2e, 0x6a, 0x70, 0x2f, 0x65, 0x6e, 980x00, 0xa2, 0x2e, 0x63, 0x6f, 0x2e, 0x6a, 0x70, 0x2f, 0x65,
990x2f, 0x7c, 0x00, 0xf1, 0x0c, 0x73, 0x2f, 0x68, 0x61, 0x73, 990x6e, 0x2f, 0x7c, 0x00, 0xf1, 0x0c, 0x73, 0x2f, 0x68, 0x61,
1000x68, 0x69, 0x77, 0x6f, 0x6b, 0x61, 0x6b, 0x65, 0x72, 0x6f, 1000x73, 0x68, 0x69, 0x77, 0x6f, 0x6b, 0x61, 0x6b, 0x65, 0x72,
1010x2e, 0x68, 0x74, 0x6d, 0x6c, 0x00, 0x28, 0x62, 0x65, 0x77, 1010x6f, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x00, 0x28, 0x62, 0x65,
1020x61, 0x72, 0x22, 0x01, 0xd5, 0x46, 0x6c, 0x61, 0x73, 0x68, 1020x77, 0x61, 0x72, 0x22, 0x01, 0xd5, 0x46, 0x6c, 0x61, 0x73,
1030x29, 0x00, 0x00, 0x00, 0x32, 0x36, 0x2e, 0x31, 0xe5, 0x03, 1030x68, 0x29, 0x00, 0x00, 0x00, 0x32, 0x36, 0x2e, 0x31, 0xe5,
1040x01, 0x8e, 0x00, 0x21, 0x6f, 0x6c, 0xee, 0x03, 0x20, 0x54, 1040x03, 0x01, 0x8e, 0x00, 0x21, 0x6f, 0x6c, 0xee, 0x03, 0x20,
1050x6f, 0xc0, 0x03, 0x43, 0x63, 0x65, 0x00, 0x61, 0x4f, 0x01, 1050x54, 0x6f, 0xc0, 0x03, 0x10, 0x63, 0xee, 0x03, 0x03, 0xb5,
1060x04, 0xa1, 0x02, 0x0a, 0x98, 0x02, 0x30, 0x63, 0x6c, 0x69, 1060x01, 0x05, 0xa1, 0x02, 0x08, 0x98, 0x02, 0x30, 0x63, 0x6c,
1070x44, 0x01, 0x10, 0x68, 0x06, 0x02, 0xb7, 0x75, 0x73, 0x65, 1070x69, 0x44, 0x01, 0x10, 0x68, 0x06, 0x02, 0xb8, 0x75, 0x73,
1080x00, 0x64, 0x6f, 0x77, 0x6e, 0x00, 0x6f, 0x6e, 0x66, 0x01, 1080x65, 0x00, 0x64, 0x6f, 0x77, 0x6e, 0x00, 0x6f, 0x6e, 0x66,
1090x01, 0xcc, 0x01, 0x51, 0x64, 0x72, 0x61, 0x67, 0x00, 0xf3, 1090x01, 0x00, 0x04, 0x00, 0x51, 0x64, 0x72, 0x61, 0x67, 0x00,
1100x01, 0x41, 0x77, 0x61, 0x72, 0x64, 0x1f, 0x04, 0x00, 0xf2, 1100xf3, 0x01, 0x42, 0x77, 0x61, 0x72, 0x64, 0x1f, 0x04, 0x01,
1110x01, 0x03, 0xf9, 0x03, 0x00, 0xc5, 0x02, 0x61, 0x6e, 0x6f, 1110xf2, 0x01, 0x01, 0xf9, 0x03, 0x00, 0xc5, 0x02, 0x62, 0x6e,
1120x74, 0x00, 0x6e, 0x65, 0x07, 0x01, 0x02, 0x2e, 0x00, 0x12, 1120x6f, 0x74, 0x00, 0x6e, 0x65, 0x07, 0x01, 0x01, 0x2e, 0x00,
1130x61, 0xa8, 0x02, 0x02, 0xd5, 0x03, 0x16, 0x6f, 0x32, 0x00, 1130x13, 0x61, 0xa8, 0x02, 0x01, 0xd5, 0x03, 0x16, 0x6f, 0x32,
1140x03, 0x57, 0x00, 0xa5, 0x3b, 0x00, 0x79, 0x6f, 0x75, 0x00, 1140x00, 0x03, 0x57, 0x00, 0xa5, 0x3b, 0x00, 0x79, 0x6f, 0x75,
1150x6f, 0x6e, 0x6c, 0x79, 0x37, 0x00, 0x47, 0x6d, 0x6f, 0x76, 1150x00, 0x6f, 0x6e, 0x6c, 0x79, 0x37, 0x00, 0x10, 0x6d, 0xa4,
1160x65, 0x8b, 0x00, 0xa3, 0x66, 0x61, 0x72, 0x00, 0x65, 0x6e, 1160x01, 0x06, 0x8b, 0x00, 0xa3, 0x66, 0x61, 0x72, 0x00, 0x65,
1170x6f, 0x75, 0x67, 0x68, 0x9a, 0x01, 0x10, 0x65, 0x53, 0x02, 1170x6e, 0x6f, 0x75, 0x67, 0x68, 0x9a, 0x01, 0x10, 0x65, 0x53,
1180x54, 0x65, 0x6e, 0x64, 0x65, 0x64, 0xd3, 0x00, 0x32, 0x64, 1180x02, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x64, 0xd3, 0x00, 0x33,
1190x69, 0x72, 0x6a, 0x01, 0x00, 0x3f, 0x00, 0xf1, 0x04, 0x62, 1190x64, 0x69, 0x72, 0x6a, 0x01, 0xf1, 0x07, 0x74, 0x6f, 0x00,
1200x65, 0x00, 0x75, 0x6e, 0x61, 0x6d, 0x62, 0x69, 0x67, 0x75, 1200x62, 0x65, 0x00, 0x75, 0x6e, 0x61, 0x6d, 0x62, 0x69, 0x67,
1210x6f, 0x75, 0x73, 0x2e, 0x00, 0x28, 0x53, 0x6f, 0x64, 0x00, 1210x75, 0x6f, 0x75, 0x73, 0x2e, 0x00, 0x28, 0x53, 0x6f, 0x64,
1220x87, 0x63, 0x61, 0x6e, 0x00, 0x6b, 0x65, 0x65, 0x70, 0x5b, 1220x00, 0x87, 0x63, 0x61, 0x6e, 0x00, 0x6b, 0x65, 0x65, 0x70,
1230x00, 0x31, 0x6e, 0x65, 0x61, 0x51, 0x00, 0x00, 0x1f, 0x02, 1230x5b, 0x00, 0x42, 0x6e, 0x65, 0x61, 0x72, 0x36, 0x02, 0x31,
1240x10, 0x72, 0x1f, 0x04, 0x04, 0xec, 0x00, 0x03, 0xdd, 0x04, 1240x74, 0x61, 0x72, 0x1f, 0x04, 0x07, 0xec, 0x00, 0xb0, 0x63,
1250x80, 0x76, 0x65, 0x6e, 0x69, 0x65, 0x6e, 0x74, 0x6c, 0x8f, 1250x6f, 0x6e, 0x76, 0x65, 0x6e, 0x69, 0x65, 0x6e, 0x74, 0x6c,
1260x04, 0x35, 0x72, 0x6f, 0x77, 0x91, 0x02, 0x32, 0x6f, 0x75, 1260x8f, 0x04, 0x35, 0x72, 0x6f, 0x77, 0x91, 0x02, 0x32, 0x6f,
1270x74, 0x85, 0x02, 0x20, 0x69, 0x74, 0xfc, 0x03, 0x46, 0x6d, 1270x75, 0x74, 0x85, 0x02, 0x20, 0x69, 0x74, 0xfc, 0x03, 0x10,
1280x61, 0x6e, 0x79, 0x84, 0x00, 0x20, 0x73, 0x2e, 0x91, 0x01, 1280x6d, 0x52, 0x04, 0x05, 0x84, 0x00, 0x20, 0x73, 0x2e, 0x91,
1290x52, 0x44, 0x6f, 0x69, 0x6e, 0x67, 0x09, 0x02, 0xa6, 0x61, 1290x01, 0x22, 0x44, 0x6f, 0xf0, 0x02, 0xd6, 0x69, 0x73, 0x00,
1300x67, 0x61, 0x69, 0x6e, 0x00, 0x77, 0x68, 0x65, 0x6e, 0x85, 1300x61, 0x67, 0x61, 0x69, 0x6e, 0x00, 0x77, 0x68, 0x65, 0x6e,
1310x01, 0x00, 0x17, 0x00, 0xf0, 0x04, 0x6c, 0x72, 0x65, 0x61, 1310x85, 0x01, 0x00, 0x17, 0x00, 0xf0, 0x04, 0x6c, 0x72, 0x65,
1320x64, 0x79, 0x00, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 1320x61, 0x64, 0x79, 0x00, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e,
1330x00, 0x77, 0x69, 0x6c, 0x6c, 0x1d, 0x03, 0x04, 0xee, 0x03, 1330x74, 0x00, 0x77, 0x69, 0x6c, 0x6c, 0x1d, 0x03, 0x05, 0xee,
1340x05, 0x6e, 0x03, 0x05, 0xf7, 0x03, 0x44, 0x49, 0x66, 0x00, 1340x03, 0x06, 0x53, 0x04, 0x03, 0xf7, 0x03, 0x45, 0x49, 0x66,
1350x74, 0xcc, 0x03, 0x05, 0x3f, 0x00, 0x21, 0x61, 0x73, 0x80, 1350x00, 0x74, 0xcc, 0x03, 0x04, 0x3f, 0x00, 0x22, 0x61, 0x73,
1360x00, 0x04, 0x9c, 0x00, 0x07, 0x80, 0x04, 0x09, 0x7b, 0x04, 1360x80, 0x00, 0x04, 0x9c, 0x00, 0x08, 0x80, 0x04, 0x07, 0xe3,
1370x00, 0x28, 0x00, 0x10, 0x70, 0x08, 0x05, 0x20, 0x74, 0x74, 1370x01, 0x00, 0x28, 0x00, 0x10, 0x70, 0x08, 0x05, 0x20, 0x74,
1380x38, 0x01, 0x11, 0x79, 0x20, 0x00, 0x40, 0x63, 0x75, 0x72, 1380x74, 0x38, 0x01, 0x11, 0x79, 0x20, 0x00, 0x40, 0x63, 0x75,
1390x72, 0x7b, 0x00, 0x34, 0x67, 0x61, 0x6d, 0x29, 0x03, 0x51, 1390x72, 0x72, 0x7b, 0x00, 0x34, 0x67, 0x61, 0x6d, 0x29, 0x03,
1400x28, 0x69, 0x2e, 0x65, 0x2e, 0x39, 0x00, 0x24, 0x62, 0x79, 1400x51, 0x28, 0x69, 0x2e, 0x65, 0x2e, 0x39, 0x00, 0x24, 0x62,
1410x21, 0x03, 0x25, 0x29, 0x2c, 0x5b, 0x03, 0x01, 0xd4, 0x01, 1410x79, 0x21, 0x03, 0x26, 0x29, 0x2c, 0x5b, 0x03, 0x00, 0xd4,
1420x11, 0x67, 0x49, 0x05, 0x01, 0xed, 0x00, 0x02, 0xb6, 0x00, 1420x01, 0x11, 0x67, 0x49, 0x05, 0x02, 0x71, 0x01, 0x01, 0xb6,
1430x20, 0x72, 0x65, 0xb4, 0x01, 0x01, 0xeb, 0x01, 0x11, 0x6f, 1430x00, 0x21, 0x72, 0x65, 0xb4, 0x01, 0x00, 0xeb, 0x01, 0x11,
1440xa4, 0x00, 0x10, 0x6d, 0xe3, 0x02, 0x21, 0x49, 0x66, 0x78, 1440x6f, 0xa4, 0x00, 0x10, 0x6d, 0xe3, 0x02, 0x21, 0x49, 0x66,
1450x01, 0x30, 0x77, 0x61, 0x6e, 0x31, 0x02, 0x00, 0x25, 0x00, 1450x78, 0x01, 0x31, 0x77, 0x61, 0x6e, 0x24, 0x04, 0x60, 0x72,
1460x30, 0x69, 0x6e, 0x64, 0x13, 0x00, 0x51, 0x72, 0x73, 0x65, 1460x65, 0x6d, 0x69, 0x6e, 0x64, 0x13, 0x00, 0x52, 0x72, 0x73,
1470x6c, 0x66, 0xf2, 0x03, 0x08, 0xa2, 0x00, 0x00, 0x6e, 0x00, 1470x65, 0x6c, 0x66, 0xf2, 0x03, 0x08, 0xa2, 0x00, 0x90, 0x64,
1480x60, 0x69, 0x6e, 0x69, 0x74, 0x65, 0x6c, 0x0e, 0x05, 0x40, 1480x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x65, 0x6c, 0x0e, 0x05,
1490x20, 0x6e, 0x6f, 0x74, 0xa7, 0x06, 0x0e, 0xb9, 0x02, 0x01, 1490x10, 0x20, 0x49, 0x02, 0x03, 0xa7, 0x06, 0x0c, 0xb9, 0x02,
1500x60, 0x00, 0x15, 0x2c, 0xd3, 0x01, 0x60, 0x72, 0x69, 0x67, 1500x45, 0x68, 0x65, 0x6d, 0x2c, 0xd3, 0x01, 0x61, 0x72, 0x69,
1510x68, 0x74, 0x2d, 0x97, 0x00, 0x09, 0x21, 0x00, 0x25, 0x00, 1510x67, 0x68, 0x74, 0x2d, 0x6b, 0x02, 0x08, 0x21, 0x00, 0x27,
1520x69, 0x83, 0x05, 0x01, 0x7c, 0x02, 0x03, 0x90, 0x02, 0x83, 1520x00, 0x69, 0x83, 0x05, 0x03, 0x7c, 0x02, 0xb3, 0x64, 0x72,
1530x77, 0x00, 0x61, 0x00, 0x60, 0x6e, 0x6f, 0x6e, 0xc2, 0x04, 1530x61, 0x77, 0x00, 0x61, 0x00, 0x60, 0x6e, 0x6f, 0x6e, 0xc2,
1540x87, 0x27, 0x00, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x72, 0xaf, 1540x04, 0x87, 0x27, 0x00, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x72,
1550x00, 0x00, 0xc7, 0x04, 0x34, 0x6b, 0x00, 0x79, 0x25, 0x07, 1550xaf, 0x00, 0x00, 0xc7, 0x04, 0x34, 0x6b, 0x00, 0x79, 0x25,
1560x00, 0x93, 0x00, 0x42, 0x73, 0x68, 0x65, 0x64, 0xad, 0x06, 1560x07, 0x00, 0x93, 0x00, 0x42, 0x73, 0x68, 0x65, 0x64, 0xad,
1570x23, 0x61, 0x6e, 0xae, 0x00, 0x02, 0x28, 0x01, 0x05, 0x27, 1570x06, 0x24, 0x61, 0x6e, 0x22, 0x02, 0x02, 0x28, 0x01, 0x05,
1580x00, 0x02, 0x64, 0x03, 0x11, 0x64, 0x02, 0x01, 0x35, 0x69, 1580x27, 0x00, 0x01, 0x64, 0x03, 0x11, 0x64, 0x02, 0x01, 0x35,
1590x74, 0x73, 0x8d, 0x01, 0x01, 0x4c, 0x02, 0x13, 0x72, 0x74, 1590x69, 0x74, 0x73, 0x8d, 0x01, 0x01, 0x4c, 0x02, 0x13, 0x72,
1600x05, 0x22, 0x64, 0x65, 0xe8, 0x04, 0x01, 0x0e, 0x07, 0x10, 1600x74, 0x05, 0x24, 0x64, 0x65, 0xe8, 0x04, 0x41, 0x74, 0x68,
1610x79, 0x18, 0x00, 0x03, 0xa5, 0x00, 0x02, 0xc4, 0x00, 0x02, 1610x65, 0x79, 0x18, 0x00, 0x03, 0xa5, 0x00, 0x01, 0xc4, 0x00,
1620x44, 0x00, 0x25, 0x73, 0x29, 0xdb, 0x00, 0x01, 0x9c, 0x00, 1620x02, 0x44, 0x00, 0x26, 0x73, 0x29, 0xdb, 0x00, 0x00, 0x9c,
1630x07, 0xe4, 0x05, 0x33, 0x00, 0x61, 0x73, 0x8f, 0x00, 0x02, 1630x00, 0x07, 0xe4, 0x05, 0x00, 0xc3, 0x01, 0x05, 0x8f, 0x00,
1640xc2, 0x01, 0x51, 0x6c, 0x65, 0x66, 0x74, 0x2d, 0xb9, 0x03, 1640x81, 0x62, 0x79, 0x00, 0x6c, 0x65, 0x66, 0x74, 0x2d, 0xb9,
1650x01, 0x79, 0x05, 0x40, 0x6e, 0x00, 0x69, 0x74, 0xf3, 0x04, 1650x03, 0x01, 0x79, 0x05, 0x40, 0x6e, 0x00, 0x69, 0x74, 0xf3,
1660x22, 0x69, 0x73, 0x95, 0x01, 0x51, 0x68, 0x69, 0x67, 0x68, 1660x04, 0x22, 0x69, 0x73, 0x95, 0x01, 0x51, 0x68, 0x69, 0x67,
1670x6c, 0x59, 0x00, 0x20, 0x69, 0x74, 0x89, 0x00, 0x04, 0x8a, 1670x68, 0x6c, 0x59, 0x00, 0x22, 0x69, 0x74, 0x89, 0x00, 0x03,
1680x03, 0x04, 0x9d, 0x00, 0x09, 0x2e, 0x06, 0x31, 0x00, 0x69, 1680x8a, 0x03, 0x04, 0x9d, 0x00, 0x08, 0x2e, 0x06, 0x32, 0x00,
1690x74, 0xae, 0x05, 0x02, 0xb2, 0x01, 0x20, 0x69, 0x6c, 0xc8, 1690x69, 0x74, 0xae, 0x05, 0x01, 0xb2, 0x01, 0x20, 0x69, 0x6c,
1700x06, 0x00, 0x9a, 0x02, 0x62, 0x76, 0x65, 0x6e, 0x74, 0x65, 1700xc8, 0x06, 0x00, 0x9a, 0x02, 0x30, 0x76, 0x65, 0x6e, 0x21,
1710x64, 0xed, 0x02, 0x62, 0x61, 0x63, 0x63, 0x69, 0x64, 0x65, 1710x00, 0x01, 0xed, 0x02, 0x31, 0x61, 0x63, 0x63, 0xc4, 0x00,
1720x7d, 0x07, 0x00, 0x2d, 0x06, 0x22, 0x69, 0x66, 0x17, 0x08, 1720x01, 0x7d, 0x07, 0x52, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x17,
1730x22, 0x6e, 0x79, 0xf6, 0x01, 0x25, 0x6f, 0x73, 0x5c, 0x00, 1730x08, 0x22, 0x6e, 0x79, 0xf6, 0x01, 0x26, 0x6f, 0x73, 0x5c,
1740x00, 0xd9, 0x00, 0x98, 0x66, 0x75, 0x74, 0x75, 0x72, 0x65, 1740x00, 0xc9, 0x69, 0x6e, 0x00, 0x66, 0x75, 0x74, 0x75, 0x72,
1750x2e, 0x00, 0x4c, 0xa7, 0x00, 0x01, 0x0d, 0x03, 0x01, 0x5a, 1750x65, 0x2e, 0x00, 0x4c, 0xa7, 0x00, 0x02, 0x0d, 0x03, 0x10,
1760x04, 0x16, 0x61, 0xa1, 0x00, 0x23, 0x65, 0x64, 0xe2, 0x00, 1760x6f, 0x0b, 0x03, 0x05, 0xa1, 0x00, 0x24, 0x65, 0x64, 0xe2,
1770x02, 0x7a, 0x00, 0x20, 0x75, 0x6e, 0xf9, 0x00, 0x04, 0xb6, 1770x00, 0x01, 0x7a, 0x00, 0x21, 0x75, 0x6e, 0xf9, 0x00, 0x03,
1780x00, 0x40, 0x72, 0x65, 0x73, 0x74, 0x2e, 0x07, 0x11, 0x79, 1780xb6, 0x00, 0x40, 0x72, 0x65, 0x73, 0x74, 0x2e, 0x07, 0x11,
1790x59, 0x08, 0x50, 0x62, 0x69, 0x6c, 0x69, 0x74, 0xcd, 0x01, 1790x79, 0x59, 0x08, 0x51, 0x62, 0x69, 0x6c, 0x69, 0x74, 0xcd,
1800x03, 0x81, 0x00, 0x00, 0xf4, 0x00, 0x00, 0xd4, 0x08, 0x03, 1800x01, 0x02, 0x81, 0x00, 0x01, 0xf4, 0x00, 0x02, 0xd4, 0x08,
1810x32, 0x01, 0x84, 0x61, 0x6c, 0x73, 0x6f, 0x00, 0x75, 0x73, 1810x00, 0x32, 0x01, 0x50, 0x61, 0x6c, 0x73, 0x6f, 0x00, 0xda,
1820x65, 0xde, 0x02, 0x85, 0x73, 0x6f, 0x72, 0x00, 0x6b, 0x65, 1820x03, 0x03, 0xde, 0x02, 0x85, 0x73, 0x6f, 0x72, 0x00, 0x6b,
1830x79, 0x73, 0x57, 0x04, 0x61, 0x61, 0x72, 0x6f, 0x75, 0x6e, 1830x65, 0x79, 0x73, 0x57, 0x04, 0x61, 0x61, 0x72, 0x6f, 0x75,
1840x64, 0x1f, 0x00, 0xf8, 0x01, 0x67, 0x72, 0x69, 0x64, 0x3a, 1840x6e, 0x64, 0x1f, 0x00, 0xf9, 0x01, 0x67, 0x72, 0x69, 0x64,
1850x00, 0x69, 0x66, 0x00, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 1850x3a, 0x00, 0x69, 0x66, 0x00, 0x70, 0x6f, 0x73, 0x73, 0x69,
1860x6c, 0x35, 0x00, 0x03, 0x8d, 0x03, 0x52, 0x6c, 0x77, 0x61, 1860x62, 0x6c, 0x35, 0x00, 0x02, 0x8d, 0x03, 0x52, 0x6c, 0x77,
1870x79, 0x73, 0x39, 0x00, 0x80, 0x6f, 0x72, 0x74, 0x68, 0x6f, 1870x61, 0x79, 0x73, 0x39, 0x00, 0x80, 0x6f, 0x72, 0x74, 0x68,
1880x67, 0x6f, 0x6e, 0xfd, 0x00, 0x12, 0x2c, 0xc2, 0x04, 0x62, 1880x6f, 0x67, 0x6f, 0x6e, 0xfd, 0x00, 0x12, 0x2c, 0xc2, 0x04,
1890x77, 0x69, 0x73, 0x65, 0x00, 0x69, 0xb9, 0x03, 0x01, 0x25, 1890x63, 0x77, 0x69, 0x73, 0x65, 0x00, 0x69, 0xb9, 0x03, 0x02,
1900x00, 0x07, 0x17, 0x05, 0x02, 0x5c, 0x04, 0x24, 0x65, 0x73, 1900xb5, 0x04, 0x07, 0x17, 0x05, 0x00, 0x5c, 0x04, 0x24, 0x65,
1910x3c, 0x08, 0x04, 0xfb, 0x04, 0x50, 0x69, 0x6e, 0x64, 0x69, 1910x73, 0x3c, 0x08, 0x04, 0xfb, 0x04, 0x51, 0x69, 0x6e, 0x64,
1920x63, 0x8b, 0x06, 0x06, 0x30, 0x04, 0x60, 0x2e, 0x00, 0x48, 1920x69, 0x63, 0x8b, 0x06, 0x05, 0x30, 0x04, 0x60, 0x2e, 0x00,
1930x6f, 0x6c, 0x64, 0x1c, 0x01, 0x12, 0x43, 0xb8, 0x05, 0x00, 1930x48, 0x6f, 0x6c, 0x64, 0x1c, 0x01, 0x12, 0x43, 0xb8, 0x05,
1940xf7, 0x00, 0x01, 0x16, 0x04, 0x11, 0x73, 0x31, 0x01, 0x07, 1940x01, 0xf7, 0x00, 0x00, 0x16, 0x04, 0x11, 0x73, 0x31, 0x01,
1950xc8, 0x00, 0x02, 0x6b, 0x00, 0x35, 0x6c, 0x61, 0x79, 0x15, 1950x07, 0xc8, 0x00, 0x02, 0x6b, 0x00, 0x37, 0x6c, 0x61, 0x79,
1960x03, 0x04, 0xa3, 0x08, 0x07, 0x03, 0x05, 0x90, 0x28, 0x69, 1960x49, 0x04, 0x03, 0xa3, 0x08, 0x06, 0x03, 0x05, 0x90, 0x28,
1970x66, 0x00, 0x61, 0x76, 0x61, 0x69, 0x6c, 0xe1, 0x07, 0x71, 1970x69, 0x66, 0x00, 0x61, 0x76, 0x61, 0x69, 0x6c, 0xe1, 0x07,
1980x29, 0x3b, 0x00, 0x53, 0x68, 0x69, 0x66, 0x4b, 0x01, 0x0f, 1980x73, 0x29, 0x3b, 0x00, 0x53, 0x68, 0x69, 0x66, 0x01, 0x02,
1990x4b, 0x00, 0x03, 0x04, 0x11, 0x03, 0x1c, 0x00, 0x12, 0x03, 1990x0f, 0x4b, 0x00, 0x04, 0x01, 0x11, 0x03, 0x1c, 0x00, 0x12,
2000x13, 0x50, 0x82, 0x00, 0x02, 0xa2, 0x02, 0x40, 0x65, 0x74, 2000x03, 0x14, 0x50, 0x82, 0x00, 0x01, 0xa2, 0x02, 0x40, 0x65,
2010x75, 0x72, 0x40, 0x05, 0x00, 0x8a, 0x07, 0x41, 0x6c, 0x6c, 2010x74, 0x75, 0x72, 0x40, 0x05, 0x00, 0x8a, 0x07, 0x42, 0x6c,
2020x6f, 0x77, 0x83, 0x02, 0x0e, 0x52, 0x00, 0x01, 0x82, 0x01, 2020x6c, 0x6f, 0x77, 0x83, 0x02, 0x0e, 0x52, 0x00, 0x01, 0x82,
2030x0f, 0xa2, 0x00, 0x0c, 0x01, 0xb1, 0x01, 0x08, 0xe3, 0x02, 2030x01, 0x0f, 0xa2, 0x00, 0x0b, 0x08, 0xb1, 0x01, 0x01, 0xea,
2040x2f, 0x61, 0x6e, 0xe2, 0x02, 0x04, 0x18, 0x70, 0x83, 0x00, 2040x01, 0x2f, 0x61, 0x6e, 0xe2, 0x02, 0x04, 0x18, 0x70, 0x83,
2050x20, 0x73, 0x70, 0xc7, 0x06, 0x66, 0x62, 0x61, 0x72, 0x00, 2050x00, 0x20, 0x73, 0x70, 0xc7, 0x06, 0x30, 0x62, 0x61, 0x72,
2060x6f, 0x72, 0x1d, 0x00, 0x0e, 0xa0, 0x00, 0x51, 0x74, 0x77, 2060xf9, 0x09, 0x0c, 0x1d, 0x00, 0x07, 0xa0, 0x00, 0x51, 0x74,
2070x69, 0x63, 0x65, 0xa1, 0x07, 0x06, 0x24, 0x00, 0x04, 0xa1, 2070x77, 0x69, 0x63, 0x65, 0xa1, 0x07, 0x07, 0x24, 0x00, 0x04,
2080x0a, 0x01, 0xa9, 0x00, 0x06, 0x61, 0x03, 0x7e, 0x6a, 0x75, 2080xa1, 0x0a, 0x00, 0x22, 0x00, 0x06, 0x61, 0x03, 0x45, 0x6a,
2090x6d, 0x70, 0x00, 0x74, 0x6f, 0xb0, 0x01, 0x02, 0xef, 0x03, 2090x75, 0x6d, 0x70, 0xfb, 0x09, 0x0a, 0xb0, 0x01, 0x01, 0xef,
2100x01, 0xb8, 0x00, 0x05, 0xda, 0x0a, 0xf0, 0x0c, 0x4c, 0x65, 2100x03, 0x02, 0x95, 0x08, 0x03, 0xda, 0x0a, 0xf0, 0x0c, 0x4c,
2110x74, 0x74, 0x65, 0x72, 0x73, 0x00, 0x60, 0x61, 0x27, 0x2c, 2110x65, 0x74, 0x74, 0x65, 0x72, 0x73, 0x00, 0x60, 0x61, 0x27,
2120x00, 0x2e, 0x2e, 0x2e, 0x2c, 0x00, 0x60, 0x66, 0x27, 0x00, 2120x2c, 0x00, 0x2e, 0x2e, 0x2e, 0x2c, 0x00, 0x60, 0x66, 0x27,
2130x63, 0x6f, 0x75, 0x6e, 0x74, 0xb8, 0x00, 0x23, 0x31, 0x30, 2130x00, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0xb8, 0x00, 0x23, 0x31,
2140x16, 0x00, 0x21, 0x31, 0x35, 0x6d, 0x01, 0x31, 0x60, 0x30, 2140x30, 0x16, 0x00, 0x21, 0x31, 0x35, 0x6d, 0x01, 0x31, 0x60,
2150x27, 0x17, 0x00, 0x10, 0x36, 0x8b, 0x00, 0x51, 0x56, 0x69, 2150x30, 0x27, 0x17, 0x00, 0x10, 0x36, 0x8b, 0x00, 0x51, 0x56,
2160x6f, 0x6c, 0x61, 0x1d, 0x06, 0x03, 0x21, 0x05, 0x02, 0x5c, 2160x69, 0x6f, 0x6c, 0x61, 0x1d, 0x06, 0x03, 0x21, 0x05, 0x04,
2170x08, 0x03, 0x75, 0x05, 0x04, 0x71, 0x03, 0x02, 0x7b, 0x01, 2170x5c, 0x08, 0x02, 0x75, 0x05, 0x04, 0x71, 0x03, 0x01, 0x7b,
2180x10, 0x64, 0x32, 0x01, 0x42, 0x72, 0x65, 0x64, 0x3a, 0xe7, 2180x01, 0x10, 0x64, 0x32, 0x01, 0x42, 0x72, 0x65, 0x64, 0x3a,
2190x09, 0x1a, 0x6e, 0x92, 0x00, 0x27, 0x6f, 0x6f, 0xef, 0x05, 2190xe7, 0x09, 0x1a, 0x6e, 0x92, 0x00, 0x2a, 0x6f, 0x6f, 0xef,
2200x06, 0x3b, 0x00, 0x06, 0x4d, 0x03, 0x05, 0x40, 0x00, 0x1f, 2200x05, 0x04, 0x3b, 0x00, 0x09, 0x4d, 0x03, 0x01, 0x40, 0x00,
2210x2e, 0x40, 0x00, 0x05, 0x3f, 0x66, 0x65, 0x77, 0x3f, 0x00, 2210x1f, 0x2e, 0x40, 0x00, 0x05, 0x3f, 0x66, 0x65, 0x77, 0x3f,
2220x10, 0x31, 0x00, 0x69, 0x66, 0xdf, 0x06, 0x08, 0x98, 0x05, 2220x00, 0x10, 0x00, 0x1a, 0x03, 0x00, 0xdf, 0x06, 0x09, 0x98,
2230x00, 0xaa, 0x01, 0xf3, 0x00, 0x65, 0x72, 0x72, 0x6f, 0x72, 2230x05, 0xf3, 0x03, 0x61, 0x6e, 0x00, 0x65, 0x72, 0x72, 0x6f,
2240x00, 0x28, 0x61, 0x73, 0x00, 0x6f, 0x70, 0x70, 0x6f, 0x73, 2240x72, 0x00, 0x28, 0x61, 0x73, 0x00, 0x6f, 0x70, 0x70, 0x6f,
2250xb3, 0x07, 0x51, 0x65, 0x72, 0x65, 0x6c, 0x79, 0xfd, 0x07, 2250x73, 0xb3, 0x07, 0x20, 0x65, 0x72, 0x1f, 0x00, 0x00, 0xb4,
2260x56, 0x62, 0x65, 0x69, 0x6e, 0x67, 0xc6, 0x01, 0x41, 0x79, 2260x05, 0x20, 0x62, 0x65, 0x70, 0x01, 0x05, 0xc6, 0x01, 0x41,
2270x65, 0x74, 0x29, 0x66, 0x03, 0x20, 0x61, 0x64, 0xe4, 0x02, 2270x79, 0x65, 0x74, 0x29, 0x66, 0x03, 0x21, 0x61, 0x64, 0xe4,
2280x03, 0xca, 0x07, 0x06, 0x80, 0x00, 0x44, 0x6f, 0x75, 0x6c, 2280x02, 0x03, 0xca, 0x07, 0x05, 0x80, 0x00, 0x45, 0x6f, 0x75,
2290x64, 0x6d, 0x0a, 0x00, 0x4b, 0x05, 0x01, 0xd1, 0x01, 0x11, 2290x6c, 0x64, 0x6d, 0x0a, 0x31, 0x68, 0x61, 0x76, 0xd1, 0x01,
2300x6f, 0xfa, 0x0a, 0x0b, 0xf8, 0x0a, 0x00, 0x84, 0x03, 0x05, 2300x12, 0x6f, 0xfa, 0x0a, 0x0b, 0xf8, 0x0a, 0x00, 0xf8, 0x01,
2310x6a, 0x06, 0x16, 0x00, 0xc4, 0x05, 0x03, 0xb1, 0x02, 0x10, 2310x04, 0x6a, 0x06, 0x16, 0x00, 0xc4, 0x05, 0x03, 0xb1, 0x02,
2320x2c, 0x1f, 0x00, 0x28, 0x69, 0x66, 0x30, 0x05, 0x20, 0x68, 2320x10, 0x2c, 0x1f, 0x00, 0x28, 0x69, 0x66, 0x30, 0x05, 0x20,
2330x61, 0x0f, 0x07, 0x29, 0x65, 0x6e, 0xde, 0x00, 0x01, 0xae, 2330x68, 0x61, 0x0f, 0x07, 0x29, 0x65, 0x6e, 0xde, 0x00, 0x01,
2340x09, 0x54, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x49, 0x0b, 0x66, 2340xae, 0x09, 0x54, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x49, 0x0b,
2350x00, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x09, 0x0d, 0x01, 0xb7, 2350x68, 0x00, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x09, 0x0d, 0x01,
2360x05, 0x08, 0x7d, 0x0a, 0x0f, 0x21, 0x01, 0x0c, 0x00, 0x06, 2360x55, 0x0a, 0x07, 0x7d, 0x0a, 0x0f, 0x21, 0x01, 0x0c, 0x41,
2370x03, 0x11, 0x6c, 0x0a, 0x01, 0x6a, 0x73, 0x75, 0x62, 0x73, 2370x61, 0x00, 0x63, 0x6c, 0x0a, 0x01, 0x33, 0x73, 0x75, 0x62,
2380x65, 0x74, 0xe3, 0x01, 0x02, 0x78, 0x01, 0x20, 0x6e, 0x6f, 2380x53, 0x0d, 0x07, 0xe3, 0x01, 0x01, 0x78, 0x01, 0x24, 0x6e,
2390x85, 0x06, 0x07, 0x12, 0x0d, 0x02, 0x46, 0x09, 0x03, 0xbc, 2390x6f, 0x85, 0x06, 0x04, 0x12, 0x0d, 0x02, 0x39, 0x0b, 0x02,
2400x02, 0x10, 0x73, 0x34, 0x00, 0x08, 0xce, 0x0b, 0x90, 0x2e, 2400xbc, 0x02, 0x15, 0x73, 0x34, 0x00, 0x03, 0x82, 0x00, 0x90,
2410x00, 0x46, 0x6f, 0x72, 0x00, 0x65, 0x78, 0x61, 0xa9, 0x00, 2410x2e, 0x00, 0x46, 0x6f, 0x72, 0x00, 0x65, 0x78, 0x61, 0xa9,
2420x31, 0x2c, 0x00, 0x69, 0x9b, 0x06, 0x03, 0x42, 0x03, 0x23, 2420x00, 0x32, 0x2c, 0x00, 0x69, 0x9b, 0x06, 0x02, 0x42, 0x03,
2430x6c, 0x79, 0x44, 0x00, 0x02, 0x3e, 0x07, 0x1b, 0x31, 0x51, 2430x26, 0x6c, 0x79, 0x56, 0x0d, 0x4c, 0x77, 0x6f, 0x00, 0x31,
2440x0d, 0x05, 0x79, 0x03, 0x00, 0xc6, 0x00, 0x06, 0x6a, 0x06, 2440x51, 0x0d, 0x05, 0x79, 0x03, 0x01, 0x77, 0x04, 0x04, 0x6a,
2450x21, 0x6e, 0x6f, 0x77, 0x06, 0x01, 0x6a, 0x09, 0x09, 0x76, 2450x06, 0x22, 0x6e, 0x6f, 0x85, 0x0d, 0x01, 0x6a, 0x09, 0x08,
2460x07, 0x25, 0x6f, 0x6e, 0x0e, 0x05, 0x00, 0xe7, 0x07, 0x04, 2460x76, 0x07, 0x25, 0x6f, 0x6e, 0x0e, 0x05, 0x01, 0xe7, 0x07,
2470xc8, 0x03, 0x02, 0x3a, 0x06, 0x41, 0x75, 0x70, 0x00, 0x72, 2470x04, 0x1a, 0x04, 0x01, 0x3a, 0x06, 0x43, 0x75, 0x70, 0x00,
2480xe2, 0x01, 0x05, 0xb9, 0x04, 0x01, 0x14, 0x03, 0x03, 0xa9, 2480x72, 0x20, 0x06, 0x03, 0xb9, 0x04, 0x02, 0x14, 0x03, 0x03,
2490x0d, 0x02, 0x39, 0x01, 0x00, 0x4a, 0x03, 0x02, 0xf9, 0x01, 2490xa9, 0x0d, 0x02, 0x39, 0x01, 0x32, 0x63, 0x61, 0x6e, 0xf9,
2500x04, 0x10, 0x0e, 0x01, 0x23, 0x01, 0x01, 0x18, 0x06, 0xa4, 2500x01, 0x04, 0x10, 0x0e, 0x02, 0x23, 0x01, 0x00, 0xa6, 0x02,
2510x76, 0x61, 0x6c, 0x69, 0x64, 0x00, 0x73, 0x6f, 0x6c, 0x75, 2510xa4, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x00, 0x73, 0x6f, 0x6c,
2520xf9, 0x03, 0x46, 0x2d, 0x00, 0x49, 0x66, 0x37, 0x07, 0x30, 2520x75, 0xf9, 0x03, 0x14, 0x2d, 0x68, 0x07, 0x01, 0x37, 0x07,
2530x73, 0x65, 0x6c, 0x82, 0x06, 0x02, 0x91, 0x05, 0x10, 0x28, 2530x33, 0x73, 0x65, 0x6c, 0x82, 0x06, 0x40, 0x68, 0x65, 0x00,
2540xd4, 0x01, 0x04, 0x73, 0x08, 0x33, 0x00, 0x6f, 0x70, 0xd1, 2540x28, 0xd4, 0x01, 0x04, 0x73, 0x08, 0x34, 0x00, 0x6f, 0x70,
2550x09, 0x00, 0x97, 0x0e, 0x10, 0x61, 0x73, 0x04, 0x01, 0xfd, 2550xd1, 0x09, 0x40, 0x64, 0x69, 0x73, 0x61, 0x73, 0x04, 0x01,
2560x0b, 0x13, 0x73, 0x34, 0x07, 0x05, 0x55, 0x00, 0x14, 0x2c, 2560xfd, 0x0b, 0x15, 0x73, 0xd9, 0x07, 0x03, 0x55, 0x00, 0x15,
2570x88, 0x00, 0x07, 0x32, 0x0c, 0x02, 0xc4, 0x0c, 0x01, 0x34, 2570x2c, 0x88, 0x00, 0x07, 0x32, 0x0c, 0x02, 0xc4, 0x0c, 0x00,
2580x0c, 0x13, 0x73, 0x35, 0x0c, 0x0e, 0xea, 0x02, 0x02, 0x22, 2580x34, 0x0c, 0x14, 0x73, 0x35, 0x0c, 0x0e, 0xea, 0x02, 0x01,
2590x03, 0x13, 0x28, 0x48, 0x0d, 0x03, 0xd0, 0x08, 0x00, 0xee, 2590x22, 0x03, 0x14, 0x28, 0x48, 0x0d, 0x02, 0xd0, 0x08, 0x00,
2600x02, 0x52, 0x73, 0x63, 0x72, 0x69, 0x62, 0xc4, 0x00, 0x13, 2600xee, 0x02, 0x52, 0x73, 0x63, 0x72, 0x69, 0x62, 0xc4, 0x00,
2610x73, 0x54, 0x05, 0x33, 0x32, 0x2e, 0x31, 0x75, 0x09, 0x26, 2610x13, 0x73, 0x54, 0x05, 0x33, 0x32, 0x2e, 0x31, 0x75, 0x09,
2620x73, 0x6f, 0x5d, 0x05, 0x13, 0x2e, 0x7a, 0x0b, 0x15, 0x32, 2620x26, 0x73, 0x6f, 0x5d, 0x05, 0x13, 0x2e, 0x7a, 0x0b, 0x15,
2630x7a, 0x0b, 0x00, 0xb3, 0x09, 0x20, 0x6d, 0x65, 0x27, 0x04, 2630x32, 0x7a, 0x0b, 0x00, 0xb3, 0x09, 0x20, 0x6d, 0x65, 0x27,
2640x12, 0x20, 0x79, 0x0d, 0x35, 0x73, 0x65, 0x00, 0x14, 0x00, 2640x04, 0x12, 0x20, 0x79, 0x0d, 0x36, 0x73, 0x65, 0x00, 0x14,
2650x01, 0xa4, 0x0d, 0x06, 0x3e, 0x00, 0x01, 0x55, 0x07, 0x01, 2650x00, 0x02, 0x43, 0x00, 0x04, 0x3e, 0x00, 0x02, 0x55, 0x07,
2660x7b, 0x00, 0xb3, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 2660x00, 0x7b, 0x00, 0xb4, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f,
2670x2e, 0x2e, 0x2e, 0x27, 0xf7, 0x00, 0x04, 0x96, 0x01, 0x40, 2670x6d, 0x2e, 0x2e, 0x2e, 0x27, 0xf7, 0x00, 0x03, 0x96, 0x01,
2680x60, 0x54, 0x79, 0x70, 0x93, 0x05, 0x30, 0x65, 0x6e, 0x75, 2680x40, 0x60, 0x54, 0x79, 0x70, 0x93, 0x05, 0x30, 0x65, 0x6e,
2690xad, 0x00, 0x91, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 2690x75, 0xad, 0x00, 0x91, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c,
2700x48, 0x65, 0x9d, 0x01, 0x50, 0x00, 0x00, 0x53, 0x69, 0x7a, 2700x00, 0x48, 0x65, 0x9d, 0x01, 0x51, 0x00, 0x00, 0x53, 0x69,
2710x07, 0x0c, 0x00, 0xbd, 0x01, 0x02, 0xaf, 0x00, 0x42, 0x71, 2710x7a, 0x07, 0x0c, 0x00, 0xbd, 0x01, 0x01, 0xaf, 0x00, 0x42,
2720x75, 0x61, 0x72, 0xcc, 0x0c, 0xaa, 0x44, 0x69, 0x66, 0x66, 2720x71, 0x75, 0x61, 0x72, 0xcc, 0x0c, 0xaa, 0x44, 0x69, 0x66,
2730x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x0d, 0x00, 0x40, 0x6c, 2730x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x0d, 0x00, 0x41,
2740x65, 0x76, 0x65, 0xa6, 0x09, 0x02, 0x9e, 0x02, 0x01, 0x03, 2740x6c, 0x65, 0x76, 0x65, 0xa6, 0x09, 0x02, 0x9e, 0x02, 0x00,
2750x03, 0x10, 0x41, 0x5d, 0x01, 0x12, 0x20, 0x5d, 0x01, 0x12, 2750x2b, 0x00, 0x10, 0x41, 0x5d, 0x01, 0x12, 0x20, 0x5d, 0x01,
2760x00, 0x41, 0x08, 0x20, 0x69, 0x73, 0x1c, 0x10, 0x07, 0x03, 2760x12, 0x00, 0x41, 0x08, 0x21, 0x69, 0x73, 0x1c, 0x10, 0x06,
2770x0a, 0x01, 0x7d, 0x0a, 0x20, 0x63, 0x6c, 0x24, 0x05, 0x21, 2770x03, 0x0a, 0x01, 0x7d, 0x0a, 0x20, 0x63, 0x6c, 0x24, 0x05,
2780x64, 0x2c, 0x3c, 0x00, 0x08, 0xb8, 0x04, 0x50, 0x67, 0x65, 2780x23, 0x64, 0x2c, 0x3c, 0x00, 0x06, 0x3e, 0x04, 0x51, 0x67,
2790x6e, 0x65, 0x72, 0xd6, 0x06, 0x0a, 0xc5, 0x0f, 0x0a, 0xed, 2790x65, 0x6e, 0x65, 0x72, 0xd6, 0x06, 0x0e, 0xc5, 0x0f, 0x06,
2800x08, 0x03, 0x4f, 0x07, 0x01, 0xb9, 0x01, 0x13, 0x62, 0x18, 2800x83, 0x02, 0x03, 0x4f, 0x07, 0x00, 0xb9, 0x01, 0x13, 0x62,
2810x03, 0x00, 0x49, 0x0b, 0x31, 0x63, 0x72, 0x65, 0x9b, 0x0f, 2810x18, 0x03, 0x00, 0x49, 0x0b, 0x33, 0x63, 0x72, 0x65, 0x9b,
2820x03, 0xa9, 0x01, 0x00, 0x87, 0x08, 0x06, 0x33, 0x02, 0x04, 2820x0f, 0x01, 0xa9, 0x01, 0x02, 0x87, 0x08, 0x04, 0xde, 0x01,
2830xcb, 0x01, 0x24, 0x64, 0x6f, 0x25, 0x04, 0x0b, 0xd0, 0x01, 2830x04, 0xcb, 0x01, 0x25, 0x64, 0x6f, 0x25, 0x04, 0x0b, 0xd0,
2840x05, 0x1e, 0x02, 0x02, 0xcf, 0x01, 0x64, 0x4d, 0x61, 0x78, 2840x01, 0x04, 0x1e, 0x02, 0x02, 0xcf, 0x01, 0x64, 0x4d, 0x61,
2850x2e, 0x20, 0x62, 0x8e, 0x01, 0x35, 0x65, 0x72, 0x20, 0x76, 2850x78, 0x2e, 0x20, 0x62, 0x8e, 0x01, 0x36, 0x65, 0x72, 0x20,
2860x06, 0x02, 0x1d, 0x00, 0x4e, 0x69, 0x6d, 0x75, 0x6d, 0x22, 2860x18, 0x07, 0x01, 0x1d, 0x00, 0x4e, 0x69, 0x6d, 0x75, 0x6d,
2870x10, 0x03, 0xaf, 0x02, 0x00, 0xab, 0x01, 0x10, 0x74, 0x28, 2870x22, 0x10, 0x04, 0xaf, 0x02, 0x20, 0x70, 0x61, 0x4f, 0x10,
2880x01, 0x28, 0x61, 0x72, 0xae, 0x06, 0x15, 0x54, 0x2b, 0x0e, 2880x48, 0x75, 0x6c, 0x61, 0x72, 0xae, 0x06, 0x17, 0x54, 0x2b,
2890x01, 0xee, 0x03, 0x11, 0x32, 0xc6, 0x0f, 0x04, 0x44, 0x06, 2890x0e, 0x42, 0x69, 0x73, 0x00, 0x32, 0xc6, 0x0f, 0x04, 0x44,
2900x02, 0x21, 0x0f, 0x13, 0x65, 0xcf, 0x03, 0x40, 0x31, 0x2c, 2900x06, 0x01, 0x21, 0x0f, 0x13, 0x65, 0xcf, 0x03, 0x40, 0x31,
2910x00, 0x33, 0x88, 0x04, 0x53, 0x34, 0x2e, 0x00, 0x49, 0x6e, 2910x2c, 0x00, 0x33, 0x88, 0x04, 0x53, 0x34, 0x2e, 0x00, 0x49,
2920x17, 0x01, 0x20, 0x6c, 0x2c, 0x72, 0x05, 0x21, 0x65, 0x72, 2920x6e, 0x17, 0x01, 0x20, 0x6c, 0x2c, 0x72, 0x05, 0x21, 0x65,
2930x6d, 0x10, 0x32, 0x61, 0x73, 0x69, 0x6e, 0x0a, 0x82, 0x25, 2930x72, 0x6d, 0x10, 0x32, 0x61, 0x73, 0x69, 0x6e, 0x0a, 0x82,
2940x61, 0x67, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x87, 0x03, 0x12, 2940x25, 0x61, 0x67, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x87, 0x03,
2950x20, 0xba, 0x01, 0x00, 0x80, 0x01, 0x40, 0x47, 0x69, 0x76, 2950x13, 0x20, 0xba, 0x01, 0x70, 0x00, 0x00, 0x00, 0x47, 0x69,
2960x65, 0xb5, 0x02, 0x10, 0x72, 0x28, 0x05, 0x00, 0xb3, 0x0b, 2960x76, 0x65, 0xb5, 0x02, 0x11, 0x72, 0x28, 0x05, 0x40, 0x70,
2970x10, 0x63, 0x73, 0x09, 0x28, 0x67, 0x65, 0xa0, 0x04, 0x25, 2970x65, 0x72, 0x63, 0x73, 0x09, 0x28, 0x67, 0x65, 0xa0, 0x04,
2980x74, 0x68, 0x74, 0x01, 0x04, 0xac, 0x08, 0x31, 0x74, 0x72, 2980x25, 0x74, 0x68, 0x74, 0x01, 0x04, 0xac, 0x08, 0x31, 0x74,
2990x79, 0x39, 0x01, 0x11, 0x6c, 0xaf, 0x04, 0x34, 0x66, 0x6f, 2990x72, 0x79, 0x39, 0x01, 0x11, 0x6c, 0xaf, 0x04, 0x34, 0x66,
3000x72, 0xbb, 0x0a, 0x03, 0x22, 0x07, 0x05, 0xf0, 0x01, 0x30, 3000x6f, 0x72, 0xbb, 0x0a, 0x05, 0xbc, 0x0f, 0x03, 0xf0, 0x01,
3010x43, 0x65, 0x72, 0xa4, 0x03, 0x00, 0x29, 0x00, 0x32, 0x6f, 3010x30, 0x43, 0x65, 0x72, 0xa4, 0x03, 0x00, 0x29, 0x00, 0x33,
3020x75, 0x74, 0xc4, 0x01, 0x00, 0x1e, 0x04, 0x00, 0x57, 0x06, 3020x6f, 0x75, 0x74, 0xc4, 0x01, 0x00, 0xc0, 0x03, 0x30, 0x6d,
3030x00, 0x67, 0x00, 0x11, 0x74, 0xbf, 0x07, 0x03, 0xa8, 0x05, 3030x61, 0x6e, 0x67, 0x00, 0x12, 0x74, 0xbf, 0x07, 0x03, 0xa8,
3040x04, 0x72, 0x00, 0x32, 0x3b, 0x00, 0x74, 0x17, 0x02, 0x00, 3040x05, 0x03, 0x72, 0x00, 0x12, 0x3b, 0xca, 0x0c, 0x10, 0x69,
3050x02, 0x06, 0x30, 0x75, 0x70, 0x70, 0x94, 0x05, 0x22, 0x6f, 3050x1b, 0x05, 0x40, 0x00, 0x75, 0x70, 0x70, 0x94, 0x05, 0x22,
3060x75, 0x13, 0x11, 0xf0, 0x03, 0x45, 0x78, 0x70, 0x61, 0x6e, 3060x6f, 0x75, 0x13, 0x11, 0xf0, 0x03, 0x45, 0x78, 0x70, 0x61,
3070x73, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x61, 0x63, 0x74, 0x6f, 3070x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x61, 0x63, 0x74,
3080x72, 0x20, 0x28, 0xdc, 0x00, 0x10, 0x29, 0x4b, 0x02, 0x03, 3080x6f, 0x72, 0x20, 0x28, 0xdc, 0x00, 0x12, 0x29, 0x00, 0x03,
3090x58, 0x04, 0x08, 0xac, 0x00, 0x41, 0x6f, 0x72, 0x6b, 0x73, 3090x02, 0x9b, 0x02, 0x07, 0xac, 0x00, 0x41, 0x6f, 0x72, 0x6b,
3100xbe, 0x07, 0x02, 0x10, 0x0a, 0x01, 0x52, 0x06, 0x39, 0x78, 3100x73, 0xbe, 0x07, 0x04, 0x10, 0x0a, 0x69, 0x6e, 0x00, 0x65,
3110x69, 0x73, 0x7d, 0x0d, 0xf8, 0x05, 0x74, 0x00, 0x72, 0x61, 3110x78, 0x69, 0x73, 0x7d, 0x0d, 0xf8, 0x05, 0x74, 0x00, 0x72,
3120x6e, 0x64, 0x6f, 0x6d, 0x00, 0x28, 0x61, 0x66, 0x74, 0x65, 3120x61, 0x6e, 0x64, 0x6f, 0x6d, 0x00, 0x28, 0x61, 0x66, 0x74,
3130x72, 0x00, 0x66, 0x69, 0x72, 0x73, 0x28, 0x02, 0x20, 0x6e, 3130x65, 0x72, 0x00, 0x66, 0x69, 0x72, 0x73, 0x28, 0x02, 0x20,
3140x00, 0x90, 0x06, 0x33, 0x69, 0x61, 0x6c, 0x32, 0x00, 0x01, 3140x6e, 0x00, 0x90, 0x06, 0x34, 0x69, 0x61, 0x6c, 0x32, 0x00,
3150x7f, 0x10, 0x10, 0x77, 0x1a, 0x0d, 0x41, 0x29, 0x2e, 0x00, 3150x00, 0x7f, 0x10, 0x10, 0x77, 0x1a, 0x0d, 0x41, 0x29, 0x2e,
3160x49, 0x72, 0x02, 0x40, 0x6e, 0x00, 0x64, 0x65, 0xae, 0x0a, 3160x00, 0x49, 0x72, 0x02, 0x40, 0x6e, 0x00, 0x64, 0x65, 0xae,
3170x11, 0x73, 0x6b, 0x0a, 0x08, 0x1e, 0x09, 0x05, 0x5e, 0x00, 3170x0a, 0x12, 0x73, 0x6b, 0x0a, 0x07, 0x1e, 0x09, 0x05, 0x5e,
3180x24, 0x29, 0x2c, 0x22, 0x05, 0x11, 0x6e, 0x97, 0x00, 0x02, 3180x00, 0x24, 0x29, 0x2c, 0x22, 0x05, 0x13, 0x6e, 0x97, 0x00,
3190xd7, 0x0d, 0x30, 0x68, 0x6f, 0x77, 0x72, 0x0e, 0x00, 0xd0, 3190x00, 0x8e, 0x02, 0x31, 0x68, 0x6f, 0x77, 0x72, 0x0e, 0x41,
3200x01, 0x11, 0x63, 0x9c, 0x06, 0x20, 0x65, 0x78, 0x6c, 0x0e, 3200x69, 0x74, 0x00, 0x63, 0x9c, 0x06, 0x20, 0x65, 0x78, 0x6c,
3210x03, 0x54, 0x01, 0x08, 0x85, 0x00, 0x08, 0xc6, 0x0e, 0x02, 3210x0e, 0x04, 0x54, 0x01, 0x07, 0x85, 0x00, 0x08, 0xc6, 0x0e,
3220x78, 0x0b, 0x06, 0xeb, 0x03, 0x32, 0x00, 0x64, 0x65, 0x75, 3220x03, 0x78, 0x0b, 0x05, 0xeb, 0x03, 0x32, 0x00, 0x64, 0x65,
3230x12, 0x21, 0x65, 0x73, 0x52, 0x00, 0x50, 0x6c, 0x69, 0x6b, 3230x75, 0x12, 0x21, 0x65, 0x73, 0x52, 0x00, 0x50, 0x6c, 0x69,
3240x65, 0x6c, 0xad, 0x0a, 0x02, 0x17, 0x13, 0x04, 0x55, 0x00, 3240x6b, 0x65, 0x6c, 0xad, 0x0a, 0x03, 0x17, 0x13, 0x03, 0x55,
3250x21, 0x61, 0x73, 0x6c, 0x00, 0x21, 0x61, 0x73, 0x6f, 0x00, 3250x00, 0x21, 0x61, 0x73, 0x6c, 0x00, 0x21, 0x61, 0x73, 0x6f,
3260x66, 0x61, 0x6e, 0x2c, 0x00, 0x72, 0x61, 0x40, 0x11, 0x40, 3260x00, 0x66, 0x61, 0x6e, 0x2c, 0x00, 0x72, 0x61, 0x40, 0x11,
3270x63, 0x68, 0x6f, 0x6f, 0xbd, 0x08, 0x06, 0xdf, 0x00, 0x01, 3270x41, 0x63, 0x68, 0x6f, 0x6f, 0xbd, 0x08, 0x05, 0xdf, 0x00,
3280x68, 0x06, 0x02, 0x40, 0x02, 0x64, 0x48, 0x69, 0x67, 0x68, 3280x02, 0x68, 0x06, 0x01, 0x40, 0x02, 0x64, 0x48, 0x69, 0x67,
3290x00, 0x65, 0x7b, 0x01, 0x12, 0x00, 0x7b, 0x01, 0x52, 0x73, 3290x68, 0x00, 0x65, 0x7b, 0x01, 0x12, 0x00, 0x7b, 0x01, 0x52,
3300x00, 0x75, 0x73, 0x75, 0x9f, 0x0b, 0x33, 0x65, 0x61, 0x6e, 3300x73, 0x00, 0x75, 0x73, 0x75, 0x9f, 0x0b, 0x33, 0x65, 0x61,
3310x6e, 0x02, 0x07, 0xae, 0x03, 0x22, 0x74, 0x68, 0x8b, 0x02, 3310x6e, 0x6e, 0x02, 0x07, 0xae, 0x03, 0x23, 0x74, 0x68, 0x8b,
3320x05, 0xf3, 0x0a, 0x06, 0xe0, 0x01, 0x3e, 0x6c, 0x6f, 0x77, 3320x02, 0x05, 0xf3, 0x0a, 0x05, 0xe0, 0x01, 0x00, 0x60, 0x05,
3330x4f, 0x00, 0x02, 0xe1, 0x02, 0x20, 0x72, 0x65, 0xf8, 0x05, 3330x0e, 0x4f, 0x00, 0x01, 0xe1, 0x02, 0x20, 0x72, 0x65, 0xf8,
3340x32, 0x6c, 0x6f, 0x74, 0xbd, 0x08, 0x00, 0x7c, 0x04, 0x61, 3340x05, 0x32, 0x6c, 0x6f, 0x74, 0xbd, 0x08, 0x00, 0x7c, 0x04,
3350x6c, 0x79, 0x2d, 0x70, 0x61, 0x63, 0xac, 0x08, 0x80, 0x73, 3350x73, 0x6c, 0x79, 0x2d, 0x70, 0x61, 0x63, 0x6b, 0xb9, 0x0b,
3360x6c, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x00, 3360x50, 0x6e, 0x64, 0x73, 0x2e, 0x00,
337}; 337};
338 338
339const unsigned short help_text_len = 5230; 339const unsigned short help_text_len = 5230;
diff --git a/apps/plugins/puzzles/help/cube.c b/apps/plugins/puzzles/help/cube.c
index 3d9137afe0..f8026a5946 100644
--- a/apps/plugins/puzzles/help/cube.c
+++ b/apps/plugins/puzzles/help/cube.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -14,148 +14,148 @@ struct style_text help_text_style[] = {
14 LAST_STYLE_ITEM 14 LAST_STYLE_ITEM
15}; 15};
16 16
17/* orig 2055 comp 1444 ratio 0.702676 level 11 saved 611 */ 17/* orig 2055 comp 1444 ratio 0.702676 level 10 saved 611 */
18const char help_text[] = { 18const char help_text[] = {
190xf1, 0x37, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 190xf2, 0x37, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
200x34, 0x3a, 0x20, 0x43, 0x75, 0x62, 0x65, 0x20, 0x00, 0x00, 200x34, 0x3a, 0x20, 0x43, 0x75, 0x62, 0x65, 0x20, 0x00, 0x00,
210x00, 0x54, 0x68, 0x69, 0x73, 0x00, 0x69, 0x73, 0x00, 0x61, 210x00, 0x54, 0x68, 0x69, 0x73, 0x00, 0x69, 0x73, 0x00, 0x61,
220x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x00, 0x6f, 0x6e, 0x65, 220x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x00, 0x6f, 0x6e, 0x65,
230x00, 0x49, 0x00, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 230x00, 0x49, 0x00, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61,
240x6c, 0x6c, 0x79, 0x00, 0x73, 0x61, 0x77, 0x00, 0x61, 0x73, 240x6c, 0x6c, 0x79, 0x00, 0x73, 0x61, 0x77, 0x00, 0x61, 0x73,
250x00, 0x61, 0x00, 0x77, 0x65, 0x62, 0x00, 0x67, 0x61, 0x6d, 250x00, 0x61, 0x00, 0x77, 0x65, 0x62, 0x00, 0x67, 0x61, 0x6d,
260x65, 0x2e, 0x34, 0x00, 0x01, 0x29, 0x00, 0x11, 0x77, 0x19, 260x65, 0x2e, 0x34, 0x00, 0x00, 0x29, 0x00, 0x11, 0x77, 0x19,
270x00, 0x41, 0x4a, 0x61, 0x76, 0x61, 0x1a, 0x00, 0xf0, 0x28, 270x00, 0x41, 0x4a, 0x61, 0x76, 0x61, 0x1a, 0x00, 0xf0, 0x28,
280x00, 0x5b, 0x32, 0x5d, 0x2c, 0x00, 0x62, 0x79, 0x00, 0x50, 280x00, 0x5b, 0x32, 0x5d, 0x2c, 0x00, 0x62, 0x79, 0x00, 0x50,
290x61, 0x75, 0x6c, 0x00, 0x53, 0x63, 0x6f, 0x74, 0x74, 0x2e, 290x61, 0x75, 0x6c, 0x00, 0x53, 0x63, 0x6f, 0x74, 0x74, 0x2e,
300x00, 0x59, 0x6f, 0x75, 0x00, 0x68, 0x61, 0x76, 0x65, 0x00, 300x00, 0x59, 0x6f, 0x75, 0x00, 0x68, 0x61, 0x76, 0x65, 0x00,
310x61, 0x00, 0x67, 0x72, 0x69, 0x64, 0x00, 0x6f, 0x66, 0x00, 310x61, 0x00, 0x67, 0x72, 0x69, 0x64, 0x00, 0x6f, 0x66, 0x00,
320x31, 0x36, 0x00, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x73, 320x31, 0x36, 0x00, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x73,
330x2c, 0x00, 0x73, 0x69, 0x78, 0x13, 0x00, 0xf0, 0x03, 0x77, 330x2c, 0x00, 0x73, 0x69, 0x78, 0x13, 0x00, 0xf1, 0x03, 0x77,
340x68, 0x69, 0x63, 0x68, 0x00, 0x61, 0x72, 0x65, 0x00, 0x62, 340x68, 0x69, 0x63, 0x68, 0x00, 0x61, 0x72, 0x65, 0x00, 0x62,
350x6c, 0x75, 0x65, 0x3b, 0x00, 0x6f, 0x6e, 0x61, 0x00, 0x03, 350x6c, 0x75, 0x65, 0x3b, 0x00, 0x6f, 0x6e, 0x61, 0x00, 0x02,
360x27, 0x00, 0x50, 0x00, 0x72, 0x65, 0x73, 0x74, 0x6a, 0x00, 360x27, 0x00, 0x50, 0x00, 0x72, 0x65, 0x73, 0x74, 0x6a, 0x00,
370x41, 0x63, 0x75, 0x62, 0x65, 0x52, 0x00, 0x60, 0x72, 0x00, 370x41, 0x63, 0x75, 0x62, 0x65, 0x52, 0x00, 0x60, 0x72, 0x00,
380x6d, 0x6f, 0x76, 0x65, 0xb8, 0x00, 0xf1, 0x05, 0x74, 0x6f, 380x6d, 0x6f, 0x76, 0x65, 0xb8, 0x00, 0xf1, 0x05, 0x74, 0x6f,
390x00, 0x75, 0x73, 0x65, 0x00, 0x74, 0x68, 0x65, 0x00, 0x61, 390x00, 0x75, 0x73, 0x65, 0x00, 0x74, 0x68, 0x65, 0x00, 0x61,
400x72, 0x72, 0x6f, 0x77, 0x00, 0x6b, 0x65, 0x79, 0x16, 0x00, 400x72, 0x72, 0x6f, 0x77, 0x00, 0x6b, 0x65, 0x79, 0x16, 0x00,
410x40, 0x72, 0x6f, 0x6c, 0x6c, 0x17, 0x00, 0x00, 0x35, 0x00, 410x41, 0x72, 0x6f, 0x6c, 0x6c, 0x17, 0x00, 0x00, 0x35, 0x00,
420x00, 0x20, 0x00, 0xf1, 0x0c, 0x72, 0x6f, 0x75, 0x67, 0x68, 420xf1, 0x0f, 0x00, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68,
430x00, 0x39, 0x30, 0x00, 0x64, 0x65, 0x67, 0x72, 0x65, 0x65, 430x00, 0x39, 0x30, 0x00, 0x64, 0x65, 0x67, 0x72, 0x65, 0x65,
440x73, 0x00, 0x73, 0x6f, 0x00, 0x74, 0x68, 0x61, 0x74, 0x00, 440x73, 0x00, 0x73, 0x6f, 0x00, 0x74, 0x68, 0x61, 0x74, 0x00,
450x69, 0x74, 0x4d, 0x00, 0x01, 0x35, 0x00, 0xb3, 0x61, 0x6e, 450x69, 0x74, 0x4d, 0x00, 0x01, 0x35, 0x00, 0xb3, 0x61, 0x6e,
460x00, 0x61, 0x64, 0x6a, 0x61, 0x63, 0x65, 0x6e, 0x74, 0x7c, 460x00, 0x61, 0x64, 0x6a, 0x61, 0x63, 0x65, 0x6e, 0x74, 0x7c,
470x00, 0x8b, 0x2e, 0x00, 0x49, 0x66, 0x00, 0x79, 0x6f, 0x75, 470x00, 0x8b, 0x2e, 0x00, 0x49, 0x66, 0x00, 0x79, 0x6f, 0x75,
480x50, 0x00, 0x21, 0x6f, 0x6e, 0x2f, 0x00, 0x00, 0xae, 0x00, 480x50, 0x00, 0x21, 0x6f, 0x6e, 0x2f, 0x00, 0x01, 0xae, 0x00,
490x04, 0xa6, 0x00, 0x10, 0x2c, 0x1e, 0x00, 0x07, 0x11, 0x00, 490x03, 0x2a, 0x00, 0x11, 0x2c, 0x1e, 0x00, 0x07, 0x11, 0x00,
500x01, 0x9f, 0x00, 0x94, 0x70, 0x69, 0x63, 0x6b, 0x65, 0x64, 500x00, 0x9f, 0x00, 0x94, 0x70, 0x69, 0x63, 0x6b, 0x65, 0x64,
510x00, 0x75, 0x70, 0xd2, 0x00, 0x75, 0x66, 0x61, 0x63, 0x65, 510x00, 0x75, 0x70, 0xd2, 0x00, 0x40, 0x66, 0x61, 0x63, 0x65,
520x00, 0x6f, 0x66, 0x4a, 0x00, 0x36, 0x3b, 0x00, 0x69, 0x60, 520xf1, 0x00, 0x04, 0x4a, 0x00, 0x37, 0x3b, 0x00, 0x69, 0x60,
530x00, 0x02, 0x51, 0x00, 0x05, 0x25, 0x00, 0x0e, 0x6f, 0x00, 530x00, 0x03, 0x51, 0x00, 0x0c, 0x25, 0x00, 0x05, 0x6f, 0x00,
540x4f, 0x6e, 0x6f, 0x6e, 0x2d, 0x73, 0x00, 0x02, 0x41, 0x6e, 540x4f, 0x6e, 0x6f, 0x6e, 0x2d, 0x73, 0x00, 0x02, 0x41, 0x6e,
550x65, 0x73, 0x73, 0x70, 0x00, 0xfd, 0x15, 0x75, 0x74, 0x00, 550x65, 0x73, 0x73, 0x70, 0x00, 0xfe, 0x15, 0x75, 0x74, 0x00,
560x64, 0x6f, 0x77, 0x6e, 0x00, 0x61, 0x67, 0x61, 0x69, 0x6e, 560x64, 0x6f, 0x77, 0x6e, 0x00, 0x61, 0x67, 0x61, 0x69, 0x6e,
570x2e, 0x00, 0x28, 0x49, 0x6e, 0x00, 0x67, 0x65, 0x6e, 0x65, 570x2e, 0x00, 0x28, 0x49, 0x6e, 0x00, 0x67, 0x65, 0x6e, 0x65,
580x72, 0x61, 0x6c, 0x2c, 0x00, 0x77, 0x68, 0x65, 0x6e, 0x65, 580x72, 0x61, 0x6c, 0x2c, 0x00, 0x77, 0x68, 0x65, 0x6e, 0x65,
590x76, 0x65, 0x72, 0xd0, 0x00, 0x03, 0x49, 0x00, 0x31, 0x74, 590x76, 0x65, 0x72, 0xd0, 0x00, 0x02, 0x49, 0x00, 0x31, 0x74,
600x77, 0x6f, 0x7b, 0x00, 0x12, 0x73, 0x19, 0x01, 0xf2, 0x11, 600x77, 0x6f, 0x7b, 0x00, 0x12, 0x73, 0x19, 0x01, 0xf2, 0x11,
610x63, 0x6f, 0x6d, 0x65, 0x00, 0x69, 0x6e, 0x74, 0x6f, 0x00, 610x63, 0x6f, 0x6d, 0x65, 0x00, 0x69, 0x6e, 0x74, 0x6f, 0x00,
620x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x00, 0x73, 0x77, 620x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x00, 0x73, 0x77,
630x61, 0x70, 0x00, 0x63, 0x6f, 0x6c, 0x6f, 0x75, 0x72, 0x73, 630x61, 0x70, 0x00, 0x63, 0x6f, 0x6c, 0x6f, 0x75, 0x72, 0x73,
640x2e, 0x29, 0x89, 0x01, 0x33, 0x6a, 0x6f, 0x62, 0x88, 0x01, 640x2e, 0x29, 0x89, 0x01, 0x33, 0x6a, 0x6f, 0x62, 0x88, 0x01,
650x70, 0x67, 0x65, 0x74, 0x00, 0x61, 0x6c, 0x6c, 0xd3, 0x01, 650x71, 0x67, 0x65, 0x74, 0x00, 0x61, 0x6c, 0x6c, 0xd3, 0x01,
660x08, 0x07, 0x01, 0x12, 0x73, 0xbe, 0x00, 0x00, 0x62, 0x00, 660x07, 0xa5, 0x00, 0x13, 0x73, 0xbe, 0x00, 0x00, 0x62, 0x00,
670x00, 0x1b, 0x00, 0x02, 0x62, 0x00, 0x09, 0xde, 0x00, 0x22, 670x00, 0x1b, 0x00, 0x02, 0x62, 0x00, 0x08, 0xde, 0x00, 0x22,
680x61, 0x74, 0x1d, 0x00, 0x00, 0x43, 0x02, 0x20, 0x74, 0x69, 680x61, 0x74, 0x1d, 0x00, 0x00, 0x43, 0x02, 0x20, 0x74, 0x69,
690x62, 0x02, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x00, 0x79, 690x62, 0x02, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x00, 0x79,
700xe9, 0x01, 0x00, 0x9f, 0x02, 0x50, 0x64, 0x00, 0x74, 0x72, 700xe9, 0x01, 0x00, 0x9f, 0x02, 0x50, 0x64, 0x00, 0x74, 0x72,
710x79, 0x48, 0x00, 0x20, 0x64, 0x6f, 0xb3, 0x01, 0x20, 0x69, 710x79, 0x48, 0x00, 0x20, 0x64, 0x6f, 0xb3, 0x01, 0x20, 0x69,
720x6e, 0x96, 0x02, 0x21, 0x66, 0x65, 0x9d, 0x02, 0xf1, 0x02, 720x6e, 0x96, 0x02, 0x21, 0x66, 0x65, 0x9d, 0x02, 0xf2, 0x02,
730x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x2e, 0x00, 730x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x2e, 0x00,
740x00, 0x00, 0x55, 0x6e, 0x6c, 0x69, 0x6b, 0x11, 0x02, 0x05, 740x00, 0x00, 0x55, 0x6e, 0x6c, 0x69, 0x6b, 0x11, 0x02, 0x04,
750xc6, 0x02, 0x06, 0xa2, 0x02, 0xf2, 0x01, 0x2c, 0x00, 0x6d, 750xc6, 0x02, 0x06, 0xa2, 0x02, 0xf2, 0x01, 0x2c, 0x00, 0x6d,
760x79, 0x00, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x00, 760x79, 0x00, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x00,
770x68, 0x61, 0x73, 0xf1, 0x01, 0x50, 0x64, 0x69, 0x74, 0x69, 770x68, 0x61, 0x73, 0xf1, 0x01, 0x50, 0x64, 0x69, 0x74, 0x69,
780x6f, 0x28, 0x00, 0xd0, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 780x6f, 0x28, 0x00, 0xd0, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72,
790x65, 0x3a, 0x00, 0x6f, 0x6e, 0x63, 0x65, 0x7f, 0x00, 0xc0, 790x65, 0x3a, 0x00, 0x6f, 0x6e, 0x63, 0x65, 0x7f, 0x00, 0xc1,
800x27, 0x76, 0x65, 0x00, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 800x27, 0x76, 0x65, 0x00, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72,
810x65, 0x64, 0x53, 0x00, 0x02, 0xe7, 0x02, 0x43, 0x77, 0x69, 810x65, 0x64, 0x53, 0x00, 0x01, 0xe7, 0x02, 0x43, 0x77, 0x69,
820x74, 0x68, 0x8e, 0x02, 0x01, 0x47, 0x01, 0x30, 0x69, 0x6e, 820x74, 0x68, 0x8e, 0x02, 0x01, 0x47, 0x01, 0x30, 0x69, 0x6e,
830x67, 0xe4, 0x00, 0x13, 0x61, 0xf1, 0x00, 0x01, 0xe8, 0x02, 830x67, 0xe4, 0x00, 0x14, 0x61, 0xf8, 0x01, 0x00, 0xe8, 0x02,
840x11, 0x2c, 0x65, 0x01, 0xa2, 0x63, 0x61, 0x6e, 0x00, 0x63, 840x11, 0x2c, 0x65, 0x01, 0xa2, 0x63, 0x61, 0x6e, 0x00, 0x63,
850x68, 0x61, 0x6e, 0x67, 0x65, 0xc0, 0x01, 0xa1, 0x74, 0x72, 850x68, 0x61, 0x6e, 0x67, 0x65, 0xc0, 0x01, 0xa2, 0x74, 0x72,
860x69, 0x61, 0x6e, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x25, 0x00, 860x69, 0x61, 0x6e, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x0d, 0x03,
870x00, 0xd7, 0x00, 0x03, 0xf9, 0x01, 0x50, 0x6e, 0x79, 0x00, 870x00, 0xd7, 0x00, 0x02, 0xf9, 0x01, 0x20, 0x6e, 0x79, 0x13,
880x6f, 0x66, 0x22, 0x00, 0xb0, 0x65, 0x74, 0x72, 0x61, 0x68, 880x01, 0xe0, 0x61, 0x00, 0x74, 0x65, 0x74, 0x72, 0x61, 0x68,
890x65, 0x64, 0x72, 0x6f, 0x6e, 0x2c, 0x9e, 0x00, 0x33, 0x6f, 890x65, 0x64, 0x72, 0x6f, 0x6e, 0x2c, 0x9e, 0x00, 0x33, 0x6f,
900x63, 0x74, 0x0f, 0x00, 0x30, 0x00, 0x6f, 0x72, 0x11, 0x00, 900x63, 0x74, 0x0f, 0x00, 0x30, 0x00, 0x6f, 0x72, 0x11, 0x00,
910x43, 0x69, 0x63, 0x6f, 0x73, 0x12, 0x00, 0x30, 0x2e, 0x00, 910x43, 0x69, 0x63, 0x6f, 0x73, 0x12, 0x00, 0x00, 0xef, 0x00,
920x00, 0x73, 0x03, 0xf0, 0x10, 0x00, 0x68, 0x74, 0x74, 0x70, 920xf0, 0x13, 0x5b, 0x32, 0x5d, 0x00, 0x68, 0x74, 0x74, 0x70,
930x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x33, 0x2e, 0x73, 0x79, 930x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x33, 0x2e, 0x73, 0x79,
940x6d, 0x70, 0x61, 0x74, 0x69, 0x63, 0x6f, 0x2e, 0x63, 0x61, 940x6d, 0x70, 0x61, 0x74, 0x69, 0x63, 0x6f, 0x2e, 0x63, 0x61,
950x2f, 0x70, 0x61, 0x75, 0x6c, 0x73, 0x87, 0x03, 0x10, 0x2f, 950x2f, 0x70, 0x61, 0x75, 0x6c, 0x73, 0x87, 0x03, 0x10, 0x2f,
960xac, 0x00, 0x11, 0x2f, 0x3f, 0x03, 0x92, 0x68, 0x74, 0x6d, 960xac, 0x00, 0x11, 0x2f, 0x3f, 0x03, 0x92, 0x68, 0x74, 0x6d,
970x00, 0x00, 0x00, 0x34, 0x2e, 0x31, 0x03, 0x04, 0x00, 0xdb, 970x00, 0x00, 0x00, 0x34, 0x2e, 0x31, 0x03, 0x04, 0x00, 0xdb,
980x01, 0x44, 0x72, 0x6f, 0x6c, 0x73, 0x0c, 0x04, 0x01, 0xe2, 980x01, 0x45, 0x72, 0x6f, 0x6c, 0x73, 0x0c, 0x04, 0x01, 0xe2,
990x00, 0x01, 0xb8, 0x00, 0x92, 0x62, 0x65, 0x00, 0x70, 0x6c, 990x00, 0x00, 0xb8, 0x00, 0x92, 0x62, 0x65, 0x00, 0x70, 0x6c,
1000x61, 0x79, 0x65, 0x64, 0xf0, 0x00, 0x20, 0x65, 0x69, 0x20, 1000x61, 0x79, 0x65, 0x64, 0xf0, 0x00, 0x21, 0x65, 0x69, 0x20,
1010x04, 0x00, 0x05, 0x01, 0x00, 0x63, 0x03, 0x72, 0x62, 0x6f, 1010x04, 0x00, 0x05, 0x01, 0xa2, 0x6b, 0x65, 0x79, 0x62, 0x6f,
1020x61, 0x72, 0x64, 0x00, 0x6f, 0x10, 0x00, 0x41, 0x6d, 0x6f, 1020x61, 0x72, 0x64, 0x00, 0x6f, 0x10, 0x00, 0x41, 0x6d, 0x6f,
1030x75, 0x73, 0x7c, 0x01, 0xd0, 0x4c, 0x65, 0x66, 0x74, 0x2d, 1030x75, 0x73, 0x7c, 0x01, 0xa0, 0x4c, 0x65, 0x66, 0x74, 0x2d,
1040x63, 0x6c, 0x69, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0xd4, 0x00, 1040x63, 0x6c, 0x69, 0x63, 0x6b, 0x13, 0x01, 0x72, 0x61, 0x6e,
1050x42, 0x77, 0x68, 0x65, 0x72, 0xbe, 0x02, 0x10, 0x68, 0x37, 1050x79, 0x77, 0x68, 0x65, 0x72, 0xbe, 0x02, 0x10, 0x68, 0x37,
1060x01, 0x91, 0x6e, 0x64, 0x6f, 0x77, 0x00, 0x77, 0x69, 0x6c, 1060x01, 0x92, 0x6e, 0x64, 0x6f, 0x77, 0x00, 0x77, 0x69, 0x6c,
1070x6c, 0xd6, 0x01, 0x06, 0x01, 0x02, 0x42, 0x28, 0x6f, 0x72, 1070x6c, 0xbf, 0x03, 0x05, 0x01, 0x02, 0x42, 0x28, 0x6f, 0x72,
1080x00, 0x7f, 0x04, 0xe6, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x29, 1080x00, 0x7f, 0x04, 0xe6, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x29,
1090x00, 0x74, 0x6f, 0x77, 0x61, 0x72, 0x64, 0x73, 0x5e, 0x00, 1090x00, 0x74, 0x6f, 0x77, 0x61, 0x72, 0x64, 0x73, 0x5e, 0x00,
1100x90, 0x00, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x2e, 1100x91, 0x00, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x2e,
1110xa7, 0x00, 0x0a, 0xec, 0x03, 0x10, 0x63, 0xc4, 0x01, 0x20, 1110xa7, 0x00, 0x09, 0xec, 0x03, 0x10, 0x63, 0xc4, 0x01, 0x21,
1120x6c, 0x73, 0x08, 0x04, 0x00, 0xa5, 0x01, 0x1e, 0x6f, 0xaa, 1120x6c, 0x73, 0x08, 0x04, 0x1e, 0x64, 0xfa, 0x03, 0x68, 0x6f,
1130x03, 0x38, 0x69, 0x74, 0x73, 0x9b, 0x01, 0x22, 0x00, 0x69, 1130x6e, 0x00, 0x69, 0x74, 0x73, 0x9b, 0x01, 0x22, 0x00, 0x69,
1140x90, 0x00, 0x10, 0x66, 0x5f, 0x02, 0x41, 0x63, 0x61, 0x72, 1140x90, 0x00, 0x10, 0x66, 0x5f, 0x02, 0x41, 0x63, 0x61, 0x72,
1150x64, 0x24, 0x02, 0x50, 0x64, 0x69, 0x72, 0x65, 0x63, 0x08, 1150x64, 0x24, 0x02, 0x50, 0x64, 0x69, 0x72, 0x65, 0x63, 0x08,
1160x02, 0x41, 0x73, 0x2e, 0x00, 0x4f, 0x21, 0x00, 0x0c, 0xae, 1160x02, 0x42, 0x73, 0x2e, 0x00, 0x4f, 0x21, 0x00, 0x0b, 0xae,
1170x01, 0x22, 0x73, 0x2c, 0x90, 0x00, 0x31, 0x61, 0x70, 0x70, 1170x01, 0x22, 0x73, 0x2c, 0x90, 0x00, 0x31, 0x61, 0x70, 0x70,
1180xf2, 0x01, 0x1a, 0x66, 0x72, 0x04, 0x06, 0x42, 0x00, 0x01, 1180xf2, 0x01, 0x1b, 0x66, 0x72, 0x04, 0x06, 0x42, 0x00, 0x00,
1190x8a, 0x03, 0xf2, 0x0a, 0x6d, 0x6f, 0x72, 0x65, 0x00, 0x61, 1190x11, 0x03, 0xf2, 0x0a, 0x6d, 0x6f, 0x72, 0x65, 0x00, 0x61,
1200x70, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x6d, 0x61, 0x74, 0x65, 1200x70, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x6d, 0x61, 0x74, 0x65,
1210x2e, 0x00, 0x56, 0x65, 0x72, 0x74, 0x69, 0x63, 0x61, 0xfd, 1210x2e, 0x00, 0x56, 0x65, 0x72, 0x74, 0x69, 0x63, 0x61, 0xfd,
1220x00, 0x40, 0x6d, 0x65, 0x6e, 0x74, 0x27, 0x00, 0xb2, 0x64, 1220x00, 0x10, 0x6d, 0x63, 0x04, 0xb0, 0x69, 0x73, 0x00, 0x64,
1230x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x00, 1230x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x67, 0x01, 0x01,
1240x2d, 0x01, 0x10, 0x69, 0xc1, 0x03, 0xe0, 0x65, 0x73, 0x6e, 1240x2d, 0x01, 0x10, 0x69, 0xc1, 0x03, 0xe0, 0x65, 0x73, 0x6e,
1250x27, 0x74, 0x00, 0x6d, 0x61, 0x6b, 0x65, 0x00, 0x73, 0x65, 1250x27, 0x74, 0x00, 0x6d, 0x61, 0x6b, 0x65, 0x00, 0x73, 0x65,
1260x6e, 0x5d, 0x01, 0x13, 0x54, 0xb1, 0x00, 0x02, 0x6e, 0x00, 1260x6e, 0x5d, 0x01, 0x14, 0x54, 0xb1, 0x00, 0x01, 0x6e, 0x00,
1270xbb, 0x73, 0x75, 0x72, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x69, 1270x80, 0x73, 0x75, 0x72, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x88,
1280x6e, 0x67, 0xfb, 0x04, 0x04, 0x6d, 0x01, 0x70, 0x6e, 0x75, 1280x00, 0x0b, 0xfb, 0x04, 0x03, 0x6d, 0x01, 0x70, 0x6e, 0x75,
1290x6d, 0x65, 0x72, 0x69, 0x63, 0x14, 0x00, 0xc0, 0x70, 0x61, 1290x6d, 0x65, 0x72, 0x69, 0x63, 0x14, 0x00, 0xc0, 0x70, 0x61,
1300x64, 0x00, 0x28, 0x60, 0x37, 0x27, 0x2c, 0x00, 0x60, 0x39, 1300x64, 0x00, 0x28, 0x60, 0x37, 0x27, 0x2c, 0x00, 0x60, 0x39,
1310x05, 0x00, 0x10, 0x31, 0x05, 0x00, 0x33, 0x33, 0x27, 0x29, 1310x05, 0x00, 0x10, 0x31, 0x05, 0x00, 0x34, 0x33, 0x27, 0x29,
1320xe6, 0x01, 0x02, 0x38, 0x01, 0xa7, 0x66, 0x6f, 0x72, 0x00, 1320xe6, 0x01, 0x01, 0x38, 0x01, 0xa7, 0x66, 0x6f, 0x72, 0x00,
1330x64, 0x69, 0x61, 0x67, 0x6f, 0x6e, 0xa1, 0x00, 0x00, 0x6e, 1330x64, 0x69, 0x61, 0x67, 0x6f, 0x6e, 0xa1, 0x00, 0x00, 0x6e,
1340x01, 0x23, 0x28, 0x41, 0x4e, 0x01, 0x13, 0x61, 0xdc, 0x00, 1340x01, 0x23, 0x28, 0x41, 0x4e, 0x01, 0x13, 0x61, 0xdc, 0x00,
1350x81, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x48, 1350x81, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x48,
1360x01, 0x12, 0x73, 0xf2, 0x00, 0x40, 0x00, 0x32, 0x2e, 0x31, 1360x01, 0x12, 0x73, 0xf2, 0x00, 0x41, 0x00, 0x32, 0x2e, 0x31,
1370xbe, 0x05, 0x02, 0x89, 0x01, 0x60, 0x61, 0x76, 0x61, 0x69, 1370xbe, 0x05, 0x01, 0x89, 0x01, 0x60, 0x61, 0x76, 0x61, 0x69,
1380x6c, 0x61, 0x90, 0x03, 0x11, 0x29, 0x6b, 0x02, 0x12, 0x32, 1380x6c, 0x61, 0x90, 0x03, 0x11, 0x29, 0x6b, 0x02, 0x12, 0x32,
1390x6b, 0x02, 0x93, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 1390x6b, 0x02, 0x93, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74,
1400x65, 0x72, 0x6d, 0x02, 0x46, 0x65, 0x73, 0x65, 0x00, 0x14, 1400x65, 0x72, 0x6d, 0x02, 0x10, 0x65, 0xd7, 0x01, 0x05, 0x14,
1410x00, 0x00, 0x3f, 0x00, 0x06, 0x3a, 0x00, 0x51, 0x00, 0x66, 1410x00, 0x02, 0x3f, 0x00, 0x04, 0x3a, 0x00, 0x51, 0x00, 0x66,
1420x72, 0x6f, 0x6d, 0x77, 0x00, 0xe0, 0x60, 0x43, 0x75, 0x73, 1420x72, 0x6f, 0x6d, 0x77, 0x00, 0xe1, 0x60, 0x43, 0x75, 0x73,
1430x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 1430x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70,
1440x6d, 0x00, 0x04, 0xe3, 0x00, 0xb0, 0x60, 0x54, 0x79, 0x70, 1440x6d, 0x00, 0x03, 0xe3, 0x00, 0xb1, 0x60, 0x54, 0x79, 0x70,
1450x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0xa9, 0x00, 0x00, 1450x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0x17, 0x02, 0x71,
1460x0e, 0x00, 0x41, 0x20, 0x6f, 0x66, 0x20, 0x43, 0x02, 0x91, 1460x79, 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x43, 0x02, 0x92,
1470x00, 0x00, 0x00, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x44, 1470x00, 0x00, 0x00, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x44,
1480x02, 0x01, 0x57, 0x02, 0x06, 0x1c, 0x02, 0x10, 0x28, 0x77, 1480x02, 0x02, 0x14, 0x00, 0x04, 0x1c, 0x02, 0x10, 0x28, 0x77,
1490x03, 0x52, 0x68, 0x65, 0x6e, 0x63, 0x65, 0x1d, 0x00, 0x33, 1490x03, 0x20, 0x68, 0x65, 0xe4, 0x03, 0x01, 0x1d, 0x00, 0x35,
1500x68, 0x61, 0x70, 0x6f, 0x05, 0x02, 0x21, 0x02, 0x29, 0x29, 1500x68, 0x61, 0x70, 0x6f, 0x05, 0x00, 0xe9, 0x01, 0x2a, 0x29,
1510x3a, 0x87, 0x03, 0x02, 0x22, 0x05, 0x07, 0x8a, 0x03, 0x4c, 1510x3a, 0x87, 0x03, 0x02, 0x22, 0x05, 0x06, 0x8a, 0x03, 0x10,
1520x2c, 0x00, 0x6f, 0x72, 0x88, 0x03, 0xf0, 0x0c, 0x57, 0x69, 1520x2c, 0xf9, 0x02, 0x0b, 0x88, 0x03, 0xf0, 0x0c, 0x57, 0x69,
1530x64, 0x74, 0x68, 0x20, 0x2f, 0x20, 0x74, 0x6f, 0x70, 0x2c, 1530x64, 0x74, 0x68, 0x20, 0x2f, 0x20, 0x74, 0x6f, 0x70, 0x2c,
1540x00, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x20, 0x2f, 0x20, 1540x00, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x20, 0x2f, 0x20,
1550x62, 0x6f, 0x74, 0x74, 0x6f, 0x70, 0x03, 0x1d, 0x4f, 0x1f, 1550x62, 0x6f, 0x74, 0x74, 0x6f, 0x70, 0x03, 0x1d, 0x4f, 0x1f,
1560x04, 0x50, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x58, 0x05, 0x11, 1560x04, 0x50, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x58, 0x05, 0x11,
1570x6c, 0x06, 0x04, 0x14, 0x76, 0x1d, 0x02, 0x64, 0x64, 0x69, 1570x6c, 0x06, 0x04, 0x14, 0x76, 0x1d, 0x02, 0x65, 0x64, 0x69,
1580x6d, 0x65, 0x6e, 0x73, 0x88, 0x02, 0x0e, 0x34, 0x04, 0x14, 1580x6d, 0x65, 0x6e, 0x73, 0x88, 0x02, 0x0d, 0x34, 0x04, 0x14,
1590x2c, 0xdf, 0x01, 0x10, 0x62, 0xae, 0x07, 0x13, 0x66, 0x1f, 1590x2c, 0xdf, 0x01, 0x10, 0x62, 0xae, 0x07, 0x13, 0x66, 0x1f,
1600x00, 0x25, 0x6c, 0x65, 0xfa, 0x01, 0x31, 0x74, 0x6f, 0x70, 1600x00, 0x25, 0x6c, 0x65, 0xfa, 0x01, 0x31, 0x74, 0x6f, 0x70,
1610x52, 0x00, 0x03, 0x7c, 0x00, 0x40, 0x72, 0x6f, 0x77, 0x73, 1610x52, 0x00, 0x03, 0x7c, 0x00, 0x40, 0x72, 0x6f, 0x77, 0x73,
diff --git a/apps/plugins/puzzles/help/dominosa.c b/apps/plugins/puzzles/help/dominosa.c
index b2994d79da..f1c61620ee 100644
--- a/apps/plugins/puzzles/help/dominosa.c
+++ b/apps/plugins/puzzles/help/dominosa.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -15,7 +15,7 @@ struct style_text help_text_style[] = {
15 LAST_STYLE_ITEM 15 LAST_STYLE_ITEM
16}; 16};
17 17
18/* orig 2278 comp 1541 ratio 0.676471 level 11 saved 737 */ 18/* orig 2278 comp 1541 ratio 0.676471 level 10 saved 737 */
19const char help_text[] = { 19const char help_text[] = {
200xf1, 0x1a, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 200xf1, 0x1a, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
210x31, 0x37, 0x3a, 0x20, 0x44, 0x6f, 0x6d, 0x69, 0x6e, 0x6f, 210x31, 0x37, 0x3a, 0x20, 0x44, 0x6f, 0x6d, 0x69, 0x6e, 0x6f,
@@ -37,16 +37,16 @@ const char help_text[] = {
370x65, 0x3b, 0x00, 0x74, 0x68, 0x65, 0x6e, 0x05, 0x00, 0x03, 370x65, 0x3b, 0x00, 0x74, 0x68, 0x65, 0x6e, 0x05, 0x00, 0x03,
380x4f, 0x00, 0xf6, 0x00, 0x00, 0x69, 0x6e, 0x00, 0x65, 0x61, 380x4f, 0x00, 0xf6, 0x00, 0x00, 0x69, 0x6e, 0x00, 0x65, 0x61,
390x63, 0x68, 0x00, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x4f, 390x63, 0x68, 0x00, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x4f,
400x00, 0xf0, 0x01, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 400x00, 0xf1, 0x01, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e,
410x00, 0x64, 0x6f, 0x77, 0x6e, 0x00, 0x61, 0x6e, 0x64, 0x34, 410x00, 0x64, 0x6f, 0x77, 0x6e, 0x00, 0x61, 0x6e, 0x64, 0x34,
420x00, 0x05, 0xc1, 0x00, 0x00, 0x0d, 0x00, 0xf0, 0x11, 0x6d, 420x00, 0x05, 0xc1, 0x00, 0xf0, 0x11, 0x74, 0x68, 0x65, 0x6d,
430x73, 0x65, 0x6c, 0x76, 0x65, 0x73, 0x00, 0x72, 0x65, 0x6d, 430x73, 0x65, 0x6c, 0x76, 0x65, 0x73, 0x00, 0x72, 0x65, 0x6d,
440x6f, 0x76, 0x65, 0x64, 0x2e, 0x00, 0x59, 0x6f, 0x75, 0x72, 440x6f, 0x76, 0x65, 0x64, 0x2e, 0x00, 0x59, 0x6f, 0x75, 0x72,
450x00, 0x74, 0x61, 0x73, 0x6b, 0x00, 0x69, 0x73, 0x00, 0x74, 450x00, 0x74, 0x61, 0x73, 0x6b, 0x00, 0x69, 0x73, 0x9e, 0x00,
460x6f, 0x75, 0x00, 0x81, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 460xb1, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75,
470x63, 0x74, 0x3d, 0x00, 0xa3, 0x70, 0x61, 0x74, 0x74, 0x65, 470x63, 0x74, 0x3d, 0x00, 0xa3, 0x70, 0x61, 0x74, 0x74, 0x65,
480x72, 0x6e, 0x00, 0x62, 0x79, 0xac, 0x00, 0x30, 0x69, 0x6e, 480x72, 0x6e, 0x00, 0x62, 0x79, 0xac, 0x00, 0x31, 0x69, 0x6e,
490x67, 0x19, 0x00, 0x0b, 0x1e, 0x01, 0x01, 0x3c, 0x00, 0x52, 490x67, 0x19, 0x00, 0x0c, 0x1e, 0x01, 0x82, 0x74, 0x6f, 0x00,
500x6d, 0x61, 0x74, 0x63, 0x68, 0x36, 0x00, 0x71, 0x72, 0x6f, 500x6d, 0x61, 0x74, 0x63, 0x68, 0x36, 0x00, 0x71, 0x72, 0x6f,
510x76, 0x69, 0x64, 0x65, 0x64, 0x34, 0x00, 0x17, 0x79, 0x08, 510x76, 0x69, 0x64, 0x65, 0x64, 0x34, 0x00, 0x17, 0x79, 0x08,
520x01, 0xf0, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x54, 0x68, 0x69, 520x01, 0xf0, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x54, 0x68, 0x69,
@@ -71,59 +71,59 @@ const char help_text[] = {
710x72, 0x65, 0x61, 0x64, 0x79, 0x00, 0x70, 0x72, 0x65, 0x73, 710x72, 0x65, 0x61, 0x64, 0x79, 0x00, 0x70, 0x72, 0x65, 0x73,
720x65, 0x6e, 0x74, 0x2e, 0x00, 0x54, 0x72, 0x79, 0x36, 0x00, 720x65, 0x6e, 0x74, 0x2e, 0x00, 0x54, 0x72, 0x79, 0x36, 0x00,
730x12, 0x6f, 0x52, 0x00, 0x06, 0x51, 0x00, 0x60, 0x77, 0x68, 730x12, 0x6f, 0x52, 0x00, 0x06, 0x51, 0x00, 0x60, 0x77, 0x68,
740x69, 0x63, 0x68, 0x00, 0x56, 0x00, 0xd6, 0x6c, 0x61, 0x70, 740x69, 0x63, 0x68, 0x00, 0x56, 0x00, 0xa0, 0x6c, 0x61, 0x70,
750x73, 0x00, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 750x73, 0x00, 0x65, 0x78, 0x69, 0x73, 0x74, 0x2a, 0x00, 0x05,
760x56, 0x01, 0x43, 0x77, 0x69, 0x6c, 0x6c, 0x65, 0x00, 0x00, 760x56, 0x01, 0x43, 0x77, 0x69, 0x6c, 0x6c, 0x65, 0x00, 0x01,
770x75, 0x00, 0x00, 0x68, 0x00, 0x44, 0x73, 0x00, 0x69, 0x74, 770x59, 0x01, 0x40, 0x6f, 0x6e, 0x65, 0x73, 0x66, 0x00, 0x04,
780x33, 0x00, 0x01, 0xef, 0x00, 0x4e, 0x52, 0x69, 0x67, 0x68, 780x33, 0x00, 0x00, 0xef, 0x00, 0x4e, 0x52, 0x69, 0x67, 0x68,
790xd6, 0x00, 0x0f, 0xd2, 0x00, 0x03, 0x40, 0x64, 0x72, 0x61, 790xd6, 0x00, 0x0f, 0xd2, 0x00, 0x03, 0x40, 0x64, 0x72, 0x61,
800x77, 0xd1, 0x00, 0x44, 0x6c, 0x69, 0x6e, 0x65, 0x2a, 0x00, 800x77, 0xd1, 0x00, 0x46, 0x6c, 0x69, 0x6e, 0x65, 0x2a, 0x00,
810x02, 0xce, 0x00, 0x03, 0x8c, 0x00, 0xb2, 0x79, 0x6f, 0x75, 810x01, 0xce, 0x00, 0x02, 0x8c, 0x00, 0xb2, 0x79, 0x6f, 0x75,
820x00, 0x63, 0x61, 0x6e, 0x00, 0x75, 0x73, 0x65, 0x0f, 0x02, 820x00, 0x63, 0x61, 0x6e, 0x00, 0x75, 0x73, 0x65, 0x0f, 0x02,
830x40, 0x6d, 0x69, 0x6e, 0x64, 0x16, 0x00, 0x51, 0x72, 0x73, 830x40, 0x6d, 0x69, 0x6e, 0x64, 0x16, 0x00, 0x52, 0x72, 0x73,
840x65, 0x6c, 0x66, 0x02, 0x03, 0x01, 0x24, 0x00, 0x42, 0x6b, 840x65, 0x6c, 0x66, 0x02, 0x03, 0x00, 0x24, 0x00, 0x43, 0x6b,
850x6e, 0x6f, 0x77, 0x7b, 0x01, 0x00, 0x69, 0x00, 0x05, 0x60, 850x6e, 0x6f, 0x77, 0x7b, 0x01, 0x00, 0x69, 0x00, 0x04, 0x60,
860x00, 0x00, 0x8e, 0x02, 0x32, 0x6e, 0x6f, 0x74, 0x2a, 0x01, 860x00, 0x00, 0x8e, 0x02, 0x32, 0x6e, 0x6f, 0x74, 0x2a, 0x01,
870x21, 0x65, 0x64, 0x37, 0x02, 0x64, 0x00, 0x73, 0x69, 0x6e, 870x21, 0x65, 0x64, 0x37, 0x02, 0x30, 0x00, 0x73, 0x69, 0xc6,
880x67, 0x6c, 0x88, 0x02, 0x1c, 0x2e, 0xb0, 0x00, 0x52, 0x61, 880x02, 0x03, 0xd5, 0x00, 0x1c, 0x2e, 0xb0, 0x00, 0x55, 0x61,
890x67, 0x61, 0x69, 0x6e, 0xe4, 0x00, 0x02, 0xa4, 0x02, 0x01, 890x67, 0x61, 0x69, 0x6e, 0x49, 0x01, 0x00, 0xe5, 0x00, 0x00,
900x9d, 0x00, 0x00, 0xd9, 0x00, 0x13, 0x59, 0x8c, 0x00, 0x72, 900x9d, 0x00, 0x00, 0xd9, 0x00, 0x13, 0x59, 0x8c, 0x00, 0x42,
910x61, 0x6c, 0x73, 0x6f, 0x00, 0x75, 0x73, 0x02, 0x01, 0xa1, 910x61, 0x6c, 0x73, 0x6f, 0x91, 0x00, 0xd2, 0x68, 0x65, 0x00,
920x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x00, 0x6b, 0x65, 0x79, 920x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x00, 0x6b, 0x65, 0x79,
930x74, 0x02, 0x01, 0x1a, 0x01, 0x14, 0x61, 0x16, 0x00, 0x43, 930x74, 0x02, 0x00, 0x1a, 0x01, 0x14, 0x61, 0x16, 0x00, 0x43,
940x61, 0x72, 0x6f, 0x75, 0xf6, 0x02, 0xa7, 0x67, 0x72, 0x69, 940x61, 0x72, 0x6f, 0x75, 0xf6, 0x02, 0x74, 0x67, 0x72, 0x69,
950x64, 0x2e, 0x00, 0x57, 0x68, 0x65, 0x6e, 0x37, 0x00, 0x00, 950x64, 0x2e, 0x00, 0x57, 0x39, 0x03, 0x03, 0x21, 0x00, 0xbf,
960x9e, 0x01, 0x8f, 0x68, 0x61, 0x6c, 0x66, 0x00, 0x77, 0x61, 960x69, 0x73, 0x00, 0x68, 0x61, 0x6c, 0x66, 0x00, 0x77, 0x61,
970x79, 0x29, 0x01, 0x0a, 0x11, 0x2c, 0xbd, 0x01, 0x14, 0x73, 970x79, 0x29, 0x01, 0x0a, 0x11, 0x2c, 0xbd, 0x01, 0x14, 0x73,
980xed, 0x02, 0x60, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x75, 980xed, 0x02, 0x60, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x75,
990x00, 0x01, 0x92, 0x01, 0x02, 0xc7, 0x01, 0x0e, 0x18, 0x02, 990x00, 0x02, 0x92, 0x01, 0x0b, 0xc7, 0x01, 0x07, 0x18, 0x02,
1000x02, 0x11, 0x01, 0x06, 0x44, 0x00, 0x2a, 0x6f, 0x72, 0x47, 1000x00, 0x11, 0x01, 0x05, 0x44, 0x00, 0x2a, 0x6f, 0x72, 0x47,
1010x00, 0x20, 0x73, 0x70, 0x37, 0x00, 0x32, 0x62, 0x61, 0x72, 1010x00, 0x20, 0x73, 0x70, 0x37, 0x00, 0x32, 0x62, 0x61, 0x72,
1020x46, 0x00, 0x3e, 0x6c, 0x61, 0x79, 0x8b, 0x01, 0x01, 0x50, 1020x46, 0x00, 0x3e, 0x6c, 0x61, 0x79, 0x8b, 0x01, 0x02, 0x50,
1030x01, 0x03, 0xd9, 0x03, 0x81, 0x73, 0x2e, 0x00, 0x52, 0x65, 1030x01, 0x02, 0xd9, 0x03, 0x81, 0x73, 0x2e, 0x00, 0x52, 0x65,
1040x70, 0x65, 0x61, 0x14, 0x02, 0xc9, 0x65, 0x69, 0x74, 0x68, 1040x70, 0x65, 0x61, 0x14, 0x02, 0xca, 0x65, 0x69, 0x74, 0x68,
1050x65, 0x72, 0x00, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x30, 0x01, 1050x65, 0x72, 0x00, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x30, 0x01,
1060x04, 0x86, 0x00, 0x25, 0x6f, 0x72, 0x3a, 0x01, 0x14, 0x50, 1060x03, 0x86, 0x00, 0x25, 0x6f, 0x72, 0x3a, 0x01, 0x14, 0x50,
1070x76, 0x00, 0x13, 0x61, 0x8d, 0x00, 0x06, 0xbb, 0x00, 0x50, 1070x76, 0x00, 0x14, 0x61, 0x32, 0x04, 0x05, 0xbb, 0x00, 0x50,
1080x68, 0x69, 0x67, 0x68, 0x6c, 0x82, 0x01, 0xe0, 0x00, 0x61, 1080x68, 0x69, 0x67, 0x68, 0x6c, 0x82, 0x01, 0xe0, 0x00, 0x61,
1090x6c, 0x6c, 0x00, 0x6f, 0x63, 0x63, 0x75, 0x72, 0x72, 0x65, 1090x6c, 0x6c, 0x00, 0x6f, 0x63, 0x63, 0x75, 0x72, 0x72, 0x65,
1100x6e, 0x63, 0xc4, 0x02, 0x01, 0xdf, 0x01, 0x04, 0x03, 0x01, 1100x6e, 0x63, 0xc4, 0x02, 0x03, 0xdf, 0x01, 0x02, 0x32, 0x00,
1110x15, 0x2e, 0x45, 0x00, 0x08, 0x16, 0x00, 0x02, 0xae, 0x01, 1110x16, 0x2e, 0x45, 0x00, 0x07, 0x16, 0x00, 0x03, 0xae, 0x01,
1120x02, 0x4a, 0x00, 0x50, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x81, 1120x01, 0x4a, 0x00, 0x51, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x81,
1130x00, 0x05, 0x54, 0x00, 0x00, 0xa8, 0x00, 0x71, 0x2e, 0x00, 1130x00, 0x05, 0x54, 0x00, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x00,
1140x55, 0x70, 0x00, 0x74, 0x6f, 0xc6, 0x00, 0x67, 0x64, 0x69, 1140x55, 0x70, 0x99, 0x01, 0x00, 0xc6, 0x00, 0x68, 0x64, 0x69,
1150x66, 0x66, 0x65, 0x72, 0x57, 0x01, 0x01, 0xcf, 0x01, 0x17, 1150x66, 0x66, 0x65, 0x72, 0x80, 0x02, 0x00, 0xcf, 0x01, 0x17,
1160x62, 0x31, 0x00, 0x00, 0x23, 0x04, 0x11, 0x74, 0x81, 0x03, 1160x62, 0x31, 0x00, 0x00, 0x23, 0x04, 0x11, 0x74, 0x81, 0x03,
1170x30, 0x67, 0x69, 0x76, 0x00, 0x01, 0x21, 0x69, 0x6d, 0xc1, 1170x30, 0x67, 0x69, 0x76, 0x00, 0x01, 0x21, 0x69, 0x6d, 0xc1,
1180x00, 0x40, 0x28, 0x41, 0x6c, 0x6c, 0x5b, 0x00, 0x03, 0xef, 1180x00, 0x41, 0x28, 0x41, 0x6c, 0x6c, 0x5b, 0x00, 0x02, 0xef,
1190x00, 0xb0, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 1190x00, 0xb0, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
1200x62, 0x65, 0x64, 0xfc, 0x04, 0x22, 0x73, 0x65, 0x05, 0x01, 1200x62, 0x65, 0x64, 0xfc, 0x04, 0x22, 0x73, 0x65, 0x05, 0x01,
1210x30, 0x32, 0x2e, 0x31, 0x72, 0x02, 0x02, 0x21, 0x02, 0xb2, 1210x31, 0x32, 0x2e, 0x31, 0x72, 0x02, 0x01, 0x21, 0x02, 0xb2,
1220x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 1220x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e,
1230x29, 0x04, 0x04, 0x16, 0x32, 0x04, 0x04, 0xb1, 0x70, 0x61, 1230x29, 0x04, 0x04, 0x16, 0x32, 0x04, 0x04, 0xb1, 0x70, 0x61,
1240x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x81, 1240x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x81,
1250x04, 0x43, 0x65, 0x73, 0x65, 0x00, 0x14, 0x00, 0x03, 0xb6, 1250x04, 0x46, 0x65, 0x73, 0x65, 0x00, 0x14, 0x00, 0x02, 0x44,
1260x02, 0x05, 0x3f, 0x00, 0x05, 0x56, 0x04, 0xf1, 0x01, 0x65, 1260x00, 0x04, 0x3f, 0x00, 0x04, 0x56, 0x04, 0xf1, 0x01, 0x65,
1270x00, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 1270x00, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e,
1280x2e, 0x27, 0x00, 0x6f, 0x70, 0x72, 0x00, 0x22, 0x6f, 0x6e, 1280x2e, 0x27, 0x00, 0x6f, 0x70, 0x72, 0x00, 0x22, 0x6f, 0x6e,
1290x1a, 0x00, 0xa0, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 1290x1a, 0x00, 0xa0, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d,
@@ -131,15 +131,15 @@ const char help_text[] = {
1310x6d, 0x75, 0x6d, 0x20, 0xe6, 0x00, 0x45, 0x20, 0x6f, 0x6e, 1310x6d, 0x75, 0x6d, 0x20, 0xe6, 0x00, 0x45, 0x20, 0x6f, 0x6e,
1320x20, 0xc1, 0x03, 0x33, 0x00, 0x00, 0x43, 0x80, 0x04, 0x02, 1320x20, 0xc1, 0x03, 0x33, 0x00, 0x00, 0x43, 0x80, 0x04, 0x02,
1330x02, 0x02, 0x32, 0x69, 0x7a, 0x65, 0x69, 0x01, 0x13, 0x65, 1330x02, 0x02, 0x32, 0x69, 0x7a, 0x65, 0x69, 0x01, 0x13, 0x65,
1340x03, 0x05, 0x10, 0x2c, 0x24, 0x03, 0x03, 0xa4, 0x04, 0x4a, 1340x03, 0x05, 0x10, 0x2c, 0x24, 0x03, 0x03, 0xa4, 0x04, 0x15,
1350x6c, 0x69, 0x6e, 0x67, 0x27, 0x00, 0x0e, 0x69, 0x05, 0x00, 1350x6c, 0x29, 0x02, 0x07, 0x27, 0x00, 0x0c, 0x69, 0x05, 0x42,
1360x09, 0x03, 0x12, 0x64, 0x6e, 0x05, 0x86, 0x6b, 0x65, 0x00, 1360x75, 0x73, 0x65, 0x64, 0x6e, 0x05, 0x86, 0x6b, 0x65, 0x00,
1370x69, 0x74, 0x2e, 0x00, 0x44, 0x2d, 0x04, 0x25, 0x74, 0x68, 1370x69, 0x74, 0x2e, 0x00, 0x44, 0x2d, 0x04, 0x25, 0x74, 0x68,
1380x6a, 0x01, 0x20, 0x67, 0x6f, 0x4d, 0x00, 0x11, 0x75, 0x8c, 1380x6a, 0x01, 0x20, 0x67, 0x6f, 0x4d, 0x00, 0x11, 0x75, 0x8c,
1390x01, 0x11, 0x4e, 0xb1, 0x01, 0x01, 0x63, 0x01, 0x32, 0x00, 1390x01, 0x12, 0x4e, 0xb1, 0x01, 0x00, 0x63, 0x01, 0x32, 0x00,
1400x72, 0x69, 0xda, 0x03, 0xa0, 0x61, 0x6e, 0x00, 0x28, 0x4e, 1400x72, 0x69, 0xda, 0x03, 0xa0, 0x61, 0x6e, 0x00, 0x28, 0x4e,
1410x2b, 0x32, 0x29, 0x00, 0x78, 0x08, 0x00, 0x28, 0x31, 0x29, 1410x2b, 0x32, 0x29, 0x00, 0x78, 0x08, 0x00, 0x28, 0x31, 0x29,
1420x6f, 0x06, 0x61, 0x73, 0x6f, 0x2c, 0x00, 0x69, 0x6e, 0x70, 1420x6f, 0x06, 0x30, 0x73, 0x6f, 0x2c, 0x67, 0x01, 0x00, 0x70,
1430x05, 0x20, 0x69, 0x63, 0x95, 0x06, 0x12, 0x2c, 0x68, 0x02, 1430x05, 0x20, 0x69, 0x63, 0x95, 0x06, 0x12, 0x2c, 0x68, 0x02,
1440xb1, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x00, 0x76, 0x61, 1440xb1, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x00, 0x76, 0x61,
1450x6c, 0x75, 0x9f, 0x00, 0x11, 0x36, 0x53, 0x00, 0x10, 0x73, 1450x6c, 0x75, 0x9f, 0x00, 0x11, 0x36, 0x53, 0x00, 0x10, 0x73,
@@ -147,29 +147,29 @@ const char help_text[] = {
1470x00, 0x00, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x20, 0x75, 1470x00, 0x00, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x20, 0x75,
1480x6e, 0x69, 0x71, 0x75, 0x65, 0x20, 0x73, 0x6f, 0x6c, 0x75, 1480x6e, 0x69, 0x71, 0x75, 0x65, 0x20, 0x73, 0x6f, 0x6c, 0x75,
1490x3c, 0x01, 0x31, 0x00, 0x00, 0x4e, 0x59, 0x07, 0x44, 0x6c, 1490x3c, 0x01, 0x31, 0x00, 0x00, 0x4e, 0x59, 0x07, 0x44, 0x6c,
1500x79, 0x2c, 0x00, 0x9a, 0x01, 0x01, 0x99, 0x00, 0x02, 0xcb, 1500x79, 0x2c, 0x00, 0x9a, 0x01, 0x02, 0x99, 0x00, 0x01, 0xcb,
1510x00, 0x00, 0x34, 0x00, 0x01, 0x6b, 0x02, 0x06, 0x1d, 0x01, 1510x00, 0x00, 0x34, 0x00, 0x02, 0x6b, 0x02, 0x06, 0x1d, 0x01,
1520x01, 0xec, 0x04, 0x04, 0x47, 0x05, 0x00, 0xba, 0x03, 0x10, 1520x01, 0xec, 0x04, 0x03, 0x47, 0x05, 0x00, 0xba, 0x03, 0x10,
1530x76, 0x02, 0x05, 0x21, 0x6c, 0x79, 0x6f, 0x05, 0x04, 0x58, 1530x76, 0x02, 0x05, 0x21, 0x6c, 0x79, 0x6f, 0x05, 0x04, 0x58,
1540x00, 0x30, 0x2e, 0x00, 0x50, 0x2c, 0x00, 0x04, 0x00, 0x01, 1540x00, 0x33, 0x2e, 0x00, 0x50, 0x2c, 0x00, 0x01, 0x00, 0x01,
1550x94, 0x61, 0x6d, 0x62, 0x69, 0x67, 0x75, 0x6f, 0x75, 0x73, 1550x94, 0x61, 0x6d, 0x62, 0x69, 0x67, 0x75, 0x6f, 0x75, 0x73,
1560x26, 0x02, 0x05, 0x75, 0x02, 0x41, 0x6d, 0x6f, 0x72, 0x65, 1560x26, 0x02, 0x05, 0x75, 0x02, 0x41, 0x6d, 0x6f, 0x72, 0x65,
1570x93, 0x02, 0x00, 0xd4, 0x00, 0x11, 0x74, 0x58, 0x06, 0x40, 1570x93, 0x02, 0x00, 0xd4, 0x00, 0x11, 0x74, 0x58, 0x06, 0x40,
1580x73, 0x6f, 0x6d, 0x65, 0x73, 0x02, 0x12, 0x73, 0x1d, 0x00, 1580x73, 0x6f, 0x6d, 0x65, 0x73, 0x02, 0x12, 0x73, 0x1d, 0x00,
1590x40, 0x73, 0x75, 0x62, 0x74, 0x92, 0x01, 0x51, 0x73, 0x6f, 1590x40, 0x73, 0x75, 0x62, 0x74, 0x92, 0x01, 0x20, 0x73, 0x6f,
1600x00, 0x69, 0x66, 0xe7, 0x04, 0x45, 0x6c, 0x69, 0x6b, 0x65, 1600xcd, 0x05, 0x00, 0xe7, 0x04, 0x45, 0x6c, 0x69, 0x6b, 0x65,
1610x14, 0x05, 0x01, 0x04, 0x04, 0x50, 0x6f, 0x66, 0x66, 0x00, 1610x14, 0x05, 0x01, 0x04, 0x04, 0x20, 0x6f, 0x66, 0x97, 0x01,
1620x74, 0xc2, 0x06, 0xb0, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 1620xe0, 0x69, 0x73, 0x00, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72,
1630x65, 0x2e, 0x00, 0x41, 0x6c, 0x30, 0x01, 0x41, 0x66, 0x69, 1630x65, 0x2e, 0x00, 0x41, 0x6c, 0x30, 0x01, 0x41, 0x66, 0x69,
1640x6e, 0x64, 0x72, 0x03, 0x03, 0xb9, 0x02, 0x72, 0x70, 0x6f, 1640x6e, 0x64, 0x72, 0x03, 0x03, 0xb9, 0x02, 0x76, 0x70, 0x6f,
1650x73, 0x73, 0x69, 0x62, 0x6c, 0xa8, 0x00, 0x09, 0x88, 0x00, 1650x73, 0x73, 0x69, 0x62, 0x6c, 0xa8, 0x00, 0x05, 0x88, 0x00,
1660x00, 0xd2, 0x04, 0x30, 0x64, 0x64, 0x69, 0x14, 0x00, 0xf2, 1660x00, 0xd2, 0x04, 0x30, 0x64, 0x64, 0x69, 0x14, 0x00, 0xf2,
1670x01, 0x61, 0x6c, 0x00, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 1670x01, 0x61, 0x6c, 0x00, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65,
1680x6e, 0x67, 0x65, 0x00, 0x66, 0x6f, 0x72, 0x1c, 0x00, 0x10, 1680x6e, 0x67, 0x65, 0x00, 0x66, 0x6f, 0x72, 0x1c, 0x00, 0x10,
1690x76, 0x57, 0x08, 0x10, 0x64, 0x65, 0x04, 0x10, 0x79, 0x88, 1690x76, 0x57, 0x08, 0x10, 0x64, 0x65, 0x04, 0x10, 0x79, 0x88,
1700x03, 0x75, 0x54, 0x75, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x7a, 1700x03, 0x40, 0x54, 0x75, 0x72, 0x6e, 0x5a, 0x00, 0x05, 0x7a,
1710x00, 0x03, 0x8c, 0x02, 0x06, 0x1b, 0x05, 0x84, 0x73, 0x70, 1710x00, 0x03, 0x8c, 0x02, 0x05, 0x1b, 0x05, 0x50, 0x73, 0x70,
1720x65, 0x65, 0x64, 0x00, 0x75, 0x70, 0x55, 0x07, 0xc0, 0x67, 1720x65, 0x65, 0x64, 0xeb, 0x01, 0x03, 0x55, 0x07, 0xc0, 0x67,
1730x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 1730x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
1740x00, 1740x00,
175}; 175};
diff --git a/apps/plugins/puzzles/help/fifteen.c b/apps/plugins/puzzles/help/fifteen.c
index 72856d1061..eb3f84ab26 100644
--- a/apps/plugins/puzzles/help/fifteen.c
+++ b/apps/plugins/puzzles/help/fifteen.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -15,7 +15,7 @@ struct style_text help_text_style[] = {
15 LAST_STYLE_ITEM 15 LAST_STYLE_ITEM
16}; 16};
17 17
18/* orig 1245 comp 924 ratio 0.742169 level 11 saved 321 */ 18/* orig 1245 comp 925 ratio 0.742972 level 5 saved 320 */
19const char help_text[] = { 19const char help_text[] = {
200xf1, 0x29, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 200xf1, 0x29, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
210x35, 0x3a, 0x20, 0x46, 0x69, 0x66, 0x74, 0x65, 0x65, 0x6e, 210x35, 0x3a, 0x20, 0x46, 0x69, 0x66, 0x74, 0x65, 0x65, 0x6e,
@@ -36,80 +36,80 @@ const char help_text[] = {
360x70, 0x00, 0x30, 0x73, 0x69, 0x78, 0xa2, 0x00, 0x20, 0x74, 360x70, 0x00, 0x30, 0x73, 0x69, 0x78, 0xa2, 0x00, 0x20, 0x74,
370x68, 0x81, 0x00, 0x51, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5b, 370x68, 0x81, 0x00, 0x51, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5b,
380x00, 0x61, 0x72, 0x00, 0x6d, 0x6f, 0x76, 0x65, 0x95, 0x00, 380x00, 0x61, 0x72, 0x00, 0x6d, 0x6f, 0x76, 0x65, 0x95, 0x00,
390xa1, 0x6f, 0x00, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x00, 390x70, 0x6f, 0x00, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x69, 0x00,
400x61, 0x3c, 0x00, 0x80, 0x00, 0x6e, 0x65, 0x78, 0x74, 0x00, 400x00, 0x3c, 0x00, 0x50, 0x00, 0x6e, 0x65, 0x78, 0x74, 0x16,
410x74, 0x6f, 0x3e, 0x00, 0x02, 0x31, 0x00, 0x61, 0x00, 0x73, 410x00, 0x00, 0x3e, 0x00, 0x01, 0x31, 0x00, 0x62, 0x00, 0x73,
420x70, 0x61, 0x63, 0x65, 0x53, 0x00, 0x01, 0xa5, 0x00, 0x72, 420x70, 0x61, 0x63, 0x65, 0x53, 0x00, 0x00, 0xa5, 0x00, 0x73,
430x65, 0x00, 0x69, 0x74, 0x00, 0x69, 0x6e, 0x23, 0x00, 0x02, 430x65, 0x00, 0x69, 0x74, 0x00, 0x69, 0x6e, 0x23, 0x00, 0x01,
440x1d, 0x00, 0x11, 0x2e, 0xff, 0x00, 0x33, 0x61, 0x69, 0x6d, 440x1d, 0x00, 0x11, 0x2e, 0xff, 0x00, 0x33, 0x61, 0x69, 0x6d,
450x52, 0x00, 0x61, 0x65, 0x6e, 0x64, 0x00, 0x75, 0x70, 0xd8, 450x52, 0x00, 0x62, 0x65, 0x6e, 0x64, 0x00, 0x75, 0x70, 0xd8,
460x00, 0x00, 0x25, 0x00, 0x02, 0x95, 0x00, 0x12, 0x00, 0xa7, 460x00, 0x00, 0x25, 0x00, 0x01, 0x95, 0x00, 0x12, 0x00, 0xa7,
470x00, 0xd1, 0x65, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x00, 0x6f, 470x00, 0xd6, 0x65, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x00, 0x6f,
480x72, 0x64, 0x65, 0x72, 0x2c, 0x23, 0x00, 0x06, 0x48, 0x00, 480x72, 0x64, 0x65, 0x72, 0x2c, 0x23, 0x00, 0x01, 0x48, 0x00,
490x32, 0x00, 0x69, 0x6e, 0x38, 0x01, 0xe0, 0x6f, 0x74, 0x74, 490x00, 0x23, 0x00, 0x01, 0x38, 0x01, 0xe0, 0x6f, 0x74, 0x74,
500x6f, 0x6d, 0x00, 0x72, 0x69, 0x67, 0x68, 0x74, 0x00, 0x28, 500x6f, 0x6d, 0x00, 0x72, 0x69, 0x67, 0x68, 0x74, 0x00, 0x28,
510x73, 0x6a, 0x00, 0x22, 0x61, 0x74, 0x4a, 0x00, 0xf0, 0x05, 510x73, 0x6a, 0x00, 0x22, 0x61, 0x74, 0x4a, 0x00, 0xf5, 0x05,
520x6f, 0x70, 0x00, 0x72, 0x6f, 0x77, 0x00, 0x72, 0x65, 0x61, 520x6f, 0x70, 0x00, 0x72, 0x6f, 0x77, 0x00, 0x72, 0x65, 0x61,
530x64, 0x73, 0x00, 0x31, 0x2c, 0x32, 0x2c, 0x33, 0x2c, 0x34, 530x64, 0x73, 0x00, 0x31, 0x2c, 0x32, 0x2c, 0x33, 0x2c, 0x34,
540x9b, 0x00, 0x07, 0x38, 0x00, 0x08, 0x21, 0x00, 0x81, 0x33, 540xee, 0x00, 0x04, 0x38, 0x00, 0x06, 0x21, 0x00, 0x81, 0x33,
550x2c, 0x31, 0x34, 0x2c, 0x31, 0x35, 0x2c, 0x5f, 0x00, 0x85, 550x2c, 0x31, 0x34, 0x2c, 0x31, 0x35, 0x2c, 0x5f, 0x00, 0x85,
560x29, 0x2e, 0x00, 0x00, 0x00, 0x35, 0x2e, 0x31, 0xb8, 0x01, 560x29, 0x2e, 0x00, 0x00, 0x00, 0x35, 0x2e, 0x31, 0xb8, 0x01,
570x00, 0x3e, 0x01, 0x41, 0x72, 0x6f, 0x6c, 0x73, 0xc1, 0x01, 570x00, 0x3e, 0x01, 0x42, 0x72, 0x6f, 0x6c, 0x73, 0xc1, 0x01,
580x00, 0xa6, 0x01, 0xc3, 0x67, 0x61, 0x6d, 0x65, 0x00, 0x63, 580xf3, 0x00, 0x69, 0x73, 0x00, 0x67, 0x61, 0x6d, 0x65, 0x00,
590x61, 0x6e, 0x00, 0x62, 0x65, 0x00, 0x1d, 0x00, 0x36, 0x6c, 590x63, 0x61, 0x6e, 0x00, 0x62, 0x65, 0x00, 0x1d, 0x00, 0x36,
600x65, 0x64, 0xa6, 0x00, 0x81, 0x6d, 0x6f, 0x75, 0x73, 0x65, 600x6c, 0x65, 0x64, 0xa6, 0x00, 0x81, 0x6d, 0x6f, 0x75, 0x73,
610x00, 0x6f, 0x72, 0x0d, 0x00, 0x80, 0x6b, 0x65, 0x79, 0x62, 610x65, 0x00, 0x6f, 0x72, 0x0d, 0x00, 0x80, 0x6b, 0x65, 0x79,
620x6f, 0x61, 0x72, 0x64, 0x56, 0x00, 0xca, 0x41, 0x00, 0x6c, 620x62, 0x6f, 0x61, 0x72, 0x64, 0x56, 0x00, 0xcc, 0x41, 0x00,
630x65, 0x66, 0x74, 0x2d, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x2f, 630x6c, 0x65, 0x66, 0x74, 0x2d, 0x63, 0x6c, 0x69, 0x63, 0x6b,
640x00, 0x04, 0xd5, 0x00, 0x00, 0x96, 0x00, 0x00, 0x3a, 0x00, 640x2f, 0x00, 0x03, 0xd5, 0x00, 0x00, 0x96, 0x00, 0x94, 0x6f,
650x64, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0xb9, 0x01, 0x3c, 650x72, 0x00, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0xb9, 0x01,
660x69, 0x6e, 0x67, 0x6a, 0x01, 0x52, 0x00, 0x77, 0x69, 0x6c, 660x01, 0xf2, 0x01, 0x0a, 0x6a, 0x01, 0x52, 0x00, 0x77, 0x69,
670x6c, 0xa0, 0x01, 0x72, 0x61, 0x73, 0x00, 0x6d, 0x61, 0x6e, 670x6c, 0x6c, 0xa0, 0x01, 0x73, 0x61, 0x73, 0x00, 0x6d, 0x61,
680x79, 0x40, 0x01, 0x00, 0x0e, 0x00, 0xc1, 0x6e, 0x65, 0x63, 680x6e, 0x79, 0x40, 0x01, 0xc0, 0x61, 0x73, 0x00, 0x6e, 0x65,
690x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x00, 0x74, 0x6f, 0x23, 690x63, 0x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x66, 0x01, 0x01,
700x00, 0x07, 0x3c, 0x01, 0x27, 0x74, 0x6f, 0x74, 0x00, 0x83, 700x23, 0x00, 0x06, 0x3c, 0x01, 0x27, 0x74, 0x6f, 0x74, 0x00,
710x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x9a, 0x02, 710x83, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x9a,
720x50, 0x61, 0x72, 0x72, 0x6f, 0x77, 0xb1, 0x00, 0x15, 0x73, 720x02, 0x20, 0x61, 0x72, 0x7e, 0x00, 0x48, 0x6b, 0x65, 0x79,
730x5e, 0x00, 0x05, 0xf1, 0x01, 0x70, 0x61, 0x64, 0x6a, 0x61, 730x73, 0x5e, 0x00, 0x02, 0xf1, 0x01, 0x75, 0x61, 0x64, 0x6a,
740x63, 0x65, 0x6e, 0xf5, 0x01, 0x0e, 0x8a, 0x01, 0xfe, 0x0c, 740x61, 0x63, 0x65, 0x6e, 0xf5, 0x01, 0x09, 0x8a, 0x01, 0xf4,
750x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x00, 750x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
760x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x00, 760x00, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64,
770x28, 0x6d, 0x6f, 0x76, 0x69, 0x6e, 0x67, 0x2d, 0x00, 0x77, 770x00, 0x28, 0x6d, 0x6f, 0x76, 0xb8, 0x00, 0x09, 0x2d, 0x00,
780x6f, 0x70, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x36, 0x00, 0x01, 780x77, 0x6f, 0x70, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x36, 0x00,
790x72, 0x01, 0x50, 0x50, 0x72, 0x65, 0x73, 0x73, 0x31, 0x00, 790x01, 0x72, 0x01, 0x50, 0x50, 0x72, 0x65, 0x73, 0x73, 0x31,
800x33, 0x60, 0x68, 0x27, 0x7f, 0x00, 0x20, 0x61, 0x6b, 0x7f, 800x00, 0x33, 0x60, 0x68, 0x27, 0x7f, 0x00, 0x20, 0x61, 0x6b,
810x00, 0x91, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 810x7f, 0x00, 0x60, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x53,
820x64, 0x90, 0x00, 0x1a, 0x2e, 0x29, 0x00, 0xb3, 0x65, 0x6e, 820x00, 0x00, 0x90, 0x00, 0x1a, 0x2e, 0x29, 0x00, 0xb3, 0x65,
830x6f, 0x75, 0x67, 0x68, 0x00, 0x74, 0x69, 0x6d, 0x65, 0xb5, 830x6e, 0x6f, 0x75, 0x67, 0x68, 0x00, 0x74, 0x69, 0x6d, 0x65,
840x00, 0x32, 0x73, 0x6f, 0x6c, 0xf1, 0x00, 0x01, 0xa7, 0x01, 840xb5, 0x00, 0x33, 0x73, 0x6f, 0x6c, 0xf1, 0x00, 0x00, 0xa7,
850x50, 0x2c, 0x00, 0x62, 0x75, 0x74, 0x8b, 0x02, 0xe0, 0x6d, 850x01, 0x50, 0x2c, 0x00, 0x62, 0x75, 0x74, 0x8b, 0x02, 0xe0,
860x61, 0x79, 0x00, 0x73, 0x63, 0x72, 0x61, 0x6d, 0x62, 0x6c, 860x6d, 0x61, 0x79, 0x00, 0x73, 0x63, 0x72, 0x61, 0x6d, 0x62,
870x65, 0x00, 0x79, 0xdc, 0x02, 0x40, 0x70, 0x72, 0x6f, 0x67, 870x6c, 0x65, 0x00, 0x79, 0xdc, 0x02, 0x40, 0x70, 0x72, 0x6f,
880x4b, 0x00, 0x30, 0x00, 0x77, 0x68, 0xe1, 0x00, 0x20, 0x64, 880x67, 0x4b, 0x00, 0x30, 0x00, 0x77, 0x68, 0xe1, 0x00, 0x20,
890x6f, 0x54, 0x00, 0x20, 0x73, 0x6f, 0x8c, 0x00, 0x41, 0x28, 890x64, 0x6f, 0x54, 0x00, 0x20, 0x73, 0x6f, 0x8c, 0x00, 0x41,
900x41, 0x6c, 0x6c, 0x43, 0x00, 0x11, 0x61, 0xa0, 0x00, 0xb0, 900x28, 0x41, 0x6c, 0x6c, 0x43, 0x00, 0x11, 0x61, 0xa0, 0x00,
910x73, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 910xb0, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62,
920x64, 0xc5, 0x00, 0x13, 0x73, 0xec, 0x00, 0x31, 0x32, 0x2e, 920x65, 0x64, 0xc5, 0x00, 0x13, 0x73, 0xec, 0x00, 0x31, 0x32,
930x31, 0xc4, 0x03, 0xf1, 0x01, 0x61, 0x6c, 0x73, 0x6f, 0x00, 930x2e, 0x31, 0xc4, 0x03, 0xf1, 0x01, 0x61, 0x6c, 0x73, 0x6f,
940x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 940x00, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65,
950x29, 0x3f, 0x02, 0x15, 0x32, 0x3f, 0x02, 0xa5, 0x70, 0x61, 950x2e, 0x29, 0x3f, 0x02, 0x15, 0x32, 0x3f, 0x02, 0xa5, 0x70,
960x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x02, 0x04, 960x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x02,
970x61, 0x6e, 0x6c, 0x79, 0x00, 0x6f, 0x70, 0x5b, 0x00, 0x06, 970x04, 0x62, 0x6e, 0x6c, 0x79, 0x00, 0x6f, 0x70, 0x5b, 0x00,
980x39, 0x00, 0x51, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x76, 0x00, 980x05, 0x39, 0x00, 0x51, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x76,
990xb3, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 990x00, 0xb3, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e,
1000x2e, 0x27, 0x27, 0x00, 0x32, 0x00, 0x6f, 0x6e, 0x1a, 0x00, 1000x2e, 0x2e, 0x27, 0x27, 0x00, 0x22, 0x00, 0x6f, 0x3c, 0x01,
1010xa1, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 1010xb1, 0x60, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 0x65,
1020x75, 0x7b, 0x00, 0x51, 0x57, 0x69, 0x64, 0x74, 0x68, 0xd9, 1020x6e, 0x75, 0x7b, 0x00, 0x51, 0x57, 0x69, 0x64, 0x74, 0x68,
1030x02, 0x20, 0x48, 0x65, 0x07, 0x03, 0x10, 0x2c, 0xcd, 0x00, 1030xd9, 0x02, 0x20, 0x48, 0x65, 0x07, 0x03, 0x10, 0x2c, 0xcd,
1040x21, 0x63, 0x68, 0x1c, 0x00, 0xf1, 0x07, 0x73, 0x65, 0x6c, 1040x00, 0x21, 0x63, 0x68, 0x1c, 0x00, 0xf1, 0x07, 0x73, 0x65,
1050x66, 0x2d, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x6e, 0x61, 0x74, 1050x6c, 0x66, 0x2d, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x6e, 0x61,
1060x6f, 0x72, 0x79, 0x2e, 0x00, 0x28, 0x4f, 0x6e, 0x63, 0xfd, 1060x74, 0x6f, 0x72, 0x79, 0x2e, 0x00, 0x28, 0x4f, 0x6e, 0x63,
1070x00, 0xa1, 0x27, 0x76, 0x65, 0x00, 0x63, 0x68, 0x61, 0x6e, 1070xfd, 0x00, 0xa1, 0x27, 0x76, 0x65, 0x00, 0x63, 0x68, 0x61,
1080x67, 0x65, 0x12, 0x03, 0xe9, 0x73, 0x65, 0x2c, 0x00, 0x69, 1080x6e, 0x67, 0x65, 0x12, 0x03, 0xe9, 0x73, 0x65, 0x2c, 0x00,
1090x74, 0x27, 0x73, 0x00, 0x6e, 0x6f, 0x74, 0x00, 0x61, 0x75, 1090x69, 0x74, 0x27, 0x73, 0x00, 0x6e, 0x6f, 0x74, 0x00, 0x61,
1100x04, 0x00, 0x58, 0x02, 0xf0, 0x03, 0x6d, 0x6f, 0x72, 0x65, 1100x75, 0x04, 0x00, 0x58, 0x02, 0xf0, 0x03, 0x6d, 0x6f, 0x72,
1110x2c, 0x00, 0x6f, 0x66, 0x00, 0x63, 0x6f, 0x75, 0x72, 0x73, 1110x65, 0x2c, 0x00, 0x6f, 0x66, 0x00, 0x63, 0x6f, 0x75, 0x72,
1120x65, 0x21, 0x29, 0x00, 1120x73, 0x65, 0x21, 0x29, 0x00,
113}; 113};
114 114
115const unsigned short help_text_len = 1245; 115const unsigned short help_text_len = 1245;
diff --git a/apps/plugins/puzzles/help/filling.c b/apps/plugins/puzzles/help/filling.c
index bf40041cff..15ba8cbe43 100644
--- a/apps/plugins/puzzles/help/filling.c
+++ b/apps/plugins/puzzles/help/filling.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -11,7 +11,7 @@ struct style_text help_text_style[] = {
11 LAST_STYLE_ITEM 11 LAST_STYLE_ITEM
12}; 12};
13 13
14/* orig 1804 comp 1242 ratio 0.68847 level 11 saved 562 */ 14/* orig 1804 comp 1242 ratio 0.68847 level 10 saved 562 */
15const char help_text[] = { 15const char help_text[] = {
160xf0, 0x28, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 160xf0, 0x28, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
170x32, 0x39, 0x3a, 0x20, 0x46, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 170x32, 0x39, 0x3a, 0x20, 0x46, 0x69, 0x6c, 0x6c, 0x69, 0x6e,
@@ -26,37 +26,37 @@ const char help_text[] = {
260x65, 0x00, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x5b, 0x00, 260x65, 0x00, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x5b, 0x00,
270xf5, 0x02, 0x72, 0x00, 0x6a, 0x6f, 0x62, 0x00, 0x69, 0x73, 270xf5, 0x02, 0x72, 0x00, 0x6a, 0x6f, 0x62, 0x00, 0x69, 0x73,
280x00, 0x74, 0x6f, 0x00, 0x66, 0x69, 0x6c, 0x6c, 0x00, 0x40, 280x00, 0x74, 0x6f, 0x00, 0x66, 0x69, 0x6c, 0x6c, 0x00, 0x40,
290x00, 0x00, 0x0a, 0x00, 0x23, 0x74, 0x68, 0x2c, 0x00, 0x05, 290x00, 0x00, 0x0a, 0x00, 0x23, 0x74, 0x68, 0x2c, 0x00, 0x06,
300x73, 0x00, 0x00, 0x16, 0x00, 0x20, 0x73, 0x75, 0x47, 0x00, 300x73, 0x00, 0x50, 0x69, 0x6e, 0x00, 0x73, 0x75, 0x47, 0x00,
310xc2, 0x00, 0x77, 0x61, 0x79, 0x00, 0x74, 0x68, 0x61, 0x74, 310xc2, 0x00, 0x77, 0x61, 0x79, 0x00, 0x74, 0x68, 0x61, 0x74,
320x00, 0x65, 0x61, 0x7d, 0x00, 0xd7, 0x6e, 0x65, 0x63, 0x74, 320x00, 0x65, 0x61, 0x7d, 0x00, 0xd7, 0x6e, 0x65, 0x63, 0x74,
330x65, 0x64, 0x00, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0xa8, 330x65, 0x64, 0x00, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0xa8,
340x00, 0x44, 0x00, 0x61, 0x6c, 0x6c, 0x9d, 0x00, 0x31, 0x69, 340x00, 0x44, 0x00, 0x61, 0x6c, 0x6c, 0x9d, 0x00, 0x31, 0x69,
350x6e, 0x67, 0x56, 0x00, 0x42, 0x73, 0x61, 0x6d, 0x65, 0x69, 350x6e, 0x67, 0x56, 0x00, 0x42, 0x73, 0x61, 0x6d, 0x65, 0x69,
360x00, 0x70, 0x00, 0x68, 0x61, 0x73, 0x00, 0x61, 0x6e, 0x98, 360x00, 0x70, 0x00, 0x68, 0x61, 0x73, 0x00, 0x61, 0x6e, 0x98,
370x00, 0xa1, 0x61, 0x00, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x00, 370x00, 0x70, 0x61, 0x00, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x8c,
380x74, 0x6f, 0x59, 0x00, 0x02, 0x20, 0x00, 0x7b, 0x2e, 0x00, 380x00, 0x01, 0x59, 0x00, 0x01, 0x20, 0x00, 0x7b, 0x2e, 0x00,
390x00, 0x00, 0x28, 0x60, 0x43, 0x5f, 0x00, 0x61, 0x27, 0x2c, 390x00, 0x00, 0x28, 0x60, 0x43, 0x5f, 0x00, 0x61, 0x27, 0x2c,
400x00, 0x66, 0x6f, 0x72, 0x4b, 0x00, 0x80, 0x70, 0x75, 0x72, 400x00, 0x66, 0x6f, 0x72, 0x4b, 0x00, 0x80, 0x70, 0x75, 0x72,
410x70, 0x6f, 0x73, 0x65, 0x73, 0x72, 0x00, 0xf0, 0x09, 0x74, 410x70, 0x6f, 0x73, 0x65, 0x73, 0x72, 0x00, 0xf0, 0x09, 0x74,
420x68, 0x69, 0x73, 0x00, 0x67, 0x61, 0x6d, 0x65, 0x2c, 0x00, 420x68, 0x69, 0x73, 0x00, 0x67, 0x61, 0x6d, 0x65, 0x2c, 0x00,
430x64, 0x6f, 0x65, 0x73, 0x00, 0x6e, 0x6f, 0x74, 0x00, 0x63, 430x64, 0x6f, 0x65, 0x73, 0x00, 0x6e, 0x6f, 0x74, 0x00, 0x63,
440x6f, 0x75, 0x6e, 0x4c, 0x00, 0xf5, 0x03, 0x61, 0x67, 0x6f, 440x6f, 0x75, 0x6e, 0x4c, 0x00, 0xf0, 0x00, 0x61, 0x67, 0x6f,
450x6e, 0x61, 0x6c, 0x6c, 0x79, 0x00, 0x73, 0x65, 0x70, 0x61, 450x6e, 0x61, 0x6c, 0x6c, 0x79, 0x00, 0x73, 0x65, 0x70, 0x61,
460x72, 0x61, 0x74, 0x65, 0x64, 0xa1, 0x00, 0x00, 0x82, 0x00, 460x72, 0x61, 0x4c, 0x00, 0x05, 0xa1, 0x00, 0xf2, 0x17, 0x73,
470xf2, 0x14, 0x64, 0x6a, 0x61, 0x63, 0x65, 0x6e, 0x74, 0x2e, 470x00, 0x61, 0x64, 0x6a, 0x61, 0x63, 0x65, 0x6e, 0x74, 0x2e,
480x29, 0x00, 0x00, 0x00, 0x46, 0x6f, 0x72, 0x00, 0x65, 0x78, 480x29, 0x00, 0x00, 0x00, 0x46, 0x6f, 0x72, 0x00, 0x65, 0x78,
490x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x00, 0x69, 0x74, 0x00, 490x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x00, 0x69, 0x74, 0x00,
500x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x73, 0x96, 0x00, 0x23, 500x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x73, 0x96, 0x00, 0x23,
510x6e, 0x6f, 0x38, 0x00, 0x45, 0x00, 0x63, 0x61, 0x6e, 0x75, 510x6e, 0x6f, 0x38, 0x00, 0x45, 0x00, 0x63, 0x61, 0x6e, 0x75,
520x01, 0x61, 0x61, 0x00, 0x7a, 0x65, 0x72, 0x6f, 0x75, 0x01, 520x01, 0x64, 0x61, 0x00, 0x7a, 0x65, 0x72, 0x6f, 0x75, 0x01,
530x02, 0x27, 0x00, 0x35, 0x74, 0x77, 0x6f, 0x55, 0x00, 0x04, 530x65, 0x61, 0x74, 0x00, 0x74, 0x77, 0x6f, 0x55, 0x00, 0x05,
540x69, 0x00, 0x00, 0x32, 0x00, 0x01, 0x94, 0x00, 0x47, 0x62, 540x69, 0x00, 0x00, 0x32, 0x00, 0x00, 0x94, 0x00, 0x47, 0x62,
550x6f, 0x74, 0x68, 0x3b, 0x00, 0x73, 0x6f, 0x6e, 0x65, 0x2e, 550x6f, 0x74, 0x68, 0x3b, 0x00, 0x74, 0x6f, 0x6e, 0x65, 0x2e,
560x00, 0x4e, 0x6f, 0xdc, 0x00, 0x09, 0x12, 0x01, 0x70, 0x67, 560x00, 0x4e, 0x6f, 0x3b, 0x01, 0x08, 0x12, 0x01, 0x70, 0x67,
570x72, 0x65, 0x61, 0x74, 0x65, 0x72, 0x54, 0x00, 0xc0, 0x6e, 570x72, 0x65, 0x61, 0x74, 0x65, 0x72, 0x54, 0x00, 0xc0, 0x6e,
580x00, 0x39, 0x00, 0x28, 0x62, 0x65, 0x63, 0x61, 0x75, 0x73, 580x00, 0x39, 0x00, 0x28, 0x62, 0x65, 0x63, 0x61, 0x75, 0x73,
590x65, 0xfa, 0x00, 0x52, 0x6e, 0x00, 0x69, 0x74, 0x73, 0x26, 590x65, 0xfa, 0x00, 0x20, 0x6e, 0x00, 0xa7, 0x01, 0x01, 0x26,
600x00, 0x52, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x5a, 0x00, 0x00, 600x00, 0x52, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x5a, 0x00, 0x00,
610x29, 0x02, 0x53, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x60, 0x01, 610x29, 0x02, 0x53, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x60, 0x01,
620x10, 0x29, 0x41, 0x01, 0x41, 0x43, 0x72, 0x65, 0x64, 0xc8, 620x10, 0x29, 0x41, 0x01, 0x41, 0x43, 0x72, 0x65, 0x64, 0xc8,
@@ -64,11 +64,11 @@ const char help_text[] = {
640x6c, 0x65, 0x00, 0x67, 0x6f, 0x65, 0xfa, 0x01, 0xb0, 0x4e, 640x6c, 0x65, 0x00, 0x67, 0x6f, 0x65, 0xfa, 0x01, 0xb0, 0x4e,
650x69, 0x6b, 0x6f, 0x6c, 0x69, 0x00, 0x5b, 0x31, 0x34, 0x5d, 650x69, 0x6b, 0x6f, 0x6c, 0x69, 0x00, 0x5b, 0x31, 0x34, 0x5d,
660x2e, 0x00, 0x03, 0x7e, 0x02, 0x41, 0x00, 0x77, 0x61, 0x73, 660x2e, 0x00, 0x03, 0x7e, 0x02, 0x41, 0x00, 0x77, 0x61, 0x73,
670xa5, 0x00, 0x72, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 670xa5, 0x00, 0x40, 0x72, 0x69, 0x62, 0x75, 0x2f, 0x01, 0x01,
680x98, 0x01, 0x10, 0x69, 0x14, 0x00, 0x50, 0x6c, 0x6c, 0x65, 680x98, 0x01, 0x10, 0x69, 0x14, 0x00, 0x50, 0x6c, 0x6c, 0x65,
690x63, 0x74, 0xab, 0x00, 0xf1, 0x04, 0x62, 0x79, 0x00, 0x4a, 690x63, 0x74, 0xab, 0x00, 0xf0, 0x01, 0x62, 0x79, 0x00, 0x4a,
700x6f, 0x6e, 0x61, 0x73, 0x00, 0x4b, 0x6f, 0x65, 0x6c, 0x6b, 700x6f, 0x6e, 0x61, 0x73, 0x00, 0x4b, 0x6f, 0x65, 0x6c, 0x6b,
710x65, 0x72, 0x2e, 0x00, 0x00, 0x47, 0x00, 0xd1, 0x00, 0x68, 710x65, 0x72, 0x3f, 0x00, 0x00, 0x47, 0x00, 0xd1, 0x00, 0x68,
720x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 720x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e,
730x6e, 0x5e, 0x00, 0xa2, 0x2e, 0x63, 0x6f, 0x2e, 0x6a, 0x70, 730x6e, 0x5e, 0x00, 0xa2, 0x2e, 0x63, 0x6f, 0x2e, 0x6a, 0x70,
740x2f, 0x65, 0x6e, 0x2f, 0x7d, 0x00, 0x20, 0x73, 0x2f, 0x70, 740x2f, 0x65, 0x6e, 0x2f, 0x7d, 0x00, 0x20, 0x73, 0x2f, 0x70,
@@ -79,20 +79,20 @@ const char help_text[] = {
790x00, 0xe1, 0x2c, 0x00, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x79, 790x00, 0xe1, 0x2c, 0x00, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x79,
800x00, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x05, 0x02, 0x20, 0x6d, 800x00, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x05, 0x02, 0x20, 0x6d,
810x6f, 0x15, 0x01, 0x00, 0x4d, 0x01, 0x29, 0x6e, 0x79, 0xb3, 810x6f, 0x15, 0x01, 0x00, 0x4d, 0x01, 0x29, 0x6e, 0x79, 0xb3,
820x02, 0x04, 0x06, 0x03, 0x83, 0x6e, 0x00, 0x74, 0x79, 0x70, 820x02, 0x04, 0x06, 0x03, 0x50, 0x6e, 0x00, 0x74, 0x79, 0x70,
830x65, 0x00, 0x61, 0x75, 0x02, 0x12, 0x6f, 0xdd, 0x02, 0x84, 830x1c, 0x01, 0x02, 0x75, 0x02, 0x12, 0x6f, 0xdd, 0x02, 0x85,
840x6b, 0x65, 0x79, 0x62, 0x6f, 0x61, 0x72, 0x64, 0xff, 0x02, 840x6b, 0x65, 0x79, 0x62, 0x6f, 0x61, 0x72, 0x64, 0xff, 0x02,
850x00, 0x67, 0x01, 0x04, 0xae, 0x01, 0xd6, 0x2e, 0x00, 0x42, 850x01, 0xbb, 0x01, 0x02, 0x3a, 0x00, 0xa4, 0x2e, 0x00, 0x42,
860x79, 0x00, 0x64, 0x72, 0x61, 0x67, 0x67, 0x69, 0x6e, 0x67, 860x79, 0x00, 0x64, 0x72, 0x61, 0x67, 0x67, 0xb5, 0x02, 0x01,
870x65, 0x00, 0x51, 0x2c, 0x00, 0x79, 0x6f, 0x75, 0xc9, 0x01, 870x65, 0x00, 0x51, 0x2c, 0x00, 0x79, 0x6f, 0x75, 0xc9, 0x01,
880x20, 0x73, 0x65, 0x06, 0x01, 0x93, 0x00, 0x6d, 0x75, 0x6c, 880x20, 0x73, 0x65, 0x06, 0x01, 0x95, 0x00, 0x6d, 0x75, 0x6c,
890x74, 0x69, 0x70, 0x6c, 0x65, 0x37, 0x00, 0x06, 0x4b, 0x03, 890x74, 0x69, 0x70, 0x6c, 0x65, 0xe5, 0x01, 0x04, 0x4c, 0x00,
900x44, 0x77, 0x69, 0x74, 0x68, 0x8d, 0x01, 0x01, 0x6b, 0x00, 900x46, 0x77, 0x69, 0x74, 0x68, 0x8d, 0x01, 0xc1, 0x6b, 0x65,
910x91, 0x70, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x00, 0x49, 0x66, 910x79, 0x70, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x00, 0x49, 0x66,
920x43, 0x00, 0x30, 0x6d, 0x61, 0x6b, 0x90, 0x00, 0x8c, 0x6d, 920x43, 0x00, 0x30, 0x6d, 0x61, 0x6b, 0x90, 0x00, 0x8e, 0x6d,
930x69, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x2c, 0xcd, 0x00, 0x04, 930x69, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x2c, 0xcd, 0x00, 0x02,
940x80, 0x03, 0x98, 0x69, 0x6e, 0x63, 0x6f, 0x72, 0x72, 0x65, 940xa3, 0x00, 0x60, 0x69, 0x6e, 0x63, 0x6f, 0x72, 0x72, 0x69,
950x63, 0x74, 0xd1, 0x00, 0x01, 0x4a, 0x00, 0xf0, 0x01, 0x00, 950x00, 0x07, 0xd1, 0x00, 0x01, 0x4a, 0x00, 0xf0, 0x01, 0x00,
960x30, 0x2c, 0x00, 0x53, 0x70, 0x61, 0x63, 0x65, 0x2c, 0x00, 960x30, 0x2c, 0x00, 0x53, 0x70, 0x61, 0x63, 0x65, 0x2c, 0x00,
970x42, 0x61, 0x63, 0x6b, 0x73, 0x0b, 0x00, 0x61, 0x00, 0x6f, 970x42, 0x61, 0x63, 0x6b, 0x73, 0x0b, 0x00, 0x61, 0x00, 0x6f,
980x72, 0x00, 0x45, 0x6e, 0x31, 0x02, 0x70, 0x6f, 0x00, 0x63, 980x72, 0x00, 0x45, 0x6e, 0x31, 0x02, 0x70, 0x6f, 0x00, 0x63,
@@ -100,41 +100,41 @@ const char help_text[] = {
1000x02, 0x43, 0x28, 0x6f, 0x72, 0x00, 0x3b, 0x02, 0xd1, 0x00, 1000x02, 0x43, 0x28, 0x6f, 0x72, 0x00, 0x3b, 0x02, 0xd1, 0x00,
1010x55, 0x6e, 0x64, 0x6f, 0x00, 0x66, 0x65, 0x61, 0x74, 0x75, 1010x55, 0x6e, 0x64, 0x6f, 0x00, 0x66, 0x65, 0x61, 0x74, 0x75,
1020x72, 0x65, 0x22, 0x02, 0x13, 0x59, 0xd5, 0x00, 0x70, 0x61, 1020x72, 0x65, 0x22, 0x02, 0x13, 0x59, 0xd5, 0x00, 0x70, 0x61,
1030x6c, 0x73, 0x6f, 0x00, 0x6d, 0x6f, 0x70, 0x04, 0x32, 0x72, 1030x6c, 0x73, 0x6f, 0x00, 0x6d, 0x6f, 0x70, 0x04, 0x33, 0x72,
1040x6f, 0x75, 0x3c, 0x01, 0x01, 0x79, 0x04, 0x01, 0xcf, 0x00, 1040x6f, 0x75, 0x42, 0x04, 0x01, 0x79, 0x04, 0x01, 0xcf, 0x00,
1050x01, 0x0e, 0x00, 0x60, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 1050x00, 0x0e, 0x00, 0x60, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72,
1060xd1, 0x00, 0x20, 0x73, 0x3b, 0x56, 0x01, 0x35, 0x69, 0x6e, 1060xd1, 0x00, 0x20, 0x73, 0x3b, 0x56, 0x01, 0x00, 0x1f, 0x01,
1070x67, 0x58, 0x01, 0x44, 0x77, 0x69, 0x6c, 0x6c, 0x4a, 0x01, 1070x04, 0x58, 0x01, 0x10, 0x77, 0xf9, 0x00, 0x03, 0x4a, 0x01,
1080x04, 0x12, 0x01, 0x07, 0xfc, 0x03, 0x07, 0x40, 0x00, 0x01, 1080x04, 0x12, 0x01, 0x0c, 0xfc, 0x03, 0x03, 0x40, 0x00, 0x03,
1090x50, 0x00, 0x03, 0x52, 0x03, 0x55, 0x75, 0x6d, 0x62, 0x65, 1090x50, 0x00, 0x00, 0x52, 0x03, 0x55, 0x75, 0x6d, 0x62, 0x65,
1100x72, 0x4c, 0x00, 0x11, 0x30, 0x46, 0x00, 0x05, 0xbe, 0x00, 1100x72, 0x4c, 0x00, 0x12, 0x30, 0x46, 0x00, 0x04, 0xbe, 0x00,
1110x19, 0x2e, 0x9c, 0x00, 0x0f, 0x76, 0x01, 0x05, 0x00, 0xdc, 1110x1a, 0x2e, 0x9c, 0x00, 0x0f, 0x76, 0x01, 0x05, 0x00, 0xdc,
1120x02, 0x03, 0x49, 0x00, 0x00, 0x44, 0x00, 0x21, 0x6f, 0x72, 1120x02, 0x02, 0x49, 0x00, 0x00, 0x44, 0x00, 0x22, 0x6f, 0x72,
1130x40, 0x00, 0x00, 0x0c, 0x00, 0x06, 0xb9, 0x00, 0x61, 0x72, 1130x40, 0x00, 0x01, 0xc7, 0x02, 0x04, 0xb9, 0x00, 0x61, 0x72,
1140x65, 0x74, 0x75, 0x72, 0x6e, 0x41, 0x01, 0x51, 0x61, 0x72, 1140x65, 0x74, 0x75, 0x72, 0x6e, 0x41, 0x01, 0x51, 0x61, 0x72,
1150x72, 0x6f, 0x77, 0xc3, 0x00, 0x8b, 0x2c, 0x00, 0x62, 0x65, 1150x72, 0x6f, 0x77, 0xc3, 0x00, 0x8c, 0x2c, 0x00, 0x62, 0x65,
1160x66, 0x6f, 0x72, 0x65, 0xca, 0x00, 0x04, 0xc6, 0x01, 0x04, 1160x66, 0x6f, 0x72, 0x65, 0xca, 0x00, 0x04, 0xc6, 0x01, 0x04,
1170x4a, 0x00, 0x02, 0x6c, 0x04, 0x88, 0x68, 0x69, 0x67, 0x68, 1170x4a, 0x00, 0x01, 0x42, 0x00, 0x88, 0x68, 0x69, 0x67, 0x68,
1180x6c, 0x69, 0x67, 0x68, 0x3d, 0x04, 0x10, 0x28, 0xae, 0x03, 1180x6c, 0x69, 0x67, 0x68, 0x3d, 0x04, 0x10, 0x28, 0xae, 0x03,
1190x30, 0x62, 0x6f, 0x76, 0x48, 0x01, 0x42, 0x54, 0x68, 0x65, 1190x30, 0x62, 0x6f, 0x76, 0x48, 0x01, 0x10, 0x54, 0xf5, 0x00,
1200x00, 0x88, 0x01, 0x70, 0x62, 0x61, 0x72, 0x00, 0x61, 0x64, 1200x01, 0x88, 0x01, 0x70, 0x62, 0x61, 0x72, 0x00, 0x61, 0x64,
1210x64, 0xc9, 0x03, 0x00, 0xb4, 0x04, 0x00, 0x52, 0x01, 0x11, 1210x64, 0xc9, 0x03, 0x00, 0xb4, 0x04, 0x00, 0x52, 0x01, 0x14,
1220x73, 0x0b, 0x02, 0x09, 0x29, 0x02, 0x01, 0x1e, 0x00, 0x42, 1220x73, 0x0b, 0x02, 0x07, 0x29, 0x02, 0x00, 0x1e, 0x00, 0x42,
1230x66, 0x72, 0x6f, 0x6d, 0x2f, 0x01, 0x13, 0x65, 0x57, 0x03, 1230x66, 0x72, 0x6f, 0x6d, 0x2f, 0x01, 0x13, 0x65, 0x57, 0x03,
1240x15, 0x2e, 0xd1, 0x01, 0x02, 0xef, 0x01, 0x63, 0x65, 0x73, 1240x17, 0x2e, 0xd1, 0x01, 0x00, 0x22, 0x00, 0x63, 0x65, 0x73,
1250x63, 0x61, 0x70, 0x65, 0x47, 0x00, 0x00, 0x4f, 0x05, 0x05, 1250x63, 0x61, 0x70, 0x65, 0x47, 0x00, 0x01, 0x4f, 0x05, 0x05,
1260x43, 0x00, 0x0e, 0x3c, 0x00, 0x01, 0x30, 0x05, 0x13, 0x41, 1260xf6, 0x00, 0x0e, 0x3c, 0x00, 0x00, 0x30, 0x05, 0x13, 0x41,
1270x81, 0x01, 0x11, 0x61, 0x13, 0x00, 0xb1, 0x73, 0x00, 0x64, 1270x81, 0x01, 0x11, 0x61, 0x13, 0x00, 0xb1, 0x73, 0x00, 0x64,
1280x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0xc0, 0x05, 1280x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0xc0, 0x05,
1290x03, 0xbc, 0x03, 0x30, 0x32, 0x2e, 0x31, 0x3e, 0x04, 0x02, 1290x03, 0xbc, 0x03, 0x31, 0x32, 0x2e, 0x31, 0x0e, 0x06, 0x01,
1300x57, 0x01, 0xb2, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 1300x57, 0x01, 0xb2, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62,
1310x6c, 0x65, 0x2e, 0x29, 0x8a, 0x03, 0x15, 0x32, 0x8a, 0x03, 1310x6c, 0x65, 0x2e, 0x29, 0x8a, 0x03, 0x15, 0x32, 0x8a, 0x03,
1320x00, 0x2e, 0x05, 0x77, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 1320x00, 0x2e, 0x05, 0x77, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73,
1330x20, 0x1d, 0x04, 0x11, 0x61, 0x13, 0x05, 0x01, 0xca, 0x02, 1330x20, 0x1d, 0x04, 0x12, 0x61, 0x13, 0x05, 0x00, 0xca, 0x02,
1340x20, 0x74, 0x6f, 0xe3, 0x01, 0x51, 0x66, 0x69, 0x67, 0x75, 1340x20, 0x74, 0x6f, 0xe3, 0x01, 0x52, 0x66, 0x69, 0x67, 0x75,
1350x72, 0x5e, 0x02, 0x03, 0x88, 0x01, 0x00, 0x91, 0x05, 0x31, 1350x72, 0x5e, 0x02, 0x02, 0x88, 0x01, 0x00, 0x91, 0x05, 0x32,
1360x72, 0x6f, 0x77, 0x03, 0x01, 0x00, 0x34, 0x04, 0x30, 0x75, 1360x72, 0x6f, 0x77, 0x03, 0x01, 0x63, 0x63, 0x6f, 0x6c, 0x75,
1370x6d, 0x6e, 0xa5, 0x05, 0x05, 0x52, 0x02, 0x82, 0x2c, 0x00, 1370x6d, 0x6e, 0xa5, 0x05, 0x02, 0x52, 0x02, 0x82, 0x2c, 0x00,
1380x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x9d, 0x01, 0xd0, 0x60, 1380x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x9d, 0x01, 0xd0, 0x60,
1390x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 1390x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75,
1400x2e, 0x00, 1400x2e, 0x00,
diff --git a/apps/plugins/puzzles/help/flip.c b/apps/plugins/puzzles/help/flip.c
index 06606d97b2..c451e8c672 100644
--- a/apps/plugins/puzzles/help/flip.c
+++ b/apps/plugins/puzzles/help/flip.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -15,7 +15,7 @@ struct style_text help_text_style[] = {
15 LAST_STYLE_ITEM 15 LAST_STYLE_ITEM
16}; 16};
17 17
18/* orig 1522 comp 1092 ratio 0.717477 level 11 saved 430 */ 18/* orig 1522 comp 1092 ratio 0.717477 level 10 saved 430 */
19const char help_text[] = { 19const char help_text[] = {
200xf2, 0x2f, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 200xf2, 0x2f, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
210x31, 0x34, 0x3a, 0x20, 0x46, 0x6c, 0x69, 0x70, 0x20, 0x00, 210x31, 0x34, 0x3a, 0x20, 0x46, 0x6c, 0x69, 0x70, 0x20, 0x00,
@@ -33,8 +33,8 @@ const char help_text[] = {
330x61, 0x6e, 0x79, 0x30, 0x00, 0x01, 0x63, 0x00, 0xf3, 0x04, 330x61, 0x6e, 0x79, 0x30, 0x00, 0x01, 0x63, 0x00, 0xf3, 0x04,
340x66, 0x6c, 0x69, 0x70, 0x00, 0x69, 0x74, 0x73, 0x00, 0x73, 340x66, 0x6c, 0x69, 0x70, 0x00, 0x69, 0x74, 0x73, 0x00, 0x73,
350x74, 0x61, 0x74, 0x65, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x5d, 350x74, 0x61, 0x74, 0x65, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x5d,
360x00, 0x21, 0x74, 0x6f, 0x7b, 0x00, 0x31, 0x00, 0x6f, 0x72, 360x00, 0x21, 0x74, 0x6f, 0x7b, 0x00, 0x32, 0x00, 0x6f, 0x72,
370x08, 0x00, 0x05, 0x76, 0x00, 0xf5, 0x0c, 0x2c, 0x00, 0x62, 370x08, 0x00, 0x04, 0x76, 0x00, 0xf5, 0x0c, 0x2c, 0x00, 0x62,
380x75, 0x74, 0x00, 0x77, 0x68, 0x65, 0x6e, 0x00, 0x79, 0x6f, 380x75, 0x74, 0x00, 0x77, 0x68, 0x65, 0x6e, 0x00, 0x79, 0x6f,
390x75, 0x00, 0x64, 0x6f, 0x00, 0x73, 0x6f, 0x2c, 0x00, 0x6f, 390x75, 0x00, 0x64, 0x6f, 0x00, 0x73, 0x6f, 0x2c, 0x00, 0x6f,
400x74, 0x68, 0x65, 0x72, 0x89, 0x00, 0xf3, 0x01, 0x61, 0x72, 400x74, 0x68, 0x65, 0x72, 0x89, 0x00, 0xf3, 0x01, 0x61, 0x72,
@@ -43,46 +43,46 @@ const char help_text[] = {
430x00, 0x77, 0x65, 0x6c, 0x6c, 0x2e, 0x00, 0x00, 0x00, 0x45, 430x00, 0x77, 0x65, 0x6c, 0x6c, 0x2e, 0x00, 0x00, 0x00, 0x45,
440x61, 0x63, 0x68, 0x88, 0x00, 0xd0, 0x63, 0x6f, 0x6e, 0x74, 440x61, 0x63, 0x68, 0x88, 0x00, 0xd0, 0x63, 0x6f, 0x6e, 0x74,
450x61, 0x69, 0x6e, 0x73, 0x00, 0x61, 0x00, 0x73, 0x6d, 0xd4, 450x61, 0x69, 0x6e, 0x73, 0x00, 0x61, 0x00, 0x73, 0x6d, 0xd4,
460x00, 0xfa, 0x06, 0x64, 0x69, 0x61, 0x67, 0x72, 0x61, 0x6d, 460x00, 0xfb, 0x06, 0x64, 0x69, 0x61, 0x67, 0x72, 0x61, 0x6d,
470x00, 0x73, 0x68, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x00, 0x77, 470x00, 0x73, 0x68, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x00, 0x77,
480x68, 0x69, 0x63, 0x68, 0x63, 0x00, 0x03, 0x59, 0x00, 0x05, 480x68, 0x69, 0x63, 0x68, 0x63, 0x00, 0x03, 0x59, 0x00, 0x05,
490x88, 0x00, 0x04, 0xc9, 0x00, 0x00, 0x5c, 0x00, 0x42, 0x31, 490x88, 0x00, 0x03, 0xc9, 0x00, 0x00, 0x5c, 0x00, 0x42, 0x31,
500x34, 0x2e, 0x31, 0x6f, 0x01, 0x00, 0x5a, 0x00, 0x40, 0x72, 500x34, 0x2e, 0x31, 0x6f, 0x01, 0x00, 0x5a, 0x00, 0x40, 0x72,
510x6f, 0x6c, 0x73, 0x78, 0x01, 0x91, 0x54, 0x68, 0x69, 0x73, 510x6f, 0x6c, 0x73, 0x78, 0x01, 0x60, 0x54, 0x68, 0x69, 0x73,
520x00, 0x67, 0x61, 0x6d, 0x65, 0x0e, 0x01, 0xf0, 0x02, 0x62, 520x00, 0x67, 0x18, 0x01, 0x00, 0x0e, 0x01, 0xf1, 0x02, 0x62,
530x65, 0x00, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x00, 0x77, 530x65, 0x00, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x00, 0x77,
540x69, 0x74, 0x68, 0x00, 0x65, 0x69, 0x5d, 0x00, 0x01, 0x3b, 540x69, 0x74, 0x68, 0x00, 0x65, 0x69, 0x5d, 0x00, 0x00, 0x3b,
550x01, 0xa2, 0x6b, 0x65, 0x79, 0x62, 0x6f, 0x61, 0x72, 0x64, 550x01, 0xa2, 0x6b, 0x65, 0x79, 0x62, 0x6f, 0x61, 0x72, 0x64,
560x00, 0x6f, 0x10, 0x00, 0x50, 0x6d, 0x6f, 0x75, 0x73, 0x65, 560x00, 0x6f, 0x10, 0x00, 0x50, 0x6d, 0x6f, 0x75, 0x73, 0x65,
570x57, 0x00, 0xf4, 0x00, 0x4c, 0x65, 0x66, 0x74, 0x2d, 0x63, 570x57, 0x00, 0xf4, 0x00, 0x4c, 0x65, 0x66, 0x74, 0x2d, 0x63,
580x6c, 0x69, 0x63, 0x6b, 0x00, 0x69, 0x6e, 0x00, 0x61, 0xbe, 580x6c, 0x69, 0x63, 0x6b, 0x00, 0x69, 0x6e, 0x00, 0x61, 0xbe,
590x00, 0x23, 0x74, 0x6f, 0x7c, 0x00, 0x01, 0xb4, 0x01, 0x01, 590x00, 0x24, 0x74, 0x6f, 0x7c, 0x00, 0x01, 0x51, 0x01, 0x00,
600x4c, 0x01, 0xa5, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 600x4c, 0x01, 0xa6, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61,
610x74, 0x65, 0x64, 0xdb, 0x01, 0x00, 0x4e, 0x00, 0x31, 0x75, 610x74, 0x65, 0x64, 0xdb, 0x01, 0x61, 0x6f, 0x72, 0x00, 0x75,
620x73, 0x65, 0x52, 0x00, 0x60, 0x63, 0x75, 0x72, 0x73, 0x6f, 620x73, 0x65, 0x52, 0x00, 0x60, 0x63, 0x75, 0x72, 0x73, 0x6f,
630x72, 0x69, 0x00, 0x00, 0xcc, 0x01, 0x05, 0x99, 0x01, 0x07, 630x72, 0x69, 0x00, 0x01, 0xcc, 0x01, 0x04, 0x99, 0x01, 0x08,
640x97, 0x01, 0x02, 0xc4, 0x01, 0x80, 0x70, 0x61, 0x63, 0x65, 640x97, 0x01, 0x01, 0xc4, 0x01, 0x80, 0x70, 0x61, 0x63, 0x65,
650x00, 0x62, 0x61, 0x72, 0x3c, 0x00, 0x41, 0x45, 0x6e, 0x74, 650x00, 0x62, 0x61, 0x72, 0x3c, 0x00, 0x41, 0x45, 0x6e, 0x74,
660x65, 0x33, 0x00, 0x04, 0x70, 0x00, 0x00, 0x92, 0x00, 0x20, 660x65, 0x33, 0x00, 0x04, 0x70, 0x00, 0x00, 0x92, 0x00, 0x21,
670x49, 0x66, 0xfb, 0x00, 0x05, 0x58, 0x00, 0xf4, 0x06, 0x60, 670x49, 0x66, 0xfb, 0x00, 0x04, 0x58, 0x00, 0xf4, 0x06, 0x60,
680x53, 0x6f, 0x6c, 0x76, 0x65, 0x27, 0x00, 0x66, 0x75, 0x6e, 680x53, 0x6f, 0x6c, 0x76, 0x65, 0x27, 0x00, 0x66, 0x75, 0x6e,
690x63, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x6f, 0x6e, 0x00, 0x74, 690x63, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x6f, 0x6e, 0x00, 0x74,
700xf6, 0x00, 0x10, 0x2c, 0xa1, 0x00, 0x92, 0x77, 0x69, 0x6c, 700xf6, 0x00, 0x10, 0x2c, 0xa1, 0x00, 0x60, 0x77, 0x69, 0x6c,
710x6c, 0x00, 0x6d, 0x61, 0x72, 0x6b, 0x5b, 0x02, 0x28, 0x6f, 710x6c, 0x00, 0x6d, 0xce, 0x01, 0x01, 0x5b, 0x02, 0x29, 0x6f,
720x66, 0x3f, 0x02, 0x00, 0xd6, 0x00, 0x44, 0x72, 0x65, 0x64, 720x66, 0x3f, 0x02, 0x74, 0x69, 0x6e, 0x00, 0x72, 0x65, 0x64,
730x2e, 0x57, 0x00, 0x02, 0xeb, 0x00, 0x40, 0x6f, 0x6e, 0x63, 730x2e, 0x57, 0x00, 0x02, 0xeb, 0x00, 0x40, 0x6f, 0x6e, 0x63,
740x65, 0x1a, 0x00, 0x44, 0x65, 0x76, 0x65, 0x72, 0x3a, 0x02, 740x65, 0x1a, 0x00, 0x45, 0x65, 0x76, 0x65, 0x72, 0x3a, 0x02,
750x02, 0x34, 0x01, 0x10, 0x61, 0x2e, 0x00, 0x01, 0x4e, 0x00, 750x01, 0x34, 0x01, 0x10, 0x61, 0x2e, 0x00, 0x01, 0x4e, 0x00,
760x10, 0x2c, 0x47, 0x00, 0x01, 0x66, 0x00, 0x00, 0xb3, 0x01, 760x11, 0x2c, 0x47, 0x00, 0x01, 0x5c, 0x01, 0x60, 0x73, 0x68,
770x30, 0x75, 0x6c, 0x64, 0x5f, 0x01, 0x40, 0x73, 0x6f, 0x6c, 770x6f, 0x75, 0x6c, 0x64, 0x5f, 0x01, 0x10, 0x73, 0x8d, 0x00,
780x76, 0x4e, 0x00, 0x13, 0x28, 0x4f, 0x00, 0x06, 0x3a, 0x01, 780x49, 0x64, 0x2e, 0x00, 0x28, 0x4f, 0x00, 0x08, 0x3a, 0x01,
790x08, 0x46, 0x00, 0x38, 0x6f, 0x75, 0x74, 0x49, 0x00, 0x07, 790x00, 0x46, 0x00, 0x39, 0x6f, 0x75, 0x74, 0x49, 0x00, 0x06,
800x0c, 0x00, 0x02, 0xad, 0x00, 0x60, 0x61, 0x70, 0x70, 0x65, 800x0c, 0x00, 0x02, 0xad, 0x00, 0x60, 0x61, 0x70, 0x70, 0x65,
810x61, 0x72, 0x37, 0x00, 0x11, 0x69, 0x93, 0x02, 0x70, 0x69, 810x61, 0x72, 0x37, 0x00, 0x11, 0x69, 0x93, 0x02, 0x70, 0x69,
820x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0xf1, 0x00, 0x20, 0x61, 820x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0xf1, 0x00, 0x21, 0x61,
830x74, 0x58, 0x00, 0x02, 0x27, 0x00, 0x40, 0x6e, 0x65, 0x65, 830x74, 0x58, 0x00, 0x01, 0x27, 0x00, 0x40, 0x6e, 0x65, 0x65,
840x64, 0x1f, 0x00, 0x10, 0x72, 0xa7, 0x00, 0x13, 0x73, 0x1e, 840x64, 0x1f, 0x00, 0x10, 0x72, 0xa7, 0x00, 0x13, 0x73, 0x1e,
850x00, 0x50, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x09, 0x01, 0x02, 850x00, 0x51, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x09, 0x01, 0x01,
860x1a, 0x00, 0x00, 0x72, 0x02, 0x21, 0x74, 0x68, 0x99, 0x00, 860x1a, 0x00, 0x00, 0x72, 0x02, 0x21, 0x74, 0x68, 0x99, 0x00,
870x10, 0x75, 0x16, 0x00, 0x73, 0x2e, 0x29, 0x00, 0x00, 0x00, 870x10, 0x75, 0x16, 0x00, 0x73, 0x2e, 0x29, 0x00, 0x00, 0x00,
880x28, 0x41, 0x44, 0x03, 0x11, 0x61, 0x33, 0x01, 0xb0, 0x73, 880x28, 0x41, 0x44, 0x03, 0x11, 0x61, 0x33, 0x01, 0xb0, 0x73,
@@ -92,39 +92,39 @@ const char help_text[] = {
920x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 920x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e,
930x29, 0x6d, 0x02, 0x12, 0x32, 0x6d, 0x02, 0x93, 0x70, 0x61, 930x29, 0x6d, 0x02, 0x12, 0x32, 0x6d, 0x02, 0x93, 0x70, 0x61,
940x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x6f, 0x02, 0x46, 940x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x6f, 0x02, 0x46,
950x65, 0x73, 0x65, 0x00, 0x14, 0x00, 0x00, 0x40, 0x00, 0x05, 950x65, 0x73, 0x65, 0x00, 0x14, 0x00, 0x02, 0x40, 0x00, 0x04,
960x3b, 0x00, 0x02, 0x69, 0x03, 0x02, 0xb5, 0x01, 0xd3, 0x43, 960x3b, 0x00, 0x02, 0x69, 0x03, 0x01, 0xb5, 0x01, 0xd6, 0x43,
970x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 970x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00,
980x6f, 0x70, 0xb7, 0x01, 0x02, 0x1a, 0x00, 0xa0, 0x54, 0x79, 980x6f, 0x70, 0xb7, 0x01, 0xd0, 0x65, 0x00, 0x60, 0x54, 0x79,
990x70, 0x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0xed, 0x01, 990x70, 0x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0xed, 0x01,
1000x91, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 0x48, 0x65, 1000x91, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 0x48, 0x65,
1010x9e, 0x03, 0x50, 0x00, 0x00, 0x53, 0x69, 0x7a, 0xc2, 0x01, 1010x9e, 0x03, 0x51, 0x00, 0x00, 0x53, 0x69, 0x7a, 0xc2, 0x01,
1020x02, 0x45, 0x04, 0x24, 0x69, 0x6e, 0xc6, 0x01, 0x10, 0x2e, 1020x01, 0x45, 0x04, 0x24, 0x69, 0x6e, 0xc6, 0x01, 0x10, 0x2e,
1030x1b, 0x00, 0x94, 0x68, 0x61, 0x70, 0x65, 0x20, 0x74, 0x79, 1030x1b, 0x00, 0x94, 0x68, 0x61, 0x70, 0x65, 0x20, 0x74, 0x79,
1040x70, 0x65, 0xf8, 0x02, 0x03, 0x09, 0x03, 0x20, 0x00, 0x64, 1040x70, 0x65, 0xf8, 0x02, 0x03, 0x09, 0x03, 0x20, 0x00, 0x64,
1050x8c, 0x00, 0x52, 0x6d, 0x69, 0x6e, 0x65, 0x73, 0x0b, 0x01, 1050x8c, 0x00, 0x52, 0x6d, 0x69, 0x6e, 0x65, 0x73, 0x0b, 0x01,
1060x35, 0x68, 0x61, 0x70, 0x07, 0x02, 0x63, 0x72, 0x65, 0x67, 1060x00, 0x29, 0x00, 0x04, 0x07, 0x02, 0x30, 0x72, 0x65, 0x67,
1070x69, 0x6f, 0x6e, 0x6d, 0x03, 0x21, 0x69, 0x73, 0x66, 0x02, 1070x7e, 0x00, 0x02, 0x6d, 0x03, 0x21, 0x69, 0x73, 0x66, 0x02,
1080x62, 0x70, 0x65, 0x64, 0x00, 0x62, 0x79, 0xbc, 0x01, 0x00, 1080x62, 0x70, 0x65, 0x64, 0x00, 0x62, 0x79, 0xbc, 0x01, 0x00,
1090x8a, 0x03, 0x21, 0x69, 0x6e, 0x41, 0x04, 0x44, 0x67, 0x69, 1090x8a, 0x03, 0x21, 0x69, 0x6e, 0x41, 0x04, 0x44, 0x67, 0x69,
1100x76, 0x65, 0x72, 0x00, 0x10, 0x2e, 0xeb, 0x00, 0xf2, 0x14, 1100x76, 0x65, 0x72, 0x00, 0x10, 0x2e, 0xeb, 0x00, 0xfa, 0x14,
1110x00, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x00, 0x73, 1110x00, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x00, 0x73,
1120x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2c, 0x00, 0x60, 0x43, 1120x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2c, 0x00, 0x60, 0x43,
1130x72, 0x6f, 0x73, 0x73, 0x65, 0x73, 0x27, 0x2c, 0x00, 0x63, 1130x72, 0x6f, 0x73, 0x73, 0x65, 0x73, 0x27, 0x2c, 0x00, 0x63,
1140x61, 0x75, 0x73, 0x65, 0x73, 0x42, 0x02, 0x0e, 0x36, 0x03, 1140x61, 0x75, 0x73, 0x65, 0x73, 0x42, 0x02, 0x06, 0x36, 0x03,
1150x45, 0x73, 0x65, 0x6c, 0x66, 0x3a, 0x03, 0x10, 0x66, 0xe7, 1150x45, 0x73, 0x65, 0x6c, 0x66, 0x3a, 0x03, 0x10, 0x66, 0xe7,
1160x04, 0x60, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0xe5, 0x01, 1160x04, 0x60, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0xe5, 0x01,
1170x10, 0x6e, 0xed, 0x00, 0x71, 0x62, 0x6f, 0x75, 0x72, 0x73, 1170x10, 0x6e, 0xed, 0x00, 0x71, 0x62, 0x6f, 0x75, 0x72, 0x73,
1180x00, 0x28, 0x8f, 0x03, 0x31, 0x72, 0x65, 0x65, 0x98, 0x03, 1180x00, 0x28, 0x8f, 0x03, 0x31, 0x72, 0x65, 0x65, 0x98, 0x03,
1190xc0, 0x77, 0x6f, 0x00, 0x69, 0x66, 0x00, 0x69, 0x74, 0x27, 1190xc0, 0x77, 0x6f, 0x00, 0x69, 0x66, 0x00, 0x69, 0x74, 0x27,
1200x73, 0x00, 0x61, 0x78, 0x03, 0x41, 0x00, 0x65, 0x64, 0x67, 1200x73, 0x00, 0x61, 0x78, 0x03, 0x41, 0x00, 0x65, 0x64, 0x67,
1210x1a, 0x00, 0x71, 0x63, 0x6f, 0x72, 0x6e, 0x65, 0x72, 0x29, 1210x1a, 0x00, 0x72, 0x63, 0x6f, 0x72, 0x6e, 0x65, 0x72, 0x29,
1220x95, 0x00, 0x02, 0x32, 0x04, 0x07, 0x93, 0x00, 0x65, 0x52, 1220x95, 0x00, 0x03, 0x32, 0x04, 0x05, 0x93, 0x00, 0x66, 0x52,
1230x61, 0x6e, 0x64, 0x6f, 0x6d, 0x92, 0x00, 0x00, 0x6d, 0x02, 1230x61, 0x6e, 0x64, 0x6f, 0x6d, 0x92, 0x00, 0x31, 0x61, 0x00,
1240x01, 0x12, 0x00, 0x01, 0x08, 0x01, 0x01, 0x94, 0x00, 0x20, 1240x72, 0x12, 0x00, 0x03, 0x08, 0x01, 0x20, 0x74, 0x6f, 0xb8,
1250x62, 0x65, 0x8f, 0x03, 0x79, 0x73, 0x65, 0x6e, 0x00, 0x66, 1250x02, 0xa9, 0x63, 0x68, 0x6f, 0x73, 0x65, 0x6e, 0x00, 0x66,
1260x6f, 0x72, 0xb2, 0x00, 0x00, 0x9d, 0x05, 0x05, 0xe7, 0x02, 1260x6f, 0x72, 0xb2, 0x00, 0x00, 0x9d, 0x05, 0x06, 0xe7, 0x02,
1270x00, 0x1f, 0x01, 0x93, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 1270xc3, 0x69, 0x73, 0x00, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72,
1280x65, 0x6e, 0x74, 0x27, 0x00, 0x60, 0x74, 0x69, 0x6d, 0x65, 1280x65, 0x6e, 0x74, 0x27, 0x00, 0x60, 0x74, 0x69, 0x6d, 0x65,
1290x2e, 0x00, 1290x2e, 0x00,
130}; 130};
diff --git a/apps/plugins/puzzles/help/flood.c b/apps/plugins/puzzles/help/flood.c
index 25a95cb394..1bee956902 100644
--- a/apps/plugins/puzzles/help/flood.c
+++ b/apps/plugins/puzzles/help/flood.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -16,7 +16,7 @@ struct style_text help_text_style[] = {
16 LAST_STYLE_ITEM 16 LAST_STYLE_ITEM
17}; 17};
18 18
19/* orig 2377 comp 1591 ratio 0.669331 level 11 saved 786 */ 19/* orig 2377 comp 1592 ratio 0.669752 level 10 saved 785 */
20const char help_text[] = { 20const char help_text[] = {
210xf3, 0x45, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 210xf3, 0x45, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
220x33, 0x39, 0x3a, 0x20, 0x46, 0x6c, 0x6f, 0x6f, 0x64, 0x20, 220x33, 0x39, 0x3a, 0x20, 0x46, 0x6c, 0x6f, 0x6f, 0x64, 0x20,
@@ -44,36 +44,36 @@ const char help_text[] = {
440x74, 0x65, 0x64, 0x00, 0x70, 0x61, 0x74, 0x68, 0xdc, 0x00, 440x74, 0x65, 0x64, 0x00, 0x70, 0x61, 0x74, 0x68, 0xdc, 0x00,
450x23, 0x00, 0x61, 0x96, 0x00, 0x44, 0x73, 0x61, 0x6d, 0x65, 450x23, 0x00, 0x61, 0x96, 0x00, 0x44, 0x73, 0x61, 0x6d, 0x65,
460x86, 0x00, 0x10, 0x77, 0xab, 0x00, 0x30, 0x62, 0x65, 0x00, 460x86, 0x00, 0x10, 0x77, 0xab, 0x00, 0x30, 0x62, 0x65, 0x00,
470xb3, 0x00, 0x51, 0x65, 0x64, 0x00, 0x69, 0x6e, 0x22, 0x00, 470xb3, 0x00, 0x20, 0x65, 0x64, 0xa1, 0x00, 0x00, 0x22, 0x00,
480x33, 0x6e, 0x65, 0x77, 0x21, 0x00, 0x51, 0x29, 0x2e, 0x00, 480x33, 0x6e, 0x65, 0x77, 0x21, 0x00, 0x51, 0x29, 0x2e, 0x00,
490x41, 0x73, 0xdf, 0x00, 0xf2, 0x02, 0x64, 0x6f, 0x00, 0x74, 490x41, 0x73, 0xdf, 0x00, 0xf2, 0x02, 0x64, 0x6f, 0x00, 0x74,
500x68, 0x69, 0x73, 0x2c, 0x00, 0x6d, 0x6f, 0x72, 0x65, 0x00, 500x68, 0x69, 0x73, 0x2c, 0x00, 0x6d, 0x6f, 0x72, 0x65, 0x00,
510x61, 0x6e, 0x64, 0x09, 0x00, 0x20, 0x6f, 0x66, 0x32, 0x00, 510x61, 0x6e, 0x64, 0x09, 0x00, 0x21, 0x6f, 0x66, 0x32, 0x00,
520x02, 0x48, 0x01, 0x77, 0x62, 0x65, 0x63, 0x6f, 0x6d, 0x65, 520x01, 0x48, 0x01, 0x77, 0x62, 0x65, 0x63, 0x6f, 0x6d, 0x65,
530x73, 0x83, 0x00, 0x2f, 0x74, 0x6f, 0xb7, 0x00, 0x01, 0x12, 530x73, 0x83, 0x00, 0x2f, 0x74, 0x6f, 0xb7, 0x00, 0x01, 0x12,
540x2e, 0x89, 0x01, 0x80, 0x72, 0x00, 0x61, 0x69, 0x6d, 0x00, 540x2e, 0x89, 0x01, 0x80, 0x72, 0x00, 0x61, 0x69, 0x6d, 0x00,
550x69, 0x73, 0x26, 0x00, 0x41, 0x6d, 0x61, 0x6b, 0x65, 0x2b, 550x69, 0x73, 0x26, 0x00, 0x41, 0x6d, 0x61, 0x6b, 0x65, 0x2b,
560x00, 0x42, 0x77, 0x68, 0x6f, 0x6c, 0x4f, 0x00, 0x0c, 0xac, 560x00, 0x43, 0x77, 0x68, 0x6f, 0x6c, 0x4f, 0x00, 0x0b, 0xac,
570x00, 0x11, 0x2c, 0x3f, 0x01, 0x51, 0x73, 0x00, 0x66, 0x65, 570x00, 0x11, 0x2c, 0x3f, 0x01, 0x51, 0x73, 0x00, 0x66, 0x65,
580x77, 0x76, 0x01, 0x10, 0x73, 0x0d, 0x00, 0xb0, 0x70, 0x6f, 580x77, 0x76, 0x01, 0x10, 0x73, 0x0d, 0x00, 0xb0, 0x70, 0x6f,
590x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x2e, 0x00, 0x54, 0x86, 590x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x2e, 0x00, 0x54, 0x86,
600x00, 0x32, 0x61, 0x6d, 0x65, 0xd3, 0x00, 0xd3, 0x73, 0x65, 600x00, 0x00, 0x2e, 0x00, 0x01, 0xd3, 0x00, 0xd3, 0x73, 0x65,
610x74, 0x00, 0x61, 0x00, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x00, 610x74, 0x00, 0x61, 0x00, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x00,
620x6f, 0xd5, 0x00, 0x40, 0x75, 0x6d, 0x62, 0x65, 0x78, 0x01, 620x6f, 0xd5, 0x00, 0x41, 0x75, 0x6d, 0x62, 0x65, 0x78, 0x01,
630x02, 0x3e, 0x00, 0x70, 0x2c, 0x00, 0x62, 0x61, 0x73, 0x65, 630x01, 0x3e, 0x00, 0x70, 0x2c, 0x00, 0x62, 0x61, 0x73, 0x65,
640x64, 0x1e, 0x00, 0x40, 0x72, 0x75, 0x6e, 0x6e, 0x9e, 0x00, 640x64, 0x1e, 0x00, 0x40, 0x72, 0x75, 0x6e, 0x6e, 0x9e, 0x00,
650xf1, 0x09, 0x69, 0x74, 0x73, 0x00, 0x6f, 0x77, 0x6e, 0x00, 650xf1, 0x09, 0x69, 0x74, 0x73, 0x00, 0x6f, 0x77, 0x6e, 0x00,
660x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x00, 0x73, 660x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x00, 0x73,
670x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x36, 0x02, 0x64, 0x77, 670x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x36, 0x02, 0x65, 0x77,
680x69, 0x6e, 0x00, 0x69, 0x66, 0xea, 0x01, 0x0f, 0xb1, 0x00, 680x69, 0x6e, 0x00, 0x69, 0x66, 0xea, 0x01, 0x0f, 0xb1, 0x00,
690x11, 0x02, 0x4e, 0x01, 0x73, 0x61, 0x74, 0x00, 0x6d, 0x61, 690x10, 0x02, 0x4e, 0x01, 0x73, 0x61, 0x74, 0x00, 0x6d, 0x61,
700x6e, 0x79, 0xb3, 0x00, 0x20, 0x6f, 0x72, 0xc0, 0x00, 0x20, 700x6e, 0x79, 0xb3, 0x00, 0x20, 0x6f, 0x72, 0xc0, 0x00, 0x20,
710x65, 0x72, 0x03, 0x01, 0x51, 0x49, 0x00, 0x73, 0x61, 0x77, 710x65, 0x72, 0x03, 0x01, 0x51, 0x49, 0x00, 0x73, 0x61, 0x77,
720x55, 0x01, 0x02, 0xb9, 0x00, 0xd2, 0x28, 0x77, 0x69, 0x74, 720x55, 0x01, 0x02, 0xb9, 0x00, 0xd2, 0x28, 0x77, 0x69, 0x74,
730x68, 0x00, 0x61, 0x00, 0x66, 0x69, 0x78, 0x65, 0x64, 0x52, 730x68, 0x00, 0x61, 0x00, 0x66, 0x69, 0x78, 0x65, 0x64, 0x52,
740x00, 0x52, 0x73, 0x69, 0x7a, 0x65, 0x2c, 0x11, 0x00, 0x06, 740x00, 0x53, 0x73, 0x69, 0x7a, 0x65, 0x2c, 0x11, 0x00, 0x06,
750xc0, 0x00, 0x04, 0x85, 0x02, 0x10, 0x2c, 0x86, 0x01, 0x02, 750xc0, 0x00, 0x03, 0x85, 0x02, 0x11, 0x2c, 0x86, 0x01, 0x02,
760x1d, 0x00, 0x01, 0x5e, 0x00, 0x02, 0xef, 0x00, 0x10, 0x29, 760x1d, 0x00, 0x00, 0x5e, 0x00, 0x02, 0xef, 0x00, 0x10, 0x29,
770xba, 0x02, 0x71, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 770xba, 0x02, 0x71, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f,
780x8f, 0x02, 0xf2, 0x0f, 0x69, 0x74, 0x2e, 0x61, 0x70, 0x70, 780x8f, 0x02, 0xf2, 0x0f, 0x69, 0x74, 0x2e, 0x61, 0x70, 0x70,
790x73, 0x70, 0x6f, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x00, 0x28, 790x73, 0x70, 0x6f, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x00, 0x28,
@@ -82,86 +82,86 @@ const char help_text[] = {
820x43, 0x33, 0x39, 0x2e, 0x31, 0x2a, 0x03, 0x80, 0x63, 0x6f, 820x43, 0x33, 0x39, 0x2e, 0x31, 0x2a, 0x03, 0x80, 0x63, 0x6f,
830x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x33, 0x03, 0x81, 0x54, 830x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x33, 0x03, 0x81, 0x54,
840x6f, 0x00, 0x70, 0x6c, 0x61, 0x79, 0x00, 0x1a, 0x00, 0x71, 840x6f, 0x00, 0x70, 0x6c, 0x61, 0x79, 0x00, 0x1a, 0x00, 0x71,
850x2c, 0x00, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0xeb, 0x00, 0x42, 850x2c, 0x00, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0xeb, 0x00, 0x43,
860x6d, 0x6f, 0x75, 0x73, 0xd4, 0x02, 0x05, 0xd8, 0x01, 0x18, 860x6d, 0x6f, 0x75, 0x73, 0xd4, 0x02, 0x04, 0xd8, 0x01, 0x18,
870x54, 0xf5, 0x02, 0x60, 0x63, 0x6f, 0x72, 0x6e, 0x65, 0x72, 870x54, 0xf5, 0x02, 0x61, 0x63, 0x6f, 0x72, 0x6e, 0x65, 0x72,
880xa5, 0x00, 0x02, 0xd8, 0x02, 0x5a, 0x74, 0x68, 0x69, 0x6e, 880xa5, 0x00, 0x01, 0xd8, 0x02, 0x20, 0x74, 0x68, 0x65, 0x01,
890x67, 0x1d, 0x02, 0x24, 0x69, 0x74, 0x82, 0x02, 0x03, 0x3b, 890x09, 0x1d, 0x02, 0x26, 0x69, 0x74, 0x82, 0x02, 0x05, 0x3b,
900x03, 0x03, 0x88, 0x02, 0x01, 0x0a, 0x01, 0x24, 0x74, 0x68, 900x03, 0x31, 0x65, 0x64, 0x00, 0x0a, 0x01, 0x25, 0x74, 0x68,
910x4a, 0x01, 0x03, 0x66, 0x02, 0x03, 0x67, 0x00, 0x00, 0x84, 910x4a, 0x01, 0x03, 0x66, 0x02, 0x03, 0xf6, 0x02, 0x01, 0x84,
920x01, 0x02, 0x87, 0x00, 0x50, 0x65, 0x64, 0x2e, 0x00, 0x43, 920x01, 0x00, 0x87, 0x00, 0x50, 0x65, 0x64, 0x2e, 0x00, 0x43,
930x09, 0x00, 0x35, 0x69, 0x6e, 0x67, 0x86, 0x00, 0x0c, 0x87, 930x09, 0x00, 0x00, 0x59, 0x00, 0x04, 0x86, 0x00, 0x0d, 0x87,
940x01, 0x00, 0x27, 0x02, 0x1f, 0x74, 0x98, 0x00, 0x00, 0xd0, 940x01, 0x4f, 0x61, 0x73, 0x00, 0x74, 0x98, 0x00, 0x00, 0xd2,
950x68, 0x61, 0x73, 0x00, 0x6e, 0x6f, 0x00, 0x65, 0x66, 0x66, 950x68, 0x61, 0x73, 0x00, 0x6e, 0x6f, 0x00, 0x65, 0x66, 0x66,
960x65, 0x63, 0x74, 0x4c, 0x01, 0x01, 0xc1, 0x01, 0x30, 0x72, 960x65, 0x63, 0x74, 0x4c, 0x01, 0x60, 0x74, 0x68, 0x65, 0x72,
970x65, 0x66, 0xd7, 0x02, 0x30, 0x64, 0x6f, 0x65, 0x1e, 0x00, 970x65, 0x66, 0xd7, 0x02, 0x30, 0x64, 0x6f, 0x65, 0x1e, 0x00,
980x00, 0x2d, 0x00, 0x30, 0x75, 0x6e, 0x74, 0x43, 0x00, 0x10, 980x00, 0x2d, 0x00, 0x30, 0x75, 0x6e, 0x74, 0x43, 0x00, 0x11,
990x61, 0x64, 0x01, 0x02, 0xbb, 0x02, 0x03, 0x03, 0x02, 0x82, 990x61, 0x64, 0x01, 0x03, 0xbb, 0x02, 0x01, 0x03, 0x02, 0x50,
1000x61, 0x6c, 0x73, 0x6f, 0x00, 0x75, 0x73, 0x65, 0xa9, 0x00, 1000x61, 0x6c, 0x73, 0x6f, 0x00, 0x03, 0x01, 0x01, 0xa9, 0x00,
1010x90, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x00, 0x6b, 0x65, 0x79, 1010x92, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x00, 0x6b, 0x65, 0x79,
1020xd0, 0x02, 0x02, 0x90, 0x01, 0x14, 0x61, 0x16, 0x00, 0xe3, 1020xd0, 0x02, 0x00, 0x90, 0x01, 0x14, 0x61, 0x16, 0x00, 0xe3,
1030x28, 0x6f, 0x75, 0x74, 0x6c, 0x69, 0x6e, 0x65, 0x00, 0x62, 1030x28, 0x6f, 0x75, 0x74, 0x6c, 0x69, 0x6e, 0x65, 0x00, 0x62,
1040x6c, 0x61, 0x63, 0x6b, 0xa8, 0x00, 0x85, 0x29, 0x00, 0x61, 1040x6c, 0x61, 0x63, 0x6b, 0xa8, 0x00, 0x85, 0x29, 0x00, 0x61,
1050x72, 0x6f, 0x75, 0x6e, 0x64, 0x40, 0x03, 0x40, 0x2e, 0x00, 1050x72, 0x6f, 0x75, 0x6e, 0x64, 0x40, 0x03, 0x40, 0x2e, 0x00,
1060x50, 0x72, 0x90, 0x01, 0x21, 0x6e, 0x67, 0x13, 0x00, 0x60, 1060x50, 0x72, 0x90, 0x01, 0x21, 0x6e, 0x67, 0x13, 0x00, 0x60,
1070x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x52, 0x00, 0x02, 0x24, 1070x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x52, 0x00, 0x02, 0x24,
1080x01, 0x03, 0x56, 0x04, 0x0e, 0xc9, 0x00, 0x2f, 0x69, 0x6e, 1080x01, 0x0e, 0x56, 0x04, 0x03, 0xc9, 0x00, 0x2f, 0x69, 0x6e,
1090x2b, 0x01, 0x07, 0x56, 0x75, 0x6e, 0x64, 0x65, 0x72, 0xa1, 1090x2b, 0x01, 0x07, 0x57, 0x75, 0x6e, 0x64, 0x65, 0x72, 0xa1,
1100x00, 0x01, 0x78, 0x02, 0x23, 0x28, 0x41, 0x49, 0x00, 0xf2, 1100x00, 0x00, 0xc0, 0x00, 0x23, 0x28, 0x41, 0x49, 0x00, 0xf2,
1110x00, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x00, 0x64, 1110x00, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x00, 0x64,
1120x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x00, 0x04, 0x21, 0x73, 1120x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x00, 0x04, 0x21, 0x73,
1130x65, 0x16, 0x00, 0x40, 0x00, 0x32, 0x2e, 0x31, 0x2a, 0x05, 1130x65, 0x16, 0x00, 0x41, 0x00, 0x32, 0x2e, 0x31, 0x2a, 0x05,
1140x02, 0xe6, 0x00, 0x60, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 1140x01, 0xe6, 0x00, 0x60, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61,
1150x68, 0x03, 0x12, 0x29, 0x29, 0x02, 0x13, 0x32, 0x29, 0x02, 1150x68, 0x03, 0x12, 0x29, 0x29, 0x02, 0x13, 0x32, 0x29, 0x02,
1160x92, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 1160x92, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72,
1170x2b, 0x02, 0x56, 0x68, 0x65, 0x73, 0x65, 0x00, 0x14, 0x00, 1170x2b, 0x02, 0x56, 0x68, 0x65, 0x73, 0x65, 0x00, 0x14, 0x00,
1180x00, 0x41, 0x00, 0x02, 0x3c, 0x00, 0x0a, 0xc7, 0x04, 0xe0, 1180x02, 0x41, 0x00, 0x04, 0x3c, 0x00, 0x06, 0xc7, 0x04, 0xe1,
1190x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 1190x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e,
1200x27, 0x00, 0x6f, 0x70, 0x6f, 0x00, 0x04, 0xa5, 0x03, 0xb0, 1200x27, 0x00, 0x6f, 0x70, 0x6f, 0x00, 0x03, 0xa5, 0x03, 0xb0,
1210x60, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 1210x60, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 0x65, 0x6e,
1220x75, 0xab, 0x00, 0xf9, 0x04, 0x57, 0x69, 0x64, 0x74, 0x68, 1220x75, 0xab, 0x00, 0xf9, 0x04, 0x57, 0x69, 0x64, 0x74, 0x68,
1230x2c, 0x00, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x00, 0x00, 1230x2c, 0x00, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x00, 0x00,
1240x00, 0x53, 0x69, 0x7a, 0x73, 0x04, 0x00, 0x14, 0x04, 0x04, 1240x00, 0x53, 0x69, 0x7a, 0x73, 0x04, 0x01, 0x14, 0x04, 0x03,
1250xe0, 0x04, 0x00, 0x30, 0x00, 0x12, 0x43, 0x1a, 0x03, 0x4c, 1250xe0, 0x04, 0x00, 0x30, 0x00, 0x12, 0x43, 0x1a, 0x03, 0x4c,
1260x00, 0x00, 0x00, 0x4e, 0x2e, 0x03, 0x31, 0x00, 0x75, 0x73, 1260x00, 0x00, 0x00, 0x4e, 0x2e, 0x03, 0x00, 0xaa, 0x01, 0x01,
1270x74, 0x02, 0x01, 0x48, 0x01, 0x07, 0x74, 0x01, 0x70, 0x4d, 1270x74, 0x02, 0x05, 0x48, 0x01, 0x02, 0x74, 0x01, 0x40, 0x4d,
1280x75, 0x73, 0x74, 0x00, 0x62, 0x65, 0x36, 0x03, 0x73, 0x6c, 1280x75, 0x73, 0x74, 0x80, 0x02, 0xa3, 0x61, 0x74, 0x00, 0x6c,
1290x65, 0x61, 0x73, 0x74, 0x00, 0x33, 0x89, 0x03, 0x34, 0x74, 1290x65, 0x61, 0x73, 0x74, 0x00, 0x33, 0x89, 0x03, 0x35, 0x74,
1300x77, 0x6f, 0x3c, 0x00, 0x02, 0x19, 0x02, 0x50, 0x00, 0x77, 1300x77, 0x6f, 0x3c, 0x00, 0x01, 0x19, 0x02, 0x50, 0x00, 0x77,
1310x6f, 0x75, 0x6c, 0x31, 0x04, 0x20, 0x6c, 0x79, 0x31, 0x00, 1310x6f, 0x75, 0x6c, 0x31, 0x04, 0x20, 0x6c, 0x79, 0x31, 0x00,
1320x93, 0x6f, 0x6e, 0x65, 0x00, 0x6c, 0x65, 0x67, 0x61, 0x6c, 1320x93, 0x6f, 0x6e, 0x65, 0x00, 0x6c, 0x65, 0x67, 0x61, 0x6c,
1330xed, 0x01, 0x50, 0x74, 0x00, 0x61, 0x6e, 0x79, 0xeb, 0x04, 1330xed, 0x01, 0x20, 0x74, 0x00, 0xe7, 0x03, 0xc0, 0x73, 0x74,
1340xc3, 0x67, 0x65, 0x2c, 0x00, 0x68, 0x65, 0x6e, 0x63, 0x65, 1340x61, 0x67, 0x65, 0x2c, 0x00, 0x68, 0x65, 0x6e, 0x63, 0x65,
1350x00, 0x6e, 0x6f, 0xdf, 0x05, 0x05, 0xe3, 0x04, 0x20, 0x61, 1350x5f, 0x02, 0x03, 0xdf, 0x05, 0x04, 0xe3, 0x04, 0x20, 0x61,
1360x74, 0x87, 0x05, 0x12, 0x29, 0x6f, 0x02, 0x00, 0x1b, 0x04, 1360x74, 0x87, 0x05, 0x12, 0x29, 0x6f, 0x02, 0x00, 0x1b, 0x04,
1370x60, 0x6f, 0x73, 0x74, 0x00, 0x31, 0x30, 0xbc, 0x00, 0x61, 1370x60, 0x6f, 0x73, 0x74, 0x00, 0x31, 0x30, 0xbc, 0x00, 0x61,
1380x45, 0x78, 0x74, 0x72, 0x61, 0x20, 0x27, 0x04, 0xa0, 0x20, 1380x45, 0x78, 0x74, 0x72, 0x61, 0x20, 0x27, 0x04, 0x70, 0x20,
1390x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0xd4, 1390x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x25, 0x03, 0x00, 0xd4,
1400x00, 0x02, 0x8c, 0x03, 0x02, 0xc5, 0x02, 0xa4, 0x64, 0x69, 1400x00, 0x02, 0x8c, 0x03, 0x01, 0xb4, 0x00, 0xa4, 0x64, 0x69,
1410x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x07, 0x01, 1410x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x07, 0x01,
1420x70, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x2c, 0x0b, 0x06, 1420x70, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x2c, 0x0b, 0x06,
1430x64, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x41, 0x02, 0x07, 1430x65, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x41, 0x02, 0x06,
1440x14, 0x04, 0x05, 0xaf, 0x06, 0x00, 0xda, 0x05, 0x02, 0x39, 1440x14, 0x04, 0x06, 0xaf, 0x06, 0x00, 0xda, 0x05, 0x02, 0x39,
1450x01, 0x02, 0xcf, 0x03, 0x01, 0x5a, 0x02, 0x00, 0x00, 0x05, 1450x01, 0x01, 0xc0, 0x01, 0x02, 0x5a, 0x02, 0x5d, 0x72, 0x75,
1460x2d, 0x00, 0x61, 0xf7, 0x04, 0x00, 0xb4, 0x00, 0x84, 0x67, 1460x6e, 0x00, 0x61, 0xf7, 0x04, 0x00, 0xb4, 0x00, 0x85, 0x67,
1470x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x1b, 0x05, 0x00, 1470x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x1b, 0x05, 0x40,
1480x1b, 0x00, 0x10, 0x75, 0xb0, 0x01, 0x05, 0x30, 0x03, 0x02, 1480x73, 0x6f, 0x6c, 0x75, 0xb0, 0x01, 0x05, 0x30, 0x03, 0x02,
1490xb7, 0x01, 0x40, 0x76, 0x61, 0x6c, 0x75, 0x0b, 0x04, 0x02, 1490xb7, 0x01, 0x41, 0x76, 0x61, 0x6c, 0x75, 0x0b, 0x04, 0x01,
1500xce, 0x04, 0x55, 0x66, 0x69, 0x65, 0x6c, 0x64, 0xd9, 0x03, 1500xce, 0x04, 0x55, 0x66, 0x69, 0x65, 0x6c, 0x64, 0xd9, 0x03,
1510x36, 0x61, 0x64, 0x64, 0x0a, 0x06, 0x41, 0x6c, 0x65, 0x6e, 1510x36, 0x61, 0x64, 0x64, 0x0a, 0x06, 0x42, 0x6c, 0x65, 0x6e,
1520x67, 0x96, 0x06, 0x02, 0x80, 0x00, 0x25, 0x27, 0x73, 0x52, 1520x67, 0x96, 0x06, 0x01, 0x80, 0x00, 0x25, 0x27, 0x73, 0x52,
1530x00, 0x09, 0x6f, 0x00, 0x13, 0x74, 0xcd, 0x05, 0x29, 0x27, 1530x00, 0x09, 0x6f, 0x00, 0x13, 0x74, 0xcd, 0x05, 0x29, 0x27,
1540x73, 0xc6, 0x00, 0x41, 0x53, 0x6f, 0x00, 0x61, 0x6c, 0x00, 1540x73, 0xc6, 0x00, 0x43, 0x53, 0x6f, 0x00, 0x61, 0x6c, 0x00,
1550x01, 0x05, 0x02, 0x92, 0x30, 0x00, 0x72, 0x65, 0x71, 0x75, 1550xc2, 0x6f, 0x66, 0x00, 0x30, 0x00, 0x72, 0x65, 0x71, 0x75,
1560x69, 0x72, 0x65, 0xa1, 0x06, 0x20, 0x74, 0x6f, 0x6e, 0x00, 1560x69, 0x72, 0x65, 0xa1, 0x06, 0x20, 0x74, 0x6f, 0x6e, 0x00,
1570x31, 0x6a, 0x75, 0x73, 0xaf, 0x03, 0x10, 0x65, 0x28, 0x01, 1570x31, 0x6a, 0x75, 0x73, 0xaf, 0x03, 0x10, 0x65, 0x28, 0x01,
1580x21, 0x69, 0x65, 0xbc, 0x03, 0x05, 0x6c, 0x00, 0x93, 0x61, 1580x22, 0x69, 0x65, 0xbc, 0x03, 0x04, 0x6c, 0x00, 0x60, 0x61,
1590x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x64, 0xe3, 0x00, 1590x75, 0x74, 0x6f, 0x6d, 0x61, 0x57, 0x01, 0x02, 0xe3, 0x00,
1600x03, 0x87, 0x01, 0x72, 0x00, 0x6c, 0x61, 0x72, 0x67, 0x65, 1600x03, 0x87, 0x01, 0x40, 0x00, 0x6c, 0x61, 0x72, 0x10, 0x05,
1610x72, 0x5a, 0x00, 0x01, 0xa8, 0x01, 0x10, 0x73, 0x9a, 0x04, 1610x02, 0x5a, 0x00, 0x00, 0xa8, 0x01, 0x10, 0x73, 0x9a, 0x04,
1620x00, 0x4b, 0x01, 0x12, 0x65, 0x32, 0x03, 0x41, 0x4e, 0x6f, 1620x00, 0x4b, 0x01, 0x12, 0x65, 0x32, 0x03, 0x42, 0x4e, 0x6f,
1630x74, 0x65, 0xcc, 0x05, 0x04, 0x4b, 0x00, 0x0b, 0x2d, 0x01, 1630x74, 0x65, 0xcc, 0x05, 0x04, 0x4b, 0x00, 0x0c, 0x2d, 0x01,
1640x02, 0x49, 0x07, 0x01, 0x31, 0x04, 0x20, 0x6e, 0x65, 0x55, 1640x01, 0xee, 0x00, 0x00, 0x31, 0x04, 0x20, 0x6e, 0x65, 0x55,
1650x05, 0x93, 0x61, 0x72, 0x69, 0x6c, 0x79, 0x00, 0x66, 0x69, 1650x05, 0x93, 0x61, 0x72, 0x69, 0x6c, 0x79, 0x00, 0x66, 0x69,
1660x6e, 0x16, 0x06, 0x75, 0x68, 0x6f, 0x72, 0x74, 0x65, 0x73, 1660x6e, 0x16, 0x06, 0x75, 0x68, 0x6f, 0x72, 0x74, 0x65, 0x73,
1670x74, 0xb0, 0x06, 0x07, 0x49, 0x01, 0xf0, 0x00, 0x74, 0x68, 1670x74, 0xb0, 0x06, 0x07, 0x49, 0x01, 0xf0, 0x00, 0x74, 0x68,
@@ -170,14 +170,14 @@ const char help_text[] = {
1700x70, 0x72, 0x65, 0x74, 0x74, 0x79, 0x00, 0x63, 0x6c, 0x6f, 1700x70, 0x72, 0x65, 0x74, 0x74, 0x79, 0x00, 0x63, 0x6c, 0x6f,
1710x73, 0x65, 0x2e, 0x00, 0x46, 0x6f, 0x72, 0x00, 0x61, 0x11, 1710x73, 0x65, 0x2e, 0x00, 0x46, 0x6f, 0x72, 0x00, 0x61, 0x11,
1720x08, 0x60, 0x6c, 0x00, 0x63, 0x68, 0x61, 0x6c, 0x46, 0x01, 1720x08, 0x60, 0x6c, 0x00, 0x63, 0x68, 0x61, 0x6c, 0x46, 0x01,
1730x20, 0x65, 0x2c, 0xe5, 0x06, 0x01, 0x71, 0x01, 0x01, 0xb9, 1730x21, 0x65, 0x2c, 0xe5, 0x06, 0x01, 0x71, 0x01, 0x02, 0xb9,
1740x00, 0x01, 0x64, 0x02, 0x17, 0x30, 0x97, 0x01, 0x52, 0x72, 1740x00, 0x47, 0x74, 0x6f, 0x00, 0x30, 0x97, 0x01, 0x20, 0x72,
1750x79, 0x00, 0x74, 0x6f, 0x9f, 0x00, 0x02, 0xe9, 0x08, 0x02, 1750x79, 0x12, 0x00, 0x01, 0x9f, 0x00, 0x04, 0xe9, 0x08, 0x00,
1760xdf, 0x03, 0x81, 0x74, 0x72, 0x69, 0x63, 0x74, 0x6c, 0x79, 1760x2d, 0x03, 0x81, 0x74, 0x72, 0x69, 0x63, 0x74, 0x6c, 0x79,
1770x20, 0x87, 0x06, 0x02, 0x96, 0x06, 0x00, 0xda, 0x00, 0x00, 1770x20, 0x87, 0x06, 0x03, 0x96, 0x06, 0x32, 0x74, 0x68, 0x61,
1780xbb, 0x01, 0x03, 0x68, 0x01, 0x00, 0x4e, 0x01, 0xc0, 0x27, 1780xc8, 0x01, 0x02, 0x31, 0x07, 0xf0, 0x00, 0x79, 0x6f, 0x75,
1790x72, 0x65, 0x00, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x21, 0x29, 1790x27, 0x72, 0x65, 0x00, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x21,
1800x00, 1800x29, 0x00,
181}; 181};
182 182
183const unsigned short help_text_len = 2377; 183const unsigned short help_text_len = 2377;
diff --git a/apps/plugins/puzzles/help/galaxies.c b/apps/plugins/puzzles/help/galaxies.c
index 68a59e6339..eed08b8ac4 100644
--- a/apps/plugins/puzzles/help/galaxies.c
+++ b/apps/plugins/puzzles/help/galaxies.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -14,7 +14,7 @@ struct style_text help_text_style[] = {
14 LAST_STYLE_ITEM 14 LAST_STYLE_ITEM
15}; 15};
16 16
17/* orig 2754 comp 1877 ratio 0.681554 level 11 saved 877 */ 17/* orig 2754 comp 1877 ratio 0.681554 level 10 saved 877 */
18const char help_text[] = { 18const char help_text[] = {
190xf0, 0x41, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 190xf0, 0x41, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
200x32, 0x38, 0x3a, 0x20, 0x47, 0x61, 0x6c, 0x61, 0x78, 0x69, 200x32, 0x38, 0x3a, 0x20, 0x47, 0x61, 0x6c, 0x61, 0x78, 0x69,
@@ -41,44 +41,44 @@ const char help_text[] = {
410x00, 0xd0, 0x73, 0x00, 0x65, 0x78, 0x61, 0x63, 0x74, 0x6c, 410x00, 0xd0, 0x73, 0x00, 0x65, 0x78, 0x61, 0x63, 0x74, 0x6c,
420x79, 0x00, 0x6f, 0x6e, 0x65, 0xaf, 0x00, 0x60, 0x00, 0x77, 420x79, 0x00, 0x6f, 0x6e, 0x65, 0xaf, 0x00, 0x60, 0x00, 0x77,
430x68, 0x69, 0x63, 0x68, 0x49, 0x00, 0x40, 0x6c, 0x6f, 0x63, 430x68, 0x69, 0x63, 0x68, 0x49, 0x00, 0x40, 0x6c, 0x6f, 0x63,
440x61, 0x88, 0x00, 0xd0, 0x61, 0x74, 0x00, 0x69, 0x74, 0x73, 440x61, 0x88, 0x00, 0xd1, 0x61, 0x74, 0x00, 0x69, 0x74, 0x73,
450x00, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x65, 0x8e, 0x00, 0x03, 450x00, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x65, 0x8e, 0x00, 0x02,
460x4a, 0x00, 0xf0, 0x00, 0x79, 0x2e, 0x00, 0x00, 0x00, 0x54, 460x4a, 0x00, 0xf0, 0x00, 0x79, 0x2e, 0x00, 0x00, 0x00, 0x54,
470x6f, 0x00, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x00, 0x79, 0xe4, 470x6f, 0x00, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x00, 0x79, 0xe4,
480x00, 0x40, 0x73, 0x6f, 0x6c, 0x75, 0x71, 0x00, 0x10, 0x2c, 480x00, 0x40, 0x73, 0x6f, 0x6c, 0x75, 0x71, 0x00, 0x10, 0x2c,
490x0f, 0x00, 0xf0, 0x02, 0x00, 0x64, 0x72, 0x61, 0x77, 0x00, 490x0f, 0x00, 0xf1, 0x02, 0x00, 0x64, 0x72, 0x61, 0x77, 0x00,
500x6c, 0x69, 0x6e, 0x65, 0x73, 0x00, 0x61, 0x6c, 0x6f, 0x6e, 500x6c, 0x69, 0x6e, 0x65, 0x73, 0x00, 0x61, 0x6c, 0x6f, 0x6e,
510x67, 0xef, 0x00, 0x02, 0x2e, 0x01, 0x41, 0x65, 0x64, 0x67, 510x67, 0xef, 0x00, 0x01, 0x2e, 0x01, 0x41, 0x65, 0x64, 0x67,
520x65, 0x0b, 0x01, 0x41, 0x6d, 0x61, 0x72, 0x6b, 0x17, 0x00, 520x65, 0x0b, 0x01, 0x41, 0x6d, 0x61, 0x72, 0x6b, 0x17, 0x00,
530x90, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x69, 0x65, 530x91, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x69, 0x65,
540xf0, 0x00, 0x00, 0x12, 0x00, 0x04, 0xff, 0x00, 0xc0, 0x2e, 540xf0, 0x00, 0x02, 0x18, 0x01, 0x01, 0xff, 0x00, 0xc0, 0x2e,
550x00, 0x54, 0x68, 0x65, 0x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 550x00, 0x54, 0x68, 0x65, 0x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c,
560x65, 0x96, 0x00, 0xc1, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 560x65, 0x96, 0x00, 0xc2, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65,
570x74, 0x65, 0x00, 0x77, 0x68, 0x65, 0x41, 0x01, 0x01, 0x44, 570x74, 0x65, 0x00, 0x77, 0x68, 0x65, 0x41, 0x01, 0x00, 0x44,
580x00, 0x23, 0x65, 0x64, 0x69, 0x00, 0x26, 0x6f, 0x6e, 0x66, 580x00, 0x23, 0x65, 0x64, 0x69, 0x00, 0x26, 0x6f, 0x6e, 0x66,
590x00, 0xc0, 0x61, 0x72, 0x65, 0x00, 0x70, 0x72, 0x65, 0x63, 590x00, 0xc0, 0x61, 0x72, 0x65, 0x00, 0x70, 0x72, 0x65, 0x63,
600x69, 0x73, 0x65, 0x6c, 0x2d, 0x01, 0x32, 0x6f, 0x73, 0x65, 600x69, 0x73, 0x65, 0x6c, 0x2d, 0x01, 0x32, 0x6f, 0x73, 0x65,
610x33, 0x01, 0xc4, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 610x33, 0x01, 0xc4, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74,
620x65, 0x00, 0x74, 0x77, 0x6f, 0x5c, 0x01, 0x30, 0x00, 0x62, 620x65, 0x00, 0x74, 0x77, 0x6f, 0x5c, 0x01, 0x30, 0x00, 0x62,
630x65, 0xa4, 0x00, 0x30, 0x69, 0x6e, 0x67, 0x98, 0x00, 0x94, 630x65, 0xa4, 0x00, 0x10, 0x69, 0xa7, 0x00, 0xb6, 0x6f, 0x00,
640x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x87, 640x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x87,
650x00, 0x01, 0xec, 0x00, 0x34, 0x68, 0x69, 0x73, 0x8a, 0x00, 650x00, 0x64, 0x00, 0x00, 0x54, 0x68, 0x69, 0x73, 0x8a, 0x00,
660x90, 0x77, 0x61, 0x73, 0x00, 0x69, 0x6e, 0x76, 0x65, 0x6e, 660x90, 0x77, 0x61, 0x73, 0x00, 0x69, 0x6e, 0x76, 0x65, 0x6e,
670x22, 0x01, 0xf1, 0x06, 0x62, 0x79, 0x00, 0x4e, 0x69, 0x6b, 670x22, 0x01, 0xf1, 0x06, 0x62, 0x79, 0x00, 0x4e, 0x69, 0x6b,
680x6f, 0x6c, 0x69, 0x00, 0x5b, 0x31, 0x33, 0x5d, 0x2c, 0x00, 680x6f, 0x6c, 0x69, 0x00, 0x5b, 0x31, 0x33, 0x5d, 0x2c, 0x00,
690x75, 0x6e, 0x64, 0x65, 0x72, 0x88, 0x00, 0x80, 0x6e, 0x61, 690x75, 0x6e, 0x64, 0x65, 0x72, 0x88, 0x00, 0x80, 0x6e, 0x61,
700x6d, 0x65, 0x00, 0x60, 0x54, 0x65, 0x6c, 0x01, 0x70, 0x00, 700x6d, 0x65, 0x00, 0x60, 0x54, 0x65, 0x6c, 0x01, 0x71, 0x00,
710x53, 0x68, 0x6f, 0x77, 0x27, 0x3b, 0x4d, 0x01, 0x00, 0x18, 710x53, 0x68, 0x6f, 0x77, 0x27, 0x3b, 0x4d, 0x01, 0x01, 0x18,
720x00, 0x04, 0xce, 0x00, 0x30, 0x6d, 0x6f, 0x6e, 0x9e, 0x00, 720x00, 0x02, 0xce, 0x00, 0x30, 0x6d, 0x6f, 0x6e, 0x9e, 0x00,
730x50, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x70, 0x01, 0x02, 0x07, 730x51, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x70, 0x01, 0x01, 0x07,
740x02, 0xf4, 0x04, 0x45, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 740x02, 0xf4, 0x04, 0x45, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68,
750x00, 0x61, 0x73, 0x00, 0x60, 0x53, 0x70, 0x69, 0x72, 0x61, 750x00, 0x61, 0x73, 0x00, 0x60, 0x53, 0x70, 0x69, 0x72, 0x61,
760x6c, 0x00, 0x8b, 0x02, 0x45, 0x27, 0x2e, 0x00, 0x00, 0x0d, 760x6c, 0x00, 0x8b, 0x02, 0x10, 0x27, 0x8c, 0x00, 0x04, 0x0d,
770x00, 0x00, 0x89, 0x00, 0x01, 0xcc, 0x01, 0x70, 0x72, 0x69, 770x00, 0x01, 0x89, 0x00, 0x00, 0xcc, 0x01, 0x40, 0x72, 0x69,
780x62, 0x75, 0x74, 0x65, 0x64, 0xbd, 0x00, 0x21, 0x74, 0x68, 780x62, 0x75, 0x3e, 0x00, 0x51, 0x74, 0x6f, 0x00, 0x74, 0x68,
790x5a, 0x00, 0x40, 0x6c, 0x6c, 0x65, 0x63, 0x8d, 0x01, 0x00, 790x5a, 0x00, 0x41, 0x6c, 0x6c, 0x65, 0x63, 0x66, 0x02, 0xe1,
800x9f, 0x00, 0xb0, 0x4a, 0x61, 0x6d, 0x65, 0x73, 0x00, 0x48, 800x62, 0x79, 0x00, 0x4a, 0x61, 0x6d, 0x65, 0x73, 0x00, 0x48,
810x61, 0x72, 0x76, 0x65, 0xb7, 0x01, 0x01, 0xa8, 0x00, 0xd1, 810x61, 0x72, 0x76, 0x65, 0xb7, 0x01, 0x00, 0xa8, 0x00, 0xd1,
820x00, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 820x00, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77,
830x77, 0x2e, 0x6e, 0xbf, 0x00, 0xa2, 0x2e, 0x63, 0x6f, 0x2e, 830x77, 0x2e, 0x6e, 0xbf, 0x00, 0xa2, 0x2e, 0x63, 0x6f, 0x2e,
840x6a, 0x70, 0x2f, 0x65, 0x6e, 0x2f, 0xe6, 0x00, 0xf6, 0x10, 840x6a, 0x70, 0x2f, 0x65, 0x6e, 0x2f, 0xe6, 0x00, 0xf6, 0x10,
@@ -87,19 +87,19 @@ const char help_text[] = {
870x68, 0x74, 0x6d, 0x6c, 0x00, 0x00, 0x00, 0x32, 0x38, 0x2e, 870x68, 0x74, 0x6d, 0x6c, 0x00, 0x00, 0x00, 0x32, 0x38, 0x2e,
880x31, 0x1d, 0x03, 0x01, 0x81, 0x00, 0x21, 0x6f, 0x6c, 0x26, 880x31, 0x1d, 0x03, 0x01, 0x81, 0x00, 0x21, 0x6f, 0x6c, 0x26,
890x03, 0xa0, 0x4c, 0x65, 0x66, 0x74, 0x2d, 0x63, 0x6c, 0x69, 890x03, 0xa0, 0x4c, 0x65, 0x66, 0x74, 0x2d, 0x63, 0x6c, 0x69,
900x63, 0x6b, 0x8d, 0x01, 0x30, 0x61, 0x6e, 0x79, 0x8d, 0x01, 900x63, 0x6b, 0x8d, 0x01, 0x32, 0x61, 0x6e, 0x79, 0x8d, 0x01,
910x02, 0x9f, 0x01, 0x32, 0x00, 0x74, 0x6f, 0x15, 0x02, 0x21, 910x00, 0x9f, 0x01, 0x01, 0x5a, 0x01, 0x00, 0x15, 0x02, 0x21,
920x61, 0x6e, 0x03, 0x02, 0x21, 0x00, 0x69, 0xeb, 0x01, 0x10, 920x61, 0x6e, 0x03, 0x02, 0x21, 0x00, 0x69, 0xeb, 0x01, 0x10,
930x72, 0x0b, 0x01, 0x31, 0x6e, 0x27, 0x74, 0x83, 0x02, 0xb0, 930x72, 0x0b, 0x01, 0x31, 0x6e, 0x27, 0x74, 0x83, 0x02, 0xb0,
940x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x2c, 0x00, 0x6f, 940x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x2c, 0x00, 0x6f,
950x72, 0x2f, 0x00, 0x99, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 950x72, 0x2f, 0x00, 0x61, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65,
960x00, 0x6f, 0x6e, 0x2d, 0x00, 0x61, 0x2e, 0x00, 0x57, 0x68, 960x1a, 0x00, 0x07, 0x2d, 0x00, 0x30, 0x2e, 0x00, 0x57, 0xfe,
970x65, 0x6e, 0x65, 0x02, 0x50, 0x63, 0x72, 0x65, 0x61, 0x74, 970x01, 0x00, 0x65, 0x02, 0x50, 0x63, 0x72, 0x65, 0x61, 0x74,
980x93, 0x03, 0x54, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x08, 0x03, 980x93, 0x03, 0x54, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x08, 0x03,
990x46, 0x28, 0x6f, 0x6e, 0x65, 0xca, 0x02, 0x7f, 0x63, 0x6c, 990x10, 0x28, 0x31, 0x00, 0x05, 0xca, 0x02, 0x7f, 0x63, 0x6c,
1000x6f, 0x73, 0x65, 0x64, 0x2c, 0xf4, 0x02, 0x06, 0x1a, 0x2c, 1000x6f, 0x73, 0x65, 0x64, 0x2c, 0xf4, 0x02, 0x06, 0x1b, 0x2c,
1010x38, 0x03, 0x06, 0x2b, 0x03, 0x61, 0x00, 0x61, 0x62, 0x6f, 1010x38, 0x03, 0x05, 0x2b, 0x03, 0x62, 0x00, 0x61, 0x62, 0x6f,
1020x75, 0x74, 0x35, 0x02, 0x00, 0x28, 0x00, 0x0b, 0x3a, 0x03, 1020x75, 0x74, 0x35, 0x02, 0x01, 0x28, 0x00, 0x09, 0x3a, 0x03,
1030x50, 0x6e, 0x6f, 0x00, 0x65, 0x78, 0xb9, 0x01, 0x43, 0x65, 1030x50, 0x6e, 0x6f, 0x00, 0x65, 0x78, 0xb9, 0x01, 0x43, 0x65,
1040x6f, 0x75, 0x73, 0xd4, 0x02, 0x71, 0x62, 0x65, 0x74, 0x77, 1040x6f, 0x75, 0x73, 0xd4, 0x02, 0x71, 0x62, 0x65, 0x74, 0x77,
1050x65, 0x65, 0x6e, 0x5a, 0x02, 0x21, 0x6f, 0x66, 0xec, 0x01, 1050x65, 0x65, 0x6e, 0x5a, 0x02, 0x21, 0x6f, 0x66, 0xec, 0x01,
@@ -107,99 +107,99 @@ const char help_text[] = {
1070x00, 0x69, 0x74, 0x00, 0x77, 0x69, 0x6c, 0x6c, 0x00, 0x62, 1070x00, 0x69, 0x74, 0x00, 0x77, 0x69, 0x6c, 0x6c, 0x00, 0x62,
1080x65, 0x00, 0x68, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 1080x65, 0x00, 0x68, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68,
1090x65, 0x03, 0x80, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 1090x65, 0x03, 0x80, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69,
1100x63, 0xac, 0x03, 0x69, 0x3b, 0x00, 0x73, 0x6f, 0x00, 0x79, 1100x63, 0xac, 0x03, 0x6a, 0x3b, 0x00, 0x73, 0x6f, 0x00, 0x79,
1110x35, 0x04, 0x02, 0x79, 0x04, 0x20, 0x74, 0x68, 0xd6, 0x00, 1110x35, 0x04, 0x01, 0x79, 0x04, 0x20, 0x74, 0x68, 0xd6, 0x00,
1120x22, 0x6f, 0x6c, 0xe1, 0x02, 0x09, 0x41, 0x00, 0x22, 0x69, 1120x23, 0x6f, 0x6c, 0xe1, 0x02, 0x08, 0x41, 0x00, 0x22, 0x69,
1130x6e, 0xa7, 0x00, 0x21, 0x77, 0x61, 0xe1, 0x01, 0x60, 0x44, 1130x6e, 0xa7, 0x00, 0x21, 0x77, 0x61, 0xe1, 0x01, 0x30, 0x44,
1140x75, 0x72, 0x69, 0x6e, 0x67, 0x91, 0x03, 0x42, 0x76, 0x69, 1140x75, 0x72, 0xcb, 0x02, 0x72, 0x73, 0x6f, 0x6c, 0x76, 0x69,
1150x6e, 0x67, 0x90, 0x03, 0x10, 0x6d, 0x2b, 0x00, 0x52, 0x00, 1150x6e, 0x67, 0x90, 0x03, 0x10, 0x6d, 0x2b, 0x00, 0x52, 0x00,
1160x6b, 0x6e, 0x6f, 0x77, 0x2b, 0x00, 0x12, 0x61, 0x8a, 0x04, 1160x6b, 0x6e, 0x6f, 0x77, 0x2b, 0x00, 0x12, 0x61, 0x8a, 0x04,
1170x15, 0x63, 0xc6, 0x04, 0x03, 0xa7, 0x00, 0x03, 0x0b, 0x03, 1170x16, 0x63, 0xc6, 0x04, 0x02, 0xa7, 0x00, 0x03, 0x0b, 0x03,
1180x01, 0x77, 0x00, 0xa2, 0x61, 0x00, 0x73, 0x70, 0x65, 0x63, 1180x01, 0x77, 0x00, 0xa2, 0x61, 0x00, 0x73, 0x70, 0x65, 0x63,
1190x69, 0x66, 0x69, 0x63, 0x01, 0x01, 0x70, 0x62, 0x75, 0x74, 1190x69, 0x66, 0x69, 0x63, 0x01, 0x01, 0x70, 0x62, 0x75, 0x74,
1200x00, 0x6e, 0x6f, 0x74, 0xbf, 0x00, 0x21, 0x73, 0x75, 0x0f, 1200x00, 0x6e, 0x6f, 0x74, 0xbf, 0x00, 0x22, 0x73, 0x75, 0x0f,
1210x04, 0x00, 0x89, 0x03, 0x11, 0x72, 0x9b, 0x00, 0x03, 0x03, 1210x04, 0x11, 0x77, 0x95, 0x01, 0x00, 0x9b, 0x00, 0x02, 0x03,
1220x01, 0x20, 0x67, 0x6f, 0x27, 0x01, 0x03, 0x7e, 0x01, 0x10, 1220x01, 0x21, 0x67, 0x6f, 0x27, 0x01, 0x02, 0x7e, 0x01, 0x10,
1230x6f, 0xb3, 0x01, 0x04, 0xff, 0x00, 0x00, 0x92, 0x03, 0x03, 1230x6f, 0xb3, 0x01, 0x05, 0x64, 0x03, 0x00, 0x5d, 0x00, 0x06,
1240xe1, 0x04, 0x05, 0xab, 0x02, 0x01, 0x81, 0x01, 0xa7, 0x2e, 1240xe1, 0x04, 0x01, 0xab, 0x02, 0x01, 0x81, 0x01, 0x71, 0x2e,
1250x00, 0x49, 0x6e, 0x00, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x15, 1250x00, 0x49, 0x6e, 0x00, 0x6f, 0x72, 0x36, 0x03, 0x05, 0x15,
1260x04, 0x23, 0x69, 0x73, 0x07, 0x01, 0x30, 0x00, 0x64, 0x6f, 1260x04, 0x23, 0x69, 0x73, 0x07, 0x01, 0x30, 0x00, 0x64, 0x6f,
1270x1e, 0x02, 0x72, 0x66, 0x6f, 0x72, 0x67, 0x65, 0x74, 0x2c, 1270x1e, 0x02, 0x72, 0x66, 0x6f, 0x72, 0x67, 0x65, 0x74, 0x2c,
1280xf6, 0x01, 0x76, 0x61, 0x6e, 0x00, 0x72, 0x69, 0x67, 0x68, 1280xf6, 0x01, 0x40, 0x61, 0x6e, 0x00, 0x72, 0xcf, 0x00, 0x06,
1290x6a, 0x02, 0x04, 0x4b, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x65, 1290x6a, 0x02, 0x03, 0x4b, 0x00, 0x01, 0x7c, 0x00, 0x53, 0x64,
1300x02, 0x22, 0x67, 0x2c, 0x82, 0x00, 0x01, 0x6e, 0x01, 0x05, 1300x72, 0x61, 0x67, 0x2c, 0x82, 0x00, 0x01, 0x6e, 0x01, 0x04,
1310x26, 0x02, 0x72, 0x6e, 0x00, 0x61, 0x72, 0x72, 0x6f, 0x77, 1310x26, 0x02, 0x72, 0x6e, 0x00, 0x61, 0x72, 0x72, 0x6f, 0x77,
1320x34, 0x04, 0x71, 0x72, 0x00, 0x70, 0x6f, 0x69, 0x6e, 0x74, 1320x34, 0x04, 0x71, 0x72, 0x00, 0x70, 0x6f, 0x69, 0x6e, 0x74,
1330xb4, 0x05, 0x16, 0x74, 0x8b, 0x00, 0x41, 0x44, 0x72, 0x6f, 1330xb4, 0x05, 0x16, 0x74, 0x8b, 0x00, 0x42, 0x44, 0x72, 0x6f,
1340x70, 0x21, 0x01, 0x00, 0x54, 0x01, 0x14, 0x61, 0x14, 0x01, 1340x70, 0x21, 0x01, 0x44, 0x69, 0x6e, 0x00, 0x61, 0x14, 0x01,
1350x22, 0x6f, 0x66, 0x92, 0x01, 0x60, 0x63, 0x68, 0x6f, 0x69, 1350x22, 0x6f, 0x66, 0x92, 0x01, 0x61, 0x63, 0x68, 0x6f, 0x69,
1360x63, 0x65, 0x66, 0x00, 0x04, 0xcb, 0x01, 0x00, 0xa4, 0x02, 1360x63, 0x65, 0x66, 0x00, 0x04, 0xcb, 0x01, 0x61, 0x72, 0x65,
1370x30, 0x69, 0x6e, 0x64, 0x1f, 0x00, 0x03, 0x73, 0x00, 0x20, 1370x6d, 0x69, 0x6e, 0x64, 0x98, 0x00, 0x02, 0x73, 0x00, 0x20,
1380x64, 0x6f, 0x33, 0x05, 0x91, 0x27, 0x73, 0x00, 0x61, 0x73, 1380x64, 0x6f, 0x33, 0x05, 0x91, 0x27, 0x73, 0x00, 0x61, 0x73,
1390x73, 0x6f, 0x63, 0x69, 0xd6, 0x03, 0x73, 0x77, 0x69, 0x74, 1390x73, 0x6f, 0x63, 0x69, 0xd6, 0x03, 0x41, 0x77, 0x69, 0x74,
1400x68, 0x2e, 0x00, 0x59, 0xbc, 0x00, 0x4c, 0x61, 0x6c, 0x73, 1400x68, 0x0a, 0x06, 0x01, 0xbc, 0x00, 0x4c, 0x61, 0x6c, 0x73,
1410x6f, 0xc1, 0x00, 0x40, 0x65, 0x78, 0x69, 0x73, 0x8d, 0x00, 1410x6f, 0xc1, 0x00, 0x42, 0x65, 0x78, 0x69, 0x73, 0x8d, 0x00,
1420x02, 0xa3, 0x00, 0x02, 0x2a, 0x06, 0x21, 0x69, 0x63, 0x1f, 1420x00, 0xa3, 0x00, 0x02, 0x2a, 0x06, 0x21, 0x69, 0x63, 0x1f,
1430x05, 0x41, 0x6d, 0x00, 0x75, 0x70, 0x73, 0x00, 0x00, 0x0d, 1430x05, 0x41, 0x6d, 0x00, 0x75, 0x70, 0x73, 0x00, 0x01, 0x0d,
1440x03, 0x01, 0x11, 0x00, 0x01, 0x20, 0x03, 0x20, 0x64, 0x65, 1440x03, 0x00, 0x11, 0x00, 0x01, 0x20, 0x03, 0x20, 0x64, 0x65,
1450x9f, 0x03, 0x11, 0x79, 0x11, 0x00, 0x00, 0xe6, 0x03, 0x82, 1450x9f, 0x03, 0x12, 0x79, 0x22, 0x00, 0x81, 0x62, 0x79, 0x00,
1460x64, 0x72, 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x11, 0x00, 1460x64, 0x72, 0x6f, 0x70, 0x70, 0xc2, 0x04, 0x00, 0x11, 0x00,
1470x34, 0x6f, 0x66, 0x66, 0x96, 0x01, 0x00, 0xbf, 0x00, 0x05, 1470x35, 0x6f, 0x66, 0x66, 0x96, 0x01, 0x04, 0x55, 0x05, 0x00,
1480x18, 0x05, 0xa1, 0x2e, 0x00, 0x28, 0x41, 0x6c, 0x73, 0x6f, 1480xe6, 0x01, 0xa1, 0x2e, 0x00, 0x28, 0x41, 0x6c, 0x73, 0x6f,
1490x2c, 0x00, 0x69, 0xd3, 0x00, 0x30, 0x27, 0x72, 0x65, 0xd2, 1490x2c, 0x00, 0x69, 0xd3, 0x00, 0x31, 0x27, 0x72, 0x65, 0xd2,
1500x01, 0x01, 0xcf, 0x01, 0x06, 0xc0, 0x00, 0x06, 0x2b, 0x01, 1500x01, 0x01, 0xcf, 0x01, 0x06, 0xc0, 0x00, 0x05, 0x2b, 0x01,
1510x27, 0x69, 0x73, 0x27, 0x01, 0x06, 0x7f, 0x01, 0x02, 0x9c, 1510x28, 0x69, 0x73, 0x27, 0x01, 0x06, 0x7f, 0x01, 0x01, 0x9c,
1520x00, 0x28, 0x69, 0x74, 0x9a, 0x00, 0x00, 0x0f, 0x00, 0x20, 1520x00, 0x29, 0x69, 0x74, 0x9a, 0x00, 0x50, 0x69, 0x74, 0x00,
1530x61, 0x72, 0xca, 0x05, 0x02, 0xc7, 0x01, 0x11, 0x6b, 0x12, 1530x61, 0x72, 0xca, 0x05, 0x02, 0xc7, 0x01, 0x11, 0x6b, 0x12,
1540x00, 0xa3, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x65, 0x72, 0x2e, 1540x00, 0xa3, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x65, 0x72, 0x2e,
1550x00, 0x49, 0x30, 0x01, 0x60, 0x73, 0x77, 0x69, 0x76, 0x65, 1550x00, 0x49, 0x30, 0x01, 0x60, 0x73, 0x77, 0x69, 0x76, 0x65,
1560x6c, 0x09, 0x02, 0x40, 0x73, 0x74, 0x61, 0x6e, 0x88, 0x03, 1560x6c, 0x09, 0x02, 0x40, 0x73, 0x74, 0x61, 0x6e, 0x88, 0x03,
1570x24, 0x61, 0x73, 0x31, 0x06, 0x50, 0x67, 0x00, 0x69, 0x74, 1570x24, 0x61, 0x73, 0x31, 0x06, 0x50, 0x67, 0x00, 0x69, 0x74,
1580x2c, 0x3e, 0x00, 0x41, 0x73, 0x74, 0x61, 0x79, 0x79, 0x00, 1580x2c, 0x3e, 0x00, 0x42, 0x73, 0x74, 0x61, 0x79, 0x79, 0x00,
1590x07, 0x83, 0x06, 0x20, 0x70, 0x61, 0x93, 0x05, 0x01, 0xa6, 1590x06, 0x83, 0x06, 0x21, 0x70, 0x61, 0x93, 0x05, 0x00, 0xa6,
1600x01, 0x3a, 0x29, 0x00, 0x00, 0x4d, 0x01, 0x22, 0x75, 0x73, 1600x01, 0x3a, 0x29, 0x00, 0x00, 0x4d, 0x01, 0x22, 0x75, 0x73,
1610x84, 0x02, 0xa0, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x00, 1610x84, 0x02, 0xa2, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x00,
1620x6b, 0x65, 0x79, 0x42, 0x01, 0x01, 0x97, 0x00, 0x03, 0x94, 1620x6b, 0x65, 0x79, 0x61, 0x06, 0x00, 0x97, 0x00, 0x04, 0x94,
1630x00, 0x05, 0x01, 0x01, 0x06, 0x8f, 0x02, 0x13, 0x6e, 0x37, 1630x00, 0x04, 0x19, 0x06, 0x05, 0x8f, 0x02, 0x13, 0x6e, 0x37,
1640x06, 0xa3, 0x2e, 0x00, 0x50, 0x72, 0x65, 0x73, 0x73, 0x69, 1640x06, 0x83, 0x2e, 0x00, 0x50, 0x72, 0x65, 0x73, 0x73, 0x69,
1650x6e, 0x67, 0x7b, 0x06, 0x40, 0x74, 0x75, 0x72, 0x6e, 0x44, 1650xa4, 0x06, 0x60, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x44,
1660x00, 0x02, 0x66, 0x06, 0x66, 0x6f, 0x76, 0x65, 0x72, 0x00, 1660x00, 0x02, 0x66, 0x06, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x00,
1670x61, 0xc8, 0x04, 0x01, 0xc7, 0x00, 0x02, 0xca, 0x04, 0x22, 1670x61, 0xc8, 0x04, 0x01, 0xc7, 0x00, 0x01, 0xca, 0x04, 0x22,
1680x6f, 0x72, 0xe0, 0x00, 0x32, 0x00, 0x69, 0x74, 0x03, 0x04, 1680x6f, 0x72, 0xe0, 0x00, 0x01, 0xa0, 0x00, 0x00, 0x6a, 0x01,
1690x40, 0x2c, 0x00, 0x61, 0x73, 0x37, 0x04, 0x2f, 0x76, 0x65, 1690x10, 0x2c, 0xcd, 0x00, 0x5f, 0x61, 0x62, 0x6f, 0x76, 0x65,
1700x55, 0x00, 0x13, 0x22, 0x64, 0x6f, 0x16, 0x01, 0x02, 0x50, 1700x55, 0x00, 0x13, 0x23, 0x64, 0x6f, 0x16, 0x01, 0x01, 0x50,
1710x01, 0x25, 0x75, 0x70, 0x79, 0x01, 0x01, 0x06, 0x01, 0x22, 1710x01, 0x25, 0x75, 0x70, 0x79, 0x01, 0x01, 0x06, 0x01, 0x22,
1720x62, 0x65, 0xd5, 0x01, 0x22, 0x65, 0x64, 0x4f, 0x06, 0x8b, 1720x62, 0x65, 0xd5, 0x01, 0x22, 0x65, 0x64, 0x4f, 0x06, 0x8c,
1730x65, 0x78, 0x74, 0x00, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x00, 1730x65, 0x78, 0x74, 0x00, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x00,
1740x01, 0xa5, 0x01, 0x00, 0x6d, 0x00, 0x31, 0x65, 0x64, 0x3b, 1740x00, 0xa5, 0x01, 0x00, 0x6d, 0x00, 0x33, 0x65, 0x64, 0x3b,
1750x3a, 0x03, 0x06, 0x18, 0x01, 0x20, 0x62, 0x65, 0x1b, 0x01, 1750xff, 0x05, 0x04, 0x18, 0x01, 0x20, 0x62, 0x65, 0x1b, 0x01,
1760x14, 0x64, 0x0c, 0x01, 0x0c, 0x66, 0x02, 0x03, 0x1c, 0x01, 1760x15, 0x64, 0x0c, 0x01, 0x0c, 0x66, 0x02, 0x02, 0x1c, 0x01,
1770x12, 0x2c, 0x69, 0x05, 0x05, 0x3c, 0x02, 0x0e, 0x4d, 0x02, 1770x12, 0x2c, 0x69, 0x05, 0x05, 0x3c, 0x02, 0x0e, 0x4d, 0x02,
1780x12, 0x6e, 0xac, 0x00, 0x00, 0xf1, 0x00, 0x21, 0x61, 0x6e, 1780x13, 0x6e, 0xac, 0x00, 0x52, 0x6f, 0x72, 0x00, 0x61, 0x6e,
1790xd6, 0x03, 0x02, 0x42, 0x00, 0x30, 0x2e, 0x00, 0x00, 0x50, 1790xd6, 0x03, 0x01, 0x42, 0x00, 0x00, 0x6d, 0x04, 0x41, 0x28,
1800x02, 0x11, 0x6c, 0x92, 0x00, 0x11, 0x61, 0x71, 0x06, 0x10, 1800x41, 0x6c, 0x6c, 0x92, 0x00, 0x11, 0x61, 0x71, 0x06, 0x10,
1810x73, 0x99, 0x02, 0x42, 0x63, 0x72, 0x69, 0x62, 0x97, 0x04, 1810x73, 0x99, 0x02, 0x42, 0x63, 0x72, 0x69, 0x62, 0x97, 0x04,
1820x13, 0x73, 0x87, 0x06, 0x30, 0x32, 0x2e, 0x31, 0x01, 0x04, 1820x13, 0x73, 0x87, 0x06, 0x31, 0x32, 0x2e, 0x31, 0x01, 0x04,
1830x02, 0x97, 0x00, 0xb2, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 1830x01, 0x97, 0x00, 0xb2, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61,
1840x62, 0x6c, 0x65, 0x2e, 0x29, 0x4e, 0x06, 0x16, 0x32, 0x4e, 1840x62, 0x6c, 0x65, 0x2e, 0x29, 0x4e, 0x06, 0x16, 0x32, 0x4e,
1850x06, 0x00, 0x9d, 0x07, 0x50, 0x6d, 0x65, 0x74, 0x65, 0x72, 1850x06, 0x00, 0x9d, 0x07, 0x71, 0x6d, 0x65, 0x74, 0x65, 0x72,
1860x50, 0x06, 0x00, 0xff, 0x07, 0x35, 0x73, 0x65, 0x00, 0x14, 1860x73, 0x20, 0x76, 0x07, 0x46, 0x65, 0x73, 0x65, 0x00, 0x14,
1870x00, 0x01, 0x45, 0x04, 0x06, 0x3f, 0x00, 0x51, 0x00, 0x66, 1870x00, 0x02, 0x44, 0x00, 0x04, 0x3f, 0x00, 0x51, 0x00, 0x66,
1880x72, 0x6f, 0x6d, 0x7c, 0x00, 0xe0, 0x60, 0x43, 0x75, 0x73, 1880x72, 0x6f, 0x6d, 0x7c, 0x00, 0xe1, 0x60, 0x43, 0x75, 0x73,
1890x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 1890x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70,
1900x72, 0x00, 0x04, 0x16, 0x04, 0xb0, 0x60, 0x54, 0x79, 0x70, 1900x72, 0x00, 0x03, 0x16, 0x04, 0xb0, 0x60, 0x54, 0x79, 0x70,
1910x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0xae, 0x00, 0x91, 1910x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0xae, 0x00, 0x91,
1920x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 0x48, 0x65, 0x0f, 1920x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 0x48, 0x65, 0x0f,
1930x05, 0x50, 0x00, 0x00, 0x53, 0x69, 0x7a, 0x20, 0x03, 0x02, 1930x05, 0x51, 0x00, 0x00, 0x53, 0x69, 0x7a, 0x20, 0x03, 0x01,
1940xdf, 0x01, 0x15, 0x69, 0xac, 0x05, 0x01, 0x46, 0x05, 0x30, 1940xdf, 0x01, 0x15, 0x69, 0xac, 0x05, 0x01, 0x46, 0x05, 0x30,
1950x69, 0x66, 0x66, 0x20, 0x05, 0x63, 0x74, 0x79, 0x00, 0x00, 1950x69, 0x66, 0x66, 0x20, 0x05, 0x63, 0x74, 0x79, 0x00, 0x00,
1960x00, 0x43, 0xe5, 0x06, 0x02, 0x2a, 0x04, 0x05, 0x1a, 0x00, 1960x00, 0x43, 0xe5, 0x06, 0x02, 0x2a, 0x04, 0x06, 0x1a, 0x00,
1970x05, 0x5b, 0x03, 0x40, 0x65, 0x6e, 0x65, 0x72, 0xeb, 0x03, 1970x04, 0x5b, 0x03, 0x41, 0x65, 0x6e, 0x65, 0x72, 0xeb, 0x03,
1980x03, 0x23, 0x08, 0x57, 0x2e, 0x00, 0x4d, 0x6f, 0x72, 0x29, 1980x02, 0x3d, 0x07, 0x57, 0x2e, 0x00, 0x4d, 0x6f, 0x72, 0x29,
1990x00, 0x13, 0x00, 0x54, 0x07, 0xd3, 0x00, 0x72, 0x65, 0x71, 1990x00, 0x13, 0x00, 0x54, 0x07, 0xa0, 0x00, 0x72, 0x65, 0x71,
2000x75, 0x69, 0x72, 0x65, 0x00, 0x6d, 0x6f, 0x72, 0x65, 0xcf, 2000x75, 0x69, 0x72, 0x65, 0x00, 0x6d, 0x1f, 0x00, 0x02, 0xcf,
2010x08, 0x62, 0x78, 0x00, 0x64, 0x65, 0x64, 0x75, 0x3d, 0x01, 2010x08, 0x62, 0x78, 0x00, 0x64, 0x65, 0x64, 0x75, 0x3d, 0x01,
2020x01, 0x65, 0x06, 0x02, 0xb8, 0x00, 0x80, 0x55, 0x6e, 0x72, 2020x02, 0x65, 0x06, 0x01, 0xb8, 0x00, 0x80, 0x55, 0x6e, 0x72,
2030x65, 0x61, 0x73, 0x6f, 0x6e, 0xe9, 0x00, 0x18, 0x27, 0x73, 2030x65, 0x61, 0x73, 0x6f, 0x6e, 0xe9, 0x00, 0x18, 0x27, 0x73,
2040x00, 0x20, 0x6c, 0x65, 0x41, 0x03, 0x35, 0x6d, 0x61, 0x79, 2040x00, 0x20, 0x6c, 0x65, 0x41, 0x03, 0x35, 0x6d, 0x61, 0x79,
2050x4d, 0x00, 0xe0, 0x62, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 2050x4d, 0x00, 0xe0, 0x62, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61,
diff --git a/apps/plugins/puzzles/help/guess.c b/apps/plugins/puzzles/help/guess.c
index 63ada73bca..1fc4f0695f 100644
--- a/apps/plugins/puzzles/help/guess.c
+++ b/apps/plugins/puzzles/help/guess.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -16,7 +16,7 @@ struct style_text help_text_style[] = {
16 LAST_STYLE_ITEM 16 LAST_STYLE_ITEM
17}; 17};
18 18
19/* orig 3042 comp 1882 ratio 0.618672 level 11 saved 1160 */ 19/* orig 3042 comp 1883 ratio 0.619001 level 10 saved 1159 */
20const char help_text[] = { 20const char help_text[] = {
210xf2, 0x2a, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 210xf2, 0x2a, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
220x31, 0x35, 0x3a, 0x20, 0x47, 0x75, 0x65, 0x73, 0x73, 0x20, 220x31, 0x35, 0x3a, 0x20, 0x47, 0x75, 0x65, 0x73, 0x73, 0x20,
@@ -37,17 +37,17 @@ const char help_text[] = {
370x95, 0x00, 0xa2, 0x65, 0x73, 0x2e, 0x00, 0x00, 0x00, 0x45, 370x95, 0x00, 0xa2, 0x65, 0x73, 0x2e, 0x00, 0x00, 0x00, 0x45,
380x61, 0x63, 0x68, 0x10, 0x00, 0xc1, 0x00, 0x67, 0x65, 0x74, 380x61, 0x63, 0x68, 0x10, 0x00, 0xc1, 0x00, 0x67, 0x65, 0x74,
390x73, 0x00, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x3d, 0x00, 390x73, 0x00, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x3d, 0x00,
400x00, 0x50, 0x00, 0x07, 0x35, 0x00, 0xa9, 0x63, 0x6f, 0x72, 400x01, 0x50, 0x00, 0x06, 0x35, 0x00, 0xa9, 0x63, 0x6f, 0x72,
410x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x2d, 0xb9, 0x00, 0x30, 410x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x2d, 0xb9, 0x00, 0x33,
420x00, 0x69, 0x6e, 0x29, 0x00, 0x04, 0x1f, 0x00, 0xf2, 0x03, 420x00, 0x69, 0x6e, 0x79, 0x00, 0x01, 0x1f, 0x00, 0xf2, 0x03,
430x00, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x00, 0x28, 0x69, 430x00, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x00, 0x28, 0x69,
440x6e, 0x00, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x29, 0xda, 0x00, 440x6e, 0x00, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x29, 0xda, 0x00,
450x4f, 0x61, 0x6c, 0x73, 0x6f, 0x51, 0x00, 0x06, 0x1f, 0x00, 450x4f, 0x61, 0x6c, 0x73, 0x6f, 0x51, 0x00, 0x06, 0x1f, 0x00,
460x52, 0x00, 0x02, 0x58, 0x77, 0x72, 0x6f, 0x6e, 0x67, 0x50, 460x52, 0x00, 0x02, 0x58, 0x77, 0x72, 0x6f, 0x6e, 0x67, 0x50,
470x00, 0x60, 0x77, 0x68, 0x69, 0x74, 0x65, 0x29, 0xb6, 0x00, 470x00, 0x60, 0x77, 0x68, 0x69, 0x74, 0x65, 0x29, 0xb6, 0x00,
480xc2, 0x54, 0x68, 0x69, 0x73, 0x00, 0x67, 0x61, 0x6d, 0x65, 480xc2, 0x54, 0x68, 0x69, 0x73, 0x00, 0x67, 0x61, 0x6d, 0x65,
490x00, 0x69, 0x73, 0x5b, 0x00, 0xa2, 0x6b, 0x6e, 0x6f, 0x77, 490x00, 0x69, 0x73, 0x5b, 0x00, 0x70, 0x6b, 0x6e, 0x6f, 0x77,
500x6e, 0x00, 0x28, 0x61, 0x6e, 0x64, 0xc3, 0x00, 0x40, 0x74, 500x6e, 0x00, 0x28, 0x6b, 0x00, 0x01, 0xc3, 0x00, 0x40, 0x74,
510x65, 0x64, 0x2c, 0x14, 0x01, 0xf2, 0x0b, 0x48, 0x61, 0x73, 510x65, 0x64, 0x2c, 0x14, 0x01, 0xf2, 0x0b, 0x48, 0x61, 0x73,
520x62, 0x72, 0x6f, 0x2c, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x6c, 520x62, 0x72, 0x6f, 0x2c, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x6c,
530x79, 0x29, 0x00, 0x61, 0x73, 0x00, 0x61, 0x00, 0x62, 0x6f, 530x79, 0x29, 0x00, 0x61, 0x73, 0x00, 0x61, 0x00, 0x62, 0x6f,
@@ -59,13 +59,13 @@ const char help_text[] = {
590x65, 0x72, 0x2c, 0x00, 0x74, 0x91, 0x00, 0xf0, 0x06, 0x76, 590x65, 0x72, 0x2c, 0x00, 0x74, 0x91, 0x00, 0xf0, 0x06, 0x76,
600x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x00, 0x61, 0x6c, 0x6c, 600x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x00, 0x61, 0x6c, 0x6c,
610x6f, 0x77, 0x73, 0x00, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 610x6f, 0x77, 0x73, 0x00, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d,
620xee, 0x01, 0x86, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x00, 0x6f, 620xee, 0x01, 0x50, 0x74, 0x69, 0x6e, 0x67, 0x73, 0xf3, 0x00,
630x66, 0xfd, 0x00, 0x04, 0x63, 0x00, 0x40, 0x00, 0x28, 0x75, 630x08, 0xfd, 0x00, 0x01, 0x63, 0x00, 0x40, 0x00, 0x28, 0x75,
640x70, 0xf1, 0x01, 0x46, 0x31, 0x30, 0x29, 0x2c, 0x1e, 0x00, 640x70, 0xf1, 0x01, 0x47, 0x31, 0x30, 0x29, 0x2c, 0x1e, 0x00,
650x0e, 0x76, 0x00, 0x0f, 0xbd, 0x01, 0x03, 0x11, 0x47, 0xb8, 650x0e, 0x76, 0x00, 0x0f, 0xbd, 0x01, 0x02, 0x11, 0x47, 0xb8,
660x01, 0xf1, 0x03, 0x77, 0x61, 0x73, 0x00, 0x63, 0x6f, 0x6e, 660x01, 0xf0, 0x00, 0x77, 0x61, 0x73, 0x00, 0x63, 0x6f, 0x6e,
670x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x00, 0x74, 670x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x4f, 0x00,
680x6f, 0x8f, 0x00, 0x00, 0x63, 0x00, 0x61, 0x6c, 0x65, 0x63, 680x01, 0x8f, 0x00, 0x91, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63,
690x74, 0x69, 0x6f, 0x1d, 0x02, 0xc0, 0x4a, 0x61, 0x6d, 0x65, 690x74, 0x69, 0x6f, 0x1d, 0x02, 0xc0, 0x4a, 0x61, 0x6d, 0x65,
700x73, 0x00, 0x48, 0x61, 0x72, 0x76, 0x65, 0x79, 0x3c, 0x00, 700x73, 0x00, 0x48, 0x61, 0x72, 0x76, 0x65, 0x79, 0x3c, 0x00,
710x43, 0x31, 0x35, 0x2e, 0x31, 0x9e, 0x02, 0x01, 0x3d, 0x00, 710x43, 0x31, 0x35, 0x2e, 0x31, 0x9e, 0x02, 0x01, 0x3d, 0x00,
@@ -73,24 +73,24 @@ const char help_text[] = {
730x6e, 0x00, 0x62, 0x65, 0x80, 0x01, 0x14, 0x79, 0x11, 0x02, 730x6e, 0x00, 0x62, 0x65, 0x80, 0x01, 0x14, 0x79, 0x11, 0x02,
740x61, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x9d, 0x01, 0x32, 740x61, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x9d, 0x01, 0x32,
750x6b, 0x65, 0x79, 0x46, 0x01, 0x12, 0x6f, 0x10, 0x00, 0x50, 750x6b, 0x65, 0x79, 0x46, 0x01, 0x12, 0x6f, 0x10, 0x00, 0x50,
760x6d, 0x6f, 0x75, 0x73, 0x65, 0x58, 0x00, 0x46, 0x57, 0x69, 760x6d, 0x6f, 0x75, 0x73, 0x65, 0x58, 0x00, 0x14, 0x57, 0x3a,
770x74, 0x68, 0x12, 0x00, 0x89, 0x2c, 0x00, 0x64, 0x72, 0x61, 770x02, 0x01, 0x12, 0x00, 0x89, 0x2c, 0x00, 0x64, 0x72, 0x61,
780x67, 0x00, 0x61, 0xe2, 0x01, 0x51, 0x00, 0x66, 0x72, 0x6f, 780x67, 0x00, 0x61, 0xe2, 0x01, 0x51, 0x00, 0x66, 0x72, 0x6f,
790x6d, 0x24, 0x00, 0x62, 0x74, 0x72, 0x61, 0x79, 0x00, 0x6f, 790x6d, 0x24, 0x00, 0x62, 0x74, 0x72, 0x61, 0x79, 0x00, 0x6f,
800xef, 0x01, 0x60, 0x6c, 0x65, 0x66, 0x74, 0x2d, 0x68, 0xec, 800xef, 0x01, 0x60, 0x6c, 0x65, 0x66, 0x74, 0x2d, 0x68, 0xec,
810x00, 0x31, 0x73, 0x69, 0x64, 0x06, 0x03, 0x91, 0x69, 0x74, 810x00, 0x31, 0x73, 0x69, 0x64, 0x06, 0x03, 0x91, 0x69, 0x74,
820x73, 0x00, 0x72, 0x65, 0x71, 0x75, 0x69, 0x38, 0x00, 0x30, 820x73, 0x00, 0x72, 0x65, 0x71, 0x75, 0x69, 0x38, 0x00, 0x31,
830x6f, 0x73, 0x69, 0xcc, 0x00, 0x05, 0x70, 0x02, 0x62, 0x75, 830x6f, 0x73, 0x69, 0xcc, 0x00, 0x04, 0x70, 0x02, 0x62, 0x75,
840x72, 0x72, 0x65, 0x6e, 0x74, 0x0f, 0x01, 0x12, 0x3b, 0x32, 840x72, 0x72, 0x65, 0x6e, 0x74, 0x0f, 0x01, 0x12, 0x3b, 0x32,
850x01, 0x32, 0x6d, 0x61, 0x79, 0x0e, 0x02, 0x21, 0x62, 0x65, 850x01, 0x32, 0x6d, 0x61, 0x79, 0x0e, 0x02, 0x21, 0x62, 0x65,
860x78, 0x00, 0x31, 0x67, 0x65, 0x64, 0x6c, 0x00, 0x04, 0x2d, 860x78, 0x00, 0x32, 0x67, 0x65, 0x64, 0x6c, 0x00, 0x04, 0x2d,
870x00, 0x01, 0x4a, 0x01, 0x44, 0x70, 0x61, 0x73, 0x74, 0x45, 870x00, 0x00, 0x5e, 0x00, 0x44, 0x70, 0x61, 0x73, 0x74, 0x45,
880x01, 0x00, 0x66, 0x00, 0x42, 0x63, 0x6f, 0x70, 0x79, 0x4b, 880x01, 0x00, 0x66, 0x00, 0x42, 0x63, 0x6f, 0x70, 0x79, 0x4b,
890x03, 0xc0, 0x65, 0x6c, 0x73, 0x65, 0x77, 0x68, 0x65, 0x72, 890x03, 0xc0, 0x65, 0x6c, 0x73, 0x65, 0x77, 0x68, 0x65, 0x72,
900x65, 0x2e, 0x00, 0x54, 0x84, 0x03, 0x20, 0x6d, 0x6f, 0xaf, 900x65, 0x2e, 0x00, 0x54, 0x84, 0x03, 0x31, 0x6d, 0x6f, 0x76,
910x03, 0x00, 0x5b, 0x00, 0x03, 0xc7, 0x00, 0x10, 0x69, 0xb8, 910x81, 0x03, 0x23, 0x65, 0x67, 0xc7, 0x00, 0x10, 0x69, 0xb8,
920x03, 0x10, 0x66, 0x98, 0x00, 0x04, 0x52, 0x00, 0x05, 0x97, 920x03, 0x11, 0x66, 0x98, 0x00, 0x04, 0x52, 0x00, 0x05, 0x97,
930x00, 0x00, 0x4a, 0x00, 0x32, 0x73, 0x6f, 0x6d, 0x40, 0x00, 930x00, 0x62, 0x74, 0x6f, 0x00, 0x73, 0x6f, 0x6d, 0x40, 0x00,
940x80, 0x00, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x10, 940x80, 0x00, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x10,
950x01, 0xef, 0x52, 0x69, 0x67, 0x68, 0x74, 0x2d, 0x63, 0x6c, 950x01, 0xef, 0x52, 0x69, 0x67, 0x68, 0x74, 0x2d, 0x63, 0x6c,
960x69, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0xbe, 0x00, 0x02, 0x40, 960x69, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0xbe, 0x00, 0x02, 0x40,
@@ -99,114 +99,114 @@ const char help_text[] = {
990x74, 0x68, 0x61, 0x74, 0x17, 0x04, 0x00, 0x1d, 0x00, 0x03, 990x74, 0x68, 0x61, 0x74, 0x17, 0x04, 0x00, 0x1d, 0x00, 0x03,
1000x1c, 0x00, 0x60, 0x73, 0x00, 0x77, 0x69, 0x6c, 0x6c, 0xe6, 1000x1c, 0x00, 0x60, 0x73, 0x00, 0x77, 0x69, 0x6c, 0x6c, 0xe6,
1010x00, 0xd0, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 1010x00, 0xd0, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69,
1020x63, 0x61, 0x6c, 0x6c, 0x79, 0x48, 0x00, 0x00, 0x00, 0x02, 1020x63, 0x61, 0x6c, 0x6c, 0x79, 0x48, 0x00, 0x04, 0x00, 0x02,
1030x03, 0x69, 0x03, 0x25, 0x65, 0x78, 0x60, 0x00, 0x40, 0x66, 1030x55, 0x65, 0x00, 0x6e, 0x65, 0x78, 0x60, 0x00, 0x41, 0x66,
1040x74, 0x65, 0x72, 0x3c, 0x00, 0x00, 0x83, 0x00, 0x00, 0x95, 1040x74, 0x65, 0x72, 0x3c, 0x00, 0x30, 0x69, 0x6e, 0x67, 0x95,
1050x00, 0xd2, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 1050x00, 0xd3, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74,
1060x69, 0x76, 0x65, 0x6c, 0x79, 0xf7, 0x02, 0x09, 0xd6, 0x01, 1060x69, 0x76, 0x65, 0x6c, 0x79, 0xf7, 0x02, 0x08, 0xd6, 0x01,
1070x11, 0x2c, 0x0e, 0x00, 0x21, 0x75, 0x70, 0x31, 0x01, 0x40, 1070x11, 0x2c, 0x0e, 0x00, 0x21, 0x75, 0x70, 0x31, 0x01, 0x10,
1080x64, 0x6f, 0x77, 0x6e, 0xb1, 0x00, 0x30, 0x73, 0x6f, 0x72, 1080x64, 0x5a, 0x03, 0x60, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72,
1090x21, 0x00, 0x14, 0x73, 0x1a, 0x02, 0x22, 0x75, 0x73, 0x6d, 1090x21, 0x00, 0x14, 0x73, 0x1a, 0x02, 0x22, 0x75, 0x73, 0x6d,
1100x00, 0x20, 0x73, 0x65, 0x67, 0x02, 0x02, 0x29, 0x01, 0x03, 1100x00, 0x20, 0x73, 0x65, 0x67, 0x02, 0x02, 0x29, 0x01, 0x03,
1110xe8, 0x01, 0x14, 0x2c, 0xd2, 0x01, 0x02, 0x73, 0x01, 0x10, 1110xe8, 0x01, 0x15, 0x2c, 0xd2, 0x01, 0x01, 0x42, 0x00, 0x10,
1120x72, 0x04, 0x01, 0x01, 0x3c, 0x00, 0x0c, 0x30, 0x00, 0x05, 1120x72, 0x04, 0x01, 0x02, 0x3c, 0x00, 0x0c, 0x30, 0x00, 0x04,
1130x40, 0x01, 0x01, 0xe6, 0x02, 0x01, 0x36, 0x00, 0x90, 0x73, 1130x40, 0x01, 0x02, 0xe6, 0x02, 0x00, 0x36, 0x00, 0x90, 0x73,
1140x70, 0x61, 0x63, 0x65, 0x00, 0x62, 0x61, 0x72, 0x5b, 0x02, 1140x70, 0x61, 0x63, 0x65, 0x00, 0x62, 0x61, 0x72, 0x5b, 0x02,
1150x41, 0x45, 0x6e, 0x74, 0x65, 0x76, 0x00, 0x31, 0x00, 0x74, 1150x41, 0x45, 0x6e, 0x74, 0x65, 0x76, 0x00, 0x00, 0x39, 0x00,
1160x6f, 0x0b, 0x04, 0x03, 0x91, 0x01, 0x03, 0xff, 0x04, 0x03, 1160x01, 0x0b, 0x04, 0x03, 0x38, 0x00, 0x02, 0xff, 0x04, 0x03,
1170x4c, 0x00, 0x23, 0x65, 0x64, 0x78, 0x00, 0x04, 0x5f, 0x01, 1170x4c, 0x00, 0x23, 0x65, 0x64, 0x78, 0x00, 0x05, 0x5f, 0x01,
1180x02, 0x14, 0x05, 0x05, 0x5d, 0x00, 0x50, 0x2e, 0x00, 0x60, 1180x02, 0x14, 0x05, 0x04, 0x5d, 0x00, 0x50, 0x2e, 0x00, 0x60,
1190x44, 0x27, 0x4f, 0x00, 0x41, 0x42, 0x61, 0x63, 0x6b, 0x60, 1190x44, 0x27, 0x4f, 0x00, 0x42, 0x42, 0x61, 0x63, 0x6b, 0x60,
1200x00, 0x03, 0xde, 0x01, 0x12, 0x73, 0x4e, 0x00, 0x02, 0x7d, 1200x00, 0x02, 0xde, 0x01, 0x14, 0x73, 0xdf, 0x01, 0x00, 0x7d,
1210x00, 0x10, 0x53, 0x19, 0x00, 0x03, 0x8c, 0x01, 0x08, 0x6e, 1210x00, 0x11, 0x53, 0x19, 0x00, 0x03, 0x8c, 0x01, 0x07, 0x6e,
1220x01, 0x00, 0x31, 0x01, 0x50, 0x50, 0x72, 0x65, 0x73, 0x73, 1220x01, 0x00, 0x31, 0x01, 0x50, 0x50, 0x72, 0x65, 0x73, 0x73,
1230xc0, 0x01, 0x21, 0x60, 0x68, 0x49, 0x00, 0x32, 0x60, 0x3f, 1230xc0, 0x01, 0x21, 0x60, 0x68, 0x49, 0x00, 0x32, 0x60, 0x3f,
1240x27, 0x84, 0x01, 0x4e, 0x66, 0x69, 0x6c, 0x6c, 0xd2, 0x01, 1240x27, 0x84, 0x01, 0x10, 0x66, 0x05, 0x00, 0x0e, 0xd2, 0x01,
1250x01, 0x52, 0x01, 0x00, 0xea, 0x05, 0x82, 0x75, 0x67, 0x67, 1250x01, 0x52, 0x01, 0x80, 0x61, 0x00, 0x73, 0x75, 0x67, 0x67,
1260x65, 0x73, 0x74, 0x65, 0x64, 0x17, 0x00, 0x30, 0x2e, 0x00, 1260x65, 0x73, 0xa0, 0x00, 0x01, 0x17, 0x00, 0x31, 0x2e, 0x00,
1270x55, 0x45, 0x00, 0x01, 0x9f, 0x03, 0x00, 0xba, 0x04, 0xd0, 1270x55, 0x45, 0x00, 0x01, 0x9f, 0x03, 0xf0, 0x01, 0x69, 0x73,
1280x6e, 0x6f, 0x74, 0x00, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 1280x00, 0x6e, 0x6f, 0x74, 0x00, 0x72, 0x65, 0x63, 0x6f, 0x6d,
1290x65, 0x6e, 0x64, 0xac, 0x02, 0x50, 0x6f, 0x72, 0x00, 0x31, 1290x6d, 0x65, 0x6e, 0x64, 0xac, 0x02, 0x20, 0x6f, 0x72, 0x5f,
1300x30, 0x60, 0x00, 0x41, 0x6d, 0x6f, 0x72, 0x65, 0x01, 0x02, 1300x04, 0x72, 0x6f, 0x72, 0x00, 0x6d, 0x6f, 0x72, 0x65, 0x01,
1310x00, 0xb1, 0x04, 0x20, 0x69, 0x74, 0x2d, 0x00, 0x41, 0x73, 1310x02, 0x20, 0x61, 0x73, 0x77, 0x02, 0x71, 0x69, 0x73, 0x00,
1320x6c, 0x6f, 0x77, 0x61, 0x03, 0x21, 0x68, 0x65, 0xe5, 0x00, 1320x73, 0x6c, 0x6f, 0x77, 0x61, 0x03, 0x22, 0x68, 0x65, 0xe5,
1330x03, 0x6a, 0x00, 0x21, 0x69, 0x73, 0xf4, 0x05, 0x52, 0x6c, 1330x00, 0x02, 0x6a, 0x00, 0x21, 0x69, 0x73, 0xf4, 0x05, 0x52,
1340x65, 0x74, 0x65, 0x2c, 0x13, 0x01, 0xf0, 0x00, 0x6d, 0x61, 1340x6c, 0x65, 0x74, 0x65, 0x2c, 0x13, 0x01, 0xf2, 0x00, 0x6d,
1350x6c, 0x6c, 0x65, 0x72, 0x00, 0x66, 0x65, 0x65, 0x64, 0x62, 1350x61, 0x6c, 0x6c, 0x65, 0x72, 0x00, 0x66, 0x65, 0x65, 0x64,
1360x61, 0x63, 0x6b, 0x47, 0x00, 0x06, 0x31, 0x02, 0x50, 0x68, 1360x62, 0x61, 0x63, 0x6b, 0x47, 0x00, 0x04, 0x31, 0x02, 0x50,
1370x69, 0x67, 0x68, 0x6c, 0x8f, 0x01, 0x44, 0x65, 0x64, 0x3b, 1370x68, 0x69, 0x67, 0x68, 0x6c, 0x8f, 0x01, 0x45, 0x65, 0x64,
1380x00, 0x96, 0x02, 0x03, 0x83, 0x03, 0x41, 0x73, 0x65, 0x00, 1380x3b, 0x00, 0x96, 0x02, 0x02, 0x83, 0x03, 0x41, 0x73, 0x65,
1390x28, 0x7c, 0x00, 0x12, 0x76, 0xa5, 0x00, 0x01, 0x82, 0x00, 1390x00, 0x28, 0x7c, 0x00, 0x12, 0x76, 0xa5, 0x00, 0x01, 0x82,
1400x03, 0xfa, 0x01, 0x03, 0x56, 0x02, 0x16, 0x6d, 0x2c, 0x02, 1400x00, 0x04, 0xfa, 0x01, 0x02, 0x56, 0x02, 0x16, 0x6d, 0x2c,
1410x51, 0x61, 0x72, 0x72, 0x6f, 0x77, 0xd5, 0x01, 0x02, 0x57, 1410x02, 0x52, 0x61, 0x72, 0x72, 0x6f, 0x77, 0xd5, 0x01, 0x01,
1420x03, 0x03, 0x22, 0x01, 0x0f, 0xc4, 0x01, 0x08, 0x11, 0x29, 1420x57, 0x03, 0x04, 0x22, 0x01, 0x0f, 0xc4, 0x01, 0x07, 0x12,
1430x86, 0x00, 0x01, 0x56, 0x01, 0x0e, 0x33, 0x01, 0x12, 0x2c, 1430x29, 0x86, 0x00, 0x00, 0x56, 0x01, 0x0e, 0x33, 0x01, 0x12,
1440x89, 0x03, 0x72, 0x61, 0x6e, 0x79, 0x00, 0x68, 0x65, 0x6c, 1440x2c, 0x89, 0x03, 0x73, 0x61, 0x6e, 0x79, 0x00, 0x68, 0x65,
1450x0a, 0x06, 0x0d, 0xcb, 0x02, 0x03, 0x27, 0x07, 0x00, 0xbb, 1450x6c, 0x0a, 0x06, 0x0d, 0xcb, 0x02, 0x02, 0xaa, 0x01, 0x01,
1460x01, 0x01, 0x19, 0x00, 0x19, 0x60, 0x43, 0x00, 0x17, 0x27, 1460x99, 0x03, 0x00, 0x19, 0x00, 0x19, 0x60, 0x43, 0x00, 0x17,
1470xb1, 0x01, 0x66, 0x49, 0x66, 0x00, 0x79, 0x6f, 0x75, 0x64, 1470x27, 0xb1, 0x01, 0x66, 0x49, 0x66, 0x00, 0x79, 0x6f, 0x75,
1480x06, 0x06, 0xa9, 0x03, 0x11, 0x61, 0xb1, 0x01, 0x02, 0x5e, 1480x64, 0x06, 0x06, 0xa9, 0x03, 0x13, 0x61, 0xb1, 0x01, 0x03,
1490x01, 0x02, 0xad, 0x00, 0x30, 0x6f, 0x6c, 0x75, 0x1a, 0x00, 1490x5f, 0x03, 0x61, 0x65, 0x00, 0x73, 0x6f, 0x6c, 0x75, 0x1a,
1500x05, 0x24, 0x01, 0x33, 0x64, 0x69, 0x73, 0xf6, 0x04, 0x82, 1500x00, 0x04, 0x24, 0x01, 0x33, 0x64, 0x69, 0x73, 0xf6, 0x04,
1510x62, 0x65, 0x6c, 0x6f, 0x77, 0x3b, 0x00, 0x69, 0x4d, 0x00, 1510x82, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x3b, 0x00, 0x69, 0x4d,
1520x77, 0x72, 0x75, 0x6e, 0x00, 0x6f, 0x75, 0x74, 0x85, 0x05, 1520x00, 0x77, 0x72, 0x75, 0x6e, 0x00, 0x6f, 0x75, 0x74, 0x85,
1530x00, 0x30, 0x01, 0x04, 0xd0, 0x02, 0xbe, 0x60, 0x53, 0x6f, 1530x05, 0x01, 0x30, 0x01, 0x03, 0xd0, 0x02, 0xbe, 0x60, 0x53,
1540x6c, 0x76, 0x65, 0x2e, 0x2e, 0x2e, 0x27, 0x29, 0x57, 0x00, 1540x6f, 0x6c, 0x76, 0x65, 0x2e, 0x2e, 0x2e, 0x27, 0x29, 0x57,
1550x05, 0x97, 0x04, 0x71, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 1550x00, 0x05, 0x97, 0x04, 0x71, 0x72, 0x65, 0x76, 0x65, 0x61,
1560x65, 0x1b, 0x04, 0x23, 0x28, 0x41, 0x8b, 0x00, 0x11, 0x61, 1560x6c, 0x65, 0x1b, 0x04, 0x23, 0x28, 0x41, 0x8b, 0x00, 0x11,
1570xa6, 0x05, 0xb0, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 1570x61, 0xa6, 0x05, 0xb0, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63,
1580x69, 0x62, 0x65, 0x64, 0xc8, 0x02, 0x13, 0x73, 0xbc, 0x05, 1580x72, 0x69, 0x62, 0x65, 0x64, 0xc8, 0x02, 0x13, 0x73, 0xbc,
1590x72, 0x32, 0x2e, 0x31, 0x00, 0x61, 0x72, 0x65, 0x42, 0x00, 1590x05, 0x72, 0x32, 0x2e, 0x31, 0x00, 0x61, 0x72, 0x65, 0x42,
1600xb2, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 1600x00, 0xb2, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c,
1610x2e, 0x29, 0xc4, 0x05, 0x13, 0x32, 0xc4, 0x05, 0x50, 0x70, 1610x65, 0x2e, 0x29, 0xc4, 0x05, 0x13, 0x32, 0xc4, 0x05, 0x50,
1620x61, 0x72, 0x61, 0x6d, 0x27, 0x08, 0x02, 0xc6, 0x05, 0x01, 1620x70, 0x61, 0x72, 0x61, 0x6d, 0x27, 0x08, 0x03, 0xc6, 0x05,
1630xcd, 0x01, 0x06, 0x14, 0x00, 0x00, 0x41, 0x00, 0x06, 0x3c, 1630x00, 0xcd, 0x01, 0x06, 0x14, 0x00, 0x02, 0x41, 0x00, 0x04,
1640x00, 0x06, 0x80, 0x05, 0x21, 0x60, 0x43, 0xa4, 0x06, 0x00, 1640x3c, 0x00, 0x06, 0x80, 0x05, 0x21, 0x60, 0x43, 0xa4, 0x06,
1650xb5, 0x00, 0x30, 0x00, 0x6f, 0x70, 0x6f, 0x00, 0x04, 0x8e, 1650x00, 0xb5, 0x00, 0x31, 0x00, 0x6f, 0x70, 0x6f, 0x00, 0x03,
1660x05, 0xc0, 0x60, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 1660x8e, 0x05, 0xc0, 0x60, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00,
1670x65, 0x6e, 0x75, 0x2e, 0x4f, 0x00, 0x82, 0x00, 0x64, 0x65, 1670x6d, 0x65, 0x6e, 0x75, 0x2e, 0x4f, 0x00, 0x82, 0x00, 0x64,
1680x66, 0x61, 0x75, 0x6c, 0x74, 0x1c, 0x06, 0x60, 0x6d, 0x61, 1680x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x1c, 0x06, 0x62, 0x6d,
1690x74, 0x63, 0x68, 0x65, 0x3f, 0x01, 0x09, 0x66, 0x00, 0x12, 1690x61, 0x74, 0x63, 0x68, 0x65, 0x3f, 0x01, 0x07, 0x66, 0x00,
1700x66, 0x0d, 0x06, 0x0f, 0x60, 0x07, 0x05, 0x00, 0xf4, 0x00, 1700x13, 0x66, 0x0d, 0x06, 0x0f, 0x60, 0x07, 0x04, 0x00, 0xf4,
1710x13, 0x43, 0xf8, 0x06, 0x3b, 0x00, 0x00, 0x4e, 0x0c, 0x07, 1710x00, 0x13, 0x43, 0xf8, 0x06, 0x3d, 0x00, 0x00, 0x4e, 0x0c,
1720x0b, 0x8d, 0x01, 0x23, 0x69, 0x73, 0xc6, 0x03, 0x01, 0xae, 1720x07, 0x09, 0x36, 0x01, 0x24, 0x69, 0x73, 0xc6, 0x03, 0x00,
1730x00, 0x12, 0x3b, 0xb4, 0x00, 0x12, 0x32, 0x2c, 0x07, 0x51, 1730xae, 0x00, 0x12, 0x3b, 0xb4, 0x00, 0x12, 0x32, 0x2c, 0x07,
1740x00, 0x28, 0x6d, 0x6f, 0x72, 0xfc, 0x07, 0x71, 0x68, 0x61, 1740x21, 0x00, 0x28, 0x20, 0x03, 0xa1, 0x69, 0x73, 0x00, 0x68,
1750x72, 0x64, 0x65, 0x72, 0x29, 0xa3, 0x03, 0x80, 0x65, 0x67, 1750x61, 0x72, 0x64, 0x65, 0x72, 0x29, 0xa3, 0x03, 0x82, 0x65,
1760x73, 0x20, 0x70, 0x65, 0x72, 0x20, 0x9c, 0x01, 0x01, 0x61, 1760x67, 0x73, 0x20, 0x70, 0x65, 0x72, 0x20, 0x18, 0x03, 0x08,
1770x00, 0x0d, 0x4f, 0x07, 0x02, 0xb7, 0x01, 0x0d, 0x3e, 0x00, 1770x61, 0x00, 0x05, 0x4f, 0x07, 0x02, 0x1b, 0x00, 0x0e, 0x3e,
1780x05, 0x4b, 0x07, 0x11, 0x65, 0x37, 0x00, 0x0c, 0x6a, 0x07, 1780x00, 0x03, 0x4b, 0x07, 0x1a, 0x65, 0x37, 0x00, 0x04, 0xe5,
1790x00, 0xfc, 0x01, 0x05, 0x9a, 0x09, 0x4b, 0x66, 0x69, 0x6e, 1790x01, 0x00, 0xfc, 0x01, 0x04, 0x9a, 0x09, 0x4b, 0x66, 0x69,
1800x64, 0xa9, 0x00, 0x8b, 0x6e, 0x00, 0x28, 0x66, 0x65, 0x77, 1800x6e, 0x64, 0xa9, 0x00, 0x8b, 0x6e, 0x00, 0x28, 0x66, 0x65,
1810x65, 0x72, 0x52, 0x00, 0x10, 0x41, 0x06, 0x08, 0x74, 0x20, 1810x77, 0x65, 0x72, 0x52, 0x00, 0x10, 0x41, 0x06, 0x08, 0x74,
1820x62, 0x6c, 0x61, 0x6e, 0x6b, 0x73, 0x0f, 0x00, 0x21, 0x73, 1820x20, 0x62, 0x6c, 0x61, 0x6e, 0x6b, 0x73, 0x0f, 0x00, 0x21,
1830x00, 0x10, 0x00, 0x03, 0x7c, 0x02, 0x01, 0x11, 0x02, 0x80, 1830x73, 0x00, 0x10, 0x00, 0x05, 0xdd, 0x02, 0x80, 0x62, 0x65,
1840x67, 0x69, 0x76, 0x65, 0x6e, 0x00, 0x61, 0x73, 0x48, 0x01, 1840x00, 0x67, 0x69, 0x76, 0x65, 0x6e, 0xe6, 0x03, 0x31, 0x70,
1850x01, 0x5b, 0x02, 0x15, 0x61, 0xa6, 0x00, 0x31, 0x61, 0x6b, 1850x61, 0x72, 0x5b, 0x02, 0x15, 0x61, 0xa6, 0x00, 0x31, 0x61,
1860x65, 0xfd, 0x03, 0x40, 0x65, 0x61, 0x73, 0x69, 0x65, 0x08, 1860x6b, 0x65, 0xfd, 0x03, 0x40, 0x65, 0x61, 0x73, 0x69, 0x65,
1870x70, 0x62, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x90, 0x00, 1870x08, 0x71, 0x62, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x90,
1880x01, 0xf0, 0x08, 0x02, 0x1d, 0x06, 0x10, 0x74, 0x26, 0x01, 1880x00, 0x00, 0xf0, 0x08, 0x02, 0x1d, 0x06, 0x10, 0x74, 0x26,
1890x02, 0x65, 0x02, 0x10, 0x6e, 0x8d, 0x08, 0x20, 0x00, 0x62, 1890x01, 0x02, 0x65, 0x02, 0x10, 0x6e, 0x8d, 0x08, 0x20, 0x00,
1900x8d, 0x09, 0x57, 0x75, 0x6e, 0x74, 0x65, 0x64, 0x57, 0x00, 1900x62, 0x8d, 0x09, 0x20, 0x75, 0x6e, 0x76, 0x04, 0x07, 0x57,
1910x09, 0xb4, 0x00, 0x43, 0x29, 0x2e, 0x00, 0x54, 0x83, 0x04, 1910x00, 0x08, 0xb4, 0x00, 0x10, 0x29, 0xd3, 0x01, 0x02, 0x83,
1920x61, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0xd7, 0x06, 0x24, 1920x04, 0x30, 0x74, 0x75, 0x72, 0x57, 0x0a, 0x00, 0xd7, 0x06,
1930x62, 0x79, 0xe5, 0x01, 0x10, 0x2e, 0x07, 0x01, 0x31, 0x6f, 1930x24, 0x62, 0x79, 0xe5, 0x01, 0x10, 0x2e, 0x07, 0x01, 0x34,
1940x74, 0x65, 0x61, 0x00, 0x02, 0xae, 0x04, 0x72, 0x64, 0x6f, 1940x6f, 0x74, 0x65, 0x61, 0x00, 0xa2, 0x69, 0x73, 0x00, 0x64,
1950x65, 0x73, 0x6e, 0x27, 0x74, 0xdc, 0x08, 0x08, 0xc6, 0x00, 1950x6f, 0x65, 0x73, 0x6e, 0x27, 0x74, 0xdc, 0x08, 0x08, 0xc6,
1960x29, 0x69, 0x6e, 0x5b, 0x00, 0x06, 0x2d, 0x03, 0x11, 0x65, 1960x00, 0x29, 0x69, 0x6e, 0x5b, 0x00, 0x06, 0x2d, 0x03, 0x11,
1970x93, 0x06, 0x20, 0x77, 0x61, 0x89, 0x00, 0x01, 0x49, 0x00, 1970x65, 0x93, 0x06, 0x21, 0x77, 0x61, 0x89, 0x00, 0x00, 0x49,
1980x20, 0x2c, 0x00, 0xbd, 0x00, 0x84, 0x6f, 0x6e, 0x65, 0x00, 1980x00, 0x20, 0x2c, 0x00, 0xbd, 0x00, 0x84, 0x6f, 0x6e, 0x65,
1990x65, 0x78, 0x74, 0x72, 0x13, 0x08, 0x06, 0x2b, 0x01, 0x95, 1990x00, 0x65, 0x78, 0x74, 0x72, 0x13, 0x08, 0x06, 0x2b, 0x01,
2000x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2f, 2000x97, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65,
2010x01, 0x0b, 0x13, 0x02, 0x13, 0x28, 0x23, 0x06, 0x04, 0x99, 2010x2f, 0x01, 0x09, 0x6a, 0x01, 0x14, 0x28, 0x23, 0x06, 0x03,
2020x01, 0x12, 0x29, 0xbf, 0x07, 0x10, 0x6e, 0xde, 0x0a, 0x04, 2020x99, 0x01, 0x12, 0x29, 0xbf, 0x07, 0x11, 0x6e, 0xde, 0x0a,
2030x45, 0x02, 0x00, 0x3a, 0x05, 0x01, 0xb8, 0x00, 0x00, 0xca, 2030x04, 0x45, 0x02, 0x01, 0xdc, 0x01, 0x30, 0x74, 0x68, 0x61,
2040x02, 0x33, 0x63, 0x65, 0x3b, 0x6c, 0x05, 0x83, 0x6e, 0x63, 2040xca, 0x02, 0x33, 0x63, 0x65, 0x3b, 0x6c, 0x05, 0x51, 0x6e,
2050x72, 0x65, 0x61, 0x73, 0x65, 0x73, 0x35, 0x06, 0x42, 0x61, 2050x63, 0x72, 0x65, 0x61, 0xf1, 0x07, 0x01, 0x35, 0x06, 0x43,
2060x72, 0x63, 0x68, 0xa5, 0x04, 0x01, 0x67, 0x01, 0x03, 0x94, 2060x61, 0x72, 0x63, 0x68, 0xa5, 0x04, 0x00, 0x67, 0x01, 0x03,
2070x05, 0x24, 0x6e, 0x67, 0xc1, 0x01, 0x02, 0xb5, 0x0a, 0x08, 2070x94, 0x05, 0x25, 0x6e, 0x67, 0xc1, 0x01, 0x02, 0x68, 0x04,
2080x20, 0x01, 0x14, 0x6e, 0x1f, 0x01, 0x50, 0x75, 0x6c, 0x74, 2080x07, 0x20, 0x01, 0x14, 0x6e, 0x1f, 0x01, 0x50, 0x75, 0x6c,
2090x2e, 0x00, 2090x74, 0x2e, 0x00,
210}; 210};
211 211
212const unsigned short help_text_len = 3042; 212const unsigned short help_text_len = 3042;
diff --git a/apps/plugins/puzzles/help/inertia.c b/apps/plugins/puzzles/help/inertia.c
index b537fbf5d0..8d7902dc54 100644
--- a/apps/plugins/puzzles/help/inertia.c
+++ b/apps/plugins/puzzles/help/inertia.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -15,7 +15,7 @@ struct style_text help_text_style[] = {
15 LAST_STYLE_ITEM 15 LAST_STYLE_ITEM
16}; 16};
17 17
18/* orig 2266 comp 1565 ratio 0.690644 level 11 saved 701 */ 18/* orig 2266 comp 1565 ratio 0.690644 level 10 saved 701 */
19const char help_text[] = { 19const char help_text[] = {
200xf0, 0x1f, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 200xf0, 0x1f, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
210x32, 0x34, 0x3a, 0x20, 0x49, 0x6e, 0x65, 0x72, 0x74, 0x69, 210x32, 0x34, 0x3a, 0x20, 0x49, 0x6e, 0x65, 0x72, 0x74, 0x69,
@@ -30,10 +30,10 @@ const char help_text[] = {
300x00, 0x74, 0x6f, 0x00, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 300x00, 0x74, 0x6f, 0x00, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63,
310x74, 0x00, 0x40, 0x00, 0xf2, 0x06, 0x74, 0x68, 0x65, 0x00, 310x74, 0x00, 0x40, 0x00, 0xf2, 0x06, 0x74, 0x68, 0x65, 0x00,
320x67, 0x65, 0x6d, 0x73, 0x00, 0x77, 0x69, 0x74, 0x68, 0x6f, 320x67, 0x65, 0x6d, 0x73, 0x00, 0x77, 0x69, 0x74, 0x68, 0x6f,
330x75, 0x74, 0x00, 0x72, 0x75, 0x6e, 0x6e, 0x51, 0x00, 0xd3, 330x75, 0x74, 0x00, 0x72, 0x75, 0x6e, 0x6e, 0x51, 0x00, 0xa0,
340x74, 0x6f, 0x00, 0x61, 0x6e, 0x79, 0x00, 0x6d, 0x69, 0x6e, 340x74, 0x6f, 0x00, 0x61, 0x6e, 0x79, 0x00, 0x6d, 0x69, 0x6e,
350x65, 0x73, 0x2e, 0x86, 0x00, 0x80, 0x63, 0x61, 0x6e, 0x00, 350x44, 0x00, 0x02, 0x86, 0x00, 0x81, 0x63, 0x61, 0x6e, 0x00,
360x6d, 0x6f, 0x76, 0x65, 0x38, 0x00, 0x02, 0x81, 0x00, 0x21, 360x6d, 0x6f, 0x76, 0x65, 0x38, 0x00, 0x01, 0x81, 0x00, 0x21,
370x69, 0x6e, 0x26, 0x00, 0xf2, 0x02, 0x6f, 0x72, 0x74, 0x68, 370x69, 0x6e, 0x26, 0x00, 0xf2, 0x02, 0x6f, 0x72, 0x74, 0x68,
380x6f, 0x67, 0x6f, 0x6e, 0x61, 0x6c, 0x00, 0x6f, 0x72, 0x20, 380x6f, 0x67, 0x6f, 0x6e, 0x61, 0x6c, 0x00, 0x6f, 0x72, 0x20,
390x64, 0x69, 0x61, 0x0c, 0x00, 0xe7, 0x64, 0x69, 0x72, 0x65, 390x64, 0x69, 0x61, 0x0c, 0x00, 0xe7, 0x64, 0x69, 0x72, 0x65,
@@ -45,134 +45,134 @@ const char help_text[] = {
450x00, 0x73, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x8f, 0x00, 0xf4, 450x00, 0x73, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x8f, 0x00, 0xf4,
460x00, 0x73, 0x74, 0x6f, 0x70, 0x73, 0x00, 0x69, 0x74, 0x2e, 460x00, 0x73, 0x74, 0x6f, 0x70, 0x73, 0x00, 0x69, 0x74, 0x2e,
470x00, 0x41, 0x00, 0x77, 0x61, 0x6c, 0x5a, 0x00, 0x20, 0x6c, 470x00, 0x41, 0x00, 0x77, 0x61, 0x6c, 0x5a, 0x00, 0x20, 0x6c,
480x79, 0x81, 0x00, 0x81, 0x69, 0x74, 0x73, 0x00, 0x70, 0x61, 480x79, 0x81, 0x00, 0x82, 0x69, 0x74, 0x73, 0x00, 0x70, 0x61,
490x74, 0x68, 0x44, 0x00, 0x01, 0x2b, 0x00, 0x00, 0x51, 0x00, 490x74, 0x68, 0x44, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x51, 0x00,
500x70, 0x28, 0x62, 0x75, 0x74, 0x00, 0x69, 0x66, 0x0b, 0x00, 500x70, 0x28, 0x62, 0x75, 0x74, 0x00, 0x69, 0x66, 0x0b, 0x00,
510x14, 0x69, 0x6a, 0x00, 0x14, 0x00, 0x9a, 0x00, 0x25, 0x6c, 510x14, 0x69, 0x6a, 0x00, 0x14, 0x00, 0x9a, 0x00, 0x26, 0x6c,
520x79, 0x75, 0x00, 0x04, 0xd1, 0x00, 0x85, 0x72, 0x6f, 0x75, 520x79, 0x75, 0x00, 0x03, 0xd1, 0x00, 0x85, 0x72, 0x6f, 0x75,
530x67, 0x68, 0x00, 0x61, 0x00, 0xbd, 0x00, 0x80, 0x67, 0x61, 530x67, 0x68, 0x00, 0x61, 0x00, 0xbd, 0x00, 0x80, 0x67, 0x61,
540x70, 0x00, 0x62, 0x65, 0x74, 0x77, 0x6d, 0x01, 0x91, 0x74, 540x70, 0x00, 0x62, 0x65, 0x74, 0x77, 0x6d, 0x01, 0x91, 0x74,
550x77, 0x6f, 0x00, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x7e, 0x00, 550x77, 0x6f, 0x00, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x7e, 0x00,
560x05, 0x2f, 0x01, 0x01, 0x6d, 0x00, 0xc1, 0x70, 0x69, 0x6e, 560x06, 0x2f, 0x01, 0x00, 0x6d, 0x00, 0xc1, 0x70, 0x69, 0x6e,
570x67, 0x29, 0x2e, 0x00, 0x41, 0x6c, 0x73, 0x6f, 0x2c, 0xb3, 570x67, 0x29, 0x2e, 0x00, 0x41, 0x6c, 0x73, 0x6f, 0x2c, 0xb3,
580x00, 0x31, 0x00, 0x6f, 0x66, 0xea, 0x00, 0x71, 0x73, 0x71, 580x00, 0x00, 0x7f, 0x01, 0x00, 0xea, 0x00, 0x71, 0x73, 0x71,
590x75, 0x61, 0x72, 0x65, 0x73, 0xbc, 0x01, 0x11, 0x60, 0xc2, 590x75, 0x61, 0x72, 0x65, 0x73, 0xbc, 0x01, 0x11, 0x60, 0xc2,
600x00, 0x73, 0x27, 0x3b, 0x00, 0x77, 0x68, 0x65, 0x6e, 0x08, 600x00, 0x76, 0x27, 0x3b, 0x00, 0x77, 0x68, 0x65, 0x6e, 0x08,
610x01, 0x03, 0x7c, 0x00, 0x50, 0x73, 0x00, 0x6f, 0x6e, 0x00, 610x01, 0x00, 0x7c, 0x00, 0x50, 0x73, 0x00, 0x6f, 0x6e, 0x00,
620x6e, 0x01, 0x01, 0x4e, 0x00, 0x00, 0x98, 0x00, 0x06, 0xc9, 620x6e, 0x01, 0x01, 0x4e, 0x00, 0x06, 0x98, 0x00, 0x01, 0xc9,
630x00, 0x04, 0xb8, 0x00, 0x70, 0x6e, 0x6f, 0x00, 0x6d, 0x61, 630x00, 0x03, 0xb8, 0x00, 0x70, 0x6e, 0x6f, 0x00, 0x6d, 0x61,
640x74, 0x74, 0x80, 0x00, 0x36, 0x68, 0x61, 0x74, 0x58, 0x01, 640x74, 0x74, 0x80, 0x00, 0x36, 0x68, 0x61, 0x74, 0x58, 0x01,
650x01, 0x2d, 0x00, 0x52, 0x61, 0x73, 0x00, 0x67, 0x6f, 0xb5, 650x01, 0x2d, 0x00, 0x52, 0x61, 0x73, 0x00, 0x67, 0x6f, 0xb5,
660x01, 0x30, 0x2e, 0x00, 0x47, 0xce, 0x01, 0x52, 0x64, 0x6f, 660x01, 0x30, 0x2e, 0x00, 0x47, 0xce, 0x01, 0x52, 0x64, 0x6f,
670x00, 0x6e, 0x6f, 0x9e, 0x00, 0x05, 0x6c, 0x00, 0x10, 0x3b, 670x00, 0x6e, 0x6f, 0x9e, 0x00, 0x05, 0x6c, 0x00, 0x10, 0x3b,
680x2c, 0x00, 0x50, 0x70, 0x69, 0x63, 0x6b, 0x73, 0x13, 0x00, 680x2c, 0x00, 0x50, 0x70, 0x69, 0x63, 0x6b, 0x73, 0x13, 0x00,
690xd0, 0x6d, 0x00, 0x75, 0x70, 0x00, 0x61, 0x6e, 0x64, 0x00, 690xd1, 0x6d, 0x00, 0x75, 0x70, 0x00, 0x61, 0x6e, 0x64, 0x00,
700x6b, 0x65, 0x65, 0x70, 0x82, 0x00, 0x02, 0x43, 0x00, 0x00, 700x6b, 0x65, 0x65, 0x70, 0x82, 0x00, 0x01, 0x43, 0x00, 0x00,
710xe9, 0x01, 0x19, 0x52, 0x03, 0x02, 0x01, 0x01, 0x02, 0x00, 710xe9, 0x01, 0x19, 0x52, 0x03, 0x02, 0x01, 0x01, 0x02, 0x00,
720x42, 0x01, 0xb0, 0x66, 0x61, 0x74, 0x61, 0x6c, 0x2e, 0x00, 720x42, 0x01, 0xb0, 0x66, 0x61, 0x74, 0x61, 0x6c, 0x2e, 0x00,
730x45, 0x76, 0x65, 0x6e, 0x57, 0x01, 0x31, 0x79, 0x6f, 0x75, 730x45, 0x76, 0x65, 0x6e, 0x57, 0x01, 0x31, 0x79, 0x6f, 0x75,
740x4e, 0x00, 0x42, 0x65, 0x64, 0x00, 0x75, 0x65, 0x00, 0x40, 740x4e, 0x00, 0x42, 0x65, 0x64, 0x00, 0x75, 0x65, 0x00, 0x40,
750x6c, 0x61, 0x73, 0x74, 0x4d, 0x02, 0x32, 0x00, 0x69, 0x6e, 750x6c, 0x61, 0x73, 0x74, 0x4d, 0x02, 0x00, 0x93, 0x01, 0x01,
760xff, 0x00, 0x32, 0x61, 0x6d, 0x65, 0x5d, 0x01, 0x70, 0x77, 760xff, 0x00, 0x32, 0x61, 0x6d, 0x65, 0x5d, 0x01, 0x70, 0x77,
770x68, 0x69, 0x63, 0x68, 0x00, 0x74, 0xfa, 0x00, 0x33, 0x68, 770x68, 0x69, 0x63, 0x68, 0x00, 0x74, 0xfa, 0x00, 0x33, 0x68,
780x69, 0x74, 0x54, 0x00, 0x12, 0x2c, 0x7d, 0x02, 0x34, 0x61, 780x69, 0x74, 0x54, 0x00, 0x12, 0x2c, 0x7d, 0x02, 0x00, 0x25,
790x6d, 0x65, 0xfc, 0x01, 0x31, 0x75, 0x6e, 0x74, 0x57, 0x00, 790x00, 0x03, 0xfc, 0x01, 0x31, 0x75, 0x6e, 0x74, 0x57, 0x00,
800xa1, 0x61, 0x73, 0x00, 0x64, 0x65, 0x61, 0x64, 0x00, 0x72, 800xa1, 0x61, 0x73, 0x00, 0x64, 0x65, 0x61, 0x64, 0x00, 0x72,
810x61, 0x72, 0x01, 0xe1, 0x74, 0x68, 0x61, 0x6e, 0x00, 0x76, 810x61, 0x72, 0x01, 0xe1, 0x74, 0x68, 0x61, 0x6e, 0x00, 0x76,
820x69, 0x63, 0x74, 0x6f, 0x72, 0x69, 0x6f, 0x75, 0x8c, 0x02, 820x69, 0x63, 0x74, 0x6f, 0x72, 0x69, 0x6f, 0x75, 0x8c, 0x02,
830x41, 0x54, 0x68, 0x69, 0x73, 0x3b, 0x00, 0x01, 0xfd, 0x00, 830x43, 0x54, 0x68, 0x69, 0x73, 0x3b, 0x00, 0x81, 0x61, 0x73,
840x51, 0x6f, 0x72, 0x69, 0x67, 0x69, 0xd5, 0x01, 0xf0, 0x16, 840x00, 0x6f, 0x72, 0x69, 0x67, 0x69, 0xd5, 0x01, 0xf0, 0x16,
850x00, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 850x00, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
860x65, 0x64, 0x00, 0x66, 0x6f, 0x72, 0x00, 0x57, 0x69, 0x6e, 860x65, 0x64, 0x00, 0x66, 0x6f, 0x72, 0x00, 0x57, 0x69, 0x6e,
870x64, 0x6f, 0x77, 0x73, 0x00, 0x62, 0x79, 0x00, 0x42, 0x65, 870x64, 0x6f, 0x77, 0x73, 0x00, 0x62, 0x79, 0x00, 0x42, 0x65,
880x6e, 0x00, 0x4f, 0x6c, 0x6d, 0x73, 0x74, 0x5b, 0x00, 0x91, 880x6e, 0x00, 0x4f, 0x6c, 0x6d, 0x73, 0x74, 0x5b, 0x00, 0x91,
890x5b, 0x31, 0x31, 0x5d, 0x2c, 0x00, 0x77, 0x68, 0x6f, 0x41, 890x5b, 0x31, 0x31, 0x5d, 0x2c, 0x00, 0x77, 0x68, 0x6f, 0x41,
900x00, 0x70, 0x6b, 0x69, 0x6e, 0x64, 0x00, 0x65, 0x6e, 0x01, 900x00, 0x71, 0x6b, 0x69, 0x6e, 0x64, 0x00, 0x65, 0x6e, 0x01,
910x02, 0x00, 0x89, 0x01, 0x80, 0x72, 0x65, 0x6c, 0x65, 0x61, 910x02, 0xb0, 0x74, 0x6f, 0x00, 0x72, 0x65, 0x6c, 0x65, 0x61,
920x73, 0x65, 0x00, 0x65, 0x00, 0xb0, 0x73, 0x6f, 0x75, 0x72, 920x73, 0x65, 0x00, 0x65, 0x00, 0xb0, 0x73, 0x6f, 0x75, 0x72,
930x63, 0x65, 0x00, 0x63, 0x6f, 0x64, 0x65, 0x25, 0x01, 0xc0, 930x63, 0x65, 0x00, 0x63, 0x6f, 0x64, 0x65, 0x25, 0x01, 0xa0,
940x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x00, 0x73, 0x6f, 940x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x00, 0x73, 0x6f,
950x00, 0x74, 0x89, 0x01, 0x20, 0x69, 0x74, 0xb8, 0x00, 0x9c, 950x97, 0x00, 0x10, 0x74, 0x53, 0x01, 0xcc, 0x63, 0x6f, 0x75,
960x6c, 0x64, 0x00, 0x62, 0x65, 0x00, 0x72, 0x65, 0x2d, 0x7f, 960x6c, 0x64, 0x00, 0x62, 0x65, 0x00, 0x72, 0x65, 0x2d, 0x7f,
970x00, 0x41, 0x74, 0x68, 0x69, 0x73, 0x70, 0x03, 0x04, 0x06, 970x00, 0x10, 0x74, 0x43, 0x00, 0x03, 0x70, 0x03, 0x01, 0x06,
980x03, 0x11, 0x00, 0x7a, 0x00, 0xf5, 0x09, 0x00, 0x68, 0x74, 980x03, 0x11, 0x00, 0x7a, 0x00, 0xf5, 0x09, 0x00, 0x68, 0x74,
990x74, 0x70, 0x3a, 0x2f, 0x2f, 0x78, 0x6e, 0x31, 0x33, 0x2e, 990x74, 0x70, 0x3a, 0x2f, 0x2f, 0x78, 0x6e, 0x31, 0x33, 0x2e,
1000x63, 0x6f, 0x6d, 0x2f, 0x00, 0x00, 0x00, 0x32, 0x34, 0x2e, 1000x63, 0x6f, 0x6d, 0x2f, 0x00, 0x00, 0x00, 0x32, 0x34, 0x2e,
1010x31, 0xf5, 0x03, 0x00, 0x08, 0x03, 0x5f, 0x72, 0x6f, 0x6c, 1010x31, 0xf5, 0x03, 0x00, 0x08, 0x03, 0x5f, 0x72, 0x6f, 0x6c,
1020x73, 0x20, 0x78, 0x03, 0x0c, 0x04, 0x6a, 0x02, 0x47, 0x65, 1020x73, 0x20, 0x78, 0x03, 0x0e, 0x02, 0x6a, 0x02, 0x47, 0x65,
1030x69, 0x67, 0x68, 0x16, 0x02, 0x71, 0x73, 0x00, 0x75, 0x73, 1030x69, 0x67, 0x68, 0x16, 0x02, 0x40, 0x73, 0x00, 0x75, 0x73,
1040x69, 0x6e, 0x67, 0x1b, 0x00, 0xe0, 0x6e, 0x75, 0x6d, 0x65, 1040xc2, 0x01, 0x00, 0x1b, 0x00, 0xe0, 0x6e, 0x75, 0x6d, 0x65,
1050x72, 0x69, 0x63, 0x00, 0x6b, 0x65, 0x79, 0x70, 0x61, 0x64, 1050x72, 0x69, 0x63, 0x00, 0x6b, 0x65, 0x79, 0x70, 0x61, 0x64,
1060xa7, 0x02, 0xc4, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 1060xa7, 0x02, 0x91, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69,
1070x76, 0x65, 0x6c, 0x79, 0x2c, 0xca, 0x01, 0x52, 0x63, 0x6c, 1070x76, 0x65, 0x05, 0x03, 0x02, 0xca, 0x01, 0x52, 0x63, 0x6c,
1080x69, 0x63, 0x6b, 0xc6, 0x01, 0xf1, 0x03, 0x65, 0x66, 0x74, 1080x69, 0x63, 0x6b, 0xc6, 0x01, 0xf2, 0x03, 0x65, 0x66, 0x74,
1090x00, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x00, 0x62, 0x75, 0x74, 1090x00, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x00, 0x62, 0x75, 0x74,
1100x74, 0x6f, 0x6e, 0x00, 0x6f, 0xcf, 0x01, 0x01, 0x5e, 0x04, 1100x74, 0x6f, 0x6e, 0x00, 0x6f, 0xcf, 0x01, 0x00, 0x5e, 0x04,
1110x15, 0x2c, 0x81, 0x00, 0x02, 0xb4, 0x01, 0x30, 0x62, 0x65, 1110x16, 0x2c, 0x81, 0x00, 0x01, 0xb4, 0x01, 0x31, 0x62, 0x65,
1120x67, 0x89, 0x00, 0x02, 0x9c, 0x00, 0x23, 0x69, 0x6e, 0x4f, 1120x67, 0x7a, 0x04, 0x01, 0x9c, 0x00, 0x23, 0x69, 0x6e, 0x4f,
1130x04, 0x38, 0x6e, 0x65, 0x72, 0xfc, 0x03, 0x30, 0x00, 0x6f, 1130x04, 0x38, 0x6e, 0x65, 0x72, 0xfc, 0x03, 0x00, 0xa5, 0x00,
1140x66, 0xf6, 0x02, 0x26, 0x72, 0x65, 0x6a, 0x00, 0x20, 0x65, 1140x56, 0x77, 0x68, 0x65, 0x72, 0x65, 0x6a, 0x00, 0x20, 0x65,
1150x64, 0x0b, 0x01, 0x12, 0x49, 0x7c, 0x00, 0x22, 0x75, 0x73, 1150x64, 0x0b, 0x01, 0x12, 0x49, 0x7c, 0x00, 0x22, 0x75, 0x73,
1160xd8, 0x00, 0xe3, 0x60, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x27, 1160xd8, 0x00, 0xb3, 0x60, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x27,
1170x00, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x79, 0x00, 0x03, 1170x00, 0x66, 0x75, 0x6e, 0x38, 0x00, 0x00, 0x51, 0x00, 0x03,
1180xe9, 0x01, 0x03, 0x2e, 0x02, 0x74, 0x70, 0x72, 0x6f, 0x67, 1180xe9, 0x01, 0x02, 0x7a, 0x00, 0x74, 0x70, 0x72, 0x6f, 0x67,
1190x72, 0x61, 0x6d, 0x31, 0x02, 0x71, 0x6d, 0x70, 0x75, 0x74, 1190x72, 0x61, 0x6d, 0x31, 0x02, 0x40, 0x6d, 0x70, 0x75, 0x74,
1200x65, 0x00, 0x61, 0xfd, 0x03, 0x04, 0xc2, 0x03, 0x05, 0xac, 1200x17, 0x05, 0x01, 0xfd, 0x03, 0x04, 0xc2, 0x03, 0x04, 0xac,
1210x00, 0x02, 0x76, 0x02, 0x04, 0x7e, 0x01, 0x15, 0x73, 0xef, 1210x00, 0x03, 0x76, 0x02, 0x03, 0x7e, 0x01, 0x15, 0x73, 0xef,
1220x04, 0x50, 0x72, 0x65, 0x6d, 0x61, 0x69, 0xe1, 0x02, 0x01, 1220x04, 0x51, 0x72, 0x65, 0x6d, 0x61, 0x69, 0xe1, 0x02, 0x01,
1230xf9, 0x04, 0x01, 0x04, 0x03, 0x60, 0x72, 0x65, 0x74, 0x75, 1230xf9, 0x04, 0x00, 0x04, 0x03, 0x61, 0x72, 0x65, 0x74, 0x75,
1240x72, 0x6e, 0x1d, 0x05, 0x01, 0x22, 0x00, 0xc2, 0x63, 0x75, 1240x72, 0x6e, 0x1d, 0x05, 0x00, 0x22, 0x00, 0xc2, 0x63, 0x75,
1250x72, 0x72, 0x65, 0x6e, 0x74, 0x00, 0x70, 0x6f, 0x73, 0x69, 1250x72, 0x72, 0x65, 0x6e, 0x74, 0x00, 0x70, 0x6f, 0x73, 0x69,
1260xb7, 0x01, 0xc2, 0x41, 0x00, 0x68, 0x69, 0x6e, 0x74, 0x00, 1260xb7, 0x01, 0xc2, 0x41, 0x00, 0x68, 0x69, 0x6e, 0x74, 0x00,
1270x61, 0x72, 0x72, 0x6f, 0x77, 0x7d, 0x00, 0x98, 0x61, 0x70, 1270x61, 0x72, 0x72, 0x6f, 0x77, 0x7d, 0x00, 0x64, 0x61, 0x70,
1280x70, 0x65, 0x61, 0x72, 0x00, 0x6f, 0x6e, 0x93, 0x01, 0x53, 1280x70, 0x65, 0x61, 0x72, 0x1c, 0x01, 0x03, 0x93, 0x01, 0x54,
1290x64, 0x69, 0x63, 0x61, 0x74, 0x79, 0x01, 0x08, 0xa4, 0x03, 1290x64, 0x69, 0x63, 0x61, 0x74, 0x79, 0x01, 0x07, 0xa4, 0x03,
1300x12, 0x6e, 0x8c, 0x00, 0x01, 0xee, 0x00, 0x20, 0x73, 0x68, 1300x13, 0x6e, 0x8c, 0x00, 0x00, 0xee, 0x00, 0x21, 0x73, 0x68,
1310x30, 0x02, 0x03, 0xce, 0x01, 0x11, 0x6f, 0x42, 0x01, 0x04, 1310x30, 0x02, 0x02, 0xce, 0x01, 0x13, 0x6f, 0x42, 0x01, 0x04,
1320xea, 0x00, 0x02, 0xc6, 0x04, 0x13, 0x2e, 0x18, 0x01, 0x01, 1320xea, 0x00, 0x00, 0xc9, 0x00, 0x14, 0x2e, 0x18, 0x01, 0x01,
1330x30, 0x03, 0x06, 0x5a, 0x01, 0x09, 0xf7, 0x03, 0x01, 0x0e, 1330x30, 0x03, 0x06, 0x5a, 0x01, 0x08, 0xf7, 0x03, 0x02, 0x0e,
1340x01, 0x08, 0x8f, 0x00, 0x50, 0x75, 0x70, 0x64, 0x61, 0x74, 1340x01, 0x07, 0x8f, 0x00, 0x51, 0x75, 0x70, 0x64, 0x61, 0x74,
1350x51, 0x00, 0x04, 0x86, 0x00, 0x12, 0x65, 0xfd, 0x01, 0x25, 1350x51, 0x00, 0x03, 0x86, 0x00, 0x12, 0x65, 0xfd, 0x01, 0x28,
1360x65, 0x78, 0x36, 0x00, 0x05, 0xca, 0x01, 0x02, 0x66, 0x00, 1360x65, 0x78, 0x2d, 0x04, 0x03, 0xae, 0x00, 0x02, 0x66, 0x00,
1370x05, 0x58, 0x02, 0xf1, 0x01, 0x61, 0x6c, 0x73, 0x6f, 0x00, 1370x04, 0x58, 0x02, 0xf1, 0x01, 0x61, 0x6c, 0x73, 0x6f, 0x00,
1380x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x53, 0x70, 0x61, 0x63, 1380x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x53, 0x70, 0x61, 0x63,
1390x65, 0x8b, 0x04, 0x80, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 1390x65, 0x8b, 0x04, 0x81, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74,
1400x69, 0x63, 0x55, 0x03, 0x04, 0x84, 0x00, 0x0a, 0xd6, 0x00, 1400x69, 0x63, 0x55, 0x03, 0x08, 0xde, 0x01, 0x09, 0xd6, 0x01,
1410x03, 0x7b, 0x02, 0x07, 0x19, 0x01, 0x04, 0xb9, 0x00, 0x04, 1410x00, 0x11, 0x00, 0x06, 0x19, 0x01, 0x05, 0xb9, 0x00, 0x04,
1420x30, 0x00, 0x01, 0x4c, 0x05, 0x68, 0x66, 0x66, 0x65, 0x72, 1420x30, 0x00, 0x00, 0x4c, 0x05, 0x31, 0x66, 0x66, 0x65, 0x4c,
1430x65, 0x6e, 0x85, 0x00, 0x41, 0x66, 0x72, 0x6f, 0x6d, 0x3a, 1430x01, 0x06, 0x38, 0x00, 0x41, 0x66, 0x72, 0x6f, 0x6d, 0x3a,
1440x00, 0x30, 0x6f, 0x6e, 0x65, 0x0e, 0x01, 0x56, 0x77, 0x6e, 1440x00, 0x30, 0x6f, 0x6e, 0x65, 0x0e, 0x01, 0x20, 0x77, 0x6e,
1450x00, 0x62, 0x79, 0xd0, 0x00, 0x12, 0x2c, 0x07, 0x00, 0x13, 1450x9e, 0x03, 0x05, 0xd0, 0x00, 0x12, 0x2c, 0x07, 0x00, 0x14,
1460x73, 0x61, 0x02, 0x04, 0x23, 0x00, 0x20, 0x6f, 0x6e, 0xde, 1460x73, 0x61, 0x02, 0x03, 0x23, 0x00, 0x20, 0x6f, 0x6e, 0xde,
1470x03, 0x12, 0x66, 0xc0, 0x00, 0x41, 0x75, 0x7a, 0x7a, 0x6c, 1470x03, 0x12, 0x66, 0xc0, 0x00, 0x41, 0x75, 0x7a, 0x7a, 0x6c,
1480x94, 0x04, 0x21, 0x73, 0x74, 0x29, 0x05, 0x70, 0x6f, 0x6c, 1480x94, 0x04, 0x21, 0x73, 0x74, 0x29, 0x05, 0x70, 0x6f, 0x6c,
1490x76, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x02, 0x13, 0x41, 0xe6, 1490x76, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x02, 0x13, 0x41, 0xe6,
1500x01, 0x13, 0x61, 0x09, 0x03, 0x90, 0x64, 0x65, 0x73, 0x63, 1500x01, 0x13, 0x61, 0x09, 0x03, 0x90, 0x64, 0x65, 0x73, 0x63,
1510x72, 0x69, 0x62, 0x65, 0x64, 0x91, 0x00, 0x13, 0x73, 0x83, 1510x72, 0x69, 0x62, 0x65, 0x64, 0x91, 0x00, 0x13, 0x73, 0x83,
1520x00, 0x30, 0x32, 0x2e, 0x31, 0x95, 0x05, 0x02, 0xfb, 0x00, 1520x00, 0x32, 0x32, 0x2e, 0x31, 0x51, 0x07, 0x00, 0xfb, 0x00,
1530x52, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x3f, 0x00, 0xd5, 0x49, 1530x52, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x3f, 0x00, 0xd5, 0x49,
1540x6e, 0x00, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x75, 0x6c, 1540x6e, 0x00, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x75, 0x6c,
1550x61, 0x72, 0x1c, 0x03, 0x20, 0x64, 0x6f, 0x16, 0x07, 0x08, 1550x61, 0x72, 0x1c, 0x03, 0x20, 0x64, 0x6f, 0x16, 0x07, 0x09,
1560x0f, 0x05, 0x01, 0x35, 0x02, 0x62, 0x64, 0x69, 0x65, 0x2c, 1560x0f, 0x05, 0x00, 0x35, 0x02, 0x63, 0x64, 0x69, 0x65, 0x2c,
1570x00, 0x79, 0x45, 0x01, 0x05, 0xc4, 0x02, 0x45, 0x55, 0x6e, 1570x00, 0x79, 0x45, 0x01, 0x04, 0xc4, 0x02, 0x46, 0x55, 0x6e,
1580x64, 0x6f, 0xc1, 0x02, 0x03, 0x5c, 0x02, 0xc2, 0x73, 0x75, 1580x64, 0x6f, 0xc1, 0x02, 0x02, 0x5c, 0x02, 0x90, 0x73, 0x75,
1590x6d, 0x65, 0x00, 0x70, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 1590x6d, 0x65, 0x00, 0x70, 0x6c, 0x61, 0x79, 0x1a, 0x02, 0x01,
1600xfe, 0x00, 0x51, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x31, 0x00, 1600xfe, 0x00, 0x52, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x31, 0x00,
1610x01, 0x56, 0x05, 0x02, 0x07, 0x06, 0x38, 0x2e, 0x00, 0x54, 1610x01, 0x56, 0x05, 0x01, 0x32, 0x01, 0x39, 0x2e, 0x00, 0x54,
1620x10, 0x05, 0x01, 0x99, 0x05, 0x94, 0x00, 0x74, 0x72, 0x61, 1620x10, 0x05, 0x00, 0x99, 0x05, 0x64, 0x00, 0x74, 0x72, 0x61,
1630x63, 0x6b, 0x00, 0x6f, 0x66, 0xcb, 0x03, 0x31, 0x62, 0x65, 1630x63, 0x6b, 0x6b, 0x01, 0x61, 0x6e, 0x75, 0x6d, 0x62, 0x65,
1640x72, 0x0e, 0x00, 0x41, 0x69, 0x6d, 0x65, 0x73, 0x7d, 0x00, 1640x72, 0x0e, 0x00, 0x41, 0x69, 0x6d, 0x65, 0x73, 0x7d, 0x00,
1650x91, 0x68, 0x61, 0x76, 0x65, 0x00, 0x64, 0x6f, 0x6e, 0x65, 1650x60, 0x68, 0x61, 0x76, 0x65, 0x00, 0x64, 0x4b, 0x01, 0x00,
1660x41, 0x02, 0x12, 0x2e, 0x49, 0x04, 0x15, 0x32, 0x49, 0x04, 1660x41, 0x02, 0x12, 0x2e, 0x49, 0x04, 0x15, 0x32, 0x49, 0x04,
1670x90, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 1670xb1, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72,
1680x4b, 0x04, 0x00, 0x61, 0x00, 0x35, 0x73, 0x65, 0x00, 0x14, 1680x73, 0x20, 0x37, 0x05, 0x46, 0x65, 0x73, 0x65, 0x00, 0x14,
1690x00, 0x01, 0x9a, 0x06, 0x06, 0x00, 0x01, 0x06, 0x9a, 0x01, 1690x00, 0x02, 0x05, 0x01, 0x04, 0x00, 0x01, 0x06, 0x9a, 0x01,
1700xe8, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 1700xe8, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e,
1710x2e, 0x27, 0x00, 0x6f, 0x70, 0x3b, 0x02, 0xb0, 0x60, 0x54, 1710x2e, 0x27, 0x00, 0x6f, 0x70, 0x3b, 0x02, 0xb0, 0x60, 0x54,
1720x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0x6c, 1720x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0x6c,
1730x00, 0x82, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 0x48, 1730x00, 0x82, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 0x48,
1740x80, 0x04, 0x50, 0x00, 0x00, 0x53, 0x69, 0x7a, 0xfe, 0x06, 1740x80, 0x04, 0x51, 0x00, 0x00, 0x53, 0x69, 0x7a, 0xfe, 0x06,
1750x00, 0x80, 0x03, 0x02, 0x71, 0x01, 0x80, 0x71, 0x75, 0x61, 1750x01, 0x80, 0x03, 0x00, 0x71, 0x01, 0x80, 0x71, 0x75, 0x61,
1760x72, 0x65, 0x73, 0x2e, 0x00, 1760x72, 0x65, 0x73, 0x2e, 0x00,
177}; 177};
178 178
diff --git a/apps/plugins/puzzles/help/keen.c b/apps/plugins/puzzles/help/keen.c
index 5628338343..8f0374dcdd 100644
--- a/apps/plugins/puzzles/help/keen.c
+++ b/apps/plugins/puzzles/help/keen.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -15,18 +15,18 @@ struct style_text help_text_style[] = {
15 LAST_STYLE_ITEM 15 LAST_STYLE_ITEM
16}; 16};
17 17
18/* orig 3952 comp 2375 ratio 0.600962 level 11 saved 1577 */ 18/* orig 3952 comp 2376 ratio 0.601215 level 10 saved 1576 */
19const char help_text[] = { 19const char help_text[] = {
200xf4, 0x21, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 200xf4, 0x21, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
210x33, 0x30, 0x3a, 0x20, 0x4b, 0x65, 0x65, 0x6e, 0x20, 0x00, 210x33, 0x30, 0x3a, 0x20, 0x4b, 0x65, 0x65, 0x6e, 0x20, 0x00,
220x00, 0x00, 0x59, 0x6f, 0x75, 0x00, 0x68, 0x61, 0x76, 0x65, 220x00, 0x00, 0x59, 0x6f, 0x75, 0x00, 0x68, 0x61, 0x76, 0x65,
230x00, 0x61, 0x00, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x00, 230x00, 0x61, 0x00, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x00,
240x67, 0x72, 0x69, 0x64, 0x3b, 0x00, 0x65, 0x61, 0x63, 0x68, 240x67, 0x72, 0x69, 0x64, 0x3b, 0x00, 0x65, 0x61, 0x63, 0x68,
250x12, 0x00, 0xf2, 0x1d, 0x6d, 0x61, 0x79, 0x00, 0x63, 0x6f, 250x12, 0x00, 0xf1, 0x1a, 0x6d, 0x61, 0x79, 0x00, 0x63, 0x6f,
260x6e, 0x74, 0x61, 0x69, 0x6e, 0x00, 0x61, 0x00, 0x64, 0x69, 260x6e, 0x74, 0x61, 0x69, 0x6e, 0x00, 0x61, 0x00, 0x64, 0x69,
270x67, 0x69, 0x74, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x00, 0x31, 270x67, 0x69, 0x74, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x00, 0x31,
280x00, 0x74, 0x6f, 0x00, 0x74, 0x68, 0x65, 0x00, 0x73, 0x69, 280x00, 0x74, 0x6f, 0x00, 0x74, 0x68, 0x65, 0x00, 0x73, 0x69,
290x7a, 0x65, 0x00, 0x6f, 0x66, 0x00, 0x74, 0x68, 0x40, 0x00, 290x7a, 0x65, 0x00, 0x6f, 0x66, 0x0c, 0x00, 0x00, 0x40, 0x00,
300x33, 0x2e, 0x00, 0x54, 0x0a, 0x00, 0xf0, 0x08, 0x00, 0x69, 300x33, 0x2e, 0x00, 0x54, 0x0a, 0x00, 0xf0, 0x08, 0x00, 0x69,
310x73, 0x00, 0x64, 0x69, 0x76, 0x69, 0x64, 0x65, 0x64, 0x00, 310x73, 0x00, 0x64, 0x69, 0x76, 0x69, 0x64, 0x65, 0x64, 0x00,
320x69, 0x6e, 0x74, 0x6f, 0x00, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 320x69, 0x6e, 0x74, 0x6f, 0x00, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
@@ -36,225 +36,225 @@ const char help_text[] = {
360x74, 0x68, 0x00, 0x61, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x65, 360x74, 0x68, 0x00, 0x61, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x65,
370x74, 0x69, 0x63, 0x00, 0x63, 0x6c, 0x75, 0x65, 0x73, 0x00, 370x74, 0x69, 0x63, 0x00, 0x63, 0x6c, 0x75, 0x65, 0x73, 0x00,
380x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x00, 0x69, 0x6e, 380x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x00, 0x69, 0x6e,
390x66, 0x00, 0x20, 0x6d, 0x2e, 0xba, 0x00, 0x80, 0x72, 0x00, 390x66, 0x00, 0x20, 0x6d, 0x2e, 0xba, 0x00, 0x50, 0x72, 0x00,
400x61, 0x69, 0x6d, 0x00, 0x69, 0x73, 0x87, 0x00, 0xe5, 0x66, 400x61, 0x69, 0x6d, 0x62, 0x00, 0xf5, 0x02, 0x74, 0x6f, 0x00,
410x75, 0x6c, 0x6c, 0x79, 0x00, 0x70, 0x6f, 0x70, 0x75, 0x6c, 410x66, 0x75, 0x6c, 0x6c, 0x79, 0x00, 0x70, 0x6f, 0x70, 0x75,
420x61, 0x74, 0x65, 0x8a, 0x00, 0x01, 0x4e, 0x00, 0x02, 0xb4, 420x6c, 0x61, 0x74, 0x65, 0x8a, 0x00, 0x02, 0x4e, 0x00, 0x01,
430x00, 0xf0, 0x03, 0x73, 0x00, 0x73, 0x75, 0x63, 0x68, 0x00, 430xb4, 0x00, 0xf0, 0x03, 0x73, 0x00, 0x73, 0x75, 0x63, 0x68,
440x74, 0x68, 0x61, 0x74, 0x3a, 0x00, 0x00, 0x00, 0x2d, 0x00, 440x00, 0x74, 0x68, 0x61, 0x74, 0x3a, 0x00, 0x00, 0x00, 0x2d,
450x45, 0xe4, 0x00, 0x34, 0x72, 0x6f, 0x77, 0xdd, 0x00, 0xf0, 450x00, 0x45, 0xe4, 0x00, 0x34, 0x72, 0x6f, 0x77, 0xdd, 0x00,
460x05, 0x73, 0x00, 0x6f, 0x6e, 0x6c, 0x79, 0x00, 0x6f, 0x6e, 460xf1, 0x05, 0x73, 0x00, 0x6f, 0x6e, 0x6c, 0x79, 0x00, 0x6f,
470x65, 0x00, 0x6f, 0x63, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 470x6e, 0x65, 0x00, 0x6f, 0x63, 0x63, 0x75, 0x72, 0x72, 0x65,
480x63, 0xd7, 0x00, 0x00, 0x0d, 0x01, 0x03, 0x44, 0x00, 0x06, 480x6e, 0x63, 0xd7, 0x00, 0x01, 0x0d, 0x01, 0x02, 0xf8, 0x00,
490x38, 0x00, 0x6f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x3b, 490x05, 0x38, 0x00, 0x6f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e,
500x00, 0x1c, 0x00, 0x17, 0x01, 0x04, 0x8d, 0x00, 0x21, 0x69, 500x3b, 0x00, 0x1d, 0x00, 0x17, 0x01, 0x03, 0x8d, 0x00, 0x22,
510x6e, 0x1d, 0x00, 0x02, 0x11, 0x01, 0xf1, 0x01, 0x00, 0x63, 510x69, 0x6e, 0x1d, 0x00, 0x01, 0x11, 0x01, 0xf1, 0x01, 0x00,
520x61, 0x6e, 0x00, 0x62, 0x65, 0x00, 0x63, 0x6f, 0x6d, 0x62, 520x63, 0x61, 0x6e, 0x00, 0x62, 0x65, 0x00, 0x63, 0x6f, 0x6d,
530x69, 0x6e, 0x65, 0x64, 0xd2, 0x00, 0x31, 0x6f, 0x72, 0x6d, 530x62, 0x69, 0x6e, 0x65, 0x64, 0xd2, 0x00, 0x31, 0x6f, 0x72,
540xc8, 0x00, 0xd3, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x00, 540x6d, 0xc8, 0x00, 0xd3, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72,
550x73, 0x74, 0x61, 0x74, 0x65, 0x64, 0x01, 0x01, 0x01, 0x16, 550x00, 0x73, 0x74, 0x61, 0x74, 0x65, 0x64, 0x01, 0x01, 0x01,
560x01, 0x70, 0x2c, 0x00, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x10, 560x16, 0x01, 0x40, 0x2c, 0x00, 0x75, 0x73, 0x42, 0x01, 0x00,
570x00, 0x08, 0x31, 0x01, 0xf8, 0x00, 0x6f, 0x70, 0x65, 0x72, 570x10, 0x00, 0x07, 0x31, 0x01, 0xf8, 0x00, 0x6f, 0x70, 0x65,
580x61, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x67, 0x69, 0x76, 0x65, 580x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x67, 0x69, 0x76,
590x6e, 0x32, 0x00, 0x00, 0x99, 0x01, 0x52, 0x61, 0x74, 0x00, 590x65, 0x6e, 0x32, 0x00, 0x00, 0x99, 0x01, 0x52, 0x61, 0x74,
600x69, 0x73, 0x02, 0x01, 0x70, 0x41, 0x6e, 0x00, 0x61, 0x64, 600x00, 0x69, 0x73, 0x02, 0x01, 0x71, 0x41, 0x6e, 0x00, 0x61,
610x64, 0x69, 0x2c, 0x00, 0x01, 0x1f, 0x00, 0x61, 0x00, 0x6d, 610x64, 0x64, 0x69, 0x2c, 0x00, 0x00, 0x1f, 0x00, 0x61, 0x00,
620x65, 0x61, 0x6e, 0x73, 0x23, 0x01, 0x02, 0xd8, 0x01, 0x21, 620x6d, 0x65, 0x61, 0x6e, 0x73, 0x23, 0x01, 0x02, 0xd8, 0x01,
630x75, 0x6d, 0xd7, 0x01, 0x05, 0xb6, 0x00, 0x03, 0x4c, 0x00, 630x24, 0x75, 0x6d, 0xd7, 0x01, 0x06, 0xb6, 0x00, 0x00, 0x0e,
640x03, 0xb5, 0x00, 0x61, 0x6d, 0x75, 0x73, 0x74, 0x00, 0x62, 640x00, 0x02, 0xb5, 0x00, 0x63, 0x6d, 0x75, 0x73, 0x74, 0x00,
650x6d, 0x01, 0x02, 0x6b, 0x00, 0x03, 0xab, 0x00, 0xf5, 0x05, 650x62, 0x6d, 0x01, 0x01, 0x6b, 0x00, 0x02, 0xab, 0x00, 0xf5,
660x2e, 0x00, 0x46, 0x6f, 0x72, 0x00, 0x65, 0x78, 0x61, 0x6d, 660x05, 0x2e, 0x00, 0x46, 0x6f, 0x72, 0x00, 0x65, 0x78, 0x61,
670x70, 0x6c, 0x65, 0x2c, 0x00, 0x60, 0x31, 0x35, 0x2b, 0x27, 670x6d, 0x70, 0x6c, 0x65, 0x2c, 0x00, 0x60, 0x31, 0x35, 0x2b,
680x5b, 0x00, 0x11, 0x65, 0x34, 0x01, 0x30, 0x65, 0x6e, 0x74, 680x27, 0x5b, 0x00, 0x11, 0x65, 0x34, 0x01, 0x31, 0x65, 0x6e,
690x05, 0x02, 0x06, 0x4d, 0x00, 0x00, 0x89, 0x00, 0x41, 0x73, 690x74, 0x05, 0x02, 0x06, 0x4d, 0x00, 0x71, 0x61, 0x64, 0x64,
700x00, 0x75, 0x70, 0xfa, 0x00, 0x72, 0x69, 0x66, 0x74, 0x65, 700x73, 0x00, 0x75, 0x70, 0xfa, 0x00, 0x72, 0x69, 0x66, 0x74,
710x65, 0x6e, 0x2e, 0xa4, 0x00, 0xb6, 0x00, 0x6d, 0x75, 0x6c, 710x65, 0x65, 0x6e, 0x2e, 0xa4, 0x00, 0xb6, 0x00, 0x6d, 0x75,
720x74, 0x69, 0x70, 0x6c, 0x69, 0x63, 0x61, 0xa9, 0x00, 0xfc, 720x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x63, 0x61, 0xa9, 0x00,
730x09, 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x00, 0x60, 0x36, 0x30, 730xfc, 0x09, 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x00, 0x60, 0x36,
740x2a, 0x27, 0x29, 0x2c, 0x00, 0x73, 0x69, 0x6d, 0x69, 0x6c, 740x30, 0x2a, 0x27, 0x29, 0x2c, 0x00, 0x73, 0x69, 0x6d, 0x69,
750x61, 0x72, 0x6c, 0x79, 0x2c, 0xc2, 0x00, 0x7f, 0x70, 0x72, 750x6c, 0x61, 0x72, 0x6c, 0x79, 0x2c, 0xc2, 0x00, 0x7f, 0x70,
760x6f, 0x64, 0x75, 0x63, 0x74, 0xc6, 0x00, 0x21, 0x04, 0x7f, 760x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0xc6, 0x00, 0x23, 0x02,
770x00, 0x76, 0x73, 0x75, 0x62, 0x74, 0x72, 0x61, 0x63, 0x7c, 770x7f, 0x00, 0x76, 0x73, 0x75, 0x62, 0x74, 0x72, 0x61, 0x63,
780x00, 0xe8, 0x77, 0x69, 0x6c, 0x6c, 0x00, 0x61, 0x6c, 0x77, 780x7c, 0x00, 0xb0, 0x77, 0x69, 0x6c, 0x6c, 0x00, 0x61, 0x6c,
790x61, 0x79, 0x73, 0x00, 0x62, 0x65, 0x9a, 0x02, 0x13, 0x61, 790x77, 0x61, 0x79, 0x73, 0x38, 0x00, 0x07, 0x9a, 0x02, 0x13,
800x53, 0x00, 0x22, 0x6f, 0x66, 0x13, 0x03, 0x41, 0x74, 0x77, 800x61, 0x53, 0x00, 0x22, 0x6f, 0x66, 0x13, 0x03, 0x41, 0x74,
810x6f, 0x2c, 0xda, 0x02, 0x27, 0x69, 0x74, 0x99, 0x00, 0x00, 810x77, 0x6f, 0x2c, 0xda, 0x02, 0x28, 0x69, 0x74, 0x99, 0x00,
820x27, 0x02, 0x0f, 0x91, 0x00, 0x08, 0x00, 0xd1, 0x02, 0x70, 820x01, 0x27, 0x02, 0x0f, 0x91, 0x00, 0x07, 0xa0, 0x69, 0x73,
830x67, 0x72, 0x65, 0x61, 0x74, 0x65, 0x72, 0x2f, 0x00, 0x02, 830x00, 0x67, 0x72, 0x65, 0x61, 0x74, 0x65, 0x72, 0x2f, 0x00,
840x1a, 0x00, 0x87, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x00, 0x62, 840x02, 0x1a, 0x00, 0x87, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x00,
850x79, 0xa6, 0x00, 0x6c, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 850x62, 0x79, 0xa6, 0x00, 0x6c, 0x61, 0x6d, 0x6f, 0x75, 0x6e,
860x6c, 0x01, 0x3f, 0x32, 0x2d, 0x27, 0x6b, 0x00, 0x1b, 0x6b, 860x74, 0x6c, 0x01, 0x3f, 0x32, 0x2d, 0x27, 0x6b, 0x00, 0x1b,
870x32, 0x00, 0x6d, 0x6f, 0x72, 0x65, 0x6a, 0x00, 0x20, 0x2c, 870x6b, 0x32, 0x00, 0x6d, 0x6f, 0x72, 0x65, 0x6a, 0x00, 0x20,
880x00, 0x55, 0x00, 0xb5, 0x71, 0x75, 0x69, 0x76, 0x61, 0x6c, 880x2c, 0x00, 0x55, 0x00, 0xb6, 0x71, 0x75, 0x69, 0x76, 0x61,
890x65, 0x6e, 0x74, 0x6c, 0x79, 0x4e, 0x00, 0x03, 0xcd, 0x02, 890x6c, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x4e, 0x00, 0x02, 0xcd,
900x56, 0x6d, 0x69, 0x6e, 0x75, 0x73, 0x30, 0x00, 0x00, 0x1a, 900x02, 0x57, 0x6d, 0x69, 0x6e, 0x75, 0x73, 0x9a, 0x00, 0x00,
910x00, 0x01, 0x4d, 0x00, 0x00, 0x61, 0x02, 0x01, 0xf8, 0x00, 910x1a, 0x00, 0x00, 0x4d, 0x00, 0x02, 0xfa, 0x03, 0x34, 0x74,
920x04, 0x6f, 0x00, 0x50, 0x63, 0x6f, 0x75, 0x6c, 0x64, 0x27, 920x77, 0x6f, 0x6f, 0x00, 0x50, 0x63, 0x6f, 0x75, 0x6c, 0x64,
930x01, 0x21, 0x65, 0x69, 0x29, 0x00, 0xf3, 0x02, 0x77, 0x61, 930x27, 0x01, 0x21, 0x65, 0x69, 0x29, 0x00, 0xf4, 0x02, 0x77,
940x79, 0x00, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2c, 0x00, 0x74, 940x61, 0x79, 0x00, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2c, 0x00,
950x68, 0x6f, 0x75, 0x67, 0x68, 0x67, 0x01, 0x01, 0x26, 0x04, 950x74, 0x68, 0x6f, 0x75, 0x67, 0x68, 0x67, 0x01, 0x00, 0x26,
960x1c, 0x73, 0xe0, 0x01, 0x2b, 0x33, 0x2f, 0xdf, 0x01, 0x23, 960x04, 0x1c, 0x73, 0xe0, 0x01, 0x2b, 0x33, 0x2f, 0xdf, 0x01,
970x69, 0x73, 0x7a, 0x01, 0x0f, 0x6f, 0x01, 0x04, 0x00, 0x6e, 970x24, 0x69, 0x73, 0x7a, 0x01, 0x0f, 0x6f, 0x01, 0x03, 0x01,
980x01, 0x02, 0x00, 0x01, 0x0b, 0xb2, 0x00, 0x05, 0x86, 0x04, 980x6e, 0x01, 0x0b, 0x00, 0x01, 0x02, 0xb2, 0x00, 0x04, 0x86,
990x27, 0x62, 0x79, 0xb7, 0x00, 0x20, 0x69, 0x73, 0xe6, 0x00, 990x04, 0x27, 0x62, 0x79, 0xb7, 0x00, 0x20, 0x69, 0x73, 0xe6,
1000x20, 0x61, 0x6c, 0x76, 0x02, 0x0e, 0x5a, 0x01, 0x61, 0x00, 1000x00, 0x24, 0x61, 0x6c, 0xc9, 0x04, 0x0a, 0x5a, 0x01, 0x62,
1010x00, 0x4e, 0x6f, 0x74, 0x65, 0x49, 0x00, 0x04, 0x6c, 0x00, 1010x00, 0x00, 0x4e, 0x6f, 0x74, 0x65, 0x49, 0x00, 0x04, 0x6c,
1020x08, 0x0d, 0x05, 0x02, 0x23, 0x03, 0x23, 0x61, 0x6d, 0x62, 1020x00, 0x08, 0x0d, 0x05, 0x01, 0x23, 0x03, 0x25, 0x61, 0x6d,
1030x00, 0x07, 0x48, 0x01, 0x10, 0x6f, 0xfe, 0x03, 0x41, 0x28, 1030x14, 0x01, 0x05, 0x48, 0x01, 0x10, 0x6f, 0xfe, 0x03, 0x42,
1040x70, 0x72, 0x6f, 0x73, 0x00, 0x01, 0x28, 0x00, 0x90, 0x69, 1040x28, 0x70, 0x72, 0x6f, 0x73, 0x00, 0x00, 0x28, 0x00, 0x90,
1050x64, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x93, 0x00, 1050x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x93,
1060x20, 0x73, 0x00, 0x58, 0x05, 0x47, 0x6e, 0x6f, 0x74, 0x00, 1060x00, 0x20, 0x73, 0x00, 0x58, 0x05, 0x48, 0x6e, 0x6f, 0x74,
1070x46, 0x00, 0x00, 0x8b, 0x04, 0x00, 0xbf, 0x00, 0x03, 0x5b, 1070x00, 0x46, 0x00, 0x00, 0x8b, 0x04, 0x00, 0xbf, 0x00, 0x02,
1080x04, 0x10, 0x29, 0x4b, 0x01, 0x61, 0x69, 0x73, 0x00, 0x72, 1080x5b, 0x04, 0x10, 0x29, 0x4b, 0x01, 0x61, 0x69, 0x73, 0x00,
1090x75, 0x6c, 0x5b, 0x01, 0x83, 0x70, 0x72, 0x65, 0x63, 0x69, 1090x72, 0x75, 0x6c, 0x5b, 0x01, 0x83, 0x70, 0x72, 0x65, 0x63,
1100x73, 0x65, 0x6c, 0xbf, 0x00, 0x64, 0x70, 0x70, 0x6f, 0x73, 1100x69, 0x73, 0x65, 0x6c, 0xbf, 0x00, 0x65, 0x70, 0x70, 0x6f,
1110x69, 0x74, 0xdd, 0x01, 0x03, 0x26, 0x00, 0xf2, 0x0e, 0x6e, 1110x73, 0x69, 0x74, 0xdd, 0x01, 0x02, 0x26, 0x00, 0xf2, 0x0e,
1120x00, 0x53, 0x6f, 0x6c, 0x6f, 0x27, 0x73, 0x00, 0x60, 0x4b, 1120x6e, 0x00, 0x53, 0x6f, 0x6c, 0x6f, 0x27, 0x73, 0x00, 0x60,
1130x69, 0x6c, 0x6c, 0x65, 0x72, 0x27, 0x00, 0x6d, 0x6f, 0x64, 1130x4b, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x27, 0x00, 0x6d, 0x6f,
1140x65, 0x00, 0x28, 0x73, 0x65, 0x65, 0x00, 0x63, 0xfe, 0x05, 1140x64, 0x65, 0x00, 0x28, 0x73, 0x65, 0x65, 0x00, 0x63, 0xfe,
1150x72, 0x00, 0x31, 0x31, 0x29, 0x2e, 0x00, 0x00, 0x5c, 0x00, 1150x05, 0x40, 0x00, 0x31, 0x31, 0x29, 0xda, 0x00, 0x01, 0x5c,
1160xd5, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x00, 0x61, 0x70, 1160x00, 0xd5, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x00, 0x61,
1170x70, 0x65, 0x61, 0x72, 0x1b, 0x02, 0xb2, 0x54, 0x69, 0x6d, 1170x70, 0x70, 0x65, 0x61, 0x72, 0x1b, 0x02, 0xb2, 0x54, 0x69,
1180x65, 0x73, 0x00, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x80, 0x04, 1180x6d, 0x65, 0x73, 0x00, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x80,
1190x00, 0x9d, 0x00, 0x80, 0x60, 0x4b, 0x65, 0x6e, 0x4b, 0x65, 1190x04, 0x00, 0x9d, 0x00, 0x80, 0x60, 0x4b, 0x65, 0x6e, 0x4b,
1200x6e, 0x27, 0x3c, 0x00, 0x42, 0x33, 0x30, 0x2e, 0x31, 0x42, 1200x65, 0x6e, 0x27, 0x3c, 0x00, 0x42, 0x33, 0x30, 0x2e, 0x31,
1210x06, 0x00, 0x0a, 0x01, 0x40, 0x72, 0x6f, 0x6c, 0x73, 0x4b, 1210x42, 0x06, 0x00, 0x0a, 0x01, 0x40, 0x72, 0x6f, 0x6c, 0x73,
1220x06, 0x00, 0x11, 0x00, 0x00, 0xcd, 0x05, 0x80, 0x72, 0x65, 1220x4b, 0x06, 0x00, 0x11, 0x00, 0x00, 0xcd, 0x05, 0x50, 0x72,
1230x73, 0x00, 0x6d, 0x75, 0x63, 0x68, 0x9b, 0x00, 0x00, 0x02, 1230x65, 0x73, 0x00, 0x6d, 0x6a, 0x05, 0x32, 0x6f, 0x66, 0x00,
1240x02, 0x03, 0x24, 0x00, 0x71, 0x00, 0x73, 0x79, 0x73, 0x74, 1240x02, 0x02, 0x01, 0x24, 0x00, 0x72, 0x00, 0x73, 0x79, 0x73,
1250x65, 0x6d, 0x91, 0x05, 0x01, 0xa7, 0x00, 0x20, 0x00, 0x28, 1250x74, 0x65, 0x6d, 0x91, 0x05, 0x00, 0xa7, 0x00, 0x20, 0x00,
1260xed, 0x00, 0x21, 0x55, 0x6e, 0x81, 0x01, 0x02, 0x94, 0x00, 1260x28, 0xed, 0x00, 0x21, 0x55, 0x6e, 0x81, 0x01, 0x02, 0x94,
1270x61, 0x6f, 0x00, 0x70, 0x6c, 0x61, 0x79, 0x4a, 0x00, 0x01, 1270x00, 0x61, 0x6f, 0x00, 0x70, 0x6c, 0x61, 0x79, 0x4a, 0x00,
1280xf6, 0x01, 0x91, 0x70, 0x6c, 0x79, 0x00, 0x63, 0x6c, 0x69, 1280x01, 0xf6, 0x01, 0x91, 0x70, 0x6c, 0x79, 0x00, 0x63, 0x6c,
1290x63, 0x6b, 0x88, 0x00, 0x51, 0x6d, 0x6f, 0x75, 0x73, 0x65, 1290x69, 0x63, 0x6b, 0x88, 0x00, 0x51, 0x6d, 0x6f, 0x75, 0x73,
1300xf8, 0x01, 0x84, 0x6e, 0x79, 0x00, 0x65, 0x6d, 0x70, 0x74, 1300x65, 0xf8, 0x01, 0x84, 0x6e, 0x79, 0x00, 0x65, 0x6d, 0x70,
1310x79, 0xa2, 0x06, 0x21, 0x61, 0x6e, 0x65, 0x01, 0x65, 0x6e, 1310x74, 0x79, 0xa2, 0x06, 0x21, 0x61, 0x6e, 0x65, 0x01, 0x65,
1320x00, 0x74, 0x79, 0x70, 0x65, 0xa4, 0x06, 0x12, 0x6f, 0xcf, 1320x6e, 0x00, 0x74, 0x79, 0x70, 0x65, 0xa4, 0x06, 0x12, 0x6f,
1330x00, 0x82, 0x6b, 0x65, 0x79, 0x62, 0x6f, 0x61, 0x72, 0x64, 1330xcf, 0x00, 0x72, 0x6b, 0x65, 0x79, 0x62, 0x6f, 0x61, 0x72,
1340x5a, 0x04, 0x21, 0x6c, 0x6c, 0xd0, 0x01, 0x03, 0x3a, 0x00, 1340x54, 0x05, 0x00, 0xbb, 0x03, 0x01, 0xd0, 0x01, 0x02, 0x3a,
1350xc0, 0x2e, 0x00, 0x49, 0x66, 0x00, 0x79, 0x6f, 0x75, 0x00, 1350x00, 0xc0, 0x2e, 0x00, 0x49, 0x66, 0x00, 0x79, 0x6f, 0x75,
1360x6d, 0x61, 0x6b, 0x39, 0x00, 0x8f, 0x6d, 0x69, 0x73, 0x74, 1360x00, 0x6d, 0x61, 0x6b, 0x39, 0x00, 0x8f, 0x6d, 0x69, 0x73,
1370x61, 0x6b, 0x65, 0x2c, 0x76, 0x00, 0x00, 0x02, 0xc6, 0x01, 1370x74, 0x61, 0x6b, 0x65, 0x2c, 0x76, 0x00, 0x01, 0x01, 0xc6,
1380x87, 0x6e, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x7a, 1380x01, 0x88, 0x6e, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74,
1390x00, 0x00, 0x9a, 0x01, 0x80, 0x73, 0x73, 0x00, 0x53, 0x70, 1390x7a, 0x00, 0xb0, 0x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x53,
1400x61, 0x63, 0x65, 0x64, 0x00, 0x50, 0x63, 0x6c, 0x65, 0x61, 1400x70, 0x61, 0x63, 0x65, 0x64, 0x00, 0x50, 0x63, 0x6c, 0x65,
1410x72, 0xf2, 0x03, 0x20, 0x61, 0x67, 0x25, 0x02, 0x62, 0x28, 1410x61, 0x72, 0xf2, 0x03, 0x20, 0x61, 0x67, 0x25, 0x02, 0x62,
1420x6f, 0x72, 0x00, 0x75, 0x73, 0x5f, 0x04, 0xc0, 0x55, 0x6e, 1420x28, 0x6f, 0x72, 0x00, 0x75, 0x73, 0x5f, 0x04, 0xc1, 0x55,
1430x64, 0x6f, 0x00, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 1430x6e, 0x64, 0x6f, 0x00, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72,
1440xf2, 0x00, 0x04, 0x7e, 0x00, 0x61, 0x72, 0x69, 0x67, 0x68, 1440x65, 0xf2, 0x00, 0x03, 0x7e, 0x00, 0x62, 0x72, 0x69, 0x67,
1450x74, 0x2d, 0x74, 0x00, 0x01, 0xe0, 0x00, 0x0f, 0xd8, 0x00, 1450x68, 0x74, 0x2d, 0x74, 0x00, 0x01, 0xd8, 0x02, 0x0f, 0xd8,
1460x04, 0x03, 0x99, 0x04, 0x11, 0x2c, 0xc2, 0x00, 0x03, 0x0d, 1460x00, 0x04, 0x02, 0x99, 0x04, 0x12, 0x2c, 0xc2, 0x00, 0x03,
1470x00, 0x01, 0x8e, 0x04, 0x01, 0x60, 0x03, 0x45, 0x6e, 0x74, 1470x17, 0x06, 0x01, 0x8e, 0x04, 0x00, 0x60, 0x03, 0x46, 0x6e,
1480x65, 0x72, 0x20, 0x06, 0x05, 0x42, 0x00, 0xf1, 0x02, 0x73, 1480x74, 0x65, 0x72, 0x20, 0x06, 0x04, 0x42, 0x00, 0xf1, 0x02,
1490x00, 0x61, 0x00, 0x60, 0x70, 0x65, 0x6e, 0x63, 0x69, 0x6c, 1490x73, 0x00, 0x61, 0x00, 0x60, 0x70, 0x65, 0x6e, 0x63, 0x69,
1500x00, 0x6d, 0x61, 0x72, 0x6b, 0x27, 0x3a, 0x07, 0x00, 0x70, 1500x6c, 0x00, 0x6d, 0x61, 0x72, 0x6b, 0x27, 0x3a, 0x07, 0x01,
1510x06, 0x02, 0xf8, 0x07, 0x07, 0x1b, 0x00, 0x10, 0x73, 0x73, 1510x70, 0x06, 0x01, 0xf8, 0x07, 0x07, 0x1b, 0x00, 0x10, 0x73,
1520x06, 0x04, 0x6e, 0x05, 0x04, 0x77, 0x06, 0x18, 0x73, 0xa3, 1520x73, 0x06, 0x04, 0x6e, 0x05, 0x04, 0x77, 0x06, 0x19, 0x73,
1530x02, 0x05, 0x36, 0x01, 0x11, 0x53, 0x08, 0x00, 0x14, 0x73, 1530xa3, 0x02, 0x04, 0x36, 0x01, 0x11, 0x53, 0x08, 0x00, 0x14,
1540x0a, 0x03, 0x00, 0x85, 0x06, 0x10, 0x66, 0x72, 0x02, 0x44, 1540x73, 0x0a, 0x03, 0x00, 0x85, 0x06, 0x10, 0x66, 0x72, 0x02,
1550x64, 0x2d, 0x69, 0x6e, 0x39, 0x00, 0x00, 0x64, 0x00, 0x00, 1550x45, 0x64, 0x2d, 0x69, 0x6e, 0x39, 0x00, 0x30, 0x63, 0x61,
1560xe3, 0x02, 0x44, 0x61, 0x6c, 0x73, 0x6f, 0x29, 0x00, 0x09, 1560x6e, 0xe3, 0x02, 0x45, 0x61, 0x6c, 0x73, 0x6f, 0x33, 0x03,
1570x6f, 0x00, 0x32, 0x2e, 0x00, 0x00, 0x28, 0x08, 0x00, 0x5a, 1570x08, 0x6f, 0x00, 0x02, 0x87, 0x02, 0x30, 0x65, 0x00, 0x67,
1580x00, 0x10, 0x70, 0xd4, 0x03, 0x40, 0x6e, 0x6f, 0x00, 0x61, 1580x5a, 0x00, 0x10, 0x70, 0xd4, 0x03, 0x40, 0x6e, 0x6f, 0x00,
1590x4c, 0x05, 0x01, 0x6c, 0x05, 0x29, 0x74, 0x6f, 0x2e, 0x00, 1590x61, 0x4c, 0x05, 0x01, 0x6c, 0x05, 0x29, 0x74, 0x6f, 0x2e,
1600x40, 0x2c, 0x00, 0x73, 0x6f, 0xe8, 0x04, 0x10, 0x63, 0x8e, 1600x00, 0x40, 0x2c, 0x00, 0x73, 0x6f, 0xe8, 0x04, 0x10, 0x63,
1610x04, 0x40, 0x77, 0x68, 0x61, 0x74, 0x3a, 0x01, 0x04, 0x5a, 1610x8e, 0x04, 0x10, 0x77, 0x01, 0x01, 0x00, 0x3a, 0x01, 0x03,
1620x01, 0x11, 0x6d, 0xbb, 0x00, 0x13, 0x69, 0x41, 0x06, 0x00, 1620x5a, 0x01, 0x11, 0x6d, 0xbb, 0x00, 0x14, 0x69, 0x41, 0x06,
1630x1a, 0x00, 0x32, 0x3a, 0x00, 0x79, 0xe7, 0x00, 0x05, 0x23, 1630x63, 0x79, 0x6f, 0x75, 0x3a, 0x00, 0x79, 0xe7, 0x00, 0x05,
1640x00, 0x00, 0x0c, 0x01, 0x40, 0x72, 0x65, 0x6d, 0x69, 0xd8, 1640x23, 0x00, 0x70, 0x61, 0x73, 0x00, 0x72, 0x65, 0x6d, 0x69,
1650x02, 0x14, 0x73, 0xd5, 0x03, 0xa4, 0x70, 0x61, 0x72, 0x74, 1650xd8, 0x02, 0x14, 0x73, 0xd5, 0x03, 0xa4, 0x70, 0x61, 0x72,
1660x69, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x32, 0x01, 0x40, 0x6e, 1660x74, 0x69, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x32, 0x01, 0x41,
1670x65, 0x65, 0x64, 0x52, 0x08, 0x00, 0x54, 0x01, 0x30, 0x72, 1670x6e, 0x65, 0x65, 0x64, 0x52, 0x08, 0x60, 0x62, 0x65, 0x00,
1680x65, 0x2d, 0x5a, 0x05, 0x00, 0x92, 0x07, 0x01, 0xd4, 0x03, 1680x72, 0x65, 0x2d, 0x5a, 0x05, 0x01, 0x92, 0x07, 0x01, 0xd4,
1690x01, 0x54, 0x00, 0x42, 0x6b, 0x6e, 0x6f, 0x77, 0xec, 0x03, 1690x03, 0x00, 0x54, 0x00, 0x42, 0x6b, 0x6e, 0x6f, 0x77, 0xec,
1700x4a, 0x61, 0x62, 0x6f, 0x75, 0x45, 0x00, 0x05, 0xa2, 0x01, 1700x03, 0x4b, 0x61, 0x62, 0x6f, 0x75, 0x45, 0x00, 0x04, 0xa2,
1710x2f, 0x6f, 0x72, 0x80, 0x00, 0x02, 0x36, 0x6c, 0x69, 0x73, 1710x01, 0x2f, 0x6f, 0x72, 0x80, 0x00, 0x02, 0x36, 0x6c, 0x69,
1720xf8, 0x06, 0x6a, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6a, 1720x73, 0xf8, 0x06, 0x6a, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62,
1730x01, 0x12, 0x61, 0x83, 0x04, 0x03, 0x8d, 0x00, 0x00, 0x48, 1730x6a, 0x01, 0x13, 0x61, 0x83, 0x04, 0x02, 0x8d, 0x00, 0x01,
1740x00, 0x00, 0xee, 0x02, 0x20, 0x74, 0x68, 0x62, 0x01, 0x32, 1740x48, 0x00, 0x50, 0x61, 0x6e, 0x79, 0x74, 0x68, 0x62, 0x01,
1750x65, 0x6c, 0x73, 0x82, 0x00, 0x93, 0x66, 0x65, 0x65, 0x6c, 1750x32, 0x65, 0x6c, 0x73, 0x82, 0x00, 0x93, 0x66, 0x65, 0x65,
1760x00, 0x6c, 0x69, 0x6b, 0x65, 0x35, 0x03, 0x40, 0x65, 0x72, 1760x6c, 0x00, 0x6c, 0x69, 0x6b, 0x65, 0x35, 0x03, 0x41, 0x65,
1770x61, 0x73, 0x1f, 0x02, 0x00, 0x0d, 0x08, 0x19, 0x6c, 0xd3, 1770x72, 0x61, 0x73, 0xc2, 0x09, 0x49, 0x69, 0x6e, 0x67, 0x6c,
1780x01, 0x18, 0x2c, 0x5b, 0x02, 0x0c, 0x1b, 0x02, 0x21, 0x6e, 1780xd3, 0x01, 0x1c, 0x2c, 0x5b, 0x02, 0x08, 0x1b, 0x02, 0x22,
1790x64, 0x58, 0x02, 0x04, 0xde, 0x01, 0x04, 0x88, 0x00, 0x01, 1790x6e, 0x64, 0x58, 0x02, 0x05, 0xde, 0x01, 0x03, 0x52, 0x02,
1800xb8, 0x02, 0x01, 0x7d, 0x07, 0x39, 0x41, 0x6c, 0x6c, 0x83, 1800x01, 0xb8, 0x02, 0x00, 0x5b, 0x00, 0x3a, 0x41, 0x6c, 0x6c,
1810x01, 0x0a, 0x9c, 0x02, 0x22, 0x72, 0x65, 0x79, 0x00, 0x61, 1810x20, 0x02, 0x09, 0x9c, 0x02, 0x22, 0x72, 0x65, 0x79, 0x00,
1820x64, 0x00, 0x77, 0x68, 0x65, 0x6e, 0x99, 0x00, 0x33, 0x6c, 1820x30, 0x64, 0x00, 0x77, 0xa3, 0x02, 0x00, 0x99, 0x00, 0x34,
1830x65, 0x66, 0x6c, 0x00, 0x06, 0x5e, 0x00, 0x17, 0x61, 0x14, 1830x6c, 0x65, 0x66, 0x6c, 0x00, 0x05, 0x5e, 0x00, 0x18, 0x61,
1840x01, 0x0f, 0x2a, 0x00, 0x01, 0x07, 0x43, 0x03, 0x10, 0x73, 1840x14, 0x01, 0x0f, 0x2a, 0x00, 0x05, 0x02, 0x43, 0x03, 0x10,
1850x43, 0x03, 0x36, 0x2e, 0x00, 0x52, 0xb3, 0x00, 0x35, 0x69, 1850x73, 0x43, 0x03, 0x36, 0x2e, 0x00, 0x52, 0xb3, 0x00, 0x00,
1860x6e, 0x67, 0x20, 0x00, 0x00, 0xde, 0x00, 0x01, 0x23, 0x00, 1860xf7, 0x00, 0x05, 0x20, 0x00, 0x01, 0x2d, 0x0a, 0x01, 0x66,
1870x05, 0x82, 0x07, 0x13, 0x73, 0xfb, 0x00, 0x0d, 0x56, 0x02, 1870x03, 0x03, 0x82, 0x07, 0x14, 0x73, 0xfb, 0x00, 0x0c, 0x56,
1880x11, 0x41, 0xcb, 0x02, 0x01, 0x66, 0x04, 0x12, 0x2c, 0x73, 1880x02, 0x12, 0x41, 0xcb, 0x02, 0x00, 0x66, 0x04, 0x12, 0x2c,
1890x08, 0x50, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x0b, 0x04, 0x14, 1890x73, 0x08, 0x50, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x0b, 0x04,
1900x73, 0x6b, 0x09, 0x20, 0x75, 0x73, 0x2d, 0x03, 0x01, 0xc2, 1900x14, 0x73, 0x6b, 0x09, 0x22, 0x75, 0x73, 0x2d, 0x03, 0x62,
1910x09, 0x31, 0x6a, 0x75, 0x6e, 0xdf, 0x07, 0x01, 0x9c, 0x04, 1910x63, 0x6f, 0x6e, 0x6a, 0x75, 0x6e, 0xdf, 0x07, 0x01, 0x9c,
1920x06, 0x2c, 0x07, 0x00, 0x2f, 0x00, 0x01, 0x0a, 0x02, 0x35, 1920x04, 0x05, 0x2c, 0x07, 0x02, 0x2f, 0x00, 0x65, 0x74, 0x6f,
1930x73, 0x65, 0x74, 0xa4, 0x01, 0x2b, 0x6f, 0x72, 0x6e, 0x00, 1930x00, 0x73, 0x65, 0x74, 0xa4, 0x01, 0x2b, 0x6f, 0x72, 0x6e,
1940x37, 0x55, 0x73, 0x65, 0x63, 0x00, 0x05, 0x34, 0x00, 0x21, 1940x00, 0x3d, 0x55, 0x73, 0x65, 0x63, 0x00, 0x51, 0x74, 0x6f,
1950x6d, 0x6f, 0x55, 0x0b, 0x50, 0x68, 0x69, 0x67, 0x68, 0x6c, 1950x00, 0x6d, 0x6f, 0x55, 0x0b, 0x50, 0x68, 0x69, 0x67, 0x68,
1960xd0, 0x00, 0x21, 0x00, 0x61, 0xf6, 0x06, 0x05, 0x99, 0x0a, 1960x6c, 0xd0, 0x00, 0x21, 0x00, 0x61, 0xf6, 0x06, 0x05, 0x99,
1970x01, 0x18, 0x08, 0x0a, 0xb0, 0x04, 0x22, 0x74, 0x6f, 0xc5, 1970x0a, 0x02, 0x18, 0x08, 0x09, 0xb0, 0x04, 0x22, 0x74, 0x6f,
1980x03, 0x24, 0x00, 0x69, 0x18, 0x06, 0x06, 0x3f, 0x00, 0x25, 1980xc5, 0x03, 0x25, 0x00, 0x69, 0x18, 0x06, 0x05, 0x3f, 0x00,
1990x65, 0x64, 0x7c, 0x03, 0x14, 0x50, 0x0c, 0x01, 0x50, 0x72, 1990x25, 0x65, 0x64, 0x7c, 0x03, 0x14, 0x50, 0x0c, 0x01, 0x50,
2000x65, 0x74, 0x75, 0x72, 0x28, 0x03, 0x5a, 0x67, 0x67, 0x6c, 2000x72, 0x65, 0x74, 0x75, 0x72, 0x28, 0x03, 0x5a, 0x67, 0x67,
2010x65, 0x73, 0x30, 0x00, 0x02, 0x6d, 0x0b, 0x10, 0x61, 0x00, 2010x6c, 0x65, 0x73, 0x30, 0x00, 0x02, 0x6d, 0x0b, 0x12, 0x61,
2020x06, 0x01, 0xbd, 0x04, 0x54, 0x77, 0x68, 0x69, 0x63, 0x68, 2020x00, 0x06, 0x85, 0x69, 0x6e, 0x00, 0x77, 0x68, 0x69, 0x63,
2030x93, 0x02, 0x03, 0x67, 0x00, 0x20, 0x6f, 0x72, 0x10, 0x03, 2030x68, 0x93, 0x02, 0x02, 0x67, 0x00, 0x20, 0x6f, 0x72, 0x10,
2040x2d, 0x6f, 0x76, 0x40, 0x01, 0x06, 0x63, 0x00, 0x11, 0x4d, 2040x03, 0x2e, 0x6f, 0x76, 0x40, 0x01, 0x05, 0x63, 0x00, 0x12,
2050x6b, 0x01, 0x01, 0xdc, 0x03, 0x01, 0xfd, 0x01, 0x01, 0x67, 2050x4d, 0x6b, 0x01, 0x01, 0x37, 0x05, 0x01, 0xfd, 0x01, 0x00,
2060x0b, 0x01, 0x10, 0x01, 0x2d, 0x6f, 0x66, 0x1b, 0x02, 0x43, 2060x67, 0x0b, 0x01, 0x10, 0x01, 0x2d, 0x6f, 0x66, 0x1b, 0x02,
2070x65, 0x76, 0x65, 0x72, 0x93, 0x05, 0x03, 0x35, 0x07, 0x40, 2070x45, 0x65, 0x76, 0x65, 0x72, 0x93, 0x05, 0x01, 0x60, 0x03,
2080x64, 0x6f, 0x65, 0x73, 0xe7, 0x06, 0x04, 0x63, 0x0c, 0x40, 2080x41, 0x64, 0x6f, 0x65, 0x73, 0xe7, 0x06, 0x03, 0x63, 0x0c,
2090x6d, 0x61, 0x69, 0x6e, 0xed, 0x00, 0x02, 0xe1, 0x00, 0x11, 2090x10, 0x6d, 0x03, 0x04, 0x02, 0xed, 0x00, 0x41, 0x69, 0x6e,
2100x69, 0x63, 0x07, 0x41, 0x28, 0x41, 0x6c, 0x6c, 0xbc, 0x00, 2100x00, 0x69, 0x63, 0x07, 0x10, 0x28, 0x66, 0x02, 0x01, 0xc2,
2110x02, 0x63, 0x09, 0x92, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63, 2110x0a, 0x01, 0x84, 0x01, 0x92, 0x73, 0x00, 0x64, 0x65, 0x73,
2120x72, 0x69, 0x62, 0x9e, 0x01, 0x22, 0x73, 0x65, 0x9a, 0x01, 2120x63, 0x72, 0x69, 0x62, 0x9e, 0x01, 0x22, 0x73, 0x65, 0x9a,
2130x30, 0x32, 0x2e, 0x31, 0x72, 0x02, 0x02, 0xf5, 0x01, 0xb2, 2130x01, 0x31, 0x32, 0x2e, 0x31, 0x72, 0x02, 0x01, 0xf5, 0x01,
2140x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 2140xb2, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65,
2150x29, 0x8e, 0x06, 0x12, 0x32, 0x8e, 0x06, 0xb2, 0x70, 0x61, 2150x2e, 0x29, 0x8e, 0x06, 0x12, 0x32, 0x8e, 0x06, 0xb2, 0x70,
2160x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x5b, 2160x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20,
2170x04, 0x35, 0x73, 0x65, 0x00, 0x14, 0x00, 0x01, 0x74, 0x07, 2170x5b, 0x04, 0x00, 0x1b, 0x02, 0x05, 0x14, 0x00, 0x02, 0x40,
2180x06, 0x3b, 0x00, 0x00, 0xc2, 0x0c, 0x02, 0x5f, 0x0b, 0xe0, 2180x00, 0x04, 0x3b, 0x00, 0x02, 0xc2, 0x0c, 0x00, 0x78, 0x00,
2190x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 2190xe1, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e,
2200x27, 0x00, 0x6f, 0x70, 0x6e, 0x00, 0x04, 0x3a, 0x06, 0x50, 2200x2e, 0x27, 0x00, 0x6f, 0x70, 0x6e, 0x00, 0x03, 0x3a, 0x06,
2210x60, 0x54, 0x79, 0x70, 0x65, 0x4f, 0x09, 0x20, 0x6e, 0x75, 2210x50, 0x60, 0x54, 0x79, 0x70, 0x65, 0x4f, 0x09, 0x20, 0x6e,
2220xaa, 0x00, 0x51, 0x47, 0x72, 0x69, 0x64, 0x20, 0x69, 0x08, 2220x75, 0xaa, 0x00, 0x51, 0x47, 0x72, 0x69, 0x64, 0x20, 0x69,
2230xbf, 0x00, 0x00, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 2230x08, 0xbf, 0x00, 0x00, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66,
2240x65, 0x73, 0x00, 0x0d, 0x04, 0xb0, 0x4c, 0x6f, 0x77, 0x65, 2240x69, 0x65, 0x73, 0x00, 0x0d, 0x04, 0xb0, 0x4c, 0x6f, 0x77,
2250x72, 0x00, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x97, 0x04, 0x68, 2250x65, 0x72, 0x00, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x97, 0x04,
2260x33, 0x3b, 0x00, 0x75, 0x70, 0x70, 0x12, 0x00, 0x74, 0x39, 2260x68, 0x33, 0x3b, 0x00, 0x75, 0x70, 0x70, 0x12, 0x00, 0x74,
2270x00, 0x28, 0x62, 0x65, 0x63, 0x61, 0x1a, 0x06, 0x20, 0x75, 2270x39, 0x00, 0x28, 0x62, 0x65, 0x63, 0x61, 0x1a, 0x06, 0x20,
2280x73, 0xf8, 0x01, 0x00, 0x97, 0x01, 0x11, 0x66, 0xe1, 0x02, 2280x75, 0x73, 0xf8, 0x01, 0x00, 0x97, 0x01, 0x11, 0x66, 0xe1,
2290x03, 0x36, 0x09, 0x42, 0x63, 0x6f, 0x6d, 0x65, 0x6c, 0x04, 2290x02, 0x03, 0x36, 0x09, 0x42, 0x63, 0x6f, 0x6d, 0x65, 0x6c,
2300x40, 0x64, 0x69, 0x66, 0x66, 0x64, 0x04, 0x12, 0x74, 0xa5, 2300x04, 0x40, 0x64, 0x69, 0x66, 0x66, 0x64, 0x04, 0x12, 0x74,
2310x02, 0x12, 0x60, 0x5f, 0x09, 0x64, 0x27, 0x00, 0x62, 0x69, 2310xa5, 0x02, 0x12, 0x60, 0x5f, 0x09, 0x64, 0x27, 0x00, 0x62,
2320x67, 0x67, 0x29, 0x0a, 0x21, 0x39, 0x21, 0x55, 0x06, 0x14, 2320x69, 0x67, 0x67, 0x29, 0x0a, 0x21, 0x39, 0x21, 0x55, 0x06,
2330x44, 0x2b, 0x00, 0x53, 0x79, 0x00, 0x00, 0x00, 0x43, 0xa2, 2330x14, 0x44, 0x2b, 0x00, 0x53, 0x79, 0x00, 0x00, 0x00, 0x43,
2340x07, 0x02, 0xd7, 0x02, 0x05, 0x1a, 0x00, 0x05, 0xae, 0x00, 2340xa2, 0x07, 0x03, 0xd7, 0x02, 0x05, 0x1a, 0x00, 0x04, 0xae,
2350x40, 0x65, 0x6e, 0x65, 0x72, 0x58, 0x0c, 0x03, 0x0c, 0x08, 2350x00, 0x41, 0x65, 0x6e, 0x65, 0x72, 0x58, 0x0c, 0x02, 0x0c,
2360xd1, 0x2e, 0x00, 0x41, 0x74, 0x00, 0x55, 0x6e, 0x72, 0x65, 2360x08, 0xd1, 0x2e, 0x00, 0x41, 0x74, 0x00, 0x55, 0x6e, 0x72,
2370x61, 0x73, 0x6f, 0x6e, 0x28, 0x01, 0x80, 0x6c, 0x65, 0x76, 2370x65, 0x61, 0x73, 0x6f, 0x6e, 0x28, 0x01, 0x50, 0x6c, 0x65,
2380x65, 0x6c, 0x2c, 0x00, 0x73, 0x8a, 0x00, 0x71, 0x62, 0x61, 2380x76, 0x65, 0x6c, 0x7d, 0x05, 0x70, 0x6d, 0x65, 0x00, 0x62,
2390x63, 0x6b, 0x74, 0x72, 0x61, 0x98, 0x03, 0x05, 0x79, 0x06, 2390x61, 0x63, 0x6b, 0x0c, 0x0b, 0x01, 0x98, 0x03, 0x04, 0x79,
2400x10, 0x72, 0x28, 0x0a, 0x73, 0x72, 0x65, 0x64, 0x2c, 0x00, 2400x06, 0x10, 0x72, 0x28, 0x0a, 0x73, 0x72, 0x65, 0x64, 0x2c,
2410x62, 0x75, 0x37, 0x0c, 0x31, 0x6f, 0x6c, 0x75, 0x48, 0x01, 2410x00, 0x62, 0x75, 0x37, 0x0c, 0x31, 0x6f, 0x6c, 0x75, 0x48,
2420x21, 0x73, 0x68, 0xc8, 0x00, 0x23, 0x73, 0x74, 0x2b, 0x00, 2420x01, 0x21, 0x73, 0x68, 0xc8, 0x00, 0x23, 0x73, 0x74, 0x2b,
2430x42, 0x75, 0x6e, 0x69, 0x71, 0x85, 0x0c, 0x10, 0x65, 0x7b, 2430x00, 0x42, 0x75, 0x6e, 0x69, 0x71, 0x85, 0x0c, 0x10, 0x65,
2440x02, 0x02, 0x3a, 0x06, 0x02, 0x62, 0x00, 0x13, 0x73, 0x48, 2440x7b, 0x02, 0x03, 0x3a, 0x06, 0x01, 0x62, 0x00, 0x14, 0x73,
2450x00, 0x01, 0x64, 0x07, 0x31, 0x72, 0x65, 0x61, 0xcc, 0x04, 2450x48, 0x00, 0x00, 0x64, 0x07, 0x00, 0x7f, 0x00, 0x00, 0xcc,
2460x00, 0x6b, 0x09, 0x00, 0xd8, 0x0a, 0x22, 0x78, 0x00, 0x91, 2460x04, 0x00, 0x6b, 0x09, 0x00, 0xd8, 0x0a, 0x22, 0x78, 0x00,
2470x00, 0x01, 0xed, 0x0c, 0x00, 0x00, 0x02, 0x30, 0x6f, 0x69, 2470x91, 0x00, 0x01, 0xed, 0x0c, 0x00, 0x00, 0x02, 0x30, 0x6f,
2480x64, 0x54, 0x02, 0x02, 0x10, 0x00, 0x06, 0x97, 0x00, 0x00, 2480x69, 0x64, 0x54, 0x02, 0x03, 0x10, 0x00, 0x05, 0x97, 0x00,
2490xfe, 0x00, 0x19, 0x4d, 0x2e, 0x0c, 0x10, 0x20, 0x98, 0x0d, 2490x00, 0xfe, 0x00, 0x19, 0x4d, 0x2e, 0x0c, 0x11, 0x20, 0x98,
2500x02, 0x69, 0x07, 0x41, 0x74, 0x68, 0x69, 0x73, 0xf1, 0x09, 2500x0d, 0x01, 0x69, 0x07, 0x10, 0x74, 0xf2, 0x08, 0x00, 0xf1,
2510x01, 0xd8, 0x00, 0x00, 0x81, 0x03, 0x00, 0x95, 0x00, 0x44, 2510x09, 0x01, 0xd8, 0x00, 0x00, 0x81, 0x03, 0x00, 0x95, 0x00,
2520x6f, 0x78, 0x65, 0x73, 0xcb, 0x00, 0x0b, 0x6a, 0x0c, 0x02, 2520x45, 0x6f, 0x78, 0x65, 0x73, 0xcb, 0x00, 0x0b, 0x6a, 0x0c,
2530x1d, 0x00, 0x31, 0x2e, 0x00, 0x57, 0x16, 0x04, 0x04, 0x8c, 2530x01, 0x1d, 0x00, 0x32, 0x2e, 0x00, 0x57, 0x16, 0x04, 0x03,
2540x09, 0x01, 0x51, 0x04, 0x04, 0x3a, 0x09, 0x21, 0x69, 0x73, 2540x8c, 0x09, 0x02, 0x51, 0x04, 0x03, 0x3a, 0x09, 0x21, 0x69,
2550x0f, 0x06, 0x10, 0x6e, 0xdc, 0x05, 0xf0, 0x02, 0x60, 0x49, 2550x73, 0x0f, 0x06, 0x10, 0x6e, 0xdc, 0x05, 0xf0, 0x02, 0x60,
2560x6e, 0x73, 0x68, 0x69, 0x00, 0x4e, 0x6f, 0x00, 0x48, 0x65, 2560x49, 0x6e, 0x73, 0x68, 0x69, 0x00, 0x4e, 0x6f, 0x00, 0x48,
2570x79, 0x61, 0x27, 0x2e, 0x00, 2570x65, 0x79, 0x61, 0x27, 0x2e, 0x00,
258}; 258};
259 259
260const unsigned short help_text_len = 3952; 260const unsigned short help_text_len = 3952;
diff --git a/apps/plugins/puzzles/help/lightup.c b/apps/plugins/puzzles/help/lightup.c
index 127c78d885..303aa45beb 100644
--- a/apps/plugins/puzzles/help/lightup.c
+++ b/apps/plugins/puzzles/help/lightup.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -16,9 +16,9 @@ struct style_text help_text_style[] = {
16 LAST_STYLE_ITEM 16 LAST_STYLE_ITEM
17}; 17};
18 18
19/* orig 2327 comp 1556 ratio 0.668672 level 11 saved 771 */ 19/* orig 2327 comp 1558 ratio 0.669532 level 10 saved 769 */
20const char help_text[] = { 20const char help_text[] = {
210xf0, 0x43, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 210xf0, 0x40, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
220x32, 0x31, 0x3a, 0x20, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x20, 220x32, 0x31, 0x3a, 0x20, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x20,
230x55, 0x70, 0x20, 0x00, 0x00, 0x00, 0x59, 0x6f, 0x75, 0x00, 230x55, 0x70, 0x20, 0x00, 0x00, 0x00, 0x59, 0x6f, 0x75, 0x00,
240x68, 0x61, 0x76, 0x65, 0x00, 0x61, 0x00, 0x67, 0x72, 0x69, 240x68, 0x61, 0x76, 0x65, 0x00, 0x61, 0x00, 0x67, 0x72, 0x69,
@@ -26,7 +26,7 @@ const char help_text[] = {
260x65, 0x73, 0x2e, 0x00, 0x53, 0x6f, 0x6d, 0x65, 0x00, 0x61, 260x65, 0x73, 0x2e, 0x00, 0x53, 0x6f, 0x6d, 0x65, 0x00, 0x61,
270x72, 0x65, 0x00, 0x66, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x00, 270x72, 0x65, 0x00, 0x66, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x00,
280x69, 0x6e, 0x00, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x3b, 0x00, 280x69, 0x6e, 0x00, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x3b, 0x00,
290x73, 0x6f, 0x6d, 0x65, 0x2b, 0x00, 0x32, 0x74, 0x68, 0x65, 290x73, 0x1a, 0x00, 0x62, 0x6f, 0x66, 0x00, 0x74, 0x68, 0x65,
300x13, 0x00, 0x04, 0x35, 0x00, 0x01, 0x2f, 0x00, 0x90, 0x6e, 300x13, 0x00, 0x04, 0x35, 0x00, 0x01, 0x2f, 0x00, 0x90, 0x6e,
310x75, 0x6d, 0x62, 0x65, 0x72, 0x65, 0x64, 0x2e, 0x5e, 0x00, 310x75, 0x6d, 0x62, 0x65, 0x72, 0x65, 0x64, 0x2e, 0x5e, 0x00,
320xe0, 0x72, 0x00, 0x61, 0x69, 0x6d, 0x00, 0x69, 0x73, 0x00, 320xe0, 0x72, 0x00, 0x61, 0x69, 0x6d, 0x00, 0x69, 0x73, 0x00,
@@ -34,19 +34,19 @@ const char help_text[] = {
340x70, 0x27, 0x00, 0x61, 0x6c, 0x6c, 0x3e, 0x00, 0x55, 0x65, 340x70, 0x27, 0x00, 0x61, 0x6c, 0x6c, 0x3e, 0x00, 0x55, 0x65,
350x6d, 0x70, 0x74, 0x79, 0x3e, 0x00, 0xb2, 0x62, 0x79, 0x00, 350x6d, 0x70, 0x74, 0x79, 0x3e, 0x00, 0xb2, 0x62, 0x79, 0x00,
360x70, 0x6c, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x00, 0x2b, 0x00, 360x70, 0x6c, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x00, 0x2b, 0x00,
370x88, 0x62, 0x75, 0x6c, 0x62, 0x73, 0x00, 0x69, 0x6e, 0x72, 370x50, 0x62, 0x75, 0x6c, 0x62, 0x73, 0x79, 0x00, 0x07, 0x72,
380x00, 0x97, 0x6d, 0x2e, 0x00, 0x00, 0x00, 0x45, 0x61, 0x63, 380x00, 0x97, 0x6d, 0x2e, 0x00, 0x00, 0x00, 0x45, 0x61, 0x63,
390x68, 0x24, 0x00, 0xc0, 0x00, 0x69, 0x6c, 0x6c, 0x75, 0x6d, 390x68, 0x24, 0x00, 0xc1, 0x00, 0x69, 0x6c, 0x6c, 0x75, 0x6d,
400x69, 0x6e, 0x61, 0x74, 0x65, 0x73, 0x24, 0x00, 0x03, 0x52, 400x69, 0x6e, 0x61, 0x74, 0x65, 0x73, 0x58, 0x00, 0x02, 0x52,
410x00, 0x30, 0x00, 0x69, 0x74, 0x7b, 0x00, 0x80, 0x6f, 0x6e, 410x00, 0x30, 0x00, 0x69, 0x74, 0x7b, 0x00, 0x81, 0x6f, 0x6e,
420x2c, 0x00, 0x70, 0x6c, 0x75, 0x73, 0x76, 0x00, 0x03, 0x1a, 420x2c, 0x00, 0x70, 0x6c, 0x75, 0x73, 0x76, 0x00, 0x04, 0x6c,
430x00, 0x01, 0x55, 0x00, 0x90, 0x6c, 0x69, 0x6e, 0x65, 0x00, 430x00, 0xc0, 0x69, 0x6e, 0x00, 0x6c, 0x69, 0x6e, 0x65, 0x00,
440x77, 0x69, 0x74, 0x68, 0x28, 0x00, 0xf1, 0x07, 0x68, 0x6f, 440x77, 0x69, 0x74, 0x68, 0x28, 0x00, 0xf1, 0x07, 0x68, 0x6f,
450x72, 0x69, 0x7a, 0x6f, 0x6e, 0x74, 0x61, 0x6c, 0x6c, 0x79, 450x72, 0x69, 0x7a, 0x6f, 0x6e, 0x74, 0x61, 0x6c, 0x6c, 0x79,
460x00, 0x6f, 0x72, 0x00, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63, 460x00, 0x6f, 0x72, 0x00, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63,
470x0e, 0x00, 0x89, 0x75, 0x6e, 0x6c, 0x65, 0x73, 0x73, 0x00, 470x0e, 0x00, 0x89, 0x75, 0x6e, 0x6c, 0x65, 0x73, 0x73, 0x00,
480x61, 0xec, 0x00, 0x00, 0x59, 0x00, 0x81, 0x62, 0x6c, 0x6f, 480x61, 0xec, 0x00, 0x00, 0x59, 0x00, 0x50, 0x62, 0x6c, 0x6f,
490x63, 0x6b, 0x69, 0x6e, 0x67, 0x73, 0x00, 0x30, 0x77, 0x61, 490x63, 0x6b, 0xae, 0x00, 0x00, 0x73, 0x00, 0x30, 0x77, 0x61,
500x79, 0x9a, 0x00, 0x61, 0x54, 0x6f, 0x00, 0x77, 0x69, 0x6e, 500x79, 0x9a, 0x00, 0x61, 0x54, 0x6f, 0x00, 0x77, 0x69, 0x6e,
510x12, 0x00, 0xf1, 0x07, 0x67, 0x61, 0x6d, 0x65, 0x2c, 0x00, 510x12, 0x00, 0xf1, 0x07, 0x67, 0x61, 0x6d, 0x65, 0x2c, 0x00,
520x79, 0x6f, 0x75, 0x00, 0x6d, 0x75, 0x73, 0x74, 0x00, 0x73, 520x79, 0x6f, 0x75, 0x00, 0x6d, 0x75, 0x73, 0x74, 0x00, 0x73,
@@ -57,18 +57,18 @@ const char help_text[] = {
570x6f, 0x6e, 0x2d, 0x58, 0x01, 0x41, 0x6c, 0x69, 0x74, 0x2e, 570x6f, 0x6e, 0x2d, 0x58, 0x01, 0x41, 0x6c, 0x69, 0x74, 0x2e,
580x23, 0x00, 0x23, 0x4e, 0x6f, 0xfb, 0x00, 0x20, 0x69, 0x73, 580x23, 0x00, 0x23, 0x4e, 0x6f, 0xfb, 0x00, 0x20, 0x69, 0x73,
590x15, 0x00, 0x00, 0x37, 0x01, 0x72, 0x61, 0x6e, 0x6f, 0x74, 590x15, 0x00, 0x00, 0x37, 0x01, 0x72, 0x61, 0x6e, 0x6f, 0x74,
600x68, 0x65, 0x72, 0x18, 0x00, 0x14, 0x2e, 0x49, 0x00, 0x05, 600x68, 0x65, 0x72, 0x18, 0x00, 0x16, 0x2e, 0x49, 0x00, 0x03,
610x8b, 0x01, 0x0a, 0xa6, 0x01, 0x02, 0xf2, 0x01, 0x60, 0x65, 610x8b, 0x01, 0x0b, 0xa6, 0x01, 0x01, 0xf2, 0x01, 0x60, 0x65,
620x78, 0x61, 0x63, 0x74, 0x6c, 0x8f, 0x00, 0x23, 0x61, 0x74, 620x78, 0x61, 0x63, 0x74, 0x6c, 0x8f, 0x00, 0x23, 0x61, 0x74,
630x29, 0x00, 0x32, 0x00, 0x6f, 0x66, 0x42, 0x00, 0xd1, 0x73, 630x29, 0x00, 0x00, 0x62, 0x01, 0x01, 0x42, 0x00, 0xa0, 0x73,
640x00, 0x61, 0x64, 0x6a, 0x61, 0x63, 0x65, 0x6e, 0x74, 0x00, 640x00, 0x61, 0x64, 0x6a, 0x61, 0x63, 0x65, 0x6e, 0x74, 0xb8,
650x74, 0x6f, 0x75, 0x01, 0x43, 0x00, 0x28, 0x69, 0x6e, 0xba, 650x01, 0x00, 0x75, 0x01, 0x23, 0x00, 0x28, 0xd5, 0x00, 0x10,
660x00, 0x26, 0x75, 0x72, 0x97, 0x00, 0xf3, 0x01, 0x62, 0x6f, 660x66, 0xd4, 0x01, 0x05, 0x97, 0x00, 0xf3, 0x01, 0x62, 0x6f,
670x76, 0x65, 0x2c, 0x00, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x2c, 670x76, 0x65, 0x2c, 0x00, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x2c,
680x00, 0x61, 0x6e, 0x64, 0x2f, 0x00, 0x60, 0x00, 0x73, 0x69, 680x00, 0x61, 0x6e, 0x64, 0x2f, 0x00, 0x60, 0x00, 0x73, 0x69,
690x64, 0x65, 0x29, 0x88, 0x00, 0x4f, 0x4e, 0x6f, 0x6e, 0x2d, 690x64, 0x65, 0x29, 0x88, 0x00, 0x4f, 0x4e, 0x6f, 0x6e, 0x2d,
700x86, 0x00, 0x04, 0x33, 0x6d, 0x61, 0x79, 0x7c, 0x02, 0x2f, 700x86, 0x00, 0x04, 0x33, 0x6d, 0x61, 0x79, 0x7c, 0x02, 0x2f,
710x6e, 0x79, 0x81, 0x00, 0x0a, 0x05, 0xf6, 0x01, 0xf1, 0x0b, 710x6e, 0x79, 0x81, 0x00, 0x0f, 0x00, 0x4d, 0x00, 0xf1, 0x0b,
720x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x00, 0x66, 0x6f, 0x72, 720x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x00, 0x66, 0x6f, 0x72,
730x00, 0x74, 0x68, 0x69, 0x73, 0x00, 0x70, 0x75, 0x7a, 0x7a, 730x00, 0x74, 0x68, 0x69, 0x73, 0x00, 0x70, 0x75, 0x7a, 0x7a,
740x6c, 0x65, 0x00, 0x67, 0x6f, 0x65, 0x60, 0x02, 0xa0, 0x4e, 740x6c, 0x65, 0x00, 0x67, 0x6f, 0x65, 0x60, 0x02, 0xa0, 0x4e,
@@ -76,104 +76,104 @@ const char help_text[] = {
760x00, 0x11, 0x4c, 0x23, 0x01, 0x60, 0x55, 0x70, 0x00, 0x77, 760x00, 0x11, 0x4c, 0x23, 0x01, 0x60, 0x55, 0x70, 0x00, 0x77,
770x61, 0x73, 0x66, 0x01, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 770x61, 0x73, 0x66, 0x01, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75,
780x74, 0x65, 0xa3, 0x00, 0x10, 0x69, 0x14, 0x00, 0x40, 0x6c, 780x74, 0x65, 0xa3, 0x00, 0x10, 0x69, 0x14, 0x00, 0x40, 0x6c,
790x6c, 0x65, 0x63, 0x7b, 0x01, 0x00, 0x42, 0x01, 0xb0, 0x4a, 790x6c, 0x65, 0x63, 0x7b, 0x01, 0x00, 0x42, 0x01, 0xb1, 0x4a,
800x61, 0x6d, 0x65, 0x73, 0x00, 0x48, 0x61, 0x72, 0x76, 0x65, 800x61, 0x6d, 0x65, 0x73, 0x00, 0x48, 0x61, 0x72, 0x76, 0x65,
810xc8, 0x01, 0x00, 0x46, 0x00, 0xd1, 0x00, 0x68, 0x74, 0x74, 810xc8, 0x01, 0xf1, 0x01, 0x5b, 0x39, 0x5d, 0x00, 0x68, 0x74,
820x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6e, 0x5c, 820x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6e,
830x00, 0xa2, 0x2e, 0x63, 0x6f, 0x2e, 0x6a, 0x70, 0x2f, 0x65, 830x5c, 0x00, 0xa2, 0x2e, 0x63, 0x6f, 0x2e, 0x6a, 0x70, 0x2f,
840x6e, 0x2f, 0x7b, 0x00, 0xf1, 0x04, 0x73, 0x2f, 0x61, 0x6b, 840x65, 0x6e, 0x2f, 0x7b, 0x00, 0xf1, 0x04, 0x73, 0x2f, 0x61,
850x61, 0x72, 0x69, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x00, 0x28, 850x6b, 0x61, 0x72, 0x69, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x00,
860x62, 0x65, 0x77, 0x61, 0x72, 0xa7, 0x02, 0xd6, 0x46, 0x6c, 860x28, 0x62, 0x65, 0x77, 0x61, 0x72, 0xa7, 0x02, 0xd6, 0x46,
870x61, 0x73, 0x68, 0x29, 0x00, 0x00, 0x00, 0x32, 0x31, 0x2e, 870x6c, 0x61, 0x73, 0x68, 0x29, 0x00, 0x00, 0x00, 0x32, 0x31,
880x31, 0x71, 0x03, 0x01, 0x86, 0x00, 0x40, 0x6f, 0x6c, 0x73, 880x2e, 0x31, 0x71, 0x03, 0x01, 0x86, 0x00, 0x40, 0x6f, 0x6c,
890x20, 0x9f, 0x00, 0x71, 0x65, 0x66, 0x74, 0x2d, 0x63, 0x6c, 890x73, 0x20, 0x9f, 0x00, 0x72, 0x65, 0x66, 0x74, 0x2d, 0x63,
900x69, 0x41, 0x02, 0x00, 0x8e, 0x02, 0x1c, 0x61, 0xf7, 0x01, 900x6c, 0x69, 0x41, 0x02, 0x4d, 0x69, 0x6e, 0x00, 0x61, 0xf7,
910x00, 0x9c, 0x02, 0x00, 0x27, 0x03, 0x51, 0x6f, 0x67, 0x67, 910x01, 0x30, 0x00, 0x77, 0x69, 0x27, 0x03, 0x51, 0x6f, 0x67,
920x6c, 0x65, 0x56, 0x01, 0x71, 0x70, 0x72, 0x65, 0x73, 0x65, 920x67, 0x6c, 0x65, 0x56, 0x01, 0x71, 0x70, 0x72, 0x65, 0x73,
930x6e, 0x63, 0x63, 0x00, 0x14, 0x61, 0x04, 0x02, 0x11, 0x6e, 930x65, 0x6e, 0x63, 0x63, 0x00, 0x14, 0x61, 0x04, 0x02, 0x12,
940xc2, 0x01, 0x03, 0x33, 0x00, 0x6f, 0x2e, 0x00, 0x52, 0x69, 940x6e, 0xc2, 0x01, 0x02, 0x33, 0x00, 0x30, 0x2e, 0x00, 0x52,
950x67, 0x68, 0x59, 0x00, 0x0d, 0x03, 0x54, 0x00, 0x00, 0xd3, 950x16, 0x00, 0x0f, 0x59, 0x00, 0x0d, 0x02, 0x54, 0x00, 0x00,
960x02, 0x40, 0x6d, 0x61, 0x72, 0x6b, 0x5c, 0x00, 0x01, 0x15, 960xd3, 0x02, 0x40, 0x6d, 0x61, 0x72, 0x6b, 0x5c, 0x00, 0x01,
970x00, 0xd0, 0x00, 0x61, 0x69, 0x64, 0x00, 0x73, 0x6f, 0x6c, 970x15, 0x00, 0xd0, 0x00, 0x61, 0x69, 0x64, 0x00, 0x73, 0x6f,
980x76, 0x69, 0x6e, 0x67, 0x3b, 0x15, 0x03, 0x92, 0x63, 0x61, 980x6c, 0x76, 0x69, 0x6e, 0x67, 0x3b, 0x15, 0x03, 0x92, 0x63,
990x6e, 0x00, 0x62, 0x65, 0x00, 0x75, 0x73, 0x37, 0x01, 0x41, 990x61, 0x6e, 0x00, 0x62, 0x65, 0x00, 0x75, 0x73, 0x37, 0x01,
1000x68, 0x69, 0x67, 0x68, 0x76, 0x00, 0x04, 0xc4, 0x01, 0x00, 1000x42, 0x68, 0x69, 0x67, 0x68, 0x76, 0x00, 0x04, 0xc4, 0x01,
1010x7b, 0x00, 0x01, 0x26, 0x00, 0x51, 0x6e, 0x6f, 0x74, 0x00, 1010x01, 0x7b, 0x00, 0x81, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74,
1020x62, 0xa3, 0x02, 0x10, 0x2c, 0x9f, 0x01, 0x00, 0x5d, 0x02, 1020x00, 0x62, 0xa3, 0x02, 0x11, 0x2c, 0x9f, 0x01, 0x83, 0x65,
1030x52, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x04, 0x01, 0xeb, 1030x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x04, 0x00,
1040x01, 0x31, 0x6e, 0x6f, 0x74, 0xde, 0x03, 0x17, 0x65, 0xbb, 1040xeb, 0x01, 0x00, 0x23, 0x00, 0x00, 0xde, 0x03, 0x18, 0x65,
1050x00, 0x03, 0x81, 0x00, 0x23, 0x65, 0x64, 0x51, 0x00, 0x52, 1050xbb, 0x00, 0x02, 0x81, 0x00, 0x23, 0x65, 0x64, 0x51, 0x00,
1060x2c, 0x00, 0x6e, 0x6f, 0x72, 0x26, 0x00, 0x04, 0x9c, 0x00, 1060x55, 0x2c, 0x00, 0x6e, 0x6f, 0x72, 0x26, 0x00, 0x01, 0x9c,
1070x21, 0x69, 0x6e, 0x30, 0x00, 0x04, 0x73, 0x00, 0x01, 0x63, 1070x00, 0x21, 0x69, 0x6e, 0x30, 0x00, 0x06, 0xe1, 0x00, 0x33,
1080x03, 0x02, 0x5c, 0x03, 0x02, 0x20, 0x01, 0x07, 0x95, 0x00, 1080x00, 0x00, 0x54, 0x5c, 0x03, 0x02, 0x20, 0x01, 0x06, 0x95,
1090xd1, 0x6f, 0x62, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x00, 0x65, 1090x00, 0xd1, 0x6f, 0x62, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x00,
1100x72, 0x72, 0x6f, 0x72, 0xe2, 0x03, 0x00, 0x86, 0x04, 0x02, 1100x65, 0x72, 0x72, 0x6f, 0x72, 0xe2, 0x03, 0x01, 0x86, 0x04,
1110x09, 0x02, 0x05, 0x2a, 0x03, 0x07, 0x28, 0x03, 0x01, 0x57, 1110x01, 0x7f, 0x01, 0x05, 0x2a, 0x03, 0x07, 0x28, 0x03, 0x02,
1120x03, 0x06, 0x40, 0x00, 0x01, 0xe3, 0x04, 0x01, 0x1b, 0x02, 1120x57, 0x03, 0x05, 0x40, 0x00, 0x02, 0xe3, 0x04, 0x01, 0x1b,
1130x00, 0xcc, 0x03, 0x3a, 0x2c, 0x00, 0x61, 0xcf, 0x04, 0x05, 1130x02, 0x6a, 0x77, 0x61, 0x79, 0x2c, 0x00, 0x61, 0xcf, 0x04,
1140xf4, 0x00, 0x81, 0x77, 0x68, 0x69, 0x63, 0x68, 0x00, 0x64, 1140x05, 0xf4, 0x00, 0x81, 0x77, 0x68, 0x69, 0x63, 0x68, 0x00,
1150x6f, 0xd2, 0x00, 0x33, 0x28, 0x6f, 0x72, 0x00, 0x01, 0x10, 1150x64, 0x6f, 0xd2, 0x00, 0x33, 0x28, 0x6f, 0x72, 0x00, 0x01,
1160x29, 0xcd, 0x02, 0x02, 0xa8, 0x01, 0x10, 0x72, 0x4f, 0x00, 1160x12, 0x29, 0xcd, 0x02, 0x00, 0xa8, 0x01, 0x11, 0x72, 0x8f,
1170x0e, 0xd3, 0x02, 0x39, 0x6e, 0x65, 0x78, 0xcf, 0x02, 0x50, 1170x00, 0x0d, 0xd3, 0x02, 0x39, 0x6e, 0x65, 0x78, 0xcf, 0x02,
1180x54, 0x68, 0x75, 0x73, 0x2c, 0x0e, 0x00, 0x02, 0x7c, 0x05, 1180x52, 0x54, 0x68, 0x75, 0x73, 0x2c, 0x2a, 0x04, 0x00, 0x7c,
1190x21, 0x69, 0x73, 0x7c, 0x01, 0x94, 0x65, 0x64, 0x00, 0x77, 1190x05, 0x21, 0x69, 0x73, 0x7c, 0x01, 0x9e, 0x65, 0x64, 0x00,
1200x68, 0x65, 0x6e, 0x00, 0x61, 0x09, 0x04, 0x0e, 0xbb, 0x03, 1200x77, 0x68, 0x65, 0x6e, 0x00, 0x61, 0x09, 0x04, 0x04, 0xbb,
1210x20, 0x79, 0x65, 0x3e, 0x04, 0x06, 0xba, 0x00, 0x10, 0x73, 1210x03, 0x20, 0x79, 0x65, 0x3e, 0x04, 0x06, 0xba, 0x00, 0x12,
1220x7b, 0x03, 0x02, 0xc6, 0x01, 0x02, 0xb3, 0x00, 0x10, 0x6f, 1220x73, 0x7b, 0x03, 0x01, 0xc6, 0x01, 0x01, 0xb3, 0x00, 0x10,
1230xfa, 0x00, 0x03, 0x77, 0x00, 0x00, 0x6a, 0x00, 0x23, 0x28, 1230x6f, 0xfa, 0x00, 0x03, 0x77, 0x00, 0x00, 0x6a, 0x00, 0x23,
1240x41, 0x70, 0x05, 0x21, 0x61, 0x63, 0x6b, 0x04, 0x82, 0x00, 1240x28, 0x41, 0x70, 0x05, 0x21, 0x61, 0x63, 0x6b, 0x04, 0x82,
1250x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0xf3, 0x00, 0x13, 1250x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0xf3, 0x00,
1260x73, 0x06, 0x03, 0x31, 0x32, 0x2e, 0x31, 0x3f, 0x00, 0xf3, 1260x13, 0x73, 0x06, 0x03, 0x31, 0x32, 0x2e, 0x31, 0x3f, 0x00,
1270x00, 0x61, 0x6c, 0x73, 0x6f, 0x00, 0x61, 0x76, 0x61, 0x69, 1270xf3, 0x00, 0x61, 0x6c, 0x73, 0x6f, 0x00, 0x61, 0x76, 0x61,
1280x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0xc8, 0x02, 0x16, 0x32, 1280x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0xc8, 0x02, 0x16,
1290xc8, 0x02, 0xb2, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 1290x32, 0xc8, 0x02, 0xb2, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65,
1300x65, 0x72, 0x73, 0x20, 0x8f, 0x01, 0x35, 0x73, 0x65, 0x00, 1300x74, 0x65, 0x72, 0x73, 0x20, 0x8f, 0x01, 0x36, 0x73, 0x65,
1310x14, 0x00, 0x01, 0x36, 0x01, 0x06, 0x3f, 0x00, 0x51, 0x00, 1310x00, 0x14, 0x00, 0x02, 0x44, 0x00, 0x04, 0x3f, 0x00, 0x51,
1320x66, 0x72, 0x6f, 0x6d, 0x7c, 0x00, 0xe1, 0x60, 0x43, 0x75, 1320x00, 0x66, 0x72, 0x6f, 0x6d, 0x7c, 0x00, 0xe1, 0x60, 0x43,
1330x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 1330x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00,
1340x70, 0x72, 0x00, 0x22, 0x6f, 0x6e, 0x1a, 0x00, 0xa0, 0x54, 1340x6f, 0x70, 0x72, 0x00, 0x22, 0x6f, 0x6e, 0x1a, 0x00, 0xa0,
1350x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0xae, 1350x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75,
1360x00, 0x91, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 0x48, 1360xae, 0x00, 0x91, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x00,
1370x65, 0x47, 0x01, 0x50, 0x00, 0x00, 0x53, 0x69, 0x7a, 0xf3, 1370x48, 0x65, 0x47, 0x01, 0x51, 0x00, 0x00, 0x53, 0x69, 0x7a,
1380x02, 0x03, 0x26, 0x01, 0x16, 0x6e, 0xa2, 0x06, 0xa1, 0x00, 1380xf3, 0x02, 0x02, 0x26, 0x01, 0x16, 0x6e, 0xa2, 0x06, 0xa1,
1390x00, 0x25, 0x61, 0x67, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x25, 1390x00, 0x00, 0x25, 0x61, 0x67, 0x65, 0x20, 0x6f, 0x66, 0x20,
1400x01, 0x14, 0x20, 0x25, 0x01, 0xb0, 0x00, 0x00, 0x52, 0x6f, 1400x25, 0x01, 0x14, 0x20, 0x25, 0x01, 0xb0, 0x00, 0x00, 0x52,
1410x75, 0x67, 0x68, 0x00, 0x70, 0x65, 0x72, 0x43, 0x04, 0x20, 1410x6f, 0x75, 0x67, 0x68, 0x00, 0x70, 0x65, 0x72, 0x43, 0x04,
1420x61, 0x67, 0x3f, 0x00, 0x0b, 0x7e, 0x04, 0x25, 0x69, 0x6e, 1420x21, 0x61, 0x67, 0x3f, 0x00, 0x0a, 0x49, 0x01, 0x25, 0x69,
1430x7a, 0x01, 0x01, 0x8c, 0x01, 0x00, 0xf7, 0x01, 0x10, 0x69, 1430x6e, 0x7a, 0x01, 0x02, 0x8c, 0x01, 0x40, 0x69, 0x73, 0x00,
1440x12, 0x03, 0x70, 0x68, 0x69, 0x6e, 0x74, 0x00, 0x72, 0x61, 1440x69, 0x12, 0x03, 0x71, 0x68, 0x69, 0x6e, 0x74, 0x00, 0x72,
1450x4e, 0x01, 0x00, 0xdf, 0x02, 0xb1, 0x6e, 0x00, 0x61, 0x6e, 1450x61, 0x27, 0x02, 0xe1, 0x74, 0x68, 0x61, 0x6e, 0x00, 0x61,
1460x00, 0x69, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x26, 0x01, 0x46, 1460x6e, 0x00, 0x69, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x26, 0x01,
1470x2e, 0x00, 0x49, 0x66, 0xb4, 0x01, 0x90, 0x67, 0x65, 0x6e, 1470x46, 0x2e, 0x00, 0x49, 0x66, 0xb4, 0x01, 0x90, 0x67, 0x65,
1480x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x00, 0x21, 0x75, 1480x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x00, 0x21,
1490x6e, 0xf1, 0x00, 0x24, 0x74, 0x6f, 0x17, 0x00, 0x33, 0x65, 1490x75, 0x6e, 0xf1, 0x00, 0x24, 0x74, 0x6f, 0x17, 0x00, 0x00,
1500x00, 0x61, 0xa4, 0x04, 0x04, 0x75, 0x04, 0x00, 0xc3, 0x03, 1500xc5, 0x02, 0x03, 0xa4, 0x04, 0x04, 0x75, 0x04, 0xf0, 0x02,
1510xe0, 0x63, 0x69, 0x73, 0x65, 0x00, 0x73, 0x70, 0x65, 0x63, 1510x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x65, 0x00, 0x73, 0x70,
1520x69, 0x66, 0x69, 0x63, 0x61, 0x54, 0x00, 0x42, 0x2c, 0x00, 1520x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x54, 0x00, 0x10,
1530x69, 0x74, 0xcd, 0x02, 0x74, 0x69, 0x6e, 0x63, 0x72, 0x65, 1530x2c, 0x6c, 0x03, 0x01, 0xcd, 0x02, 0x74, 0x69, 0x6e, 0x63,
1540x61, 0x73, 0xef, 0x03, 0x40, 0x6f, 0x70, 0x6f, 0x72, 0x21, 1540x72, 0x65, 0x61, 0x73, 0xef, 0x03, 0x42, 0x6f, 0x70, 0x6f,
1550x00, 0x0e, 0xbf, 0x00, 0x53, 0x75, 0x6e, 0x74, 0x69, 0x6c, 1550x72, 0x29, 0x01, 0x0c, 0xbf, 0x00, 0x53, 0x75, 0x6e, 0x74,
1560xa3, 0x03, 0x10, 0x2e, 0x24, 0x01, 0xb0, 0x79, 0x6d, 0x6d, 1560x69, 0x6c, 0xa3, 0x03, 0x10, 0x2e, 0x24, 0x01, 0xb0, 0x79,
1570x65, 0x74, 0x72, 0x79, 0x00, 0x00, 0x00, 0x41, 0x1d, 0x02, 1570x6d, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x00, 0x00, 0x00, 0x41,
1580x11, 0x73, 0x78, 0x06, 0x23, 0x74, 0x6f, 0x69, 0x00, 0x12, 1580x1d, 0x02, 0x11, 0x73, 0x78, 0x06, 0x23, 0x74, 0x6f, 0x69,
1590x79, 0x98, 0x02, 0x41, 0x65, 0x71, 0x75, 0x69, 0xcb, 0x02, 1590x00, 0x12, 0x79, 0x98, 0x02, 0x41, 0x65, 0x71, 0x75, 0x69,
1600x03, 0x2e, 0x00, 0x0d, 0xc5, 0x07, 0x0e, 0x1b, 0x01, 0x11, 1600xcb, 0x02, 0x04, 0x2e, 0x00, 0x0e, 0xc5, 0x07, 0x0c, 0x1b,
1610x28, 0x1a, 0x01, 0x41, 0x64, 0x6f, 0x65, 0x73, 0xf0, 0x02, 1610x01, 0x11, 0x28, 0x1a, 0x01, 0x10, 0x64, 0x63, 0x05, 0x00,
1620x61, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x00, 0x94, 1620xf0, 0x02, 0x61, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20,
1630x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x47, 1630x00, 0x95, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c,
1640x00, 0x02, 0xec, 0x00, 0x02, 0x29, 0x00, 0x71, 0x69, 0x63, 1640x74, 0x47, 0x00, 0x03, 0x15, 0x05, 0x00, 0x29, 0x00, 0x71,
1650x65, 0x61, 0x62, 0x6c, 0x79, 0x3d, 0x02, 0x16, 0x44, 0x29, 1650x69, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x79, 0x3d, 0x02, 0x16,
1660x00, 0x70, 0x00, 0x00, 0x60, 0x45, 0x61, 0x73, 0x79, 0xec, 1660x44, 0x29, 0x00, 0x70, 0x00, 0x00, 0x60, 0x45, 0x61, 0x73,
1670x01, 0x22, 0x61, 0x6e, 0x3f, 0x04, 0x09, 0x3a, 0x00, 0x90, 1670x79, 0xec, 0x01, 0x23, 0x61, 0x6e, 0x3f, 0x04, 0x08, 0x3a,
1680x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x00, 0x62, 0x65, 0x0b, 1680x00, 0x60, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x4b, 0x04,
1690x03, 0x32, 0x75, 0x62, 0x6c, 0xa0, 0x07, 0xb1, 0x6f, 0x75, 1690x62, 0x73, 0x6f, 0x6c, 0x75, 0x62, 0x6c, 0xa0, 0x07, 0xb2,
1700x74, 0x00, 0x62, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0xd6, 1700x6f, 0x75, 0x74, 0x00, 0x62, 0x61, 0x63, 0x6b, 0x74, 0x72,
1710x04, 0x00, 0xa0, 0x07, 0xf8, 0x00, 0x67, 0x75, 0x65, 0x73, 1710x61, 0xd6, 0x04, 0xf9, 0x03, 0x6f, 0x72, 0x00, 0x67, 0x75,
1720x73, 0x69, 0x6e, 0x67, 0x2c, 0x00, 0x60, 0x48, 0x61, 0x72, 1720x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x2c, 0x00, 0x60, 0x48,
1730x64, 0x52, 0x00, 0x01, 0x2e, 0x08, 0x02, 0x21, 0x00, 0x21, 1730x61, 0x72, 0x64, 0x52, 0x00, 0x01, 0x2e, 0x08, 0x01, 0x21,
1740x65, 0x73, 0x58, 0x01, 0x00, 0x4b, 0x01, 0x10, 0x62, 0x90, 1740x00, 0x22, 0x65, 0x73, 0x58, 0x01, 0x40, 0x70, 0x72, 0x6f,
1750x00, 0x00, 0x5a, 0x00, 0xb0, 0x6e, 0x65, 0x63, 0x65, 0x73, 1750x62, 0x90, 0x00, 0x00, 0x5a, 0x00, 0xb0, 0x6e, 0x65, 0x63,
1760x73, 0x61, 0x72, 0x79, 0x2e, 0x00, 1760x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x2e, 0x00,
177}; 177};
178 178
179const unsigned short help_text_len = 2327; 179const unsigned short help_text_len = 2327;
diff --git a/apps/plugins/puzzles/help/loopy.c b/apps/plugins/puzzles/help/loopy.c
index 1c6e420fd3..eb4adedfc8 100644
--- a/apps/plugins/puzzles/help/loopy.c
+++ b/apps/plugins/puzzles/help/loopy.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -20,7 +20,7 @@ struct style_text help_text_style[] = {
20 LAST_STYLE_ITEM 20 LAST_STYLE_ITEM
21}; 21};
22 22
23/* orig 2260 comp 1602 ratio 0.70885 level 11 saved 658 */ 23/* orig 2260 comp 1600 ratio 0.707965 level 10 saved 660 */
24const char help_text[] = { 24const char help_text[] = {
250xf1, 0x4e, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 250xf1, 0x4e, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
260x32, 0x33, 0x3a, 0x20, 0x4c, 0x6f, 0x6f, 0x70, 0x79, 0x20, 260x32, 0x33, 0x3a, 0x20, 0x4c, 0x6f, 0x6f, 0x70, 0x79, 0x20,
@@ -46,26 +46,26 @@ const char help_text[] = {
460x6f, 0x6d, 0x8c, 0x00, 0x01, 0x28, 0x00, 0x21, 0x6f, 0x74, 460x6f, 0x6d, 0x8c, 0x00, 0x01, 0x28, 0x00, 0x21, 0x6f, 0x74,
470xbb, 0x00, 0x61, 0x69, 0x6e, 0x00, 0x74, 0x68, 0x65, 0xdb, 470xbb, 0x00, 0x61, 0x69, 0x6e, 0x00, 0x74, 0x68, 0x65, 0xdb,
480x00, 0x50, 0x2e, 0x00, 0x00, 0x00, 0x53, 0x64, 0x00, 0x21, 480x00, 0x50, 0x2e, 0x00, 0x00, 0x00, 0x53, 0x64, 0x00, 0x21,
490x6f, 0x66, 0x14, 0x00, 0xd1, 0x73, 0x70, 0x61, 0x63, 0x65, 490x6f, 0x66, 0x14, 0x00, 0xd2, 0x73, 0x70, 0x61, 0x63, 0x65,
500x73, 0x00, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x27, 0x00, 500x73, 0x00, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x27, 0x00,
510x02, 0x67, 0x00, 0x00, 0xb7, 0x00, 0xf4, 0x04, 0x74, 0x61, 510x02, 0x67, 0x00, 0xf4, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61,
520x69, 0x6e, 0x00, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 520x69, 0x6e, 0x00, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73,
530x2e, 0x00, 0x54, 0x68, 0x65, 0x73, 0x65, 0x0f, 0x00, 0x06, 530x2e, 0x00, 0x54, 0x68, 0x65, 0x73, 0x65, 0x0f, 0x00, 0x06,
540xfd, 0x00, 0xb7, 0x68, 0x6f, 0x77, 0x00, 0x6d, 0x61, 0x6e, 540xfd, 0x00, 0x84, 0x68, 0x6f, 0x77, 0x00, 0x6d, 0x61, 0x6e,
550x79, 0x00, 0x6f, 0x66, 0x3e, 0x00, 0xb2, 0x61, 0x72, 0x6f, 550x79, 0x51, 0x00, 0x02, 0x3e, 0x00, 0xb2, 0x61, 0x72, 0x6f,
560x75, 0x6e, 0x64, 0x00, 0x74, 0x68, 0x61, 0x74, 0x63, 0x00, 560x75, 0x6e, 0x64, 0x00, 0x74, 0x68, 0x61, 0x74, 0x63, 0x00,
570xa3, 0x00, 0x66, 0x6f, 0x72, 0x6d, 0x00, 0x70, 0x61, 0x72, 570xa5, 0x00, 0x66, 0x6f, 0x72, 0x6d, 0x00, 0x70, 0x61, 0x72,
580x74, 0x29, 0x00, 0x01, 0xae, 0x00, 0x33, 0x2e, 0x00, 0x54, 580x74, 0x29, 0x00, 0x31, 0x6f, 0x6f, 0x70, 0x56, 0x00, 0x02,
590x0a, 0x00, 0x00, 0x3a, 0x01, 0x02, 0xd8, 0x00, 0x83, 0x6d, 590xb8, 0x00, 0x00, 0x3a, 0x01, 0x01, 0xd8, 0x00, 0x83, 0x6d,
600x75, 0x73, 0x74, 0x00, 0x63, 0x6f, 0x72, 0x2e, 0x01, 0x70, 600x75, 0x73, 0x74, 0x00, 0x63, 0x6f, 0x72, 0x2e, 0x01, 0x70,
610x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x79, 0x52, 0x01, 0x01, 610x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x79, 0x52, 0x01, 0x03,
620x3a, 0x00, 0x01, 0x86, 0x00, 0x32, 0x63, 0x6c, 0x75, 0x0a, 620x3a, 0x00, 0x62, 0x73, 0x65, 0x00, 0x63, 0x6c, 0x75, 0x0a,
630x01, 0x20, 0x62, 0x65, 0xa9, 0x00, 0x94, 0x73, 0x69, 0x64, 630x01, 0x20, 0x62, 0x65, 0xa9, 0x00, 0x94, 0x73, 0x69, 0x64,
640x65, 0x72, 0x65, 0x64, 0x00, 0x61, 0x38, 0x00, 0x90, 0x00, 640x65, 0x72, 0x65, 0x64, 0x00, 0x61, 0x38, 0x00, 0x90, 0x00,
650x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0xef, 0x00, 650x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0xef, 0x00,
660x12, 0x49, 0xd7, 0x00, 0xd0, 0x64, 0x65, 0x66, 0x61, 0x75, 660x12, 0x49, 0xd7, 0x00, 0xd2, 0x64, 0x65, 0x66, 0x61, 0x75,
670x6c, 0x74, 0x00, 0x6d, 0x6f, 0x64, 0x65, 0x2c, 0x12, 0x00, 670x6c, 0x74, 0x00, 0x6d, 0x6f, 0x64, 0x65, 0x2c, 0x12, 0x00,
680x01, 0xb2, 0x01, 0x02, 0xae, 0x01, 0x98, 0x72, 0x72, 0x61, 680x00, 0xb2, 0x01, 0x01, 0xae, 0x01, 0x98, 0x72, 0x72, 0x61,
690x6e, 0x67, 0x65, 0x64, 0x00, 0x69, 0x02, 0x02, 0x80, 0x73, 690x6e, 0x67, 0x65, 0x64, 0x00, 0x69, 0x02, 0x02, 0x80, 0x73,
700x71, 0x75, 0x61, 0x72, 0x65, 0x73, 0x3b, 0xe3, 0x00, 0x51, 700x71, 0x75, 0x61, 0x72, 0x65, 0x73, 0x3b, 0xe3, 0x00, 0x51,
710x65, 0x76, 0x65, 0x72, 0x2c, 0xa4, 0x00, 0xf1, 0x19, 0x63, 710x65, 0x76, 0x65, 0x72, 0x2c, 0xa4, 0x00, 0xf1, 0x19, 0x63,
@@ -91,10 +91,10 @@ const char help_text[] = {
910x6e, 0x68, 0x01, 0x62, 0x65, 0x6e, 0x68, 0x61, 0x6e, 0x63, 910x6e, 0x68, 0x01, 0x62, 0x65, 0x6e, 0x68, 0x61, 0x6e, 0x63,
920x3c, 0x00, 0xf0, 0x05, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 920x3c, 0x00, 0xf0, 0x05, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65,
930x00, 0x76, 0x61, 0x72, 0x69, 0x6f, 0x75, 0x73, 0x00, 0x74, 930x00, 0x76, 0x61, 0x72, 0x69, 0x6f, 0x75, 0x73, 0x00, 0x74,
940x79, 0x70, 0x65, 0x73, 0x12, 0x01, 0x41, 0x6e, 0x6f, 0x6e, 940x79, 0x70, 0x65, 0x73, 0x12, 0x01, 0x42, 0x6e, 0x6f, 0x6e,
950x2d, 0x16, 0x01, 0x02, 0x4c, 0x02, 0x00, 0x54, 0x00, 0x73, 950x2d, 0x16, 0x01, 0x02, 0x25, 0x01, 0xa3, 0x62, 0x79, 0x00,
960x4c, 0x61, 0x6d, 0x62, 0x72, 0x6f, 0x73, 0x08, 0x00, 0x41, 960x4c, 0x61, 0x6d, 0x62, 0x72, 0x6f, 0x73, 0x08, 0x00, 0x10,
970x75, 0x2e, 0x00, 0x00, 0xa6, 0x00, 0xd1, 0x00, 0x68, 0x74, 970x75, 0x9e, 0x00, 0x00, 0xa6, 0x00, 0xd1, 0x00, 0x68, 0x74,
980x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6e, 980x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6e,
990xbd, 0x00, 0xa2, 0x2e, 0x63, 0x6f, 0x2e, 0x6a, 0x70, 0x2f, 990xbd, 0x00, 0xa2, 0x2e, 0x63, 0x6f, 0x2e, 0x6a, 0x70, 0x2f,
1000x65, 0x6e, 0x2f, 0xe1, 0x00, 0x50, 0x73, 0x2f, 0x73, 0x6c, 1000x65, 0x6e, 0x2f, 0xe1, 0x00, 0x50, 0x73, 0x2f, 0x73, 0x6c,
@@ -107,82 +107,81 @@ const char help_text[] = {
1070x01, 0x00, 0x3c, 0x03, 0x60, 0x62, 0x75, 0x74, 0x74, 0x6f, 1070x01, 0x00, 0x3c, 0x03, 0x60, 0x62, 0x75, 0x74, 0x74, 0x6f,
1080x6e, 0x94, 0x01, 0x18, 0x61, 0x33, 0x03, 0x01, 0x0e, 0x01, 1080x6e, 0x94, 0x01, 0x18, 0x61, 0x33, 0x03, 0x01, 0x0e, 0x01,
1090xd4, 0x75, 0x72, 0x6e, 0x00, 0x69, 0x74, 0x00, 0x62, 0x6c, 1090xd4, 0x75, 0x72, 0x6e, 0x00, 0x69, 0x74, 0x00, 0x62, 0x6c,
1100x61, 0x63, 0x6b, 0x2c, 0xbe, 0x02, 0x31, 0x69, 0x6e, 0x67, 1100x61, 0x63, 0x6b, 0x2c, 0xbe, 0x02, 0x32, 0x69, 0x6e, 0x67,
1110xa3, 0x02, 0x01, 0xd9, 0x01, 0x00, 0x27, 0x03, 0x10, 0x6b, 1110xa3, 0x02, 0x00, 0xd9, 0x01, 0x00, 0x27, 0x03, 0x10, 0x6b,
1120x24, 0x00, 0x2e, 0x69, 0x73, 0xa8, 0x02, 0x03, 0x71, 0x00, 1120x24, 0x00, 0x2e, 0x69, 0x73, 0xa8, 0x02, 0x03, 0x71, 0x00,
1130x53, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x50, 0x00, 0x05, 0x2d, 1130x20, 0x61, 0x67, 0x13, 0x03, 0x04, 0x50, 0x00, 0x04, 0xef,
1140x03, 0x04, 0xa0, 0x03, 0x03, 0x1e, 0x00, 0x84, 0x28, 0x6d, 1140x02, 0x04, 0x6d, 0x00, 0x02, 0x1e, 0x00, 0x50, 0x28, 0x6d,
1150x65, 0x61, 0x6e, 0x69, 0x6e, 0x67, 0x0c, 0x04, 0x70, 0x6e, 1150x65, 0x61, 0x6e, 0x5a, 0x00, 0x03, 0x0c, 0x04, 0x70, 0x6e,
1160x27, 0x74, 0x00, 0x73, 0x75, 0x72, 0x26, 0x00, 0x21, 0x74, 1160x27, 0x74, 0x00, 0x73, 0x75, 0x72, 0x26, 0x00, 0x21, 0x74,
1170x29, 0x90, 0x02, 0x14, 0x66, 0x1b, 0x00, 0x01, 0x18, 0x00, 1170x29, 0x90, 0x02, 0x15, 0x66, 0x27, 0x04, 0x01, 0x18, 0x00,
1180x02, 0x82, 0x00, 0x11, 0x61, 0x74, 0x00, 0x20, 0x69, 0x63, 1180x01, 0x82, 0x00, 0x11, 0x61, 0x74, 0x00, 0x21, 0x69, 0x63,
1190x48, 0x02, 0x02, 0x55, 0x00, 0x61, 0x73, 0x65, 0x67, 0x6d, 1190x48, 0x02, 0x01, 0x55, 0x00, 0x61, 0x73, 0x65, 0x67, 0x6d,
1200x65, 0x6e, 0x8f, 0x00, 0x3d, 0x6e, 0x6f, 0x74, 0x93, 0x00, 1200x65, 0x6e, 0x8f, 0x00, 0x3d, 0x6e, 0x6f, 0x74, 0x93, 0x00,
1210x06, 0x8e, 0x02, 0x15, 0x63, 0x0c, 0x01, 0x49, 0x72, 0x69, 1210x06, 0x8e, 0x02, 0x15, 0x63, 0x0c, 0x01, 0x4b, 0x72, 0x69,
1220x67, 0x68, 0x0d, 0x01, 0x01, 0xac, 0x00, 0x80, 0x72, 0x65, 1220x67, 0x68, 0x0d, 0x01, 0xb0, 0x74, 0x6f, 0x00, 0x72, 0x65,
1230x6d, 0x6f, 0x76, 0x65, 0x00, 0x69, 0x56, 0x03, 0xb0, 0x6d, 1230x6d, 0x6f, 0x76, 0x65, 0x00, 0x69, 0x56, 0x03, 0xb0, 0x6d,
1240x70, 0x6c, 0x65, 0x74, 0x65, 0x6c, 0x79, 0x2e, 0x00, 0x41, 1240x70, 0x6c, 0x65, 0x74, 0x65, 0x6c, 0x79, 0x2e, 0x00, 0x41,
1250xad, 0x00, 0x12, 0x2c, 0x3d, 0x00, 0x30, 0x69, 0x6e, 0x67, 1250xad, 0x00, 0x12, 0x2c, 0x3d, 0x00, 0x00, 0xae, 0x00, 0x60,
1260x4f, 0x04, 0x30, 0x65, 0x63, 0x6f, 0xb4, 0x03, 0x8b, 0x69, 1260x61, 0x00, 0x73, 0x65, 0x63, 0x6f, 0xb4, 0x03, 0x8b, 0x69,
1270x6d, 0x65, 0x00, 0x77, 0x69, 0x6c, 0x6c, 0xe5, 0x00, 0x20, 1270x6d, 0x65, 0x00, 0x77, 0x69, 0x6c, 0x6c, 0xe5, 0x00, 0x20,
1280x62, 0x61, 0x66, 0x00, 0x13, 0x6f, 0xed, 0x00, 0x00, 0xc9, 1280x62, 0x61, 0x66, 0x00, 0x13, 0x6f, 0xed, 0x00, 0x00, 0xc9,
1290x00, 0x41, 0x28, 0x41, 0x6c, 0x6c, 0x20, 0x00, 0x11, 0x61, 1290x00, 0x41, 0x28, 0x41, 0x6c, 0x6c, 0x20, 0x00, 0x11, 0x61,
1300x63, 0x02, 0x92, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 1300x63, 0x02, 0x92, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72,
1310x69, 0x62, 0x49, 0x03, 0x13, 0x73, 0x79, 0x02, 0x30, 0x32, 1310x69, 0x62, 0x49, 0x03, 0x13, 0x73, 0x79, 0x02, 0x33, 0x32,
1320x2e, 0x31, 0xec, 0x00, 0x02, 0x35, 0x03, 0xa3, 0x61, 0x76, 1320x2e, 0x31, 0x13, 0x05, 0xd3, 0x73, 0x6f, 0x00, 0x61, 0x76,
1330x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0xdd, 0x01, 1330x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0xdd, 0x01,
1340x13, 0x32, 0xdd, 0x01, 0x90, 0x70, 0x61, 0x72, 0x61, 0x6d, 1340x13, 0x32, 0xdd, 0x01, 0x91, 0x70, 0x61, 0x72, 0x61, 0x6d,
1350x65, 0x74, 0x65, 0x72, 0xdf, 0x01, 0x03, 0x6c, 0x04, 0x05, 1350x65, 0x74, 0x65, 0x72, 0xdf, 0x01, 0x02, 0x6c, 0x04, 0x06,
1360x14, 0x00, 0x01, 0xa6, 0x03, 0x06, 0x3c, 0x00, 0x01, 0xe4, 1360x14, 0x00, 0x02, 0x41, 0x00, 0x04, 0x3c, 0x00, 0x02, 0xe4,
1370x04, 0x01, 0x79, 0x00, 0xe1, 0x60, 0x43, 0x75, 0x73, 0x74, 1370x04, 0x00, 0x79, 0x00, 0xe1, 0x60, 0x43, 0x75, 0x73, 0x74,
1380x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x6f, 1380x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x6f,
1390x00, 0x22, 0x6f, 0x6e, 0x1a, 0x00, 0x91, 0x54, 0x79, 0x70, 1390x00, 0x22, 0x6f, 0x6e, 0x1a, 0x00, 0x91, 0x54, 0x79, 0x70,
1400x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x94, 0x02, 0x90, 0x57, 1400x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x94, 0x02, 0x91, 0x57,
1410x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 0x48, 0x65, 0x22, 0x01, 1410x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 0x48, 0x65, 0x22, 0x01,
1420x00, 0x03, 0x05, 0x20, 0x69, 0x7a, 0x68, 0x02, 0x01, 0xc7, 1420x51, 0x00, 0x00, 0x53, 0x69, 0x7a, 0x68, 0x02, 0x00, 0xc7,
1430x02, 0x70, 0x2c, 0x00, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x41, 1430x02, 0x70, 0x2c, 0x00, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x41,
1440x04, 0x05, 0xf0, 0x04, 0x00, 0x1c, 0x00, 0x31, 0x72, 0x65, 1440x04, 0x05, 0xf0, 0x04, 0x00, 0x1c, 0x00, 0x31, 0x72, 0x65,
1450x67, 0xd6, 0x00, 0x61, 0x61, 0x63, 0x72, 0x6f, 0x73, 0x73, 1450x67, 0xd6, 0x00, 0x61, 0x61, 0x63, 0x72, 0x6f, 0x73, 0x73,
1460x32, 0x03, 0x93, 0x64, 0x6f, 0x77, 0x6e, 0x2e, 0x00, 0x46, 1460x32, 0x03, 0x93, 0x64, 0x6f, 0x77, 0x6e, 0x2e, 0x00, 0x46,
1470x6f, 0x72, 0x1d, 0x04, 0x04, 0xe5, 0x03, 0xa0, 0x69, 0x74, 1470x6f, 0x72, 0x1d, 0x04, 0x04, 0xe5, 0x03, 0xa1, 0x69, 0x74,
1480x27, 0x73, 0x00, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x2d, 0x04, 1480x27, 0x73, 0x00, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x10, 0x05,
1490x02, 0x7c, 0x03, 0x01, 0x7f, 0x03, 0x61, 0x75, 0x6e, 0x74, 1490x01, 0x7c, 0x03, 0x01, 0x7f, 0x03, 0x61, 0x75, 0x6e, 0x74,
1500x65, 0x64, 0x3b, 0xe2, 0x03, 0x10, 0x6f, 0xed, 0x02, 0x02, 1500x65, 0x64, 0x3b, 0xe2, 0x03, 0x10, 0x6f, 0xed, 0x02, 0x06,
1510x4c, 0x03, 0x04, 0x7a, 0x00, 0x01, 0xc3, 0x01, 0x70, 0x6d, 1510x4c, 0x03, 0x01, 0x41, 0x03, 0x00, 0xc3, 0x01, 0x72, 0x6d,
1520x61, 0x79, 0x00, 0x68, 0x61, 0x76, 0xa7, 0x02, 0x03, 0x84, 1520x61, 0x79, 0x00, 0x68, 0x61, 0x76, 0xa7, 0x02, 0x01, 0x84,
1530x02, 0x41, 0x61, 0x00, 0x62, 0x69, 0xc0, 0x05, 0x21, 0x73, 1530x02, 0x41, 0x61, 0x00, 0x62, 0x69, 0xc0, 0x05, 0x22, 0x73,
1540x65, 0x60, 0x05, 0x02, 0xad, 0x04, 0x52, 0x69, 0x6d, 0x65, 1540x65, 0x60, 0x05, 0x01, 0xad, 0x04, 0x52, 0x69, 0x6d, 0x65,
1550x6e, 0x73, 0x91, 0x00, 0x24, 0x72, 0x65, 0xb3, 0x00, 0x01, 1550x6e, 0x73, 0x91, 0x00, 0x25, 0x72, 0x65, 0xb3, 0x00, 0x00,
1560xd0, 0x05, 0x50, 0x47, 0x72, 0x69, 0x64, 0x20, 0x59, 0x00, 1560xdd, 0x00, 0x50, 0x47, 0x72, 0x69, 0x64, 0x20, 0x59, 0x00,
1570x40, 0x00, 0x00, 0x00, 0x41, 0x9d, 0x01, 0x01, 0x88, 0x06, 1570x40, 0x00, 0x00, 0x00, 0x41, 0x9d, 0x01, 0x02, 0x88, 0x06,
1580x01, 0x7c, 0x06, 0x54, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0xde, 1580x00, 0x7c, 0x06, 0x20, 0x68, 0x6f, 0x40, 0x06, 0x04, 0xde,
1590x05, 0x01, 0xe4, 0x01, 0x04, 0x10, 0x04, 0x26, 0x6f, 0x66, 1590x05, 0x00, 0xe4, 0x01, 0x04, 0x10, 0x04, 0x26, 0x6f, 0x66,
1600x8c, 0x00, 0x71, 0x74, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x2e, 1600x8c, 0x00, 0x72, 0x74, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x2e,
1610x19, 0x06, 0x02, 0x8c, 0x00, 0x13, 0x61, 0xda, 0x01, 0x10, 1610x19, 0x06, 0x01, 0x8c, 0x00, 0x13, 0x61, 0xda, 0x01, 0x11,
1620x66, 0x1e, 0x06, 0x02, 0x29, 0x06, 0x21, 0x61, 0x6d, 0x55, 1620x66, 0x1e, 0x06, 0x01, 0x29, 0x06, 0x21, 0x61, 0x6d, 0x55,
1630x02, 0x06, 0xb0, 0x00, 0x70, 0x6d, 0x75, 0x6c, 0x74, 0x69, 1630x02, 0x06, 0xb0, 0x00, 0x70, 0x6d, 0x75, 0x6c, 0x74, 0x69,
1640x70, 0x6c, 0x9b, 0x00, 0x76, 0x66, 0x66, 0x65, 0x72, 0x65, 1640x70, 0x6c, 0x9b, 0x00, 0x40, 0x66, 0x66, 0x65, 0x72, 0xac,
1650x6e, 0x74, 0x52, 0x00, 0xc1, 0x76, 0x65, 0x72, 0x74, 0x65, 1650x02, 0x05, 0x52, 0x00, 0xc1, 0x76, 0x65, 0x72, 0x74, 0x65,
1660x78, 0x00, 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x3f, 0x00, 0x50, 1660x78, 0x00, 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x3f, 0x00, 0x50,
1670x43, 0x61, 0x69, 0x72, 0x6f, 0x0d, 0x05, 0x51, 0x4b, 0x69, 1670x43, 0x61, 0x69, 0x72, 0x6f, 0x0d, 0x05, 0x51, 0x4b, 0x69,
1680x74, 0x65, 0x73, 0x85, 0x05, 0x22, 0x29, 0x3b, 0x14, 0x01, 1680x74, 0x65, 0x73, 0x85, 0x05, 0x22, 0x29, 0x3b, 0x14, 0x01,
1690x19, 0x73, 0x73, 0x00, 0x01, 0x3b, 0x00, 0x1f, 0x69, 0x76, 1690x1a, 0x73, 0x73, 0x00, 0x00, 0x3b, 0x00, 0x1f, 0x69, 0x76,
1700x00, 0x07, 0x0e, 0x6d, 0x00, 0x01, 0xa5, 0x00, 0x07, 0x6b, 1700x00, 0x07, 0x0e, 0x6d, 0x00, 0x01, 0xa5, 0x00, 0x07, 0x6b,
1710x00, 0x74, 0x47, 0x72, 0x65, 0x61, 0x74, 0x20, 0x48, 0x89, 1710x00, 0x74, 0x47, 0x72, 0x65, 0x61, 0x74, 0x20, 0x48, 0x89,
1720x05, 0x11, 0x29, 0x65, 0x06, 0x03, 0xb1, 0x01, 0x17, 0x2c, 1720x05, 0x12, 0x29, 0x65, 0x06, 0x02, 0xb1, 0x01, 0x18, 0x2c,
1730xaf, 0x05, 0x01, 0xd2, 0x01, 0x91, 0x68, 0x6f, 0x6e, 0x65, 1730xaf, 0x05, 0x00, 0xd2, 0x01, 0x92, 0x68, 0x6f, 0x6e, 0x65,
1740x79, 0x63, 0x6f, 0x6d, 0x62, 0x91, 0x01, 0x02, 0x5c, 0x01, 1740x79, 0x63, 0x6f, 0x6d, 0x62, 0xcb, 0x01, 0x01, 0x5c, 0x01,
1750x20, 0x66, 0x75, 0x50, 0x05, 0x21, 0x72, 0x65, 0x26, 0x00, 1750x20, 0x66, 0x75, 0x50, 0x05, 0x21, 0x72, 0x65, 0x26, 0x00,
1760x01, 0x2b, 0x05, 0x09, 0xa2, 0x00, 0x24, 0x69, 0x72, 0xa4, 1760x02, 0x2b, 0x05, 0x08, 0xa2, 0x00, 0x26, 0x69, 0x72, 0xa4,
1770x00, 0x01, 0x15, 0x02, 0x0b, 0x24, 0x01, 0x12, 0x3b, 0xfe, 1770x00, 0x00, 0x1c, 0x00, 0x0a, 0x24, 0x01, 0x12, 0x3b, 0xfe,
1780x01, 0x32, 0x6d, 0x61, 0x6b, 0x15, 0x00, 0x13, 0x6d, 0xa6, 1780x01, 0x32, 0x6d, 0x61, 0x6b, 0x15, 0x00, 0x13, 0x6d, 0xa6,
1790x04, 0x11, 0x61, 0xd6, 0x06, 0x41, 0x6e, 0x66, 0x75, 0x73, 1790x04, 0x11, 0x61, 0xd6, 0x06, 0x41, 0x6e, 0x66, 0x75, 0x73,
1800x76, 0x04, 0x02, 0x40, 0x06, 0x00, 0xbe, 0x01, 0x40, 0x44, 1800x76, 0x04, 0x02, 0x40, 0x06, 0x00, 0xbe, 0x01, 0x40, 0x44,
1810x69, 0x66, 0x66, 0xf8, 0x03, 0x20, 0x74, 0x79, 0xd8, 0x04, 1810x69, 0x66, 0x66, 0xf8, 0x03, 0x20, 0x74, 0x79, 0xd8, 0x04,
1820x03, 0xe4, 0x04, 0x02, 0xf3, 0x01, 0x04, 0x1a, 0x00, 0x05, 1820x03, 0xe4, 0x04, 0x03, 0xf3, 0x01, 0x05, 0x1a, 0x00, 0x03,
1830x5d, 0x07, 0xf0, 0x03, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 1830xf9, 0x03, 0x60, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0xe2,
1840x74, 0x65, 0x64, 0x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 1840x05, 0x80, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x2e, 0x00,
1850x2e, 0x00,
186}; 185};
187 186
188const unsigned short help_text_len = 2260; 187const unsigned short help_text_len = 2260;
diff --git a/apps/plugins/puzzles/help/magnets.c b/apps/plugins/puzzles/help/magnets.c
index eed84c78b6..becfe20902 100644
--- a/apps/plugins/puzzles/help/magnets.c
+++ b/apps/plugins/puzzles/help/magnets.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -17,7 +17,7 @@ struct style_text help_text_style[] = {
17 LAST_STYLE_ITEM 17 LAST_STYLE_ITEM
18}; 18};
19 19
20/* orig 2502 comp 1650 ratio 0.659472 level 11 saved 852 */ 20/* orig 2502 comp 1653 ratio 0.660671 level 10 saved 849 */
21const char help_text[] = { 21const char help_text[] = {
220xf2, 0x3e, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 220xf2, 0x3e, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
230x33, 0x33, 0x3a, 0x20, 0x4d, 0x61, 0x67, 0x6e, 0x65, 0x74, 230x33, 0x33, 0x3a, 0x20, 0x4d, 0x61, 0x67, 0x6e, 0x65, 0x74,
@@ -32,56 +32,56 @@ const char help_text[] = {
320x65, 0x73, 0x2d, 0x00, 0xf1, 0x05, 0x6f, 0x6e, 0x65, 0x00, 320x65, 0x73, 0x2d, 0x00, 0xf1, 0x05, 0x6f, 0x6e, 0x65, 0x00,
330x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x00, 0x65, 330x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x00, 0x65,
340x6e, 0x64, 0x00, 0x61, 0x6e, 0x64, 0x15, 0x00, 0x44, 0x6e, 340x6e, 0x64, 0x00, 0x61, 0x6e, 0x64, 0x15, 0x00, 0x44, 0x6e,
350x65, 0x67, 0x61, 0x15, 0x00, 0x11, 0x29, 0x16, 0x00, 0x54, 350x65, 0x67, 0x61, 0x15, 0x00, 0x11, 0x29, 0x16, 0x00, 0x56,
360x62, 0x6c, 0x61, 0x6e, 0x6b, 0x3f, 0x00, 0x0f, 0x52, 0x00, 360x62, 0x6c, 0x61, 0x6e, 0x6b, 0x3f, 0x00, 0x0f, 0x52, 0x00,
370x07, 0xf6, 0x0a, 0x74, 0x77, 0x6f, 0x00, 0x6e, 0x65, 0x75, 370x05, 0xf6, 0x0a, 0x74, 0x77, 0x6f, 0x00, 0x6e, 0x65, 0x75,
380x74, 0x72, 0x61, 0x6c, 0x00, 0x70, 0x6f, 0x6c, 0x65, 0x73, 380x74, 0x72, 0x61, 0x6c, 0x00, 0x70, 0x6f, 0x6c, 0x65, 0x73,
390x29, 0x2e, 0x00, 0x54, 0x68, 0x65, 0x73, 0x65, 0x28, 0x00, 390x29, 0x2e, 0x00, 0x54, 0x68, 0x65, 0x73, 0x65, 0x28, 0x00,
400xf0, 0x05, 0x61, 0x72, 0x65, 0x00, 0x69, 0x6e, 0x69, 0x74, 400xf0, 0x05, 0x61, 0x72, 0x65, 0x00, 0x69, 0x6e, 0x69, 0x74,
410x69, 0x61, 0x6c, 0x6c, 0x79, 0x00, 0x6f, 0x6e, 0x6c, 0x79, 410x69, 0x61, 0x6c, 0x6c, 0x79, 0x00, 0x6f, 0x6e, 0x6c, 0x79,
420x00, 0x73, 0xc6, 0x00, 0xf1, 0x0a, 0x69, 0x6e, 0x00, 0x73, 420x00, 0x73, 0xc6, 0x00, 0xf2, 0x0a, 0x69, 0x6e, 0x00, 0x73,
430x69, 0x6c, 0x68, 0x6f, 0x75, 0x65, 0x74, 0x74, 0x65, 0x2e, 430x69, 0x6c, 0x68, 0x6f, 0x75, 0x65, 0x74, 0x74, 0x65, 0x2e,
440x00, 0x41, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x00, 0x74, 0x68, 440x00, 0x41, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x00, 0x74, 0x68,
450x65, 0xee, 0x00, 0x01, 0x37, 0x00, 0xf0, 0x00, 0x70, 0x6c, 450x65, 0xee, 0x00, 0x00, 0x37, 0x00, 0xf0, 0x00, 0x70, 0x6c,
460x61, 0x63, 0x65, 0x64, 0x00, 0x61, 0x00, 0x6e, 0x75, 0x6d, 460x61, 0x63, 0x65, 0x64, 0x00, 0x61, 0x00, 0x6e, 0x75, 0x6d,
470x62, 0x65, 0x72, 0xe3, 0x00, 0xf0, 0x01, 0x63, 0x6c, 0x75, 470x62, 0x65, 0x72, 0xe3, 0x00, 0xf1, 0x01, 0x63, 0x6c, 0x75,
480x65, 0x73, 0x00, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 480x65, 0x73, 0x00, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74,
490x69, 0x6e, 0x67, 0x31, 0x00, 0x06, 0x1f, 0x00, 0x05, 0xde, 490x69, 0x6e, 0x67, 0x31, 0x00, 0x06, 0x1f, 0x00, 0x05, 0xde,
500x00, 0x00, 0xc4, 0x00, 0x05, 0xd6, 0x00, 0x02, 0x9a, 0x00, 500x00, 0x00, 0xc4, 0x00, 0x05, 0xd6, 0x00, 0x01, 0x9a, 0x00,
510xa0, 0x00, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 510xa0, 0x00, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
520x64, 0x7b, 0x00, 0x50, 0x63, 0x65, 0x72, 0x74, 0x61, 0x08, 520x64, 0x7b, 0x00, 0x50, 0x63, 0x65, 0x72, 0x74, 0x61, 0x08,
530x00, 0x61, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x30, 0x00, 530x00, 0x61, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x30, 0x00,
540xf0, 0x0b, 0x72, 0x6f, 0x77, 0x73, 0x2e, 0x00, 0x00, 0x00, 540xf0, 0x0b, 0x72, 0x6f, 0x77, 0x73, 0x2e, 0x00, 0x00, 0x00,
550x59, 0x6f, 0x75, 0x72, 0x00, 0x61, 0x69, 0x6d, 0x00, 0x69, 550x59, 0x6f, 0x75, 0x72, 0x00, 0x61, 0x69, 0x6d, 0x00, 0x69,
560x73, 0x00, 0x74, 0x6f, 0x00, 0x63, 0x6f, 0x72, 0x8c, 0x01, 560x73, 0x00, 0x74, 0x6f, 0x00, 0x63, 0x6f, 0x72, 0x8c, 0x01,
570x22, 0x6c, 0x79, 0x90, 0x00, 0x00, 0x72, 0x00, 0x04, 0x6a, 570x22, 0x6c, 0x79, 0x90, 0x00, 0x01, 0x72, 0x00, 0x04, 0x6a,
580x01, 0x0f, 0x2b, 0x01, 0x01, 0x51, 0x73, 0x75, 0x63, 0x68, 580x01, 0x0f, 0x2b, 0x01, 0x00, 0x51, 0x73, 0x75, 0x63, 0x68,
590x00, 0x2f, 0x01, 0x30, 0x61, 0x6c, 0x6c, 0x2d, 0x00, 0x00, 590x00, 0x2f, 0x01, 0x31, 0x61, 0x6c, 0x6c, 0x2d, 0x00, 0x02,
600xb4, 0x00, 0x03, 0x08, 0x01, 0xa1, 0x73, 0x61, 0x74, 0x69, 600xb4, 0x00, 0x00, 0xd1, 0x00, 0xa3, 0x73, 0x61, 0x74, 0x69,
610x73, 0x66, 0x69, 0x65, 0x64, 0x2c, 0x3f, 0x01, 0x01, 0x1e, 610x73, 0x66, 0x69, 0x65, 0x64, 0x2c, 0x3f, 0x01, 0xd0, 0x68,
620x00, 0xa0, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 620x65, 0x00, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,
630x61, 0x6c, 0xa2, 0x00, 0x72, 0x73, 0x74, 0x72, 0x61, 0x69, 630x61, 0x6c, 0xa2, 0x00, 0x72, 0x73, 0x74, 0x72, 0x61, 0x69,
640x6e, 0x74, 0x41, 0x00, 0x21, 0x6e, 0x6f, 0x61, 0x01, 0x73, 640x6e, 0x74, 0x41, 0x00, 0x21, 0x6e, 0x6f, 0x61, 0x01, 0x40,
650x73, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72, 0x75, 0x00, 0x23, 650x73, 0x69, 0x6d, 0x69, 0x06, 0x02, 0x02, 0x75, 0x00, 0x23,
660x69, 0x63, 0xd0, 0x00, 0xf1, 0x00, 0x6d, 0x61, 0x79, 0x00, 660x69, 0x63, 0xd0, 0x00, 0xf1, 0x00, 0x6d, 0x61, 0x79, 0x00,
670x62, 0x65, 0x00, 0x6f, 0x72, 0x74, 0x68, 0x6f, 0x67, 0x6f, 670x62, 0x65, 0x00, 0x6f, 0x72, 0x74, 0x68, 0x6f, 0x67, 0x6f,
680x6e, 0x5f, 0x01, 0xd2, 0x61, 0x64, 0x6a, 0x61, 0x63, 0x65, 680x6e, 0x5f, 0x01, 0xd2, 0x61, 0x64, 0x6a, 0x61, 0x63, 0x65,
690x6e, 0x74, 0x00, 0x28, 0x73, 0x69, 0x6e, 0xac, 0x00, 0xb8, 690x6e, 0x74, 0x00, 0x28, 0x73, 0x69, 0x6e, 0xac, 0x00, 0xb8,
700x79, 0x00, 0x72, 0x65, 0x70, 0x65, 0x6c, 0x29, 0x2e, 0x00, 700x79, 0x00, 0x72, 0x65, 0x70, 0x65, 0x6c, 0x29, 0x2e, 0x00,
710x4e, 0xa9, 0x01, 0x72, 0x00, 0x64, 0x6f, 0x00, 0x6e, 0x6f, 710x4e, 0xa9, 0x01, 0x72, 0x00, 0x64, 0x6f, 0x00, 0x6e, 0x6f,
720x74, 0x1d, 0x00, 0x11, 0x2c, 0xc9, 0x00, 0x65, 0x63, 0x61, 720x74, 0x1d, 0x00, 0x11, 0x2c, 0xc9, 0x00, 0x30, 0x63, 0x61,
730x6e, 0x00, 0x62, 0x65, 0x44, 0x00, 0x00, 0xfc, 0x00, 0x91, 730x6e, 0x51, 0x00, 0x05, 0x44, 0x00, 0xc1, 0x74, 0x6f, 0x00,
740x61, 0x6e, 0x79, 0x00, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x35, 740x61, 0x6e, 0x79, 0x00, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x35,
750x00, 0x00, 0x1d, 0x01, 0xf1, 0x0b, 0x43, 0x72, 0x65, 0x64, 750x00, 0x00, 0x1d, 0x01, 0xf1, 0x0b, 0x43, 0x72, 0x65, 0x64,
760x69, 0x74, 0x00, 0x66, 0x6f, 0x72, 0x00, 0x74, 0x68, 0x69, 760x69, 0x74, 0x00, 0x66, 0x6f, 0x72, 0x00, 0x74, 0x68, 0x69,
770x73, 0x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x00, 0x67, 770x73, 0x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x00, 0x67,
780x6f, 0x65, 0x2d, 0x01, 0xa0, 0x4a, 0x61, 0x6e, 0x6b, 0x6f, 780x6f, 0x65, 0x2d, 0x01, 0xa0, 0x4a, 0x61, 0x6e, 0x6b, 0x6f,
790x00, 0x5b, 0x31, 0x36, 0x5d, 0x2d, 0x00, 0x13, 0x4d, 0x27, 790x00, 0x5b, 0x31, 0x36, 0x5d, 0x2d, 0x00, 0x13, 0x4d, 0x27,
800x01, 0x22, 0x77, 0x61, 0x7f, 0x01, 0xa1, 0x72, 0x69, 0x62, 800x01, 0x22, 0x77, 0x61, 0x7f, 0x01, 0x70, 0x72, 0x69, 0x62,
810x75, 0x74, 0x65, 0x64, 0x00, 0x74, 0x6f, 0x3d, 0x00, 0x00, 810x75, 0x74, 0x65, 0x64, 0x29, 0x00, 0x01, 0x3d, 0x00, 0x60,
820x7e, 0x01, 0x30, 0x6c, 0x65, 0x63, 0xfe, 0x00, 0xf1, 0x04, 820x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0xfe, 0x00, 0xf0, 0x01,
830x00, 0x62, 0x79, 0x00, 0x4a, 0x61, 0x6d, 0x65, 0x73, 0x00, 830x00, 0x62, 0x79, 0x00, 0x4a, 0x61, 0x6d, 0x65, 0x73, 0x00,
840x48, 0x61, 0x72, 0x76, 0x65, 0x79, 0x2e, 0x00, 0x00, 0x46, 840x48, 0x61, 0x72, 0x76, 0x65, 0x79, 0x3e, 0x00, 0x00, 0x46,
850x00, 0xd0, 0x00, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 850x00, 0xd0, 0x00, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f,
860x77, 0x77, 0x77, 0x2e, 0x6a, 0x5c, 0x00, 0xc2, 0x2e, 0x61, 860x77, 0x77, 0x77, 0x2e, 0x6a, 0x5c, 0x00, 0xc2, 0x2e, 0x61,
870x74, 0x2f, 0x52, 0x61, 0x65, 0x74, 0x73, 0x65, 0x6c, 0x2f, 870x74, 0x2f, 0x52, 0x61, 0x65, 0x74, 0x73, 0x65, 0x6c, 0x2f,
@@ -89,25 +89,25 @@ const char help_text[] = {
890x78, 0x2e, 0x68, 0x74, 0x6d, 0x00, 0x00, 0x00, 0x33, 0x33, 890x78, 0x2e, 0x68, 0x74, 0x6d, 0x00, 0x00, 0x00, 0x33, 0x33,
900x2e, 0x31, 0x49, 0x03, 0x01, 0x74, 0x00, 0x21, 0x6f, 0x6c, 900x2e, 0x31, 0x49, 0x03, 0x01, 0x74, 0x00, 0x21, 0x6f, 0x6c,
910x52, 0x03, 0xa0, 0x4c, 0x65, 0x66, 0x74, 0x2d, 0x63, 0x6c, 910x52, 0x03, 0xa0, 0x4c, 0x65, 0x66, 0x74, 0x2d, 0x63, 0x6c,
920x69, 0x63, 0x6b, 0x37, 0x02, 0xf4, 0x00, 0x6f, 0x6e, 0x00, 920x69, 0x63, 0x6b, 0x37, 0x02, 0xf5, 0x00, 0x6f, 0x6e, 0x00,
930x61, 0x6e, 0x00, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x00, 0x73, 930x61, 0x6e, 0x00, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x00, 0x73,
940x71, 0x75, 0x6e, 0x02, 0x00, 0xa8, 0x01, 0x03, 0x68, 0x01, 940x71, 0x75, 0x6e, 0x02, 0x33, 0x73, 0x00, 0x61, 0x68, 0x01,
950x22, 0x00, 0x61, 0x86, 0x01, 0x03, 0x54, 0x02, 0x24, 0x6f, 950x23, 0x00, 0x61, 0x86, 0x01, 0x02, 0x54, 0x02, 0x26, 0x6f,
960x6e, 0xb3, 0x01, 0x02, 0x44, 0x03, 0x05, 0x59, 0x02, 0x30, 960x6e, 0xb3, 0x01, 0x05, 0x66, 0x02, 0x00, 0x15, 0x01, 0x00,
970x00, 0x6f, 0x6e, 0x15, 0x00, 0x04, 0x46, 0x00, 0x11, 0x61, 970x4b, 0x00, 0x00, 0x15, 0x00, 0x03, 0x46, 0x00, 0x13, 0x61,
980xc5, 0x02, 0x02, 0x53, 0x03, 0x0c, 0x24, 0x00, 0x03, 0x4b, 980xc5, 0x02, 0x09, 0x7d, 0x02, 0x04, 0x24, 0x00, 0x02, 0x4b,
990x01, 0x77, 0x68, 0x61, 0x6c, 0x66, 0x00, 0x6f, 0x66, 0x49, 990x01, 0x40, 0x68, 0x61, 0x6c, 0x66, 0xad, 0x02, 0x06, 0x49,
1000x02, 0x39, 0x3b, 0x00, 0x6c, 0x9e, 0x00, 0x20, 0x61, 0x67, 1000x02, 0x39, 0x3b, 0x00, 0x6c, 0x9e, 0x00, 0x20, 0x61, 0x67,
1010x9c, 0x02, 0x83, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 1010x9c, 0x02, 0x83, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65,
1020x73, 0x74, 0x00, 0x62, 0x6c, 0x61, 0x72, 0x69, 0x74, 0x79, 1020x73, 0x74, 0x00, 0x62, 0x6c, 0x61, 0x72, 0x69, 0x74, 0x79,
1030xab, 0x01, 0x10, 0x61, 0x40, 0x01, 0x31, 0x72, 0x64, 0x00, 1030xab, 0x01, 0x10, 0x61, 0x40, 0x01, 0x31, 0x72, 0x64, 0x00,
1040x32, 0x00, 0x87, 0x00, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 1040x32, 0x00, 0x87, 0x00, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65,
1050x73, 0x51, 0x00, 0x00, 0x3f, 0x01, 0x4f, 0x52, 0x69, 0x67, 1050x73, 0x51, 0x00, 0x00, 0x3f, 0x01, 0x4f, 0x52, 0x69, 0x67,
1060x68, 0xf2, 0x00, 0x13, 0x09, 0xc3, 0x02, 0x10, 0x00, 0xa4, 1060x68, 0xf2, 0x00, 0x14, 0x08, 0xc3, 0x02, 0x10, 0x00, 0xa4,
1070x00, 0x21, 0x65, 0x2e, 0x3f, 0x00, 0x0c, 0x93, 0x00, 0x03, 1070x00, 0x2c, 0x65, 0x2e, 0x3f, 0x00, 0x02, 0x93, 0x00, 0x03,
1080x32, 0x00, 0x01, 0x96, 0x02, 0x41, 0x71, 0x75, 0x65, 0x73, 1080x32, 0x00, 0x00, 0x96, 0x02, 0x41, 0x71, 0x75, 0x65, 0x73,
1090x17, 0x01, 0x52, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0xe2, 0x00, 1090x17, 0x01, 0x54, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0xe2, 0x00,
1100x04, 0xf7, 0x03, 0x90, 0x2c, 0x00, 0x73, 0x69, 0x67, 0x6e, 1100x02, 0x44, 0x00, 0x90, 0x2c, 0x00, 0x73, 0x69, 0x67, 0x6e,
1110x69, 0x66, 0x79, 0x3a, 0x00, 0x12, 0x60, 0xeb, 0x01, 0x20, 1110x69, 0x66, 0x79, 0x3a, 0x00, 0x12, 0x60, 0xeb, 0x01, 0x20,
1120x61, 0x6e, 0x6f, 0x02, 0x22, 0x62, 0x65, 0x6d, 0x00, 0x84, 1120x61, 0x6e, 0x6f, 0x02, 0x22, 0x62, 0x65, 0x6d, 0x00, 0x84,
1130x27, 0x00, 0x28, 0x77, 0x68, 0x69, 0x63, 0x68, 0x75, 0x02, 1130x27, 0x00, 0x28, 0x77, 0x68, 0x69, 0x63, 0x68, 0x75, 0x02,
@@ -117,9 +117,9 @@ const char help_text[] = {
1170x73, 0x6f, 0x6c, 0x76, 0x69, 0x6e, 0x67, 0x29, 0x2c, 0xaa, 1170x73, 0x6f, 0x6c, 0x76, 0x69, 0x6e, 0x67, 0x29, 0x2c, 0xaa,
1180x03, 0x0e, 0x9c, 0x00, 0x02, 0xdb, 0x00, 0x37, 0x69, 0x65, 1180x03, 0x0e, 0x9c, 0x00, 0x02, 0xdb, 0x00, 0x37, 0x69, 0x65,
1190x73, 0x87, 0x00, 0x1d, 0x2e, 0xf7, 0x01, 0x11, 0x61, 0x8d, 1190x73, 0x87, 0x00, 0x1d, 0x2e, 0xf7, 0x01, 0x11, 0x61, 0x8d,
1200x03, 0x51, 0x00, 0x77, 0x69, 0x6c, 0x6c, 0xb8, 0x00, 0x80, 1200x03, 0x51, 0x00, 0x77, 0x69, 0x6c, 0x6c, 0xb8, 0x00, 0x50,
1210x00, 0x69, 0x74, 0x00, 0x61, 0x73, 0x00, 0x64, 0x05, 0x05, 1210x00, 0x69, 0x74, 0x00, 0x61, 0x0c, 0x03, 0x80, 0x6e, 0x65,
1220x50, 0x28, 0x67, 0x72, 0x65, 0x79, 0x11, 0x00, 0xb4, 0x6f, 1220x00, 0x28, 0x67, 0x72, 0x65, 0x79, 0x11, 0x00, 0xb4, 0x6f,
1230x75, 0x74, 0x29, 0x2c, 0x00, 0x6f, 0x72, 0x00, 0x75, 0x6e, 1230x75, 0x74, 0x29, 0x2c, 0x00, 0x6f, 0x72, 0x00, 0x75, 0x6e,
1240x24, 0x00, 0x21, 0x69, 0x66, 0x06, 0x00, 0x91, 0x73, 0x00, 1240x24, 0x00, 0x21, 0x69, 0x66, 0x06, 0x00, 0x91, 0x73, 0x00,
1250x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x3d, 0x00, 0x23, 1250x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x3d, 0x00, 0x23,
@@ -129,61 +129,62 @@ const char help_text[] = {
1290x6d, 0x6f, 0x93, 0x04, 0x04, 0x16, 0x00, 0x1a, 0x61, 0xeb, 1290x6d, 0x6f, 0x93, 0x04, 0x04, 0x16, 0x00, 0x1a, 0x61, 0xeb,
1300x04, 0x74, 0x2e, 0x00, 0x50, 0x72, 0x65, 0x73, 0x73, 0xcd, 1300x04, 0x74, 0x2e, 0x00, 0x50, 0x72, 0x65, 0x73, 0x73, 0xcd,
1310x04, 0x60, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x00, 1310x04, 0x60, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x00,
1320x02, 0xa7, 0x00, 0x53, 0x6c, 0x61, 0x79, 0x00, 0x61, 0xd1, 1320x02, 0xa7, 0x00, 0x54, 0x6c, 0x61, 0x79, 0x00, 0x61, 0x9c,
1330x00, 0x03, 0xf4, 0x05, 0x0a, 0x81, 0x02, 0x0d, 0xa9, 0x02, 1330x01, 0x03, 0xf4, 0x05, 0x0a, 0x81, 0x02, 0x0c, 0xa9, 0x02,
1340x30, 0x3b, 0x00, 0x70, 0x51, 0x00, 0x0f, 0x49, 0x02, 0x0c, 1340x34, 0x3b, 0x00, 0x70, 0x51, 0x00, 0x0f, 0x49, 0x02, 0x08,
1350x04, 0xaa, 0x02, 0x14, 0x6e, 0x3f, 0x02, 0x09, 0xc0, 0x01, 1350x04, 0xaa, 0x02, 0x19, 0x6e, 0x3f, 0x02, 0x04, 0xc0, 0x01,
1360x12, 0x61, 0xe1, 0x05, 0x0a, 0x98, 0x02, 0x35, 0x2e, 0x00, 1360x13, 0x61, 0xe1, 0x05, 0x09, 0x98, 0x02, 0x35, 0x2e, 0x00,
1370x55, 0xa7, 0x00, 0x20, 0x73, 0x70, 0x0c, 0x05, 0x30, 0x62, 1370x55, 0xa7, 0x00, 0x20, 0x73, 0x70, 0x0c, 0x05, 0x30, 0x62,
1380x61, 0x72, 0xe7, 0x04, 0x32, 0x6f, 0x77, 0x73, 0x1b, 0x02, 1380x61, 0x72, 0xe7, 0x04, 0x32, 0x6f, 0x77, 0x73, 0x1b, 0x02,
1390x10, 0x6d, 0x38, 0x04, 0x2a, 0x6f, 0x66, 0x14, 0x05, 0x01, 1390x10, 0x6d, 0x38, 0x04, 0x2c, 0x6f, 0x66, 0x14, 0x05, 0x03,
1400x27, 0x05, 0x03, 0x01, 0x02, 0x42, 0x2d, 0x62, 0x65, 0x2d, 1400x5e, 0x04, 0x72, 0x6e, 0x6f, 0x74, 0x2d, 0x62, 0x65, 0x2d,
1410x1d, 0x00, 0x50, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x69, 0x00, 1410x1d, 0x00, 0x51, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x69, 0x00,
1420x00, 0x4c, 0x04, 0x03, 0xd2, 0x01, 0x16, 0x00, 0x6a, 0x00, 1420x00, 0x4c, 0x04, 0x02, 0xd2, 0x01, 0x16, 0x00, 0x6a, 0x00,
1430x43, 0x00, 0x00, 0x28, 0x41, 0x40, 0x05, 0x13, 0x61, 0x0a, 1430x43, 0x00, 0x00, 0x28, 0x41, 0x40, 0x05, 0x13, 0x61, 0x0a,
1440x02, 0x72, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0xc1, 1440x02, 0x72, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0xc1,
1450x05, 0x13, 0x73, 0x38, 0x04, 0x30, 0x32, 0x2e, 0x31, 0x5b, 1450x05, 0x13, 0x73, 0x38, 0x04, 0x31, 0x32, 0x2e, 0x31, 0x5b,
1460x05, 0x02, 0x7f, 0x01, 0xb2, 0x61, 0x76, 0x61, 0x69, 0x6c, 1460x05, 0x01, 0x7f, 0x01, 0xb2, 0x61, 0x76, 0x61, 0x69, 0x6c,
1470x61, 0x62, 0x6c, 0x65, 0x2e, 0x29, 0x0b, 0x04, 0x15, 0x32, 1470x61, 0x62, 0x6c, 0x65, 0x2e, 0x29, 0x0b, 0x04, 0x15, 0x32,
1480x0b, 0x04, 0x90, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 1480x0b, 0x04, 0x91, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74,
1490x65, 0x72, 0x0d, 0x04, 0x03, 0xa4, 0x06, 0x05, 0x14, 0x00, 1490x65, 0x72, 0x0d, 0x04, 0x02, 0xa4, 0x06, 0x06, 0x14, 0x00,
1500x01, 0x9e, 0x05, 0x06, 0x3e, 0x00, 0x51, 0x00, 0x66, 0x72, 1500x02, 0x43, 0x00, 0x04, 0x3e, 0x00, 0x51, 0x00, 0x66, 0x72,
1510x6f, 0x6d, 0x7b, 0x00, 0xe0, 0x60, 0x43, 0x75, 0x73, 0x74, 1510x6f, 0x6d, 0x7b, 0x00, 0xe1, 0x60, 0x43, 0x75, 0x73, 0x74,
1520x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x71, 1520x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x71,
1530x00, 0x04, 0xe9, 0x02, 0xb0, 0x60, 0x54, 0x79, 0x70, 0x65, 1530x00, 0x03, 0xe9, 0x02, 0xb0, 0x60, 0x54, 0x79, 0x70, 0x65,
1540x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0xad, 0x00, 0x90, 0x57, 1540x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0xad, 0x00, 0x90, 0x57,
1550x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 0x48, 0x65, 0xc8, 0x00, 1550x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 0x48, 0x65, 0xc8, 0x00,
1560x60, 0x00, 0x00, 0x00, 0x53, 0x69, 0x7a, 0x93, 0x07, 0x02, 1560x61, 0x00, 0x00, 0x00, 0x53, 0x69, 0x7a, 0x93, 0x07, 0x01,
1570xcc, 0x06, 0x23, 0x69, 0x6e, 0x72, 0x03, 0x11, 0x73, 0x1e, 1570xcc, 0x06, 0x23, 0x69, 0x6e, 0x72, 0x03, 0x11, 0x73, 0x1e,
1580x07, 0x13, 0x72, 0x81, 0x02, 0x21, 0x62, 0x65, 0x0b, 0x04, 1580x07, 0x13, 0x72, 0x81, 0x02, 0x22, 0x62, 0x65, 0x0b, 0x04,
1590x02, 0x3c, 0x00, 0x23, 0x00, 0x78, 0x3d, 0x00, 0x06, 0x36, 1590x01, 0x3c, 0x00, 0x24, 0x00, 0x78, 0x3d, 0x00, 0x05, 0x36,
1600x01, 0x25, 0x69, 0x6e, 0x24, 0x02, 0x41, 0x3a, 0x00, 0x69, 1600x01, 0x25, 0x69, 0x6e, 0x24, 0x02, 0x10, 0x3a, 0x82, 0x02,
1610x66, 0x33, 0x05, 0x03, 0xec, 0x06, 0x00, 0x8b, 0x02, 0x23, 1610x01, 0x48, 0x03, 0x03, 0xec, 0x06, 0x53, 0x69, 0x73, 0x00,
1620x6f, 0x64, 0xc0, 0x01, 0x22, 0x6f, 0x6e, 0x7e, 0x04, 0x03, 1620x6f, 0x64, 0xc0, 0x01, 0x25, 0x6f, 0x6e, 0x7e, 0x04, 0x04,
1630x58, 0x00, 0x05, 0x64, 0x03, 0x01, 0x45, 0x01, 0x42, 0x47, 1630x58, 0x00, 0x01, 0x63, 0x01, 0x01, 0x45, 0x01, 0x53, 0x47,
1640x72, 0x69, 0x64, 0xcc, 0x01, 0x00, 0x28, 0x02, 0x50, 0x6c, 1640x72, 0x69, 0x64, 0x73, 0x38, 0x02, 0x71, 0x74, 0x00, 0x6c,
1650x65, 0x61, 0x73, 0x74, 0x31, 0x00, 0x01, 0x3e, 0x00, 0x70, 1650x65, 0x61, 0x73, 0x74, 0x31, 0x00, 0x00, 0x3e, 0x00, 0x70,
1660x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0xd2, 0x00, 0x20, 1660x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0xd2, 0x00, 0x21,
1670x65, 0x6e, 0x96, 0x05, 0x00, 0x3b, 0x00, 0x91, 0x65, 0x61, 1670x65, 0x6e, 0x96, 0x05, 0x90, 0x62, 0x65, 0x00, 0x65, 0x61,
1680x73, 0x69, 0x65, 0x72, 0x00, 0x74, 0x6f, 0x74, 0x03, 0x02, 1680x73, 0x69, 0x65, 0x72, 0x0d, 0x00, 0x00, 0x74, 0x03, 0x02,
1690x4a, 0x01, 0xa0, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 1690x4a, 0x01, 0xa0, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75,
1700x6c, 0x74, 0x79, 0x02, 0x06, 0x02, 0x55, 0x05, 0x03, 0x30, 1700x6c, 0x74, 0x79, 0x02, 0x06, 0x03, 0x55, 0x05, 0x02, 0x30,
1710x02, 0x05, 0x1a, 0x00, 0x04, 0xd2, 0x04, 0x92, 0x67, 0x65, 1710x02, 0x06, 0x1a, 0x00, 0x03, 0xd2, 0x04, 0x60, 0x67, 0x65,
1720x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x1b, 0x06, 0x00, 1720x6e, 0x65, 0x72, 0x61, 0xe6, 0x05, 0x02, 0x1b, 0x06, 0xf0,
1730xdb, 0x07, 0xc0, 0x74, 0x00, 0x54, 0x72, 0x69, 0x63, 0x6b, 1730x00, 0x2e, 0x00, 0x41, 0x74, 0x00, 0x54, 0x72, 0x69, 0x63,
1740x79, 0x00, 0x6c, 0x65, 0x76, 0x6d, 0x06, 0x31, 0x79, 0x6f, 1740x6b, 0x79, 0x00, 0x6c, 0x65, 0x76, 0x6d, 0x06, 0x31, 0x79,
1750x75, 0x71, 0x01, 0x62, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 1750x6f, 0x75, 0x71, 0x01, 0x62, 0x72, 0x65, 0x71, 0x75, 0x69,
1760x10, 0x06, 0x89, 0x6d, 0x61, 0x6b, 0x65, 0x00, 0x6d, 0x6f, 1760x72, 0x10, 0x06, 0x89, 0x6d, 0x61, 0x6b, 0x65, 0x00, 0x6d,
1770x72, 0xfc, 0x03, 0x52, 0x61, 0x62, 0x6f, 0x75, 0x74, 0xb4, 1770x6f, 0x72, 0xfc, 0x03, 0x53, 0x61, 0x62, 0x6f, 0x75, 0x74,
1780x04, 0x04, 0x17, 0x01, 0x05, 0xab, 0x07, 0x11, 0x2f, 0xbb, 1780xb4, 0x04, 0x09, 0x4d, 0x02, 0x42, 0x72, 0x6f, 0x77, 0x2f,
1790x07, 0x00, 0xc2, 0x07, 0x31, 0x75, 0x6e, 0x74, 0xb8, 0x07, 1790xbb, 0x07, 0x61, 0x00, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0xb8,
1800x62, 0x53, 0x74, 0x72, 0x69, 0x70, 0x20, 0x6e, 0x07, 0xe0, 1800x07, 0x62, 0x53, 0x74, 0x72, 0x69, 0x70, 0x20, 0x6e, 0x07,
1810x00, 0x00, 0x49, 0x66, 0x00, 0x74, 0x72, 0x75, 0x65, 0x2c, 1810xe1, 0x00, 0x00, 0x49, 0x66, 0x00, 0x74, 0x72, 0x75, 0x65,
1820x00, 0x73, 0x6f, 0x6d, 0x8b, 0x01, 0x08, 0x8b, 0x07, 0x0e, 1820x2c, 0x00, 0x73, 0x6f, 0x6d, 0x8b, 0x01, 0x08, 0x8b, 0x07,
1830x6c, 0x08, 0x02, 0x05, 0x03, 0x00, 0x6d, 0x08, 0x14, 0x74, 1830x0e, 0x6c, 0x08, 0x02, 0x05, 0x03, 0x10, 0x64, 0x25, 0x01,
1840xc2, 0x00, 0x01, 0x18, 0x01, 0x40, 0x69, 0x6d, 0x65, 0x2c, 1840x03, 0xc2, 0x00, 0x01, 0x18, 0x01, 0x40, 0x69, 0x6d, 0x65,
1850x9c, 0x00, 0x03, 0xf7, 0x02, 0x02, 0xd4, 0x00, 0x01, 0xa9, 1850x2c, 0x9c, 0x00, 0x04, 0xf7, 0x02, 0x03, 0xef, 0x06, 0x02,
1860x00, 0x04, 0xfc, 0x00, 0x50, 0x75, 0x6c, 0x74, 0x2e, 0x00, 1860xa9, 0x00, 0xa0, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c,
1870x74, 0x2e, 0x00,
187}; 188};
188 189
189const unsigned short help_text_len = 2502; 190const unsigned short help_text_len = 2502;
diff --git a/apps/plugins/puzzles/help/map.c b/apps/plugins/puzzles/help/map.c
index 931ffeb05f..731b5f4745 100644
--- a/apps/plugins/puzzles/help/map.c
+++ b/apps/plugins/puzzles/help/map.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -18,7 +18,7 @@ struct style_text help_text_style[] = {
18 LAST_STYLE_ITEM 18 LAST_STYLE_ITEM
19}; 19};
20 20
21/* orig 3466 comp 2282 ratio 0.658396 level 11 saved 1184 */ 21/* orig 3466 comp 2283 ratio 0.658684 level 10 saved 1183 */
22const char help_text[] = { 22const char help_text[] = {
230xf0, 0x2e, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 230xf0, 0x2e, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
240x32, 0x32, 0x3a, 0x20, 0x4d, 0x61, 0x70, 0x20, 0x00, 0x00, 240x32, 0x32, 0x3a, 0x20, 0x4d, 0x61, 0x70, 0x20, 0x00, 0x00,
@@ -31,7 +31,7 @@ const char help_text[] = {
310x74, 0x61, 0x73, 0x6b, 0x00, 0x69, 0x73, 0x00, 0x74, 0x6f, 310x74, 0x61, 0x73, 0x6b, 0x00, 0x69, 0x73, 0x00, 0x74, 0x6f,
320x00, 0x63, 0x6f, 0x6c, 0x12, 0x00, 0x43, 0x65, 0x61, 0x63, 320x00, 0x63, 0x6f, 0x6c, 0x12, 0x00, 0x43, 0x65, 0x61, 0x63,
330x68, 0x25, 0x00, 0x90, 0x00, 0x77, 0x69, 0x74, 0x68, 0x00, 330x68, 0x25, 0x00, 0x90, 0x00, 0x77, 0x69, 0x74, 0x68, 0x00,
340x6f, 0x6e, 0x65, 0x38, 0x00, 0x43, 0x66, 0x6f, 0x75, 0x72, 340x6f, 0x6e, 0x65, 0x38, 0x00, 0x10, 0x66, 0x1d, 0x00, 0x02,
350x24, 0x00, 0xf4, 0x0d, 0x73, 0x2c, 0x00, 0x69, 0x6e, 0x00, 350x24, 0x00, 0xf4, 0x0d, 0x73, 0x2c, 0x00, 0x69, 0x6e, 0x00,
360x73, 0x75, 0x63, 0x68, 0x00, 0x61, 0x00, 0x77, 0x61, 0x79, 360x73, 0x75, 0x63, 0x68, 0x00, 0x61, 0x00, 0x77, 0x61, 0x79,
370x00, 0x74, 0x68, 0x61, 0x74, 0x00, 0x6e, 0x6f, 0x00, 0x74, 370x00, 0x74, 0x68, 0x61, 0x74, 0x00, 0x6e, 0x6f, 0x00, 0x74,
@@ -44,211 +44,211 @@ const char help_text[] = {
440x4c, 0x00, 0x73, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 440x4c, 0x00, 0x73, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79,
450x33, 0x00, 0xe0, 0x65, 0x64, 0x2c, 0x00, 0x73, 0x75, 0x66, 450x33, 0x00, 0xe0, 0x65, 0x64, 0x2c, 0x00, 0x73, 0x75, 0x66,
460x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0xbb, 0x00, 0x32, 460x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0xbb, 0x00, 0x32,
470x6d, 0x61, 0x6b, 0x59, 0x00, 0x71, 0x72, 0x65, 0x6d, 0x61, 470x6d, 0x61, 0x6b, 0x59, 0x00, 0x72, 0x72, 0x65, 0x6d, 0x61,
480x69, 0x6e, 0x64, 0xea, 0x00, 0x02, 0x6a, 0x00, 0x40, 0x6f, 480x69, 0x6e, 0x64, 0xea, 0x00, 0x01, 0x6a, 0x00, 0x40, 0x6f,
490x6c, 0x75, 0x74, 0xcb, 0x00, 0xe5, 0x75, 0x6e, 0x69, 0x71, 490x6c, 0x75, 0x74, 0xcb, 0x00, 0xe5, 0x75, 0x6e, 0x69, 0x71,
500x75, 0x65, 0x2e, 0x00, 0x00, 0x00, 0x4f, 0x6e, 0x6c, 0x79, 500x75, 0x65, 0x2e, 0x00, 0x00, 0x00, 0x4f, 0x6e, 0x6c, 0x79,
510x5a, 0x00, 0x51, 0x77, 0x68, 0x69, 0x63, 0x68, 0xac, 0x00, 510x5a, 0x00, 0x51, 0x77, 0x68, 0x69, 0x63, 0x68, 0xac, 0x00,
520xa0, 0x65, 0x00, 0x61, 0x00, 0x6c, 0x65, 0x6e, 0x67, 0x74, 520xa0, 0x65, 0x00, 0x61, 0x00, 0x6c, 0x65, 0x6e, 0x67, 0x74,
530x68, 0x3c, 0x00, 0x30, 0x62, 0x6f, 0x72, 0x46, 0x00, 0x20, 530x68, 0x3c, 0x00, 0x30, 0x62, 0x6f, 0x72, 0x46, 0x00, 0x20,
540x61, 0x72, 0x54, 0x00, 0x60, 0x71, 0x75, 0x69, 0x72, 0x65, 540x61, 0x72, 0x54, 0x00, 0x60, 0x71, 0x75, 0x69, 0x72, 0x65,
550x64, 0x69, 0x00, 0xc4, 0x62, 0x65, 0x00, 0x64, 0x69, 0x66, 550x64, 0x69, 0x00, 0x90, 0x62, 0x65, 0x00, 0x64, 0x69, 0x66,
560x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x0d, 0x01, 0x5b, 0x2e, 560x66, 0x65, 0x72, 0x79, 0x00, 0x03, 0x0d, 0x01, 0x5b, 0x2e,
570x00, 0x54, 0x77, 0x6f, 0x51, 0x00, 0xc1, 0x6d, 0x65, 0x65, 570x00, 0x54, 0x77, 0x6f, 0x51, 0x00, 0x90, 0x6d, 0x65, 0x65,
580x74, 0x00, 0x61, 0x74, 0x00, 0x6f, 0x6e, 0x6c, 0x79, 0x41, 580x74, 0x00, 0x61, 0x74, 0x00, 0x6f, 0x6c, 0x00, 0x00, 0x41,
590x01, 0xb1, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x00, 0x28, 0x69, 590x01, 0xb1, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x00, 0x28, 0x69,
600x2e, 0x65, 0x2e, 0x55, 0x00, 0xfd, 0x0c, 0x64, 0x69, 0x61, 600x2e, 0x65, 0x2e, 0x55, 0x00, 0xff, 0x0c, 0x64, 0x69, 0x61,
610x67, 0x6f, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x00, 0x73, 0x65, 610x67, 0x6f, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x00, 0x73, 0x65,
620x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x64, 0x29, 0x00, 0x6d, 620x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x64, 0x29, 0x00, 0x6d,
630x61, 0x79, 0x00, 0x62, 0x23, 0x01, 0x00, 0xb5, 0x00, 0x71, 630x61, 0x79, 0x00, 0x62, 0x23, 0x01, 0x00, 0x91, 0x00, 0x00,
640x49, 0x00, 0x62, 0x65, 0x6c, 0x69, 0x65, 0x40, 0x01, 0x90, 640x49, 0x00, 0x62, 0x65, 0x6c, 0x69, 0x65, 0x40, 0x01, 0x90,
650x69, 0x73, 0x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0xb9, 650x69, 0x73, 0x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0xb9,
660x01, 0xf0, 0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 660x01, 0xf0, 0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61,
670x6c, 0x3b, 0x00, 0x49, 0x27, 0x76, 0x65, 0x00, 0x6e, 0x65, 670x6c, 0x3b, 0x00, 0x49, 0x27, 0x76, 0x65, 0x00, 0x6e, 0x65,
680x76, 0x65, 0x72, 0x00, 0x73, 0x65, 0x09, 0x02, 0xc0, 0x6e, 680x76, 0x65, 0x72, 0x00, 0x73, 0x65, 0x09, 0x02, 0xc1, 0x6e,
690x00, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 690x00, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
700x61, 0x04, 0x01, 0x00, 0xd8, 0x00, 0xf0, 0x06, 0x69, 0x74, 700x61, 0x04, 0x01, 0xf0, 0x09, 0x6f, 0x66, 0x00, 0x69, 0x74,
710x00, 0x61, 0x6e, 0x79, 0x77, 0x68, 0x65, 0x72, 0x65, 0x00, 710x00, 0x61, 0x6e, 0x79, 0x77, 0x68, 0x65, 0x72, 0x65, 0x00,
720x65, 0x6c, 0x73, 0x65, 0x2e, 0x00, 0x54, 0x68, 0x65, 0x2e, 720x65, 0x6c, 0x73, 0x65, 0x2e, 0x00, 0x54, 0x68, 0x65, 0x2e,
730x02, 0x41, 0x63, 0x65, 0x70, 0x74, 0x2b, 0x02, 0x01, 0xe9, 730x02, 0x42, 0x63, 0x65, 0x70, 0x74, 0x2b, 0x02, 0x00, 0xe9,
740x01, 0x11, 0x2d, 0x7a, 0x00, 0x00, 0xc0, 0x01, 0x04, 0x6b, 740x01, 0x12, 0x2d, 0x7a, 0x00, 0x00, 0xc0, 0x01, 0x03, 0x6b,
750x00, 0xf0, 0x20, 0x77, 0x61, 0x73, 0x00, 0x73, 0x75, 0x67, 750x00, 0xf0, 0x20, 0x77, 0x61, 0x73, 0x00, 0x73, 0x75, 0x67,
760x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x00, 0x62, 0x79, 0x00, 760x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x00, 0x62, 0x79, 0x00,
770x4f, 0x77, 0x65, 0x6e, 0x00, 0x44, 0x75, 0x6e, 0x6e, 0x3b, 770x4f, 0x77, 0x65, 0x6e, 0x00, 0x44, 0x75, 0x6e, 0x6e, 0x3b,
780x00, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x00, 0x6d, 0x75, 780x00, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x00, 0x6d, 0x75,
790x73, 0x74, 0x00, 0x61, 0x6c, 0x73, 0x6f, 0x00, 0x67, 0x6f, 790x73, 0x74, 0x00, 0x61, 0x6c, 0x73, 0x6f, 0x00, 0x67, 0x6f,
800x2d, 0x01, 0x91, 0x4e, 0x69, 0x6b, 0x6f, 0x6c, 0x69, 0x00, 800x2d, 0x01, 0x91, 0x4e, 0x69, 0x6b, 0x6f, 0x6c, 0x69, 0x00,
810x61, 0x6e, 0x3b, 0x01, 0xf0, 0x07, 0x56, 0x65, 0x72, 0x69, 810x61, 0x6e, 0x3b, 0x01, 0xf1, 0x07, 0x56, 0x65, 0x72, 0x69,
820x74, 0x79, 0x00, 0x41, 0x6c, 0x6c, 0x61, 0x6e, 0x00, 0x66, 820x74, 0x79, 0x00, 0x41, 0x6c, 0x6c, 0x61, 0x6e, 0x00, 0x66,
830x6f, 0x72, 0x00, 0x69, 0x6e, 0x73, 0x70, 0x69, 0x63, 0x00, 830x6f, 0x72, 0x00, 0x69, 0x6e, 0x73, 0x70, 0x69, 0x63, 0x00,
840x01, 0xf0, 0x00, 0x52, 0x74, 0x72, 0x61, 0x69, 0x6e, 0xb6, 840x00, 0xf0, 0x00, 0x52, 0x74, 0x72, 0x61, 0x69, 0x6e, 0xb6,
850x01, 0x52, 0x6f, 0x75, 0x67, 0x68, 0x74, 0x54, 0x02, 0x12, 850x01, 0x52, 0x6f, 0x75, 0x67, 0x68, 0x74, 0x54, 0x02, 0x12,
860x6c, 0x77, 0x01, 0x01, 0x0b, 0x02, 0x71, 0x61, 0x6c, 0x69, 860x6c, 0x77, 0x01, 0x01, 0x0b, 0x02, 0x40, 0x61, 0x6c, 0x69,
870x73, 0x69, 0x6e, 0x67, 0x79, 0x00, 0x14, 0x27, 0x8d, 0x00, 870x73, 0x2e, 0x00, 0x00, 0x79, 0x00, 0x15, 0x27, 0x8d, 0x00,
880x00, 0xd8, 0x00, 0x01, 0x9c, 0x00, 0x82, 0x61, 0x00, 0x76, 880x01, 0xa7, 0x02, 0xb3, 0x61, 0x73, 0x00, 0x61, 0x00, 0x76,
890x69, 0x61, 0x62, 0x6c, 0x65, 0xb0, 0x00, 0x01, 0xd8, 0x00, 890x69, 0x61, 0x62, 0x6c, 0x65, 0xb0, 0x00, 0x00, 0xd8, 0x00,
900x40, 0x61, 0x6e, 0x6b, 0x73, 0x90, 0x00, 0x01, 0x8d, 0x00, 900x42, 0x61, 0x6e, 0x6b, 0x73, 0x90, 0x00, 0xf1, 0x01, 0x74,
910xd1, 0x47, 0x61, 0x72, 0x65, 0x74, 0x68, 0x00, 0x54, 0x61, 910x6f, 0x00, 0x47, 0x61, 0x72, 0x65, 0x74, 0x68, 0x00, 0x54,
920x79, 0x6c, 0x6f, 0x72, 0x80, 0x00, 0xd7, 0x6d, 0x61, 0x6e, 920x61, 0x79, 0x6c, 0x6f, 0x72, 0x80, 0x00, 0xa0, 0x6d, 0x61,
930x79, 0x00, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x65, 0x64, 930x6e, 0x79, 0x00, 0x64, 0x65, 0x74, 0x61, 0x69, 0x66, 0x00,
940x4f, 0x00, 0x10, 0x73, 0x70, 0x01, 0x41, 0x32, 0x32, 0x2e, 940x06, 0x4f, 0x00, 0x10, 0x73, 0x70, 0x01, 0x41, 0x32, 0x32,
950x31, 0x60, 0x03, 0x80, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 950x2e, 0x31, 0x60, 0x03, 0x80, 0x63, 0x6f, 0x6e, 0x74, 0x72,
960x6c, 0x73, 0x69, 0x03, 0x15, 0x54, 0x25, 0x03, 0x13, 0x61, 960x6f, 0x6c, 0x73, 0x69, 0x03, 0x15, 0x54, 0x25, 0x03, 0x13,
970xf0, 0x01, 0x71, 0x2c, 0x00, 0x63, 0x6c, 0x69, 0x63, 0x6b, 970x61, 0xf0, 0x01, 0x71, 0x2c, 0x00, 0x63, 0x6c, 0x69, 0x63,
980xc2, 0x00, 0xf0, 0x00, 0x6c, 0x65, 0x66, 0x74, 0x00, 0x6d, 980x6b, 0xc2, 0x00, 0xf0, 0x00, 0x6c, 0x65, 0x66, 0x74, 0x00,
990x6f, 0x75, 0x73, 0x65, 0x00, 0x62, 0x75, 0x74, 0x74, 0x70, 990x6d, 0x6f, 0x75, 0x73, 0x65, 0x00, 0x62, 0x75, 0x74, 0x74,
1000x01, 0x01, 0x85, 0x01, 0x22, 0x65, 0x78, 0x89, 0x03, 0x03, 1000x70, 0x01, 0x01, 0x85, 0x01, 0x23, 0x65, 0x78, 0x89, 0x03,
1010x33, 0x00, 0x04, 0x9a, 0x02, 0x30, 0x64, 0x65, 0x73, 0x56, 1010x03, 0x55, 0x03, 0x03, 0x9a, 0x02, 0x31, 0x64, 0x65, 0x73,
1020x02, 0x03, 0x52, 0x00, 0x01, 0x26, 0x01, 0x41, 0x64, 0x72, 1020x56, 0x02, 0x04, 0x52, 0x00, 0x72, 0x6e, 0x64, 0x00, 0x64,
1030x61, 0x67, 0xf8, 0x00, 0x04, 0x15, 0x00, 0x41, 0x69, 0x6e, 1030x72, 0x61, 0x67, 0xf8, 0x00, 0x03, 0x15, 0x00, 0x41, 0x69,
1040x74, 0x6f, 0x2d, 0x00, 0x33, 0x6e, 0x65, 0x77, 0x3f, 0x00, 1040x6e, 0x74, 0x6f, 0x2d, 0x00, 0x33, 0x6e, 0x65, 0x77, 0x3f,
1050x00, 0x9d, 0x00, 0x31, 0x28, 0x54, 0x68, 0x2f, 0x03, 0xf3, 1050x00, 0x00, 0x9d, 0x00, 0x31, 0x28, 0x54, 0x68, 0x2f, 0x03,
1060x07, 0x67, 0x72, 0x61, 0x6d, 0x00, 0x77, 0x69, 0x6c, 0x6c, 1060xf3, 0x07, 0x67, 0x72, 0x61, 0x6d, 0x00, 0x77, 0x69, 0x6c,
1070x00, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x00, 0x65, 0x6e, 1070x6c, 0x00, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x00, 0x65,
1080x73, 0x75, 0x72, 0x40, 0x02, 0x47, 0x74, 0x61, 0x72, 0x74, 1080x6e, 0x73, 0x75, 0x72, 0x40, 0x02, 0x47, 0x74, 0x61, 0x72,
1090xc0, 0x01, 0x41, 0x68, 0x61, 0x73, 0x00, 0x51, 0x01, 0x30, 1090x74, 0xc0, 0x01, 0x10, 0x68, 0x24, 0x01, 0x00, 0x51, 0x01,
1100x61, 0x73, 0x74, 0x92, 0x02, 0x06, 0x8e, 0x00, 0x01, 0xf2, 1100x31, 0x61, 0x73, 0x74, 0x92, 0x02, 0x06, 0x8e, 0x00, 0x01,
1110x03, 0x03, 0x72, 0x00, 0x41, 0x2c, 0x00, 0x73, 0x6f, 0x82, 1110xf2, 0x03, 0x02, 0x72, 0x00, 0x42, 0x2c, 0x00, 0x73, 0x6f,
1120x00, 0x02, 0x67, 0x02, 0x24, 0x69, 0x73, 0x5a, 0x00, 0xa0, 1120x82, 0x00, 0x01, 0x67, 0x02, 0x24, 0x69, 0x73, 0x5a, 0x00,
1130x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x21, 0x29, 1130xa0, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x21,
1140x8d, 0x02, 0x82, 0x66, 0x00, 0x79, 0x6f, 0x75, 0x00, 0x6e, 1140x29, 0x8d, 0x02, 0x82, 0x66, 0x00, 0x79, 0x6f, 0x75, 0x00,
1150x65, 0x9e, 0x01, 0x47, 0x63, 0x6c, 0x65, 0x61, 0x13, 0x01, 1150x6e, 0x65, 0x9e, 0x01, 0x48, 0x63, 0x6c, 0x65, 0x61, 0x13,
1160x01, 0x1c, 0x00, 0x32, 0x63, 0x61, 0x6e, 0xcf, 0x00, 0x41, 1160x01, 0x00, 0x1c, 0x00, 0x32, 0x63, 0x61, 0x6e, 0xcf, 0x00,
1170x66, 0x72, 0x6f, 0x6d, 0x06, 0x01, 0x45, 0x6d, 0x70, 0x74, 1170x41, 0x66, 0x72, 0x6f, 0x6d, 0x06, 0x01, 0x45, 0x6d, 0x70,
1180x79, 0x23, 0x00, 0x22, 0x6f, 0x72, 0x19, 0x00, 0x24, 0x74, 1180x74, 0x79, 0x23, 0x00, 0x22, 0x6f, 0x72, 0x19, 0x00, 0x24,
1190x68, 0xb1, 0x01, 0x06, 0x26, 0x04, 0x11, 0x69, 0x20, 0x01, 1190x74, 0x68, 0xb1, 0x01, 0x06, 0x26, 0x04, 0x11, 0x69, 0x20,
1200x21, 0x72, 0x65, 0x28, 0x03, 0x29, 0x6e, 0x6f, 0x3a, 0x00, 1200x01, 0x21, 0x72, 0x65, 0x28, 0x03, 0x29, 0x6e, 0x6f, 0x3a,
1210x11, 0x73, 0x66, 0x01, 0x00, 0x04, 0x01, 0x51, 0x44, 0x72, 1210x00, 0x11, 0x73, 0x66, 0x01, 0x00, 0x04, 0x01, 0x52, 0x44,
1220x61, 0x67, 0x67, 0x60, 0x04, 0x04, 0x2d, 0x01, 0x24, 0x75, 1220x72, 0x61, 0x67, 0x67, 0x60, 0x04, 0x03, 0x2d, 0x01, 0x24,
1230x73, 0x4c, 0x02, 0x4a, 0x72, 0x69, 0x67, 0x68, 0x8b, 0x01, 1230x75, 0x73, 0x4c, 0x02, 0x4b, 0x72, 0x69, 0x67, 0x68, 0x8b,
1240x02, 0x26, 0x01, 0x60, 0x73, 0x74, 0x69, 0x70, 0x70, 0x6c, 1240x01, 0x01, 0x26, 0x01, 0x64, 0x73, 0x74, 0x69, 0x70, 0x70,
1250x20, 0x01, 0x05, 0xff, 0x00, 0x28, 0x69, 0x6e, 0x71, 0x01, 1250x6c, 0x2a, 0x04, 0x01, 0xff, 0x00, 0x28, 0x69, 0x6e, 0x71,
1260x12, 0x2c, 0xbf, 0x03, 0x05, 0xc2, 0x00, 0x00, 0x41, 0x00, 1260x01, 0x13, 0x2c, 0xbf, 0x03, 0x04, 0xc2, 0x00, 0x00, 0x41,
1270x01, 0x5c, 0x02, 0x40, 0x6e, 0x6f, 0x74, 0x65, 0xeb, 0x00, 1270x00, 0x01, 0x5c, 0x02, 0x40, 0x6e, 0x6f, 0x74, 0x65, 0xeb,
1280x10, 0x79, 0xf1, 0x03, 0x31, 0x65, 0x6c, 0x66, 0x35, 0x00, 1280x00, 0x10, 0x79, 0xf1, 0x03, 0x32, 0x65, 0x6c, 0x66, 0x35,
1290x00, 0x0e, 0x00, 0x00, 0x28, 0x01, 0x28, 0x6e, 0x6b, 0x52, 1290x00, 0x00, 0x27, 0x00, 0x58, 0x74, 0x68, 0x69, 0x6e, 0x6b,
1300x00, 0x11, 0x6d, 0x7d, 0x00, 0x28, 0x62, 0x65, 0x58, 0x00, 1300x52, 0x00, 0x11, 0x6d, 0x7d, 0x00, 0x28, 0x62, 0x65, 0x58,
1310x33, 0x2e, 0x00, 0x41, 0x1f, 0x00, 0x01, 0x57, 0x00, 0x00, 1310x00, 0x34, 0x2e, 0x00, 0x41, 0x1f, 0x00, 0x00, 0x57, 0x00,
1320x54, 0x02, 0x34, 0x61, 0x69, 0x6e, 0x90, 0x00, 0x10, 0x73, 1320x00, 0x54, 0x02, 0x00, 0xee, 0x02, 0x03, 0x90, 0x00, 0x10,
1330x86, 0x00, 0x74, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 1330x73, 0x86, 0x00, 0x74, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70,
1340xf4, 0x03, 0x01, 0xad, 0x01, 0x00, 0x96, 0x03, 0x43, 0x2e, 1340x6c, 0xf4, 0x03, 0x01, 0xad, 0x01, 0x00, 0x96, 0x03, 0x10,
1350x00, 0x28, 0x54, 0x8b, 0x01, 0x41, 0x6f, 0x66, 0x74, 0x65, 1350x2e, 0xee, 0x01, 0x02, 0x8b, 0x01, 0x41, 0x6f, 0x66, 0x74,
1360x94, 0x00, 0x41, 0x66, 0x75, 0x6c, 0x00, 0xa3, 0x01, 0x00, 1360x65, 0x94, 0x00, 0x41, 0x66, 0x75, 0x6c, 0x00, 0xa3, 0x01,
1370xd7, 0x01, 0x01, 0xa8, 0x04, 0x20, 0x64, 0x69, 0x0f, 0x05, 1370x00, 0xd7, 0x01, 0x01, 0xa8, 0x04, 0x20, 0x64, 0x69, 0x0f,
1380xd0, 0x75, 0x6c, 0x74, 0x79, 0x00, 0x6c, 0x65, 0x76, 0x65, 1380x05, 0xd3, 0x75, 0x6c, 0x74, 0x79, 0x00, 0x6c, 0x65, 0x76,
1390x6c, 0x73, 0x2e, 0x29, 0x19, 0x06, 0x02, 0xc7, 0x00, 0x02, 1390x65, 0x6c, 0x73, 0x2e, 0x29, 0x19, 0x06, 0x00, 0x70, 0x00,
1400x04, 0x03, 0x22, 0x75, 0x73, 0xf9, 0x00, 0xb1, 0x63, 0x75, 1400x01, 0x04, 0x03, 0x22, 0x75, 0x73, 0xf9, 0x00, 0xb1, 0x63,
1410x72, 0x73, 0x6f, 0x72, 0x00, 0x6b, 0x65, 0x79, 0x73, 0x5b, 1410x75, 0x72, 0x73, 0x6f, 0x72, 0x00, 0x6b, 0x65, 0x79, 0x73,
1420x03, 0x20, 0x6f, 0x76, 0x6a, 0x01, 0x00, 0x7d, 0x01, 0x00, 1420x5b, 0x03, 0x20, 0x6f, 0x76, 0x6a, 0x01, 0x00, 0x7d, 0x01,
1430x1f, 0x00, 0x00, 0x3d, 0x06, 0x10, 0x3a, 0x09, 0x00, 0x04, 1430x01, 0x1f, 0x00, 0x42, 0x6d, 0x61, 0x70, 0x3a, 0x28, 0x00,
1440x56, 0x01, 0x28, 0x6f, 0x66, 0x36, 0x00, 0x92, 0x69, 0x6e, 1440x02, 0x56, 0x01, 0x28, 0x6f, 0x66, 0x36, 0x00, 0x92, 0x69,
1450x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0xba, 0x01, 0x33, 1450x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0xba, 0x01,
1460x6f, 0x73, 0x69, 0x59, 0x04, 0x07, 0x33, 0x00, 0x01, 0x17, 1460x34, 0x6f, 0x73, 0x69, 0x59, 0x04, 0x07, 0x33, 0x00, 0x00,
1470x01, 0x43, 0x77, 0x6f, 0x75, 0x6c, 0xd1, 0x02, 0x12, 0x28, 1470x17, 0x01, 0x43, 0x77, 0x6f, 0x75, 0x6c, 0xd1, 0x02, 0x12,
1480x54, 0x01, 0x20, 0x69, 0x73, 0x46, 0x01, 0xa1, 0x00, 0x6f, 1480x28, 0x54, 0x01, 0x20, 0x69, 0x73, 0x46, 0x01, 0xa1, 0x00,
1490x62, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x00, 0x69, 0x44, 0x02, 1490x6f, 0x62, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x00, 0x69, 0x44,
1500x65, 0x27, 0x72, 0x65, 0x00, 0x6f, 0x6e, 0x3c, 0x02, 0x25, 1500x02, 0x31, 0x27, 0x72, 0x65, 0x26, 0x03, 0x03, 0x1e, 0x01,
1510x27, 0x73, 0x07, 0x02, 0x70, 0x2c, 0x00, 0x73, 0x69, 0x6e, 1510x25, 0x27, 0x73, 0x07, 0x02, 0x70, 0x2c, 0x00, 0x73, 0x69,
1520x63, 0x65, 0xb1, 0x04, 0xa2, 0x64, 0x65, 0x70, 0x65, 0x6e, 1520x6e, 0x63, 0x65, 0xb1, 0x04, 0x70, 0x64, 0x65, 0x70, 0x65,
1530x64, 0x73, 0x00, 0x6f, 0x6e, 0x39, 0x03, 0x40, 0x69, 0x72, 1530x6e, 0x64, 0x73, 0x29, 0x00, 0x01, 0x39, 0x03, 0x41, 0x69,
1540x65, 0x63, 0x77, 0x00, 0x01, 0x43, 0x02, 0x07, 0xb2, 0x01, 1540x72, 0x65, 0x63, 0x77, 0x00, 0x01, 0x43, 0x02, 0x06, 0xb2,
1550x90, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68, 0x65, 1550x01, 0x92, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x61, 0x63, 0x68,
1560xca, 0x00, 0x06, 0x51, 0x02, 0x76, 0x29, 0x2e, 0x00, 0x50, 1560x65, 0xca, 0x00, 0x04, 0x4a, 0x00, 0x76, 0x29, 0x2e, 0x00,
1570x72, 0x65, 0x73, 0x1e, 0x02, 0x50, 0x65, 0x74, 0x75, 0x72, 1570x50, 0x72, 0x65, 0x73, 0x1e, 0x02, 0x50, 0x65, 0x74, 0x75,
1580x6e, 0x01, 0x01, 0x02, 0x25, 0x03, 0x32, 0x73, 0x00, 0x61, 1580x72, 0x6e, 0x01, 0x01, 0x02, 0x25, 0x03, 0x00, 0xe0, 0x01,
1590xa9, 0x00, 0x29, 0x6f, 0x66, 0x0c, 0x02, 0x01, 0xfa, 0x01, 1590x01, 0xa9, 0x00, 0x2a, 0x6f, 0x66, 0x0c, 0x02, 0x00, 0xfa,
1600x48, 0x62, 0x6f, 0x76, 0x65, 0x16, 0x02, 0x03, 0x0f, 0x04, 1600x01, 0x49, 0x62, 0x6f, 0x76, 0x65, 0x16, 0x02, 0x02, 0x0f,
1610x01, 0xa4, 0x06, 0x0c, 0x4f, 0x01, 0x3f, 0x3b, 0x00, 0x70, 1610x04, 0x02, 0xa4, 0x06, 0x0b, 0x4f, 0x01, 0x3f, 0x3b, 0x00,
1620x68, 0x00, 0x04, 0x20, 0x61, 0x67, 0xef, 0x01, 0x62, 0x66, 1620x70, 0x68, 0x00, 0x04, 0x20, 0x61, 0x67, 0xef, 0x01, 0x63,
1630x69, 0x6e, 0x69, 0x73, 0x68, 0x3c, 0x01, 0x01, 0x72, 0x00, 1630x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x3c, 0x01, 0x00, 0x72,
1640x02, 0x7d, 0x05, 0x90, 0x73, 0x70, 0x61, 0x63, 0x65, 0x00, 1640x00, 0x02, 0x7d, 0x05, 0x91, 0x73, 0x70, 0x61, 0x63, 0x65,
1650x62, 0x61, 0x72, 0xac, 0x01, 0x00, 0x39, 0x02, 0x20, 0x75, 1650x00, 0x62, 0x61, 0x72, 0xac, 0x01, 0x20, 0x62, 0x65, 0xaa,
1660x73, 0x90, 0x04, 0x81, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72, 1660x01, 0xb1, 0x64, 0x00, 0x73, 0x69, 0x6d, 0x69, 0x6c, 0x61,
1670x6c, 0x79, 0x62, 0x03, 0x74, 0x72, 0x65, 0x61, 0x74, 0x65, 1670x72, 0x6c, 0x79, 0x62, 0x03, 0x40, 0x72, 0x65, 0x61, 0x74,
1680x00, 0x61, 0x32, 0x02, 0x15, 0x64, 0x0d, 0x04, 0x7f, 0x44, 1680xa1, 0x06, 0x03, 0x32, 0x02, 0x15, 0x64, 0x0d, 0x04, 0x7f,
1690x6f, 0x75, 0x62, 0x6c, 0x65, 0x2d, 0x79, 0x00, 0x05, 0x30, 1690x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x2d, 0x79, 0x00, 0x05,
1700x28, 0x77, 0x69, 0x50, 0x05, 0x10, 0x74, 0xe7, 0x01, 0x37, 1700x30, 0x28, 0x77, 0x69, 0x50, 0x05, 0x10, 0x74, 0xe7, 0x01,
1710x69, 0x6e, 0x67, 0xb2, 0x00, 0x11, 0x29, 0x13, 0x03, 0x02, 1710x04, 0x1f, 0x00, 0x02, 0xb2, 0x00, 0x12, 0x29, 0x13, 0x03,
1720xbc, 0x03, 0x07, 0xbf, 0x02, 0x02, 0xf6, 0x00, 0x0f, 0xbb, 1720x02, 0xbc, 0x03, 0x06, 0xbf, 0x02, 0x02, 0xf6, 0x00, 0x0f,
1730x03, 0x07, 0x64, 0x00, 0x64, 0x6f, 0x65, 0x73, 0x3a, 0x1e, 1730xbb, 0x03, 0x07, 0x65, 0x00, 0x64, 0x6f, 0x65, 0x73, 0x3a,
1740x04, 0x02, 0x8d, 0x02, 0x0e, 0x0e, 0x01, 0x43, 0x6d, 0x6f, 1740x1e, 0x04, 0x03, 0x8d, 0x02, 0x0c, 0x0e, 0x01, 0x43, 0x6d,
1750x64, 0x65, 0xe2, 0x01, 0x02, 0xf5, 0x07, 0x43, 0x66, 0x69, 1750x6f, 0x64, 0x65, 0xe2, 0x01, 0x02, 0xf5, 0x07, 0x43, 0x66,
1760x6c, 0x6c, 0x97, 0x01, 0x61, 0x65, 0x6e, 0x74, 0x69, 0x72, 1760x69, 0x6c, 0x6c, 0x97, 0x01, 0x51, 0x65, 0x6e, 0x74, 0x69,
1770x65, 0xa5, 0x08, 0x20, 0x69, 0x6e, 0x9f, 0x03, 0x06, 0x48, 1770x72, 0x68, 0x02, 0x00, 0xf7, 0x02, 0x36, 0x62, 0x75, 0x74,
1780x04, 0x20, 0x6f, 0x72, 0xda, 0x01, 0x02, 0x4d, 0x05, 0x65, 1780x48, 0x04, 0x20, 0x6f, 0x72, 0xda, 0x01, 0x02, 0x4d, 0x05,
1790x61, 0x79, 0x6f, 0x75, 0x74, 0x2e, 0x6d, 0x04, 0x02, 0x5b, 1790x66, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x2e, 0x6d, 0x04, 0x01,
1800x01, 0x43, 0x00, 0x4c, 0x00, 0x64, 0x96, 0x06, 0x41, 0x6c, 1800xe2, 0x00, 0x43, 0x00, 0x4c, 0x00, 0x64, 0x96, 0x06, 0x41,
1810x61, 0x79, 0x2c, 0x2a, 0x00, 0x42, 0x67, 0x61, 0x6d, 0x65, 1810x6c, 0x61, 0x79, 0x2c, 0x2a, 0x00, 0x10, 0x67, 0x29, 0x07,
1820xcc, 0x00, 0x50, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x20, 0x02, 1820x01, 0xcc, 0x00, 0x50, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x20,
1830x10, 0x73, 0x1e, 0x00, 0x09, 0xf8, 0x08, 0x29, 0x69, 0x6e, 1830x02, 0x10, 0x73, 0x1e, 0x00, 0x09, 0xf8, 0x08, 0x29, 0x69,
1840xd8, 0x08, 0x24, 0x6f, 0x66, 0xec, 0x02, 0x39, 0x2e, 0x00, 1840x6e, 0xd8, 0x08, 0x24, 0x6f, 0x66, 0xec, 0x02, 0x00, 0x83,
1850x54, 0xcb, 0x00, 0x04, 0xb6, 0x00, 0x21, 0x77, 0x61, 0x5a, 1850x01, 0x09, 0xcb, 0x00, 0x03, 0xb6, 0x00, 0x22, 0x77, 0x61,
1860x08, 0x00, 0x4d, 0x00, 0x30, 0x63, 0x75, 0x73, 0x13, 0x01, 1860x5a, 0x08, 0x60, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x13,
1870x40, 0x70, 0x61, 0x72, 0x74, 0x63, 0x03, 0x25, 0x61, 0x72, 1870x01, 0x10, 0x70, 0x50, 0x05, 0x55, 0x63, 0x75, 0x6c, 0x61,
1880x7e, 0x07, 0x71, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 1880x72, 0x7e, 0x07, 0x40, 0x6e, 0x73, 0x74, 0x61, 0xa4, 0x02,
1890xff, 0x00, 0x00, 0x39, 0x07, 0x70, 0x72, 0x69, 0x65, 0x6e, 1890x01, 0xff, 0x00, 0xa0, 0x61, 0x00, 0x66, 0x72, 0x69, 0x65,
1900x64, 0x00, 0x2d, 0xf3, 0x00, 0x01, 0x9a, 0x04, 0x00, 0x76, 1900x6e, 0x64, 0x00, 0x2d, 0xf3, 0x00, 0x01, 0x9a, 0x04, 0x00,
1910x08, 0x60, 0x61, 0x6d, 0x62, 0x69, 0x67, 0x75, 0xf2, 0x02, 1910x76, 0x08, 0x60, 0x61, 0x6d, 0x62, 0x69, 0x67, 0x75, 0xf2,
1920x10, 0x6e, 0xa9, 0x00, 0x29, 0x66, 0x6f, 0x62, 0x09, 0x00, 1920x02, 0x10, 0x6e, 0xa9, 0x00, 0x2a, 0x66, 0x6f, 0x62, 0x09,
1930x79, 0x00, 0x10, 0x6d, 0x48, 0x09, 0x60, 0x65, 0x61, 0x73, 1930x40, 0x69, 0x73, 0x00, 0x6d, 0x48, 0x09, 0x60, 0x65, 0x61,
1940x69, 0x65, 0x72, 0x80, 0x02, 0x51, 0x6e, 0x00, 0x74, 0x72, 1940x73, 0x69, 0x65, 0x72, 0x80, 0x02, 0x51, 0x6e, 0x00, 0x74,
1950x79, 0xac, 0x01, 0x00, 0x55, 0x08, 0x42, 0x66, 0x65, 0x72, 1950x72, 0x79, 0xac, 0x01, 0x00, 0x55, 0x08, 0x10, 0x66, 0x15,
1960x00, 0x04, 0x06, 0x81, 0x6d, 0x00, 0x61, 0x6c, 0x6c, 0x00, 1960x00, 0x01, 0x04, 0x06, 0x50, 0x6d, 0x00, 0x61, 0x6c, 0x6c,
1970x62, 0x79, 0x48, 0x00, 0x13, 0x73, 0x7e, 0x09, 0x61, 0x73, 1970x79, 0x07, 0x00, 0x48, 0x00, 0x13, 0x73, 0x7e, 0x09, 0x30,
1980x00, 0x60, 0x74, 0x68, 0x65, 0xd0, 0x05, 0x40, 0x64, 0x6f, 1980x73, 0x00, 0x60, 0xc9, 0x00, 0x00, 0xd0, 0x05, 0x41, 0x64,
1990x77, 0x6e, 0x46, 0x06, 0x02, 0xfe, 0x04, 0x04, 0xe3, 0x00, 1990x6f, 0x77, 0x6e, 0x46, 0x06, 0x02, 0xfe, 0x04, 0x03, 0xe3,
2000x52, 0x62, 0x72, 0x6f, 0x77, 0x6e, 0xc3, 0x09, 0x12, 0x6e, 2000x00, 0x20, 0x62, 0x72, 0x17, 0x00, 0x01, 0xc3, 0x09, 0x12,
2010x68, 0x07, 0x23, 0x6f, 0x70, 0xdd, 0x08, 0x11, 0x27, 0x4b, 2010x6e, 0x68, 0x07, 0x23, 0x6f, 0x70, 0xdd, 0x08, 0x11, 0x27,
2020x06, 0x31, 0x41, 0x6c, 0x6c, 0x18, 0x00, 0x21, 0x61, 0x63, 2020x4b, 0x06, 0x31, 0x41, 0x6c, 0x6c, 0x18, 0x00, 0x21, 0x61,
2030xfc, 0x06, 0x00, 0x97, 0x06, 0x61, 0x63, 0x72, 0x69, 0x62, 2030x63, 0xfc, 0x06, 0x00, 0x97, 0x06, 0x61, 0x63, 0x72, 0x69,
2040x65, 0x64, 0xe3, 0x09, 0x03, 0x69, 0x03, 0x30, 0x32, 0x2e, 2040x62, 0x65, 0x64, 0xe3, 0x09, 0x03, 0x69, 0x03, 0x31, 0x32,
2050x31, 0x8e, 0x05, 0x02, 0x49, 0x04, 0x50, 0x61, 0x76, 0x61, 2050x2e, 0x31, 0x8e, 0x05, 0x01, 0x49, 0x04, 0x50, 0x61, 0x76,
2060x69, 0x6c, 0x6b, 0x07, 0x22, 0x2e, 0x29, 0x29, 0x07, 0x11, 2060x61, 0x69, 0x6c, 0x6b, 0x07, 0x22, 0x2e, 0x29, 0x29, 0x07,
2070x32, 0x29, 0x07, 0x00, 0xc5, 0x08, 0x52, 0x6d, 0x65, 0x74, 2070x11, 0x32, 0x29, 0x07, 0x00, 0xc5, 0x08, 0x52, 0x6d, 0x65,
2080x65, 0x72, 0x2b, 0x07, 0x56, 0x68, 0x65, 0x73, 0x65, 0x00, 2080x74, 0x65, 0x72, 0x2b, 0x07, 0x56, 0x68, 0x65, 0x73, 0x65,
2090x14, 0x00, 0x00, 0x3f, 0x00, 0x06, 0x3a, 0x00, 0x06, 0xfd, 2090x00, 0x14, 0x00, 0x02, 0x3f, 0x00, 0x04, 0x3a, 0x00, 0x06,
2100x05, 0xe2, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 2100xfd, 0x05, 0xe2, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d,
2110x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x4d, 0x04, 0x12, 0x6e, 2110x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x4d, 0x04, 0x12,
2120x1a, 0x00, 0xa0, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 2120x6e, 0x1a, 0x00, 0xa0, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00,
2130x65, 0x6e, 0x75, 0xa9, 0x00, 0x91, 0x57, 0x69, 0x64, 0x74, 2130x6d, 0x65, 0x6e, 0x75, 0xa9, 0x00, 0x91, 0x57, 0x69, 0x64,
2140x68, 0x2c, 0x00, 0x48, 0x65, 0xde, 0x00, 0x51, 0x00, 0x00, 2140x74, 0x68, 0x2c, 0x00, 0x48, 0x65, 0xde, 0x00, 0x51, 0x00,
2150x53, 0x69, 0x7a, 0x97, 0x0a, 0x32, 0x67, 0x72, 0x69, 0xab, 2150x00, 0x53, 0x69, 0x7a, 0x97, 0x0a, 0x32, 0x67, 0x72, 0x69,
2160x00, 0x51, 0x71, 0x75, 0x61, 0x72, 0x65, 0xbc, 0x07, 0x13, 2160xab, 0x00, 0x51, 0x71, 0x75, 0x61, 0x72, 0x65, 0xbc, 0x07,
2170x52, 0x2b, 0x06, 0x3b, 0x00, 0x00, 0x4e, 0xf6, 0x0a, 0x00, 2170x13, 0x52, 0x2b, 0x06, 0x3c, 0x00, 0x00, 0x4e, 0xf6, 0x0a,
2180x6a, 0x05, 0x02, 0x35, 0x02, 0x31, 0x65, 0x6e, 0x65, 0x74, 2180x22, 0x00, 0x69, 0x5d, 0x00, 0x41, 0x67, 0x65, 0x6e, 0x65,
2190x09, 0x00, 0x04, 0x02, 0x01, 0x4f, 0x06, 0x05, 0x41, 0x05, 2190x74, 0x09, 0x02, 0x04, 0x02, 0x36, 0x00, 0x00, 0x44, 0x41,
2200x00, 0x73, 0x02, 0x81, 0x6e, 0x00, 0x60, 0x45, 0x61, 0x73, 2200x05, 0xb1, 0x00, 0x00, 0x49, 0x6e, 0x00, 0x60, 0x45, 0x61,
2210x79, 0x27, 0xc9, 0x02, 0x13, 0x2c, 0x8f, 0x06, 0x20, 0x73, 2210x73, 0x79, 0x27, 0xc9, 0x02, 0x13, 0x2c, 0x8f, 0x06, 0x21,
2220x68, 0xd4, 0x04, 0x04, 0x11, 0x07, 0x2f, 0x62, 0x65, 0x4f, 2220x73, 0x68, 0xd4, 0x04, 0x03, 0x11, 0x07, 0x2f, 0x62, 0x65,
2230x07, 0x02, 0x43, 0x77, 0x68, 0x6f, 0x73, 0x09, 0x05, 0x05, 2230x4f, 0x07, 0x02, 0x45, 0x77, 0x68, 0x6f, 0x73, 0x09, 0x05,
2240xd0, 0x03, 0x10, 0x64, 0x02, 0x01, 0x30, 0x6d, 0x69, 0x6e, 2240x03, 0xd0, 0x03, 0x10, 0x64, 0x02, 0x01, 0x30, 0x6d, 0x69,
2250xe6, 0x02, 0x40, 0x72, 0x69, 0x76, 0x69, 0xf6, 0x09, 0x11, 2250x6e, 0xe6, 0x02, 0x40, 0x72, 0x69, 0x76, 0x69, 0xf6, 0x09,
2260x2e, 0x65, 0x00, 0x71, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 2260x11, 0x2e, 0x65, 0x00, 0x71, 0x4e, 0x6f, 0x72, 0x6d, 0x61,
2270x27, 0xb7, 0x01, 0x52, 0x60, 0x48, 0x61, 0x72, 0x64, 0x72, 2270x6c, 0x27, 0xb7, 0x01, 0x52, 0x60, 0x48, 0x61, 0x72, 0x64,
2280x00, 0x11, 0x73, 0x44, 0x07, 0x01, 0xd5, 0x02, 0x03, 0x34, 2280x72, 0x00, 0x12, 0x73, 0x44, 0x07, 0x01, 0xd5, 0x02, 0x02,
2290x0b, 0x02, 0xbf, 0x05, 0x20, 0x69, 0x6e, 0x09, 0x04, 0x00, 2290x34, 0x0b, 0x02, 0xbf, 0x05, 0x20, 0x69, 0x6e, 0x09, 0x04,
2300xe8, 0x03, 0x10, 0x6c, 0x0c, 0x0b, 0x00, 0xdd, 0x09, 0x71, 2300x00, 0xe8, 0x03, 0x10, 0x6c, 0x0c, 0x0b, 0x00, 0xdd, 0x09,
2310x78, 0x00, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0xab, 0x02, 0x5a, 2310x71, 0x78, 0x00, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0xab, 0x02,
2320x65, 0x64, 0x75, 0x63, 0x65, 0xbc, 0x05, 0x09, 0x47, 0x0b, 2320x5b, 0x65, 0x64, 0x75, 0x63, 0x65, 0xbc, 0x05, 0x08, 0x47,
2330x50, 0x2e, 0x00, 0x48, 0x6f, 0x77, 0x20, 0x0a, 0x49, 0x2c, 2330x0b, 0x50, 0x2e, 0x00, 0x48, 0x6f, 0x77, 0x20, 0x0a, 0x10,
2340x00, 0x69, 0x74, 0x38, 0x08, 0x25, 0x62, 0x65, 0xe1, 0x07, 2340x2c, 0x56, 0x05, 0x08, 0x38, 0x08, 0x25, 0x62, 0x65, 0xe1,
2350x13, 0x00, 0x32, 0x04, 0x00, 0x79, 0x00, 0x03, 0x86, 0x02, 2350x07, 0x14, 0x00, 0x32, 0x04, 0x03, 0xc5, 0x02, 0x70, 0x74,
2360x50, 0x67, 0x75, 0x65, 0x73, 0x73, 0xb3, 0x07, 0xa3, 0x62, 2360x6f, 0x00, 0x67, 0x75, 0x65, 0x73, 0x69, 0x0a, 0xb3, 0x00,
2370x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x2e, 0x25, 2370x62, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x2e,
2380x01, 0x20, 0x55, 0x6e, 0x90, 0x00, 0x20, 0x6f, 0x6e, 0xd4, 2380x25, 0x01, 0x20, 0x55, 0x6e, 0x90, 0x00, 0x20, 0x6f, 0x6e,
2390x01, 0x05, 0x2d, 0x01, 0x0c, 0x9c, 0x08, 0x80, 0x66, 0x65, 2390xd4, 0x01, 0x07, 0x2d, 0x01, 0x0a, 0x9c, 0x08, 0x81, 0x66,
2400x65, 0x6c, 0x00, 0x66, 0x72, 0x65, 0xc7, 0x00, 0x04, 0x79, 2400x65, 0x65, 0x6c, 0x00, 0x66, 0x72, 0x65, 0xc7, 0x00, 0x04,
2410x01, 0x04, 0xf6, 0x07, 0x03, 0x30, 0x0b, 0x02, 0x1e, 0x02, 2410x79, 0x01, 0x03, 0x44, 0x03, 0x04, 0x30, 0x0b, 0x01, 0x1e,
2420x11, 0x73, 0xce, 0x06, 0x00, 0x08, 0x00, 0x20, 0x69, 0x74, 2420x02, 0x11, 0x73, 0xce, 0x06, 0x00, 0x08, 0x00, 0x21, 0x69,
2430x3c, 0x01, 0x04, 0x94, 0x00, 0x15, 0x79, 0xe0, 0x0b, 0x11, 2430x74, 0x3c, 0x01, 0x03, 0x94, 0x00, 0x15, 0x79, 0xe0, 0x0b,
2440x6d, 0x9b, 0x06, 0x01, 0x56, 0x0b, 0x01, 0xe2, 0x0c, 0x01, 2440x12, 0x6d, 0x9b, 0x06, 0x01, 0x56, 0x0b, 0x00, 0xe2, 0x0c,
2450x35, 0x0a, 0x11, 0x74, 0xc0, 0x0c, 0x12, 0x68, 0x11, 0x07, 2450x01, 0x35, 0x0a, 0x11, 0x74, 0xc0, 0x0c, 0x12, 0x68, 0x11,
2460x14, 0x79, 0xa7, 0x01, 0x25, 0x73, 0x74, 0x3e, 0x01, 0x12, 2460x07, 0x14, 0x79, 0xa7, 0x01, 0x25, 0x73, 0x74, 0x3e, 0x01,
2470x61, 0xfd, 0x0b, 0x06, 0x0d, 0x0c, 0x51, 0x2e, 0x00, 0x53, 2470x13, 0x61, 0xfd, 0x0b, 0x05, 0x0d, 0x0c, 0x51, 0x2e, 0x00,
2480x6f, 0x6c, 0xde, 0x00, 0x07, 0xc1, 0x00, 0x05, 0x93, 0x00, 2480x53, 0x6f, 0x6c, 0xde, 0x00, 0x08, 0xc1, 0x00, 0x05, 0x93,
2490x00, 0x86, 0x0b, 0x04, 0xf5, 0x0b, 0x02, 0xfc, 0x00, 0x02, 2490x00, 0x00, 0x86, 0x0b, 0x03, 0xf5, 0x0b, 0x02, 0xfc, 0x00,
2500xcd, 0x03, 0x16, 0x64, 0x00, 0x01, 0x50, 0x69, 0x6e, 0x67, 2500x02, 0xcd, 0x03, 0x16, 0x64, 0x00, 0x01, 0x50, 0x69, 0x6e,
2510x2e, 0x00, 2510x67, 0x2e, 0x00,
252}; 252};
253 253
254const unsigned short help_text_len = 3466; 254const unsigned short help_text_len = 3466;
diff --git a/apps/plugins/puzzles/help/mines.c b/apps/plugins/puzzles/help/mines.c
index ad20406b3a..317d626292 100644
--- a/apps/plugins/puzzles/help/mines.c
+++ b/apps/plugins/puzzles/help/mines.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -20,7 +20,7 @@ struct style_text help_text_style[] = {
20 LAST_STYLE_ITEM 20 LAST_STYLE_ITEM
21}; 21};
22 22
23/* orig 3796 comp 2332 ratio 0.614331 level 11 saved 1464 */ 23/* orig 3796 comp 2333 ratio 0.614594 level 10 saved 1463 */
24const char help_text[] = { 24const char help_text[] = {
250xf0, 0x2e, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 250xf0, 0x2e, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
260x31, 0x32, 0x3a, 0x20, 0x4d, 0x69, 0x6e, 0x65, 0x73, 0x20, 260x31, 0x32, 0x3a, 0x20, 0x4d, 0x69, 0x6e, 0x65, 0x73, 0x20,
@@ -37,17 +37,17 @@ const char help_text[] = {
370x73, 0x00, 0x74, 0x6f, 0x00, 0x75, 0x6e, 0x59, 0x00, 0x63, 370x73, 0x00, 0x74, 0x6f, 0x00, 0x75, 0x6e, 0x59, 0x00, 0x63,
380x00, 0x65, 0x76, 0x65, 0x72, 0x79, 0x5d, 0x00, 0x03, 0x53, 380x00, 0x65, 0x76, 0x65, 0x72, 0x79, 0x5d, 0x00, 0x03, 0x53,
390x00, 0x85, 0x64, 0x6f, 0x65, 0x73, 0x00, 0x6e, 0x6f, 0x74, 390x00, 0x85, 0x64, 0x6f, 0x65, 0x73, 0x00, 0x6e, 0x6f, 0x74,
400x5c, 0x00, 0x11, 0x61, 0x5e, 0x00, 0x40, 0x2e, 0x00, 0x49, 400x5c, 0x00, 0x11, 0x61, 0x5e, 0x00, 0x41, 0x2e, 0x00, 0x49,
410x66, 0x5c, 0x00, 0x05, 0x3b, 0x00, 0x13, 0x61, 0x37, 0x00, 410x66, 0x5c, 0x00, 0x04, 0x3b, 0x00, 0x14, 0x61, 0x37, 0x00,
420x04, 0x28, 0x00, 0x33, 0x69, 0x6e, 0x67, 0x2b, 0x00, 0x11, 420x03, 0x28, 0x00, 0x33, 0x69, 0x6e, 0x67, 0x2b, 0x00, 0x11,
430x2c, 0x28, 0x00, 0x3f, 0x6c, 0x6f, 0x73, 0x35, 0x00, 0x00, 430x2c, 0x28, 0x00, 0x3f, 0x6c, 0x6f, 0x73, 0x35, 0x00, 0x08,
440x0f, 0x6c, 0x00, 0x0b, 0x09, 0x41, 0x00, 0x00, 0x27, 0x00, 440x0f, 0x6c, 0x00, 0x0a, 0x02, 0x41, 0x00, 0x00, 0x27, 0x00,
450xd2, 0x74, 0x6f, 0x6c, 0x64, 0x00, 0x68, 0x6f, 0x77, 0x00, 450xd2, 0x74, 0x6f, 0x6c, 0x64, 0x00, 0x68, 0x6f, 0x77, 0x00,
460x6d, 0x61, 0x6e, 0x79, 0xe6, 0x00, 0x17, 0x00, 0x74, 0x00, 460x6d, 0x61, 0x6e, 0x79, 0xe6, 0x00, 0x17, 0x00, 0x74, 0x00,
470xf4, 0x10, 0x65, 0x64, 0x00, 0x77, 0x69, 0x74, 0x68, 0x69, 470xf0, 0x0d, 0x65, 0x64, 0x00, 0x77, 0x69, 0x74, 0x68, 0x69,
480x6e, 0x00, 0x74, 0x68, 0x65, 0x00, 0x65, 0x69, 0x67, 0x68, 480x6e, 0x00, 0x74, 0x68, 0x65, 0x00, 0x65, 0x69, 0x67, 0x68,
490x74, 0x00, 0x73, 0x75, 0x72, 0x72, 0x6f, 0x75, 0x6e, 0x64, 490x74, 0x00, 0x73, 0x75, 0x72, 0x72, 0x6f, 0x75, 0x6e, 0x64,
500x69, 0x6e, 0x67, 0x36, 0x01, 0xf0, 0x03, 0x2e, 0x00, 0x00, 500x90, 0x00, 0x03, 0x36, 0x01, 0xf0, 0x03, 0x2e, 0x00, 0x00,
510x00, 0x54, 0x68, 0x69, 0x73, 0x00, 0x67, 0x61, 0x6d, 0x65, 510x00, 0x54, 0x68, 0x69, 0x73, 0x00, 0x67, 0x61, 0x6d, 0x65,
520x00, 0x6e, 0x65, 0x65, 0x64, 0x76, 0x00, 0xf0, 0x1a, 0x00, 520x00, 0x6e, 0x65, 0x65, 0x64, 0x76, 0x00, 0xf0, 0x1a, 0x00,
530x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 530x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69,
@@ -60,8 +60,8 @@ const char help_text[] = {
600x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x00, 0x70, 0x75, 0x7a, 600x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x00, 0x70, 0x75, 0x7a,
610x7a, 0x6c, 0x65, 0x67, 0x00, 0xc5, 0x69, 0x6e, 0x00, 0x65, 610x7a, 0x6c, 0x65, 0x67, 0x00, 0xc5, 0x69, 0x6e, 0x00, 0x65,
620x78, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x81, 0x00, 620x78, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x81, 0x00,
630xa0, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x00, 0x6f, 630x70, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0xc1, 0x01,
640x66, 0x58, 0x00, 0xf1, 0x14, 0x68, 0x61, 0x73, 0x00, 0x61, 640xf1, 0x17, 0x69, 0x74, 0x00, 0x68, 0x61, 0x73, 0x00, 0x61,
650x6e, 0x00, 0x75, 0x6e, 0x75, 0x73, 0x75, 0x61, 0x6c, 0x00, 650x6e, 0x00, 0x75, 0x6e, 0x75, 0x73, 0x75, 0x61, 0x6c, 0x00,
660x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2e, 0x00, 660x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2e, 0x00,
670x42, 0x79, 0x00, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 670x42, 0x79, 0x00, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
@@ -73,32 +73,32 @@ const char help_text[] = {
730x40, 0x65, 0x6e, 0x73, 0x75, 0x42, 0x01, 0x22, 0x68, 0x61, 730x40, 0x65, 0x6e, 0x73, 0x75, 0x42, 0x01, 0x22, 0x68, 0x61,
740x14, 0x02, 0x10, 0x6e, 0xec, 0x01, 0x01, 0xfd, 0x00, 0x00, 740x14, 0x02, 0x10, 0x6e, 0xec, 0x01, 0x01, 0xfd, 0x00, 0x00,
750x1e, 0x00, 0xb3, 0x67, 0x75, 0x65, 0x73, 0x73, 0x00, 0x77, 750x1e, 0x00, 0xb3, 0x67, 0x75, 0x65, 0x73, 0x73, 0x00, 0x77,
760x68, 0x65, 0x72, 0x65, 0x75, 0x01, 0x40, 0x00, 0x69, 0x73, 760x68, 0x65, 0x72, 0x65, 0x75, 0x01, 0x41, 0x00, 0x69, 0x73,
770x3a, 0x29, 0x00, 0x02, 0x6e, 0x00, 0xe0, 0x61, 0x6c, 0x77, 770x3a, 0x29, 0x00, 0x01, 0x6e, 0x00, 0xe0, 0x61, 0x6c, 0x77,
780x61, 0x79, 0x73, 0x00, 0x62, 0x65, 0x00, 0x61, 0x62, 0x6c, 780x61, 0x79, 0x73, 0x00, 0x62, 0x65, 0x00, 0x61, 0x62, 0x6c,
790x65, 0x32, 0x00, 0x50, 0x64, 0x65, 0x64, 0x75, 0x63, 0x7e, 790x65, 0x32, 0x00, 0x50, 0x64, 0x65, 0x64, 0x75, 0x63, 0x7e,
800x00, 0x01, 0x83, 0x02, 0x75, 0x68, 0x6f, 0x77, 0x2e, 0x00, 800x00, 0x01, 0x83, 0x02, 0x76, 0x68, 0x6f, 0x77, 0x2e, 0x00,
810x53, 0x6f, 0x31, 0x00, 0x02, 0x5f, 0x00, 0x10, 0x2c, 0x7c, 810x53, 0x6f, 0x31, 0x00, 0x01, 0x5f, 0x00, 0x10, 0x2c, 0x7c,
820x00, 0xa0, 0x63, 0x61, 0x6e, 0x00, 0x68, 0x61, 0x70, 0x70, 820x00, 0xa0, 0x63, 0x61, 0x6e, 0x00, 0x68, 0x61, 0x70, 0x70,
830x65, 0x6e, 0x98, 0x00, 0x54, 0x6f, 0x74, 0x68, 0x65, 0x72, 830x65, 0x6e, 0x98, 0x00, 0x54, 0x6f, 0x74, 0x68, 0x65, 0x72,
840xf8, 0x00, 0x91, 0x73, 0x2c, 0x00, 0x67, 0x65, 0x74, 0x00, 840xf8, 0x00, 0x60, 0x73, 0x2c, 0x00, 0x67, 0x65, 0x74, 0x4e,
850x74, 0x6f, 0x48, 0x01, 0x93, 0x6c, 0x61, 0x73, 0x74, 0x00, 850x00, 0x00, 0x48, 0x01, 0x60, 0x6c, 0x61, 0x73, 0x74, 0x00,
860x66, 0x6f, 0x75, 0x72, 0xa8, 0x01, 0x00, 0x0d, 0x01, 0x51, 860x66, 0x99, 0x02, 0x03, 0xa8, 0x01, 0x82, 0x00, 0x61, 0x6e,
870x64, 0x00, 0x64, 0x69, 0x73, 0x2c, 0x02, 0x02, 0xba, 0x00, 870x64, 0x00, 0x64, 0x69, 0x73, 0x2c, 0x02, 0x01, 0xba, 0x00,
880x10, 0x74, 0xa2, 0x00, 0x02, 0x0b, 0x02, 0x23, 0x77, 0x6f, 880x12, 0x74, 0xa2, 0x00, 0x00, 0xc9, 0x00, 0x23, 0x77, 0x6f,
890x01, 0x02, 0x42, 0x6c, 0x65, 0x66, 0x74, 0xeb, 0x02, 0x04, 890x01, 0x02, 0x45, 0x6c, 0x65, 0x66, 0x74, 0xeb, 0x02, 0x01,
900x30, 0x03, 0x21, 0x6e, 0x6f, 0xf9, 0x00, 0x21, 0x6f, 0x66, 900x30, 0x03, 0x21, 0x6e, 0x6f, 0xf9, 0x00, 0x21, 0x6f, 0x66,
910x90, 0x01, 0x00, 0xfa, 0x01, 0x40, 0x66, 0x6f, 0x72, 0x00, 910x90, 0x01, 0x00, 0xfa, 0x01, 0x41, 0x66, 0x6f, 0x72, 0x00,
920x00, 0x01, 0x02, 0xe3, 0x00, 0x00, 0x47, 0x00, 0x41, 0x79, 920x00, 0x01, 0x02, 0xe3, 0x00, 0x40, 0x74, 0x68, 0x65, 0x79,
930x00, 0x61, 0x72, 0x89, 0x01, 0x43, 0x31, 0x32, 0x2e, 0x31, 930x46, 0x00, 0x00, 0x89, 0x01, 0x43, 0x31, 0x32, 0x2e, 0x31,
940x74, 0x03, 0x20, 0x63, 0x6f, 0x03, 0x02, 0x38, 0x6c, 0x73, 940x74, 0x03, 0x20, 0x63, 0x6f, 0x03, 0x02, 0x39, 0x6c, 0x73,
950x20, 0x21, 0x02, 0x01, 0xef, 0x01, 0x33, 0x6c, 0x61, 0x79, 950x20, 0x21, 0x02, 0x00, 0xef, 0x01, 0x33, 0x6c, 0x61, 0x79,
960x5d, 0x02, 0x01, 0xab, 0x00, 0x40, 0x6d, 0x6f, 0x75, 0x73, 960x5d, 0x02, 0x01, 0xab, 0x00, 0x41, 0x6d, 0x6f, 0x75, 0x73,
970x3d, 0x00, 0x03, 0xd0, 0x02, 0x01, 0x83, 0x00, 0x70, 0x2d, 970x3d, 0x00, 0x03, 0xd0, 0x02, 0x00, 0x83, 0x00, 0x71, 0x2d,
980x63, 0x6c, 0x69, 0x63, 0x6b, 0x00, 0xb6, 0x02, 0x0b, 0xa7, 980x63, 0x6c, 0x69, 0x63, 0x6b, 0x00, 0xb6, 0x02, 0x0a, 0xa7,
990x03, 0x06, 0xb5, 0x01, 0x24, 0x62, 0x65, 0xfb, 0x02, 0x27, 990x03, 0x06, 0xb5, 0x01, 0x24, 0x62, 0x65, 0xfb, 0x02, 0x27,
1000x65, 0x64, 0x3f, 0x00, 0x4f, 0x72, 0x69, 0x67, 0x68, 0x40, 1000x65, 0x64, 0x3f, 0x00, 0x10, 0x72, 0xaa, 0x02, 0x0f, 0x40,
1010x00, 0x11, 0x00, 0x88, 0x00, 0x10, 0x63, 0xa1, 0x01, 0x43, 1010x00, 0x11, 0x40, 0x70, 0x6c, 0x61, 0x63, 0xa1, 0x01, 0x43,
1020x66, 0x6c, 0x61, 0x67, 0x34, 0x03, 0x95, 0x69, 0x6e, 0x64, 1020x66, 0x6c, 0x61, 0x67, 0x34, 0x03, 0x95, 0x69, 0x6e, 0x64,
1030x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x21, 0x01, 0x04, 0x54, 1030x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x21, 0x01, 0x04, 0x54,
1040x03, 0x10, 0x69, 0xb0, 0x01, 0x42, 0x6c, 0x69, 0x65, 0x76, 1040x03, 0x10, 0x69, 0xb0, 0x01, 0x42, 0x6c, 0x69, 0x65, 0x76,
@@ -106,156 +106,156 @@ const char help_text[] = {
1060x00, 0x00, 0x1c, 0x01, 0x02, 0x68, 0x03, 0x35, 0x61, 0x72, 1060x00, 0x00, 0x1c, 0x01, 0x02, 0x68, 0x03, 0x35, 0x61, 0x72,
1070x6b, 0x71, 0x00, 0x03, 0xc3, 0x01, 0x25, 0x6f, 0x74, 0xa9, 1070x6b, 0x71, 0x00, 0x03, 0xc3, 0x01, 0x25, 0x6f, 0x74, 0xa9,
1080x03, 0x32, 0x69, 0x74, 0x2c, 0x44, 0x01, 0x51, 0x61, 0x66, 1080x03, 0x32, 0x69, 0x74, 0x2c, 0x44, 0x01, 0x51, 0x61, 0x66,
1090x65, 0x74, 0x79, 0x40, 0x04, 0x00, 0xd9, 0x01, 0x09, 0xba, 1090x65, 0x74, 0x79, 0x40, 0x04, 0x01, 0xd9, 0x01, 0x08, 0xba,
1100x00, 0x50, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x6a, 0x00, 0x63, 1100x00, 0x30, 0x61, 0x67, 0x61, 0x7a, 0x03, 0x83, 0x6f, 0x00,
1110x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x55, 0x00, 0x02, 0xb4, 1110x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x55, 0x00, 0x02, 0xb4,
1120x00, 0x11, 0x64, 0x00, 0x03, 0x4f, 0x72, 0x72, 0x6f, 0x72, 1120x00, 0x11, 0x64, 0x00, 0x03, 0x4f, 0x72, 0x72, 0x6f, 0x72,
1130x36, 0x01, 0x05, 0x02, 0xfa, 0x02, 0x0f, 0xf9, 0x00, 0x05, 1130x36, 0x01, 0x07, 0x00, 0xfa, 0x02, 0x0f, 0xf9, 0x00, 0x05,
1140x81, 0x60, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x00, 0x61, 0xcb, 1140x81, 0x60, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x00, 0x61, 0xcb,
1150x03, 0x17, 0x27, 0xe6, 0x00, 0x12, 0x2e, 0xa9, 0x01, 0x97, 1150x03, 0x17, 0x27, 0xe6, 0x00, 0x12, 0x2e, 0xa9, 0x01, 0x98,
1160x6d, 0x65, 0x61, 0x6e, 0x73, 0x3a, 0x00, 0x69, 0x66, 0x1b, 1160x6d, 0x65, 0x61, 0x6e, 0x73, 0x3a, 0x00, 0x69, 0x66, 0x01,
1170x00, 0x01, 0x50, 0x03, 0x60, 0x65, 0x78, 0x61, 0x63, 0x74, 1170x01, 0x00, 0x50, 0x03, 0x61, 0x65, 0x78, 0x61, 0x63, 0x74,
1180x6c, 0x05, 0x03, 0x01, 0x34, 0x04, 0x01, 0x3a, 0x01, 0x18, 1180x6c, 0x05, 0x03, 0x01, 0x34, 0x04, 0x00, 0x3a, 0x01, 0x19,
1190x73, 0x15, 0x04, 0x00, 0x63, 0x00, 0x21, 0x61, 0x73, 0xc8, 1190x73, 0x15, 0x04, 0x20, 0x69, 0x74, 0x1d, 0x00, 0x00, 0xc8,
1200x02, 0x51, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x42, 0x02, 0x03, 1200x02, 0x52, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x42, 0x02, 0x03,
1210x41, 0x05, 0x00, 0x4d, 0x00, 0x50, 0x6e, 0x00, 0x61, 0x6c, 1210x41, 0x05, 0x81, 0x74, 0x68, 0x65, 0x6e, 0x00, 0x61, 0x6c,
1220x6c, 0x09, 0x00, 0x0c, 0x7c, 0x05, 0x41, 0x00, 0x6e, 0x65, 1220x6c, 0x56, 0x00, 0x0b, 0x7c, 0x05, 0x41, 0x00, 0x6e, 0x65,
1230x78, 0xbc, 0x02, 0x22, 0x69, 0x74, 0x8b, 0x01, 0x00, 0x51, 1230x78, 0xbc, 0x02, 0x23, 0x69, 0x74, 0x8b, 0x01, 0x00, 0x74,
1240x02, 0x00, 0x35, 0x01, 0x01, 0x64, 0x00, 0x3e, 0x67, 0x65, 1240x00, 0x00, 0x35, 0x01, 0x00, 0x64, 0x00, 0x3e, 0x67, 0x65,
1250x64, 0xf3, 0x01, 0x01, 0x23, 0x03, 0x41, 0x6f, 0x6e, 0x63, 1250x64, 0xf3, 0x01, 0x01, 0x23, 0x03, 0x41, 0x6f, 0x6e, 0x63,
1260x65, 0xff, 0x00, 0x00, 0xa9, 0x04, 0x10, 0x6b, 0x0a, 0x00, 1260x65, 0xff, 0x00, 0x00, 0xa9, 0x04, 0x11, 0x6b, 0x0a, 0x00,
1270x01, 0xa6, 0x02, 0x02, 0x03, 0x03, 0x42, 0x6f, 0x63, 0x61, 1270x01, 0x9a, 0x05, 0x01, 0x03, 0x03, 0x43, 0x6f, 0x63, 0x61,
1280x74, 0x11, 0x04, 0x03, 0x77, 0x00, 0x03, 0x8b, 0x00, 0x03, 1280x74, 0x11, 0x04, 0x04, 0x77, 0x00, 0x04, 0xe6, 0x04, 0x00,
1290xfa, 0x00, 0x04, 0x31, 0x05, 0x03, 0x13, 0x05, 0x10, 0x63, 1290xb0, 0x00, 0x05, 0x31, 0x05, 0x02, 0x13, 0x05, 0x10, 0x63,
1300x34, 0x01, 0x40, 0x73, 0x65, 0x00, 0x74, 0x03, 0x01, 0x41, 1300x34, 0x01, 0x20, 0x73, 0x65, 0x4a, 0x00, 0x61, 0x73, 0x00,
1310x66, 0x75, 0x6e, 0x63, 0x3c, 0x00, 0x00, 0x46, 0x04, 0x00, 1310x66, 0x75, 0x6e, 0x63, 0x3c, 0x00, 0x00, 0x46, 0x04, 0x00,
1320xcd, 0x00, 0x41, 0x72, 0x74, 0x63, 0x75, 0xa1, 0x00, 0x41, 1320xcd, 0x00, 0x41, 0x72, 0x74, 0x63, 0x75, 0xa1, 0x00, 0x41,
1330x61, 0x76, 0x6f, 0x69, 0xd8, 0x00, 0x30, 0x69, 0x6e, 0x67, 1330x61, 0x76, 0x6f, 0x69, 0xd8, 0x00, 0x00, 0xef, 0x00, 0x32,
1340x10, 0x00, 0x02, 0x73, 0x01, 0x91, 0x6f, 0x6e, 0x00, 0x65, 1340x74, 0x6f, 0x00, 0x73, 0x01, 0x92, 0x6f, 0x6e, 0x00, 0x65,
1350x61, 0x63, 0x68, 0x00, 0x6f, 0x34, 0x01, 0x00, 0xb5, 0x01, 1350x61, 0x63, 0x68, 0x00, 0x6f, 0x34, 0x01, 0x33, 0x72, 0x65,
1360x02, 0xb6, 0x05, 0x05, 0xe0, 0x00, 0x30, 0x6f, 0x6e, 0x65, 1360x6d, 0xb6, 0x05, 0x04, 0xe0, 0x00, 0x30, 0x6f, 0x6e, 0x65,
1370xfa, 0x04, 0x20, 0x6f, 0x6e, 0xea, 0x02, 0x0f, 0xba, 0x05, 1370xfa, 0x04, 0x28, 0x6f, 0x6e, 0xea, 0x02, 0x0f, 0xba, 0x05,
1380x0b, 0x01, 0x6b, 0x01, 0x14, 0x6e, 0x91, 0x03, 0x02, 0x80, 1380x04, 0x00, 0x6b, 0x01, 0x14, 0x6e, 0x91, 0x03, 0x03, 0x80,
1390x05, 0x08, 0x65, 0x01, 0x02, 0x8c, 0x05, 0x02, 0x33, 0x00, 1390x05, 0x08, 0x65, 0x01, 0x03, 0x8c, 0x05, 0x04, 0xb6, 0x06,
1400x04, 0x58, 0x01, 0x03, 0x4a, 0x05, 0x91, 0x6f, 0x62, 0x76, 1400x01, 0x58, 0x01, 0x02, 0x4a, 0x05, 0x91, 0x6f, 0x62, 0x76,
1410x69, 0x6f, 0x75, 0x73, 0x6c, 0x79, 0x5c, 0x02, 0x08, 0x8d, 1410x69, 0x6f, 0x75, 0x73, 0x6c, 0x79, 0x5c, 0x02, 0x08, 0x8d,
1420x06, 0x43, 0x74, 0x68, 0x6f, 0x73, 0xcc, 0x01, 0x03, 0x55, 1420x06, 0x44, 0x74, 0x68, 0x6f, 0x73, 0xcc, 0x01, 0x02, 0x55,
1430x00, 0x41, 0x75, 0x72, 0x6e, 0x2c, 0x15, 0x04, 0x10, 0x73, 1430x00, 0x41, 0x75, 0x72, 0x6e, 0x2c, 0x15, 0x04, 0x10, 0x73,
1440x47, 0x01, 0x00, 0xee, 0x01, 0x33, 0x61, 0x6e, 0x79, 0xc1, 1440x47, 0x01, 0x00, 0xee, 0x01, 0x00, 0xd3, 0x01, 0x02, 0xc1,
1450x00, 0x63, 0x6d, 0x00, 0x61, 0x6c, 0x73, 0x6f, 0x89, 0x00, 1450x00, 0x64, 0x6d, 0x00, 0x61, 0x6c, 0x73, 0x6f, 0x89, 0x00,
1460x08, 0x7c, 0x00, 0x02, 0x95, 0x00, 0x02, 0x28, 0x02, 0x04, 1460x08, 0x7c, 0x00, 0x01, 0x95, 0x00, 0x03, 0x28, 0x02, 0x04,
1470x93, 0x01, 0x00, 0x12, 0x07, 0x10, 0x65, 0xd1, 0x02, 0x02, 1470x93, 0x01, 0x10, 0x64, 0xdd, 0x00, 0x00, 0xd1, 0x02, 0x01,
1480x5a, 0x06, 0xd0, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 1480x5a, 0x06, 0xd0, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69,
1490x63, 0x61, 0x6c, 0x6c, 0x79, 0x3b, 0x5d, 0x00, 0x00, 0xd3, 1490x63, 0x61, 0x6c, 0x6c, 0x79, 0x3b, 0x5d, 0x00, 0x00, 0xd3,
1500x04, 0x41, 0x74, 0x69, 0x6d, 0x65, 0x13, 0x05, 0x1f, 0x6e, 1500x04, 0x41, 0x74, 0x69, 0x6d, 0x65, 0x13, 0x05, 0x1f, 0x6e,
1510xf9, 0x00, 0x02, 0x10, 0x2c, 0x5e, 0x05, 0x30, 0x68, 0x6f, 1510xf9, 0x00, 0x02, 0x10, 0x2c, 0x5e, 0x05, 0x30, 0x68, 0x6f,
1520x6c, 0x41, 0x06, 0x10, 0x77, 0xfb, 0x01, 0x12, 0x61, 0x5d, 1520x6c, 0x41, 0x06, 0x10, 0x77, 0xfb, 0x01, 0x12, 0x61, 0x5d,
1530x00, 0x10, 0x6f, 0xe9, 0x04, 0x23, 0x75, 0x70, 0x72, 0x03, 1530x00, 0x10, 0x6f, 0xe9, 0x04, 0x23, 0x75, 0x70, 0x72, 0x03,
1540x52, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0xed, 0x03, 0x04, 0x34, 1540x53, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0xed, 0x03, 0x04, 0x34,
1550x03, 0x01, 0xa8, 0x00, 0x00, 0xb7, 0x01, 0x02, 0x55, 0x02, 1550x03, 0x01, 0xa8, 0x00, 0x02, 0xb7, 0x01, 0xc1, 0x65, 0x00,
1560x91, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x00, 0x6b, 0x65, 0x79, 1560x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x00, 0x6b, 0x65, 0x79,
1570xa6, 0x05, 0x00, 0x39, 0x03, 0x03, 0xec, 0x01, 0x05, 0xfd, 1570xa6, 0x05, 0x02, 0x39, 0x03, 0x02, 0xec, 0x01, 0x04, 0xfd,
1580x01, 0xb0, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x00, 0x50, 1580x01, 0xb0, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x00, 0x50,
1590x72, 0x65, 0x73, 0x6b, 0x06, 0x03, 0xae, 0x01, 0x00, 0x0d, 1590x72, 0x65, 0x73, 0x6b, 0x06, 0x03, 0xae, 0x01, 0x00, 0x0d,
1600x01, 0x00, 0x37, 0x00, 0x0f, 0x31, 0x04, 0x00, 0x05, 0x72, 1600x01, 0x00, 0x37, 0x00, 0x0f, 0x31, 0x04, 0x01, 0x04, 0xad,
1610x02, 0x00, 0xd7, 0x02, 0x01, 0x31, 0x01, 0x0a, 0x60, 0x03, 1610x00, 0x00, 0xd7, 0x02, 0x02, 0x31, 0x01, 0x0e, 0x60, 0x03,
1620x0b, 0xe8, 0x03, 0x08, 0x5b, 0x03, 0x00, 0x95, 0x01, 0x31, 1620x06, 0xe8, 0x03, 0x08, 0x5b, 0x03, 0x00, 0x95, 0x01, 0x31,
1630x28, 0x73, 0x6f, 0x15, 0x03, 0x51, 0x63, 0x74, 0x73, 0x00, 1630x28, 0x73, 0x6f, 0x15, 0x03, 0x52, 0x63, 0x74, 0x73, 0x00,
1640x61, 0xe3, 0x06, 0x05, 0x63, 0x05, 0x78, 0x74, 0x6f, 0x6e, 1640x61, 0xe3, 0x06, 0x04, 0x63, 0x05, 0x78, 0x74, 0x6f, 0x6e,
1650x29, 0x2c, 0x00, 0x70, 0x8a, 0x00, 0x20, 0x73, 0x70, 0x93, 1650x29, 0x2c, 0x00, 0x70, 0x8a, 0x00, 0x20, 0x73, 0x70, 0x93,
1660x04, 0x3f, 0x62, 0x61, 0x72, 0x89, 0x00, 0x02, 0x0e, 0xb6, 1660x04, 0x3f, 0x62, 0x61, 0x72, 0x89, 0x00, 0x02, 0x0e, 0xb6,
1670x04, 0xbb, 0x28, 0x73, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72, 1670x04, 0xbc, 0x28, 0x73, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72,
1680x6c, 0x79, 0x2c, 0x66, 0x00, 0x01, 0x4d, 0x04, 0x05, 0x67, 1680x6c, 0x79, 0x2c, 0x66, 0x00, 0x01, 0x4d, 0x04, 0x04, 0x67,
1690x00, 0x00, 0x32, 0x01, 0x13, 0x41, 0x03, 0x03, 0x21, 0x61, 1690x00, 0x00, 0x32, 0x01, 0x13, 0x41, 0x03, 0x03, 0x22, 0x61,
1700x63, 0xd8, 0x06, 0x00, 0x58, 0x07, 0x42, 0x63, 0x72, 0x69, 1700x63, 0xd8, 0x06, 0x72, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
1710x62, 0x4e, 0x04, 0x22, 0x73, 0x65, 0xef, 0x02, 0x30, 0x32, 1710x62, 0x4e, 0x04, 0x22, 0x73, 0x65, 0xef, 0x02, 0x31, 0x32,
1720x2e, 0x31, 0x7f, 0x01, 0x02, 0x57, 0x01, 0x81, 0x61, 0x76, 1720x2e, 0x31, 0x7a, 0x03, 0x01, 0x57, 0x01, 0x50, 0x61, 0x76,
1730x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0xb3, 0x02, 0xc5, 0x45, 1730x61, 0x69, 0x6c, 0xa3, 0x06, 0x00, 0x3f, 0x00, 0x90, 0x45,
1740x76, 0x65, 0x6e, 0x00, 0x55, 0x6e, 0x64, 0x6f, 0x00, 0x69, 1740x76, 0x65, 0x6e, 0x00, 0x55, 0x6e, 0x64, 0x6f, 0x68, 0x02,
1750x73, 0x1a, 0x00, 0x00, 0xb9, 0x01, 0x71, 0x6c, 0x74, 0x68, 1750x05, 0x1a, 0x00, 0xa1, 0x2c, 0x00, 0x61, 0x6c, 0x74, 0x68,
1760x6f, 0x75, 0x67, 0x68, 0xd8, 0x01, 0x41, 0x6d, 0x69, 0x67, 1760x6f, 0x75, 0x67, 0x68, 0xd8, 0x01, 0x11, 0x6d, 0x75, 0x00,
1770x68, 0x71, 0x08, 0x31, 0x73, 0x69, 0x64, 0xe9, 0x04, 0x63, 1770x61, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0xe9, 0x04, 0x63,
1780x00, 0x63, 0x68, 0x65, 0x61, 0x74, 0x2b, 0x03, 0x20, 0x75, 1780x00, 0x63, 0x68, 0x65, 0x61, 0x74, 0x2b, 0x03, 0x20, 0x75,
1790x73, 0xe3, 0x06, 0x05, 0xb8, 0x08, 0x64, 0x73, 0x74, 0x65, 1790x73, 0xe3, 0x06, 0x05, 0xb8, 0x08, 0x66, 0x73, 0x74, 0x65,
1800x70, 0x00, 0x6f, 0x98, 0x08, 0x01, 0xc8, 0x02, 0x00, 0xa7, 1800x70, 0x00, 0x6f, 0x98, 0x08, 0x00, 0x9d, 0x00, 0x73, 0x70,
1810x07, 0x43, 0x67, 0x72, 0x61, 0x6d, 0xfe, 0x01, 0x95, 0x6e, 1810x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0xfe, 0x01, 0x96, 0x6e,
1820x6c, 0x79, 0x00, 0x72, 0x65, 0x76, 0x65, 0x61, 0xbd, 0x03, 1820x6c, 0x79, 0x00, 0x72, 0x65, 0x76, 0x65, 0x61, 0xbd, 0x03,
1830x01, 0xfb, 0x07, 0x41, 0x71, 0x75, 0x65, 0x73, 0xae, 0x00, 1830x00, 0xad, 0x00, 0x41, 0x71, 0x75, 0x65, 0x73, 0xae, 0x00,
1840x60, 0x28, 0x75, 0x6e, 0x6c, 0x69, 0x6b, 0x42, 0x06, 0x23, 1840x60, 0x28, 0x75, 0x6e, 0x6c, 0x69, 0x6b, 0x42, 0x06, 0x23,
1850x73, 0x74, 0x0d, 0x07, 0xb1, 0x69, 0x6d, 0x70, 0x6c, 0x65, 1850x73, 0x74, 0x0d, 0x07, 0xb2, 0x69, 0x6d, 0x70, 0x6c, 0x65,
1860x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x14, 0x07, 0x02, 0x53, 1860x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x14, 0x07, 0x02, 0x53,
1870x03, 0x03, 0x46, 0x00, 0x00, 0x07, 0x04, 0x04, 0xe2, 0x02, 1870x03, 0x03, 0x46, 0x00, 0x00, 0x07, 0x04, 0x03, 0xe2, 0x02,
1880x16, 0x29, 0x78, 0x05, 0x24, 0x74, 0x68, 0xdb, 0x00, 0x10, 1880x16, 0x29, 0x78, 0x05, 0x24, 0x74, 0x68, 0xdb, 0x00, 0x10,
1890x79, 0x31, 0x07, 0x53, 0x66, 0x61, 0x74, 0x61, 0x6c, 0x3d, 1890x79, 0x31, 0x07, 0x53, 0x66, 0x61, 0x74, 0x61, 0x6c, 0x3d,
1900x02, 0x21, 0x6e, 0x64, 0x0f, 0x09, 0x41, 0x69, 0x6e, 0x75, 1900x02, 0x21, 0x6e, 0x64, 0x0f, 0x09, 0x41, 0x69, 0x6e, 0x75,
1910x65, 0xb8, 0x06, 0x01, 0xe4, 0x04, 0x03, 0x71, 0x05, 0x20, 1910x65, 0xb8, 0x06, 0x01, 0xe4, 0x04, 0x03, 0x71, 0x05, 0x21,
1920x69, 0x6b, 0x31, 0x05, 0x0c, 0xb5, 0x00, 0x51, 0x74, 0x72, 1920x69, 0x6b, 0x31, 0x05, 0x0b, 0xb5, 0x00, 0x51, 0x74, 0x72,
1930x61, 0x63, 0x6b, 0xaf, 0x00, 0x60, 0x6e, 0x75, 0x6d, 0x62, 1930x61, 0x63, 0x6b, 0xaf, 0x00, 0x61, 0x6e, 0x75, 0x6d, 0x62,
1940x65, 0x72, 0x70, 0x00, 0x01, 0xfe, 0x02, 0x02, 0x3d, 0x0a, 1940x65, 0x72, 0x70, 0x00, 0x01, 0xfe, 0x02, 0x01, 0x3d, 0x0a,
1950x81, 0x69, 0x65, 0x64, 0x00, 0x28, 0x61, 0x6e, 0x64, 0x70, 1950x50, 0x69, 0x65, 0x64, 0x00, 0x28, 0x57, 0x00, 0x01, 0x70,
1960x00, 0x06, 0x1b, 0x06, 0x10, 0x72, 0x01, 0x08, 0x03, 0x51, 1960x00, 0x05, 0x1b, 0x06, 0x12, 0x72, 0x01, 0x08, 0x01, 0x76,
1970x08, 0x80, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x29, 1970x06, 0x80, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x29,
1980x90, 0x0a, 0x05, 0x33, 0x03, 0x08, 0xdc, 0x07, 0x32, 0x65, 1980x90, 0x0a, 0x06, 0x33, 0x03, 0x07, 0xdc, 0x07, 0x34, 0x65,
1990x6e, 0x64, 0xc6, 0x00, 0x02, 0x0e, 0x09, 0x05, 0xf6, 0x04, 1990x6e, 0x64, 0x69, 0x04, 0x01, 0x54, 0x07, 0x05, 0xf6, 0x04,
2000x00, 0x2d, 0x00, 0x01, 0x05, 0x01, 0x20, 0x6f, 0x72, 0x55, 2000x31, 0x77, 0x68, 0x65, 0x05, 0x01, 0x21, 0x6f, 0x72, 0x55,
2010x00, 0x03, 0x71, 0x00, 0x12, 0x64, 0xf8, 0x05, 0x00, 0xa6, 2010x00, 0x02, 0x71, 0x00, 0x12, 0x64, 0xf8, 0x05, 0x00, 0xa6,
2020x01, 0x40, 0x74, 0x00, 0x6d, 0x61, 0xa6, 0x06, 0x00, 0xea, 2020x01, 0x41, 0x74, 0x00, 0x6d, 0x61, 0xa6, 0x06, 0x00, 0xea,
2030x03, 0x02, 0x41, 0x06, 0x01, 0xbf, 0x09, 0x14, 0x28, 0x3a, 2030x03, 0x01, 0x41, 0x06, 0x01, 0xbf, 0x09, 0x14, 0x28, 0x3a,
2040x07, 0x10, 0x65, 0xb4, 0x03, 0x40, 0x00, 0x77, 0x61, 0x6e, 2040x07, 0x10, 0x65, 0xb4, 0x03, 0x41, 0x00, 0x77, 0x61, 0x6e,
2050x6b, 0x00, 0x06, 0x49, 0x05, 0xb3, 0x66, 0x75, 0x6c, 0x6c, 2050x6b, 0x00, 0x05, 0x49, 0x05, 0x80, 0x66, 0x75, 0x6c, 0x6c,
2060x00, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x78, 0x00, 0x01, 2060x00, 0x6c, 0x61, 0x79, 0x41, 0x00, 0x04, 0x78, 0x00, 0x34,
2070x43, 0x0b, 0x03, 0x5c, 0x01, 0x0f, 0x79, 0x01, 0x02, 0x02, 2070x72, 0x69, 0x64, 0x5c, 0x01, 0x0f, 0x79, 0x01, 0x02, 0x02,
2080x1d, 0x04, 0x00, 0x39, 0x05, 0x12, 0x77, 0x16, 0x04, 0x43, 2080xdb, 0x00, 0x10, 0x73, 0x5f, 0x0a, 0x01, 0x16, 0x04, 0x44,
2090x66, 0x74, 0x65, 0x72, 0x91, 0x00, 0x06, 0x70, 0x05, 0x03, 2090x66, 0x74, 0x65, 0x72, 0x02, 0x01, 0x06, 0x70, 0x05, 0x03,
2100x0a, 0x09, 0x05, 0xc0, 0x03, 0x30, 0x53, 0x6f, 0x6c, 0x2f, 2100x0a, 0x09, 0x04, 0xc0, 0x03, 0x30, 0x53, 0x6f, 0x6c, 0x2f,
2110x06, 0x60, 0x65, 0x6e, 0x75, 0x00, 0x6f, 0x70, 0x47, 0x00, 2110x06, 0x60, 0x65, 0x6e, 0x75, 0x00, 0x6f, 0x70, 0x47, 0x00,
2120x22, 0x2e, 0x29, 0x54, 0x08, 0x13, 0x32, 0x54, 0x08, 0x93, 2120x22, 0x2e, 0x29, 0x54, 0x08, 0x13, 0x32, 0x54, 0x08, 0x93,
2130x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x56, 2130x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x56,
2140x08, 0x13, 0x65, 0x28, 0x00, 0x07, 0x92, 0x02, 0x51, 0x00, 2140x08, 0x13, 0x65, 0x28, 0x00, 0x07, 0x92, 0x02, 0x51, 0x00,
2150x66, 0x72, 0x6f, 0x6d, 0x4e, 0x00, 0xb3, 0x60, 0x43, 0x75, 2150x66, 0x72, 0x6f, 0x6d, 0x4e, 0x00, 0xb3, 0x60, 0x43, 0x75,
2160x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x27, 0x00, 2160x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x27, 0x00,
2170x32, 0x00, 0x6f, 0x6e, 0x1a, 0x00, 0x50, 0x54, 0x79, 0x70, 2170x00, 0x6e, 0x02, 0x01, 0x1a, 0x00, 0x52, 0x54, 0x79, 0x70,
2180x65, 0x27, 0x69, 0x00, 0x01, 0x0a, 0x0b, 0xc2, 0x3a, 0x00, 2180x65, 0x27, 0x69, 0x00, 0xf2, 0x00, 0x61, 0x72, 0x65, 0x3a,
2190x00, 0x00, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 0x48, 2190x00, 0x00, 0x00, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x00,
2200x5c, 0x05, 0x50, 0x00, 0x00, 0x53, 0x69, 0x7a, 0x0b, 0x0c, 2200x48, 0x5c, 0x05, 0x51, 0x00, 0x00, 0x53, 0x69, 0x7a, 0x0b,
2210x02, 0x2c, 0x0c, 0x28, 0x69, 0x6e, 0xee, 0x0a, 0x11, 0x4d, 2210x0c, 0x01, 0x2c, 0x0c, 0x28, 0x69, 0x6e, 0xee, 0x0a, 0x11,
2220x98, 0x05, 0x34, 0x00, 0x00, 0x4e, 0xe0, 0x01, 0x05, 0xaa, 2220x4d, 0x98, 0x05, 0x35, 0x00, 0x00, 0x4e, 0xe0, 0x01, 0x09,
2230x05, 0x05, 0x1b, 0x01, 0x06, 0x5c, 0x02, 0x10, 0x65, 0xcb, 2230xaa, 0x05, 0x00, 0x32, 0x00, 0x06, 0x5c, 0x02, 0x10, 0x65,
2240x01, 0x02, 0x54, 0x06, 0x02, 0x91, 0x0a, 0x72, 0x61, 0x62, 2240xcb, 0x01, 0x02, 0x54, 0x06, 0x02, 0x91, 0x0a, 0x73, 0x61,
2250x73, 0x6f, 0x6c, 0x75, 0x74, 0xce, 0x02, 0x02, 0xec, 0x01, 2250x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0xce, 0x02, 0x01, 0xec,
2260x40, 0x2c, 0x00, 0x6f, 0x72, 0x48, 0x03, 0xa5, 0x65, 0x72, 2260x01, 0x10, 0x2c, 0xb1, 0x01, 0xd5, 0x61, 0x6c, 0x74, 0x65,
2270x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x79, 0x21, 0x01, 2270x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x79, 0x21,
2280xb5, 0x70, 0x75, 0x74, 0x00, 0x61, 0x00, 0x25, 0x00, 0x73, 2280x01, 0xb5, 0x70, 0x75, 0x74, 0x00, 0x61, 0x00, 0x25, 0x00,
2290x69, 0x67, 0xbe, 0x00, 0x11, 0x65, 0x83, 0x04, 0x04, 0xa5, 2290x73, 0x69, 0x67, 0xbe, 0x00, 0x12, 0x65, 0x83, 0x04, 0x03,
2300x0c, 0x35, 0x61, 0x73, 0x65, 0x0a, 0x02, 0x03, 0x5f, 0x0a, 2300xa5, 0x0c, 0x36, 0x61, 0x73, 0x65, 0x0a, 0x02, 0x02, 0x5f,
2310x50, 0x72, 0x72, 0x61, 0x6e, 0x67, 0x92, 0x05, 0x02, 0xe8, 2310x0a, 0x52, 0x72, 0x72, 0x61, 0x6e, 0x67, 0x92, 0x05, 0x01,
2320x09, 0x01, 0xfc, 0x0a, 0x22, 0x6f, 0x72, 0x01, 0x01, 0x07, 2320x51, 0x02, 0x00, 0xfc, 0x0a, 0x24, 0x6f, 0x72, 0x0b, 0x07,
2330xd4, 0x07, 0x09, 0xb3, 0x00, 0x03, 0xd6, 0x08, 0x04, 0xe0, 2330x06, 0xd4, 0x07, 0x09, 0xb3, 0x00, 0x03, 0x64, 0x05, 0x03,
2340x05, 0x71, 0x00, 0x00, 0x42, 0x65, 0x77, 0x61, 0x72, 0x03, 2340xe0, 0x05, 0x71, 0x00, 0x00, 0x42, 0x65, 0x77, 0x61, 0x72,
2350x01, 0x42, 0x73, 0x65, 0x74, 0x74, 0xa1, 0x04, 0x06, 0xb5, 2350x03, 0x01, 0x44, 0x73, 0x65, 0x74, 0x74, 0xa1, 0x04, 0x06,
2360x00, 0x01, 0x22, 0x02, 0xb0, 0x6f, 0x00, 0x68, 0x69, 0x67, 2360xb5, 0x00, 0xe1, 0x00, 0x74, 0x6f, 0x6f, 0x00, 0x68, 0x69,
2370x68, 0x2e, 0x00, 0x41, 0x74, 0x00, 0xeb, 0x0c, 0x01, 0x0e, 2370x67, 0x68, 0x2e, 0x00, 0x41, 0x74, 0x00, 0xeb, 0x0c, 0x00,
2380x00, 0x40, 0x00, 0x64, 0x65, 0x6e, 0x3a, 0x0b, 0x2a, 0x65, 2380x0e, 0x00, 0x40, 0x00, 0x64, 0x65, 0x6e, 0x3a, 0x0b, 0x2a,
2390x73, 0xd1, 0x03, 0x90, 0x6d, 0x61, 0x79, 0x00, 0x73, 0x70, 2390x65, 0x73, 0xd1, 0x03, 0x60, 0x6d, 0x61, 0x79, 0x00, 0x73,
2400x65, 0x6e, 0x64, 0x97, 0x00, 0x01, 0x2e, 0x0b, 0x62, 0x73, 2400x70, 0xbb, 0x00, 0x31, 0x66, 0x6f, 0x72, 0x2e, 0x0b, 0x64,
2410x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x0a, 0x01, 0x0a, 0x06, 2410x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x0a, 0x61, 0x61,
2420x62, 0x6f, 0x6c, 0x76, 0x61, 0x62, 0x6c, 0x8e, 0x00, 0x01, 2420x00, 0x73, 0x6f, 0x6c, 0x76, 0xc1, 0x01, 0x02, 0x41, 0x01,
2430x72, 0x04, 0x01, 0x65, 0x0b, 0x10, 0x20, 0x2f, 0x01, 0x60, 2430x31, 0x00, 0x00, 0x45, 0x65, 0x0b, 0x10, 0x20, 0x2f, 0x01,
2440x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0xa7, 0x01, 0x31, 0x68, 2440x60, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0xa7, 0x01, 0x00,
2450x65, 0x6e, 0x4e, 0x01, 0x03, 0xd2, 0x01, 0x00, 0x8d, 0x04, 2450x0f, 0x03, 0x01, 0x4e, 0x01, 0x03, 0xd2, 0x01, 0x50, 0x69,
2460x51, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x57, 0x03, 0x13, 0x73, 2460x73, 0x00, 0x65, 0x6e, 0x37, 0x00, 0x00, 0x57, 0x03, 0x13,
2470x07, 0x07, 0x15, 0x62, 0xe3, 0x0b, 0x21, 0x29, 0x2c, 0xaf, 2470x73, 0x07, 0x07, 0x15, 0x62, 0xe3, 0x0b, 0x23, 0x29, 0x2c,
2480x01, 0x02, 0x8f, 0x02, 0x08, 0xb7, 0x0b, 0x03, 0x4a, 0x01, 2480xaf, 0x01, 0x01, 0x1a, 0x01, 0x08, 0xb7, 0x0b, 0x02, 0x4a,
2490x32, 0x74, 0x69, 0x72, 0x71, 0x00, 0x01, 0x6e, 0x01, 0x12, 2490x01, 0x33, 0x74, 0x69, 0x72, 0xff, 0x00, 0x00, 0x6e, 0x01,
2500x62, 0xec, 0x02, 0x12, 0x79, 0x90, 0x0b, 0x00, 0x79, 0x05, 2500x12, 0x62, 0xec, 0x02, 0x13, 0x79, 0x90, 0x0b, 0x61, 0x64,
2510x30, 0x74, 0x61, 0x72, 0xfc, 0x00, 0x06, 0x55, 0x02, 0x62, 2510x00, 0x73, 0x74, 0x61, 0x72, 0xfc, 0x00, 0x05, 0x55, 0x02,
2520x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x9a, 0x06, 0x01, 0xaf, 2520x63, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x9a, 0x06, 0x01,
2530x05, 0x05, 0x88, 0x0d, 0x00, 0xca, 0x05, 0x33, 0x66, 0x65, 2530xaf, 0x05, 0x05, 0xd0, 0x04, 0x63, 0x70, 0x72, 0x65, 0x66,
2540x72, 0x7d, 0x05, 0x51, 0x73, 0x6b, 0x69, 0x65, 0x72, 0x5a, 2540x65, 0x72, 0x7d, 0x05, 0x51, 0x73, 0x6b, 0x69, 0x65, 0x72,
2550x00, 0x14, 0x73, 0x5e, 0x0c, 0x01, 0xfc, 0x0c, 0x0f, 0x2e, 2550x5a, 0x00, 0x15, 0x73, 0x5e, 0x0c, 0x01, 0xfc, 0x0c, 0x0f,
2560x03, 0x03, 0x06, 0x12, 0x03, 0x41, 0x73, 0x77, 0x69, 0x74, 2560xa7, 0x04, 0x04, 0x04, 0xf1, 0x01, 0x41, 0x73, 0x77, 0x69,
2570x48, 0x08, 0x15, 0x66, 0xe7, 0x00, 0x50, 0x69, 0x6f, 0x6e, 2570x74, 0x48, 0x08, 0x15, 0x66, 0xe7, 0x00, 0x50, 0x69, 0x6f,
2580x2e, 0x00, 2580x6e, 0x2e, 0x00,
259}; 259};
260 260
261const unsigned short help_text_len = 3796; 261const unsigned short help_text_len = 3796;
diff --git a/apps/plugins/puzzles/help/net.c b/apps/plugins/puzzles/help/net.c
index 504de3fca5..d83892c110 100644
--- a/apps/plugins/puzzles/help/net.c
+++ b/apps/plugins/puzzles/help/net.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -27,7 +27,7 @@ struct style_text help_text_style[] = {
27 LAST_STYLE_ITEM 27 LAST_STYLE_ITEM
28}; 28};
29 29
30/* orig 3439 comp 2361 ratio 0.686537 level 11 saved 1078 */ 30/* orig 3439 comp 2361 ratio 0.686537 level 10 saved 1078 */
31const char help_text[] = { 31const char help_text[] = {
320xf4, 0x57, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 320xf4, 0x57, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
330x33, 0x3a, 0x20, 0x4e, 0x65, 0x74, 0x20, 0x00, 0x00, 0x00, 330x33, 0x3a, 0x20, 0x4e, 0x65, 0x74, 0x20, 0x00, 0x00, 0x00,
@@ -45,7 +45,7 @@ const char help_text[] = {
450x67, 0x69, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x00, 0x73, 0x61, 450x67, 0x69, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x00, 0x73, 0x61,
460x77, 0x62, 0x00, 0x21, 0x69, 0x6e, 0x81, 0x00, 0x40, 0x66, 460x77, 0x62, 0x00, 0x21, 0x69, 0x6e, 0x81, 0x00, 0x40, 0x66,
470x6f, 0x72, 0x6d, 0x76, 0x00, 0x30, 0x61, 0x00, 0x46, 0x4f, 470x6f, 0x72, 0x6d, 0x76, 0x00, 0x30, 0x61, 0x00, 0x46, 0x4f,
480x00, 0x01, 0x79, 0x00, 0x04, 0x76, 0x00, 0xf0, 0x18, 0x46, 480x00, 0x02, 0x79, 0x00, 0x03, 0x76, 0x00, 0xf0, 0x18, 0x46,
490x72, 0x65, 0x65, 0x4e, 0x65, 0x74, 0x00, 0x5b, 0x31, 0x5d, 490x72, 0x65, 0x65, 0x4e, 0x65, 0x74, 0x00, 0x5b, 0x31, 0x5d,
500x2c, 0x00, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x00, 500x2c, 0x00, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x00,
510x62, 0x79, 0x00, 0x50, 0x61, 0x76, 0x69, 0x6c, 0x73, 0x00, 510x62, 0x79, 0x00, 0x50, 0x61, 0x76, 0x69, 0x6c, 0x73, 0x00,
@@ -60,12 +60,12 @@ const char help_text[] = {
600x74, 0x65, 0x72, 0x00, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 600x74, 0x65, 0x72, 0x00, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72,
610x65, 0x73, 0x00, 0x61, 0x00, 0x6e, 0x65, 0x74, 0x77, 0x6f, 610x65, 0x73, 0x00, 0x61, 0x00, 0x6e, 0x65, 0x74, 0x77, 0x6f,
620x72, 0x6b, 0x73, 0x00, 0x70, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 620x72, 0x6b, 0x73, 0x00, 0x70, 0x63, 0x6f, 0x6e, 0x6e, 0x65,
630x63, 0x74, 0xee, 0x00, 0x21, 0x75, 0x70, 0x43, 0x00, 0x70, 630x63, 0x74, 0xee, 0x00, 0x21, 0x75, 0x70, 0x43, 0x00, 0x40,
640x63, 0x65, 0x6e, 0x74, 0x72, 0x65, 0x73, 0xbc, 0x00, 0x61, 640x63, 0x65, 0x6e, 0x74, 0x27, 0x00, 0x61, 0x6f, 0x66, 0x00,
650x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0xd3, 0x00, 0xb0, 0x61, 650x73, 0x71, 0x75, 0x32, 0x00, 0xe0, 0x69, 0x6e, 0x00, 0x61,
660x00, 0x67, 0x72, 0x69, 0x64, 0x2c, 0x00, 0x61, 0x6e, 0x64, 660x00, 0x67, 0x72, 0x69, 0x64, 0x2c, 0x00, 0x61, 0x6e, 0x64,
670x26, 0x00, 0xa0, 0x6e, 0x00, 0x73, 0x68, 0x75, 0x66, 0x66, 670x26, 0x00, 0xa2, 0x6e, 0x00, 0x73, 0x68, 0x75, 0x66, 0x66,
680x6c, 0x65, 0x73, 0x0e, 0x00, 0x08, 0x51, 0x00, 0x41, 0x72, 680x6c, 0x65, 0x73, 0x77, 0x00, 0x06, 0x51, 0x00, 0x41, 0x72,
690x6f, 0x74, 0x61, 0x4f, 0x00, 0x00, 0xb2, 0x00, 0xf0, 0x0a, 690x6f, 0x74, 0x61, 0x4f, 0x00, 0x00, 0xb2, 0x00, 0xf0, 0x0a,
700x79, 0x00, 0x74, 0x69, 0x6c, 0x65, 0x00, 0x72, 0x61, 0x6e, 700x79, 0x00, 0x74, 0x69, 0x6c, 0x65, 0x00, 0x72, 0x61, 0x6e,
710x64, 0x6f, 0x6d, 0x6c, 0x79, 0x2e, 0x00, 0x59, 0x6f, 0x75, 710x64, 0x6f, 0x6d, 0x6c, 0x79, 0x2e, 0x00, 0x59, 0x6f, 0x75,
@@ -81,8 +81,8 @@ const char help_text[] = {
810x03, 0x6e, 0x6f, 0x00, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, 810x03, 0x6e, 0x6f, 0x00, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64,
820x00, 0x6c, 0x6f, 0x6f, 0x70, 0x73, 0x2e, 0x00, 0x41, 0x02, 820x00, 0x6c, 0x6f, 0x6f, 0x70, 0x73, 0x2e, 0x00, 0x41, 0x02,
830x01, 0x81, 0x76, 0x69, 0x73, 0x75, 0x61, 0x6c, 0x00, 0x61, 830x01, 0x81, 0x76, 0x69, 0x73, 0x75, 0x61, 0x6c, 0x00, 0x61,
840xd3, 0x00, 0x21, 0x6c, 0x6c, 0xa7, 0x00, 0x70, 0x73, 0x00, 840xd3, 0x00, 0x21, 0x6c, 0x6c, 0xa7, 0x00, 0x71, 0x73, 0x00,
850x77, 0x68, 0x69, 0x63, 0x68, 0x70, 0x01, 0x07, 0x4e, 0x00, 850x77, 0x68, 0x69, 0x63, 0x68, 0x70, 0x01, 0x06, 0x4e, 0x00,
860x21, 0x74, 0x6f, 0xe2, 0x00, 0x34, 0x6f, 0x6e, 0x65, 0xda, 860x21, 0x74, 0x6f, 0xe2, 0x00, 0x34, 0x6f, 0x6e, 0x65, 0xda,
870x01, 0x52, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x97, 0x01, 0xe0, 870x01, 0x52, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x97, 0x01, 0xe0,
880x68, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x65, 880x68, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x65,
@@ -92,8 +92,8 @@ const char help_text[] = {
920x66, 0x66, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0xfc, 0x01, 0xa1, 920x66, 0x66, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0xfc, 0x01, 0xa1,
930x2e, 0x68, 0x74, 0x6d, 0x00, 0x00, 0x00, 0x33, 0x2e, 0x31, 930x2e, 0x68, 0x74, 0x6d, 0x00, 0x00, 0x00, 0x33, 0x2e, 0x31,
940xbd, 0x02, 0x80, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 940xbd, 0x02, 0x80, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c,
950x73, 0xc6, 0x02, 0x15, 0x54, 0xa8, 0x02, 0x60, 0x63, 0x61, 950x73, 0xc6, 0x02, 0x15, 0x54, 0xa8, 0x02, 0x30, 0x63, 0x61,
960x6e, 0x00, 0x62, 0x65, 0x0e, 0x01, 0x32, 0x79, 0x65, 0x64, 960x6e, 0xe7, 0x00, 0x62, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64,
970xcf, 0x00, 0x43, 0x65, 0x69, 0x74, 0x68, 0xec, 0x01, 0xb2, 970xcf, 0x00, 0x43, 0x65, 0x69, 0x74, 0x68, 0xec, 0x01, 0xb2,
980x6b, 0x65, 0x79, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x00, 0x6f, 980x6b, 0x65, 0x79, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x00, 0x6f,
990x72, 0x98, 0x00, 0x33, 0x6f, 0x75, 0x73, 0x35, 0x01, 0x04, 990x72, 0x98, 0x00, 0x33, 0x6f, 0x75, 0x73, 0x35, 0x01, 0x04,
@@ -106,15 +106,15 @@ const char help_text[] = {
1060x63, 0x6c, 0x6f, 0x63, 0x6b, 0x77, 0x69, 0x73, 0x65, 0x3a, 1060x63, 0x6c, 0x6f, 0x63, 0x6b, 0x77, 0x69, 0x73, 0x65, 0x3a,
1070x00, 0x6c, 0x65, 0x66, 0x74, 0x3c, 0x00, 0xb0, 0x62, 0x75, 1070x00, 0x6c, 0x65, 0x66, 0x74, 0x3c, 0x00, 0xb0, 0x62, 0x75,
1080x74, 0x74, 0x6f, 0x6e, 0x2c, 0x00, 0x60, 0x41, 0x27, 0x39, 1080x74, 0x74, 0x6f, 0x6e, 0x2c, 0x00, 0x60, 0x41, 0x27, 0x39,
1090x00, 0x0b, 0x38, 0x00, 0x07, 0x34, 0x00, 0x4d, 0x72, 0x69, 1090x00, 0x0b, 0x38, 0x00, 0x07, 0x34, 0x00, 0x10, 0x72, 0x1c,
1100x67, 0x68, 0x35, 0x00, 0x1f, 0x44, 0x35, 0x00, 0x01, 0xf4, 1100x01, 0x0c, 0x35, 0x00, 0x1f, 0x44, 0x35, 0x00, 0x01, 0xf4,
1110x03, 0x62, 0x79, 0x20, 0x31, 0x38, 0x30, 0x20, 0x64, 0x65, 1110x03, 0x62, 0x79, 0x20, 0x31, 0x38, 0x30, 0x20, 0x64, 0x65,
1120x67, 0x72, 0x65, 0x65, 0x73, 0x3a, 0x00, 0x60, 0x46, 0x26, 1120x67, 0x72, 0x65, 0x65, 0x73, 0x3a, 0x00, 0x60, 0x46, 0x26,
1130x00, 0xb0, 0x4c, 0x6f, 0x63, 0x6b, 0x20, 0x28, 0x6f, 0x72, 1130x00, 0xb0, 0x4c, 0x6f, 0x63, 0x6b, 0x20, 0x28, 0x6f, 0x72,
1140x20, 0x75, 0x6e, 0x59, 0x00, 0x12, 0x29, 0xc6, 0x00, 0x03, 1140x20, 0x75, 0x6e, 0x59, 0x00, 0x14, 0x29, 0xc6, 0x00, 0x02,
1150x86, 0x01, 0x0b, 0x5c, 0x00, 0xf3, 0x00, 0x73, 0x68, 0x69, 1150x86, 0x01, 0x0a, 0x5c, 0x00, 0xf4, 0x00, 0x73, 0x68, 0x69,
1160x66, 0x74, 0x2d, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x2c, 0x00, 1160x66, 0x74, 0x2d, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x2c, 0x00,
1170x60, 0x53, 0x43, 0x00, 0x00, 0x76, 0x02, 0x01, 0x4c, 0x01, 1170x60, 0x53, 0x43, 0x00, 0x31, 0x59, 0x6f, 0x75, 0x4c, 0x01,
1180x00, 0x40, 0x00, 0x22, 0x00, 0x61, 0x94, 0x02, 0xa0, 0x6f, 1180x00, 0x40, 0x00, 0x22, 0x00, 0x61, 0x94, 0x02, 0xa0, 0x6f,
1190x6e, 0x63, 0x65, 0x00, 0x79, 0x6f, 0x75, 0x27, 0x72, 0x64, 1190x6e, 0x63, 0x65, 0x00, 0x79, 0x6f, 0x75, 0x27, 0x72, 0x64,
1200x02, 0x20, 0x72, 0x65, 0xf0, 0x02, 0x30, 0x69, 0x74, 0x73, 1200x02, 0x20, 0x72, 0x65, 0xf0, 0x02, 0x30, 0x69, 0x74, 0x73,
@@ -122,70 +122,70 @@ const char help_text[] = {
1220x61, 0x6c, 0x73, 0x6f, 0x00, 0x80, 0x00, 0x01, 0xad, 0x02, 1220x61, 0x6c, 0x73, 0x6f, 0x00, 0x80, 0x00, 0x01, 0xad, 0x02,
1230x50, 0x67, 0x61, 0x69, 0x6e, 0x2c, 0x76, 0x00, 0x00, 0x33, 1230x50, 0x67, 0x61, 0x69, 0x6e, 0x2c, 0x76, 0x00, 0x00, 0x33,
1240x02, 0x10, 0x6c, 0xc1, 0x02, 0x21, 0x27, 0x73, 0x5e, 0x00, 1240x02, 0x10, 0x6c, 0xc1, 0x02, 0x21, 0x27, 0x73, 0x5e, 0x00,
1250x42, 0x65, 0x64, 0x00, 0x79, 0x34, 0x00, 0xb1, 0x27, 0x74, 1250x42, 0x65, 0x64, 0x00, 0x79, 0x34, 0x00, 0x80, 0x27, 0x74,
1260x00, 0x61, 0x63, 0x63, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x20, 1260x00, 0x61, 0x63, 0x63, 0x69, 0x64, 0x4d, 0x00, 0x00, 0x20,
1270x04, 0x80, 0x74, 0x75, 0x72, 0x6e, 0x00, 0x69, 0x74, 0x2e, 1270x04, 0x81, 0x74, 0x75, 0x72, 0x6e, 0x00, 0x69, 0x74, 0x2e,
1280xe1, 0x01, 0x01, 0x1f, 0x04, 0x79, 0x6c, 0x6c, 0x6f, 0x77, 1280xe1, 0x01, 0x00, 0x1f, 0x04, 0x40, 0x6c, 0x6c, 0x6f, 0x77,
1290x69, 0x6e, 0x67, 0xac, 0x01, 0x70, 0x00, 0x6e, 0x6f, 0x74, 1290x28, 0x03, 0x08, 0xac, 0x01, 0x70, 0x00, 0x6e, 0x6f, 0x74,
1300x00, 0x6e, 0x65, 0xf1, 0x02, 0x10, 0x61, 0x3d, 0x03, 0x11, 1300x00, 0x6e, 0x65, 0xf1, 0x02, 0x10, 0x61, 0x3d, 0x03, 0x11,
1310x6f, 0xbf, 0x03, 0x40, 0x6c, 0x65, 0x74, 0x65, 0xe2, 0x01, 1310x6f, 0xbf, 0x03, 0x41, 0x6c, 0x65, 0x74, 0x65, 0xe2, 0x01,
1320x01, 0x15, 0x02, 0x02, 0x77, 0x00, 0x30, 0x6d, 0x61, 0x79, 1320x00, 0x15, 0x02, 0x02, 0x77, 0x00, 0x30, 0x6d, 0x61, 0x79,
1330x1a, 0x02, 0x61, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0xe2, 1330x1a, 0x02, 0x61, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0xe2,
1340x01, 0x00, 0xfa, 0x00, 0x10, 0x20, 0xa4, 0x03, 0x12, 0x3a, 1340x01, 0x00, 0xfa, 0x00, 0x10, 0x20, 0xa4, 0x03, 0x12, 0x3a,
1350x0c, 0x00, 0x2a, 0x00, 0x2b, 0xda, 0x01, 0x21, 0x4f, 0x6e, 1350x0c, 0x00, 0x2a, 0x00, 0x2b, 0xda, 0x01, 0x21, 0x4f, 0x6e,
1360xc2, 0x03, 0x00, 0xb0, 0x03, 0x84, 0x61, 0x74, 0x00, 0x77, 1360xc2, 0x03, 0x00, 0xb0, 0x03, 0x84, 0x61, 0x74, 0x00, 0x77,
1370x72, 0x61, 0x70, 0x2c, 0xab, 0x00, 0x41, 0x00, 0x6d, 0x6f, 1370x72, 0x61, 0x70, 0x2c, 0xab, 0x00, 0x42, 0x00, 0x6d, 0x6f,
1380x76, 0x61, 0x00, 0x02, 0xd0, 0x04, 0x03, 0x2d, 0x05, 0x13, 1380x76, 0x61, 0x00, 0x02, 0xd0, 0x04, 0x02, 0x2d, 0x05, 0x13,
1390x65, 0xf2, 0x03, 0x21, 0x73, 0x6f, 0x33, 0x00, 0x01, 0x36, 1390x65, 0xf2, 0x03, 0x22, 0x73, 0x6f, 0x33, 0x00, 0x02, 0x23,
1400x01, 0x04, 0x3e, 0x00, 0x00, 0x97, 0x04, 0x00, 0x55, 0x05, 1400x03, 0x02, 0x3e, 0x00, 0x00, 0x97, 0x04, 0x00, 0x55, 0x05,
1410xd8, 0x70, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x00, 0x73, 1410xd8, 0x70, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x00, 0x73,
1420x69, 0x64, 0x65, 0x73, 0x37, 0x00, 0x04, 0xbb, 0x02, 0x90, 1420x69, 0x64, 0x65, 0x73, 0x37, 0x00, 0x04, 0xbb, 0x02, 0x90,
1430x73, 0x65, 0x65, 0x6e, 0x00, 0x74, 0x6f, 0x67, 0x65, 0xb6, 1430x73, 0x65, 0x65, 0x6e, 0x00, 0x74, 0x6f, 0x67, 0x65, 0xb6,
1440x02, 0x00, 0xfc, 0x00, 0x52, 0x4d, 0x6f, 0x76, 0x65, 0x20, 1440x02, 0x00, 0xfc, 0x00, 0x52, 0x4d, 0x6f, 0x76, 0x65, 0x20,
1450x63, 0x04, 0x69, 0x3a, 0x00, 0x43, 0x74, 0x72, 0x6c, 0xa8, 1450x63, 0x04, 0x6c, 0x3a, 0x00, 0x43, 0x74, 0x72, 0x6c, 0xa8,
1460x00, 0x07, 0xac, 0x01, 0x62, 0x63, 0x68, 0x61, 0x6e, 0x67, 1460x00, 0x04, 0x73, 0x01, 0x63, 0x63, 0x68, 0x61, 0x6e, 0x67,
1470x65, 0x93, 0x03, 0x00, 0x7c, 0x00, 0x01, 0xb6, 0x05, 0x10, 1470x65, 0x93, 0x03, 0x11, 0x74, 0x65, 0x01, 0x30, 0x73, 0x00,
1480x75, 0xc8, 0x03, 0x12, 0x61, 0x74, 0x04, 0x50, 0x73, 0x6f, 1480x75, 0xc8, 0x03, 0x12, 0x61, 0x74, 0x04, 0x51, 0x73, 0x6f,
1490x75, 0x72, 0x63, 0xb7, 0x01, 0x05, 0x86, 0x03, 0x00, 0x77, 1490x75, 0x72, 0x63, 0xb7, 0x01, 0x05, 0x86, 0x03, 0xd0, 0x69,
1500x04, 0xa0, 0x2e, 0x00, 0x28, 0x49, 0x74, 0x00, 0x64, 0x6f, 1500x6e, 0x67, 0x2e, 0x00, 0x28, 0x49, 0x74, 0x00, 0x64, 0x6f,
1510x65, 0x73, 0x82, 0x01, 0x70, 0x75, 0x6c, 0x74, 0x69, 0x6d, 1510x65, 0x73, 0x82, 0x01, 0x70, 0x75, 0x6c, 0x74, 0x69, 0x6d,
1520x61, 0x74, 0x20, 0x04, 0x67, 0x6d, 0x61, 0x74, 0x74, 0x65, 1520x61, 0x74, 0x20, 0x04, 0x30, 0x6d, 0x61, 0x74, 0x06, 0x05,
1530x72, 0x50, 0x00, 0x03, 0xae, 0x05, 0x57, 0x73, 0x2c, 0x00, 1530x07, 0x50, 0x00, 0x02, 0xae, 0x05, 0x20, 0x73, 0x2c, 0x51,
1540x61, 0x73, 0xad, 0x04, 0x03, 0x5d, 0x04, 0x0a, 0x03, 0x04, 1540x00, 0x07, 0xad, 0x04, 0x04, 0x5d, 0x04, 0x09, 0x03, 0x04,
1550x02, 0x20, 0x00, 0x02, 0x7e, 0x05, 0x01, 0x26, 0x00, 0x02, 1550x02, 0x20, 0x00, 0x02, 0x7e, 0x05, 0x02, 0x8d, 0x00, 0x00,
1560x13, 0x05, 0x74, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 1560x13, 0x05, 0x75, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74,
1570x99, 0x04, 0x03, 0x13, 0x02, 0x15, 0x69, 0x9f, 0x01, 0x74, 1570x99, 0x04, 0x02, 0x9c, 0x01, 0x15, 0x69, 0x9f, 0x01, 0x40,
1580x68, 0x65, 0x6c, 0x70, 0x66, 0x75, 0x6c, 0x39, 0x04, 0x01, 1580x68, 0x65, 0x6c, 0x70, 0xb9, 0x04, 0x03, 0x39, 0x04, 0x01,
1590x71, 0x03, 0x50, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x33, 0x01, 1590x71, 0x03, 0x50, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x33, 0x01,
1600x33, 0x74, 0x61, 0x67, 0x66, 0x05, 0x61, 0x6f, 0x6c, 0x76, 1600x33, 0x74, 0x61, 0x67, 0x66, 0x05, 0x30, 0x6f, 0x6c, 0x76,
1610x69, 0x6e, 0x67, 0x23, 0x00, 0x61, 0x70, 0x75, 0x7a, 0x7a, 1610x09, 0x02, 0x00, 0x23, 0x00, 0x61, 0x70, 0x75, 0x7a, 0x7a,
1620x6c, 0x65, 0x5e, 0x06, 0x51, 0x4a, 0x75, 0x6d, 0x62, 0x6c, 1620x6c, 0x65, 0x5e, 0x06, 0x52, 0x4a, 0x75, 0x6d, 0x62, 0x6c,
1630x1e, 0x03, 0x01, 0x10, 0x03, 0x11, 0x4a, 0xcd, 0x02, 0x04, 1630x1e, 0x03, 0x00, 0x10, 0x03, 0x14, 0x4a, 0xcd, 0x02, 0x01,
1640x1f, 0x04, 0x22, 0x6b, 0x65, 0x52, 0x02, 0x10, 0x73, 0xbe, 1640x1f, 0x04, 0x22, 0x6b, 0x65, 0x52, 0x02, 0x17, 0x73, 0xbe,
1650x04, 0x07, 0x9b, 0x01, 0x04, 0x45, 0x02, 0x04, 0x8d, 0x02, 1650x04, 0x01, 0x9b, 0x01, 0x04, 0x45, 0x02, 0x03, 0x8d, 0x02,
1660x23, 0x74, 0x6f, 0x7d, 0x05, 0x08, 0xd8, 0x02, 0x20, 0x73, 1660x23, 0x74, 0x6f, 0x7d, 0x05, 0x08, 0xd8, 0x02, 0x20, 0x73,
1670x2e, 0x2c, 0x07, 0x31, 0x41, 0x6c, 0x6c, 0x73, 0x00, 0x22, 1670x2e, 0x2c, 0x07, 0x31, 0x41, 0x6c, 0x6c, 0x73, 0x00, 0x22,
1680x61, 0x63, 0x45, 0x06, 0x90, 0x64, 0x65, 0x73, 0x63, 0x72, 1680x61, 0x63, 0x45, 0x06, 0x90, 0x64, 0x65, 0x73, 0x63, 0x72,
1690x69, 0x62, 0x65, 0x64, 0xaf, 0x00, 0x31, 0x73, 0x65, 0x63, 1690x69, 0x62, 0x65, 0x64, 0xaf, 0x00, 0x31, 0x73, 0x65, 0x63,
1700x6a, 0x05, 0x30, 0x32, 0x2e, 0x31, 0x53, 0x00, 0x02, 0x01, 1700x6a, 0x05, 0x31, 0x32, 0x2e, 0x31, 0x53, 0x00, 0x01, 0x01,
1710x03, 0x73, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0xa0, 1710x03, 0x73, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0xa0,
1720x00, 0x31, 0x33, 0x2e, 0x32, 0xbb, 0x04, 0x93, 0x70, 0x61, 1720x00, 0x31, 0x33, 0x2e, 0x32, 0xbb, 0x04, 0x93, 0x70, 0x61,
1730x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0xbd, 0x04, 0x45, 1730x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0xbd, 0x04, 0x10,
1740x65, 0x73, 0x65, 0x00, 0x14, 0x00, 0x01, 0xd6, 0x02, 0x06, 1740x65, 0x5d, 0x04, 0x05, 0x14, 0x00, 0x02, 0x3e, 0x00, 0x04,
1750x39, 0x00, 0x51, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x76, 0x00, 1750x39, 0x00, 0x51, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x76, 0x00,
1760xe1, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 1760xe1, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e,
1770x2e, 0x27, 0x00, 0x6f, 0x70, 0x6c, 0x00, 0x22, 0x6f, 0x6e, 1770x2e, 0x27, 0x00, 0x6f, 0x70, 0x6c, 0x00, 0x22, 0x6f, 0x6e,
1780x1a, 0x00, 0xa0, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 1780x1a, 0x00, 0xa0, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d,
1790x65, 0x6e, 0x75, 0xa8, 0x00, 0x90, 0x57, 0x69, 0x64, 0x74, 1790x65, 0x6e, 0x75, 0xa8, 0x00, 0x91, 0x57, 0x69, 0x64, 0x74,
1800x68, 0x2c, 0x00, 0x48, 0x65, 0xe1, 0x01, 0x00, 0xe9, 0x02, 1800x68, 0x2c, 0x00, 0x48, 0x65, 0x4b, 0x04, 0x51, 0x00, 0x00,
1810x20, 0x69, 0x7a, 0xf5, 0x01, 0x02, 0x66, 0x02, 0x22, 0x69, 1810x53, 0x69, 0x7a, 0xf5, 0x01, 0x01, 0x66, 0x02, 0x22, 0x69,
1820x6e, 0xfc, 0x00, 0x01, 0x29, 0x00, 0x50, 0x61, 0x6c, 0x6c, 1820x6e, 0xfc, 0x00, 0x01, 0x29, 0x00, 0x50, 0x61, 0x6c, 0x6c,
1830x73, 0x20, 0xd9, 0x02, 0x70, 0x20, 0x61, 0x72, 0x6f, 0x75, 1830x73, 0x20, 0xd9, 0x02, 0x70, 0x20, 0x61, 0x72, 0x6f, 0x75,
1840x6e, 0x64, 0xa2, 0x07, 0x50, 0x66, 0x00, 0x63, 0x68, 0x65, 1840x6e, 0x64, 0xa2, 0x07, 0x50, 0x66, 0x00, 0x63, 0x68, 0x65,
1850x0a, 0x01, 0x61, 0x2c, 0x00, 0x66, 0x6c, 0x6f, 0x77, 0x5a, 1850x0a, 0x01, 0x61, 0x2c, 0x00, 0x66, 0x6c, 0x6f, 0x77, 0x5a,
1860x02, 0x45, 0x70, 0x61, 0x73, 0x73, 0x89, 0x00, 0x02, 0xd7, 1860x02, 0x46, 0x70, 0x61, 0x73, 0x73, 0x89, 0x00, 0x01, 0xd7,
1870x04, 0x43, 0x65, 0x64, 0x67, 0x65, 0xea, 0x05, 0x01, 0xb4, 1870x04, 0x44, 0x65, 0x64, 0x67, 0x65, 0xea, 0x05, 0x02, 0xb4,
1880x04, 0x02, 0x12, 0x00, 0x01, 0xee, 0x06, 0x03, 0x2a, 0x00, 1880x04, 0x00, 0x12, 0x00, 0x02, 0xee, 0x06, 0x02, 0x2a, 0x00,
1890x20, 0x6f, 0x70, 0x20, 0x00, 0x62, 0x62, 0x6f, 0x74, 0x74, 1890x20, 0x6f, 0x70, 0x20, 0x00, 0x62, 0x62, 0x6f, 0x74, 0x74,
1900x6f, 0x6d, 0x18, 0x00, 0x41, 0x76, 0x69, 0x63, 0x65, 0x5f, 1900x6f, 0x6d, 0x18, 0x00, 0x41, 0x76, 0x69, 0x63, 0x65, 0x5f,
1910x08, 0x10, 0x61, 0x7e, 0x00, 0xf0, 0x03, 0x42, 0x61, 0x72, 1910x08, 0x10, 0x61, 0x7e, 0x00, 0xf0, 0x03, 0x42, 0x61, 0x72,
@@ -195,19 +195,19 @@ const char help_text[] = {
1950x77, 0x0b, 0x03, 0x31, 0x30, 0x2e, 0x30, 0x3d, 0x00, 0x34, 1950x77, 0x0b, 0x03, 0x31, 0x30, 0x2e, 0x30, 0x3d, 0x00, 0x34,
1960x31, 0x2e, 0x30, 0xf9, 0x03, 0x11, 0x6c, 0x6a, 0x08, 0x11, 1960x31, 0x2e, 0x30, 0xf9, 0x03, 0x11, 0x6c, 0x6a, 0x08, 0x11,
1970x68, 0x22, 0x03, 0x00, 0xd2, 0x06, 0x51, 0x69, 0x6d, 0x6d, 1970x68, 0x22, 0x03, 0x00, 0xd2, 0x06, 0x51, 0x69, 0x6d, 0x6d,
1980x6f, 0x76, 0x2d, 0x01, 0x12, 0x62, 0x54, 0x00, 0x32, 0x00, 1980x6f, 0x76, 0x2d, 0x01, 0x12, 0x62, 0x54, 0x00, 0x00, 0xf9,
1990x69, 0x73, 0x11, 0x07, 0x15, 0x64, 0x47, 0x00, 0x34, 0x74, 1990x02, 0x01, 0x11, 0x07, 0x15, 0x64, 0x47, 0x00, 0x34, 0x74,
2000x77, 0x6f, 0xf5, 0x01, 0x10, 0x6f, 0xd9, 0x07, 0x41, 0x76, 2000x77, 0x6f, 0xf5, 0x01, 0x10, 0x6f, 0xd9, 0x07, 0x42, 0x76,
2010x65, 0x6e, 0x74, 0xe1, 0x00, 0x06, 0x22, 0x00, 0x61, 0x68, 2010x65, 0x6e, 0x74, 0xe1, 0x00, 0x05, 0x22, 0x00, 0x61, 0x68,
2020x65, 0x6d, 0x00, 0x28, 0x61, 0x1c, 0x03, 0x24, 0x65, 0x72, 2020x65, 0x6d, 0x00, 0x28, 0x61, 0x1c, 0x03, 0x24, 0x65, 0x72,
2030x87, 0x00, 0x95, 0x67, 0x69, 0x76, 0x65, 0x73, 0x00, 0x6d, 2030x87, 0x00, 0x95, 0x67, 0x69, 0x76, 0x65, 0x73, 0x00, 0x6d,
2040x6f, 0x72, 0x5d, 0x00, 0x83, 0x73, 0x29, 0x2e, 0x00, 0x53, 2040x6f, 0x72, 0x5d, 0x00, 0x86, 0x73, 0x29, 0x2e, 0x00, 0x53,
2050x69, 0x6e, 0x63, 0x11, 0x00, 0x03, 0xb2, 0x01, 0x06, 0x85, 2050x69, 0x6e, 0x63, 0x11, 0x00, 0x01, 0xb2, 0x01, 0x05, 0x85,
2060x00, 0x10, 0x2c, 0x4a, 0x00, 0x10, 0x79, 0x25, 0x02, 0x30, 2060x00, 0x10, 0x2c, 0x4a, 0x00, 0x10, 0x79, 0x25, 0x02, 0x00,
2070x00, 0x61, 0x73, 0xb3, 0x00, 0x83, 0x73, 0x74, 0x72, 0x61, 2070x27, 0x03, 0xb4, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61,
2080x69, 0x6e, 0x74, 0x73, 0xaf, 0x01, 0x06, 0x95, 0x07, 0x80, 2080x69, 0x6e, 0x74, 0x73, 0xaf, 0x01, 0x05, 0x95, 0x07, 0x80,
2090x28, 0x69, 0x2e, 0x65, 0x2e, 0x2c, 0x00, 0x68, 0x1d, 0x00, 2090x28, 0x69, 0x2e, 0x65, 0x2e, 0x2c, 0x00, 0x68, 0x1d, 0x00,
2100x11, 0x29, 0xe7, 0x04, 0x04, 0x0c, 0x04, 0x51, 0x67, 0x65, 2100x14, 0x29, 0xe7, 0x04, 0x01, 0xa6, 0x01, 0x51, 0x67, 0x65,
2110x6e, 0x65, 0x72, 0x7a, 0x02, 0x00, 0xb1, 0x01, 0x00, 0xf9, 2110x6e, 0x65, 0x72, 0x7a, 0x02, 0x00, 0xb1, 0x01, 0x00, 0xf9,
2120x08, 0x50, 0x68, 0x61, 0x73, 0x00, 0x62, 0xa7, 0x00, 0x30, 2120x08, 0x50, 0x68, 0x61, 0x73, 0x00, 0x62, 0xa7, 0x00, 0x30,
2130x63, 0x61, 0x72, 0xc2, 0x04, 0x20, 0x6c, 0x79, 0x05, 0x04, 2130x63, 0x61, 0x72, 0xc2, 0x04, 0x20, 0x6c, 0x79, 0x05, 0x04,
@@ -215,54 +215,54 @@ const char help_text[] = {
2150x00, 0x60, 0x6e, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x52, 0x05, 2150x00, 0x60, 0x6e, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x52, 0x05,
2160x04, 0x6b, 0x04, 0x48, 0x72, 0x65, 0x73, 0x74, 0x77, 0x04, 2160x04, 0x6b, 0x04, 0x48, 0x72, 0x65, 0x73, 0x74, 0x77, 0x04,
2170x12, 0x2e, 0x1e, 0x03, 0x43, 0x6d, 0x65, 0x61, 0x6e, 0x10, 2170x12, 0x2e, 0x1e, 0x03, 0x43, 0x6d, 0x65, 0x61, 0x6e, 0x10,
2180x03, 0x20, 0x69, 0x66, 0xe6, 0x04, 0x00, 0x13, 0x03, 0x50, 2180x03, 0x21, 0x69, 0x66, 0xe6, 0x04, 0x82, 0x6e, 0x6f, 0x74,
2190x65, 0x00, 0x64, 0x6f, 0x77, 0xb4, 0x00, 0x04, 0x90, 0x08, 2190x65, 0x00, 0x64, 0x6f, 0x77, 0xb4, 0x00, 0x03, 0x13, 0x03,
2200x00, 0x9d, 0x04, 0x12, 0x64, 0x53, 0x04, 0x24, 0x74, 0x6f, 2200x42, 0x73, 0x65, 0x65, 0x64, 0x53, 0x04, 0x24, 0x74, 0x6f,
2210xa5, 0x00, 0x12, 0x65, 0x04, 0x09, 0x63, 0x75, 0x72, 0x72, 2210xa5, 0x00, 0x12, 0x65, 0x04, 0x09, 0x30, 0x75, 0x72, 0x72,
2220x65, 0x6e, 0x74, 0x8f, 0x03, 0x57, 0x00, 0x28, 0x73, 0x65, 2220x67, 0x00, 0x02, 0x8f, 0x03, 0x57, 0x00, 0x28, 0x73, 0x65,
2230x65, 0x13, 0x03, 0x32, 0x32, 0x29, 0x2c, 0x9f, 0x04, 0x01, 2230x65, 0x13, 0x03, 0x34, 0x32, 0x29, 0x2c, 0x9f, 0x04, 0x00,
2240x2d, 0x00, 0x0f, 0xfb, 0x01, 0x01, 0x06, 0x01, 0x03, 0x07, 2240x2d, 0x00, 0x0f, 0xfb, 0x01, 0x01, 0x05, 0x01, 0x03, 0x07,
2250x32, 0x09, 0x40, 0x72, 0x65, 0x2d, 0x65, 0x02, 0x04, 0x02, 2250x32, 0x09, 0x40, 0x72, 0x65, 0x2d, 0x65, 0x02, 0x04, 0x02,
2260x37, 0x01, 0x29, 0x61, 0x6d, 0x88, 0x00, 0x02, 0x8d, 0x05, 2260x37, 0x01, 0x29, 0x61, 0x6d, 0x88, 0x00, 0x02, 0x8d, 0x05,
2270x70, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x00, 0x6f, 0x00, 2270x70, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x00, 0x6f, 0x00,
2280x74, 0x65, 0x78, 0x61, 0x63, 0x74, 0x6c, 0x79, 0x2d, 0x00, 2280x76, 0x65, 0x78, 0x61, 0x63, 0x74, 0x6c, 0x79, 0x2d, 0x00,
2290x01, 0x31, 0x04, 0x10, 0x72, 0xe2, 0x04, 0x01, 0xe9, 0x00, 2290x41, 0x73, 0x74, 0x61, 0x72, 0x59, 0x09, 0x02, 0x97, 0x05,
2300x02, 0xdd, 0x08, 0x03, 0x9a, 0x08, 0x24, 0x6c, 0x79, 0x8f, 2300x01, 0x0e, 0x08, 0x02, 0x9a, 0x08, 0x24, 0x6c, 0x79, 0x8f,
2310x00, 0x23, 0x62, 0x65, 0x49, 0x04, 0x04, 0xf1, 0x01, 0x25, 2310x00, 0x24, 0x62, 0x65, 0x49, 0x04, 0x03, 0xf1, 0x01, 0x25,
2320x6f, 0x66, 0x44, 0x01, 0x75, 0x2e, 0x00, 0x53, 0x6f, 0x00, 2320x6f, 0x66, 0x44, 0x01, 0x43, 0x2e, 0x00, 0x53, 0x6f, 0x0f,
2330x69, 0x66, 0xf4, 0x06, 0x60, 0x74, 0x75, 0x63, 0x6b, 0x00, 2330x01, 0x01, 0xf4, 0x06, 0x60, 0x74, 0x75, 0x63, 0x6b, 0x00,
2340x6f, 0xc7, 0x04, 0x10, 0x70, 0x59, 0x00, 0x52, 0x63, 0x75, 2340x6f, 0xc7, 0x04, 0x10, 0x70, 0x59, 0x00, 0x52, 0x63, 0x75,
2350x6c, 0x61, 0x72, 0xb0, 0x01, 0x20, 0x61, 0x6e, 0x45, 0x09, 2350x6c, 0x61, 0x72, 0xb0, 0x01, 0x20, 0x61, 0x6e, 0x45, 0x09,
2360x00, 0x6a, 0x05, 0x01, 0xce, 0x01, 0x03, 0x28, 0x06, 0x00, 2360x00, 0x6a, 0x05, 0x01, 0xce, 0x01, 0x03, 0x28, 0x06, 0x02,
2370x9a, 0x00, 0x02, 0x85, 0x00, 0x00, 0x2a, 0x0a, 0x23, 0x61, 2370x9a, 0x00, 0x00, 0x85, 0x00, 0x00, 0x2a, 0x0a, 0x23, 0x61,
2380x6e, 0x8b, 0x0a, 0x51, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x88, 2380x6e, 0x8b, 0x0a, 0x52, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x88,
2390x05, 0x00, 0xda, 0x01, 0x40, 0x2c, 0x00, 0x73, 0x65, 0x20, 2390x05, 0x71, 0x4e, 0x65, 0x74, 0x2c, 0x00, 0x73, 0x65, 0x20,
2400x00, 0x04, 0xb7, 0x00, 0x08, 0x0b, 0x04, 0x01, 0x1d, 0x05, 2400x00, 0x05, 0xb7, 0x00, 0x07, 0x0b, 0x04, 0x00, 0x1d, 0x05,
2410x04, 0x92, 0x02, 0x05, 0xdd, 0x02, 0x07, 0x36, 0x01, 0x02, 2410x05, 0x92, 0x02, 0x04, 0xdd, 0x02, 0x07, 0x36, 0x01, 0x02,
2420x2c, 0x01, 0x01, 0x24, 0x01, 0x05, 0xef, 0x06, 0x01, 0x1d, 2420x2c, 0x01, 0x06, 0x24, 0x01, 0x01, 0x04, 0x09, 0x01, 0xa5,
2430x01, 0x05, 0xae, 0x03, 0x05, 0x71, 0x0b, 0x01, 0x46, 0x02, 2430x01, 0x05, 0xae, 0x03, 0x04, 0x71, 0x0b, 0x01, 0x46, 0x02,
2440x11, 0x77, 0x9a, 0x0b, 0x00, 0x6b, 0x02, 0x20, 0x45, 0x6e, 2440x11, 0x77, 0x9a, 0x0b, 0x00, 0x6b, 0x02, 0x20, 0x45, 0x6e,
2450xc3, 0x07, 0x85, 0x20, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 2450xc3, 0x07, 0x85, 0x20, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65,
2460x20, 0x93, 0x02, 0x60, 0x00, 0x00, 0x4e, 0x6f, 0x72, 0x6d, 2460x20, 0x93, 0x02, 0x60, 0x00, 0x00, 0x4e, 0x6f, 0x72, 0x6d,
2470x7f, 0x07, 0x10, 0x2c, 0x31, 0x00, 0x02, 0xdb, 0x05, 0x32, 2470x7f, 0x07, 0x13, 0x2c, 0x31, 0x00, 0x63, 0x6c, 0x6c, 0x00,
2480x6d, 0x61, 0x6b, 0xf2, 0x07, 0x01, 0x21, 0x02, 0x06, 0x76, 2480x6d, 0x61, 0x6b, 0xf2, 0x07, 0x05, 0x67, 0x02, 0x02, 0xe7,
2490x05, 0x00, 0xe8, 0x0a, 0x10, 0x74, 0x4d, 0x03, 0x20, 0x73, 2490x01, 0x10, 0x73, 0xba, 0x05, 0x50, 0x70, 0x72, 0x65, 0x73,
2500x65, 0xdf, 0x02, 0x33, 0x68, 0x61, 0x76, 0x5c, 0x01, 0x26, 2500x65, 0xdf, 0x02, 0x33, 0x68, 0x61, 0x76, 0x5c, 0x01, 0x26,
2510x6f, 0x6e, 0xe6, 0x02, 0x32, 0x2e, 0x00, 0x50, 0x2c, 0x00, 2510x6f, 0x6e, 0xe6, 0x02, 0x33, 0x2e, 0x00, 0x50, 0x2c, 0x00,
2520x02, 0x80, 0x01, 0x94, 0x61, 0x6d, 0x62, 0x69, 0x67, 0x75, 2520x01, 0x80, 0x01, 0x94, 0x61, 0x6d, 0x62, 0x69, 0x67, 0x75,
2530x6f, 0x75, 0x73, 0x1e, 0x02, 0x13, 0x73, 0xf9, 0x06, 0x02, 2530x6f, 0x75, 0x73, 0x1e, 0x02, 0x14, 0x73, 0xf9, 0x06, 0x01,
2540x64, 0x03, 0x40, 0x64, 0x69, 0x66, 0x66, 0x59, 0x01, 0x11, 2540x64, 0x03, 0x40, 0x64, 0x69, 0x66, 0x66, 0x59, 0x01, 0x11,
2550x74, 0xd9, 0x00, 0x21, 0x6d, 0x6f, 0x6b, 0x08, 0x40, 0x62, 2550x74, 0xd9, 0x00, 0x21, 0x6d, 0x6f, 0x6b, 0x08, 0x41, 0x62,
2560x74, 0x6c, 0x65, 0x56, 0x07, 0x04, 0x9b, 0x02, 0x44, 0x6c, 2560x74, 0x6c, 0x65, 0x56, 0x07, 0x03, 0x9b, 0x02, 0x45, 0x6c,
2570x69, 0x6b, 0x65, 0x8a, 0x07, 0x02, 0x26, 0x08, 0x23, 0x6f, 2570x69, 0x6b, 0x65, 0x8a, 0x07, 0x01, 0x26, 0x08, 0x23, 0x6f,
2580x66, 0xad, 0x0c, 0x71, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 2580x66, 0xad, 0x0c, 0x40, 0x66, 0x65, 0x61, 0x74, 0xa9, 0x00,
2590x65, 0x3e, 0x00, 0x70, 0x72, 0x69, 0x73, 0x6b, 0x00, 0x68, 2590x00, 0x3e, 0x00, 0x40, 0x72, 0x69, 0x73, 0x6b, 0x95, 0x00,
2600x61, 0x2a, 0x06, 0x06, 0x77, 0x00, 0x04, 0xba, 0x00, 0x10, 2600x00, 0xe1, 0x01, 0x06, 0x77, 0x00, 0x03, 0xba, 0x00, 0x10,
2610x2e, 0xcf, 0x05, 0x81, 0x73, 0x6f, 0x2c, 0x00, 0x66, 0x69, 2610x2e, 0xcf, 0x05, 0x81, 0x73, 0x6f, 0x2c, 0x00, 0x66, 0x69,
2620x6e, 0x64, 0x22, 0x00, 0x03, 0xdd, 0x05, 0x72, 0x70, 0x6f, 2620x6e, 0x64, 0x22, 0x00, 0x03, 0xdd, 0x05, 0x76, 0x70, 0x6f,
2630x73, 0x73, 0x69, 0x62, 0x6c, 0xc1, 0x00, 0x09, 0xa1, 0x00, 2630x73, 0x73, 0x69, 0x62, 0x6c, 0xc1, 0x00, 0x05, 0xa1, 0x00,
2640x00, 0xd6, 0x08, 0x60, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 2640x00, 0xd6, 0x08, 0x30, 0x64, 0x64, 0x69, 0x14, 0x00, 0x20,
2650x4f, 0x01, 0x20, 0x63, 0x68, 0x9a, 0x0c, 0x21, 0x6e, 0x67, 2650x61, 0x6c, 0x40, 0x02, 0x51, 0x6c, 0x6c, 0x65, 0x6e, 0x67,
2660xb8, 0x0c, 0x02, 0x1c, 0x00, 0x30, 0x76, 0x61, 0x6e, 0x73, 2660xb8, 0x0c, 0x02, 0x1c, 0x00, 0x30, 0x76, 0x61, 0x6e, 0x73,
2670x04, 0x90, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x29, 2670x04, 0x90, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x29,
2680x00, 2680x00,
diff --git a/apps/plugins/puzzles/help/netslide.c b/apps/plugins/puzzles/help/netslide.c
index be2a6d7aa6..dc6a0d65e1 100644
--- a/apps/plugins/puzzles/help/netslide.c
+++ b/apps/plugins/puzzles/help/netslide.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
diff --git a/apps/plugins/puzzles/help/palisade.c b/apps/plugins/puzzles/help/palisade.c
index 3b0e897828..3de6c2d06d 100644
--- a/apps/plugins/puzzles/help/palisade.c
+++ b/apps/plugins/puzzles/help/palisade.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
diff --git a/apps/plugins/puzzles/help/pattern.c b/apps/plugins/puzzles/help/pattern.c
index f977e03860..3c51afd66c 100644
--- a/apps/plugins/puzzles/help/pattern.c
+++ b/apps/plugins/puzzles/help/pattern.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
diff --git a/apps/plugins/puzzles/help/pearl.c b/apps/plugins/puzzles/help/pearl.c
index 162b8a44a4..1c7a7ee3ab 100644
--- a/apps/plugins/puzzles/help/pearl.c
+++ b/apps/plugins/puzzles/help/pearl.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -15,7 +15,7 @@ struct style_text help_text_style[] = {
15 LAST_STYLE_ITEM 15 LAST_STYLE_ITEM
16}; 16};
17 17
18/* orig 2570 comp 1610 ratio 0.626459 level 11 saved 960 */ 18/* orig 2570 comp 1610 ratio 0.626459 level 10 saved 960 */
19const char help_text[] = { 19const char help_text[] = {
200xf0, 0x21, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 200xf0, 0x21, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
210x33, 0x36, 0x3a, 0x20, 0x50, 0x65, 0x61, 0x72, 0x6c, 0x20, 210x33, 0x36, 0x3a, 0x20, 0x50, 0x65, 0x61, 0x72, 0x6c, 0x20,
@@ -30,57 +30,57 @@ const char help_text[] = {
300x68, 0x6f, 0x72, 0x69, 0x7a, 0x6f, 0x6e, 0x74, 0x61, 0x6c, 300x68, 0x6f, 0x72, 0x69, 0x7a, 0x6f, 0x6e, 0x74, 0x61, 0x6c,
310x6c, 0x79, 0x00, 0x6f, 0x72, 0x00, 0x76, 0x65, 0x72, 0x74, 310x6c, 0x79, 0x00, 0x6f, 0x72, 0x00, 0x76, 0x65, 0x72, 0x74,
320x69, 0x63, 0x0e, 0x00, 0x40, 0x61, 0x64, 0x6a, 0x61, 0x2a, 320x69, 0x63, 0x0e, 0x00, 0x40, 0x61, 0x64, 0x6a, 0x61, 0x2a,
330x00, 0x04, 0x5e, 0x00, 0x90, 0x2c, 0x00, 0x73, 0x6f, 0x00, 330x00, 0x04, 0x5e, 0x00, 0x91, 0x2c, 0x00, 0x73, 0x6f, 0x00,
340x74, 0x68, 0x61, 0x74, 0x44, 0x00, 0x03, 0x56, 0x00, 0xf2, 340x74, 0x68, 0x61, 0x74, 0x44, 0x00, 0x02, 0x56, 0x00, 0xf2,
350x0d, 0x66, 0x6f, 0x72, 0x6d, 0x00, 0x61, 0x00, 0x73, 0x69, 350x0d, 0x66, 0x6f, 0x72, 0x6d, 0x00, 0x61, 0x00, 0x73, 0x69,
360x6e, 0x67, 0x6c, 0x65, 0x00, 0x63, 0x6c, 0x6f, 0x73, 0x65, 360x6e, 0x67, 0x6c, 0x65, 0x00, 0x63, 0x6c, 0x6f, 0x73, 0x65,
370x64, 0x00, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x00, 0x49, 0x6c, 370x64, 0x00, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x00, 0x49, 0x6c,
380x00, 0x91, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x69, 0x6e, 380x00, 0x91, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x69, 0x6e,
390x67, 0xad, 0x00, 0x00, 0x44, 0x00, 0x50, 0x6d, 0x65, 0x00, 390x67, 0xad, 0x00, 0x00, 0x44, 0x00, 0x20, 0x6d, 0x65, 0x79,
400x6f, 0x66, 0x1c, 0x00, 0x04, 0x59, 0x00, 0x05, 0x55, 0x00, 400x00, 0x00, 0x1c, 0x00, 0x03, 0x59, 0x00, 0x07, 0x55, 0x00,
410x01, 0x3a, 0x00, 0x51, 0x00, 0x70, 0x61, 0x73, 0x73, 0x15, 410x81, 0x6f, 0x6f, 0x70, 0x00, 0x70, 0x61, 0x73, 0x73, 0x15,
420x00, 0xc0, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x00, 0x77, 0x69, 420x00, 0xc0, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x00, 0x77, 0x69,
430x6c, 0x6c, 0x00, 0x63, 0xa3, 0x00, 0xf1, 0x00, 0x69, 0x6e, 430x6c, 0x6c, 0x00, 0x63, 0xa3, 0x00, 0xf2, 0x00, 0x69, 0x6e,
440x00, 0x63, 0x6f, 0x72, 0x6e, 0x65, 0x72, 0x73, 0x2c, 0x00, 440x00, 0x63, 0x6f, 0x72, 0x6e, 0x65, 0x72, 0x73, 0x2c, 0x00,
450x61, 0x6e, 0x64, 0x4b, 0x00, 0x02, 0x1f, 0x00, 0xb7, 0x62, 450x61, 0x6e, 0x64, 0x4b, 0x00, 0x01, 0x1f, 0x00, 0xb7, 0x62,
460x65, 0x00, 0x73, 0x74, 0x72, 0x61, 0x69, 0x67, 0x68, 0x74, 460x65, 0x00, 0x73, 0x74, 0x72, 0x61, 0x69, 0x67, 0x68, 0x74,
470xd2, 0x00, 0x08, 0xd0, 0x00, 0x02, 0xb0, 0x00, 0x42, 0x2e, 470xd2, 0x00, 0x08, 0xd0, 0x00, 0x02, 0xb0, 0x00, 0x44, 0x2e,
480x00, 0x28, 0x41, 0x39, 0x00, 0x06, 0x7d, 0x00, 0x30, 0x63, 480x00, 0x28, 0x41, 0x39, 0x00, 0x04, 0x7d, 0x00, 0x30, 0x63,
490x61, 0x6e, 0x40, 0x00, 0xf6, 0x03, 0x63, 0x6f, 0x6d, 0x70, 490x61, 0x6e, 0x40, 0x00, 0xf6, 0x03, 0x63, 0x6f, 0x6d, 0x70,
500x6c, 0x65, 0x74, 0x65, 0x6c, 0x79, 0x00, 0x65, 0x6d, 0x70, 500x6c, 0x65, 0x74, 0x65, 0x6c, 0x79, 0x00, 0x65, 0x6d, 0x70,
510x74, 0x79, 0x00, 0x2d, 0x92, 0x00, 0x72, 0x64, 0x6f, 0x65, 510x74, 0x79, 0x00, 0x2d, 0x92, 0x00, 0x72, 0x64, 0x6f, 0x65,
520x73, 0x6e, 0x27, 0x74, 0x76, 0x01, 0x20, 0x74, 0x6f, 0xa2, 520x73, 0x6e, 0x27, 0x74, 0x76, 0x01, 0x21, 0x74, 0x6f, 0xa2,
530x00, 0x06, 0xa0, 0x00, 0x53, 0x65, 0x76, 0x65, 0x72, 0x79, 530x00, 0x05, 0xa0, 0x00, 0x53, 0x65, 0x76, 0x65, 0x72, 0x79,
540x4e, 0x00, 0x6e, 0x2e, 0x29, 0x00, 0x00, 0x00, 0x53, 0xe2, 540x4e, 0x00, 0x6e, 0x2e, 0x29, 0x00, 0x00, 0x00, 0x53, 0xe2,
550x00, 0x05, 0xc0, 0x00, 0x51, 0x62, 0x6c, 0x61, 0x63, 0x6b, 550x00, 0x05, 0xc0, 0x00, 0x51, 0x62, 0x6c, 0x61, 0x63, 0x6b,
560xbd, 0x00, 0xe0, 0x77, 0x68, 0x69, 0x74, 0x65, 0x00, 0x63, 560xbd, 0x00, 0xb0, 0x77, 0x68, 0x69, 0x74, 0x65, 0x00, 0x63,
570x69, 0x72, 0x63, 0x6c, 0x65, 0x73, 0x2c, 0x0f, 0x00, 0x50, 570x69, 0x72, 0x63, 0x6c, 0x5b, 0x01, 0x80, 0x77, 0x68, 0x69,
580x63, 0x68, 0x00, 0x61, 0x72, 0x45, 0x01, 0x1d, 0x75, 0x13, 580x63, 0x68, 0x00, 0x61, 0x72, 0x45, 0x01, 0x1d, 0x75, 0x13,
590x01, 0xf2, 0x02, 0x6d, 0x75, 0x73, 0x74, 0x00, 0x73, 0x61, 590x01, 0xf3, 0x02, 0x6d, 0x75, 0x73, 0x74, 0x00, 0x73, 0x61,
600x74, 0x69, 0x73, 0x66, 0x79, 0x2e, 0x00, 0x00, 0x00, 0x41, 600x74, 0x69, 0x73, 0x66, 0x79, 0x2e, 0x00, 0x00, 0x00, 0x41,
610x49, 0x00, 0x03, 0x3f, 0x00, 0x52, 0x00, 0x69, 0x6e, 0x00, 610x49, 0x00, 0x02, 0x3f, 0x00, 0x53, 0x00, 0x69, 0x6e, 0x00,
620x61, 0x6b, 0x00, 0x00, 0x0c, 0x00, 0x56, 0x64, 0x69, 0x63, 620x61, 0x6b, 0x00, 0x86, 0x00, 0x69, 0x6e, 0x64, 0x69, 0x63,
630x61, 0x74, 0x43, 0x00, 0x14, 0x61, 0xc1, 0x01, 0x00, 0x14, 630x61, 0x74, 0x43, 0x00, 0x14, 0x61, 0xc1, 0x01, 0x00, 0x14,
640x02, 0x13, 0x61, 0x42, 0x01, 0xdb, 0x2c, 0x00, 0x62, 0x75, 640x02, 0x13, 0x61, 0x42, 0x01, 0xdc, 0x2c, 0x00, 0x62, 0x75,
650x74, 0x00, 0x6e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0xad, 650x74, 0x00, 0x6e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0xad,
660x00, 0x05, 0xf9, 0x01, 0x00, 0xeb, 0x00, 0x55, 0x69, 0x74, 660x00, 0x05, 0xf9, 0x01, 0x50, 0x74, 0x6f, 0x00, 0x69, 0x74,
670x00, 0x69, 0x6e, 0x89, 0x00, 0x01, 0x43, 0x00, 0x35, 0x6c, 670x5e, 0x00, 0x05, 0x89, 0x00, 0x00, 0x43, 0x00, 0x35, 0x6c,
680x73, 0x6f, 0x48, 0x00, 0x01, 0x8d, 0x00, 0x09, 0xcc, 0x00, 680x73, 0x6f, 0x48, 0x00, 0x02, 0x8d, 0x00, 0x08, 0xcc, 0x00,
690x0e, 0x81, 0x00, 0x18, 0x65, 0x80, 0x00, 0x06, 0xa8, 0x01, 690x0e, 0x81, 0x00, 0x19, 0x65, 0x80, 0x00, 0x05, 0xa8, 0x01,
700x42, 0x65, 0x64, 0x67, 0x65, 0x87, 0x00, 0xcf, 0x61, 0x74, 700x42, 0x65, 0x64, 0x67, 0x65, 0x87, 0x00, 0xcf, 0x61, 0x74,
710x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x20, 0x6f, 0x6e, 0x65, 710x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x20, 0x6f, 0x6e, 0x65,
720x8c, 0x00, 0x1a, 0x09, 0x87, 0x00, 0xc0, 0x28, 0x49, 0x6e, 720x8c, 0x00, 0x1c, 0x07, 0x87, 0x00, 0xc0, 0x28, 0x49, 0x6e,
730x00, 0x62, 0x6f, 0x74, 0x68, 0x00, 0x63, 0x61, 0x73, 0x52, 730x00, 0x62, 0x6f, 0x74, 0x68, 0x00, 0x63, 0x61, 0x73, 0x52,
740x01, 0x22, 0x74, 0x68, 0x4c, 0x01, 0x50, 0x00, 0x6f, 0x6e, 740x01, 0x22, 0x74, 0x68, 0x4c, 0x01, 0x50, 0x00, 0x6f, 0x6e,
750x6c, 0x79, 0x81, 0x01, 0x01, 0x7a, 0x00, 0x21, 0x6e, 0x73, 750x6c, 0x79, 0x81, 0x01, 0x01, 0x7a, 0x00, 0x21, 0x6e, 0x73,
760x19, 0x00, 0x3e, 0x74, 0x77, 0x6f, 0x63, 0x00, 0x70, 0x69, 760x19, 0x00, 0x3e, 0x74, 0x77, 0x6f, 0x63, 0x00, 0x70, 0x69,
770x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x5d, 0x00, 0x12, 0x2c, 770x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x5d, 0x00, 0x12, 0x2c,
780xbd, 0x00, 0x3f, 0x69, 0x73, 0x2c, 0xa9, 0x02, 0x0f, 0xf5, 780xbd, 0x00, 0x3f, 0x69, 0x73, 0x2c, 0xa9, 0x02, 0x0f, 0xf0,
790x03, 0x69, 0x6e, 0x74, 0x6f, 0x00, 0x61, 0x66, 0x74, 0x65, 790x00, 0x69, 0x6e, 0x74, 0x6f, 0x00, 0x61, 0x66, 0x74, 0x65,
800x72, 0x00, 0x6c, 0x65, 0x61, 0x76, 0x69, 0x6e, 0x67, 0x7c, 800x72, 0x00, 0x6c, 0x65, 0x61, 0x76, 0xeb, 0x02, 0x05, 0x7c,
810x00, 0x04, 0x17, 0x02, 0x2c, 0x00, 0x54, 0x45, 0x00, 0x22, 810x00, 0x03, 0x17, 0x02, 0x2c, 0x00, 0x54, 0x45, 0x00, 0x23,
820x61, 0x72, 0x99, 0x00, 0x0d, 0x7e, 0x00, 0x00, 0x26, 0x03, 820x61, 0x72, 0x99, 0x00, 0x0c, 0x7e, 0x00, 0x01, 0xd3, 0x03,
830x01, 0x1e, 0x00, 0x36, 0x6e, 0x6f, 0x74, 0xb6, 0x00, 0x21, 830x00, 0x1e, 0x00, 0x36, 0x6e, 0x6f, 0x74, 0xb6, 0x00, 0x21,
840x65, 0x64, 0x5b, 0x02, 0x60, 0x43, 0x72, 0x65, 0x64, 0x69, 840x65, 0x64, 0x5b, 0x02, 0x60, 0x43, 0x72, 0x65, 0x64, 0x69,
850x74, 0x76, 0x03, 0xf1, 0x01, 0x00, 0x74, 0x68, 0x69, 0x73, 850x74, 0x76, 0x03, 0xf1, 0x01, 0x00, 0x74, 0x68, 0x69, 0x73,
860x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x00, 0x67, 0x6f, 860x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x00, 0x67, 0x6f,
@@ -92,8 +92,8 @@ const char help_text[] = {
920x73, 0x00, 0x48, 0x61, 0x72, 0x76, 0x65, 0x79, 0x53, 0x00, 920x73, 0x00, 0x48, 0x61, 0x72, 0x76, 0x65, 0x79, 0x53, 0x00,
930x90, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 930x90, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63,
940x56, 0x03, 0x21, 0x74, 0x68, 0xc6, 0x00, 0x10, 0x69, 0x16, 940x56, 0x03, 0x21, 0x74, 0x68, 0xc6, 0x00, 0x10, 0x69, 0x16,
950x03, 0xc2, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 950x03, 0x90, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f,
960x6e, 0x2e, 0x00, 0x00, 0x48, 0x00, 0xc1, 0x68, 0x74, 0x74, 960x6e, 0x68, 0x01, 0x01, 0x48, 0x00, 0xc1, 0x68, 0x74, 0x74,
970x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6e, 0x75, 970x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6e, 0x75,
980x00, 0xa2, 0x2e, 0x63, 0x6f, 0x2e, 0x6a, 0x70, 0x2f, 0x65, 980x00, 0xa2, 0x2e, 0x63, 0x6f, 0x2e, 0x6a, 0x70, 0x2f, 0x65,
990x6e, 0x2f, 0x94, 0x00, 0x30, 0x73, 0x2f, 0x6d, 0x78, 0x00, 990x6e, 0x2f, 0x94, 0x00, 0x30, 0x73, 0x2f, 0x6d, 0x78, 0x00,
@@ -102,47 +102,47 @@ const char help_text[] = {
1020x68, 0xcb, 0x00, 0x43, 0x33, 0x36, 0x2e, 0x31, 0xd4, 0x04, 1020x68, 0xcb, 0x00, 0x43, 0x33, 0x36, 0x2e, 0x31, 0xd4, 0x04,
1030x00, 0x1d, 0x03, 0x50, 0x72, 0x6f, 0x6c, 0x73, 0x20, 0xe2, 1030x00, 0x1d, 0x03, 0x50, 0x72, 0x6f, 0x6c, 0x73, 0x20, 0xe2,
1040x00, 0x46, 0x6c, 0x69, 0x63, 0x6b, 0x7f, 0x00, 0x40, 0x6c, 1040x00, 0x46, 0x6c, 0x69, 0x63, 0x6b, 0x7f, 0x00, 0x40, 0x6c,
1050x65, 0x66, 0x74, 0x24, 0x02, 0x63, 0x74, 0x6f, 0x6e, 0x00, 1050x65, 0x66, 0x74, 0x24, 0x02, 0x64, 0x74, 0x6f, 0x6e, 0x00,
1060x6f, 0x6e, 0xf2, 0x04, 0x01, 0x3b, 0x02, 0x04, 0xdf, 0x04, 1060x6f, 0x6e, 0xf2, 0x04, 0x00, 0x3b, 0x02, 0x05, 0xdf, 0x04,
1070x00, 0x53, 0x02, 0x30, 0x65, 0x67, 0x6d, 0x42, 0x01, 0x25, 1070x50, 0x61, 0x00, 0x73, 0x65, 0x67, 0xa2, 0x00, 0x04, 0x3b,
1080x6f, 0x66, 0x9c, 0x01, 0x04, 0x9e, 0x03, 0x00, 0x6d, 0x01, 1080x02, 0x01, 0x9c, 0x01, 0x04, 0x9e, 0x03, 0x01, 0x6d, 0x01,
1090x04, 0x6b, 0x02, 0x20, 0x6f, 0x72, 0x34, 0x00, 0x68, 0x72, 1090x02, 0x6b, 0x02, 0x20, 0x6f, 0x72, 0x34, 0x00, 0x68, 0x72,
1100x65, 0x6d, 0x6f, 0x76, 0x65, 0x36, 0x00, 0x00, 0xf0, 0x00, 1100x65, 0x6d, 0x6f, 0x76, 0x65, 0x36, 0x00, 0x00, 0xf0, 0x00,
1110x10, 0x69, 0xec, 0x01, 0x01, 0x50, 0x00, 0x01, 0xe4, 0x00, 1110x10, 0x69, 0xec, 0x01, 0x01, 0x50, 0x00, 0x01, 0xe4, 0x00,
1120x4f, 0x44, 0x72, 0x61, 0x67, 0x85, 0x00, 0x02, 0x04, 0x58, 1120x4f, 0x44, 0x72, 0x61, 0x67, 0x85, 0x00, 0x03, 0x04, 0x58,
1130x00, 0x01, 0x40, 0x00, 0x46, 0x72, 0x69, 0x65, 0x73, 0x7e, 1130x00, 0x00, 0x40, 0x00, 0x47, 0x72, 0x69, 0x65, 0x73, 0x7e,
1140x05, 0x06, 0x71, 0x05, 0x40, 0x6d, 0x6f, 0x72, 0x65, 0x79, 1140x05, 0x05, 0x92, 0x00, 0x40, 0x6d, 0x6f, 0x72, 0x65, 0x79,
1150x00, 0x00, 0xb3, 0x00, 0x1f, 0x65, 0x9e, 0x00, 0x02, 0x12, 1150x00, 0x00, 0xb3, 0x00, 0x1f, 0x65, 0x9e, 0x00, 0x02, 0x12,
1160x69, 0x1b, 0x00, 0xf0, 0x05, 0x67, 0x6f, 0x2e, 0x00, 0x41, 1160x69, 0x1b, 0x00, 0xf0, 0x05, 0x67, 0x6f, 0x2e, 0x00, 0x41,
1170x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 1170x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65,
1180x6c, 0x79, 0x2c, 0x00, 0x64, 0x7a, 0x00, 0xc1, 0x6f, 0x76, 1180x6c, 0x79, 0x2c, 0x00, 0x64, 0x7a, 0x00, 0xc1, 0x6f, 0x76,
1190x65, 0x72, 0x00, 0x61, 0x6e, 0x00, 0x65, 0x78, 0x69, 0x73, 1190x65, 0x72, 0x00, 0x61, 0x6e, 0x00, 0x65, 0x78, 0x69, 0x73,
1200x3b, 0x05, 0x3b, 0x70, 0x61, 0x72, 0xdf, 0x00, 0x41, 0x6f, 1200x3b, 0x05, 0x3b, 0x70, 0x61, 0x72, 0xdf, 0x00, 0x41, 0x6f,
1210x00, 0x75, 0x6e, 0x6d, 0x00, 0x20, 0x69, 0x74, 0xda, 0x00, 1210x00, 0x75, 0x6e, 0x6d, 0x00, 0x24, 0x69, 0x74, 0xda, 0x00,
1220x06, 0x11, 0x00, 0x05, 0x2c, 0x00, 0x20, 0x69, 0x74, 0x68, 1220x03, 0x11, 0x00, 0x04, 0x2c, 0x00, 0x21, 0x69, 0x74, 0x68,
1230x04, 0x00, 0x33, 0x00, 0x42, 0x6e, 0x00, 0x67, 0x6f, 0x24, 1230x04, 0x72, 0x74, 0x68, 0x65, 0x6e, 0x00, 0x67, 0x6f, 0x24,
1240x04, 0x60, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x8e, 0x00, 1240x04, 0x60, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x8e, 0x00,
1250x51, 0x64, 0x69, 0x72, 0x65, 0x63, 0xd3, 0x01, 0x0e, 0x75, 1250x54, 0x64, 0x69, 0x72, 0x65, 0x63, 0xd3, 0x01, 0x0b, 0x75,
1260x01, 0x4f, 0x72, 0x69, 0x67, 0x68, 0x76, 0x01, 0x08, 0x71, 1260x01, 0x11, 0x72, 0xa0, 0x03, 0x0f, 0x76, 0x01, 0x06, 0x40,
1270x6d, 0x61, 0x72, 0x6b, 0x00, 0x69, 0x74, 0x30, 0x00, 0x00, 1270x6d, 0x61, 0x72, 0x6b, 0x5e, 0x00, 0x01, 0x30, 0x00, 0x84,
1280x82, 0x03, 0x53, 0x72, 0x6f, 0x73, 0x73, 0x2c, 0xf7, 0x03, 1280x61, 0x00, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x2c, 0xf7, 0x03,
1290x00, 0xae, 0x00, 0x02, 0x74, 0x01, 0x31, 0x79, 0x6f, 0x75, 1290x02, 0xfe, 0x02, 0x61, 0x61, 0x74, 0x00, 0x79, 0x6f, 0x75,
1300xc7, 0x02, 0x4a, 0x73, 0x75, 0x72, 0x65, 0x4a, 0x05, 0x01, 1300xc7, 0x02, 0x4a, 0x73, 0x75, 0x72, 0x65, 0x4a, 0x05, 0x01,
1310xda, 0x02, 0x2e, 0x67, 0x6f, 0xa3, 0x01, 0x92, 0x2e, 0x00, 1310xda, 0x02, 0x2e, 0x67, 0x6f, 0xa3, 0x01, 0x92, 0x2e, 0x00,
1320x28, 0x46, 0x6f, 0x72, 0x00, 0x69, 0x6e, 0x85, 0x02, 0x64, 1320x28, 0x46, 0x6f, 0x72, 0x00, 0x69, 0x6e, 0x85, 0x02, 0x64,
1330x2c, 0x00, 0x69, 0x66, 0x00, 0x79, 0xed, 0x06, 0x72, 0x64, 1330x2c, 0x00, 0x69, 0x66, 0x00, 0x79, 0xed, 0x06, 0x73, 0x64,
1340x65, 0x63, 0x69, 0x64, 0x65, 0x64, 0x29, 0x05, 0x0f, 0x26, 1340x65, 0x63, 0x69, 0x64, 0x65, 0x64, 0x29, 0x05, 0x0f, 0x26,
1350x04, 0x09, 0x11, 0x61, 0x8f, 0x04, 0x03, 0x80, 0x03, 0x21, 1350x04, 0x08, 0x14, 0x61, 0x8f, 0x04, 0x00, 0x80, 0x03, 0x21,
1360x68, 0x61, 0x97, 0x01, 0x2b, 0x62, 0x65, 0xfa, 0x04, 0x20, 1360x68, 0x61, 0x97, 0x01, 0x2b, 0x62, 0x65, 0xfa, 0x04, 0x20,
1370x64, 0x6f, 0xd0, 0x05, 0x83, 0x79, 0x65, 0x74, 0x00, 0x6b, 1370x64, 0x6f, 0xd0, 0x05, 0x83, 0x79, 0x65, 0x74, 0x00, 0x6b,
1380x6e, 0x6f, 0x77, 0x55, 0x00, 0x30, 0x77, 0x61, 0x79, 0x56, 1380x6e, 0x6f, 0x77, 0x55, 0x00, 0x32, 0x77, 0x61, 0x79, 0xba,
1390x00, 0x03, 0x29, 0x00, 0x71, 0x00, 0x74, 0x75, 0x72, 0x6e, 1390x03, 0x01, 0x29, 0x00, 0x71, 0x00, 0x74, 0x75, 0x72, 0x6e,
1400x73, 0x2c, 0x82, 0x00, 0x10, 0x6d, 0x12, 0x01, 0x01, 0xf9, 1400x73, 0x2c, 0x82, 0x00, 0x11, 0x6d, 0x12, 0x01, 0x01, 0xf9,
1410x00, 0x00, 0x21, 0x00, 0x00, 0xbc, 0x01, 0x01, 0x2d, 0x00, 1410x00, 0x00, 0x21, 0x00, 0x00, 0xbc, 0x01, 0x00, 0x2d, 0x00,
1420x20, 0x69, 0x74, 0x3e, 0x06, 0x10, 0x27, 0xce, 0x00, 0x09, 1420x20, 0x69, 0x74, 0x3e, 0x06, 0x11, 0x27, 0xce, 0x00, 0x08,
1430x0e, 0x01, 0x00, 0xac, 0x03, 0x0c, 0xd9, 0x01, 0x32, 0x75, 1430x0e, 0x01, 0x01, 0xac, 0x03, 0x0b, 0xd9, 0x01, 0x32, 0x75,
1440x73, 0x65, 0x5d, 0x00, 0xa1, 0x75, 0x72, 0x73, 0x6f, 0x72, 1440x73, 0x65, 0x5d, 0x00, 0x91, 0x75, 0x72, 0x73, 0x6f, 0x72,
1450x00, 0x6b, 0x65, 0x79, 0x73, 0x4d, 0x01, 0x28, 0x6f, 0x76, 1450x00, 0x6b, 0x65, 0x79, 0x9a, 0x00, 0x01, 0x8d, 0x02, 0x06,
1460x18, 0x00, 0x33, 0x2e, 0x00, 0x55, 0x28, 0x00, 0x41, 0x45, 1460x18, 0x00, 0x33, 0x2e, 0x00, 0x55, 0x28, 0x00, 0x41, 0x45,
1470x6e, 0x74, 0x65, 0x27, 0x00, 0x02, 0xc0, 0x00, 0x31, 0x67, 1470x6e, 0x74, 0x65, 0x27, 0x00, 0x02, 0xc0, 0x00, 0x31, 0x67,
1480x69, 0x6e, 0xcf, 0x01, 0x30, 0x65, 0x6e, 0x64, 0x15, 0x00, 1480x69, 0x6e, 0xcf, 0x01, 0x30, 0x65, 0x6e, 0x64, 0x15, 0x00,
@@ -151,29 +151,29 @@ const char help_text[] = {
1510x73, 0x3f, 0x00, 0x30, 0x53, 0x70, 0x61, 0x42, 0x01, 0x60, 1510x73, 0x3f, 0x00, 0x30, 0x53, 0x70, 0x61, 0x42, 0x01, 0x60,
1520x45, 0x73, 0x63, 0x61, 0x70, 0x65, 0x21, 0x02, 0x50, 0x42, 1520x45, 0x73, 0x63, 0x61, 0x70, 0x65, 0x21, 0x02, 0x50, 0x42,
1530x61, 0x63, 0x6b, 0x73, 0x15, 0x00, 0x05, 0x7b, 0x00, 0x10, 1530x61, 0x63, 0x6b, 0x73, 0x15, 0x00, 0x05, 0x7b, 0x00, 0x10,
1540x63, 0x65, 0x01, 0x10, 0x6c, 0x2e, 0x00, 0x01, 0x76, 0x02, 1540x63, 0x65, 0x01, 0x11, 0x6c, 0x2e, 0x00, 0x00, 0x48, 0x00,
1550xc2, 0x2e, 0x00, 0x4f, 0x72, 0x2c, 0x00, 0x68, 0x6f, 0x6c, 1550xc2, 0x2e, 0x00, 0x4f, 0x72, 0x2c, 0x00, 0x68, 0x6f, 0x6c,
1560x64, 0x00, 0x43, 0x91, 0x03, 0x00, 0x17, 0x01, 0x12, 0x6c, 1560x64, 0x00, 0x43, 0x91, 0x03, 0x00, 0x17, 0x01, 0x12, 0x6c,
1570x1d, 0x00, 0x34, 0x67, 0x69, 0x6e, 0x11, 0x03, 0x0e, 0xc4, 1570x1d, 0x00, 0x37, 0x67, 0x69, 0x6e, 0x11, 0x03, 0x0b, 0xc4,
1580x00, 0x55, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0xe9, 0x02, 0x40, 1580x00, 0x55, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0xe9, 0x02, 0x42,
1590x73, 0x00, 0x61, 0x73, 0x35, 0x01, 0x01, 0xdb, 0x00, 0x04, 1590x73, 0x00, 0x61, 0x73, 0x35, 0x01, 0x00, 0xdb, 0x00, 0x04,
1600x77, 0x08, 0x06, 0xa2, 0x08, 0x60, 0x00, 0x00, 0x50, 0x72, 1600x77, 0x08, 0x05, 0xa2, 0x08, 0x60, 0x00, 0x00, 0x50, 0x72,
1610x65, 0x73, 0x31, 0x08, 0x04, 0x67, 0x00, 0xe1, 0x2d, 0x53, 1610x65, 0x73, 0x31, 0x08, 0x04, 0x67, 0x00, 0xe1, 0x2d, 0x53,
1620x68, 0x69, 0x66, 0x74, 0x2d, 0x61, 0x72, 0x72, 0x6f, 0x77, 1620x68, 0x69, 0x66, 0x74, 0x2d, 0x61, 0x72, 0x72, 0x6f, 0x77,
1630x6b, 0x65, 0x86, 0x08, 0x0b, 0x12, 0x00, 0x51, 0x73, 0x69, 1630x6b, 0x65, 0x86, 0x08, 0x0b, 0x12, 0x00, 0x51, 0x73, 0x69,
1640x6d, 0x75, 0x6c, 0x53, 0x06, 0x12, 0x61, 0x8d, 0x03, 0x23, 1640x6d, 0x75, 0x6c, 0x53, 0x06, 0x12, 0x61, 0x8d, 0x03, 0x23,
1650x6f, 0x72, 0xa5, 0x02, 0x10, 0x63, 0xba, 0x02, 0x10, 0x2c, 1650x6f, 0x72, 0xa5, 0x02, 0x10, 0x63, 0xba, 0x02, 0x10, 0x2c,
1660x65, 0x08, 0x34, 0x70, 0x65, 0x63, 0x6b, 0x01, 0x11, 0x6f, 1660x65, 0x08, 0x34, 0x70, 0x65, 0x63, 0x6b, 0x01, 0x12, 0x6f,
1670x25, 0x06, 0x01, 0x53, 0x02, 0x03, 0x31, 0x06, 0x06, 0xef, 1670x25, 0x06, 0x01, 0xb0, 0x02, 0x03, 0x31, 0x06, 0x05, 0xef,
1680x02, 0x02, 0x3a, 0x02, 0x01, 0x05, 0x01, 0x01, 0x35, 0x06, 1680x02, 0x04, 0x3a, 0x02, 0x31, 0x6b, 0x65, 0x79, 0x35, 0x06,
1690x22, 0x41, 0x6c, 0x02, 0x01, 0x21, 0x61, 0x63, 0x41, 0x01, 1690x22, 0x41, 0x6c, 0x02, 0x01, 0x21, 0x61, 0x63, 0x41, 0x01,
1700xa0, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 1700xa0, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
1710x64, 0x3a, 0x00, 0x13, 0x73, 0x34, 0x00, 0x30, 0x32, 0x2e, 1710x64, 0x3a, 0x00, 0x13, 0x73, 0x34, 0x00, 0x31, 0x32, 0x2e,
1720x31, 0xcc, 0x02, 0x03, 0xfb, 0x06, 0x93, 0x76, 0x61, 0x69, 1720x31, 0xcc, 0x02, 0x02, 0xfb, 0x06, 0x93, 0x76, 0x61, 0x69,
1730x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0xc7, 0x04, 0x13, 0x32, 1730x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0xc7, 0x04, 0x13, 0x32,
1740xc7, 0x04, 0x90, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 1740xc7, 0x04, 0xb1, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74,
1750x65, 0x72, 0xc9, 0x04, 0x00, 0xf2, 0x05, 0x36, 0x73, 0x65, 1750x65, 0x72, 0x73, 0x20, 0x68, 0x05, 0x46, 0x65, 0x73, 0x65,
1760x00, 0x14, 0x00, 0x00, 0x41, 0x00, 0x06, 0x3c, 0x00, 0x51, 1760x00, 0x14, 0x00, 0x02, 0x41, 0x00, 0x04, 0x3c, 0x00, 0x51,
1770x00, 0x66, 0x72, 0x6f, 0x6d, 0x79, 0x00, 0xa0, 0x60, 0x43, 1770x00, 0x66, 0x72, 0x6f, 0x6d, 0x79, 0x00, 0xa0, 0x60, 0x43,
1780x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0xc9, 0x01, 1780x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0xc9, 0x01,
1790x02, 0xa3, 0x00, 0x12, 0x6e, 0x1a, 0x00, 0xc0, 0x54, 0x79, 1790x02, 0xa3, 0x00, 0x12, 0x6e, 0x1a, 0x00, 0xc0, 0x54, 0x79,
diff --git a/apps/plugins/puzzles/help/pegs.c b/apps/plugins/puzzles/help/pegs.c
index 0877c3a5c2..d64cbe8d56 100644
--- a/apps/plugins/puzzles/help/pegs.c
+++ b/apps/plugins/puzzles/help/pegs.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
diff --git a/apps/plugins/puzzles/help/range.c b/apps/plugins/puzzles/help/range.c
index 64e4f59042..62c308778e 100644
--- a/apps/plugins/puzzles/help/range.c
+++ b/apps/plugins/puzzles/help/range.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -14,7 +14,7 @@ struct style_text help_text_style[] = {
14 LAST_STYLE_ITEM 14 LAST_STYLE_ITEM
15}; 15};
16 16
17/* orig 2036 comp 1386 ratio 0.680747 level 11 saved 650 */ 17/* orig 2036 comp 1387 ratio 0.681238 level 4 saved 649 */
18const char help_text[] = { 18const char help_text[] = {
190xf4, 0x26, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 190xf4, 0x26, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
200x33, 0x35, 0x3a, 0x20, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x20, 200x33, 0x35, 0x3a, 0x20, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x20,
@@ -23,20 +23,20 @@ const char help_text[] = {
230x66, 0x00, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x73, 0x3b, 230x66, 0x00, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x73, 0x3b,
240x00, 0x73, 0x6f, 0x6d, 0x65, 0x0e, 0x00, 0xf0, 0x02, 0x00, 240x00, 0x73, 0x6f, 0x6d, 0x65, 0x0e, 0x00, 0xf0, 0x02, 0x00,
250x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x00, 0x6e, 0x75, 250x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x00, 0x6e, 0x75,
260x6d, 0x62, 0x65, 0x72, 0x73, 0x2e, 0x3a, 0x00, 0xf1, 0x03, 260x6d, 0x62, 0x65, 0x72, 0x73, 0x2e, 0x3a, 0x00, 0xf0, 0x00,
270x72, 0x00, 0x6a, 0x6f, 0x62, 0x00, 0x69, 0x73, 0x00, 0x74, 270x72, 0x00, 0x6a, 0x6f, 0x62, 0x00, 0x69, 0x73, 0x00, 0x74,
280x6f, 0x00, 0x63, 0x6f, 0x6c, 0x6f, 0x75, 0x72, 0x34, 0x00, 280x6f, 0x00, 0x63, 0x6f, 0x6c, 0x11, 0x00, 0x01, 0x34, 0x00,
290x00, 0x45, 0x00, 0x26, 0x74, 0x68, 0x3b, 0x00, 0xf3, 0x28, 290x56, 0x6f, 0x66, 0x00, 0x74, 0x68, 0x3b, 0x00, 0xf3, 0x28,
300x62, 0x6c, 0x61, 0x63, 0x6b, 0x2c, 0x00, 0x73, 0x75, 0x63, 300x62, 0x6c, 0x61, 0x63, 0x6b, 0x2c, 0x00, 0x73, 0x75, 0x63,
310x68, 0x00, 0x74, 0x68, 0x61, 0x74, 0x00, 0x73, 0x65, 0x76, 310x68, 0x00, 0x74, 0x68, 0x61, 0x74, 0x00, 0x73, 0x65, 0x76,
320x65, 0x72, 0x61, 0x6c, 0x00, 0x63, 0x72, 0x69, 0x74, 0x65, 320x65, 0x72, 0x61, 0x6c, 0x00, 0x63, 0x72, 0x69, 0x74, 0x65,
330x72, 0x69, 0x61, 0x00, 0x61, 0x72, 0x65, 0x00, 0x73, 0x61, 330x72, 0x69, 0x61, 0x00, 0x61, 0x72, 0x65, 0x00, 0x73, 0x61,
340x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x64, 0x3a, 0x00, 0x00, 340x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x64, 0x3a, 0x00, 0x00,
350x00, 0x2d, 0x00, 0x6e, 0x6f, 0x40, 0x00, 0x73, 0x00, 0x77, 350x00, 0x2d, 0x00, 0x6e, 0x6f, 0x40, 0x00, 0x73, 0x00, 0x77,
360x69, 0x74, 0x68, 0x00, 0x61, 0x79, 0x00, 0x33, 0x00, 0x69, 360x69, 0x74, 0x68, 0x00, 0x61, 0x79, 0x00, 0x00, 0x6e, 0x00,
370x73, 0x6b, 0x00, 0x22, 0x65, 0x64, 0x59, 0x00, 0x14, 0x2e, 370x02, 0x6b, 0x00, 0x22, 0x65, 0x64, 0x59, 0x00, 0x14, 0x2e,
380x2f, 0x00, 0x32, 0x74, 0x77, 0x6f, 0x12, 0x00, 0x04, 0x79, 380x2f, 0x00, 0x32, 0x74, 0x77, 0x6f, 0x12, 0x00, 0x05, 0x79,
390x00, 0x01, 0x57, 0x00, 0xf0, 0x00, 0x61, 0x64, 0x6a, 0x61, 390x00, 0x00, 0x3e, 0x00, 0xf0, 0x00, 0x61, 0x64, 0x6a, 0x61,
400x63, 0x65, 0x6e, 0x74, 0x00, 0x28, 0x68, 0x6f, 0x72, 0x69, 400x63, 0x65, 0x6e, 0x74, 0x00, 0x28, 0x68, 0x6f, 0x72, 0x69,
410x7a, 0xc6, 0x00, 0xd0, 0x6c, 0x6c, 0x79, 0x00, 0x6f, 0x72, 410x7a, 0xc6, 0x00, 0xd0, 0x6c, 0x6c, 0x79, 0x00, 0x6f, 0x72,
420x00, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63, 0x0e, 0x00, 0x12, 420x00, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63, 0x0e, 0x00, 0x12,
@@ -47,114 +47,114 @@ const char help_text[] = {
470x77, 0x65, 0x65, 0x6e, 0x18, 0x00, 0xca, 0x6d, 0x00, 0x75, 470x77, 0x65, 0x65, 0x6e, 0x18, 0x00, 0xca, 0x6d, 0x00, 0x75,
480x73, 0x69, 0x6e, 0x67, 0x00, 0x6f, 0x6e, 0x6c, 0x79, 0x37, 480x73, 0x69, 0x6e, 0x67, 0x00, 0x6f, 0x6e, 0x6c, 0x79, 0x37,
490x00, 0x06, 0x56, 0x00, 0x4f, 0x65, 0x61, 0x63, 0x68, 0xcf, 490x00, 0x06, 0x56, 0x00, 0x4f, 0x65, 0x61, 0x63, 0x68, 0xcf,
500x00, 0x02, 0x11, 0x2c, 0x11, 0x01, 0x04, 0xdc, 0x00, 0x71, 500x00, 0x02, 0x12, 0x2c, 0x11, 0x01, 0x03, 0xdc, 0x00, 0x71,
510x64, 0x65, 0x6e, 0x6f, 0x74, 0x65, 0x73, 0x3d, 0x01, 0x54, 510x64, 0x65, 0x6e, 0x6f, 0x74, 0x65, 0x73, 0x3d, 0x01, 0x54,
520x74, 0x6f, 0x74, 0x61, 0x6c, 0x19, 0x00, 0x2a, 0x6f, 0x66, 520x74, 0x6f, 0x74, 0x61, 0x6c, 0x19, 0x00, 0x2a, 0x6f, 0x66,
530x5a, 0x00, 0x20, 0x00, 0x72, 0x52, 0x00, 0x91, 0x61, 0x62, 530x5a, 0x00, 0x20, 0x00, 0x72, 0x52, 0x00, 0x93, 0x61, 0x62,
540x6c, 0x65, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x45, 0x00, 0x04, 540x6c, 0x65, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x56, 0x01, 0x02,
550x60, 0x00, 0x20, 0x67, 0x6f, 0x8e, 0x00, 0xf1, 0x06, 0x69, 550x60, 0x00, 0x20, 0x67, 0x6f, 0x8e, 0x00, 0xf1, 0x03, 0x69,
560x6e, 0x00, 0x61, 0x00, 0x73, 0x74, 0x72, 0x61, 0x69, 0x67, 560x6e, 0x00, 0x61, 0x00, 0x73, 0x74, 0x72, 0x61, 0x69, 0x67,
570x68, 0x74, 0x00, 0x6c, 0x69, 0x6e, 0x65, 0x00, 0x69, 0x6e, 570x68, 0x74, 0x00, 0x6c, 0x69, 0x6e, 0x65, 0x13, 0x00, 0x36,
580xde, 0x00, 0x06, 0x07, 0x01, 0x08, 0x05, 0x01, 0xf0, 0x06, 580x6e, 0x79, 0x00, 0x07, 0x01, 0x08, 0x05, 0x01, 0xf0, 0x06,
590x00, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 590x00, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
600x00, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x00, 0x68, 0x69, 0x74, 600x00, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x00, 0x68, 0x69, 0x74,
610x74, 0x49, 0x00, 0x51, 0x61, 0x00, 0x77, 0x61, 0x6c, 0x2b, 610x74, 0x49, 0x00, 0x51, 0x61, 0x00, 0x77, 0x61, 0x6c, 0x2b,
620x00, 0x19, 0x61, 0x5e, 0x01, 0x10, 0x3b, 0xa6, 0x00, 0x08, 620x00, 0x19, 0x61, 0x5e, 0x01, 0x17, 0x3b, 0xe3, 0x01, 0x02,
630xd4, 0x00, 0x00, 0x10, 0x00, 0x07, 0xa5, 0x01, 0xb7, 0x69, 630xd4, 0x00, 0x00, 0x10, 0x00, 0x06, 0xa5, 0x01, 0x80, 0x69,
640x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x00, 0x69, 0x6e, 640x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x77, 0x00, 0x06,
650xd0, 0x00, 0x51, 0x28, 0x6f, 0x6e, 0x63, 0x65, 0x6f, 0x01, 650xd0, 0x00, 0x51, 0x28, 0x6f, 0x6e, 0x63, 0x65, 0x6f, 0x01,
660xf3, 0x00, 0x46, 0x6f, 0x72, 0x00, 0x69, 0x6e, 0x73, 0x74, 660xf4, 0x00, 0x46, 0x6f, 0x72, 0x00, 0x69, 0x6e, 0x73, 0x74,
670x61, 0x6e, 0x63, 0x65, 0x2c, 0x00, 0x61, 0x4a, 0x00, 0x04, 670x61, 0x6e, 0x63, 0x65, 0x2c, 0x00, 0x61, 0x4a, 0x00, 0x03,
680x67, 0x02, 0x38, 0x69, 0x6e, 0x67, 0x50, 0x00, 0x82, 0x6f, 680x67, 0x02, 0x00, 0x7a, 0x00, 0x07, 0x50, 0x00, 0x82, 0x6f,
690x6e, 0x65, 0x00, 0x6d, 0x75, 0x73, 0x74, 0xab, 0x02, 0x4c, 690x6e, 0x65, 0x00, 0x6d, 0x75, 0x73, 0x74, 0xab, 0x02, 0x10,
700x66, 0x6f, 0x75, 0x72, 0xea, 0x01, 0xf1, 0x04, 0x73, 0x00, 700x66, 0x69, 0x02, 0x0b, 0xea, 0x01, 0xf1, 0x04, 0x73, 0x00,
710x69, 0x74, 0x73, 0x00, 0x6e, 0x65, 0x69, 0x67, 0x68, 0x62, 710x69, 0x74, 0x73, 0x00, 0x6e, 0x65, 0x69, 0x67, 0x68, 0x62,
720x6f, 0x75, 0x72, 0x73, 0x00, 0x62, 0x79, 0x41, 0x00, 0x44, 720x6f, 0x75, 0x72, 0x73, 0x00, 0x62, 0x79, 0x41, 0x00, 0x44,
730x6c, 0x61, 0x73, 0x74, 0x68, 0x02, 0x70, 0x6f, 0x6e, 0x3b, 730x6c, 0x61, 0x73, 0x74, 0x68, 0x02, 0x70, 0x6f, 0x6e, 0x3b,
740x00, 0x62, 0x75, 0x74, 0x18, 0x00, 0xe1, 0x6e, 0x00, 0x69, 740x00, 0x62, 0x75, 0x74, 0x18, 0x00, 0xe1, 0x6e, 0x00, 0x69,
750x74, 0x27, 0x73, 0x00, 0x69, 0x6d, 0x70, 0x6f, 0x73, 0x73, 750x74, 0x27, 0x73, 0x00, 0x69, 0x6d, 0x70, 0x6f, 0x73, 0x73,
760x69, 0x48, 0x01, 0x00, 0x90, 0x00, 0x10, 0x74, 0xca, 0x02, 760x69, 0x48, 0x01, 0x00, 0x90, 0x00, 0x10, 0x74, 0xca, 0x02,
770x11, 0x62, 0x86, 0x00, 0x91, 0x6e, 0x65, 0x63, 0x74, 0x65, 770x11, 0x62, 0x86, 0x00, 0x60, 0x6e, 0x65, 0x63, 0x74, 0x65,
780x64, 0x00, 0x74, 0x6f, 0x35, 0x01, 0x79, 0x6f, 0x75, 0x74, 780x64, 0x10, 0x00, 0x00, 0x35, 0x01, 0x79, 0x6f, 0x75, 0x74,
790x73, 0x69, 0x64, 0x65, 0x86, 0x01, 0x10, 0x2c, 0x0e, 0x00, 790x73, 0x69, 0x64, 0x65, 0x86, 0x01, 0x10, 0x2c, 0x0e, 0x00,
800x84, 0x63, 0x68, 0x00, 0x76, 0x69, 0x6f, 0x6c, 0x61, 0xb7, 800x84, 0x63, 0x68, 0x00, 0x76, 0x69, 0x6f, 0x6c, 0x61, 0xb7,
810x01, 0x50, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x37, 0x00, 0x0b, 810x01, 0x51, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x37, 0x00, 0x0a,
820x7a, 0x00, 0x49, 0x2e, 0x00, 0x53, 0x6f, 0xd4, 0x02, 0x24, 820x7a, 0x00, 0x49, 0x2e, 0x00, 0x53, 0x6f, 0xd4, 0x02, 0x25,
830x6c, 0x6c, 0xec, 0x00, 0x0b, 0xe9, 0x00, 0x00, 0x1d, 0x01, 830x6c, 0x6c, 0x53, 0x03, 0x0a, 0xe9, 0x00, 0x00, 0x1d, 0x01,
840x61, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x94, 0x00, 0xa0, 840x61, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x94, 0x00, 0xa0,
850x74, 0x68, 0x69, 0x73, 0x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 850x74, 0x68, 0x69, 0x73, 0x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c,
860xdb, 0x01, 0x11, 0x65, 0x6c, 0x03, 0x60, 0x4e, 0x69, 0x6b, 860xdb, 0x01, 0x11, 0x65, 0x6c, 0x03, 0x60, 0x4e, 0x69, 0x6b,
870x6f, 0x6c, 0x69, 0x80, 0x00, 0x12, 0x6f, 0x12, 0x01, 0xa0, 870x6f, 0x6c, 0x69, 0x80, 0x00, 0x12, 0x6f, 0x12, 0x01, 0xa0,
880x76, 0x61, 0x72, 0x69, 0x6f, 0x75, 0x73, 0x6c, 0x79, 0x00, 880x76, 0x61, 0x72, 0x69, 0x6f, 0x75, 0x73, 0x6c, 0x79, 0x00,
890xd0, 0x02, 0x20, 0x65, 0x64, 0xca, 0x00, 0xb2, 0x60, 0x4b, 890xd0, 0x02, 0x00, 0x75, 0x01, 0xd2, 0x74, 0x00, 0x60, 0x4b,
900x75, 0x72, 0x6f, 0x64, 0x6f, 0x6b, 0x6f, 0x27, 0x2c, 0x0c, 900x75, 0x72, 0x6f, 0x64, 0x6f, 0x6b, 0x6f, 0x27, 0x2c, 0x0c,
910x00, 0x50, 0x6d, 0x61, 0x73, 0x75, 0x27, 0xc9, 0x01, 0x24, 910x00, 0x50, 0x6d, 0x61, 0x73, 0x75, 0x27, 0xc9, 0x01, 0x24,
920x60, 0x57, 0xce, 0x02, 0x11, 0x42, 0x45, 0x01, 0xc0, 0x43, 920x60, 0x57, 0xce, 0x02, 0x11, 0x42, 0x45, 0x01, 0xc0, 0x43,
930x65, 0x6c, 0x6c, 0x73, 0x27, 0x2e, 0x00, 0x5b, 0x31, 0x38, 930x65, 0x6c, 0x6c, 0x73, 0x27, 0x2e, 0x00, 0x5b, 0x31, 0x38,
940x5d, 0x7e, 0x00, 0x01, 0x1d, 0x04, 0x32, 0x00, 0x77, 0x61, 940x5d, 0x7e, 0x00, 0x01, 0x1d, 0x04, 0x32, 0x00, 0x77, 0x61,
950xf5, 0x03, 0x43, 0x72, 0x69, 0x62, 0x75, 0x0a, 0x01, 0x22, 950xf5, 0x03, 0x43, 0x72, 0x69, 0x62, 0x75, 0x0a, 0x01, 0x22,
960x74, 0x68, 0x7e, 0x03, 0x12, 0x6c, 0x2a, 0x02, 0x00, 0x64, 960x74, 0x68, 0x7e, 0x03, 0x13, 0x6c, 0x2a, 0x02, 0xf0, 0x01,
970x01, 0xd0, 0x4a, 0x6f, 0x6e, 0x61, 0x73, 0x00, 0x4b, 0x6f, 970x62, 0x79, 0x00, 0x4a, 0x6f, 0x6e, 0x61, 0x73, 0x00, 0x4b,
980x65, 0x6c, 0x6b, 0x65, 0x72, 0x3d, 0x00, 0x00, 0x45, 0x00, 980x6f, 0x65, 0x6c, 0x6b, 0x65, 0x72, 0x3d, 0x00, 0x00, 0x45,
990xd1, 0x00, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 990x00, 0xd1, 0x00, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f,
1000x77, 0x77, 0x2e, 0x6e, 0xac, 0x00, 0xa2, 0x2e, 0x63, 0x6f, 1000x77, 0x77, 0x77, 0x2e, 0x6e, 0xac, 0x00, 0xa2, 0x2e, 0x63,
1010x2e, 0x6a, 0x70, 0x2f, 0x65, 0x6e, 0x2f, 0xcb, 0x00, 0x30, 1010x6f, 0x2e, 0x6a, 0x70, 0x2f, 0x65, 0x6e, 0x2f, 0xcb, 0x00,
1020x73, 0x2f, 0x77, 0x84, 0x00, 0x41, 0x5f, 0x69, 0x73, 0x5f, 1020x30, 0x73, 0x2f, 0x77, 0x84, 0x00, 0x41, 0x5f, 0x69, 0x73,
1030xc9, 0x01, 0x20, 0x5f, 0x63, 0x84, 0x00, 0xc3, 0x2e, 0x68, 1030x5f, 0xc9, 0x01, 0x20, 0x5f, 0x63, 0x84, 0x00, 0xc3, 0x2e,
1040x74, 0x6d, 0x6c, 0x00, 0x00, 0x00, 0x33, 0x35, 0x2e, 0x31, 1040x68, 0x74, 0x6d, 0x6c, 0x00, 0x00, 0x00, 0x33, 0x35, 0x2e,
1050xa3, 0x04, 0x01, 0x82, 0x00, 0x40, 0x6f, 0x6c, 0x73, 0x20, 1050x31, 0xa3, 0x04, 0x01, 0x82, 0x00, 0x30, 0x6f, 0x6c, 0x73,
1060x16, 0x01, 0x46, 0x6c, 0x69, 0x63, 0x6b, 0x6c, 0x02, 0x40, 1060xac, 0x04, 0x56, 0x43, 0x6c, 0x69, 0x63, 0x6b, 0x6c, 0x02,
1070x6c, 0x65, 0x66, 0x74, 0xd0, 0x01, 0x30, 0x74, 0x6f, 0x6e, 1070x40, 0x6c, 0x65, 0x66, 0x74, 0xd0, 0x01, 0x30, 0x74, 0x6f,
1080x9d, 0x00, 0x55, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x49, 0x02, 1080x6e, 0x9d, 0x00, 0x56, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x49,
1090x04, 0x75, 0x04, 0x26, 0x6f, 0x72, 0x31, 0x00, 0x48, 0x72, 1090x02, 0x03, 0x75, 0x04, 0x26, 0x6f, 0x72, 0x31, 0x00, 0x11,
1100x69, 0x67, 0x68, 0x32, 0x00, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 1100x72, 0x0c, 0x03, 0x06, 0x32, 0x00, 0x6b, 0x6d, 0x61, 0x72,
1110x00, 0x61, 0x98, 0x03, 0x21, 0x64, 0x6f, 0x05, 0x02, 0x82, 1110x6b, 0x00, 0x61, 0x98, 0x03, 0x21, 0x64, 0x6f, 0x05, 0x02,
1120x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5b, 0x03, 1120x82, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5b,
1130x32, 0x79, 0x6f, 0x75, 0xa4, 0x04, 0x30, 0x75, 0x72, 0x65, 1130x03, 0x32, 0x79, 0x6f, 0x75, 0xa4, 0x04, 0x10, 0x75, 0x38,
1140x5c, 0x01, 0xd2, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x00, 1140x01, 0xc0, 0x74, 0x00, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64,
1150x6e, 0x6f, 0x74, 0x00, 0x62, 0x65, 0x7a, 0x00, 0x06, 0x8f, 1150x00, 0x6e, 0x6f, 0x74, 0x2e, 0x02, 0x01, 0x7a, 0x00, 0x06,
1160x04, 0x50, 0x52, 0x65, 0x70, 0x65, 0x61, 0x10, 0x00, 0x10, 1160x8f, 0x04, 0x50, 0x52, 0x65, 0x70, 0x65, 0x61, 0x10, 0x00,
1170x63, 0xb0, 0x00, 0x32, 0x69, 0x6e, 0x67, 0x5b, 0x00, 0x20, 1170x10, 0x63, 0xb0, 0x00, 0x00, 0xca, 0x02, 0x01, 0x5b, 0x00,
1180x65, 0x69, 0x45, 0x04, 0x03, 0x7f, 0x00, 0x03, 0x01, 0x02, 1180x20, 0x65, 0x69, 0x45, 0x04, 0x04, 0x7f, 0x00, 0x02, 0x01,
1190x48, 0x79, 0x63, 0x6c, 0x65, 0x48, 0x03, 0x60, 0x74, 0x68, 1190x02, 0x48, 0x79, 0x63, 0x6c, 0x65, 0x48, 0x03, 0x62, 0x74,
1200x72, 0x6f, 0x75, 0x67, 0xae, 0x00, 0x01, 0x0c, 0x00, 0x35, 1200x68, 0x72, 0x6f, 0x75, 0x67, 0xae, 0x00, 0x65, 0x74, 0x68,
1210x65, 0x65, 0x00, 0xa0, 0x02, 0x21, 0x73, 0x74, 0x64, 0x02, 1210x72, 0x65, 0x65, 0x00, 0xa0, 0x02, 0x21, 0x73, 0x74, 0x64,
1220x30, 0x28, 0x66, 0x69, 0xe1, 0x01, 0x10, 0x2c, 0xa8, 0x00, 1220x02, 0x30, 0x28, 0x66, 0x69, 0xe1, 0x01, 0x10, 0x2c, 0xa8,
1230x00, 0x64, 0x00, 0x00, 0x5d, 0x04, 0x50, 0x6d, 0x70, 0x74, 1230x00, 0x00, 0x64, 0x00, 0x00, 0x5d, 0x04, 0x50, 0x6d, 0x70,
1240x79, 0x29, 0x68, 0x03, 0x86, 0x6f, 0x70, 0x70, 0x6f, 0x73, 1240x74, 0x79, 0x29, 0x68, 0x03, 0x50, 0x6f, 0x70, 0x70, 0x6f,
1250x69, 0x74, 0x65, 0xcd, 0x03, 0x23, 0x73, 0x2e, 0xe4, 0x05, 1250x73, 0xa1, 0x02, 0x05, 0xcd, 0x03, 0x23, 0x73, 0x2e, 0xe4,
1260xb2, 0x63, 0x61, 0x6e, 0x00, 0x61, 0x6c, 0x73, 0x6f, 0x00, 1260x05, 0xb2, 0x63, 0x61, 0x6e, 0x00, 0x61, 0x6c, 0x73, 0x6f,
1270x75, 0x73, 0x72, 0x00, 0xb1, 0x63, 0x75, 0x72, 0x73, 0x6f, 1270x00, 0x75, 0x73, 0x72, 0x00, 0xa1, 0x63, 0x75, 0x72, 0x73,
1280x72, 0x00, 0x6b, 0x65, 0x79, 0x73, 0x0c, 0x01, 0x10, 0x6f, 1280x6f, 0x72, 0x00, 0x6b, 0x65, 0x79, 0x53, 0x02, 0x20, 0x6d,
1290x04, 0x06, 0x50, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x1f, 0x00, 1290x6f, 0x04, 0x06, 0x51, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x1f,
1300x01, 0x0d, 0x06, 0x06, 0xc8, 0x04, 0x41, 0x50, 0x72, 0x65, 1300x00, 0x01, 0x0d, 0x06, 0x05, 0xc8, 0x04, 0x41, 0x50, 0x72,
1310x73, 0xe5, 0x04, 0x94, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 1310x65, 0x73, 0xe5, 0x04, 0x94, 0x52, 0x65, 0x74, 0x75, 0x72,
1320x00, 0x64, 0x6f, 0xef, 0x02, 0x68, 0x61, 0x6d, 0x65, 0x00, 1320x6e, 0x00, 0x64, 0x6f, 0xef, 0x02, 0x30, 0x61, 0x6d, 0x65,
1330x61, 0x73, 0xeb, 0x00, 0x0e, 0x9e, 0x01, 0x01, 0x29, 0x03, 1330x7d, 0x03, 0x0a, 0xeb, 0x00, 0x0b, 0x9e, 0x01, 0x01, 0x29,
1340x44, 0x6c, 0x65, 0x00, 0x70, 0x46, 0x00, 0x5e, 0x53, 0x70, 1340x03, 0x44, 0x6c, 0x65, 0x00, 0x70, 0x46, 0x00, 0x5e, 0x53,
1350x61, 0x63, 0x65, 0x45, 0x00, 0x19, 0x61, 0xa2, 0x01, 0x02, 1350x70, 0x61, 0x63, 0x65, 0x45, 0x00, 0x1a, 0x61, 0xa2, 0x01,
1360x54, 0x00, 0x54, 0x2e, 0x00, 0x4d, 0x6f, 0x76, 0x59, 0x00, 1360x01, 0x54, 0x00, 0x59, 0x2e, 0x00, 0x4d, 0x6f, 0x76, 0x59,
1370x0c, 0xb9, 0x00, 0x03, 0x58, 0x00, 0x41, 0x68, 0x6f, 0x6c, 1370x00, 0x08, 0xb9, 0x00, 0x02, 0x58, 0x00, 0x41, 0x68, 0x6f,
1380x64, 0x57, 0x00, 0x42, 0x68, 0x69, 0x66, 0x74, 0x5a, 0x01, 1380x6c, 0x64, 0x57, 0x00, 0x42, 0x68, 0x69, 0x66, 0x74, 0x5a,
1390x22, 0x70, 0x6c, 0x62, 0x00, 0x21, 0x74, 0x73, 0xf7, 0x04, 1390x01, 0x22, 0x70, 0x6c, 0x62, 0x00, 0x21, 0x74, 0x73, 0xf7,
1400x24, 0x6c, 0x6c, 0xcc, 0x00, 0x01, 0xd0, 0x01, 0x00, 0xcc, 1400x04, 0x25, 0x6c, 0x6c, 0x2a, 0x04, 0x01, 0xd0, 0x01, 0x00,
1410x01, 0x01, 0xf2, 0x00, 0x14, 0x64, 0x72, 0x01, 0x00, 0x27, 1410x6c, 0x01, 0x00, 0xf2, 0x00, 0x14, 0x64, 0x72, 0x01, 0x00,
1420x01, 0x41, 0x28, 0x41, 0x6c, 0x6c, 0x62, 0x00, 0x12, 0x61, 1420x27, 0x01, 0x41, 0x28, 0x41, 0x6c, 0x6c, 0x62, 0x00, 0x12,
1430x3b, 0x01, 0x82, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 1430x61, 0x3b, 0x01, 0x82, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72,
1440x62, 0xc4, 0x04, 0x13, 0x73, 0xf4, 0x02, 0x30, 0x32, 0x2e, 1440x69, 0x62, 0xc4, 0x04, 0x13, 0x73, 0xf4, 0x02, 0x32, 0x32,
1450x31, 0x3f, 0x00, 0x02, 0x4d, 0x01, 0x50, 0x61, 0x76, 0x61, 1450x2e, 0x31, 0x58, 0x06, 0x00, 0x4d, 0x01, 0x50, 0x61, 0x76,
1460x69, 0x6c, 0x87, 0x05, 0x22, 0x2e, 0x29, 0xb7, 0x02, 0x13, 1460x61, 0x69, 0x6c, 0x87, 0x05, 0x22, 0x2e, 0x29, 0xb7, 0x02,
1470x32, 0xb7, 0x02, 0x91, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 1470x13, 0x32, 0xb7, 0x02, 0x91, 0x70, 0x61, 0x72, 0x61, 0x6d,
1480x74, 0x65, 0x72, 0xb9, 0x02, 0x65, 0x54, 0x68, 0x65, 0x73, 1480x65, 0x74, 0x65, 0x72, 0xb9, 0x02, 0x66, 0x54, 0x68, 0x65,
1490x65, 0x00, 0x14, 0x00, 0x01, 0x99, 0x06, 0x02, 0x3c, 0x00, 1490x73, 0x65, 0x00, 0x14, 0x00, 0x02, 0x41, 0x00, 0x04, 0x3c,
1500x08, 0xc3, 0x05, 0xf1, 0x01, 0x65, 0x00, 0x60, 0x43, 0x75, 1500x00, 0x04, 0xc3, 0x05, 0xf1, 0x01, 0x65, 0x00, 0x60, 0x43,
1510x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 1510x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00,
1520x70, 0x6f, 0x00, 0x22, 0x6f, 0x6e, 0x1a, 0x00, 0xa0, 0x54, 1520x6f, 0x70, 0x6f, 0x00, 0x22, 0x6f, 0x6e, 0x1a, 0x00, 0xa0,
1530x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0xab, 1530x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75,
1540x00, 0x91, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 0x48, 1540xab, 0x00, 0x91, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x00,
1550x65, 0x30, 0x01, 0x50, 0x00, 0x00, 0x53, 0x69, 0x7a, 0x76, 1550x48, 0x65, 0x30, 0x01, 0x51, 0x00, 0x00, 0x53, 0x69, 0x7a,
1560x07, 0x00, 0xb6, 0x01, 0x02, 0xad, 0x00, 0x80, 0x71, 0x75, 1560x76, 0x07, 0x01, 0xb6, 0x01, 0x00, 0xad, 0x00, 0x80, 0x71,
1570x61, 0x72, 0x65, 0x73, 0x2e, 0x00, 1570x75, 0x61, 0x72, 0x65, 0x73, 0x2e, 0x00,
158}; 158};
159 159
160const unsigned short help_text_len = 2036; 160const unsigned short help_text_len = 2036;
diff --git a/apps/plugins/puzzles/help/rect.c b/apps/plugins/puzzles/help/rect.c
index 8ce9af4a73..768bd1a4ce 100644
--- a/apps/plugins/puzzles/help/rect.c
+++ b/apps/plugins/puzzles/help/rect.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -18,7 +18,7 @@ struct style_text help_text_style[] = {
18 LAST_STYLE_ITEM 18 LAST_STYLE_ITEM
19}; 19};
20 20
21/* orig 3535 comp 2340 ratio 0.661952 level 11 saved 1195 */ 21/* orig 3535 comp 2341 ratio 0.662235 level 10 saved 1194 */
22const char help_text[] = { 22const char help_text[] = {
230xf0, 0x50, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 230xf0, 0x50, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
240x38, 0x3a, 0x20, 0x52, 0x65, 0x63, 0x74, 0x61, 0x6e, 0x67, 240x38, 0x3a, 0x20, 0x52, 0x65, 0x63, 0x74, 0x61, 0x6e, 0x67,
@@ -30,10 +30,10 @@ const char help_text[] = {
300x69, 0x74, 0x74, 0x65, 0x6e, 0x00, 0x69, 0x6e, 0x00, 0x73, 300x69, 0x74, 0x74, 0x65, 0x6e, 0x00, 0x69, 0x6e, 0x00, 0x73,
310x6f, 0x6d, 0x65, 0x00, 0x28, 0x62, 0x75, 0x74, 0x00, 0x6e, 310x6f, 0x6d, 0x65, 0x00, 0x28, 0x62, 0x75, 0x74, 0x00, 0x6e,
320x6f, 0x74, 0x00, 0x61, 0x6c, 0x6c, 0x29, 0x37, 0x00, 0x34, 320x6f, 0x74, 0x00, 0x61, 0x6c, 0x6c, 0x29, 0x37, 0x00, 0x34,
330x74, 0x68, 0x65, 0x3b, 0x00, 0x10, 0x2e, 0x57, 0x00, 0xf0, 330x74, 0x68, 0x65, 0x3b, 0x00, 0x10, 0x2e, 0x57, 0x00, 0xf1,
340x07, 0x72, 0x00, 0x74, 0x61, 0x73, 0x6b, 0x00, 0x69, 0x73, 340x07, 0x72, 0x00, 0x74, 0x61, 0x73, 0x6b, 0x00, 0x69, 0x73,
350x00, 0x74, 0x6f, 0x00, 0x73, 0x75, 0x62, 0x64, 0x69, 0x76, 350x00, 0x74, 0x6f, 0x00, 0x73, 0x75, 0x62, 0x64, 0x69, 0x76,
360x69, 0x64, 0x65, 0x27, 0x00, 0x02, 0x6a, 0x00, 0x65, 0x69, 360x69, 0x64, 0x65, 0x27, 0x00, 0x01, 0x6a, 0x00, 0x65, 0x69,
370x6e, 0x74, 0x6f, 0x00, 0x72, 0x8d, 0x00, 0x00, 0x43, 0x00, 370x6e, 0x74, 0x6f, 0x00, 0x72, 0x8d, 0x00, 0x00, 0x43, 0x00,
380xb0, 0x76, 0x61, 0x72, 0x69, 0x6f, 0x75, 0x73, 0x00, 0x73, 380xb0, 0x76, 0x61, 0x72, 0x69, 0x6f, 0x75, 0x73, 0x00, 0x73,
390x69, 0x7a, 0x80, 0x00, 0xf6, 0x04, 0x73, 0x75, 0x63, 0x68, 390x69, 0x7a, 0x80, 0x00, 0xf6, 0x04, 0x73, 0x75, 0x63, 0x68,
@@ -43,8 +43,8 @@ const char help_text[] = {
430x78, 0x61, 0x63, 0x74, 0x6c, 0x79, 0x00, 0x6f, 0x6e, 0x65, 430x78, 0x61, 0x63, 0x74, 0x6c, 0x79, 0x00, 0x6f, 0x6e, 0x65,
440xae, 0x00, 0x23, 0x65, 0x64, 0x8a, 0x00, 0x91, 0x2c, 0x00, 440xae, 0x00, 0x23, 0x65, 0x64, 0x8a, 0x00, 0x91, 0x2c, 0x00,
450x61, 0x6e, 0x64, 0x00, 0x28, 0x62, 0x29, 0x77, 0x00, 0x40, 450x61, 0x6e, 0x64, 0x00, 0x28, 0x62, 0x29, 0x77, 0x00, 0x40,
460x61, 0x72, 0x65, 0x61, 0x67, 0x00, 0x46, 0x65, 0x61, 0x63, 460x61, 0x72, 0x65, 0x61, 0x67, 0x00, 0x47, 0x65, 0x61, 0x63,
470x68, 0x49, 0x00, 0x00, 0xa2, 0x00, 0x50, 0x65, 0x71, 0x75, 470x68, 0x49, 0x00, 0x80, 0x69, 0x73, 0x00, 0x65, 0x71, 0x75,
480x61, 0x6c, 0xa8, 0x00, 0x24, 0x74, 0x68, 0x44, 0x00, 0x08, 480x61, 0x6c, 0xa8, 0x00, 0x24, 0x74, 0x68, 0x44, 0x00, 0x08,
490xf1, 0x00, 0x3c, 0x69, 0x74, 0x73, 0x5a, 0x00, 0xf4, 0x0e, 490xf1, 0x00, 0x3c, 0x69, 0x74, 0x73, 0x5a, 0x00, 0xf4, 0x0e,
500x2e, 0x00, 0x00, 0x00, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 500x2e, 0x00, 0x00, 0x00, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74,
@@ -54,11 +54,11 @@ const char help_text[] = {
540x65, 0x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x00, 0x6d, 540x65, 0x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x00, 0x6d,
550x61, 0x67, 0x61, 0x7a, 0x69, 0x6e, 0x65, 0x00, 0x4e, 0x69, 550x61, 0x67, 0x61, 0x7a, 0x69, 0x6e, 0x65, 0x00, 0x4e, 0x69,
560x6b, 0x6f, 0x6c, 0x69, 0x00, 0x5b, 0x33, 0x5d, 0x3b, 0x00, 560x6b, 0x6f, 0x6c, 0x69, 0x00, 0x5b, 0x33, 0x5d, 0x3b, 0x00,
570x49, 0x27, 0x7e, 0x01, 0xf1, 0x14, 0x6c, 0x73, 0x6f, 0x00, 570x49, 0x27, 0x7e, 0x01, 0xf2, 0x14, 0x6c, 0x73, 0x6f, 0x00,
580x73, 0x65, 0x65, 0x6e, 0x00, 0x61, 0x00, 0x50, 0x61, 0x6c, 580x73, 0x65, 0x65, 0x6e, 0x00, 0x61, 0x00, 0x50, 0x61, 0x6c,
590x6d, 0x00, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 590x6d, 0x00, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e,
600x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x61, 0x74, 0x00, 600x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x61, 0x74, 0x00,
610x50, 0x44, 0x00, 0x00, 0x1e, 0x00, 0xfa, 0x00, 0x61, 0x63, 610x50, 0x44, 0x00, 0xfa, 0x03, 0x50, 0x61, 0x6c, 0x61, 0x63,
620x65, 0x00, 0x5b, 0x34, 0x5d, 0x2e, 0x00, 0x55, 0x6e, 0x6c, 620x65, 0x00, 0x5b, 0x34, 0x5d, 0x2e, 0x00, 0x55, 0x6e, 0x6c,
630x69, 0x6b, 0x65, 0x1a, 0x00, 0x2b, 0x27, 0x73, 0x3c, 0x00, 630x69, 0x6b, 0x65, 0x1a, 0x00, 0x2b, 0x27, 0x73, 0x3c, 0x00,
640x91, 0x2c, 0x00, 0x6d, 0x79, 0x00, 0x76, 0x65, 0x72, 0x73, 640x91, 0x2c, 0x00, 0x6d, 0x79, 0x00, 0x76, 0x65, 0x72, 0x73,
@@ -68,7 +68,7 @@ const char help_text[] = {
680x64, 0x6f, 0x6d, 0x99, 0x01, 0x01, 0x8a, 0x01, 0x31, 0x61, 680x64, 0x6f, 0x6d, 0x99, 0x01, 0x01, 0x8a, 0x01, 0x31, 0x61,
690x6e, 0x79, 0x86, 0x01, 0x50, 0x00, 0x79, 0x6f, 0x75, 0x00, 690x6e, 0x79, 0x86, 0x01, 0x50, 0x00, 0x79, 0x6f, 0x75, 0x00,
700x65, 0x00, 0x60, 0x2e, 0x00, 0x54, 0x68, 0x65, 0x00, 0x27, 700x65, 0x00, 0x60, 0x2e, 0x00, 0x54, 0x68, 0x65, 0x00, 0x27,
710x01, 0x64, 0x69, 0x74, 0x79, 0x00, 0x6f, 0x66, 0xd3, 0x00, 710x01, 0x30, 0x69, 0x74, 0x79, 0x22, 0x00, 0x03, 0xd3, 0x00,
720x61, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0xe6, 0x01, 0x81, 720x61, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0xe6, 0x01, 0x81,
730x68, 0x65, 0x72, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x16, 0x02, 730x68, 0x65, 0x72, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x16, 0x02,
740xd0, 0x71, 0x75, 0x69, 0x74, 0x65, 0x00, 0x61, 0x73, 0x00, 740xd0, 0x71, 0x75, 0x69, 0x74, 0x65, 0x00, 0x61, 0x73, 0x00,
@@ -77,183 +77,184 @@ const char help_text[] = {
770x00, 0xc0, 0x73, 0x00, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x00, 770x00, 0xc0, 0x73, 0x00, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x00,
780x62, 0x65, 0x2c, 0x00, 0x4e, 0x02, 0x21, 0x6f, 0x6e, 0x36, 780x62, 0x65, 0x2c, 0x00, 0x4e, 0x02, 0x21, 0x6f, 0x6e, 0x36,
790x01, 0x21, 0x70, 0x6c, 0x03, 0x02, 0x12, 0x64, 0x7d, 0x00, 790x01, 0x21, 0x70, 0x6c, 0x03, 0x02, 0x12, 0x64, 0x7d, 0x00,
800x50, 0x67, 0x65, 0x74, 0x00, 0x61, 0x86, 0x01, 0xf6, 0x02, 800x50, 0x67, 0x65, 0x74, 0x00, 0x61, 0x86, 0x01, 0xf7, 0x02,
810x65, 0x78, 0x68, 0x61, 0x75, 0x73, 0x74, 0x69, 0x62, 0x6c, 810x65, 0x78, 0x68, 0x61, 0x75, 0x73, 0x74, 0x69, 0x62, 0x6c,
820x65, 0x00, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x87, 0x00, 0x00, 820x65, 0x00, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x87, 0x00, 0x70,
830x72, 0x01, 0x70, 0x61, 0x69, 0x6c, 0x6f, 0x72, 0x65, 0x64, 830x73, 0x00, 0x74, 0x61, 0x69, 0x6c, 0x6f, 0x9f, 0x01, 0x40,
840x7b, 0x01, 0x10, 0x79, 0x7d, 0x02, 0xc1, 0x6f, 0x77, 0x6e, 840x74, 0x6f, 0x00, 0x79, 0x7d, 0x02, 0xc1, 0x6f, 0x77, 0x6e,
850x00, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x08, 850x00, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x08,
860x01, 0x30, 0x2e, 0x00, 0x00, 0x71, 0x01, 0xd1, 0x00, 0x68, 860x01, 0x00, 0xb2, 0x01, 0xf1, 0x01, 0x5b, 0x33, 0x5d, 0x00,
870x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 870x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77,
880x6e, 0x87, 0x01, 0xa3, 0x2e, 0x63, 0x6f, 0x2e, 0x6a, 0x70, 880x2e, 0x6e, 0x87, 0x01, 0xa3, 0x2e, 0x63, 0x6f, 0x2e, 0x6a,
890x2f, 0x65, 0x6e, 0x2f, 0x4d, 0x00, 0xf0, 0x06, 0x2f, 0x73, 890x70, 0x2f, 0x65, 0x6e, 0x2f, 0x4d, 0x00, 0xf0, 0x06, 0x2f,
900x68, 0x69, 0x6b, 0x61, 0x6b, 0x75, 0x2e, 0x68, 0x74, 0x6d, 900x73, 0x68, 0x69, 0x6b, 0x61, 0x6b, 0x75, 0x2e, 0x68, 0x74,
910x6c, 0x00, 0x28, 0x62, 0x65, 0x77, 0x61, 0x72, 0x65, 0x6d, 910x6d, 0x6c, 0x00, 0x28, 0x62, 0x65, 0x77, 0x61, 0x72, 0x65,
920x00, 0x60, 0x46, 0x6c, 0x61, 0x73, 0x68, 0x29, 0x48, 0x00, 920x6d, 0x00, 0x60, 0x46, 0x6c, 0x61, 0x73, 0x68, 0x29, 0x48,
930x12, 0x34, 0x48, 0x00, 0x10, 0x73, 0x49, 0x00, 0xe0, 0x65, 930x00, 0x12, 0x34, 0x48, 0x00, 0x10, 0x73, 0x49, 0x00, 0xe0,
940x62, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 940x65, 0x62, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65,
950x6f, 0x72, 0x67, 0x10, 0x00, 0xf7, 0x01, 0x2f, 0x32, 0x30, 950x2e, 0x6f, 0x72, 0x67, 0x10, 0x00, 0xf7, 0x01, 0x2f, 0x32,
960x30, 0x34, 0x31, 0x30, 0x32, 0x34, 0x30, 0x30, 0x31, 0x34, 960x30, 0x30, 0x34, 0x31, 0x30, 0x32, 0x34, 0x30, 0x30, 0x31,
970x35, 0x39, 0x2f, 0x73, 0x00, 0x02, 0x63, 0x00, 0x63, 0x2e, 970x34, 0x35, 0x39, 0x2f, 0x73, 0x00, 0x02, 0x63, 0x00, 0x30,
980x67, 0x72, 0x2e, 0x6a, 0x70, 0x70, 0x00, 0x21, 0x2f, 0x73, 980x2e, 0x67, 0x72, 0x73, 0x00, 0x02, 0x0d, 0x00, 0x21, 0x2f,
990x6e, 0x00, 0xb1, 0x2f, 0x70, 0x61, 0x6c, 0x6d, 0x2f, 0x69, 990x73, 0x6e, 0x00, 0xb1, 0x2f, 0x70, 0x61, 0x6c, 0x6d, 0x2f,
1000x6e, 0x64, 0x65, 0x78, 0x79, 0x00, 0x98, 0x2e, 0x65, 0x6e, 1000x69, 0x6e, 0x64, 0x65, 0x78, 0x79, 0x00, 0x98, 0x2e, 0x65,
1010x00, 0x00, 0x00, 0x38, 0x2e, 0x31, 0xb2, 0x03, 0x00, 0xf5, 1010x6e, 0x00, 0x00, 0x00, 0x38, 0x2e, 0x31, 0xb2, 0x03, 0x00,
1020x02, 0x31, 0x72, 0x6f, 0x6c, 0xbb, 0x03, 0x13, 0x54, 0x74, 1020xf5, 0x02, 0x31, 0x72, 0x6f, 0x6c, 0xbb, 0x03, 0x15, 0x54,
1030x02, 0x01, 0xc2, 0x02, 0x61, 0x70, 0x6c, 0x61, 0x79, 0x65, 1030x74, 0x02, 0x92, 0x69, 0x73, 0x00, 0x70, 0x6c, 0x61, 0x79,
1040x64, 0xb3, 0x03, 0x01, 0x45, 0x01, 0xf0, 0x05, 0x6d, 0x6f, 1040x65, 0x64, 0xb3, 0x03, 0x00, 0x45, 0x01, 0xf0, 0x05, 0x6d,
1050x75, 0x73, 0x65, 0x00, 0x6f, 0x72, 0x00, 0x63, 0x75, 0x72, 1050x6f, 0x75, 0x73, 0x65, 0x00, 0x6f, 0x72, 0x00, 0x63, 0x75,
1060x73, 0x6f, 0x72, 0x00, 0x6b, 0x65, 0x79, 0x73, 0x02, 0x01, 1060x72, 0x73, 0x6f, 0x72, 0x00, 0x6b, 0x65, 0x79, 0x73, 0x02,
1070xa1, 0x4c, 0x65, 0x66, 0x74, 0x2d, 0x63, 0x6c, 0x69, 0x63, 1070x01, 0xa1, 0x4c, 0x65, 0x66, 0x74, 0x2d, 0x63, 0x6c, 0x69,
1080x6b, 0xe4, 0x01, 0x41, 0x65, 0x64, 0x67, 0x65, 0xae, 0x02, 1080x63, 0x6b, 0xe4, 0x01, 0x41, 0x65, 0x64, 0x67, 0x65, 0xae,
1090x21, 0x6f, 0x67, 0x0b, 0x03, 0x00, 0x85, 0x01, 0x00, 0x36, 1090x02, 0x21, 0x6f, 0x67, 0x0b, 0x03, 0x01, 0x85, 0x01, 0x70,
1100x00, 0x40, 0x6f, 0x66, 0x66, 0x2c, 0x08, 0x00, 0x18, 0x6c, 1100x6f, 0x72, 0x00, 0x6f, 0x66, 0x66, 0x2c, 0x08, 0x00, 0x18,
1110x2f, 0x00, 0x90, 0x64, 0x00, 0x64, 0x72, 0x61, 0x67, 0x00, 1110x6c, 0x2f, 0x00, 0x60, 0x64, 0x00, 0x64, 0x72, 0x61, 0x67,
1120x74, 0x6f, 0x08, 0x00, 0x10, 0x77, 0x96, 0x01, 0x67, 0x65, 1120x2f, 0x00, 0x40, 0x64, 0x72, 0x61, 0x77, 0x96, 0x01, 0x67,
1130x6e, 0x74, 0x69, 0x72, 0x65, 0x4c, 0x03, 0x10, 0x28, 0x34, 1130x65, 0x6e, 0x74, 0x69, 0x72, 0x65, 0x4c, 0x03, 0x10, 0x28,
1140x00, 0x78, 0x69, 0x6e, 0x65, 0x29, 0x00, 0x6f, 0x6e, 0xeb, 1140x34, 0x00, 0x44, 0x69, 0x6e, 0x65, 0x29, 0xcd, 0x01, 0x03,
1150x03, 0x01, 0x9d, 0x03, 0xc2, 0x67, 0x6f, 0x00, 0x28, 0x72, 1150xeb, 0x03, 0x01, 0x9d, 0x03, 0xc2, 0x67, 0x6f, 0x00, 0x28,
1160x65, 0x6d, 0x6f, 0x76, 0x69, 0x6e, 0x67, 0x7e, 0x00, 0x71, 1160x72, 0x65, 0x6d, 0x6f, 0x76, 0x69, 0x6e, 0x67, 0x7e, 0x00,
1170x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x87, 0x00, 0x11, 1170x40, 0x78, 0x69, 0x73, 0x74, 0x0d, 0x00, 0x00, 0x87, 0x00,
1180x73, 0xbd, 0x00, 0x21, 0x69, 0x6e, 0xf2, 0x03, 0x06, 0x53, 1180x11, 0x73, 0xbd, 0x00, 0x22, 0x69, 0x6e, 0xf2, 0x03, 0x05,
1190x00, 0x73, 0x29, 0x2e, 0x00, 0x52, 0x69, 0x67, 0x68, 0x86, 1190x53, 0x00, 0x73, 0x29, 0x2e, 0x00, 0x52, 0x69, 0x67, 0x68,
1200x00, 0x35, 0x69, 0x6e, 0x67, 0x89, 0x00, 0x10, 0x67, 0x0d, 1200x86, 0x00, 0x02, 0x3a, 0x00, 0x02, 0x89, 0x00, 0x10, 0x67,
1210x00, 0x40, 0x77, 0x69, 0x6c, 0x6c, 0x83, 0x04, 0x20, 0x6f, 1210x0d, 0x00, 0x40, 0x77, 0x69, 0x6c, 0x6c, 0x83, 0x04, 0x21,
1220x77, 0xf7, 0x01, 0x00, 0x9c, 0x00, 0x40, 0x65, 0x72, 0x61, 1220x6f, 0x77, 0x2e, 0x02, 0x72, 0x74, 0x6f, 0x00, 0x65, 0x72,
1230x73, 0x67, 0x04, 0x02, 0x22, 0x04, 0x32, 0x65, 0x6e, 0x74, 1230x61, 0x73, 0x67, 0x04, 0x00, 0x2d, 0x01, 0x32, 0x65, 0x6e,
1240xd1, 0x02, 0x06, 0x52, 0x00, 0x01, 0x68, 0x00, 0x90, 0x6f, 1240x74, 0xd1, 0x02, 0x07, 0xa5, 0x00, 0x00, 0x68, 0x00, 0x91,
1250x75, 0x74, 0x00, 0x61, 0x66, 0x66, 0x65, 0x63, 0x80, 0x00, 1250x6f, 0x75, 0x74, 0x00, 0x61, 0x66, 0x66, 0x65, 0x63, 0x80,
1260x00, 0xe1, 0x03, 0x01, 0x84, 0x00, 0x01, 0x23, 0x01, 0xf2, 1260x00, 0x00, 0xe1, 0x03, 0x01, 0x84, 0x00, 0x00, 0x23, 0x01,
1270x01, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 1270xf4, 0x01, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74,
1280x76, 0x65, 0x6c, 0x79, 0x2c, 0x00, 0x75, 0x4e, 0x00, 0x07, 1280x69, 0x76, 0x65, 0x6c, 0x79, 0x2c, 0x00, 0x75, 0x4e, 0x00,
1290x49, 0x01, 0x01, 0xe0, 0x03, 0x42, 0x6d, 0x6f, 0x76, 0x65, 1290x06, 0x49, 0x01, 0x00, 0x67, 0x00, 0x42, 0x6d, 0x6f, 0x76,
1300xaf, 0x02, 0x31, 0x6f, 0x73, 0x69, 0xa4, 0x03, 0x30, 0x69, 1300x65, 0xaf, 0x02, 0x31, 0x6f, 0x73, 0x69, 0xa4, 0x03, 0x30,
1310x6e, 0x64, 0x6b, 0x02, 0x91, 0x6f, 0x72, 0x00, 0x61, 0x72, 1310x69, 0x6e, 0x64, 0x6b, 0x02, 0x91, 0x6f, 0x72, 0x00, 0x61,
1320x6f, 0x75, 0x6e, 0x64, 0x1e, 0x00, 0xc0, 0x62, 0x6f, 0x61, 1320x72, 0x6f, 0x75, 0x6e, 0x64, 0x1e, 0x00, 0xc0, 0x62, 0x6f,
1330x72, 0x64, 0x2e, 0x00, 0x50, 0x72, 0x65, 0x73, 0x73, 0x6a, 1330x61, 0x72, 0x64, 0x2e, 0x00, 0x50, 0x72, 0x65, 0x73, 0x73,
1340x00, 0x20, 0x74, 0x68, 0x2f, 0x01, 0x40, 0x74, 0x75, 0x72, 1340x6a, 0x00, 0x20, 0x74, 0x68, 0x2f, 0x01, 0x40, 0x74, 0x75,
1350x6e, 0x4a, 0x00, 0x00, 0x0f, 0x00, 0x12, 0x6e, 0xbf, 0x00, 1350x72, 0x6e, 0x4a, 0x00, 0x00, 0x0f, 0x00, 0x12, 0x6e, 0xbf,
1360x13, 0x73, 0xc0, 0x00, 0x0f, 0x70, 0x00, 0x04, 0x01, 0xf2, 1360x00, 0x14, 0x73, 0xc0, 0x00, 0x0f, 0x70, 0x00, 0x04, 0x01,
1370x00, 0x09, 0xc6, 0x00, 0x00, 0xc2, 0x00, 0x41, 0x66, 0x72, 1370x7b, 0x01, 0x08, 0xc6, 0x00, 0x00, 0xc2, 0x00, 0x42, 0x66,
1380x6f, 0x6d, 0x30, 0x01, 0x05, 0x86, 0x00, 0x02, 0xf2, 0x04, 1380x72, 0x6f, 0x6d, 0x30, 0x01, 0x04, 0x86, 0x00, 0x02, 0xf2,
1390x1f, 0x70, 0x6f, 0x00, 0x04, 0x80, 0x61, 0x67, 0x61, 0x69, 1390x04, 0x1f, 0x70, 0x6f, 0x00, 0x04, 0x80, 0x61, 0x67, 0x61,
1400x6e, 0x00, 0x63, 0x6f, 0x21, 0x04, 0x20, 0x74, 0x65, 0xb4, 1400x69, 0x6e, 0x00, 0x63, 0x6f, 0x21, 0x04, 0x21, 0x74, 0x65,
1410x03, 0x07, 0xbd, 0x01, 0x35, 0x2e, 0x00, 0x55, 0x34, 0x00, 1410xb4, 0x03, 0x06, 0x52, 0x00, 0x35, 0x2e, 0x00, 0x55, 0x34,
1420x20, 0x73, 0x70, 0x65, 0x04, 0xa0, 0x62, 0x61, 0x72, 0x00, 1420x00, 0x20, 0x73, 0x70, 0x65, 0x04, 0xa1, 0x62, 0x61, 0x72,
1430x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x19, 0x06, 0x0b, 0x4d, 1430x00, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x19, 0x06, 0x0c,
1440x00, 0x03, 0xb7, 0x00, 0x0f, 0x77, 0x01, 0x32, 0x10, 0x2c, 1440x4d, 0x00, 0x09, 0xb7, 0x00, 0x0f, 0x77, 0x01, 0x2a, 0x10,
1450x22, 0x04, 0x57, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2b, 0x01, 1450x2c, 0x22, 0x04, 0x57, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2b,
1460xf1, 0x01, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x00, 0x63, 1460x01, 0xf1, 0x01, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x00,
1470x61, 0x6e, 0x63, 0x65, 0x6c, 0x73, 0x00, 0x61, 0x03, 0x01, 1470x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x73, 0x00, 0x61, 0x03,
1480x00, 0xa1, 0x01, 0x4a, 0x57, 0x68, 0x65, 0x6e, 0x0b, 0x01, 1480x01, 0x00, 0xa1, 0x01, 0x11, 0x57, 0x35, 0x01, 0x08, 0x0b,
1490x13, 0x66, 0x79, 0x00, 0x10, 0x72, 0x14, 0x00, 0x02, 0xb9, 1490x01, 0x13, 0x66, 0x79, 0x00, 0x10, 0x72, 0x14, 0x00, 0x02,
1500x04, 0x25, 0x69, 0x73, 0xe8, 0x00, 0x52, 0x64, 0x2c, 0x00, 1500xb9, 0x04, 0x25, 0x69, 0x73, 0xe8, 0x00, 0x20, 0x64, 0x2c,
1510x69, 0x74, 0x2a, 0x02, 0x90, 0x62, 0x65, 0x00, 0x73, 0x68, 1510xd9, 0x02, 0x01, 0x2a, 0x02, 0x90, 0x62, 0x65, 0x00, 0x73,
1520x61, 0x64, 0x65, 0x64, 0x48, 0x00, 0x42, 0x28, 0x41, 0x6c, 1520x68, 0x61, 0x64, 0x65, 0x64, 0x48, 0x00, 0x42, 0x28, 0x41,
1530x6c, 0x19, 0x06, 0x10, 0x63, 0x3b, 0x01, 0x10, 0x73, 0xcd, 1530x6c, 0x6c, 0x19, 0x06, 0x10, 0x63, 0x3b, 0x01, 0x10, 0x73,
1540x04, 0x61, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0xe6, 0x06, 1540xcd, 0x04, 0x61, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0xe6,
1550x21, 0x65, 0x63, 0xd7, 0x01, 0x63, 0x32, 0x2e, 0x31, 0x00, 1550x06, 0x21, 0x65, 0x63, 0xd7, 0x01, 0x30, 0x32, 0x2e, 0x31,
1560x61, 0x72, 0xa3, 0x05, 0xb1, 0x61, 0x76, 0x61, 0x69, 0x6c, 1560x3a, 0x06, 0x02, 0xa3, 0x05, 0xb1, 0x61, 0x76, 0x61, 0x69,
1570x61, 0x62, 0x6c, 0x65, 0x2e, 0x29, 0x9d, 0x03, 0x18, 0x32, 1570x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x29, 0x9d, 0x03, 0x18,
1580x9d, 0x03, 0x93, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 1580x32, 0x9d, 0x03, 0x93, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65,
1590x65, 0x72, 0x9f, 0x03, 0x00, 0xfa, 0x05, 0x06, 0x14, 0x00, 1590x74, 0x65, 0x72, 0x9f, 0x03, 0x01, 0xfa, 0x05, 0x05, 0x14,
1600x00, 0x45, 0x00, 0x06, 0x40, 0x00, 0x04, 0xbb, 0x01, 0xf0, 1600x00, 0x02, 0x45, 0x00, 0x04, 0x40, 0x00, 0x04, 0xbb, 0x01,
1610x01, 0x65, 0x00, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 1610xf1, 0x01, 0x65, 0x00, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f,
1620x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x73, 0x00, 0x04, 1620x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x73, 0x00,
1630x3c, 0x03, 0xb1, 0x60, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 1630x03, 0x3c, 0x03, 0xb1, 0x60, 0x54, 0x79, 0x70, 0x65, 0x27,
1640x6d, 0x65, 0x6e, 0x75, 0xf7, 0x00, 0x80, 0x69, 0x64, 0x74, 1640x00, 0x6d, 0x65, 0x6e, 0x75, 0xf7, 0x00, 0x80, 0x69, 0x64,
1650x68, 0x2c, 0x00, 0x48, 0x65, 0x0f, 0x03, 0x60, 0x00, 0x00, 1650x74, 0x68, 0x2c, 0x00, 0x48, 0x65, 0x0f, 0x03, 0x61, 0x00,
1660x00, 0x53, 0x69, 0x7a, 0xfb, 0x00, 0x00, 0x63, 0x03, 0x00, 1660x00, 0x00, 0x53, 0x69, 0x7a, 0xfb, 0x00, 0x00, 0x63, 0x03,
1670xe2, 0x00, 0x16, 0x6e, 0x7e, 0x07, 0x70, 0x00, 0x00, 0x45, 1670x11, 0x2c, 0xb2, 0x00, 0x04, 0x7e, 0x07, 0x70, 0x00, 0x00,
1680x78, 0x70, 0x61, 0x6e, 0xf2, 0x05, 0x74, 0x20, 0x66, 0x61, 1680x45, 0x78, 0x70, 0x61, 0x6e, 0xf2, 0x05, 0x40, 0x20, 0x66,
1690x63, 0x74, 0x6f, 0x72, 0x2f, 0x04, 0x10, 0x69, 0x48, 0x01, 1690x61, 0x63, 0x93, 0x02, 0x03, 0x2f, 0x04, 0x10, 0x69, 0x48,
1700x91, 0x6d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 1700x01, 0x91, 0x6d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73,
1710xbb, 0x06, 0x00, 0x0c, 0x00, 0x14, 0x67, 0xf8, 0x01, 0x35, 1710x6d, 0xbb, 0x06, 0x00, 0x0c, 0x00, 0x14, 0x67, 0xf8, 0x01,
1720x74, 0x79, 0x70, 0x54, 0x00, 0x15, 0x73, 0x20, 0x06, 0x42, 1720x35, 0x74, 0x79, 0x70, 0x54, 0x00, 0x15, 0x73, 0x20, 0x06,
1730x64, 0x00, 0x62, 0x79, 0xec, 0x02, 0x90, 0x72, 0x6f, 0x67, 1730x42, 0x64, 0x00, 0x62, 0x79, 0xec, 0x02, 0x90, 0x72, 0x6f,
1740x72, 0x61, 0x6d, 0x2e, 0x00, 0x53, 0x03, 0x08, 0x60, 0x70, 1740x67, 0x72, 0x61, 0x6d, 0x2e, 0x00, 0x53, 0x03, 0x08, 0x60,
1750x65, 0x6f, 0x70, 0x6c, 0x65, 0x6d, 0x02, 0x33, 0x66, 0x65, 1750x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x6d, 0x02, 0x34, 0x66,
1760x72, 0x41, 0x08, 0x04, 0x97, 0x07, 0x01, 0xa9, 0x03, 0x96, 1760x65, 0x72, 0x41, 0x08, 0x03, 0x97, 0x07, 0x01, 0xa9, 0x03,
1770x00, 0x66, 0x65, 0x77, 0x00, 0x6c, 0x61, 0x72, 0x67, 0x66, 1770x97, 0x00, 0x66, 0x65, 0x77, 0x00, 0x6c, 0x61, 0x72, 0x67,
1780x02, 0x01, 0x1d, 0x07, 0x00, 0x0e, 0x04, 0x08, 0x29, 0x00, 1780x66, 0x02, 0x01, 0xcd, 0x02, 0x00, 0x0e, 0x04, 0x07, 0x29,
1790x11, 0x6d, 0x6f, 0x06, 0x70, 0x6d, 0x61, 0x6c, 0x6c, 0x00, 1790x00, 0x11, 0x6d, 0x6f, 0x06, 0x40, 0x6d, 0x61, 0x6c, 0x6c,
1800x6f, 0x6e, 0xc1, 0x00, 0x11, 0x53, 0xc5, 0x05, 0x00, 0xfb, 1800x1a, 0x00, 0x10, 0x73, 0x5f, 0x00, 0x01, 0x57, 0x02, 0x40,
1810x01, 0x10, 0x00, 0x44, 0x08, 0x19, 0x52, 0x3d, 0x00, 0x30, 1810x63, 0x61, 0x6e, 0x00, 0x44, 0x08, 0x19, 0x52, 0x3d, 0x00,
1820x65, 0x73, 0x73, 0x78, 0x04, 0x09, 0xc2, 0x06, 0x22, 0x00, 1820x30, 0x65, 0x73, 0x73, 0x78, 0x04, 0x09, 0xc2, 0x06, 0x22,
1830x61, 0x40, 0x00, 0x21, 0x65, 0x72, 0x86, 0x00, 0x00, 0x14, 1830x00, 0x61, 0x40, 0x00, 0x22, 0x65, 0x72, 0x86, 0x00, 0x32,
1840x03, 0x01, 0x44, 0x01, 0x05, 0xc5, 0x06, 0x04, 0x0c, 0x06, 1840x74, 0x68, 0x61, 0x44, 0x01, 0x05, 0xc5, 0x06, 0x03, 0x0c,
1850x21, 0x65, 0x64, 0x22, 0x03, 0x01, 0x79, 0x03, 0x01, 0x4d, 1850x06, 0x22, 0x65, 0x64, 0x22, 0x03, 0x01, 0x79, 0x03, 0x00,
1860x00, 0x20, 0x78, 0x70, 0x0f, 0x00, 0x20, 0x69, 0x74, 0xe3, 1860x4d, 0x00, 0x00, 0x29, 0x01, 0x10, 0x64, 0x20, 0x02, 0x60,
1870x00, 0x30, 0x61, 0x64, 0x64, 0x8f, 0x00, 0x10, 0x72, 0xd7, 1870x62, 0x79, 0x00, 0x61, 0x64, 0x64, 0x8f, 0x00, 0x10, 0x72,
1880x02, 0x20, 0x61, 0x6e, 0xcc, 0x00, 0x61, 0x6c, 0x75, 0x6d, 1880xd7, 0x02, 0x20, 0x61, 0x6e, 0xcc, 0x00, 0x41, 0x6c, 0x75,
1890x6e, 0x73, 0x2e, 0x3e, 0x01, 0x00, 0xec, 0x06, 0x52, 0x66, 1890x6d, 0x6e, 0x51, 0x01, 0x00, 0xfe, 0x06, 0x72, 0x64, 0x65,
1900x61, 0x75, 0x6c, 0x74, 0x34, 0x00, 0x01, 0x4f, 0x07, 0x02, 1900x66, 0x61, 0x75, 0x6c, 0x74, 0x34, 0x00, 0x01, 0x4f, 0x07,
1910x5d, 0x01, 0x00, 0x31, 0x01, 0xa1, 0x7a, 0x65, 0x72, 0x6f, 1910x03, 0x5d, 0x01, 0xd2, 0x6f, 0x66, 0x00, 0x7a, 0x65, 0x72,
1920x00, 0x6d, 0x65, 0x61, 0x6e, 0x73, 0x90, 0x03, 0x07, 0xb3, 1920x6f, 0x00, 0x6d, 0x65, 0x61, 0x6e, 0x73, 0x90, 0x03, 0x07,
1930x00, 0x02, 0x79, 0x02, 0x46, 0x73, 0x69, 0x6d, 0x70, 0xb0, 1930xb3, 0x00, 0x01, 0x79, 0x02, 0x10, 0x73, 0x95, 0x07, 0x09,
1940x00, 0x07, 0x6f, 0x09, 0x09, 0xa6, 0x00, 0x00, 0xee, 0x00, 1940xb0, 0x00, 0x04, 0x6f, 0x09, 0x09, 0xa6, 0x00, 0x00, 0xee,
1950x00, 0x95, 0x01, 0x12, 0x2c, 0xe5, 0x04, 0x10, 0x6f, 0x4b, 1950x00, 0x42, 0x66, 0x6f, 0x72, 0x2c, 0xe5, 0x04, 0x10, 0x6f,
1960x07, 0x10, 0x68, 0x93, 0x00, 0x30, 0x66, 0x75, 0x72, 0x60, 1960x4b, 0x07, 0x10, 0x68, 0x93, 0x00, 0x30, 0x66, 0x75, 0x72,
1970x07, 0x42, 0x2e, 0x00, 0x49, 0x66, 0xce, 0x00, 0x01, 0x16, 1970x60, 0x07, 0x42, 0x2e, 0x00, 0x49, 0x66, 0xce, 0x00, 0x02,
1980x07, 0x0f, 0x8a, 0x00, 0x02, 0x90, 0x28, 0x73, 0x61, 0x79, 1980x16, 0x07, 0x0f, 0x8a, 0x00, 0x01, 0x91, 0x28, 0x73, 0x61,
1990x29, 0x00, 0x30, 0x2e, 0x35, 0xf6, 0x02, 0x07, 0x93, 0x00, 1990x79, 0x29, 0x00, 0x30, 0x2e, 0x35, 0xf6, 0x02, 0x07, 0x93,
2000x02, 0xf7, 0x08, 0x42, 0x64, 0x69, 0x6d, 0x65, 0x32, 0x00, 2000x00, 0x01, 0xf7, 0x08, 0x42, 0x64, 0x69, 0x6d, 0x65, 0x32,
2010x25, 0x6f, 0x66, 0xa1, 0x05, 0x04, 0x1c, 0x03, 0x03, 0x0e, 2010x00, 0x26, 0x6f, 0x66, 0xa1, 0x05, 0x04, 0x1c, 0x03, 0x02,
2020x01, 0x02, 0x46, 0x07, 0x42, 0x68, 0x61, 0x6c, 0x66, 0x31, 2020x0e, 0x01, 0x02, 0x46, 0x07, 0x43, 0x68, 0x61, 0x6c, 0x66,
2030x04, 0x00, 0x9d, 0x03, 0x40, 0x62, 0x69, 0x67, 0x00, 0xbc, 2030x31, 0x04, 0x70, 0x61, 0x73, 0x00, 0x62, 0x69, 0x67, 0x00,
2040x07, 0x12, 0x72, 0xc3, 0x00, 0x03, 0x52, 0x07, 0x60, 0x49, 2040xbc, 0x07, 0x14, 0x72, 0xc3, 0x00, 0x01, 0x52, 0x07, 0x60,
2050x6e, 0x00, 0x6f, 0x74, 0x68, 0x2d, 0x09, 0x51, 0x6f, 0x72, 2050x49, 0x6e, 0x00, 0x6f, 0x74, 0x68, 0x2d, 0x09, 0x51, 0x6f,
2060x64, 0x73, 0x2c, 0x51, 0x00, 0x30, 0x69, 0x6e, 0x69, 0x9d, 2060x72, 0x64, 0x73, 0x2c, 0x51, 0x00, 0x30, 0x69, 0x6e, 0x69,
2070x01, 0x0a, 0x59, 0x00, 0x36, 0x32, 0x2f, 0x33, 0xe9, 0x00, 2070x9d, 0x01, 0x0a, 0x59, 0x00, 0x36, 0x32, 0x2f, 0x33, 0xe9,
2080x28, 0x69, 0x6e, 0x8c, 0x00, 0x03, 0xb5, 0x04, 0x0f, 0x85, 2080x00, 0x2b, 0x69, 0x6e, 0x8c, 0x00, 0x02, 0xef, 0x00, 0x0f,
2090x00, 0x02, 0x01, 0x22, 0x04, 0x21, 0x66, 0x75, 0x40, 0x01, 2090x85, 0x00, 0x01, 0x00, 0x22, 0x04, 0x21, 0x66, 0x75, 0x40,
2100x17, 0x7a, 0x42, 0x04, 0x24, 0x64, 0x64, 0x43, 0x06, 0x27, 2100x01, 0x17, 0x7a, 0x42, 0x04, 0x24, 0x64, 0x64, 0x43, 0x06,
2110x6d, 0x6f, 0x80, 0x06, 0x02, 0xfc, 0x02, 0x30, 0x53, 0x65, 2110x28, 0x6d, 0x6f, 0x80, 0x06, 0x01, 0xab, 0x01, 0x31, 0x53,
2120x74, 0x5e, 0x04, 0x0f, 0x20, 0x01, 0x04, 0x03, 0x9d, 0x05, 2120x65, 0x74, 0x5e, 0x04, 0x0f, 0x20, 0x01, 0x04, 0x03, 0x9d,
2130x00, 0x21, 0x01, 0x52, 0x00, 0x74, 0x65, 0x6e, 0x64, 0xcd, 2130x05, 0x82, 0x30, 0x2e, 0x35, 0x00, 0x74, 0x65, 0x6e, 0x64,
2140x05, 0x21, 0x61, 0x6b, 0xbc, 0x04, 0x01, 0x4f, 0x07, 0x02, 2140xcd, 0x05, 0x23, 0x61, 0x6b, 0x9a, 0x0a, 0x00, 0x4f, 0x07,
2150x54, 0x00, 0x91, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 2150x01, 0x54, 0x00, 0x92, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63,
2160x6c, 0x74, 0x9d, 0x00, 0x02, 0xfe, 0x03, 0x60, 0x28, 0x69, 2160x75, 0x6c, 0x74, 0x9d, 0x00, 0x01, 0xfe, 0x03, 0x50, 0x28,
2170x6e, 0x00, 0x6d, 0x79, 0x56, 0x00, 0xa0, 0x65, 0x72, 0x69, 2170x69, 0x6e, 0x00, 0x6d, 0xb7, 0x06, 0xb0, 0x70, 0x65, 0x72,
2180x65, 0x6e, 0x63, 0x65, 0x29, 0x00, 0x72, 0x1d, 0x08, 0x10, 2180x69, 0x65, 0x6e, 0x63, 0x65, 0x29, 0x00, 0x72, 0x1d, 0x08,
2190x64, 0x56, 0x03, 0x30, 0x6c, 0x65, 0x73, 0x42, 0x04, 0x30, 2190x10, 0x64, 0x56, 0x03, 0x30, 0x6c, 0x65, 0x73, 0x42, 0x04,
2200x64, 0x75, 0x63, 0x3a, 0x06, 0x00, 0x35, 0x00, 0x01, 0x49, 2200x30, 0x64, 0x75, 0x63, 0x3a, 0x06, 0x01, 0x35, 0x00, 0x01,
2210x00, 0x00, 0xe8, 0x0a, 0x20, 0x75, 0x69, 0x13, 0x00, 0x01, 2210x49, 0x00, 0x51, 0x69, 0x6e, 0x74, 0x75, 0x69, 0x13, 0x00,
2220xa4, 0x07, 0x00, 0x99, 0x00, 0x58, 0x73, 0x74, 0x79, 0x6c, 2220x00, 0xa4, 0x07, 0x00, 0x99, 0x00, 0x59, 0x73, 0x74, 0x79,
2230x65, 0xcb, 0x01, 0x00, 0xa9, 0x01, 0xa0, 0x74, 0x6f, 0x6f, 2230x6c, 0x65, 0xcb, 0x01, 0xd0, 0x69, 0x74, 0x00, 0x74, 0x6f,
2240x00, 0x68, 0x69, 0x67, 0x68, 0x2c, 0x00, 0xe4, 0x00, 0x35, 2240x6f, 0x00, 0x68, 0x69, 0x67, 0x68, 0x2c, 0x00, 0xe4, 0x00,
2250x67, 0x68, 0x2c, 0x90, 0x00, 0x03, 0x3c, 0x02, 0x00, 0x0e, 2250x02, 0x08, 0x00, 0x03, 0x90, 0x00, 0x03, 0x3c, 0x02, 0x30,
2260x03, 0x34, 0x6e, 0x6f, 0x74, 0x80, 0x01, 0x02, 0xa7, 0x00, 2260x63, 0x61, 0x6e, 0x5a, 0x09, 0x05, 0x43, 0x02, 0x01, 0x5e,
2270x01, 0xe9, 0x02, 0x02, 0x69, 0x03, 0x0b, 0x63, 0x03, 0x50, 2270x00, 0x01, 0xe9, 0x02, 0x02, 0x69, 0x03, 0x0a, 0x63, 0x03,
2280x63, 0x6f, 0x76, 0x65, 0x72, 0x44, 0x00, 0x02, 0xa5, 0x07, 2280x51, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x44, 0x00, 0x03, 0xa5,
2290x01, 0xe9, 0x01, 0x02, 0xfc, 0x02, 0x06, 0x59, 0x00, 0x50, 2290x07, 0x02, 0x27, 0x04, 0x03, 0xfc, 0x02, 0x02, 0x59, 0x00,
2300x62, 0x65, 0x63, 0x6f, 0x6d, 0x2f, 0x00, 0x61, 0x72, 0x69, 2300x50, 0x62, 0x65, 0x63, 0x6f, 0x6d, 0x2f, 0x00, 0x61, 0x72,
2310x76, 0x69, 0x61, 0x6c, 0x39, 0x04, 0xf1, 0x02, 0x6e, 0x73, 2310x69, 0x76, 0x69, 0x61, 0x6c, 0x39, 0x04, 0xf1, 0x02, 0x6e,
2320x75, 0x72, 0x65, 0x20, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 2320x73, 0x75, 0x72, 0x65, 0x20, 0x75, 0x6e, 0x69, 0x71, 0x75,
2330x20, 0x73, 0x6f, 0x6c, 0x75, 0x92, 0x04, 0x60, 0x00, 0x00, 2330x65, 0x20, 0x73, 0x6f, 0x6c, 0x75, 0x92, 0x04, 0x60, 0x00,
2340x4e, 0x6f, 0x72, 0x6d, 0x73, 0x03, 0x1c, 0x2c, 0xdb, 0x02, 2340x00, 0x4e, 0x6f, 0x72, 0x6d, 0x73, 0x03, 0x1d, 0x2c, 0xdb,
2350x02, 0x3d, 0x01, 0x00, 0x36, 0x00, 0x01, 0x67, 0x02, 0x00, 2350x02, 0x01, 0x3d, 0x01, 0x00, 0x36, 0x00, 0x02, 0x67, 0x02,
2360x5e, 0x00, 0x05, 0x96, 0x09, 0x21, 0x69, 0x74, 0x8b, 0x06, 2360x01, 0x28, 0x04, 0x03, 0x96, 0x09, 0x21, 0x69, 0x74, 0x8b,
2370x00, 0x0e, 0x06, 0x02, 0x66, 0x0c, 0x23, 0x6f, 0x6e, 0xa9, 2370x06, 0x01, 0x0e, 0x06, 0x01, 0x66, 0x0c, 0x23, 0x6f, 0x6e,
2380x0b, 0x04, 0x5a, 0x00, 0x13, 0x2e, 0xbe, 0x0a, 0x12, 0x73, 2380xa9, 0x0b, 0x04, 0x5a, 0x00, 0x13, 0x2e, 0xbe, 0x0a, 0x12,
2390xbb, 0x08, 0x61, 0x61, 0x6d, 0x62, 0x69, 0x67, 0x75, 0x04, 2390x73, 0xbb, 0x08, 0x61, 0x61, 0x6d, 0x62, 0x69, 0x67, 0x75,
2400x0c, 0x12, 0x65, 0x95, 0x05, 0x01, 0x05, 0x04, 0x1c, 0x62, 2400x04, 0x0c, 0x13, 0x65, 0x95, 0x05, 0x00, 0x05, 0x04, 0x1c,
2410x95, 0x01, 0x05, 0x5f, 0x01, 0x00, 0x5a, 0x0c, 0xa5, 0x74, 2410x62, 0x95, 0x01, 0x06, 0x5f, 0x01, 0xd5, 0x73, 0x75, 0x62,
2420x6c, 0x65, 0x2c, 0x00, 0x73, 0x6f, 0x00, 0x69, 0x66, 0xaf, 2420x74, 0x6c, 0x65, 0x2c, 0x00, 0x73, 0x6f, 0x00, 0x69, 0x66,
2430x0a, 0x05, 0x3f, 0x04, 0x00, 0xae, 0x06, 0x00, 0xce, 0x08, 2430xaf, 0x0a, 0x05, 0x3f, 0x04, 0x01, 0xae, 0x06, 0x32, 0x6f,
2440x02, 0xa2, 0x0b, 0x62, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 2440x66, 0x66, 0xa2, 0x0b, 0x62, 0x66, 0x65, 0x61, 0x74, 0x75,
2450x9d, 0x01, 0x70, 0x72, 0x69, 0x73, 0x6b, 0x00, 0x68, 0x61, 2450x72, 0x9d, 0x01, 0x40, 0x72, 0x69, 0x73, 0x6b, 0x95, 0x00,
2460x8d, 0x08, 0x06, 0x77, 0x00, 0x04, 0xba, 0x00, 0xb2, 0x2e, 2460x01, 0x2b, 0x02, 0x05, 0x77, 0x00, 0x03, 0xba, 0x00, 0xb2,
2470x00, 0x41, 0x6c, 0x73, 0x6f, 0x2c, 0x00, 0x66, 0x69, 0x6e, 2470x2e, 0x00, 0x41, 0x6c, 0x73, 0x6f, 0x2c, 0x00, 0x66, 0x69,
2480x6b, 0x02, 0x24, 0x6c, 0x6c, 0xed, 0x07, 0x42, 0x73, 0x69, 2480x6e, 0x6b, 0x02, 0x24, 0x6c, 0x6c, 0xed, 0x07, 0x12, 0x73,
2490x62, 0x6c, 0xc0, 0x00, 0x09, 0xa0, 0x00, 0x20, 0x61, 0x6e, 2490x82, 0x0a, 0x03, 0xc0, 0x00, 0x05, 0xa0, 0x00, 0x21, 0x61,
2500x97, 0x02, 0x01, 0x84, 0x07, 0x50, 0x61, 0x6c, 0x00, 0x63, 2500x6e, 0x97, 0x02, 0x00, 0x14, 0x00, 0x20, 0x61, 0x6c, 0x55,
2510x68, 0x8d, 0x04, 0x30, 0x6e, 0x67, 0x65, 0xce, 0x03, 0x02, 2510x05, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x63, 0x05,
2520x1c, 0x00, 0x10, 0x76, 0xc8, 0x06, 0x11, 0x64, 0x05, 0x02, 2520x01, 0x1c, 0x00, 0x10, 0x76, 0xc8, 0x06, 0x12, 0x64, 0xa9,
2530x00, 0xc9, 0x03, 0x30, 0x54, 0x75, 0x72, 0xfc, 0x04, 0x05, 2530x09, 0x61, 0x72, 0x2e, 0x00, 0x54, 0x75, 0x72, 0xfc, 0x04,
2540x9c, 0x00, 0x03, 0xfc, 0x05, 0x00, 0x4f, 0x00, 0x03, 0x0e, 2540x05, 0x9c, 0x00, 0x03, 0xfc, 0x05, 0x01, 0xf4, 0x04, 0x01,
2550x0c, 0x73, 0x70, 0x65, 0x65, 0x64, 0x00, 0x75, 0x70, 0x93, 2550x0e, 0x0c, 0x74, 0x70, 0x65, 0x65, 0x64, 0x00, 0x75, 0x70,
2560x00, 0x04, 0xf8, 0x01, 0x50, 0x69, 0x6f, 0x6e, 0x2e, 0x00, 2560x6a, 0x0b, 0x03, 0xf8, 0x01, 0x50, 0x69, 0x6f, 0x6e, 0x2e,
2570x00,
257}; 258};
258 259
259const unsigned short help_text_len = 3535; 260const unsigned short help_text_len = 3535;
diff --git a/apps/plugins/puzzles/help/samegame.c b/apps/plugins/puzzles/help/samegame.c
index 067dea0cec..2f8e8a3003 100644
--- a/apps/plugins/puzzles/help/samegame.c
+++ b/apps/plugins/puzzles/help/samegame.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -17,7 +17,7 @@ struct style_text help_text_style[] = {
17 LAST_STYLE_ITEM 17 LAST_STYLE_ITEM
18}; 18};
19 19
20/* orig 2470 comp 1632 ratio 0.660729 level 11 saved 838 */ 20/* orig 2470 comp 1634 ratio 0.661538 level 10 saved 836 */
21const char help_text[] = { 21const char help_text[] = {
220xf0, 0x03, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 220xf0, 0x03, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
230x31, 0x33, 0x3a, 0x20, 0x53, 0x61, 0x6d, 0x65, 0x20, 0x47, 230x31, 0x33, 0x3a, 0x20, 0x53, 0x61, 0x6d, 0x65, 0x20, 0x47,
@@ -32,16 +32,16 @@ const char help_text[] = {
320x63, 0x6f, 0x6e, 0x74, 0x69, 0x67, 0x75, 0x6f, 0x75, 0x73, 320x63, 0x6f, 0x6e, 0x74, 0x69, 0x67, 0x75, 0x6f, 0x75, 0x73,
330x00, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x50, 0x00, 330x00, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x50, 0x00,
340xdc, 0x6d, 0x6f, 0x72, 0x65, 0x00, 0x74, 0x68, 0x61, 0x6e, 340xdc, 0x6d, 0x6f, 0x72, 0x65, 0x00, 0x74, 0x68, 0x61, 0x6e,
350x00, 0x6f, 0x6e, 0x65, 0x5e, 0x00, 0xc0, 0x3b, 0x00, 0x74, 350x00, 0x6f, 0x6e, 0x65, 0x5e, 0x00, 0xc1, 0x3b, 0x00, 0x74,
360x68, 0x65, 0x00, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x72, 0x0b, 360x68, 0x65, 0x00, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x72, 0x0b,
370x00, 0x03, 0x39, 0x00, 0x00, 0x6d, 0x00, 0x06, 0x5c, 0x00, 370x00, 0x02, 0x39, 0x00, 0x02, 0x6d, 0x00, 0x04, 0x5c, 0x00,
380x10, 0x2c, 0x1a, 0x00, 0x02, 0x48, 0x00, 0x61, 0x70, 0x6f, 380x11, 0x2c, 0x1a, 0x00, 0x01, 0x48, 0x00, 0x61, 0x70, 0x6f,
390x69, 0x6e, 0x74, 0x73, 0x1f, 0x00, 0x81, 0x67, 0x65, 0x74, 390x69, 0x6e, 0x74, 0x73, 0x1f, 0x00, 0x81, 0x67, 0x65, 0x74,
400x00, 0x28, 0x61, 0x6e, 0x64, 0x1d, 0x00, 0x60, 0x66, 0x61, 400x00, 0x28, 0x61, 0x6e, 0x64, 0x1d, 0x00, 0x61, 0x66, 0x61,
410x73, 0x74, 0x65, 0x72, 0x18, 0x00, 0x01, 0x9c, 0x00, 0x02, 410x73, 0x74, 0x65, 0x72, 0x18, 0x00, 0x02, 0x9c, 0x00, 0x00,
420x4c, 0x00, 0xca, 0x61, 0x72, 0x65, 0x6e, 0x61, 0x29, 0x2e, 420x15, 0x00, 0xcb, 0x61, 0x72, 0x65, 0x6e, 0x61, 0x29, 0x2e,
430x00, 0x00, 0x00, 0x49, 0x66, 0x1b, 0x00, 0x01, 0xed, 0x00, 430x00, 0x00, 0x00, 0x49, 0x66, 0x1b, 0x00, 0x01, 0xed, 0x00,
440x01, 0x13, 0x00, 0x44, 0x77, 0x69, 0x6e, 0x2e, 0x1f, 0x00, 440x00, 0x13, 0x00, 0x44, 0x77, 0x69, 0x6e, 0x2e, 0x1f, 0x00,
450xf0, 0x01, 0x65, 0x6e, 0x64, 0x00, 0x75, 0x70, 0x00, 0x77, 450xf0, 0x01, 0x65, 0x6e, 0x64, 0x00, 0x75, 0x70, 0x00, 0x77,
460x69, 0x74, 0x68, 0x00, 0x6e, 0x6f, 0x74, 0x68, 0xd4, 0x00, 460x69, 0x74, 0x68, 0x00, 0x6e, 0x6f, 0x74, 0x68, 0xd4, 0x00,
470xa4, 0x62, 0x75, 0x74, 0x00, 0x73, 0x69, 0x6e, 0x67, 0x6c, 470xa4, 0x62, 0x75, 0x74, 0x00, 0x73, 0x69, 0x6e, 0x67, 0x6c,
@@ -52,8 +52,8 @@ const char help_text[] = {
520x5c, 0x00, 0x40, 0x6c, 0x6f, 0x73, 0x65, 0x8a, 0x00, 0x50, 520x5c, 0x00, 0x40, 0x6c, 0x6f, 0x73, 0x65, 0x8a, 0x00, 0x50,
530x52, 0x65, 0x6d, 0x6f, 0x76, 0x59, 0x00, 0x14, 0x61, 0xeb, 530x52, 0x65, 0x6d, 0x6f, 0x76, 0x59, 0x00, 0x14, 0x61, 0xeb,
540x00, 0x63, 0x63, 0x61, 0x75, 0x73, 0x65, 0x73, 0xfd, 0x00, 540x00, 0x63, 0x63, 0x61, 0x75, 0x73, 0x65, 0x73, 0xfd, 0x00,
550x55, 0x73, 0x74, 0x00, 0x6f, 0x66, 0xa2, 0x00, 0x00, 0x6b, 550x20, 0x73, 0x74, 0x33, 0x01, 0x05, 0xa2, 0x00, 0xf0, 0x06,
560x01, 0xf0, 0x03, 0x73, 0x68, 0x75, 0x66, 0x66, 0x6c, 0x65, 560x74, 0x6f, 0x00, 0x73, 0x68, 0x75, 0x66, 0x66, 0x6c, 0x65,
570x00, 0x75, 0x70, 0x3a, 0x00, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 570x00, 0x75, 0x70, 0x3a, 0x00, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
580x73, 0x4d, 0x01, 0x11, 0x74, 0x79, 0x00, 0xf3, 0x13, 0x73, 580x73, 0x4d, 0x01, 0x11, 0x74, 0x79, 0x00, 0xf3, 0x13, 0x73,
590x75, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x00, 0x77, 590x75, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x00, 0x77,
@@ -66,123 +66,123 @@ const char help_text[] = {
660xa3, 0x00, 0x00, 0x21, 0x02, 0x20, 0x00, 0x47, 0x05, 0x00, 660xa3, 0x00, 0x00, 0x21, 0x02, 0x20, 0x00, 0x47, 0x05, 0x00,
670x31, 0x77, 0x61, 0x73, 0xd5, 0x01, 0x61, 0x72, 0x69, 0x62, 670x31, 0x77, 0x61, 0x73, 0xd5, 0x01, 0x61, 0x72, 0x69, 0x62,
680x75, 0x74, 0x65, 0x8f, 0x00, 0x40, 0x74, 0x68, 0x69, 0x73, 680x75, 0x74, 0x65, 0x8f, 0x00, 0x40, 0x74, 0x68, 0x69, 0x73,
690x47, 0x00, 0x70, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 690x47, 0x00, 0x40, 0x6c, 0x65, 0x63, 0x74, 0xbe, 0x00, 0xf0,
700x04, 0x02, 0xc0, 0x4a, 0x61, 0x6d, 0x65, 0x73, 0x00, 0x48, 700x00, 0x62, 0x79, 0x00, 0x4a, 0x61, 0x6d, 0x65, 0x73, 0x00,
710x61, 0x72, 0x76, 0x65, 0x79, 0x40, 0x00, 0x47, 0x31, 0x33, 710x48, 0x61, 0x72, 0x76, 0x65, 0x79, 0x40, 0x00, 0x47, 0x31,
720x2e, 0x31, 0x66, 0x02, 0x01, 0x41, 0x00, 0x30, 0x6f, 0x6c, 720x33, 0x2e, 0x31, 0x66, 0x02, 0x01, 0x41, 0x00, 0x30, 0x6f,
730x73, 0x6f, 0x02, 0x10, 0x54, 0x3e, 0x00, 0x10, 0x67, 0x5b, 730x6c, 0x73, 0x6f, 0x02, 0x10, 0x54, 0x3e, 0x00, 0x10, 0x67,
740x00, 0xd2, 0x63, 0x61, 0x6e, 0x00, 0x62, 0x65, 0x00, 0x70, 740x5b, 0x00, 0xd2, 0x63, 0x61, 0x6e, 0x00, 0x62, 0x65, 0x00,
750x6c, 0x61, 0x79, 0x65, 0x64, 0x73, 0x01, 0x43, 0x65, 0x69, 750x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x73, 0x01, 0x43, 0x65,
760x74, 0x68, 0x06, 0x02, 0xb3, 0x6b, 0x65, 0x79, 0x62, 0x6f, 760x69, 0x74, 0x68, 0x06, 0x02, 0xb3, 0x6b, 0x65, 0x79, 0x62,
770x61, 0x72, 0x64, 0x00, 0x6f, 0x72, 0xfc, 0x01, 0x36, 0x75, 770x6f, 0x61, 0x72, 0x64, 0x00, 0x6f, 0x72, 0xfc, 0x01, 0x37,
780x73, 0x65, 0xc9, 0x01, 0x01, 0x58, 0x01, 0x11, 0x2d, 0x6f, 780x75, 0x73, 0x65, 0xc9, 0x01, 0x00, 0x58, 0x01, 0x11, 0x2d,
790x01, 0x80, 0x00, 0x61, 0x6e, 0x00, 0x75, 0x6e, 0x73, 0x65, 790x6f, 0x01, 0x80, 0x00, 0x61, 0x6e, 0x00, 0x75, 0x6e, 0x73,
800x90, 0x00, 0x23, 0x65, 0x64, 0x54, 0x01, 0x90, 0x2c, 0x00, 800x65, 0x90, 0x00, 0x23, 0x65, 0x64, 0x54, 0x01, 0x90, 0x2c,
810x69, 0x74, 0x00, 0x62, 0x65, 0x63, 0x6f, 0x99, 0x00, 0x05, 810x00, 0x69, 0x74, 0x00, 0x62, 0x65, 0x63, 0x6f, 0x99, 0x00,
820x1c, 0x00, 0x92, 0x28, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 820x05, 0x1c, 0x00, 0x92, 0x28, 0x70, 0x6f, 0x73, 0x73, 0x69,
830x6c, 0x79, 0x08, 0x02, 0x31, 0x69, 0x6e, 0x67, 0x5c, 0x00, 830x62, 0x6c, 0x79, 0x08, 0x02, 0x00, 0x85, 0x01, 0x00, 0x5c,
840xa3, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x00, 0x73, 840x00, 0x73, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x28,
850x65, 0xd4, 0x00, 0x1f, 0x29, 0x69, 0x00, 0x02, 0x01, 0x2c, 850x00, 0x4f, 0x69, 0x6f, 0x6e, 0x29, 0x69, 0x00, 0x03, 0x00,
860x00, 0x0f, 0x68, 0x00, 0x00, 0x01, 0x7b, 0x01, 0x00, 0xcb, 860x2c, 0x00, 0x0f, 0x68, 0x00, 0x01, 0x01, 0x7b, 0x01, 0x10,
870x00, 0x10, 0x72, 0xda, 0x01, 0x24, 0x65, 0x64, 0x94, 0x02, 870x62, 0xbd, 0x01, 0x56, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x94,
880x0e, 0xce, 0x01, 0x04, 0xcb, 0x01, 0xd7, 0x64, 0x00, 0x69, 880x02, 0x0d, 0xce, 0x01, 0x03, 0xcb, 0x01, 0xd8, 0x64, 0x00,
890x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x6c, 0x79, 890x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x6c,
900x6d, 0x00, 0x01, 0x82, 0x01, 0x0f, 0x6e, 0x00, 0x14, 0x07, 900x79, 0x6d, 0x00, 0x01, 0x82, 0x01, 0x0f, 0x6e, 0x00, 0x14,
910xf4, 0x00, 0x10, 0x2e, 0x58, 0x01, 0x02, 0xc8, 0x00, 0x30, 910x06, 0xf4, 0x00, 0x11, 0x2e, 0x58, 0x01, 0x01, 0xc8, 0x00,
920x73, 0x6f, 0x72, 0x3b, 0x01, 0x40, 0x73, 0x00, 0x6d, 0x6f, 920x30, 0x73, 0x6f, 0x72, 0x3b, 0x01, 0x41, 0x73, 0x00, 0x6d,
930xd3, 0x03, 0x04, 0x13, 0x00, 0x65, 0x61, 0x72, 0x6f, 0x75, 930x6f, 0xd3, 0x03, 0x03, 0x13, 0x00, 0x65, 0x61, 0x72, 0x6f,
940x6e, 0x64, 0x88, 0x00, 0x74, 0x2e, 0x00, 0x50, 0x72, 0x65, 940x75, 0x6e, 0x64, 0x88, 0x00, 0x74, 0x2e, 0x00, 0x50, 0x72,
950x73, 0x73, 0x00, 0x01, 0x50, 0x53, 0x70, 0x61, 0x63, 0x65, 950x65, 0x73, 0x73, 0x00, 0x01, 0x50, 0x53, 0x70, 0x61, 0x63,
960x69, 0x01, 0x42, 0x45, 0x6e, 0x74, 0x65, 0x40, 0x00, 0x00, 960x65, 0x69, 0x01, 0x43, 0x45, 0x6e, 0x74, 0x65, 0x40, 0x00,
970xf2, 0x03, 0x46, 0x6c, 0x65, 0x00, 0x74, 0x56, 0x00, 0x5f, 970x40, 0x77, 0x68, 0x69, 0x6c, 0xb5, 0x03, 0x05, 0x56, 0x00,
980x69, 0x73, 0x00, 0x69, 0x6e, 0x6c, 0x01, 0x02, 0x03, 0xa6, 980x5f, 0x69, 0x73, 0x00, 0x69, 0x6e, 0x6c, 0x01, 0x02, 0x03,
990x00, 0x73, 0x73, 0x00, 0x69, 0x74, 0x3b, 0x00, 0x70, 0x59, 990xa6, 0x00, 0x74, 0x73, 0x00, 0x69, 0x74, 0x3b, 0x00, 0x70,
1000x00, 0x0c, 0x55, 0x00, 0x53, 0x61, 0x67, 0x61, 0x69, 0x6e, 1000x59, 0x00, 0x0b, 0x55, 0x00, 0x53, 0x61, 0x67, 0x61, 0x69,
1010x22, 0x01, 0x10, 0x73, 0xc7, 0x00, 0x71, 0x61, 0x73, 0x00, 1010x6e, 0x22, 0x01, 0x10, 0x73, 0xc7, 0x00, 0x71, 0x61, 0x73,
1020x61, 0x62, 0x6f, 0x76, 0xd4, 0x01, 0x42, 0x28, 0x41, 0x6c, 1020x00, 0x61, 0x62, 0x6f, 0x76, 0xd4, 0x01, 0x42, 0x28, 0x41,
1030x6c, 0xb0, 0x03, 0x21, 0x63, 0x74, 0x36, 0x03, 0x90, 0x64, 1030x6c, 0x6c, 0xb0, 0x03, 0x21, 0x63, 0x74, 0x36, 0x03, 0x70,
1040x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0x74, 0x00, 1040x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x29, 0x01, 0x00,
1050x13, 0x73, 0x69, 0x02, 0x31, 0x32, 0x2e, 0x31, 0xb7, 0x02, 1050x5f, 0x00, 0x02, 0x69, 0x02, 0x31, 0x32, 0x2e, 0x31, 0xb7,
1060xa0, 0x61, 0x6c, 0x73, 0x6f, 0x00, 0x61, 0x76, 0x61, 0x69, 1060x02, 0xa0, 0x61, 0x6c, 0x73, 0x6f, 0x00, 0x61, 0x76, 0x61,
1070x6c, 0x6a, 0x03, 0x22, 0x2e, 0x29, 0x71, 0x02, 0x17, 0x32, 1070x69, 0x6c, 0x6a, 0x03, 0x22, 0x2e, 0x29, 0x71, 0x02, 0x17,
1080x71, 0x02, 0x93, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 1080x32, 0x71, 0x02, 0x93, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65,
1090x65, 0x72, 0x73, 0x02, 0x45, 0x65, 0x73, 0x65, 0x00, 0x14, 1090x74, 0x65, 0x72, 0x73, 0x02, 0x46, 0x65, 0x73, 0x65, 0x00,
1100x00, 0x01, 0xfc, 0x02, 0x06, 0x40, 0x00, 0x06, 0xff, 0x02, 1100x14, 0x00, 0x02, 0x45, 0x00, 0x04, 0x40, 0x00, 0x06, 0xff,
1110xe1, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 1110x02, 0xe1, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e,
1120x2e, 0x27, 0x00, 0x6f, 0x70, 0x73, 0x00, 0x22, 0x6f, 0x6e, 1120x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x73, 0x00, 0x22, 0x6f,
1130x1a, 0x00, 0xa0, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 1130x6e, 0x1a, 0x00, 0xa0, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00,
1140x65, 0x6e, 0x75, 0xaf, 0x00, 0x90, 0x57, 0x69, 0x64, 0x74, 1140x6d, 0x65, 0x6e, 0x75, 0xaf, 0x00, 0x90, 0x57, 0x69, 0x64,
1150x68, 0x2c, 0x00, 0x48, 0x65, 0xae, 0x01, 0x00, 0x2f, 0x03, 1150x74, 0x68, 0x2c, 0x00, 0x48, 0x65, 0xae, 0x01, 0x00, 0x2f,
1160x62, 0x69, 0x7a, 0x65, 0x00, 0x6f, 0x66, 0xe3, 0x01, 0x24, 1160x03, 0x30, 0x69, 0x7a, 0x65, 0xe7, 0x01, 0x01, 0xe3, 0x01,
1170x69, 0x6e, 0x27, 0x04, 0x00, 0x2b, 0x00, 0x72, 0x4e, 0x6f, 1170x24, 0x69, 0x6e, 0x27, 0x04, 0x00, 0x2b, 0x00, 0x72, 0x4e,
1180x2e, 0x20, 0x6f, 0x66, 0x20, 0xf4, 0x04, 0x10, 0x73, 0x11, 1180x6f, 0x2e, 0x20, 0x6f, 0x66, 0x20, 0xf4, 0x04, 0x10, 0x73,
1190x00, 0x50, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x00, 0x51, 1190x11, 0x00, 0x50, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x00,
1200x64, 0x69, 0x66, 0x66, 0x65, 0x78, 0x02, 0x04, 0x1e, 0x00, 1200x51, 0x64, 0x69, 0x66, 0x66, 0x65, 0x78, 0x02, 0x04, 0x1e,
1210x21, 0x75, 0x73, 0x62, 0x03, 0x01, 0x98, 0x03, 0x05, 0xac, 1210x00, 0x22, 0x75, 0x73, 0x62, 0x03, 0x00, 0x98, 0x03, 0x05,
1220x01, 0x15, 0x3b, 0xfb, 0x04, 0x04, 0x28, 0x00, 0x12, 0x2c, 1220xac, 0x01, 0x16, 0x3b, 0xfb, 0x04, 0x03, 0x28, 0x00, 0x12,
1230xf0, 0x04, 0x41, 0x65, 0x77, 0x65, 0x72, 0x38, 0x05, 0x05, 1230x2c, 0xf0, 0x04, 0x42, 0x65, 0x77, 0x65, 0x72, 0x38, 0x05,
1240x6d, 0x04, 0x06, 0xbc, 0x05, 0x03, 0xf6, 0x03, 0x25, 0x75, 1240x08, 0x6c, 0x05, 0x02, 0x24, 0x00, 0x03, 0xf6, 0x03, 0x26,
1250x73, 0x3d, 0x00, 0x01, 0x6f, 0x00, 0x50, 0x69, 0x63, 0x75, 1250x75, 0x73, 0x3d, 0x00, 0x00, 0x6f, 0x00, 0x50, 0x69, 0x63,
1260x6c, 0x74, 0x7d, 0x01, 0x21, 0x69, 0x73, 0x59, 0x04, 0xbb, 1260x75, 0x6c, 0x74, 0x7d, 0x01, 0x21, 0x69, 0x73, 0x59, 0x04,
1270x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x6c, 1270xbb, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c,
1280x79, 0x1a, 0x05, 0x01, 0x06, 0x04, 0x20, 0x63, 0x6f, 0x23, 1280x6c, 0x79, 0x1a, 0x05, 0x01, 0x06, 0x04, 0x20, 0x63, 0x6f,
1290x03, 0xb2, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x00, 1290x23, 0x03, 0xb3, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d,
1300x00, 0x00, 0x43, 0xc8, 0x03, 0x01, 0x55, 0x00, 0x00, 0xe9, 1300x00, 0x00, 0x00, 0x43, 0xc8, 0x03, 0x01, 0x26, 0x00, 0xf2,
1310x01, 0xe2, 0x63, 0x69, 0x73, 0x65, 0x00, 0x6d, 0x65, 0x63, 1310x02, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x65, 0x00, 0x6d,
1320x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0xbf, 0x00, 0x52, 0x66, 1320x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0xbf, 0x00,
1330x6f, 0x72, 0x00, 0x73, 0x39, 0x00, 0x61, 0x2e, 0x00, 0x57, 1330x52, 0x66, 0x6f, 0x72, 0x00, 0x73, 0x39, 0x00, 0x30, 0x2e,
1340x69, 0x74, 0x68, 0x2d, 0x00, 0x40, 0x64, 0x65, 0x66, 0x61, 1340x00, 0x57, 0xd5, 0x03, 0x00, 0x2d, 0x00, 0x40, 0x64, 0x65,
1350x7b, 0x00, 0x02, 0x4b, 0x00, 0xf8, 0x02, 0x2c, 0x00, 0x60, 1350x66, 0x61, 0x7b, 0x00, 0x02, 0x4b, 0x00, 0xf8, 0x02, 0x2c,
1360x28, 0x6e, 0x2d, 0x32, 0x29, 0x5e, 0x32, 0x27, 0x2c, 0x00, 1360x00, 0x60, 0x28, 0x6e, 0x2d, 0x32, 0x29, 0x5e, 0x32, 0x27,
1370x6f, 0x6e, 0x6c, 0x79, 0xc1, 0x00, 0x46, 0x74, 0x68, 0x72, 1370x2c, 0x00, 0x6f, 0x6e, 0x6c, 0x79, 0xc1, 0x00, 0x46, 0x74,
1380x65, 0x6a, 0x05, 0x21, 0x6f, 0x72, 0xbe, 0x00, 0x01, 0xf5, 1380x68, 0x72, 0x65, 0x6a, 0x05, 0x22, 0x6f, 0x72, 0xbe, 0x00,
1390x02, 0x00, 0x58, 0x00, 0x00, 0xba, 0x01, 0x24, 0x6e, 0x79, 1390x01, 0xf5, 0x02, 0x20, 0x73, 0x63, 0x0b, 0x00, 0x34, 0x61,
1400x05, 0x06, 0x00, 0x05, 0x05, 0x27, 0x6c, 0x6c, 0x68, 0x00, 1400x6e, 0x79, 0x05, 0x06, 0x00, 0x05, 0x05, 0x27, 0x6c, 0x6c,
1410xb1, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 1410x68, 0x00, 0xb1, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61,
1420x76, 0x65, 0x64, 0x00, 0x10, 0x31, 0x64, 0x00, 0x04, 0x76, 1420x74, 0x69, 0x76, 0x65, 0x64, 0x00, 0x10, 0x31, 0x64, 0x00,
1430x00, 0x09, 0x66, 0x00, 0x24, 0x77, 0x6f, 0x64, 0x00, 0x04, 1430x05, 0x76, 0x00, 0x08, 0x66, 0x00, 0x25, 0x77, 0x6f, 0x64,
1440x57, 0x00, 0x02, 0x55, 0x00, 0x51, 0x00, 0x65, 0x61, 0x63, 1440x00, 0x03, 0x57, 0x00, 0x02, 0x55, 0x00, 0x52, 0x00, 0x65,
1450x68, 0x36, 0x05, 0x03, 0x94, 0x06, 0x03, 0x36, 0x00, 0x04, 1450x61, 0x63, 0x68, 0x36, 0x05, 0x03, 0x94, 0x06, 0x04, 0x36,
1460x27, 0x00, 0x31, 0x72, 0x65, 0x6c, 0x5f, 0x00, 0x27, 0x6c, 1460x00, 0x02, 0x27, 0x00, 0x31, 0x72, 0x65, 0x6c, 0x5f, 0x00,
1470x79, 0x8f, 0x06, 0x01, 0xeb, 0x01, 0xf1, 0x02, 0x45, 0x6e, 1470x28, 0x6c, 0x79, 0x8f, 0x06, 0x00, 0x2f, 0x01, 0xf2, 0x02,
1480x73, 0x75, 0x72, 0x65, 0x20, 0x73, 0x6f, 0x6c, 0x75, 0x62, 1480x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x20, 0x73, 0x6f, 0x6c,
1490x69, 0x6c, 0x69, 0x74, 0x79, 0xd7, 0x03, 0x01, 0x2f, 0x05, 1490x75, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0xd7, 0x03, 0x01,
1500x03, 0x4f, 0x02, 0x01, 0x77, 0x01, 0x30, 0x69, 0x63, 0x6b, 1500x2f, 0x05, 0x03, 0x4f, 0x02, 0x00, 0x77, 0x01, 0x30, 0x69,
1510x23, 0x04, 0x09, 0x16, 0x01, 0xd0, 0x74, 0x61, 0x74, 0x65, 1510x63, 0x6b, 0x23, 0x04, 0x09, 0x16, 0x01, 0xd0, 0x74, 0x61,
1520x29, 0x2c, 0x00, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x59, 1520x74, 0x65, 0x29, 0x2c, 0x00, 0x67, 0x65, 0x6e, 0x65, 0x72,
1530x03, 0x00, 0x83, 0x01, 0x15, 0x73, 0xea, 0x03, 0x81, 0x67, 1530x61, 0x59, 0x03, 0x00, 0x83, 0x01, 0x15, 0x73, 0xea, 0x03,
1540x75, 0x61, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x1e, 0x02, 0x03, 1540x82, 0x67, 0x75, 0x61, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x1e,
1550xad, 0x07, 0x71, 0x74, 0x00, 0x6c, 0x65, 0x61, 0x73, 0x74, 1550x02, 0x02, 0xad, 0x07, 0x71, 0x74, 0x00, 0x6c, 0x65, 0x61,
1560x52, 0x07, 0x00, 0x73, 0x00, 0x00, 0x60, 0x00, 0x07, 0x49, 1560x73, 0x74, 0x52, 0x07, 0x00, 0x73, 0x00, 0x00, 0x60, 0x00,
1570x04, 0x60, 0x74, 0x75, 0x72, 0x6e, 0x00, 0x69, 0x7d, 0x04, 1570x07, 0x49, 0x04, 0x60, 0x74, 0x75, 0x72, 0x6e, 0x00, 0x69,
1580x11, 0x66, 0x2f, 0x02, 0x01, 0x73, 0x05, 0x04, 0x61, 0x00, 1580x7d, 0x04, 0x12, 0x66, 0x2f, 0x02, 0x01, 0x73, 0x05, 0x03,
1590x21, 0x6f, 0x72, 0x5b, 0x00, 0x00, 0xe2, 0x06, 0x76, 0x00, 1590x61, 0x00, 0x22, 0x6f, 0x72, 0x5b, 0x00, 0x70, 0x6e, 0x6f,
1600x74, 0x72, 0x79, 0x00, 0x74, 0x6f, 0x63, 0x00, 0x11, 0x00, 1600x74, 0x00, 0x74, 0x72, 0x79, 0x55, 0x00, 0x05, 0x63, 0x00,
1610xc0, 0x00, 0x22, 0x6c, 0x65, 0x83, 0x00, 0x14, 0x3b, 0x71, 1610x01, 0x4d, 0x00, 0x00, 0x17, 0x03, 0x01, 0x83, 0x00, 0x14,
1620x04, 0xd0, 0x2c, 0x00, 0x68, 0x6f, 0x77, 0x65, 0x76, 0x65, 1620x3b, 0x71, 0x04, 0xd0, 0x2c, 0x00, 0x68, 0x6f, 0x77, 0x65,
1630x72, 0x2c, 0x00, 0x73, 0x74, 0x3c, 0x00, 0x11, 0x65, 0xee, 1630x76, 0x65, 0x72, 0x2c, 0x00, 0x73, 0x74, 0x3c, 0x00, 0x11,
1640x00, 0x01, 0x89, 0x06, 0x05, 0x08, 0x07, 0x07, 0x97, 0x00, 1640x65, 0xee, 0x00, 0x02, 0x89, 0x06, 0x06, 0x08, 0x07, 0x05,
1650x16, 0x32, 0xc2, 0x01, 0x11, 0x66, 0x53, 0x01, 0x04, 0x99, 1650x97, 0x00, 0x16, 0x32, 0xc2, 0x01, 0x11, 0x66, 0x53, 0x01,
1660x02, 0x26, 0x6f, 0x6e, 0x0e, 0x05, 0x02, 0x3b, 0x00, 0x00, 1660x04, 0x99, 0x02, 0x26, 0x6f, 0x6e, 0x0e, 0x05, 0x02, 0x3b,
1670xff, 0x00, 0x83, 0x72, 0x74, 0x00, 0x28, 0x73, 0x69, 0x6e, 1670x00, 0x00, 0xff, 0x00, 0x85, 0x72, 0x74, 0x00, 0x28, 0x73,
1680x63, 0x86, 0x08, 0x04, 0x0f, 0x06, 0x93, 0x78, 0x61, 0x63, 1680x69, 0x6e, 0x63, 0x86, 0x08, 0x02, 0x0f, 0x06, 0x62, 0x78,
1690x74, 0x6c, 0x79, 0x00, 0x6f, 0x6e, 0x11, 0x02, 0x00, 0x66, 1690x61, 0x63, 0x74, 0x6c, 0x79, 0xe4, 0x00, 0x01, 0x4f, 0x00,
1700x03, 0x00, 0x22, 0x00, 0x44, 0x69, 0x76, 0x65, 0x6e, 0x51, 1700x00, 0x4e, 0x00, 0x74, 0x61, 0x00, 0x67, 0x69, 0x76, 0x65,
1710x00, 0x20, 0x69, 0x73, 0x48, 0x01, 0x40, 0x69, 0x6e, 0x69, 1710x6e, 0x51, 0x00, 0x20, 0x69, 0x73, 0x48, 0x01, 0x40, 0x69,
1720x74, 0x94, 0x01, 0x23, 0x69, 0x6e, 0xc0, 0x00, 0x40, 0x29, 1720x6e, 0x69, 0x74, 0x94, 0x01, 0x23, 0x69, 0x6e, 0xc0, 0x00,
1730x2e, 0x00, 0x47, 0xc2, 0x00, 0x04, 0xf4, 0x00, 0x03, 0x63, 1730x41, 0x29, 0x2e, 0x00, 0x47, 0x45, 0x01, 0x06, 0x55, 0x01,
1740x06, 0x09, 0x8f, 0x01, 0x50, 0x64, 0x69, 0x73, 0x61, 0x62, 1740x01, 0x54, 0x00, 0x08, 0x8f, 0x01, 0x50, 0x64, 0x69, 0x73,
1750x8e, 0x05, 0x31, 0x6d, 0x61, 0x79, 0xe6, 0x06, 0x30, 0x61, 1750x61, 0x62, 0x8e, 0x05, 0x31, 0x6d, 0x61, 0x79, 0xe6, 0x06,
1760x69, 0x6e, 0xd6, 0x01, 0x02, 0x8f, 0x08, 0x01, 0xd2, 0x00, 1760x00, 0xa3, 0x04, 0x01, 0xd6, 0x01, 0x02, 0x57, 0x03, 0x43,
1770x10, 0x61, 0xc1, 0x00, 0x07, 0xd7, 0x08, 0x03, 0x76, 0x00, 1770x61, 0x72, 0x65, 0x61, 0x55, 0x03, 0x05, 0xd7, 0x08, 0x02,
1780x10, 0x2c, 0xe7, 0x00, 0x11, 0x64, 0x40, 0x05, 0xf0, 0x00, 1780x76, 0x00, 0x10, 0x2c, 0xe7, 0x00, 0x11, 0x64, 0x40, 0x05,
1790x6f, 0x00, 0x6f, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x75, 0x6e, 1790xf1, 0x00, 0x6f, 0x00, 0x6f, 0x70, 0x70, 0x6f, 0x72, 0x74,
1800x69, 0x74, 0x69, 0x65, 0x73, 0x01, 0x03, 0x01, 0xb8, 0x08, 1800x75, 0x6e, 0x69, 0x74, 0x69, 0x65, 0x73, 0x01, 0x03, 0x00,
1810x22, 0x65, 0x72, 0x32, 0x02, 0x11, 0x73, 0xc1, 0x03, 0x10, 1810xb8, 0x08, 0x22, 0x65, 0x72, 0x32, 0x02, 0x11, 0x73, 0xc1,
1820x79, 0xef, 0x06, 0x02, 0xba, 0x04, 0x80, 0x74, 0x61, 0x6b, 1820x03, 0x11, 0x79, 0xef, 0x06, 0x01, 0xba, 0x04, 0x80, 0x74,
1830x65, 0x00, 0x6c, 0x65, 0x73, 0x0c, 0x02, 0x21, 0x6d, 0x65, 1830x61, 0x6b, 0x65, 0x00, 0x6c, 0x65, 0x73, 0x0c, 0x02, 0x21,
1840x7d, 0x01, 0x90, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 1840x6d, 0x65, 0x7d, 0x01, 0x90, 0x65, 0x6e, 0x65, 0x72, 0x61,
1850x2e, 0x00, 1850x74, 0x65, 0x2e, 0x00,
186}; 186};
187 187
188const unsigned short help_text_len = 2470; 188const unsigned short help_text_len = 2470;
diff --git a/apps/plugins/puzzles/help/signpost.c b/apps/plugins/puzzles/help/signpost.c
index fd496dab24..ceafcfd056 100644
--- a/apps/plugins/puzzles/help/signpost.c
+++ b/apps/plugins/puzzles/help/signpost.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -14,7 +14,7 @@ struct style_text help_text_style[] = {
14 LAST_STYLE_ITEM 14 LAST_STYLE_ITEM
15}; 15};
16 16
17/* orig 3054 comp 1895 ratio 0.620498 level 11 saved 1159 */ 17/* orig 3054 comp 1895 ratio 0.620498 level 10 saved 1159 */
18const char help_text[] = { 18const char help_text[] = {
190xf3, 0x29, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 190xf3, 0x29, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
200x33, 0x34, 0x3a, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x70, 0x6f, 200x33, 0x34, 0x3a, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x70, 0x6f,
@@ -30,34 +30,34 @@ const char help_text[] = {
300x6d, 0x65, 0x47, 0x00, 0x54, 0x00, 0x61, 0x6c, 0x73, 0x6f, 300x6d, 0x65, 0x47, 0x00, 0x54, 0x00, 0x61, 0x6c, 0x73, 0x6f,
310x29, 0x00, 0x90, 0x00, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 310x29, 0x00, 0x90, 0x00, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72,
320x73, 0x2e, 0x78, 0x00, 0xa1, 0x72, 0x00, 0x6a, 0x6f, 0x62, 320x73, 0x2e, 0x78, 0x00, 0xa1, 0x72, 0x00, 0x6a, 0x6f, 0x62,
330x00, 0x69, 0x73, 0x00, 0x74, 0x20, 0x00, 0x30, 0x6e, 0x65, 330x00, 0x69, 0x73, 0x00, 0x74, 0x20, 0x00, 0x32, 0x6e, 0x65,
340x63, 0x5f, 0x00, 0x04, 0x39, 0x00, 0x01, 0x17, 0x00, 0x61, 340x63, 0x5f, 0x00, 0x04, 0x39, 0x00, 0x91, 0x74, 0x6f, 0x00,
350x66, 0x6f, 0x72, 0x6d, 0x00, 0x61, 0x3e, 0x00, 0x90, 0x69, 350x66, 0x6f, 0x72, 0x6d, 0x00, 0x61, 0x3e, 0x00, 0x90, 0x69,
360x6e, 0x75, 0x6f, 0x75, 0x73, 0x00, 0x6c, 0x69, 0x7c, 0x00, 360x6e, 0x75, 0x6f, 0x75, 0x73, 0x00, 0x6c, 0x69, 0x7c, 0x00,
370x14, 0x66, 0x49, 0x00, 0xe1, 0x00, 0x73, 0x74, 0x61, 0x72, 370x14, 0x66, 0x49, 0x00, 0xe1, 0x00, 0x73, 0x74, 0x61, 0x72,
380x74, 0x69, 0x6e, 0x67, 0x00, 0x61, 0x74, 0x00, 0x31, 0x7d, 380x74, 0x69, 0x6e, 0x67, 0x00, 0x61, 0x74, 0x00, 0x31, 0x7d,
390x00, 0x91, 0x6c, 0x69, 0x6e, 0x6b, 0x65, 0x64, 0x00, 0x69, 390x00, 0x91, 0x6c, 0x69, 0x6e, 0x6b, 0x65, 0x64, 0x00, 0x69,
400x6e, 0x4d, 0x00, 0xc0, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 400x6e, 0x4d, 0x00, 0x90, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74,
410x69, 0x6f, 0x6e, 0x00, 0x6f, 0x66, 0x11, 0x00, 0x02, 0xa7, 410x69, 0x6f, 0x6e, 0x35, 0x00, 0x00, 0x11, 0x00, 0x01, 0xa7,
420x00, 0x66, 0x73, 0x00, 0x2d, 0x00, 0x73, 0x6f, 0x10, 0x00, 420x00, 0x66, 0x73, 0x00, 0x2d, 0x00, 0x73, 0x6f, 0x10, 0x00,
430x77, 0x00, 0x69, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x7f, 0x00, 430x77, 0x00, 0x69, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x7f, 0x00,
440x50, 0x00, 0x77, 0x69, 0x74, 0x68, 0x10, 0x00, 0x03, 0x6a, 440x51, 0x00, 0x77, 0x69, 0x74, 0x68, 0x10, 0x00, 0x02, 0x6a,
450x00, 0xd0, 0x00, 0x31, 0x00, 0x77, 0x69, 0x6c, 0x6c, 0x00, 450x00, 0xd0, 0x00, 0x31, 0x00, 0x77, 0x69, 0x6c, 0x6c, 0x00,
460x70, 0x6f, 0x69, 0x6e, 0x74, 0x9b, 0x00, 0x06, 0x2b, 0x00, 460x70, 0x6f, 0x69, 0x6e, 0x74, 0x9b, 0x00, 0x07, 0x2b, 0x00,
470x04, 0xdd, 0x00, 0x38, 0x69, 0x6e, 0x67, 0x31, 0x00, 0x8f, 470x03, 0xdd, 0x00, 0x00, 0x86, 0x00, 0x07, 0x31, 0x00, 0x8f,
480x32, 0x2c, 0x00, 0x77, 0x68, 0x69, 0x63, 0x68, 0x38, 0x00, 480x32, 0x2c, 0x00, 0x77, 0x68, 0x69, 0x63, 0x68, 0x38, 0x00,
490x1d, 0x97, 0x33, 0x2c, 0x00, 0x65, 0x74, 0x63, 0x2e, 0x00, 490x1d, 0x97, 0x33, 0x2c, 0x00, 0x65, 0x74, 0x63, 0x2e, 0x00,
500x45, 0x7e, 0x01, 0xf1, 0x0e, 0x63, 0x61, 0x6e, 0x00, 0x62, 500x45, 0x7e, 0x01, 0xf1, 0x0e, 0x63, 0x61, 0x6e, 0x00, 0x62,
510x65, 0x00, 0x61, 0x6e, 0x79, 0x00, 0x64, 0x69, 0x73, 0x74, 510x65, 0x00, 0x61, 0x6e, 0x79, 0x00, 0x64, 0x69, 0x73, 0x74,
520x61, 0x6e, 0x63, 0x65, 0x00, 0x61, 0x77, 0x61, 0x79, 0x00, 520x61, 0x6e, 0x63, 0x65, 0x00, 0x61, 0x77, 0x61, 0x79, 0x00,
530x66, 0x72, 0x6f, 0x6d, 0x3d, 0x00, 0x80, 0x70, 0x72, 0x65, 530x66, 0x72, 0x6f, 0x6d, 0x3d, 0x00, 0x50, 0x70, 0x72, 0x65,
540x76, 0x69, 0x6f, 0x75, 0x73, 0x98, 0x01, 0x90, 0x2c, 0x00, 540x76, 0x69, 0x21, 0x01, 0xc0, 0x6f, 0x6e, 0x65, 0x2c, 0x00,
550x61, 0x73, 0x00, 0x6c, 0x6f, 0x6e, 0x67, 0x08, 0x00, 0x51, 550x61, 0x73, 0x00, 0x6c, 0x6f, 0x6e, 0x67, 0x08, 0x00, 0x20,
560x69, 0x74, 0x00, 0x69, 0x73, 0x92, 0x01, 0x5f, 0x77, 0x68, 560x69, 0x74, 0x63, 0x01, 0x00, 0x92, 0x01, 0x5f, 0x77, 0x68,
570x65, 0x72, 0x65, 0x18, 0x01, 0x0b, 0x60, 0x2e, 0x00, 0x00, 570x65, 0x72, 0x65, 0x18, 0x01, 0x0b, 0x60, 0x2e, 0x00, 0x00,
580x00, 0x42, 0x79, 0x99, 0x00, 0x62, 0x76, 0x65, 0x6e, 0x74, 580x00, 0x42, 0x79, 0x99, 0x00, 0x31, 0x76, 0x65, 0x6e, 0x1e,
590x69, 0x6f, 0x2c, 0x00, 0x50, 0x66, 0x69, 0x72, 0x73, 0x74, 590x00, 0x00, 0x1b, 0x00, 0x52, 0x66, 0x69, 0x72, 0x73, 0x74,
600x5c, 0x01, 0x01, 0xfa, 0x01, 0x05, 0x7b, 0x01, 0x00, 0x99, 600x5c, 0x01, 0x00, 0xfa, 0x01, 0x04, 0x7b, 0x01, 0x00, 0x99,
610x00, 0x60, 0x73, 0x68, 0x6f, 0x77, 0x6e, 0x3b, 0x75, 0x00, 610x00, 0x60, 0x73, 0x68, 0x6f, 0x77, 0x6e, 0x3b, 0x75, 0x00,
620x61, 0x00, 0x6f, 0x72, 0x00, 0x6d, 0x6f, 0x61, 0x00, 0x55, 620x61, 0x00, 0x6f, 0x72, 0x00, 0x6d, 0x6f, 0x61, 0x00, 0x55,
630x74, 0x65, 0x72, 0x69, 0x6d, 0x27, 0x00, 0x32, 0x6d, 0x61, 630x74, 0x65, 0x72, 0x69, 0x6d, 0x27, 0x00, 0x32, 0x6d, 0x61,
@@ -74,19 +74,19 @@ const char help_text[] = {
740x00, 0x04, 0xe7, 0x02, 0x41, 0x00, 0x77, 0x61, 0x73, 0x6c, 740x00, 0x04, 0xe7, 0x02, 0x41, 0x00, 0x77, 0x61, 0x73, 0x6c,
750x01, 0x72, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x86, 750x01, 0x72, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x86,
760x01, 0x10, 0x69, 0x14, 0x00, 0x23, 0x6c, 0x6c, 0x05, 0x01, 760x01, 0x10, 0x69, 0x14, 0x00, 0x23, 0x6c, 0x6c, 0x05, 0x01,
770xf1, 0x03, 0x62, 0x79, 0x00, 0x4a, 0x61, 0x6d, 0x65, 0x73, 770xf0, 0x00, 0x62, 0x79, 0x00, 0x4a, 0x61, 0x6d, 0x65, 0x73,
780x00, 0x48, 0x61, 0x72, 0x76, 0x65, 0x79, 0x2e, 0x00, 0x00, 780x00, 0x48, 0x61, 0x72, 0x76, 0x65, 0x79, 0x3f, 0x00, 0x00,
790x6f, 0x00, 0x90, 0x00, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 790x6f, 0x00, 0x90, 0x00, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
800x2f, 0x6a, 0x81, 0x00, 0xc5, 0x2e, 0x61, 0x74, 0x2f, 0x52, 800x2f, 0x6a, 0x81, 0x00, 0xc5, 0x2e, 0x61, 0x74, 0x2f, 0x52,
810x61, 0x65, 0x74, 0x73, 0x65, 0x6c, 0x2f, 0x79, 0x00, 0xf6, 810x61, 0x65, 0x74, 0x73, 0x65, 0x6c, 0x2f, 0x79, 0x00, 0xf6,
820x02, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 820x02, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74,
830x6d, 0x00, 0x00, 0x00, 0x33, 0x34, 0x2e, 0x31, 0x5e, 0x03, 830x6d, 0x00, 0x00, 0x00, 0x33, 0x34, 0x2e, 0x31, 0x5e, 0x03,
840x01, 0x73, 0x00, 0x30, 0x6f, 0x6c, 0x73, 0x67, 0x03, 0x75, 840x01, 0x73, 0x00, 0x30, 0x6f, 0x6c, 0x73, 0x67, 0x03, 0x75,
850x54, 0x6f, 0x00, 0x70, 0x6c, 0x61, 0x79, 0x94, 0x00, 0x54, 850x54, 0x6f, 0x00, 0x70, 0x6c, 0x61, 0x79, 0x94, 0x00, 0x55,
860x2c, 0x00, 0x79, 0x6f, 0x75, 0xf6, 0x02, 0x07, 0xf2, 0x02, 860x2c, 0x00, 0x79, 0x6f, 0x75, 0xf6, 0x02, 0x06, 0xf2, 0x02,
870x60, 0x67, 0x65, 0x74, 0x68, 0x65, 0x72, 0x8f, 0x00, 0x82, 870x60, 0x67, 0x65, 0x74, 0x68, 0x65, 0x72, 0x8f, 0x00, 0x50,
880x64, 0x72, 0x61, 0x67, 0x67, 0x69, 0x6e, 0x67, 0xe3, 0x01, 880x64, 0x72, 0x61, 0x67, 0x67, 0x1b, 0x02, 0x01, 0xe3, 0x01,
890x24, 0x6f, 0x6e, 0x36, 0x02, 0x00, 0xbe, 0x00, 0x30, 0x61, 890x25, 0x6f, 0x6e, 0x36, 0x02, 0x60, 0x74, 0x6f, 0x00, 0x61,
900x6e, 0x6f, 0x27, 0x00, 0x92, 0x2c, 0x00, 0x69, 0x6e, 0x64, 900x6e, 0x6f, 0x27, 0x00, 0x92, 0x2c, 0x00, 0x69, 0x6e, 0x64,
910x69, 0x63, 0x61, 0x74, 0x42, 0x02, 0x02, 0x59, 0x01, 0x11, 910x69, 0x63, 0x61, 0x74, 0x42, 0x02, 0x02, 0x59, 0x01, 0x11,
920x79, 0x98, 0x01, 0x84, 0x61, 0x64, 0x6a, 0x61, 0x63, 0x65, 920x79, 0x98, 0x01, 0x84, 0x61, 0x64, 0x6a, 0x61, 0x63, 0x65,
@@ -96,112 +96,112 @@ const char help_text[] = {
960x74, 0x6f, 0x6e, 0x69, 0x00, 0x17, 0x61, 0x67, 0x00, 0xe0, 960x74, 0x6f, 0x6e, 0x69, 0x00, 0x17, 0x61, 0x67, 0x00, 0xe0,
970x69, 0x74, 0x73, 0x00, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 970x69, 0x74, 0x73, 0x00, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73,
980x73, 0x6f, 0x72, 0x2c, 0xe1, 0x01, 0x05, 0x38, 0x00, 0x4f, 980x73, 0x6f, 0x72, 0x2c, 0xe1, 0x01, 0x05, 0x38, 0x00, 0x4f,
990x72, 0x69, 0x67, 0x68, 0x39, 0x00, 0x0a, 0x00, 0x91, 0x02, 990x72, 0x69, 0x67, 0x68, 0x39, 0x00, 0x0b, 0x52, 0x70, 0x72,
1000x22, 0x64, 0x65, 0x3b, 0x00, 0x00, 0x4e, 0x01, 0x28, 0x49, 1000x65, 0x64, 0x65, 0x3b, 0x00, 0x00, 0x4e, 0x01, 0x29, 0x49,
1010x66, 0xf2, 0x00, 0x06, 0xea, 0x00, 0x35, 0x74, 0x77, 0x6f, 1010x66, 0xf2, 0x00, 0x05, 0xea, 0x00, 0x35, 0x74, 0x77, 0x6f,
1020xff, 0x00, 0x22, 0x69, 0x6e, 0x98, 0x01, 0x30, 0x77, 0x61, 1020xff, 0x00, 0x22, 0x69, 0x6e, 0x98, 0x01, 0x00, 0xd9, 0x02,
1030x79, 0x6e, 0x02, 0x00, 0xf5, 0x00, 0x03, 0x9e, 0x02, 0x73, 1030x00, 0x6e, 0x02, 0x01, 0x56, 0x02, 0x01, 0x9e, 0x02, 0x74,
1040x6d, 0x00, 0x68, 0x61, 0x73, 0x00, 0x61, 0x54, 0x02, 0x00, 1040x6d, 0x00, 0x68, 0x61, 0x73, 0x00, 0x61, 0x23, 0x03, 0x62,
1050x29, 0x00, 0x32, 0x69, 0x74, 0x2c, 0xb7, 0x02, 0x94, 0x70, 1050x69, 0x6e, 0x00, 0x69, 0x74, 0x2c, 0xb7, 0x02, 0x95, 0x70,
1060x70, 0x72, 0x6f, 0x70, 0x72, 0x69, 0x61, 0x74, 0x41, 0x03, 1060x70, 0x72, 0x6f, 0x70, 0x72, 0x69, 0x61, 0x74, 0x41, 0x03,
1070x01, 0x70, 0x03, 0x03, 0x6d, 0x02, 0x04, 0xff, 0x00, 0x01, 1070x01, 0x70, 0x03, 0x03, 0x6d, 0x02, 0x03, 0xff, 0x00, 0x01,
1080x2f, 0x01, 0x03, 0x68, 0x00, 0x1b, 0x2e, 0x8c, 0x00, 0x01, 1080x2f, 0x01, 0x03, 0x68, 0x00, 0x1d, 0x2e, 0x8c, 0x00, 0x72,
1090x83, 0x00, 0x42, 0x6e, 0x6f, 0x6e, 0x2d, 0x3f, 0x00, 0x24, 1090x77, 0x6f, 0x00, 0x6e, 0x6f, 0x6e, 0x2d, 0x3f, 0x00, 0x24,
1100x65, 0x64, 0x90, 0x00, 0x11, 0x2c, 0x4f, 0x01, 0x01, 0x4f, 1100x65, 0x64, 0x90, 0x00, 0x12, 0x2c, 0x4f, 0x01, 0x01, 0x4f,
1110x00, 0x01, 0x7d, 0x03, 0x50, 0x73, 0x73, 0x69, 0x67, 0x6e, 1110x00, 0x00, 0x7d, 0x03, 0x50, 0x73, 0x73, 0x69, 0x67, 0x6e,
1120x3f, 0x02, 0x70, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 1120x3f, 0x02, 0x70, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72,
1130xd7, 0x02, 0xf9, 0x01, 0x67, 0x65, 0x62, 0x72, 0x61, 0x69, 1130xd7, 0x02, 0xf9, 0x01, 0x67, 0x65, 0x62, 0x72, 0x61, 0x69,
1140x63, 0x00, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x3a, 0x00, 1140x63, 0x00, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x3a, 0x00,
1150x32, 0x03, 0x8a, 0x6f, 0x63, 0x63, 0x61, 0x73, 0x69, 0x6f, 1150x32, 0x03, 0x8b, 0x6f, 0x63, 0x63, 0x61, 0x73, 0x69, 0x6f,
1160x6e, 0x49, 0x00, 0x02, 0x2c, 0x00, 0x71, 0x6c, 0x65, 0x64, 1160x6e, 0x49, 0x00, 0x01, 0x2c, 0x00, 0x71, 0x6c, 0x65, 0x64,
1170x00, 0x60, 0x61, 0x27, 0xe8, 0x00, 0x51, 0x60, 0x61, 0x2b, 1170x00, 0x60, 0x61, 0x27, 0xe8, 0x00, 0x52, 0x60, 0x61, 0x2b,
1180x31, 0x27, 0x3a, 0x05, 0x00, 0x29, 0x00, 0x43, 0x6e, 0x00, 1180x31, 0x27, 0x3a, 0x05, 0x73, 0x74, 0x68, 0x65, 0x6e, 0x00,
1190x60, 0x62, 0x18, 0x00, 0x14, 0x62, 0x18, 0x00, 0x00, 0xad, 1190x60, 0x62, 0x18, 0x00, 0x15, 0x62, 0x18, 0x00, 0x82, 0x73,
1200x04, 0x51, 0x6f, 0x6e, 0x2e, 0x00, 0x43, 0xb3, 0x00, 0x00, 1200x6f, 0x00, 0x6f, 0x6e, 0x2e, 0x00, 0x43, 0xb3, 0x00, 0x00,
1210xf0, 0x01, 0x00, 0x6c, 0x03, 0x06, 0x2b, 0x05, 0x24, 0x6f, 1210xf0, 0x01, 0x01, 0x6c, 0x03, 0x04, 0x3a, 0x01, 0x24, 0x6f,
1220x6e, 0x5b, 0x04, 0x41, 0x65, 0x6e, 0x64, 0x73, 0xc5, 0x05, 1220x6e, 0x5b, 0x04, 0x41, 0x65, 0x6e, 0x64, 0x73, 0xc5, 0x05,
1230x30, 0x75, 0x63, 0x68, 0x3a, 0x05, 0x42, 0x68, 0x61, 0x69, 1230x30, 0x75, 0x63, 0x68, 0x3a, 0x05, 0x10, 0x68, 0x76, 0x05,
1240x6e, 0x7a, 0x00, 0x52, 0x63, 0x61, 0x75, 0x73, 0x65, 0x4d, 1240x01, 0x7a, 0x00, 0x52, 0x63, 0x61, 0x75, 0x73, 0x65, 0x4d,
1250x01, 0x00, 0x3f, 0x03, 0x28, 0x74, 0x6f, 0x8c, 0x00, 0x06, 1250x01, 0x00, 0x3f, 0x03, 0x29, 0x74, 0x6f, 0x8c, 0x00, 0x05,
1260xda, 0x01, 0x30, 0x73, 0x61, 0x6d, 0x17, 0x02, 0x31, 0x74, 1260xda, 0x01, 0x30, 0x73, 0x61, 0x6d, 0x17, 0x02, 0x31, 0x74,
1270x74, 0x65, 0xb8, 0x01, 0x40, 0x57, 0x68, 0x65, 0x6e, 0x2e, 1270x74, 0x65, 0xb8, 0x01, 0x10, 0x57, 0x91, 0x00, 0x00, 0x2e,
1280x01, 0x01, 0x2a, 0x02, 0x91, 0x2d, 0x63, 0x6c, 0x69, 0x63, 1280x01, 0x00, 0x2a, 0x02, 0x60, 0x2d, 0x63, 0x6c, 0x69, 0x63,
1290x6b, 0x00, 0x6f, 0x72, 0x00, 0x02, 0x04, 0x0f, 0x00, 0x25, 1290x6b, 0x09, 0x02, 0x01, 0x00, 0x02, 0x03, 0x0f, 0x00, 0x25,
1300x69, 0x6e, 0xfd, 0x01, 0x13, 0x2c, 0x55, 0x02, 0x33, 0x67, 1300x69, 0x6e, 0xfd, 0x01, 0x13, 0x2c, 0x55, 0x02, 0x38, 0x67,
1310x61, 0x6c, 0x12, 0x00, 0x09, 0xde, 0x05, 0x10, 0x69, 0xf9, 1310x61, 0x6c, 0xc7, 0x05, 0x04, 0x6a, 0x01, 0x11, 0x69, 0x02,
1320x01, 0x03, 0x08, 0x01, 0x03, 0x3c, 0x04, 0x10, 0x2e, 0x1d, 1320x05, 0x04, 0x08, 0x01, 0x01, 0x3c, 0x04, 0x10, 0x2e, 0x1d,
1330x03, 0x07, 0x87, 0x05, 0x08, 0x75, 0x06, 0x02, 0xdd, 0x05, 1330x03, 0x07, 0x87, 0x05, 0x09, 0x75, 0x06, 0x01, 0xdd, 0x05,
1340x00, 0xcf, 0x00, 0x71, 0x66, 0x00, 0x62, 0x6c, 0x61, 0x63, 1340x00, 0xcf, 0x00, 0x72, 0x66, 0x00, 0x62, 0x6c, 0x61, 0x63,
1350x6b, 0x0c, 0x01, 0x02, 0x16, 0x04, 0x9a, 0x67, 0x72, 0x65, 1350x6b, 0x0c, 0x01, 0x01, 0x16, 0x04, 0x60, 0x67, 0x72, 0x65,
1360x79, 0x00, 0x6f, 0x6e, 0x63, 0x65, 0xcb, 0x01, 0x2e, 0x68, 1360x79, 0x00, 0x6f, 0x08, 0x05, 0x09, 0xcb, 0x01, 0x2e, 0x68,
1370x65, 0xc0, 0x02, 0x04, 0x85, 0x02, 0x58, 0x41, 0x6c, 0x73, 1370x65, 0xc0, 0x02, 0x04, 0x85, 0x02, 0x59, 0x41, 0x6c, 0x73,
1380x6f, 0x2c, 0x60, 0x00, 0x03, 0xa0, 0x05, 0x78, 0x6e, 0x65, 1380x6f, 0x2c, 0x60, 0x00, 0x02, 0xa0, 0x05, 0x40, 0x6e, 0x65,
1390x65, 0x64, 0x73, 0x00, 0x61, 0xb2, 0x02, 0x03, 0x6f, 0x02, 1390x65, 0x64, 0x5d, 0x02, 0x07, 0xb2, 0x02, 0x03, 0x6f, 0x02,
1400x20, 0x73, 0x6d, 0x2a, 0x01, 0x25, 0x64, 0x6f, 0x47, 0x03, 1400x20, 0x73, 0x6d, 0x2a, 0x01, 0x25, 0x64, 0x6f, 0x47, 0x03,
1410x62, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x36, 0x03, 0x64, 1410x62, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x36, 0x03, 0x64,
1420x63, 0x6f, 0x72, 0x6e, 0x65, 0x72, 0xe5, 0x05, 0x85, 0x76, 1420x63, 0x6f, 0x72, 0x6e, 0x65, 0x72, 0xe5, 0x05, 0x86, 0x76,
1430x61, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x73, 0x94, 0x00, 0x01, 1430x61, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x73, 0x94, 0x00, 0x00,
1440x88, 0x06, 0x0b, 0x16, 0x03, 0x60, 0x2e, 0x00, 0x53, 0x6f, 1440x88, 0x06, 0x0b, 0x16, 0x03, 0x60, 0x2e, 0x00, 0x53, 0x6f,
1450x00, 0x79, 0xfa, 0x06, 0x50, 0x61, 0x69, 0x6d, 0x00, 0x69, 1450x00, 0x79, 0xfa, 0x06, 0x50, 0x61, 0x69, 0x6d, 0x00, 0x69,
1460x1c, 0x07, 0x39, 0x77, 0x61, 0x79, 0x23, 0x01, 0x19, 0x61, 1460x1c, 0x07, 0x39, 0x77, 0x61, 0x79, 0x23, 0x01, 0x19, 0x61,
1470x80, 0x06, 0x12, 0x61, 0xf8, 0x00, 0x03, 0x1e, 0x01, 0x2c, 1470x80, 0x06, 0x12, 0x61, 0xf8, 0x00, 0x03, 0x1e, 0x01, 0x2d,
1480x74, 0x6f, 0x1f, 0x00, 0x00, 0x9c, 0x00, 0x12, 0x2e, 0x5f, 1480x74, 0x6f, 0x1f, 0x00, 0x42, 0x64, 0x6f, 0x74, 0x2e, 0x5f,
1490x04, 0x51, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x23, 0x06, 0x01, 1490x04, 0x52, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x23, 0x06, 0x00,
1500x7a, 0x00, 0x10, 0x73, 0x4d, 0x05, 0x00, 0xd5, 0x00, 0x00, 1500x7a, 0x00, 0x11, 0x73, 0x4d, 0x05, 0x30, 0x61, 0x00, 0x70,
1510x1f, 0x07, 0x55, 0x63, 0x75, 0x6c, 0x61, 0x72, 0xca, 0x07, 1510x1f, 0x07, 0x55, 0x63, 0x75, 0x6c, 0x61, 0x72, 0xca, 0x07,
1520xd2, 0x62, 0x6f, 0x74, 0x68, 0x00, 0x69, 0x6e, 0x63, 0x6f, 1520xa1, 0x62, 0x6f, 0x74, 0x68, 0x00, 0x69, 0x6e, 0x63, 0x6f,
1530x6d, 0x69, 0x6e, 0x67, 0x69, 0x03, 0x92, 0x75, 0x74, 0x67, 1530x6d, 0x38, 0x07, 0x00, 0x69, 0x03, 0x92, 0x75, 0x74, 0x67,
1540x6f, 0x69, 0x6e, 0x67, 0x29, 0x2c, 0xe7, 0x01, 0x10, 0x64, 1540x6f, 0x69, 0x6e, 0x67, 0x29, 0x2c, 0xe7, 0x01, 0x10, 0x64,
1550x24, 0x04, 0x10, 0x69, 0x68, 0x07, 0x01, 0x7e, 0x03, 0x01, 1550x24, 0x04, 0x10, 0x69, 0x68, 0x07, 0x02, 0x1c, 0x06, 0x00,
1560x1a, 0x08, 0x18, 0x2e, 0x65, 0x00, 0x00, 0x86, 0x05, 0x22, 1560x1a, 0x08, 0x18, 0x2e, 0x65, 0x00, 0x00, 0x86, 0x05, 0x22,
1570x6c, 0x65, 0x5e, 0x02, 0x11, 0x2c, 0x0d, 0x02, 0x02, 0x35, 1570x6c, 0x65, 0x5e, 0x02, 0x13, 0x2c, 0x0d, 0x02, 0x01, 0x35,
1580x00, 0x00, 0x7f, 0x00, 0x01, 0x68, 0x00, 0x04, 0x69, 0x06, 1580x00, 0x00, 0x7f, 0x00, 0x03, 0x68, 0x00, 0x03, 0x33, 0x01,
1590x03, 0x24, 0x00, 0x0a, 0x4a, 0x00, 0x02, 0x77, 0x08, 0x00, 1590x02, 0x82, 0x02, 0x0a, 0x4a, 0x00, 0x02, 0x77, 0x08, 0x00,
1600xd5, 0x06, 0x02, 0x19, 0x06, 0x03, 0x98, 0x02, 0x40, 0x00, 1600xd5, 0x06, 0x01, 0x19, 0x06, 0x03, 0x98, 0x02, 0x40, 0x00,
1610x63, 0x75, 0x72, 0x7c, 0x01, 0x22, 0x6b, 0x65, 0x13, 0x01, 1610x63, 0x75, 0x72, 0x7c, 0x01, 0x22, 0x6b, 0x65, 0x13, 0x01,
1620x02, 0x6b, 0x00, 0x54, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3c, 1620x02, 0x6b, 0x00, 0x55, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3c,
1630x00, 0x05, 0x9c, 0x03, 0x04, 0xea, 0x07, 0x94, 0x65, 0x73, 1630x00, 0x06, 0x56, 0x08, 0x02, 0xea, 0x07, 0x94, 0x65, 0x73,
1640x2e, 0x00, 0x50, 0x72, 0x65, 0x73, 0x73, 0x45, 0x07, 0x80, 1640x2e, 0x00, 0x50, 0x72, 0x65, 0x73, 0x73, 0x45, 0x07, 0x80,
1650x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x00, 0x6b, 0x70, 0x03, 1650x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x00, 0x6b, 0x70, 0x03,
1660x00, 0xbb, 0x02, 0x6b, 0x6f, 0x76, 0x65, 0x72, 0x00, 0x61, 1660x00, 0xbb, 0x02, 0x30, 0x6f, 0x76, 0x65, 0x07, 0x01, 0x0a,
1670x51, 0x02, 0x12, 0x61, 0x9d, 0x01, 0x50, 0x6f, 0x70, 0x65, 1670x51, 0x02, 0x12, 0x61, 0x9d, 0x01, 0x50, 0x6f, 0x70, 0x65,
1680x72, 0x61, 0xff, 0x05, 0x02, 0x58, 0x02, 0x1f, 0x70, 0x48, 1680x72, 0x61, 0xff, 0x05, 0x02, 0x58, 0x02, 0x1f, 0x70, 0x48,
1690x00, 0x04, 0x4b, 0x61, 0x67, 0x61, 0x69, 0x49, 0x00, 0x02, 1690x00, 0x04, 0x4c, 0x61, 0x67, 0x61, 0x69, 0x49, 0x00, 0x01,
1700xc4, 0x02, 0x51, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x36, 0x03, 1700xc4, 0x02, 0x20, 0x66, 0x69, 0xf4, 0x01, 0x02, 0xf3, 0x02,
1710x01, 0x50, 0x00, 0x40, 0x2c, 0x00, 0x69, 0x66, 0x5b, 0x03, 1710x70, 0x69, 0x6e, 0x6b, 0x2c, 0x00, 0x69, 0x66, 0x5b, 0x03,
1720x6b, 0x6f, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x98, 0x00, 0x9f, 1720x6b, 0x6f, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x98, 0x00, 0x9f,
1730x73, 0x70, 0x61, 0x63, 0x65, 0x00, 0x62, 0x61, 0x72, 0x49, 1730x73, 0x70, 0x61, 0x63, 0x65, 0x00, 0x62, 0x61, 0x72, 0x49,
1740x00, 0x00, 0x01, 0x0a, 0x03, 0x0d, 0xa8, 0x04, 0x11, 0x73, 1740x00, 0x01, 0x00, 0x0a, 0x03, 0x0d, 0xa8, 0x04, 0x12, 0x73,
1750x34, 0x08, 0x00, 0xec, 0x03, 0x02, 0x3d, 0x02, 0x01, 0xa5, 1750x34, 0x08, 0x01, 0x41, 0x00, 0x00, 0x3d, 0x02, 0x02, 0xa5,
1760x00, 0x02, 0x60, 0x00, 0x00, 0x44, 0x02, 0x07, 0x1f, 0x09, 1760x00, 0x01, 0x60, 0x00, 0x01, 0x60, 0x02, 0x06, 0x1f, 0x09,
1770x72, 0x62, 0x61, 0x63, 0x6b, 0x77, 0x61, 0x72, 0xfb, 0x08, 1770x72, 0x62, 0x61, 0x63, 0x6b, 0x77, 0x61, 0x72, 0xfb, 0x08,
1780x06, 0xcc, 0x00, 0x0e, 0x7c, 0x00, 0x03, 0xcb, 0x00, 0x10, 1780x0e, 0xcc, 0x00, 0x07, 0x7c, 0x00, 0x02, 0xcb, 0x00, 0x10,
1790x63, 0x40, 0x08, 0x21, 0x6c, 0x73, 0x6d, 0x05, 0x00, 0x8d, 1790x63, 0x40, 0x08, 0x21, 0x6c, 0x73, 0x6d, 0x05, 0x00, 0x8d,
1800x01, 0x42, 0x28, 0x41, 0x6c, 0x6c, 0x4d, 0x05, 0x01, 0x0d, 1800x01, 0x42, 0x28, 0x41, 0x6c, 0x6c, 0x4d, 0x05, 0x01, 0x0d,
1810x07, 0x92, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 1810x07, 0x92, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
1820x62, 0x46, 0x09, 0x13, 0x73, 0x23, 0x07, 0x30, 0x32, 0x2e, 1820x62, 0x46, 0x09, 0x13, 0x73, 0x23, 0x07, 0x32, 0x32, 0x2e,
1830x31, 0x5b, 0x06, 0x03, 0xcc, 0x07, 0x41, 0x76, 0x61, 0x69, 1830x31, 0x5b, 0x06, 0x01, 0xcc, 0x07, 0x41, 0x76, 0x61, 0x69,
1840x6c, 0xe7, 0x00, 0x12, 0x29, 0xf8, 0x06, 0x16, 0x32, 0xf8, 1840x6c, 0xe7, 0x00, 0x12, 0x29, 0xf8, 0x06, 0x16, 0x32, 0xf8,
1850x06, 0xb2, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 1850x06, 0xb2, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65,
1860x72, 0x73, 0x20, 0xdd, 0x03, 0x33, 0x73, 0x65, 0x00, 0x14, 1860x72, 0x73, 0x20, 0xdd, 0x03, 0x36, 0x73, 0x65, 0x00, 0x14,
1870x00, 0x03, 0x37, 0x08, 0x06, 0x3f, 0x00, 0x06, 0xc1, 0x08, 1870x00, 0x02, 0x44, 0x00, 0x04, 0x3f, 0x00, 0x06, 0xc1, 0x08,
1880xe2, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 1880xe2, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e,
1890x2e, 0x27, 0x00, 0x6f, 0x70, 0x9a, 0x08, 0x12, 0x6e, 0x1a, 1890x2e, 0x27, 0x00, 0x6f, 0x70, 0x9a, 0x08, 0x12, 0x6e, 0x1a,
1900x00, 0xa1, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 0x65, 1900x00, 0xa1, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 0x65,
1910x6e, 0x75, 0x92, 0x04, 0x80, 0x69, 0x64, 0x74, 0x68, 0x2c, 1910x6e, 0x75, 0x92, 0x04, 0x81, 0x69, 0x64, 0x74, 0x68, 0x2c,
1920x00, 0x48, 0x65, 0x76, 0x02, 0x01, 0xe7, 0x07, 0x10, 0x7a, 1920x00, 0x48, 0x65, 0x83, 0x06, 0x00, 0xe7, 0x07, 0x11, 0x7a,
1930x27, 0x06, 0x02, 0x1f, 0x02, 0x23, 0x69, 0x6e, 0x3e, 0x01, 1930x27, 0x06, 0x01, 0x1f, 0x02, 0x24, 0x69, 0x6e, 0x3e, 0x01,
1940x01, 0xd9, 0x00, 0x61, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x20, 1940x00, 0x2b, 0x00, 0x61, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x20,
1950xf5, 0x01, 0x82, 0x2f, 0x65, 0x6e, 0x64, 0x20, 0x74, 0x6f, 1950xf5, 0x01, 0x82, 0x2f, 0x65, 0x6e, 0x64, 0x20, 0x74, 0x6f,
1960x20, 0xb6, 0x03, 0x12, 0x73, 0x92, 0x06, 0x31, 0x74, 0x72, 1960x20, 0xb6, 0x03, 0x12, 0x73, 0x92, 0x06, 0x33, 0x74, 0x72,
1970x75, 0xb3, 0x04, 0x02, 0x19, 0x02, 0x02, 0xe3, 0x08, 0x27, 1970x75, 0xb3, 0x04, 0x01, 0x24, 0x00, 0x01, 0x3a, 0x01, 0x27,
1980x65, 0x6e, 0x65, 0x02, 0x23, 0x72, 0x65, 0xa3, 0x03, 0x00, 1980x65, 0x6e, 0x65, 0x02, 0x24, 0x72, 0x65, 0xa3, 0x03, 0x42,
1990xbe, 0x07, 0x12, 0x63, 0x10, 0x01, 0x94, 0x6f, 0x70, 0x70, 1990x70, 0x6c, 0x61, 0x63, 0x10, 0x01, 0x94, 0x6f, 0x70, 0x70,
2000x6f, 0x73, 0x69, 0x74, 0x65, 0x00, 0x4b, 0x00, 0x15, 0x28, 2000x6f, 0x73, 0x69, 0x74, 0x65, 0x00, 0x4b, 0x00, 0x17, 0x28,
2010x41, 0x00, 0x04, 0xdc, 0x08, 0x31, 0x74, 0x6f, 0x70, 0x49, 2010x41, 0x00, 0x02, 0x83, 0x04, 0x31, 0x74, 0x6f, 0x70, 0x49,
2020x03, 0x05, 0xd4, 0x05, 0x01, 0x56, 0x00, 0x27, 0x61, 0x74, 2020x03, 0x05, 0xd4, 0x05, 0x01, 0x56, 0x00, 0x28, 0x61, 0x74,
2030x44, 0x04, 0x02, 0x35, 0x03, 0x11, 0x29, 0x8d, 0x06, 0x5f, 2030x44, 0x04, 0x01, 0x35, 0x03, 0x11, 0x29, 0x8d, 0x06, 0x5f,
2040x66, 0x61, 0x6c, 0x73, 0x65, 0x87, 0x00, 0x0b, 0x04, 0x80, 2040x66, 0x61, 0x6c, 0x73, 0x65, 0x87, 0x00, 0x0c, 0x03, 0x80,
2050x00, 0xf4, 0x03, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x6c, 2050x00, 0xf4, 0x03, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x6c,
2060x79, 0x00, 0x28, 0x61, 0x6c, 0x74, 0x68, 0x6f, 0x75, 0x67, 2060x79, 0x00, 0x28, 0x61, 0x6c, 0x74, 0x68, 0x6f, 0x75, 0x67,
2070x68, 0xa1, 0x00, 0x01, 0xd6, 0x03, 0x80, 0x73, 0x68, 0x6f, 2070x68, 0xa1, 0x00, 0x01, 0xd6, 0x03, 0x80, 0x73, 0x68, 0x6f,
diff --git a/apps/plugins/puzzles/help/singles.c b/apps/plugins/puzzles/help/singles.c
index 66978cd67d..dffc14b35b 100644
--- a/apps/plugins/puzzles/help/singles.c
+++ b/apps/plugins/puzzles/help/singles.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -14,7 +14,7 @@ struct style_text help_text_style[] = {
14 LAST_STYLE_ITEM 14 LAST_STYLE_ITEM
15}; 15};
16 16
17/* orig 1392 comp 1054 ratio 0.757184 level 11 saved 338 */ 17/* orig 1392 comp 1052 ratio 0.755747 level 10 saved 340 */
18const char help_text[] = { 18const char help_text[] = {
190xf3, 0x2d, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 190xf3, 0x2d, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
200x33, 0x32, 0x3a, 0x20, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 200x33, 0x32, 0x3a, 0x20, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65,
@@ -27,27 +27,27 @@ const char help_text[] = {
270x62, 0x65, 0x72, 0x73, 0x2e, 0x40, 0x00, 0xf0, 0x01, 0x72, 270x62, 0x65, 0x72, 0x73, 0x2e, 0x40, 0x00, 0xf0, 0x01, 0x72,
280x00, 0x74, 0x61, 0x73, 0x6b, 0x00, 0x69, 0x73, 0x00, 0x74, 280x00, 0x74, 0x61, 0x73, 0x6b, 0x00, 0x69, 0x73, 0x00, 0x74,
290x6f, 0x00, 0x63, 0x6f, 0x6c, 0x12, 0x00, 0x40, 0x73, 0x6f, 290x6f, 0x00, 0x63, 0x6f, 0x6c, 0x12, 0x00, 0x40, 0x73, 0x6f,
300x6d, 0x65, 0x36, 0x00, 0x25, 0x74, 0x68, 0x4a, 0x00, 0xf0, 300x6d, 0x65, 0x36, 0x00, 0x25, 0x74, 0x68, 0x4a, 0x00, 0xf1,
310x01, 0x00, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x00, 0x28, 0x72, 310x01, 0x00, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x00, 0x28, 0x72,
320x65, 0x6d, 0x6f, 0x76, 0x69, 0x6e, 0x67, 0x1c, 0x00, 0x03, 320x65, 0x6d, 0x6f, 0x76, 0x69, 0x6e, 0x67, 0x1c, 0x00, 0x02,
330x48, 0x00, 0x61, 0x29, 0x00, 0x73, 0x6f, 0x00, 0x61, 0x40, 330x48, 0x00, 0x61, 0x29, 0x00, 0x73, 0x6f, 0x00, 0x61, 0x40,
340x00, 0x70, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x79, 0x76, 340x00, 0x74, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x79, 0x76,
350x00, 0x04, 0x40, 0x00, 0x90, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 350x00, 0x00, 0x24, 0x00, 0x60, 0x66, 0x6f, 0x6c, 0x6c, 0x6f,
360x77, 0x69, 0x6e, 0x67, 0x7e, 0x00, 0xf3, 0x00, 0x64, 0x69, 360x77, 0x32, 0x00, 0xf3, 0x03, 0x63, 0x6f, 0x6e, 0x64, 0x69,
370x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x00, 0x00, 0x00, 0x2d, 370x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x00, 0x00, 0x00, 0x2d,
380x00, 0x4e, 0x6f, 0x41, 0x00, 0xf0, 0x15, 0x00, 0x6f, 0x63, 380x00, 0x4e, 0x6f, 0x41, 0x00, 0xf0, 0x15, 0x00, 0x6f, 0x63,
390x63, 0x75, 0x72, 0x73, 0x00, 0x6d, 0x6f, 0x72, 0x65, 0x00, 390x63, 0x75, 0x72, 0x73, 0x00, 0x6d, 0x6f, 0x72, 0x65, 0x00,
400x74, 0x68, 0x61, 0x6e, 0x00, 0x6f, 0x6e, 0x63, 0x65, 0x00, 400x74, 0x68, 0x61, 0x6e, 0x00, 0x6f, 0x6e, 0x63, 0x65, 0x00,
410x69, 0x6e, 0x00, 0x61, 0x6e, 0x79, 0x00, 0x72, 0x6f, 0x77, 410x69, 0x6e, 0x00, 0x61, 0x6e, 0x79, 0x00, 0x72, 0x6f, 0x77,
420x00, 0x6f, 0x72, 0x9b, 0x00, 0x43, 0x75, 0x6d, 0x6e, 0x2e, 420x00, 0x6f, 0x72, 0x9b, 0x00, 0x44, 0x75, 0x6d, 0x6e, 0x2e,
430x3a, 0x00, 0x02, 0x8f, 0x00, 0x03, 0x9d, 0x00, 0x00, 0xbd, 430x3a, 0x00, 0x02, 0x8f, 0x00, 0x02, 0x9d, 0x00, 0x00, 0xbd,
440x00, 0x50, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0xdf, 0x00, 0x30, 440x00, 0x50, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0xdf, 0x00, 0x30,
450x6c, 0x6c, 0x79, 0x2f, 0x00, 0x61, 0x76, 0x65, 0x72, 0x74, 450x6c, 0x6c, 0x79, 0x2f, 0x00, 0x61, 0x76, 0x65, 0x72, 0x74,
460x69, 0x63, 0x0e, 0x00, 0xb1, 0x61, 0x64, 0x6a, 0x61, 0x63, 460x69, 0x63, 0x0e, 0x00, 0x80, 0x61, 0x64, 0x6a, 0x61, 0x63,
470x65, 0x6e, 0x74, 0x00, 0x74, 0x6f, 0x51, 0x00, 0x59, 0x6f, 470x65, 0x6e, 0x74, 0xa1, 0x00, 0x00, 0x51, 0x00, 0x59, 0x6f,
480x74, 0x68, 0x65, 0x72, 0x41, 0x00, 0x02, 0x56, 0x00, 0xda, 480x74, 0x68, 0x65, 0x72, 0x41, 0x00, 0x02, 0x56, 0x00, 0xa0,
490x54, 0x68, 0x65, 0x00, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 490x54, 0x68, 0x65, 0x00, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e,
500x69, 0x6e, 0x67, 0x48, 0x01, 0x51, 0x00, 0x6d, 0x75, 0x73, 500xae, 0x00, 0x09, 0x48, 0x01, 0x51, 0x00, 0x6d, 0x75, 0x73,
510x74, 0xd6, 0x00, 0x81, 0x66, 0x6f, 0x72, 0x6d, 0x00, 0x6f, 510x74, 0xd6, 0x00, 0x81, 0x66, 0x6f, 0x72, 0x6d, 0x00, 0x6f,
520x6e, 0x65, 0x4c, 0x01, 0xf0, 0x10, 0x69, 0x67, 0x75, 0x6f, 520x6e, 0x65, 0x4c, 0x01, 0xf0, 0x10, 0x69, 0x67, 0x75, 0x6f,
530x75, 0x73, 0x00, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x00, 530x75, 0x73, 0x00, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x00,
@@ -63,8 +63,8 @@ const char help_text[] = {
630x5d, 0x00, 0x77, 0x68, 0x6f, 0x00, 0x63, 0x85, 0x00, 0x90, 630x5d, 0x00, 0x77, 0x68, 0x6f, 0x00, 0x63, 0x85, 0x00, 0x90,
640x69, 0x74, 0x00, 0x48, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x41, 640x69, 0x74, 0x00, 0x48, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x41,
650x00, 0x03, 0x0f, 0x02, 0x41, 0x00, 0x77, 0x61, 0x73, 0x95, 650x00, 0x03, 0x0f, 0x02, 0x41, 0x00, 0x77, 0x61, 0x73, 0x95,
660x00, 0x40, 0x72, 0x69, 0x62, 0x75, 0x84, 0x00, 0x21, 0x74, 660x00, 0x40, 0x72, 0x69, 0x62, 0x75, 0x84, 0x00, 0x22, 0x74,
670x6f, 0x51, 0x00, 0x00, 0x39, 0x01, 0x30, 0x6c, 0x65, 0x63, 670x6f, 0x51, 0x00, 0x60, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63,
680x78, 0x01, 0x00, 0x97, 0x00, 0xc0, 0x4a, 0x61, 0x6d, 0x65, 680x78, 0x01, 0x00, 0x97, 0x00, 0xc0, 0x4a, 0x61, 0x6d, 0x65,
690x73, 0x00, 0x48, 0x61, 0x72, 0x76, 0x65, 0x79, 0x3e, 0x00, 690x73, 0x00, 0x48, 0x61, 0x72, 0x76, 0x65, 0x79, 0x3e, 0x00,
700x01, 0x59, 0x00, 0xc1, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 700x01, 0x59, 0x00, 0xc1, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
@@ -78,50 +78,50 @@ const char help_text[] = {
780x6c, 0x69, 0x63, 0x6b, 0xfb, 0x00, 0x10, 0x6f, 0xd2, 0x01, 780x6c, 0x69, 0x63, 0x6b, 0xfb, 0x00, 0x10, 0x6f, 0xd2, 0x01,
790x64, 0x00, 0x65, 0x6d, 0x70, 0x74, 0x79, 0xbb, 0x01, 0x44, 790x64, 0x00, 0x65, 0x6d, 0x70, 0x74, 0x79, 0xbb, 0x01, 0x44,
800x77, 0x69, 0x6c, 0x6c, 0x77, 0x02, 0x22, 0x69, 0x74, 0x96, 800x77, 0x69, 0x6c, 0x6c, 0x77, 0x02, 0x22, 0x69, 0x74, 0x96,
810x01, 0x39, 0x3b, 0x00, 0x6c, 0x37, 0x00, 0x52, 0x61, 0x67, 810x01, 0x39, 0x3b, 0x00, 0x6c, 0x37, 0x00, 0x20, 0x61, 0x67,
820x61, 0x69, 0x6e, 0x2a, 0x00, 0x77, 0x72, 0x65, 0x73, 0x74, 820xb5, 0x02, 0x01, 0x2a, 0x00, 0x42, 0x72, 0x65, 0x73, 0x74,
830x6f, 0x72, 0x65, 0x7e, 0x02, 0x66, 0x2e, 0x00, 0x52, 0x69, 830x26, 0x02, 0x04, 0x7e, 0x02, 0x67, 0x2e, 0x00, 0x52, 0x69,
840x67, 0x68, 0x2e, 0x00, 0x02, 0x28, 0x00, 0xf1, 0x05, 0x61, 840x67, 0x68, 0x2e, 0x00, 0x01, 0x28, 0x00, 0xf1, 0x05, 0x61,
850x64, 0x64, 0x00, 0x61, 0x00, 0x63, 0x69, 0x72, 0x63, 0x6c, 850x64, 0x64, 0x00, 0x61, 0x00, 0x63, 0x69, 0x72, 0x63, 0x6c,
860x65, 0x00, 0x28, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x64, 860x65, 0x00, 0x28, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x64,
870x01, 0x72, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0xc2, 870x01, 0x72, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0xc2,
880x02, 0x20, 0x61, 0x74, 0x25, 0x00, 0x30, 0x65, 0x6c, 0x6c, 880x02, 0x20, 0x61, 0x74, 0x25, 0x00, 0x30, 0x65, 0x6c, 0x6c,
890x42, 0x02, 0xd3, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 890x42, 0x02, 0xa1, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74,
900x65, 0x6c, 0x79, 0x00, 0x6e, 0x6f, 0x8a, 0x00, 0x23, 0x29, 900x65, 0x6c, 0x79, 0xb5, 0x01, 0x01, 0x8a, 0x00, 0x23, 0x29,
910x2e, 0x65, 0x03, 0xb2, 0x63, 0x61, 0x6e, 0x00, 0x61, 0x6c, 910x2e, 0x65, 0x03, 0xb2, 0x63, 0x61, 0x6e, 0x00, 0x61, 0x6c,
920x73, 0x6f, 0x00, 0x75, 0x73, 0x7d, 0x00, 0x00, 0xb1, 0x02, 920x73, 0x6f, 0x00, 0x75, 0x73, 0x7d, 0x00, 0x00, 0xb1, 0x02,
930x61, 0x6f, 0x72, 0x00, 0x6b, 0x65, 0x79, 0xa7, 0x01, 0x20, 930x61, 0x6f, 0x72, 0x00, 0x6b, 0x65, 0x79, 0xa7, 0x01, 0x20,
940x6d, 0x6f, 0x85, 0x03, 0x50, 0x72, 0x6f, 0x75, 0x6e, 0x64, 940x6d, 0x6f, 0x85, 0x03, 0x51, 0x72, 0x6f, 0x75, 0x6e, 0x64,
950x1f, 0x00, 0x01, 0x8e, 0x03, 0x74, 0x2e, 0x00, 0x50, 0x72, 950x1f, 0x00, 0x00, 0x8e, 0x03, 0x74, 0x2e, 0x00, 0x50, 0x72,
960x65, 0x73, 0x73, 0x2d, 0x03, 0x60, 0x72, 0x65, 0x74, 0x75, 960x65, 0x73, 0x73, 0x2d, 0x03, 0x60, 0x72, 0x65, 0x74, 0x75,
970x72, 0x6e, 0x9c, 0x02, 0x51, 0x73, 0x70, 0x61, 0x63, 0x65, 970x72, 0x6e, 0x9c, 0x02, 0x52, 0x73, 0x70, 0x61, 0x63, 0x65,
980x3b, 0x00, 0x02, 0xad, 0x00, 0x01, 0x18, 0x00, 0x13, 0x61, 980x3b, 0x00, 0x01, 0xad, 0x00, 0x01, 0x18, 0x00, 0x14, 0x61,
990x12, 0x01, 0x03, 0x99, 0x02, 0x29, 0x6f, 0x72, 0xc4, 0x00, 990x12, 0x01, 0x02, 0x99, 0x02, 0x2a, 0x6f, 0x72, 0xc4, 0x00,
1000x00, 0xf9, 0x00, 0x10, 0x70, 0xc6, 0x01, 0xb6, 0x76, 0x65, 1000x40, 0x72, 0x65, 0x73, 0x70, 0xc6, 0x01, 0xb8, 0x76, 0x65,
1010x6c, 0x79, 0x2c, 0x00, 0x61, 0x6e, 0x64, 0x00, 0x70, 0x5d, 1010x6c, 0x79, 0x2c, 0x00, 0x61, 0x6e, 0x64, 0x00, 0x70, 0x5d,
1020x00, 0x01, 0x4d, 0x00, 0x0f, 0x27, 0x01, 0x0b, 0x00, 0x51, 1020x00, 0x3f, 0x6b, 0x65, 0x79, 0x27, 0x01, 0x0b, 0x00, 0x51,
1030x00, 0x01, 0xbc, 0x03, 0x01, 0x15, 0x00, 0x02, 0x56, 0x00, 1030x00, 0x01, 0xbc, 0x03, 0x03, 0xbf, 0x00, 0x01, 0x56, 0x00,
1040x01, 0xf8, 0x02, 0x41, 0x28, 0x41, 0x6c, 0x6c, 0x13, 0x00, 1040x00, 0xde, 0x00, 0x41, 0x28, 0x41, 0x6c, 0x6c, 0x13, 0x00,
1050x11, 0x61, 0x24, 0x02, 0x00, 0x08, 0x01, 0x70, 0x73, 0x63, 1050x11, 0x61, 0x24, 0x02, 0x00, 0x08, 0x01, 0x70, 0x73, 0x63,
1060x72, 0x69, 0x62, 0x65, 0x64, 0x81, 0x03, 0x13, 0x73, 0x3a, 1060x72, 0x69, 0x62, 0x65, 0x64, 0x81, 0x03, 0x13, 0x73, 0x3a,
1070x02, 0x72, 0x32, 0x2e, 0x31, 0x00, 0x61, 0x72, 0x65, 0x04, 1070x02, 0x40, 0x32, 0x2e, 0x31, 0x00, 0x9d, 0x00, 0x01, 0x04,
1080x01, 0xa3, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 1080x01, 0xa3, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c,
1090x65, 0x2e, 0xfc, 0x01, 0x15, 0x32, 0xfc, 0x01, 0x90, 0x70, 1090x65, 0x2e, 0xfc, 0x01, 0x15, 0x32, 0xfc, 0x01, 0x91, 0x70,
1100x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0xfe, 0x01, 1100x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0xfe, 0x01,
1110x00, 0x52, 0x03, 0x36, 0x73, 0x65, 0x00, 0x14, 0x00, 0x00, 1110x66, 0x54, 0x68, 0x65, 0x73, 0x65, 0x00, 0x14, 0x00, 0x02,
1120x43, 0x00, 0x06, 0x3e, 0x00, 0x51, 0x00, 0x66, 0x72, 0x6f, 1120x43, 0x00, 0x04, 0x3e, 0x00, 0x51, 0x00, 0x66, 0x72, 0x6f,
1130x6d, 0x7b, 0x00, 0xe1, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 1130x6d, 0x7b, 0x00, 0xe1, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f,
1140x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x71, 0x00, 1140x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x71, 0x00,
1150x22, 0x6f, 0x6e, 0x1a, 0x00, 0xa0, 0x54, 0x79, 0x70, 0x65, 1150x22, 0x6f, 0x6e, 0x1a, 0x00, 0xa0, 0x54, 0x79, 0x70, 0x65,
1160x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0xad, 0x00, 0x90, 0x57, 1160x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0xad, 0x00, 0x90, 0x57,
1170x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 0x48, 0x65, 0xf3, 0x01, 1170x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 0x48, 0x65, 0xf3, 0x01,
1180x01, 0xfc, 0x02, 0x10, 0x7a, 0x89, 0x02, 0x02, 0xfd, 0x04, 1180x01, 0xfc, 0x02, 0x11, 0x7a, 0x89, 0x02, 0x01, 0xfd, 0x04,
1190x24, 0x69, 0x6e, 0xaf, 0x03, 0x00, 0x2b, 0x00, 0xa0, 0x44, 1190x24, 0x69, 0x6e, 0xaf, 0x03, 0x00, 0x2b, 0x00, 0xa0, 0x44,
1200x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x65, 1200x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x65,
1210x03, 0x03, 0x93, 0x02, 0x01, 0x54, 0x00, 0x15, 0x64, 0x1a, 1210x03, 0x03, 0x93, 0x02, 0x01, 0x54, 0x00, 0x16, 0x64, 0x1a,
1220x00, 0x04, 0xa4, 0x04, 0xf0, 0x03, 0x67, 0x65, 0x6e, 0x65, 1220x00, 0x03, 0xa4, 0x04, 0x60, 0x67, 0x65, 0x6e, 0x65, 0x72,
1230x72, 0x61, 0x74, 0x65, 0x64, 0x00, 0x70, 0x75, 0x7a, 0x7a, 1230x61, 0x35, 0x03, 0x80, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65,
1240x6c, 0x65, 0x2e, 0x00, 1240x2e, 0x00,
125}; 125};
126 126
127const unsigned short help_text_len = 1392; 127const unsigned short help_text_len = 1392;
diff --git a/apps/plugins/puzzles/help/sixteen.c b/apps/plugins/puzzles/help/sixteen.c
index 8e3dfdba2a..eb8feed049 100644
--- a/apps/plugins/puzzles/help/sixteen.c
+++ b/apps/plugins/puzzles/help/sixteen.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -14,7 +14,7 @@ struct style_text help_text_style[] = {
14 LAST_STYLE_ITEM 14 LAST_STYLE_ITEM
15}; 15};
16 16
17/* orig 2534 comp 1754 ratio 0.692186 level 11 saved 780 */ 17/* orig 2534 comp 1755 ratio 0.692581 level 6 saved 779 */
18const char help_text[] = { 18const char help_text[] = {
190xf0, 0x3b, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 190xf0, 0x3b, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
200x36, 0x3a, 0x20, 0x53, 0x69, 0x78, 0x74, 0x65, 0x65, 0x6e, 200x36, 0x3a, 0x20, 0x53, 0x69, 0x78, 0x74, 0x65, 0x65, 0x6e,
@@ -36,22 +36,22 @@ const char help_text[] = {
360x65, 0x73, 0x00, 0x6f, 0x6e, 0x24, 0x00, 0xf4, 0x07, 0x00, 360x65, 0x73, 0x00, 0x6f, 0x6e, 0x24, 0x00, 0xf4, 0x07, 0x00,
370x67, 0x72, 0x69, 0x64, 0x00, 0x63, 0x6f, 0x6e, 0x74, 0x61, 370x67, 0x72, 0x69, 0x64, 0x00, 0x63, 0x6f, 0x6e, 0x74, 0x61,
380x69, 0x6e, 0x00, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x65, 380x69, 0x6e, 0x00, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x65,
390x64, 0x25, 0x00, 0x60, 0x2e, 0x00, 0x59, 0x6f, 0x75, 0x72, 390x64, 0x25, 0x00, 0x61, 0x2e, 0x00, 0x59, 0x6f, 0x75, 0x72,
400x5d, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x9d, 0x00, 0xfd, 0x16, 400x5d, 0x00, 0x00, 0x4b, 0x00, 0xf0, 0x16, 0x74, 0x6f, 0x00,
410x73, 0x68, 0x69, 0x66, 0x74, 0x00, 0x61, 0x6e, 0x00, 0x65, 410x73, 0x68, 0x69, 0x66, 0x74, 0x00, 0x61, 0x6e, 0x00, 0x65,
420x6e, 0x74, 0x69, 0x72, 0x65, 0x00, 0x72, 0x6f, 0x77, 0x00, 420x6e, 0x74, 0x69, 0x72, 0x65, 0x00, 0x72, 0x6f, 0x77, 0x00,
430x6c, 0x65, 0x66, 0x74, 0x00, 0x6f, 0x72, 0x00, 0x72, 0x69, 430x6c, 0x65, 0x66, 0x74, 0x00, 0x6f, 0x72, 0x00, 0x72, 0x69,
440x67, 0x68, 0x74, 0x2c, 0x00, 0x6f, 0x72, 0x26, 0x00, 0x90, 440x67, 0x68, 0x74, 0x2c, 0x0a, 0x00, 0x0c, 0x26, 0x00, 0x90,
450x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x00, 0x75, 0x70, 0x1d, 450x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x00, 0x75, 0x70, 0x1d,
460x00, 0xb1, 0x64, 0x6f, 0x77, 0x6e, 0x3b, 0x00, 0x65, 0x76, 460x00, 0xb1, 0x64, 0x6f, 0x77, 0x6e, 0x3b, 0x00, 0x65, 0x76,
470x65, 0x72, 0x79, 0xac, 0x00, 0xc1, 0x00, 0x79, 0x6f, 0x75, 470x65, 0x72, 0x79, 0xac, 0x00, 0xc1, 0x00, 0x79, 0x6f, 0x75,
480x00, 0x64, 0x6f, 0x00, 0x74, 0x68, 0x61, 0x74, 0xb8, 0x00, 480x00, 0x64, 0x6f, 0x00, 0x74, 0x68, 0x61, 0x74, 0xb8, 0x00,
490x00, 0x23, 0x01, 0x01, 0x16, 0x00, 0x03, 0x48, 0x00, 0x36, 490x02, 0x23, 0x01, 0x00, 0x16, 0x00, 0x02, 0x48, 0x00, 0x36,
500x6f, 0x66, 0x66, 0xab, 0x00, 0xd1, 0x72, 0x65, 0x2d, 0x61, 500x6f, 0x66, 0x66, 0xab, 0x00, 0xd1, 0x72, 0x65, 0x2d, 0x61,
510x70, 0x70, 0x65, 0x61, 0x72, 0x73, 0x00, 0x61, 0x74, 0x17, 510x70, 0x70, 0x65, 0x61, 0x72, 0x73, 0x00, 0x61, 0x74, 0x17,
520x00, 0x02, 0x5f, 0x01, 0x52, 0x65, 0x6e, 0x64, 0x00, 0x6f, 520x00, 0x02, 0x5f, 0x01, 0x52, 0x65, 0x6e, 0x64, 0x00, 0x6f,
530x28, 0x00, 0x31, 0x73, 0x61, 0x6d, 0x99, 0x00, 0x42, 0x2c, 530x28, 0x00, 0x31, 0x73, 0x61, 0x6d, 0x99, 0x00, 0x32, 0x2c,
540x00, 0x69, 0x6e, 0x11, 0x00, 0x32, 0x70, 0x61, 0x63, 0x51, 540x00, 0x69, 0xe4, 0x00, 0x42, 0x73, 0x70, 0x61, 0x63, 0x51,
550x00, 0xf5, 0x0e, 0x6a, 0x75, 0x73, 0x74, 0x00, 0x76, 0x61, 550x00, 0xf5, 0x0e, 0x6a, 0x75, 0x73, 0x74, 0x00, 0x76, 0x61,
560x63, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x00, 0x54, 0x6f, 0x00, 560x63, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x00, 0x54, 0x6f, 0x00,
570x77, 0x69, 0x6e, 0x2c, 0x00, 0x61, 0x72, 0x72, 0x61, 0x6e, 570x77, 0x69, 0x6e, 0x2c, 0x00, 0x61, 0x72, 0x72, 0x61, 0x6e,
@@ -83,115 +83,115 @@ const char help_text[] = {
830x65, 0x65, 0x6e, 0x73, 0x61, 0x76, 0x65, 0x72, 0x00, 0x49, 830x65, 0x65, 0x6e, 0x73, 0x61, 0x76, 0x65, 0x72, 0x00, 0x49,
840x27, 0x64, 0x00, 0x73, 0x65, 0x65, 0x6e, 0x2c, 0xab, 0x02, 840x27, 0x64, 0x00, 0x73, 0x65, 0x65, 0x6e, 0x2c, 0xab, 0x02,
850x12, 0x49, 0x59, 0x00, 0x61, 0x61, 0x00, 0x66, 0x65, 0x65, 850x12, 0x49, 0x59, 0x00, 0x61, 0x61, 0x00, 0x66, 0x65, 0x65,
860x6c, 0xf9, 0x02, 0x12, 0x68, 0xb1, 0x01, 0x08, 0x34, 0x00, 860x6c, 0xf9, 0x02, 0x13, 0x68, 0xb1, 0x01, 0x08, 0x34, 0x00,
870x03, 0xdc, 0x00, 0x31, 0x61, 0x63, 0x74, 0x07, 0x03, 0x02, 870x02, 0xdc, 0x00, 0x32, 0x61, 0x63, 0x74, 0x07, 0x03, 0x01,
880x33, 0x00, 0x10, 0x62, 0xfe, 0x02, 0x14, 0x61, 0x08, 0x03, 880x33, 0x00, 0x10, 0x62, 0xfe, 0x02, 0x14, 0x61, 0x08, 0x03,
890x44, 0x2d, 0x74, 0x79, 0x70, 0x31, 0x03, 0x30, 0x00, 0x72, 890x11, 0x2d, 0xe3, 0x02, 0x02, 0x31, 0x03, 0x31, 0x00, 0x72,
900x61, 0xba, 0x00, 0x00, 0x4b, 0x00, 0x12, 0x6e, 0x03, 0x01, 900x61, 0xba, 0x00, 0x42, 0x74, 0x68, 0x61, 0x6e, 0x03, 0x01,
910x20, 0x73, 0x6c, 0x41, 0x00, 0x27, 0x6c, 0x79, 0x42, 0x01, 910x20, 0x73, 0x6c, 0x41, 0x00, 0x27, 0x6c, 0x79, 0x42, 0x01,
920x81, 0x6b, 0x69, 0x6e, 0x64, 0x2e, 0x00, 0x53, 0x6f, 0x21, 920x82, 0x6b, 0x69, 0x6e, 0x64, 0x2e, 0x00, 0x53, 0x6f, 0x21,
930x00, 0x03, 0x61, 0x00, 0x12, 0x62, 0xdd, 0x01, 0x02, 0x80, 930x00, 0x02, 0x61, 0x00, 0x12, 0x62, 0xdd, 0x01, 0x02, 0x80,
940x01, 0x30, 0x69, 0x6e, 0x67, 0x1a, 0x02, 0x22, 0x6d, 0x79, 940x01, 0x00, 0x8d, 0x00, 0x54, 0x69, 0x6e, 0x00, 0x6d, 0x79,
950x56, 0x00, 0x01, 0x9f, 0x02, 0xf2, 0x16, 0x6c, 0x65, 0x63, 950x56, 0x00, 0xf2, 0x19, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63,
960x74, 0x69, 0x6f, 0x6e, 0x00, 0x77, 0x68, 0x69, 0x63, 0x68, 960x74, 0x69, 0x6f, 0x6e, 0x00, 0x77, 0x68, 0x69, 0x63, 0x68,
970x00, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 970x00, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74,
980x73, 0x00, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x76, 0x69, 980x73, 0x00, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x76, 0x69,
990x74, 0x79, 0x00, 0x6f, 0x34, 0x00, 0x38, 0x61, 0x72, 0x74, 990x74, 0x79, 0x00, 0x6f, 0x34, 0x00, 0x39, 0x61, 0x72, 0x74,
1000x88, 0x00, 0x02, 0x54, 0x02, 0xb0, 0x65, 0x6e, 0x67, 0x69, 1000x88, 0x00, 0x01, 0x54, 0x02, 0xb0, 0x65, 0x6e, 0x67, 0x69,
1010x6e, 0x65, 0x65, 0x72, 0x69, 0x6e, 0x67, 0xb5, 0x01, 0x35, 1010x6e, 0x65, 0x65, 0x72, 0x69, 0x6e, 0x67, 0xb5, 0x01, 0x35,
1020x36, 0x2e, 0x31, 0x04, 0x04, 0x00, 0x5d, 0x03, 0x40, 0x72, 1020x36, 0x2e, 0x31, 0x04, 0x04, 0x00, 0x5d, 0x03, 0x40, 0x72,
1030x6f, 0x6c, 0x73, 0x0d, 0x04, 0xa2, 0x4c, 0x65, 0x66, 0x74, 1030x6f, 0x6c, 0x73, 0x0d, 0x04, 0xa3, 0x4c, 0x65, 0x66, 0x74,
1040x2d, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0xf9, 0x01, 0x00, 0x24, 1040x2d, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0xf9, 0x01, 0x20, 0x61,
1050x03, 0x20, 0x61, 0x72, 0x45, 0x03, 0x40, 0x77, 0x69, 0x6c, 1050x6e, 0x7e, 0x02, 0x72, 0x6f, 0x77, 0x00, 0x77, 0x69, 0x6c,
1060x6c, 0x69, 0x03, 0x02, 0xa9, 0x00, 0xa2, 0x61, 0x70, 0x70, 1060x6c, 0x69, 0x03, 0x00, 0xa9, 0x00, 0xa2, 0x61, 0x70, 0x70,
1070x72, 0x6f, 0x70, 0x72, 0x69, 0x61, 0x74, 0x63, 0x03, 0x23, 1070x72, 0x6f, 0x70, 0x72, 0x69, 0x61, 0x74, 0x63, 0x03, 0x24,
1080x6f, 0x72, 0x44, 0x03, 0x04, 0xd3, 0x02, 0x32, 0x64, 0x69, 1080x6f, 0x72, 0x44, 0x03, 0x03, 0xd3, 0x02, 0x33, 0x64, 0x69,
1090x72, 0xb2, 0x00, 0x00, 0xba, 0x01, 0x13, 0x69, 0xd0, 0x02, 1090x72, 0xb2, 0x00, 0x43, 0x69, 0x6e, 0x64, 0x69, 0xd0, 0x02,
1100x46, 0x52, 0x69, 0x67, 0x68, 0x5f, 0x00, 0x07, 0x53, 0x00, 1100x10, 0x52, 0xec, 0x00, 0x06, 0x5f, 0x00, 0x06, 0x53, 0x00,
1110x24, 0x69, 0x74, 0x38, 0x00, 0x77, 0x6f, 0x70, 0x70, 0x6f, 1110x24, 0x69, 0x74, 0x38, 0x00, 0x77, 0x6f, 0x70, 0x70, 0x6f,
1120x73, 0x69, 0x74, 0x41, 0x00, 0x10, 0x2e, 0xa4, 0x04, 0x50, 1120x73, 0x69, 0x74, 0x41, 0x00, 0x00, 0xaf, 0x00, 0x60, 0x41,
1130x6c, 0x74, 0x65, 0x72, 0x6e, 0xe8, 0x00, 0x72, 0x65, 0x6c, 1130x6c, 0x74, 0x65, 0x72, 0x6e, 0xe8, 0x00, 0x72, 0x65, 0x6c,
1140x79, 0x2c, 0x00, 0x75, 0x73, 0x86, 0x00, 0xa0, 0x63, 0x75, 1140x79, 0x2c, 0x00, 0x75, 0x73, 0x86, 0x00, 0xa1, 0x63, 0x75,
1150x72, 0x73, 0x6f, 0x72, 0x00, 0x6b, 0x65, 0x79, 0xfc, 0x03, 1150x72, 0x73, 0x6f, 0x72, 0x00, 0x6b, 0x65, 0x79, 0xfc, 0x03,
1160x06, 0x9e, 0x00, 0x00, 0x43, 0x00, 0x08, 0x7c, 0x00, 0x91, 1160x05, 0x9e, 0x00, 0x01, 0x43, 0x00, 0x07, 0x7c, 0x00, 0x91,
1170x6f, 0x72, 0x00, 0x61, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x1e, 1170x6f, 0x72, 0x00, 0x61, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x1e,
1180x00, 0x66, 0x65, 0x64, 0x67, 0x65, 0x00, 0x6f, 0xb3, 0x03, 1180x00, 0x31, 0x65, 0x64, 0x67, 0x93, 0x04, 0x04, 0xb3, 0x03,
1190x55, 0x2c, 0x00, 0x61, 0x6e, 0x64, 0x54, 0x00, 0x60, 0x72, 1190x20, 0x2c, 0x00, 0x7c, 0x02, 0x04, 0x54, 0x00, 0x60, 0x72,
1200x65, 0x74, 0x75, 0x72, 0x6e, 0x54, 0x00, 0x07, 0x53, 0x00, 1200x65, 0x74, 0x75, 0x72, 0x6e, 0x54, 0x00, 0x09, 0x53, 0x00,
1210x01, 0xe5, 0x00, 0x1f, 0x2f, 0xe2, 0x00, 0x10, 0x10, 0x00, 1210x4f, 0x72, 0x6f, 0x77, 0x2f, 0xe2, 0x00, 0x10, 0x10, 0x00,
1220x91, 0x04, 0x20, 0x00, 0x63, 0x36, 0x01, 0x21, 0x6c, 0x73, 1220x91, 0x04, 0x20, 0x00, 0x63, 0x36, 0x01, 0x27, 0x6c, 0x73,
1230x3f, 0x00, 0x07, 0xb6, 0x03, 0x03, 0x33, 0x00, 0x79, 0x6c, 1230x3f, 0x00, 0x02, 0xb6, 0x03, 0x02, 0x33, 0x00, 0x79, 0x6c,
1240x79, 0x2e, 0x00, 0x4d, 0x6f, 0x76, 0xc3, 0x00, 0x10, 0x6f, 1240x79, 0x2e, 0x00, 0x4d, 0x6f, 0x76, 0xc3, 0x00, 0x10, 0x6f,
1250xd0, 0x03, 0x11, 0x61, 0x27, 0x00, 0x10, 0x2c, 0x0f, 0x05, 1250xd0, 0x03, 0x11, 0x61, 0x27, 0x00, 0x10, 0x2c, 0x0f, 0x05,
1260x32, 0x64, 0x00, 0x43, 0x96, 0x01, 0x01, 0x9c, 0x00, 0x00, 1260x32, 0x64, 0x00, 0x43, 0x96, 0x01, 0x01, 0x9c, 0x00, 0x00,
1270xed, 0x01, 0x15, 0x73, 0x8b, 0x01, 0x08, 0x9c, 0x00, 0x06, 1270xed, 0x01, 0x16, 0x73, 0x8b, 0x01, 0x0c, 0x9c, 0x00, 0x01,
1280x8f, 0x04, 0x57, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x53, 0x00, 1280x8f, 0x04, 0x20, 0x75, 0x6e, 0x03, 0x04, 0x07, 0x53, 0x00,
1290x01, 0x39, 0x00, 0x1b, 0x6d, 0x67, 0x00, 0x51, 0x61, 0x6c, 1290x00, 0x39, 0x00, 0x1b, 0x6d, 0x67, 0x00, 0x52, 0x61, 0x6c,
1300x6f, 0x6e, 0x67, 0xa5, 0x05, 0x05, 0x39, 0x00, 0x43, 0x2e, 1300x6f, 0x6e, 0x67, 0xa5, 0x05, 0x04, 0x39, 0x00, 0x43, 0x2e,
1310x00, 0x4f, 0x72, 0x73, 0x00, 0x10, 0x53, 0xce, 0x04, 0x04, 1310x00, 0x4f, 0x72, 0x73, 0x00, 0x11, 0x53, 0xce, 0x04, 0x04,
1320x5a, 0x00, 0x01, 0xa9, 0x03, 0x07, 0x26, 0x00, 0x10, 0x50, 1320x5a, 0x00, 0x01, 0xa9, 0x03, 0x06, 0x26, 0x00, 0x10, 0x50,
1330x84, 0x00, 0x00, 0xb6, 0x01, 0x50, 0x45, 0x6e, 0x74, 0x65, 1330x84, 0x00, 0x00, 0xb6, 0x01, 0x20, 0x45, 0x6e, 0xf0, 0x05,
1340x72, 0x10, 0x06, 0x60, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x73, 1340x91, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x73,
1350x3b, 0x00, 0x00, 0x38, 0x06, 0x01, 0x37, 0x05, 0x05, 0xb6, 1350x3b, 0x00, 0x00, 0x18, 0x00, 0x00, 0x37, 0x05, 0x05, 0xb6,
1360x00, 0x11, 0x28, 0xb3, 0x00, 0x03, 0x2c, 0x00, 0x50, 0x61, 1360x00, 0x12, 0x28, 0xb3, 0x00, 0x02, 0x2c, 0x00, 0x20, 0x61,
1370x67, 0x61, 0x69, 0x6e, 0x58, 0x00, 0xc1, 0x72, 0x65, 0x6c, 1370x67, 0xbc, 0x05, 0xc0, 0x74, 0x6f, 0x00, 0x72, 0x65, 0x6c,
1380x65, 0x61, 0x73, 0x65, 0x29, 0x2c, 0x00, 0x77, 0x68, 0x66, 1380x65, 0x61, 0x73, 0x65, 0x29, 0x2c, 0xc7, 0x02, 0x00, 0x66,
1390x06, 0x04, 0x54, 0x00, 0x10, 0x53, 0x01, 0x05, 0x0f, 0x54, 1390x06, 0x04, 0x54, 0x00, 0x11, 0x53, 0x01, 0x05, 0x0f, 0x54,
1400x00, 0x04, 0x02, 0x65, 0x05, 0x00, 0x5b, 0x01, 0x42, 0x28, 1400x00, 0x04, 0x01, 0x65, 0x05, 0x00, 0x5b, 0x01, 0x42, 0x28,
1410x41, 0x6c, 0x6c, 0x7e, 0x02, 0x01, 0x78, 0x01, 0xb0, 0x73, 1410x41, 0x6c, 0x6c, 0x7e, 0x02, 0x01, 0x78, 0x01, 0x90, 0x73,
1420x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 1420x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x08, 0x04,
1430x94, 0x01, 0x13, 0x73, 0x8e, 0x01, 0x72, 0x32, 0x2e, 0x31, 1430x33, 0x6e, 0x00, 0x73, 0x8e, 0x01, 0x72, 0x32, 0x2e, 0x31,
1440x00, 0x61, 0x72, 0x65, 0x81, 0x01, 0xb1, 0x61, 0x76, 0x61, 1440x00, 0x61, 0x72, 0x65, 0x81, 0x01, 0xb1, 0x61, 0x76, 0x61,
1450x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x29, 0xf6, 0x02, 1450x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x29, 0xf6, 0x02,
1460x15, 0x32, 0xf6, 0x02, 0x91, 0x70, 0x61, 0x72, 0x61, 0x6d, 1460x15, 0x32, 0xf6, 0x02, 0x91, 0x70, 0x61, 0x72, 0x61, 0x6d,
1470x65, 0x74, 0x65, 0x72, 0xf8, 0x02, 0x46, 0x54, 0x68, 0x65, 1470x65, 0x74, 0x65, 0x72, 0xf8, 0x02, 0x10, 0x54, 0x36, 0x02,
1480x00, 0x12, 0x00, 0x06, 0x37, 0x00, 0x51, 0x00, 0x66, 0x72, 1480x05, 0x12, 0x00, 0x06, 0x37, 0x00, 0x51, 0x00, 0x66, 0x72,
1490x6f, 0x6d, 0x74, 0x00, 0xe0, 0x60, 0x43, 0x75, 0x73, 0x74, 1490x6f, 0x6d, 0x74, 0x00, 0xe1, 0x60, 0x43, 0x75, 0x73, 0x74,
1500x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x6a, 1500x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x6a,
1510x00, 0x04, 0x4b, 0x05, 0xb0, 0x60, 0x54, 0x79, 0x70, 0x65, 1510x00, 0x03, 0x4b, 0x05, 0xb0, 0x60, 0x54, 0x79, 0x70, 0x65,
1520x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0x79, 0x00, 0xb1, 0x3a, 1520x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0x79, 0x00, 0xb1, 0x3a,
1530x00, 0x00, 0x00, 0x2d, 0x00, 0x57, 0x69, 0x64, 0x74, 0x68, 1530x00, 0x00, 0x00, 0x2d, 0x00, 0x57, 0x69, 0x64, 0x74, 0x68,
1540x84, 0x01, 0x21, 0x48, 0x65, 0x77, 0x06, 0x02, 0xba, 0x03, 1540x84, 0x01, 0x22, 0x48, 0x65, 0x77, 0x06, 0x02, 0xba, 0x03,
1550x01, 0x9a, 0x00, 0x00, 0x10, 0x05, 0x70, 0x2d, 0x65, 0x78, 1550x00, 0x9a, 0x00, 0x00, 0x10, 0x05, 0x70, 0x2d, 0x65, 0x78,
1560x70, 0x6c, 0x61, 0x6e, 0x9c, 0x02, 0x20, 0x79, 0x2e, 0x32, 1560x70, 0x6c, 0x61, 0x6e, 0x9c, 0x02, 0x21, 0x79, 0x2e, 0x32,
1570x00, 0x06, 0x39, 0x02, 0x40, 0x73, 0x6b, 0x00, 0x66, 0xac, 1570x00, 0x05, 0x39, 0x02, 0x40, 0x73, 0x6b, 0x00, 0x66, 0xac,
1580x01, 0x20, 0x00, 0x6c, 0xc9, 0x04, 0x00, 0xed, 0x06, 0x51, 1580x01, 0x20, 0x00, 0x6c, 0xc9, 0x04, 0x00, 0xed, 0x06, 0x41,
1590x68, 0x75, 0x66, 0x66, 0x6c, 0x91, 0x03, 0x41, 0x70, 0x65, 1590x68, 0x75, 0x66, 0x66, 0xa3, 0x04, 0x51, 0x6f, 0x70, 0x65,
1600x72, 0x61, 0x7c, 0x00, 0x20, 0x74, 0x6f, 0x34, 0x04, 0x98, 1600x72, 0x61, 0x7c, 0x00, 0x20, 0x74, 0x6f, 0x34, 0x04, 0x98,
1610x70, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x64, 0x2e, 1610x70, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x64, 0x2e,
1620x07, 0xe3, 0x2e, 0x00, 0x42, 0x79, 0x00, 0x64, 0x65, 0x66, 1620x07, 0xe3, 0x2e, 0x00, 0x42, 0x79, 0x00, 0x64, 0x65, 0x66,
1630x61, 0x75, 0x6c, 0x74, 0x2c, 0x00, 0xf0, 0x00, 0x01, 0x6d, 1630x61, 0x75, 0x6c, 0x74, 0x2c, 0x00, 0xf0, 0x00, 0x02, 0x6d,
1640x03, 0x03, 0x4a, 0x00, 0x14, 0x65, 0x2b, 0x00, 0x02, 0x38, 1640x03, 0x02, 0x4a, 0x00, 0x16, 0x65, 0xae, 0x06, 0x00, 0x38,
1650x01, 0x20, 0x75, 0x63, 0xb3, 0x07, 0x32, 0x77, 0x61, 0x79, 1650x01, 0x10, 0x75, 0x97, 0x00, 0x42, 0x00, 0x77, 0x61, 0x79,
1660x02, 0x05, 0x34, 0x61, 0x6e, 0x79, 0x71, 0x06, 0x11, 0x6d, 1660x02, 0x05, 0x34, 0x61, 0x6e, 0x79, 0x71, 0x06, 0x11, 0x6d,
1670xa0, 0x05, 0xf1, 0x00, 0x73, 0x00, 0x61, 0x62, 0x6f, 0x75, 1670xa0, 0x05, 0xf1, 0x00, 0x73, 0x00, 0x61, 0x62, 0x6f, 0x75,
1680x74, 0x00, 0x61, 0x73, 0x00, 0x70, 0x72, 0x6f, 0x62, 0x17, 1680x74, 0x00, 0x61, 0x73, 0x00, 0x70, 0x72, 0x6f, 0x62, 0x17,
1690x01, 0x20, 0x61, 0x73, 0x28, 0x00, 0x02, 0xa8, 0x05, 0x15, 1690x01, 0x21, 0x61, 0x73, 0x28, 0x00, 0x01, 0xa8, 0x05, 0x15,
1700x2e, 0xbb, 0x00, 0x81, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 1700x2e, 0xbb, 0x00, 0x82, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69,
1710x64, 0x65, 0xda, 0x04, 0x00, 0xe5, 0x05, 0x62, 0x72, 0x65, 1710x64, 0x65, 0xda, 0x04, 0x93, 0x62, 0x79, 0x00, 0x72, 0x65,
1720x71, 0x75, 0x65, 0x73, 0x8b, 0x05, 0x00, 0xee, 0x01, 0x43, 1720x71, 0x75, 0x65, 0x73, 0x8b, 0x05, 0x73, 0x70, 0x72, 0x65,
1730x63, 0x69, 0x73, 0x65, 0xc5, 0x07, 0x36, 0x00, 0x6f, 0x66, 1730x63, 0x69, 0x73, 0x65, 0xc5, 0x07, 0x00, 0x82, 0x03, 0x06,
1740xd9, 0x00, 0x01, 0x72, 0x02, 0x1a, 0x73, 0xd5, 0x00, 0x01, 1740xd9, 0x00, 0x00, 0x72, 0x02, 0x1c, 0x73, 0xd5, 0x00, 0x71,
1750x01, 0x07, 0x41, 0x79, 0x70, 0x69, 0x63, 0x79, 0x05, 0x10, 1750x2e, 0x00, 0x54, 0x79, 0x70, 0x69, 0x63, 0x79, 0x05, 0x10,
1760x79, 0xe8, 0x07, 0x31, 0x61, 0x69, 0x6d, 0xe7, 0x07, 0x21, 1760x79, 0xe8, 0x07, 0x31, 0x61, 0x69, 0x6d, 0xe7, 0x07, 0x21,
1770x68, 0x65, 0x01, 0x01, 0x10, 0x64, 0xad, 0x01, 0x31, 0x6d, 1770x68, 0x65, 0x01, 0x01, 0x10, 0x64, 0xad, 0x01, 0x33, 0x6d,
1780x69, 0x6e, 0xd0, 0x00, 0x05, 0x5f, 0x00, 0x3f, 0x73, 0x65, 1780x69, 0x6e, 0xf5, 0x03, 0x03, 0x5f, 0x00, 0x3f, 0x73, 0x65,
1790x74, 0x5c, 0x00, 0x00, 0x00, 0x8b, 0x01, 0x01, 0x37, 0x06, 1790x74, 0x5c, 0x00, 0x01, 0x00, 0x8b, 0x01, 0x00, 0x37, 0x06,
1800x11, 0x72, 0xe4, 0x05, 0x70, 0x6d, 0x00, 0x65, 0x78, 0x61, 1800x11, 0x72, 0xe4, 0x05, 0x50, 0x6d, 0x00, 0x65, 0x78, 0x61,
1810x63, 0x74, 0x4d, 0x04, 0x12, 0x73, 0xda, 0x07, 0x01, 0x7f, 1810x8b, 0x03, 0x32, 0x2c, 0x00, 0x73, 0xda, 0x07, 0x01, 0x7f,
1820x07, 0x40, 0x61, 0x6e, 0x73, 0x77, 0x49, 0x07, 0x40, 0x73, 1820x07, 0x40, 0x61, 0x6e, 0x73, 0x77, 0x49, 0x07, 0x40, 0x73,
1830x61, 0x79, 0x29, 0x1a, 0x06, 0x40, 0x6f, 0x75, 0x72, 0x2d, 1830x61, 0x79, 0x29, 0x1a, 0x06, 0x41, 0x6f, 0x75, 0x72, 0x2d,
1840x3f, 0x00, 0x04, 0x39, 0x01, 0x01, 0x3b, 0x03, 0x0a, 0x19, 1840x0d, 0x03, 0x04, 0x39, 0x01, 0x03, 0xe0, 0x08, 0x07, 0x19,
1850x00, 0x32, 0x6f, 0x6c, 0x75, 0xa6, 0x04, 0x46, 0x4e, 0x6f, 1850x00, 0x32, 0x6f, 0x6c, 0x75, 0xa6, 0x04, 0x46, 0x4e, 0x6f,
1860x74, 0x65, 0x44, 0x06, 0x42, 0x6d, 0x6f, 0x72, 0x65, 0x7a, 1860x74, 0x65, 0x44, 0x06, 0x43, 0x6d, 0x6f, 0x72, 0x65, 0x7a,
1870x00, 0x00, 0x59, 0x00, 0x04, 0xd5, 0x01, 0x16, 0x2c, 0x1c, 1870x00, 0x01, 0x59, 0x00, 0x02, 0xd5, 0x01, 0x16, 0x2c, 0x1c,
1880x00, 0x40, 0x6c, 0x69, 0x6b, 0x65, 0xca, 0x06, 0x00, 0x61, 1880x00, 0x40, 0x6c, 0x69, 0x6b, 0x65, 0xca, 0x06, 0x12, 0x74,
1890x01, 0x01, 0x37, 0x00, 0x05, 0x4b, 0x00, 0x72, 0x73, 0x00, 1890xd2, 0x00, 0x25, 0x61, 0x74, 0x4b, 0x00, 0x76, 0x73, 0x00,
1900x73, 0x68, 0x6f, 0x72, 0x74, 0xbf, 0x05, 0x03, 0xca, 0x07, 1900x73, 0x68, 0x6f, 0x72, 0x74, 0x47, 0x06, 0xf2, 0x00, 0x65,
1910xc2, 0x61, 0x72, 0x67, 0x65, 0x74, 0x00, 0x6c, 0x65, 0x6e, 1910x00, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x00, 0x6c, 0x65,
1920x67, 0x74, 0x68, 0xcb, 0x01, 0x01, 0xa6, 0x04, 0x34, 0x6f, 1920x6e, 0x67, 0x74, 0x68, 0xcb, 0x01, 0x01, 0xa6, 0x04, 0x00,
1930x75, 0x74, 0x35, 0x01, 0x90, 0x6f, 0x73, 0x73, 0x69, 0x62, 1930x97, 0x01, 0x03, 0x35, 0x01, 0x90, 0x6f, 0x73, 0x73, 0x69,
1940x6c, 0x65, 0x2e, 0x00, 1940x62, 0x6c, 0x65, 0x2e, 0x00,
195}; 195};
196 196
197const unsigned short help_text_len = 2534; 197const unsigned short help_text_len = 2534;
diff --git a/apps/plugins/puzzles/help/slant.c b/apps/plugins/puzzles/help/slant.c
index f905458aeb..873863757e 100644
--- a/apps/plugins/puzzles/help/slant.c
+++ b/apps/plugins/puzzles/help/slant.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -15,7 +15,7 @@ struct style_text help_text_style[] = {
15 LAST_STYLE_ITEM 15 LAST_STYLE_ITEM
16}; 16};
17 17
18/* orig 2378 comp 1648 ratio 0.693019 level 11 saved 730 */ 18/* orig 2378 comp 1650 ratio 0.69386 level 10 saved 728 */
19const char help_text[] = { 19const char help_text[] = {
200xf0, 0x21, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 200xf0, 0x21, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
210x32, 0x30, 0x3a, 0x20, 0x53, 0x6c, 0x61, 0x6e, 0x74, 0x20, 210x32, 0x30, 0x3a, 0x20, 0x53, 0x6c, 0x61, 0x6e, 0x74, 0x20,
@@ -27,9 +27,9 @@ const char help_text[] = {
270x00, 0x61, 0x00, 0x64, 0x69, 0x61, 0x67, 0x6f, 0x6e, 0x61, 270x00, 0x61, 0x00, 0x64, 0x69, 0x61, 0x67, 0x6f, 0x6e, 0x61,
280x6c, 0x00, 0x6c, 0x69, 0x6e, 0x65, 0x00, 0x74, 0x68, 0x72, 280x6c, 0x00, 0x6c, 0x69, 0x6e, 0x65, 0x00, 0x74, 0x68, 0x72,
290x6f, 0x75, 0x67, 0x68, 0x00, 0x65, 0x61, 0x63, 0x68, 0x3a, 290x6f, 0x75, 0x67, 0x68, 0x00, 0x65, 0x61, 0x63, 0x68, 0x3a,
300x00, 0xf1, 0x07, 0x2c, 0x00, 0x61, 0x6e, 0x64, 0x00, 0x63, 300x00, 0xf2, 0x07, 0x2c, 0x00, 0x61, 0x6e, 0x64, 0x00, 0x63,
310x68, 0x6f, 0x6f, 0x73, 0x65, 0x00, 0x77, 0x68, 0x69, 0x63, 310x68, 0x6f, 0x6f, 0x73, 0x65, 0x00, 0x77, 0x68, 0x69, 0x63,
320x68, 0x00, 0x77, 0x61, 0x79, 0x22, 0x00, 0x02, 0x34, 0x00, 320x68, 0x00, 0x77, 0x61, 0x79, 0x22, 0x00, 0x01, 0x34, 0x00,
330x10, 0x73, 0x7d, 0x00, 0xfa, 0x24, 0x73, 0x00, 0x73, 0x6f, 330x10, 0x73, 0x7d, 0x00, 0xfa, 0x24, 0x73, 0x00, 0x73, 0x6f,
340x00, 0x74, 0x68, 0x61, 0x74, 0x00, 0x74, 0x68, 0x65, 0x00, 340x00, 0x74, 0x68, 0x61, 0x74, 0x00, 0x74, 0x68, 0x65, 0x00,
350x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x00, 350x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x00,
@@ -44,144 +44,144 @@ const char help_text[] = {
440x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x00, 0x68, 0x61, 0x73, 440x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x00, 0x68, 0x61, 0x73,
450x00, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x65, 0x6c, 0x79, 450x00, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x65, 0x6c, 0x79,
460x83, 0x00, 0x43, 0x6d, 0x61, 0x6e, 0x79, 0x55, 0x00, 0x40, 460x83, 0x00, 0x43, 0x6d, 0x61, 0x6e, 0x79, 0x55, 0x00, 0x40,
470x6d, 0x65, 0x65, 0x74, 0x88, 0x00, 0xf1, 0x05, 0x61, 0x74, 470x6d, 0x65, 0x65, 0x74, 0x88, 0x00, 0xf1, 0x02, 0x61, 0x74,
480x00, 0x69, 0x74, 0x2e, 0x00, 0x28, 0x54, 0x68, 0x75, 0x73, 480x00, 0x69, 0x74, 0x2e, 0x00, 0x28, 0x54, 0x68, 0x75, 0x73,
490x2c, 0x00, 0x61, 0x00, 0x34, 0x00, 0x69, 0x73, 0xab, 0x00, 490x2c, 0x00, 0x61, 0x00, 0x34, 0x06, 0x01, 0x90, 0x68, 0x65,
500x90, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x65, 0x00, 0x6f, 0x66, 500x00, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x65, 0x29, 0x01, 0xfe,
510x5a, 0x00, 0xfd, 0x0b, 0x72, 0x6f, 0x73, 0x73, 0x00, 0x73, 510x0e, 0x61, 0x00, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x00, 0x73,
520x68, 0x61, 0x70, 0x65, 0x2c, 0x00, 0x77, 0x68, 0x65, 0x72, 520x68, 0x61, 0x70, 0x65, 0x2c, 0x00, 0x77, 0x68, 0x65, 0x72,
530x65, 0x61, 0x73, 0x00, 0x61, 0x00, 0x7a, 0x65, 0x72, 0x6f, 530x65, 0x61, 0x73, 0x00, 0x61, 0x00, 0x7a, 0x65, 0x72, 0x6f,
540x2f, 0x00, 0x02, 0x3b, 0x01, 0x42, 0x6d, 0x6f, 0x6e, 0x64, 540x2f, 0x00, 0x01, 0x3b, 0x01, 0x42, 0x6d, 0x6f, 0x6e, 0x64,
550x31, 0x00, 0xc0, 0x00, 0x2d, 0x00, 0x6f, 0x72, 0x00, 0x72, 550x31, 0x00, 0xc0, 0x00, 0x2d, 0x00, 0x6f, 0x72, 0x00, 0x72,
560x61, 0x74, 0x68, 0x65, 0x72, 0x61, 0x00, 0x7a, 0x70, 0x61, 560x61, 0x74, 0x68, 0x65, 0x72, 0x61, 0x00, 0x7a, 0x70, 0x61,
570x72, 0x74, 0x69, 0x61, 0x6c, 0x25, 0x00, 0x94, 0x2c, 0x00, 570x72, 0x74, 0x69, 0x61, 0x6c, 0x25, 0x00, 0x94, 0x2c, 0x00,
580x62, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x56, 0x00, 0x33, 580x62, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x56, 0x00, 0x33,
590x63, 0x61, 0x6e, 0xf8, 0x00, 0x91, 0x61, 0x70, 0x70, 0x65, 590x63, 0x61, 0x6e, 0xf8, 0x00, 0x91, 0x61, 0x70, 0x70, 0x65,
600x61, 0x72, 0x00, 0x69, 0x6e, 0x67, 0x00, 0x50, 0x6d, 0x69, 600x61, 0x72, 0x00, 0x69, 0x6e, 0x67, 0x00, 0x51, 0x6d, 0x69,
610x64, 0x64, 0x6c, 0x67, 0x00, 0x00, 0x0e, 0x00, 0x01, 0xcb, 610x64, 0x64, 0x6c, 0x67, 0x00, 0x00, 0x0e, 0x00, 0x01, 0xcb,
620x01, 0x04, 0x3a, 0x00, 0x02, 0xe2, 0x00, 0xe0, 0x77, 0x6f, 620x01, 0x04, 0x3a, 0x00, 0x01, 0xe2, 0x00, 0xe0, 0x77, 0x6f,
630x75, 0x6c, 0x64, 0x00, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 630x75, 0x6c, 0x64, 0x00, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69,
640x61, 0x74, 0xf9, 0x00, 0x01, 0x1d, 0x00, 0x04, 0x39, 0x01, 640x61, 0x74, 0xf9, 0x00, 0x04, 0x57, 0x00, 0x01, 0x39, 0x01,
650xa0, 0x29, 0x00, 0x00, 0x00, 0x43, 0x72, 0x65, 0x64, 0x69, 650xa0, 0x29, 0x00, 0x00, 0x00, 0x43, 0x72, 0x65, 0x64, 0x69,
660x74, 0x50, 0x01, 0xf1, 0x01, 0x00, 0x74, 0x68, 0x69, 0x73, 660x74, 0x50, 0x01, 0xf1, 0x01, 0x00, 0x74, 0x68, 0x69, 0x73,
670x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x00, 0x67, 0x6f, 670x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x00, 0x67, 0x6f,
680x65, 0xff, 0x01, 0xd0, 0x4e, 0x69, 0x6b, 0x6f, 0x6c, 0x69, 680x65, 0xff, 0x01, 0xa0, 0x4e, 0x69, 0x6b, 0x6f, 0x6c, 0x69,
690x00, 0x5b, 0x38, 0x5d, 0x2e, 0x00, 0x00, 0x07, 0x00, 0xd1, 690x00, 0x5b, 0x38, 0x5d, 0x67, 0x01, 0xf1, 0x01, 0x5b, 0x38,
700x00, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 700x5d, 0x00, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77,
710x77, 0x2e, 0x6e, 0x1d, 0x00, 0xa2, 0x2e, 0x63, 0x6f, 0x2e, 710x77, 0x77, 0x2e, 0x6e, 0x1d, 0x00, 0xa2, 0x2e, 0x63, 0x6f,
720x6a, 0x70, 0x2f, 0x6a, 0x61, 0x2f, 0x3c, 0x00, 0xf0, 0x0e, 720x2e, 0x6a, 0x70, 0x2f, 0x6a, 0x61, 0x2f, 0x3c, 0x00, 0xf0,
730x73, 0x2f, 0x67, 0x6f, 0x6b, 0x69, 0x67, 0x65, 0x6e, 0x5f, 730x0e, 0x73, 0x2f, 0x67, 0x6f, 0x6b, 0x69, 0x67, 0x65, 0x6e,
740x6e, 0x61, 0x6e, 0x61, 0x6d, 0x65, 0x00, 0x28, 0x69, 0x6e, 740x5f, 0x6e, 0x61, 0x6e, 0x61, 0x6d, 0x65, 0x00, 0x28, 0x69,
750x00, 0x4a, 0x61, 0x70, 0x61, 0x6e, 0x65, 0x73, 0x65, 0x73, 750x6e, 0x00, 0x4a, 0x61, 0x70, 0x61, 0x6e, 0x65, 0x73, 0x65,
760x00, 0x43, 0x32, 0x30, 0x2e, 0x31, 0x8c, 0x02, 0x80, 0x63, 760x73, 0x00, 0x43, 0x32, 0x30, 0x2e, 0x31, 0x8c, 0x02, 0x80,
770x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x95, 0x02, 0xd0, 770x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x95, 0x02,
780x4c, 0x65, 0x66, 0x74, 0x2d, 0x63, 0x6c, 0x69, 0x63, 0x6b, 780xa0, 0x4c, 0x65, 0x66, 0x74, 0x2d, 0x63, 0x6c, 0x69, 0x63,
790x69, 0x6e, 0x67, 0xe2, 0x00, 0x73, 0x61, 0x00, 0x62, 0x6c, 790x6b, 0x8a, 0x01, 0xa3, 0x69, 0x6e, 0x00, 0x61, 0x00, 0x62,
800x61, 0x6e, 0x6b, 0x61, 0x02, 0xa0, 0x00, 0x77, 0x69, 0x6c, 800x6c, 0x61, 0x6e, 0x6b, 0x61, 0x02, 0xa0, 0x00, 0x77, 0x69,
810x6c, 0x00, 0x70, 0x6c, 0x61, 0x63, 0xc0, 0x00, 0x10, 0x5c, 810x6c, 0x6c, 0x00, 0x70, 0x6c, 0x61, 0x63, 0xc0, 0x00, 0x10,
820x21, 0x00, 0x52, 0x69, 0x74, 0x00, 0x28, 0x61, 0x5e, 0x02, 820x5c, 0x21, 0x00, 0x52, 0x69, 0x74, 0x00, 0x28, 0x61, 0x5e,
830x40, 0x6c, 0x65, 0x61, 0x6e, 0x37, 0x00, 0x10, 0x74, 0x5f, 830x02, 0x40, 0x6c, 0x65, 0x61, 0x6e, 0x37, 0x00, 0x10, 0x74,
840x02, 0x00, 0x0f, 0x00, 0xc1, 0x66, 0x74, 0x2c, 0x00, 0x69, 840x5f, 0x02, 0x00, 0x0f, 0x00, 0xc1, 0x66, 0x74, 0x2c, 0x00,
850x2e, 0x65, 0x2e, 0x00, 0x72, 0x75, 0x6e, 0x1a, 0x00, 0x41, 850x69, 0x2e, 0x65, 0x2e, 0x00, 0x72, 0x75, 0x6e, 0x1a, 0x00,
860x66, 0x72, 0x6f, 0x6d, 0x1c, 0x00, 0x31, 0x74, 0x6f, 0x70, 860x41, 0x66, 0x72, 0x6f, 0x6d, 0x1c, 0x00, 0x31, 0x74, 0x6f,
870x20, 0x00, 0x03, 0x37, 0x01, 0x03, 0x5f, 0x00, 0x04, 0x3a, 870x70, 0x20, 0x00, 0x04, 0x37, 0x01, 0x03, 0x5f, 0x00, 0x03,
880x00, 0xff, 0x04, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x00, 880x3a, 0x00, 0xf0, 0x01, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d,
890x72, 0x69, 0x67, 0x68, 0x74, 0x29, 0x2e, 0x00, 0x52, 0x69, 890x00, 0x72, 0x69, 0x67, 0x68, 0x74, 0x29, 0x2e, 0x00, 0x52,
900x67, 0x68, 0x96, 0x00, 0x17, 0x14, 0x2f, 0x96, 0x00, 0x0a, 900x08, 0x00, 0x0f, 0x96, 0x00, 0x16, 0x14, 0x2f, 0x96, 0x00,
910x8f, 0x00, 0x02, 0x4e, 0x00, 0x1b, 0x2c, 0x8b, 0x00, 0x22, 910x0b, 0x8f, 0x00, 0x01, 0x4e, 0x00, 0x1b, 0x2c, 0x8b, 0x00,
920x6f, 0x70, 0x18, 0x00, 0x33, 0x00, 0x74, 0x6f, 0x76, 0x00, 920x22, 0x6f, 0x70, 0x18, 0x00, 0x00, 0x25, 0x00, 0x03, 0x76,
930x01, 0x97, 0x00, 0x20, 0x29, 0x2e, 0x96, 0x01, 0x63, 0x6f, 930x00, 0x00, 0x97, 0x00, 0x20, 0x29, 0x2e, 0x96, 0x01, 0x63,
940x6e, 0x74, 0x69, 0x6e, 0x75, 0x43, 0x00, 0x01, 0x7f, 0x00, 940x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x43, 0x00, 0x01, 0x7f,
950x30, 0x00, 0x65, 0x69, 0x35, 0x02, 0x72, 0x00, 0x62, 0x75, 950x00, 0x30, 0x00, 0x65, 0x69, 0x35, 0x02, 0x72, 0x00, 0x62,
960x74, 0x74, 0x6f, 0x6e, 0x78, 0x00, 0xc0, 0x63, 0x79, 0x63, 960x75, 0x74, 0x74, 0x6f, 0x6e, 0x78, 0x00, 0xd2, 0x63, 0x79,
970x6c, 0x65, 0x00, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x12, 970x63, 0x6c, 0x65, 0x00, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65,
980x02, 0x01, 0x9a, 0x03, 0xa5, 0x65, 0x65, 0x00, 0x70, 0x6f, 980x6e, 0xdd, 0x00, 0xc5, 0x68, 0x72, 0x65, 0x65, 0x00, 0x70,
990x73, 0x73, 0x69, 0x62, 0x6c, 0xdc, 0x00, 0x00, 0x67, 0x01, 990x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0xdc, 0x00, 0x00, 0x67,
1000x62, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x00, 0xd9, 0x02, 0x85, 1000x01, 0x62, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x00, 0xd9, 0x02,
1010x69, 0x66, 0x00, 0x79, 0x6f, 0x75, 0x00, 0x6c, 0x72, 0x01, 1010x85, 0x69, 0x66, 0x00, 0x79, 0x6f, 0x75, 0x00, 0x6c, 0x72,
1020xbf, 0x00, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 1020x01, 0xbe, 0x00, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65,
1030x6c, 0x79, 0xe4, 0x00, 0x00, 0x23, 0x69, 0x74, 0x6f, 0x00, 1030x64, 0x6c, 0x79, 0xe4, 0x00, 0x00, 0xd2, 0x00, 0x02, 0x6f,
1040x51, 0x68, 0x61, 0x6e, 0x67, 0x65, 0xbf, 0x00, 0x02, 0x21, 1040x00, 0x52, 0x68, 0x61, 0x6e, 0x67, 0x65, 0xbf, 0x00, 0x02,
1050x00, 0x00, 0x9d, 0x00, 0x10, 0x5c, 0x05, 0x00, 0x50, 0x2f, 1050x21, 0x00, 0x40, 0x74, 0x6f, 0x00, 0x5c, 0x05, 0x00, 0x51,
1060x00, 0x62, 0x61, 0x63, 0x0f, 0x00, 0x02, 0x18, 0x00, 0x01, 1060x2f, 0x00, 0x62, 0x61, 0x63, 0x0f, 0x00, 0x01, 0x18, 0x00,
1070x0d, 0x04, 0x03, 0x66, 0x00, 0x01, 0xe5, 0x00, 0x0e, 0x67, 1070x02, 0x0d, 0x04, 0x03, 0x66, 0x00, 0x01, 0xe5, 0x00, 0x0e,
1080x00, 0x07, 0x7b, 0x01, 0x0f, 0x5d, 0x00, 0x08, 0x11, 0x2f, 1080x67, 0x00, 0x07, 0x7b, 0x01, 0x0f, 0x5d, 0x00, 0x07, 0x12,
1090x62, 0x00, 0x0a, 0x5d, 0x00, 0x00, 0x9f, 0x03, 0x00, 0x75, 1090x2f, 0x62, 0x00, 0x09, 0x5d, 0x00, 0x01, 0x9f, 0x03, 0x50,
1100x03, 0x50, 0x66, 0x6f, 0x72, 0x65, 0x2c, 0x62, 0x00, 0x00, 1100x65, 0x72, 0x65, 0x66, 0x6f, 0x76, 0x04, 0x00, 0x62, 0x00,
1110x1f, 0x03, 0x00, 0x83, 0x01, 0x12, 0x79, 0x06, 0x03, 0x00, 1110x00, 0x1f, 0x03, 0x42, 0x70, 0x6c, 0x61, 0x79, 0x06, 0x03,
1120x73, 0x02, 0x82, 0x65, 0x6e, 0x74, 0x69, 0x72, 0x65, 0x6c, 1120x00, 0x73, 0x02, 0x50, 0x65, 0x6e, 0x74, 0x69, 0x72, 0xf0,
1130x79, 0x0d, 0x04, 0x33, 0x6f, 0x6e, 0x65, 0x37, 0x01, 0x04, 1130x02, 0x01, 0x0d, 0x04, 0x34, 0x6f, 0x6e, 0x65, 0x37, 0x01,
1140x94, 0x00, 0x71, 0x6e, 0x65, 0x65, 0x64, 0x00, 0x74, 0x6f, 1140x03, 0x94, 0x00, 0x71, 0x6e, 0x65, 0x65, 0x64, 0x00, 0x74,
1150x02, 0x03, 0x13, 0x59, 0x42, 0x00, 0x82, 0x61, 0x6c, 0x73, 1150x6f, 0x02, 0x03, 0x13, 0x59, 0x42, 0x00, 0x52, 0x61, 0x6c,
1160x6f, 0x00, 0x75, 0x73, 0x65, 0xc1, 0x03, 0x91, 0x75, 0x72, 1160x73, 0x6f, 0x00, 0x3b, 0x03, 0xc1, 0x65, 0x00, 0x63, 0x75,
1170x73, 0x6f, 0x72, 0x00, 0x6b, 0x65, 0x79, 0x07, 0x03, 0x20, 1170x72, 0x73, 0x6f, 0x72, 0x00, 0x6b, 0x65, 0x79, 0x07, 0x03,
1180x6d, 0x6f, 0x2d, 0x05, 0x55, 0x72, 0x6f, 0x75, 0x6e, 0x64, 1180x20, 0x6d, 0x6f, 0x2d, 0x05, 0x55, 0x72, 0x6f, 0x75, 0x6e,
1190x6b, 0x03, 0xa2, 0x2e, 0x00, 0x50, 0x72, 0x65, 0x73, 0x73, 1190x64, 0x6b, 0x03, 0x71, 0x2e, 0x00, 0x50, 0x72, 0x65, 0x73,
1200x69, 0x6e, 0x67, 0xe4, 0x01, 0x50, 0x65, 0x74, 0x75, 0x72, 1200x73, 0xa4, 0x01, 0x00, 0xe4, 0x01, 0x50, 0x65, 0x74, 0x75,
1210x6e, 0xde, 0x03, 0x51, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3b, 1210x72, 0x6e, 0xde, 0x03, 0x20, 0x73, 0x70, 0x0e, 0x02, 0x01,
1220x00, 0x0c, 0xb4, 0x02, 0x20, 0x6f, 0x72, 0x25, 0x02, 0xe1, 1220x3b, 0x00, 0x0b, 0xb4, 0x02, 0x20, 0x6f, 0x72, 0x25, 0x02,
1230x2c, 0x00, 0x72, 0x65, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 1230xe2, 0x2c, 0x00, 0x72, 0x65, 0x73, 0x70, 0x65, 0x63, 0x74,
1240x76, 0x65, 0x6c, 0x79, 0x2c, 0x01, 0x01, 0x29, 0x00, 0x00, 1240x69, 0x76, 0x65, 0x6c, 0x79, 0x2c, 0x01, 0x01, 0x29, 0x00,
1250x47, 0x00, 0x11, 0x6e, 0xd4, 0x01, 0x01, 0x84, 0x00, 0x20, 1250x43, 0x74, 0x68, 0x65, 0x6e, 0xd4, 0x01, 0x50, 0x74, 0x68,
1260x6d, 0x00, 0x57, 0x04, 0x5a, 0x62, 0x6f, 0x76, 0x65, 0x2e, 1260x65, 0x6d, 0x00, 0x57, 0x04, 0x5a, 0x62, 0x6f, 0x76, 0x65,
1270xa4, 0x00, 0x10, 0x70, 0x77, 0x00, 0x51, 0x00, 0x2f, 0x00, 1270x2e, 0xa4, 0x00, 0x10, 0x70, 0x77, 0x00, 0x20, 0x00, 0x2f,
1280x6f, 0x72, 0x7d, 0x01, 0x04, 0x60, 0x00, 0x03, 0x12, 0x00, 1280x4e, 0x00, 0x01, 0x7d, 0x01, 0x06, 0x7e, 0x02, 0x00, 0x12,
1290x0c, 0x5e, 0x00, 0xa1, 0x69, 0x6e, 0x64, 0x65, 0x70, 0x65, 1290x00, 0x0c, 0x5e, 0x00, 0xa1, 0x69, 0x6e, 0x64, 0x65, 0x70,
1300x6e, 0x64, 0x65, 0x6e, 0xf2, 0x02, 0x40, 0x77, 0x68, 0x61, 1300x65, 0x6e, 0x64, 0x65, 0x6e, 0xf2, 0x02, 0x20, 0x77, 0x68,
1310x74, 0xa6, 0x04, 0x60, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 1310xe4, 0x04, 0x81, 0x73, 0x00, 0x61, 0x6c, 0x72, 0x65, 0x61,
1320xee, 0x01, 0x07, 0xf0, 0x00, 0x03, 0x91, 0x01, 0x62, 0x2e, 1320x64, 0xee, 0x01, 0x07, 0xf0, 0x00, 0x02, 0x91, 0x01, 0x62,
1330x00, 0x42, 0x61, 0x63, 0x6b, 0xc7, 0x00, 0x20, 0x72, 0x65, 1330x2e, 0x00, 0x42, 0x61, 0x63, 0x6b, 0xc7, 0x00, 0x20, 0x72,
1340xfc, 0x00, 0x24, 0x73, 0x00, 0x2c, 0x05, 0x03, 0xbd, 0x02, 1340x65, 0xfc, 0x00, 0x24, 0x73, 0x00, 0x2c, 0x05, 0x06, 0x48,
1350x0e, 0x33, 0x00, 0x42, 0x00, 0x00, 0x28, 0x41, 0xc4, 0x00, 1350x03, 0x0b, 0x33, 0x00, 0x42, 0x00, 0x00, 0x28, 0x41, 0xc4,
1360x32, 0x00, 0x61, 0x63, 0xcb, 0x05, 0x90, 0x64, 0x65, 0x73, 1360x00, 0x32, 0x00, 0x61, 0x63, 0xcb, 0x05, 0x90, 0x64, 0x65,
1370x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0x66, 0x00, 0x21, 0x73, 1370x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0x66, 0x00, 0x21,
1380x65, 0x16, 0x00, 0x40, 0x00, 0x32, 0x2e, 0x31, 0xe4, 0x05, 1380x73, 0x65, 0x16, 0x00, 0x41, 0x00, 0x32, 0x2e, 0x31, 0xe4,
1390x02, 0xcb, 0x00, 0xa3, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 1390x05, 0x01, 0xcb, 0x00, 0xa3, 0x61, 0x76, 0x61, 0x69, 0x6c,
1400x62, 0x6c, 0x65, 0x2e, 0x19, 0x04, 0x13, 0x32, 0x19, 0x04, 1400x61, 0x62, 0x6c, 0x65, 0x2e, 0x19, 0x04, 0x13, 0x32, 0x19,
1410x90, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 1410x04, 0x91, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65,
1420x1b, 0x04, 0x00, 0x07, 0x06, 0x35, 0x73, 0x65, 0x00, 0x14, 1420x72, 0x1b, 0x04, 0x66, 0x54, 0x68, 0x65, 0x73, 0x65, 0x00,
1430x00, 0x01, 0x25, 0x06, 0x05, 0x3c, 0x00, 0x07, 0x93, 0x00, 1430x14, 0x00, 0x02, 0x41, 0x00, 0x04, 0x3c, 0x00, 0x06, 0x93,
1440xe1, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 1440x00, 0xe1, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e,
1450x2e, 0x27, 0x00, 0x6f, 0x70, 0x6f, 0x00, 0x22, 0x6f, 0x6e, 1450x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x6f, 0x00, 0x22, 0x6f,
1460x1a, 0x00, 0xa0, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 1460x6e, 0x1a, 0x00, 0xa0, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00,
1470x65, 0x6e, 0x75, 0xab, 0x00, 0x91, 0x57, 0x69, 0x64, 0x74, 1470x6d, 0x65, 0x6e, 0x75, 0xab, 0x00, 0x91, 0x57, 0x69, 0x64,
1480x68, 0x2c, 0x00, 0x48, 0x65, 0x81, 0x03, 0x50, 0x00, 0x00, 1480x74, 0x68, 0x2c, 0x00, 0x48, 0x65, 0x81, 0x03, 0x51, 0x00,
1490x53, 0x69, 0x7a, 0x47, 0x05, 0x02, 0x43, 0x05, 0x26, 0x69, 1490x00, 0x53, 0x69, 0x7a, 0x47, 0x05, 0x01, 0x43, 0x05, 0x26,
1500x6e, 0x0e, 0x07, 0xc0, 0x00, 0x00, 0x44, 0x69, 0x66, 0x66, 1500x69, 0x6e, 0x0e, 0x07, 0xc3, 0x00, 0x00, 0x44, 0x69, 0x66,
1510x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x98, 0x03, 0x02, 0xb0, 1510x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x98, 0x03, 0x00,
1520x04, 0x02, 0xe5, 0x05, 0x15, 0x64, 0x1a, 0x00, 0x05, 0x82, 1520xb0, 0x04, 0x01, 0x54, 0x00, 0x16, 0x64, 0x1a, 0x00, 0x04,
1530x05, 0x40, 0x65, 0x6e, 0x65, 0x72, 0xe0, 0x02, 0x03, 0x47, 1530x82, 0x05, 0x40, 0x65, 0x6e, 0x65, 0x72, 0xe0, 0x02, 0x03,
1540x05, 0xf2, 0x00, 0x2e, 0x00, 0x41, 0x74, 0x00, 0x48, 0x61, 1540x47, 0x05, 0xf2, 0x00, 0x2e, 0x00, 0x41, 0x74, 0x00, 0x48,
1550x72, 0x64, 0x00, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0xae, 0x02, 1550x61, 0x72, 0x64, 0x00, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0xae,
1560x20, 0x61, 0x72, 0x56, 0x01, 0x61, 0x71, 0x75, 0x69, 0x72, 1560x02, 0x20, 0x61, 0x72, 0x56, 0x01, 0x61, 0x71, 0x75, 0x69,
1570x65, 0x64, 0x62, 0x07, 0x63, 0x6f, 0x00, 0x64, 0x65, 0x64, 1570x72, 0x65, 0x64, 0x62, 0x07, 0x63, 0x6f, 0x00, 0x64, 0x65,
1580x75, 0x34, 0x01, 0x50, 0x62, 0x61, 0x73, 0x65, 0x64, 0xb6, 1580x64, 0x75, 0x34, 0x01, 0x50, 0x62, 0x61, 0x73, 0x65, 0x64,
1590x00, 0x81, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 1590xb6, 0x00, 0x81, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64,
1600x98, 0x00, 0x41, 0x72, 0x65, 0x6c, 0x61, 0x20, 0x00, 0x43, 1600x67, 0x98, 0x00, 0x41, 0x72, 0x65, 0x6c, 0x61, 0x20, 0x00,
1610x68, 0x69, 0x70, 0x73, 0xf1, 0x03, 0x05, 0xa6, 0x00, 0x02, 1610x45, 0x68, 0x69, 0x70, 0x73, 0xf1, 0x03, 0x03, 0xa6, 0x00,
1620x4f, 0x06, 0x00, 0xc0, 0x05, 0x01, 0x22, 0x02, 0x30, 0x77, 1620x03, 0x4f, 0x06, 0x00, 0xf3, 0x05, 0x00, 0x22, 0x02, 0x30,
1630x61, 0x79, 0x23, 0x00, 0x01, 0xcf, 0x06, 0x10, 0x62, 0x4b, 1630x77, 0x61, 0x79, 0x23, 0x00, 0x01, 0xcf, 0x06, 0x10, 0x62,
1640x02, 0x03, 0x60, 0x00, 0x02, 0xd9, 0x02, 0x55, 0x65, 0x78, 1640x4b, 0x02, 0x03, 0x60, 0x00, 0x02, 0xd9, 0x02, 0x55, 0x65,
1650x61, 0x63, 0x74, 0x11, 0x04, 0x00, 0x5c, 0x00, 0x24, 0x6f, 1650x78, 0x61, 0x63, 0x74, 0x11, 0x04, 0x00, 0x5c, 0x00, 0x25,
1660x6e, 0x89, 0x03, 0x00, 0xff, 0x06, 0xc0, 0x61, 0x00, 0x74, 1660x6f, 0x6e, 0x89, 0x03, 0xf0, 0x00, 0x61, 0x74, 0x00, 0x61,
1670x69, 0x6d, 0x65, 0x2e, 0x00, 0x28, 0x46, 0x6f, 0x72, 0x2d, 1670x00, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x00, 0x28, 0x46, 0x6f,
1680x00, 0x33, 0x6d, 0x70, 0x6c, 0x66, 0x03, 0x10, 0x6d, 0x2c, 1680x72, 0x2d, 0x00, 0x33, 0x6d, 0x70, 0x6c, 0x66, 0x03, 0x11,
1690x01, 0x01, 0x97, 0x00, 0x03, 0xc2, 0x07, 0x24, 0x77, 0x6f, 1690x6d, 0x2c, 0x01, 0x00, 0x97, 0x00, 0x03, 0xc2, 0x07, 0x25,
1700x82, 0x00, 0x02, 0xdd, 0x07, 0x04, 0x4c, 0x02, 0x30, 0x73, 1700x77, 0x6f, 0x82, 0x00, 0x01, 0xdd, 0x07, 0x04, 0x4c, 0x02,
1710x61, 0x6d, 0x1d, 0x01, 0x12, 0x72, 0xf1, 0x01, 0x55, 0x2c, 1710x30, 0x73, 0x61, 0x6d, 0x1d, 0x01, 0x12, 0x72, 0xf1, 0x01,
1720x00, 0x65, 0x76, 0x65, 0x79, 0x03, 0x82, 0x64, 0x6f, 0x6e, 1720x55, 0x2c, 0x00, 0x65, 0x76, 0x65, 0x79, 0x03, 0x83, 0x64,
1730x27, 0x74, 0x00, 0x79, 0x65, 0x49, 0x00, 0x01, 0x8e, 0x02, 1730x6f, 0x6e, 0x27, 0x74, 0x00, 0x79, 0x65, 0x49, 0x00, 0x01,
1740x01, 0x4e, 0x00, 0x06, 0x30, 0x00, 0x31, 0x00, 0x69, 0x73, 1740x8e, 0x02, 0x01, 0x4e, 0x00, 0x05, 0x30, 0x00, 0x32, 0x00,
1750x13, 0x03, 0x01, 0x8f, 0x06, 0x03, 0x75, 0x00, 0x20, 0x65, 1750x69, 0x73, 0x13, 0x03, 0x01, 0x8f, 0x06, 0x02, 0x75, 0x00,
1760x6e, 0xca, 0x00, 0x00, 0x41, 0x00, 0x07, 0xce, 0x00, 0x62, 1760x21, 0x65, 0x6e, 0xca, 0x00, 0x00, 0x41, 0x00, 0x06, 0xce,
1770x73, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0xe7, 0x00, 0x60, 0x6f, 1770x00, 0x62, 0x73, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0xe7, 0x00,
1780x75, 0x74, 0x00, 0x73, 0x74, 0x44, 0x03, 0x10, 0x6f, 0x0b, 1780x60, 0x6f, 0x75, 0x74, 0x00, 0x73, 0x74, 0x44, 0x03, 0x11,
1790x01, 0x05, 0xc0, 0x01, 0x30, 0x29, 0x00, 0x45, 0x7d, 0x00, 1790x6f, 0x0b, 0x01, 0x04, 0xc0, 0x01, 0x30, 0x29, 0x00, 0x45,
1800x1a, 0x61, 0x86, 0x01, 0x90, 0x67, 0x75, 0x65, 0x73, 0x73, 1800x7d, 0x00, 0x1a, 0x61, 0x86, 0x01, 0x91, 0x67, 0x75, 0x65,
1810x77, 0x6f, 0x72, 0x6b, 0x68, 0x00, 0x01, 0x5d, 0x04, 0x32, 1810x73, 0x73, 0x77, 0x6f, 0x72, 0x6b, 0x68, 0x00, 0x00, 0x5d,
1820x74, 0x72, 0x61, 0xe1, 0x05, 0x20, 0x73, 0x68, 0x33, 0x07, 1820x04, 0x32, 0x74, 0x72, 0x61, 0xe1, 0x05, 0x21, 0x73, 0x68,
1830x03, 0x6d, 0x07, 0xe0, 0x62, 0x65, 0x00, 0x6e, 0x65, 0x63, 1830x33, 0x07, 0x02, 0x6d, 0x07, 0xe0, 0x62, 0x65, 0x00, 0x6e,
1840x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x2e, 0x00, 1840x65, 0x63, 0x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x2e, 0x00,
185}; 185};
186 186
187const unsigned short help_text_len = 2378; 187const unsigned short help_text_len = 2378;
diff --git a/apps/plugins/puzzles/help/solo.c b/apps/plugins/puzzles/help/solo.c
index f2ba9c7848..a02bb94c04 100644
--- a/apps/plugins/puzzles/help/solo.c
+++ b/apps/plugins/puzzles/help/solo.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -14,7 +14,7 @@ struct style_text help_text_style[] = {
14 LAST_STYLE_ITEM 14 LAST_STYLE_ITEM
15}; 15};
16 16
17/* orig 6263 comp 3634 ratio 0.580233 level 11 saved 2629 */ 17/* orig 6263 comp 3635 ratio 0.580393 level 10 saved 2628 */
18const char help_text[] = { 18const char help_text[] = {
190xf0, 0x53, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 190xf0, 0x53, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
200x31, 0x31, 0x3a, 0x20, 0x53, 0x6f, 0x6c, 0x6f, 0x20, 0x00, 200x31, 0x31, 0x3a, 0x20, 0x53, 0x6f, 0x6c, 0x6f, 0x20, 0x00,
@@ -30,9 +30,9 @@ const char help_text[] = {
300x68, 0x61, 0x73, 0x00, 0x72, 0x6f, 0x77, 0x73, 0x2e, 0x00, 300x68, 0x61, 0x73, 0x00, 0x72, 0x6f, 0x77, 0x73, 0x2e, 0x00,
310x45, 0x61, 0x63, 0x68, 0x5f, 0x00, 0xc1, 0x6d, 0x75, 0x73, 310x45, 0x61, 0x63, 0x68, 0x5f, 0x00, 0xc1, 0x6d, 0x75, 0x73,
320x74, 0x00, 0x62, 0x65, 0x00, 0x66, 0x69, 0x6c, 0x6c, 0x57, 320x74, 0x00, 0x62, 0x65, 0x00, 0x66, 0x69, 0x6c, 0x6c, 0x57,
330x00, 0xf0, 0x08, 0x00, 0x77, 0x69, 0x74, 0x68, 0x00, 0x61, 330x00, 0xf1, 0x08, 0x00, 0x77, 0x69, 0x74, 0x68, 0x00, 0x61,
340x00, 0x64, 0x69, 0x67, 0x69, 0x74, 0x00, 0x66, 0x72, 0x6f, 340x00, 0x64, 0x69, 0x67, 0x69, 0x74, 0x00, 0x66, 0x72, 0x6f,
350x6d, 0x00, 0x31, 0x00, 0x74, 0x6f, 0x48, 0x00, 0x01, 0x60, 350x6d, 0x00, 0x31, 0x00, 0x74, 0x6f, 0x48, 0x00, 0x00, 0x60,
360x00, 0x35, 0x00, 0x6f, 0x66, 0x54, 0x00, 0x10, 0x2c, 0x30, 360x00, 0x35, 0x00, 0x6f, 0x66, 0x54, 0x00, 0x10, 0x2c, 0x30,
370x00, 0x30, 0x73, 0x75, 0x63, 0x30, 0x00, 0xf0, 0x03, 0x77, 370x00, 0x30, 0x73, 0x75, 0x63, 0x30, 0x00, 0xf0, 0x03, 0x77,
380x61, 0x79, 0x00, 0x74, 0x68, 0x61, 0x74, 0x00, 0x00, 0x00, 380x61, 0x79, 0x00, 0x74, 0x68, 0x61, 0x74, 0x00, 0x00, 0x00,
@@ -40,110 +40,110 @@ const char help_text[] = {
400x0d, 0x00, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 400x0d, 0x00, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73,
410x00, 0x6f, 0x6e, 0x6c, 0x79, 0x00, 0x6f, 0x6e, 0x65, 0x00, 410x00, 0x6f, 0x6e, 0x6c, 0x79, 0x00, 0x6f, 0x6e, 0x65, 0x00,
420x6f, 0x63, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x4b, 420x6f, 0x63, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x4b,
430x00, 0x41, 0x65, 0x61, 0x63, 0x68, 0x6c, 0x00, 0x08, 0x39, 430x00, 0x10, 0x65, 0x8c, 0x00, 0x02, 0x6c, 0x00, 0x06, 0x39,
440x00, 0x6f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x3c, 0x00, 440x00, 0x6f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x3c, 0x00,
450x23, 0x01, 0xfa, 0x00, 0x0f, 0x3b, 0x00, 0x18, 0x11, 0x2e, 450x23, 0x01, 0xfa, 0x00, 0x0f, 0x3b, 0x00, 0x18, 0x11, 0x2e,
460x3c, 0x00, 0x70, 0x28, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 460x3c, 0x00, 0x70, 0x28, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
470x46, 0x01, 0xf1, 0x02, 0x2c, 0x00, 0x62, 0x79, 0x00, 0x64, 470x46, 0x01, 0xf2, 0x02, 0x2c, 0x00, 0x62, 0x79, 0x00, 0x64,
480x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x00, 0x6f, 0x66, 0x66, 480x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x00, 0x6f, 0x66, 0x66,
490x29, 0x2d, 0x00, 0x03, 0xf7, 0x00, 0x03, 0x37, 0x01, 0xf0, 490x29, 0x2d, 0x00, 0x03, 0xf7, 0x00, 0x02, 0x37, 0x01, 0xf0,
500x01, 0x27, 0x73, 0x00, 0x74, 0x77, 0x6f, 0x00, 0x6d, 0x61, 500x01, 0x27, 0x73, 0x00, 0x74, 0x77, 0x6f, 0x00, 0x6d, 0x61,
510x69, 0x6e, 0x00, 0x64, 0x69, 0x61, 0x67, 0x3a, 0x00, 0x1f, 510x69, 0x6e, 0x00, 0x64, 0x69, 0x61, 0x67, 0x3a, 0x00, 0x1f,
520x73, 0x75, 0x00, 0x19, 0x03, 0xeb, 0x01, 0x01, 0xe1, 0x01, 520x73, 0x75, 0x00, 0x1c, 0x00, 0xeb, 0x01, 0x01, 0xe1, 0x01,
530x85, 0x69, 0x76, 0x65, 0x6e, 0x00, 0x73, 0x6f, 0x6d, 0x5b, 530x85, 0x69, 0x76, 0x65, 0x6e, 0x00, 0x73, 0x6f, 0x6d, 0x5b,
540x01, 0x61, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0xbe, 0x01, 540x01, 0x61, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0xbe, 0x01,
550xf0, 0x03, 0x63, 0x6c, 0x75, 0x65, 0x73, 0x3b, 0x00, 0x79, 550xf0, 0x00, 0x63, 0x6c, 0x75, 0x65, 0x73, 0x3b, 0x00, 0x79,
560x6f, 0x75, 0x72, 0x00, 0x61, 0x69, 0x6d, 0x00, 0x69, 0x73, 560x6f, 0x75, 0x72, 0x00, 0x61, 0x69, 0x6d, 0x02, 0x02, 0x81,
570x8c, 0x01, 0x51, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2b, 0x00, 570x74, 0x6f, 0x00, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2b, 0x00,
580x4c, 0x72, 0x65, 0x73, 0x74, 0x37, 0x00, 0x90, 0x63, 0x6f, 580x4c, 0x72, 0x65, 0x73, 0x74, 0x37, 0x00, 0x90, 0x63, 0x6f,
590x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x66, 0x00, 0x50, 590x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x66, 0x00, 0x51,
600x55, 0x6e, 0x64, 0x65, 0x72, 0x1f, 0x00, 0x05, 0xd3, 0x00, 600x55, 0x6e, 0x64, 0x65, 0x72, 0x1f, 0x00, 0x04, 0xd3, 0x00,
610x90, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2c, 610x92, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2c,
620x16, 0x00, 0x09, 0x2d, 0x02, 0x24, 0x72, 0x65, 0x16, 0x02, 620xd0, 0x00, 0x07, 0x2d, 0x02, 0x24, 0x72, 0x65, 0x16, 0x02,
630x30, 0x6f, 0x72, 0x00, 0x43, 0x00, 0xa7, 0x61, 0x6e, 0x67, 630x30, 0x6f, 0x72, 0x00, 0x43, 0x00, 0xa7, 0x61, 0x6e, 0x67,
640x75, 0x6c, 0x61, 0x72, 0x2e, 0x00, 0x54, 0x40, 0x00, 0x52, 640x75, 0x6c, 0x61, 0x72, 0x2e, 0x00, 0x54, 0x40, 0x00, 0x53,
650x70, 0x75, 0x7a, 0x7a, 0x6c, 0x0c, 0x02, 0x00, 0x8f, 0x00, 650x70, 0x75, 0x7a, 0x7a, 0x6c, 0x0c, 0x02, 0xf3, 0x05, 0x69,
660xf2, 0x02, 0x33, 0x78, 0x33, 0x00, 0x28, 0x61, 0x00, 0x39, 660x73, 0x00, 0x33, 0x78, 0x33, 0x00, 0x28, 0x61, 0x00, 0x39,
670x78, 0x39, 0x00, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x1a, 670x78, 0x39, 0x00, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x1a,
680x02, 0x0a, 0xa9, 0x02, 0x41, 0x6e, 0x69, 0x6e, 0x65, 0x2a, 680x02, 0x09, 0xa9, 0x02, 0x41, 0x6e, 0x69, 0x6e, 0x65, 0x2a,
690x00, 0x02, 0x6b, 0x00, 0x21, 0x29, 0x2e, 0xfe, 0x00, 0xf1, 690x00, 0x02, 0x6b, 0x00, 0x21, 0x29, 0x2e, 0xfe, 0x00, 0xf1,
700x00, 0x63, 0x61, 0x6e, 0x00, 0x61, 0x6c, 0x73, 0x6f, 0x00, 700x00, 0x63, 0x61, 0x6e, 0x00, 0x61, 0x6c, 0x73, 0x6f, 0x00,
710x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x53, 0x00, 0x11, 0x73, 710x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x53, 0x00, 0x12, 0x73,
720x80, 0x02, 0x08, 0x7e, 0x00, 0x13, 0x00, 0x9f, 0x00, 0xa5, 720x80, 0x02, 0x07, 0x7e, 0x00, 0x13, 0x00, 0x9f, 0x00, 0x70,
730x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x00, 0x6f, 0x66, 730x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0xee, 0x00, 0x04,
740xa6, 0x00, 0x43, 0x6e, 0x65, 0x73, 0x2c, 0x80, 0x02, 0x32, 740xa6, 0x00, 0x43, 0x6e, 0x65, 0x73, 0x2c, 0x80, 0x02, 0x32,
750x73, 0x00, 0x32, 0x89, 0x00, 0x31, 0x36, 0x78, 0x36, 0x82, 750x73, 0x00, 0x32, 0x89, 0x00, 0x32, 0x36, 0x78, 0x36, 0xf0,
760x00, 0x0a, 0x81, 0x00, 0x76, 0x73, 0x69, 0x78, 0x00, 0x33, 760x02, 0x09, 0x81, 0x00, 0x76, 0x73, 0x69, 0x78, 0x00, 0x33,
770x78, 0x32, 0x80, 0x00, 0xb0, 0x41, 0x6c, 0x74, 0x65, 0x72, 770x78, 0x32, 0x80, 0x00, 0xb0, 0x41, 0x6c, 0x74, 0x65, 0x72,
780x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0xf3, 0x01, 0x12, 0x79, 780x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0xf3, 0x01, 0x13, 0x79,
790x8f, 0x00, 0x04, 0x8a, 0x00, 0xd0, 0x60, 0x6a, 0x69, 0x67, 790x8f, 0x00, 0x03, 0x8a, 0x00, 0xd1, 0x60, 0x6a, 0x69, 0x67,
800x73, 0x61, 0x77, 0x27, 0x00, 0x6d, 0x6f, 0x64, 0x65, 0xe6, 800x73, 0x61, 0x77, 0x27, 0x00, 0x6d, 0x6f, 0x64, 0x65, 0xe6,
810x02, 0x02, 0x81, 0x03, 0x0f, 0x32, 0x01, 0x01, 0xe0, 0x61, 810x02, 0x02, 0x81, 0x03, 0x0f, 0x32, 0x01, 0x00, 0xe0, 0x61,
820x72, 0x62, 0x69, 0x74, 0x72, 0x61, 0x72, 0x79, 0x00, 0x73, 820x72, 0x62, 0x69, 0x74, 0x72, 0x61, 0x72, 0x79, 0x00, 0x73,
830x68, 0x61, 0x70, 0xc0, 0x00, 0x21, 0x68, 0x69, 0xe7, 0x01, 830x68, 0x61, 0x70, 0xc0, 0x00, 0x21, 0x68, 0x69, 0xe7, 0x01,
840xf1, 0x00, 0x66, 0x66, 0x65, 0x72, 0x00, 0x62, 0x65, 0x74, 840xf1, 0x00, 0x66, 0x66, 0x65, 0x72, 0x00, 0x62, 0x65, 0x74,
850x77, 0x65, 0x65, 0x6e, 0x00, 0x69, 0x6e, 0x8f, 0x00, 0x33, 850x77, 0x65, 0x65, 0x6e, 0x00, 0x69, 0x6e, 0x8f, 0x00, 0x00,
860x75, 0x61, 0x6c, 0x40, 0x01, 0x10, 0x73, 0x9d, 0x01, 0xf0, 860x1f, 0x01, 0x02, 0x40, 0x01, 0x10, 0x73, 0x9d, 0x01, 0xf1,
870x02, 0x41, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x00, 0x61, 870x02, 0x41, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x00, 0x61,
880x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x70, 0x00, 880x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x70, 0x00,
890x01, 0x56, 0x01, 0x20, 0x60, 0x6b, 0x90, 0x03, 0xb2, 0x72, 890x00, 0x56, 0x01, 0x20, 0x60, 0x6b, 0x90, 0x03, 0xb3, 0x72,
900x27, 0x2e, 0x00, 0x49, 0x6e, 0x00, 0x74, 0x68, 0x69, 0x73, 900x27, 0x2e, 0x00, 0x49, 0x6e, 0x00, 0x74, 0x68, 0x69, 0x73,
910x8a, 0x00, 0x01, 0x10, 0x02, 0x02, 0x78, 0x00, 0x33, 0x6e, 910x8a, 0x00, 0x01, 0x10, 0x02, 0x01, 0x78, 0x00, 0x33, 0x6e,
920x6f, 0x74, 0x3b, 0x02, 0x21, 0x69, 0x6e, 0x98, 0x00, 0x73, 920x6f, 0x74, 0x3b, 0x02, 0x21, 0x69, 0x6e, 0x98, 0x00, 0x40,
930x66, 0x6f, 0x72, 0x6d, 0x00, 0x6f, 0x66, 0xca, 0x03, 0x33, 930x66, 0x6f, 0x72, 0x6d, 0x1d, 0x01, 0x02, 0xca, 0x03, 0x33,
940x2d, 0x69, 0x6e, 0x27, 0x01, 0x24, 0x73, 0x3b, 0x3b, 0x01, 940x2d, 0x69, 0x6e, 0x27, 0x01, 0x24, 0x73, 0x3b, 0x3b, 0x01,
950x15, 0x2c, 0xb9, 0x03, 0x0d, 0x4a, 0x04, 0x91, 0x60, 0x63, 950x16, 0x2c, 0x0d, 0x04, 0x0c, 0x4a, 0x04, 0x91, 0x60, 0x63,
960x61, 0x67, 0x65, 0x73, 0x27, 0x00, 0x62, 0x7d, 0x03, 0x81, 960x61, 0x67, 0x65, 0x73, 0x27, 0x00, 0x62, 0x7d, 0x03, 0x81,
970x6f, 0x75, 0x72, 0x65, 0x64, 0x00, 0x6c, 0x69, 0x60, 0x01, 970x6f, 0x75, 0x72, 0x65, 0x64, 0x00, 0x6c, 0x69, 0x60, 0x01,
980x30, 0x61, 0x6e, 0x64, 0x5c, 0x00, 0x02, 0xbe, 0x02, 0x00, 980x30, 0x61, 0x6e, 0x64, 0x5c, 0x00, 0x02, 0xbe, 0x02, 0x00,
990x27, 0x00, 0x02, 0x46, 0x00, 0x91, 0x61, 0x6d, 0x65, 0x00, 990x27, 0x00, 0x02, 0x46, 0x00, 0x91, 0x61, 0x6d, 0x65, 0x00,
1000x74, 0x65, 0x6c, 0x6c, 0x73, 0x3c, 0x01, 0x43, 0x77, 0x68, 1000x74, 0x65, 0x6c, 0x6c, 0x73, 0x3c, 0x01, 0x10, 0x77, 0xfa,
1010x61, 0x74, 0x1e, 0x01, 0x01, 0x85, 0x00, 0x30, 0x61, 0x6c, 1010x03, 0x02, 0x1e, 0x01, 0x01, 0x85, 0x00, 0x32, 0x61, 0x6c,
1020x6c, 0x0f, 0x00, 0x02, 0xee, 0x02, 0x00, 0xbc, 0x01, 0x01, 1020x6c, 0x75, 0x02, 0x00, 0xee, 0x02, 0x00, 0xbc, 0x01, 0x02,
1030x1c, 0x04, 0x02, 0x3f, 0x00, 0x90, 0x73, 0x68, 0x6f, 0x75, 1030x1c, 0x04, 0x01, 0x3f, 0x00, 0x90, 0x73, 0x68, 0x6f, 0x75,
1040x6c, 0x64, 0x00, 0x62, 0x65, 0x86, 0x01, 0x63, 0x73, 0x6f, 1040x6c, 0x64, 0x00, 0x62, 0x65, 0x86, 0x01, 0x63, 0x73, 0x6f,
1050x2c, 0x00, 0x6e, 0x6f, 0xc6, 0x03, 0xe0, 0x6d, 0x61, 0x79, 1050x2c, 0x00, 0x6e, 0x6f, 0xc6, 0x03, 0xe0, 0x6d, 0x61, 0x79,
1060x00, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x00, 0x6d, 0x6f, 1060x00, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x00, 0x6d, 0x6f,
1070x72, 0x69, 0x00, 0x71, 0x61, 0x6e, 0x00, 0x6f, 0x6e, 0x63, 1070x72, 0x69, 0x00, 0x40, 0x61, 0x6e, 0x00, 0x6f, 0x3e, 0x03,
1080x65, 0x15, 0x02, 0x41, 0x69, 0x6e, 0x00, 0x61, 0x42, 0x00, 1080x00, 0x15, 0x02, 0x41, 0x69, 0x6e, 0x00, 0x61, 0x42, 0x00,
1090x31, 0x2c, 0x00, 0x65, 0xf8, 0x00, 0x01, 0xf7, 0x02, 0x02, 1090x31, 0x2c, 0x00, 0x65, 0xf8, 0x00, 0x02, 0xf7, 0x02, 0x01,
1100x54, 0x00, 0x62, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x65, 0xee, 1100x54, 0x00, 0x62, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x65, 0xee,
1110x04, 0xa1, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x69, 1110x04, 0xa1, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x69,
1120x65, 0x73, 0x75, 0x03, 0x30, 0x78, 0x69, 0x73, 0xf0, 0x02, 1120x65, 0x73, 0x75, 0x03, 0x30, 0x78, 0x69, 0x73, 0xf0, 0x02,
1130x71, 0x00, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x78, 0x01, 1130x71, 0x00, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x78, 0x01,
1140x20, 0x49, 0x66, 0xb5, 0x00, 0x04, 0xed, 0x01, 0x18, 0x61, 1140x21, 0x49, 0x66, 0xb5, 0x00, 0x03, 0xed, 0x01, 0x19, 0x61,
1150xd3, 0x02, 0x03, 0xbf, 0x01, 0x87, 0x72, 0x65, 0x71, 0x75, 1150xd3, 0x02, 0x02, 0xbf, 0x01, 0x87, 0x72, 0x65, 0x71, 0x75,
1160x69, 0x72, 0x65, 0x73, 0x88, 0x00, 0x12, 0x39, 0xa5, 0x00, 1160x69, 0x72, 0x65, 0x73, 0x88, 0x00, 0x13, 0x39, 0xcd, 0x00,
1170x03, 0x38, 0x03, 0x42, 0x61, 0x64, 0x64, 0x69, 0x32, 0x04, 1170x02, 0x46, 0x01, 0x42, 0x61, 0x64, 0x64, 0x69, 0x32, 0x04,
1180x04, 0xe4, 0x00, 0x40, 0x77, 0x69, 0x6c, 0x6c, 0x4a, 0x05, 1180x04, 0xe4, 0x00, 0x40, 0x77, 0x69, 0x6c, 0x6c, 0x4a, 0x05,
1190x74, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x72, 0x73, 0x96, 0x03, 1190x40, 0x6c, 0x65, 0x74, 0x74, 0x87, 0x03, 0x03, 0x96, 0x03,
1200xb0, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, 0x65, 0x74, 0x2e, 1200xb0, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, 0x65, 0x74, 0x2e,
1210x00, 0x46, 0x45, 0x01, 0x50, 0x78, 0x61, 0x6d, 0x70, 0x6c, 1210x00, 0x46, 0x45, 0x01, 0x50, 0x78, 0x61, 0x6d, 0x70, 0x6c,
1220x53, 0x02, 0x09, 0x83, 0x00, 0x30, 0x33, 0x78, 0x34, 0x2d, 1220x53, 0x02, 0x09, 0x83, 0x00, 0x30, 0x33, 0x78, 0x34, 0x2d,
1230x00, 0x16, 0x6e, 0x34, 0x01, 0x04, 0x48, 0x02, 0x51, 0x67, 1230x00, 0x18, 0x6e, 0x34, 0x01, 0x02, 0x89, 0x00, 0x20, 0x67,
1240x6f, 0x00, 0x69, 0x6e, 0x00, 0x04, 0x01, 0xb9, 0x01, 0x04, 1240x6f, 0x3d, 0x01, 0x01, 0x00, 0x04, 0x01, 0xb9, 0x01, 0x04,
1250x66, 0x00, 0x02, 0x94, 0x05, 0xf1, 0x01, 0x39, 0x2c, 0x00, 1250x66, 0x00, 0x01, 0x94, 0x05, 0xf1, 0x01, 0x39, 0x2c, 0x00,
1260x70, 0x6c, 0x75, 0x73, 0x00, 0x60, 0x61, 0x27, 0x2c, 0x00, 1260x70, 0x6c, 0x75, 0x73, 0x00, 0x60, 0x61, 0x27, 0x2c, 0x00,
1270x60, 0x62, 0x27, 0xac, 0x01, 0x30, 0x60, 0x63, 0x27, 0xb1, 1270x60, 0x62, 0x27, 0xac, 0x01, 0x30, 0x60, 0x63, 0x27, 0xb1,
1280x03, 0x20, 0x69, 0x73, 0xd1, 0x02, 0x20, 0x6e, 0x6f, 0xde, 1280x03, 0x20, 0x69, 0x73, 0xd1, 0x02, 0x21, 0x6e, 0x6f, 0xde,
1290x05, 0x03, 0x67, 0x00, 0x12, 0x65, 0xc9, 0x01, 0x02, 0x5b, 1290x05, 0x02, 0x67, 0x00, 0x12, 0x65, 0xc9, 0x01, 0x02, 0x5b,
1300x02, 0x08, 0x88, 0x02, 0xb1, 0x49, 0x00, 0x66, 0x69, 0x72, 1300x02, 0x08, 0x88, 0x02, 0xb2, 0x49, 0x00, 0x66, 0x69, 0x72,
1310x73, 0x74, 0x00, 0x73, 0x61, 0x77, 0x6d, 0x02, 0x03, 0x1c, 1310x73, 0x74, 0x00, 0x73, 0x61, 0x77, 0x6d, 0x02, 0x03, 0x11,
1320x00, 0x00, 0x7a, 0x00, 0xf2, 0x0a, 0x4e, 0x69, 0x6b, 0x6f, 1320x01, 0xf2, 0x0d, 0x69, 0x6e, 0x00, 0x4e, 0x69, 0x6b, 0x6f,
1330x6c, 0x69, 0x00, 0x5b, 0x35, 0x5d, 0x2c, 0x00, 0x61, 0x6c, 1330x6c, 0x69, 0x00, 0x5b, 0x35, 0x5d, 0x2c, 0x00, 0x61, 0x6c,
1340x74, 0x68, 0x6f, 0x75, 0x67, 0x68, 0x00, 0x69, 0x74, 0x27, 1340x74, 0x68, 0x6f, 0x75, 0x67, 0x68, 0x00, 0x69, 0x74, 0x27,
1350x73, 0xba, 0x03, 0x10, 0x62, 0xdd, 0x02, 0x30, 0x70, 0x6f, 1350x73, 0xba, 0x03, 0x10, 0x62, 0xdd, 0x02, 0x30, 0x70, 0x6f,
1360x70, 0xa9, 0x03, 0x40, 0x69, 0x73, 0x65, 0x64, 0x41, 0x02, 1360x70, 0xa9, 0x03, 0x40, 0x69, 0x73, 0x65, 0x64, 0x41, 0x02,
1370xf0, 0x00, 0x76, 0x61, 0x72, 0x69, 0x6f, 0x75, 0x73, 0x00, 1370xf0, 0x00, 0x76, 0x61, 0x72, 0x69, 0x6f, 0x75, 0x73, 0x00,
1380x6e, 0x65, 0x77, 0x73, 0x70, 0x61, 0x70, 0x0c, 0x01, 0x15, 1380x6e, 0x65, 0x77, 0x73, 0x70, 0x61, 0x70, 0x0c, 0x01, 0x15,
1390x75, 0x86, 0x04, 0x10, 0x6e, 0x38, 0x02, 0xb0, 0x60, 0x53, 1390x75, 0x86, 0x04, 0x10, 0x6e, 0x38, 0x02, 0x80, 0x60, 0x53,
1400x75, 0x64, 0x6f, 0x6b, 0x75, 0x27, 0x00, 0x6f, 0x72, 0x0c, 1400x75, 0x64, 0x6f, 0x6b, 0x75, 0x27, 0x68, 0x04, 0x50, 0x60,
1410x00, 0x20, 0x00, 0x44, 0x0d, 0x00, 0xf1, 0x01, 0x2e, 0x00, 1410x53, 0x75, 0x00, 0x44, 0x0d, 0x00, 0xf1, 0x01, 0x2e, 0x00,
1420x48, 0x6f, 0x77, 0x61, 0x72, 0x64, 0x00, 0x47, 0x61, 0x72, 1420x48, 0x6f, 0x77, 0x61, 0x72, 0x64, 0x00, 0x47, 0x61, 0x72,
1430x6e, 0x73, 0x00, 0x69, 0x50, 0x05, 0x40, 0x73, 0x69, 0x64, 1430x6e, 0x73, 0x00, 0x69, 0x50, 0x05, 0x40, 0x73, 0x69, 0x64,
1440x65, 0x8c, 0x02, 0x20, 0x74, 0x68, 0x8e, 0x00, 0x62, 0x76, 1440x65, 0x8c, 0x02, 0x20, 0x74, 0x68, 0x8e, 0x00, 0x64, 0x76,
1450x65, 0x6e, 0x74, 0x6f, 0x72, 0x5a, 0x01, 0x02, 0x2c, 0x03, 1450x65, 0x6e, 0x74, 0x6f, 0x72, 0x5a, 0x01, 0x00, 0x12, 0x03,
1460x21, 0x72, 0x6e, 0xf8, 0x02, 0x03, 0x13, 0x00, 0x03, 0xb8, 1460x25, 0x72, 0x6e, 0xf8, 0x02, 0x00, 0x13, 0x00, 0x02, 0xb8,
1470x00, 0x02, 0xb4, 0x02, 0x63, 0x69, 0x74, 0x00, 0x77, 0x61, 1470x00, 0x02, 0xb4, 0x02, 0x63, 0x69, 0x74, 0x00, 0x77, 0x61,
1480x73, 0xda, 0x00, 0x72, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 1480x73, 0xda, 0x00, 0x72, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73,
1490x68, 0xe2, 0x06, 0xd2, 0x44, 0x65, 0x6c, 0x6c, 0x20, 0x50, 1490x68, 0xe2, 0x06, 0xd2, 0x44, 0x65, 0x6c, 0x6c, 0x20, 0x50,
@@ -153,233 +153,233 @@ const char help_text[] = {
1530x03, 0x65, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x65, 1530x03, 0x65, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x65,
1540x00, 0x74, 0x72, 0x65, 0x61, 0x74, 0x6d, 0x65, 0x6e, 0x6f, 1540x00, 0x74, 0x72, 0x65, 0x61, 0x74, 0x6d, 0x65, 0x6e, 0x6f,
1550x05, 0x7a, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x7b, 1550x05, 0x7a, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x7b,
1560x00, 0x00, 0x74, 0x01, 0x01, 0x4f, 0x07, 0x00, 0x84, 0x02, 1560x00, 0x01, 0x45, 0x04, 0x00, 0x4f, 0x07, 0x00, 0x84, 0x02,
1570xf0, 0x05, 0x00, 0x6f, 0x6e, 0x00, 0x57, 0x69, 0x6b, 0x69, 1570xf0, 0x02, 0x00, 0x6f, 0x6e, 0x00, 0x57, 0x69, 0x6b, 0x69,
1580x70, 0x65, 0x64, 0x69, 0x61, 0x00, 0x5b, 0x36, 0x5d, 0x2e, 1580x70, 0x65, 0x64, 0x69, 0x61, 0x00, 0x5b, 0x36, 0x5d, 0x6c,
1590x00, 0x00, 0x4a, 0x01, 0xd1, 0x00, 0x68, 0x74, 0x74, 0x70, 1590x01, 0xf1, 0x01, 0x5b, 0x35, 0x5d, 0x00, 0x68, 0x74, 0x74,
1600x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6e, 0x60, 0x01, 1600x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6e, 0x60,
1610xa3, 0x2e, 0x63, 0x6f, 0x2e, 0x6a, 0x70, 0x2f, 0x65, 0x6e, 1610x01, 0xa3, 0x2e, 0x63, 0x6f, 0x2e, 0x6a, 0x70, 0x2f, 0x65,
1620x2f, 0x96, 0x01, 0x21, 0x2f, 0x73, 0x22, 0x01, 0xc1, 0x2e, 1620x6e, 0x2f, 0x96, 0x01, 0x21, 0x2f, 0x73, 0x22, 0x01, 0xc1,
1630x68, 0x74, 0x6d, 0x6c, 0x00, 0x28, 0x62, 0x65, 0x77, 0x61, 1630x2e, 0x68, 0x74, 0x6d, 0x6c, 0x00, 0x28, 0x62, 0x65, 0x77,
1640x72, 0x1f, 0x06, 0x60, 0x46, 0x6c, 0x61, 0x73, 0x68, 0x29, 1640x61, 0x72, 0x1f, 0x06, 0x60, 0x46, 0x6c, 0x61, 0x73, 0x68,
1650x47, 0x00, 0x15, 0x36, 0x47, 0x00, 0x44, 0x65, 0x6e, 0x2e, 1650x29, 0x47, 0x00, 0x15, 0x36, 0x47, 0x00, 0x44, 0x65, 0x6e,
1660x77, 0x66, 0x00, 0x50, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x0e, 1660x2e, 0x77, 0x66, 0x00, 0x50, 0x2e, 0x6f, 0x72, 0x67, 0x2f,
1670x00, 0x12, 0x2f, 0x63, 0x01, 0x72, 0x00, 0x00, 0x00, 0x31, 1670x0e, 0x00, 0x12, 0x2f, 0x63, 0x01, 0x72, 0x00, 0x00, 0x00,
1680x31, 0x2e, 0x31, 0x60, 0x08, 0x00, 0xa0, 0x06, 0x40, 0x72, 1680x31, 0x31, 0x2e, 0x31, 0x60, 0x08, 0x00, 0xa0, 0x06, 0x40,
1690x6f, 0x6c, 0x73, 0x69, 0x08, 0x11, 0x54, 0x46, 0x06, 0x20, 1690x72, 0x6f, 0x6c, 0x73, 0x69, 0x08, 0x11, 0x54, 0x46, 0x06,
1700x79, 0x00, 0x19, 0x00, 0xe3, 0x2c, 0x00, 0x73, 0x69, 0x6d, 1700x20, 0x79, 0x00, 0x19, 0x00, 0xe3, 0x2c, 0x00, 0x73, 0x69,
1710x70, 0x6c, 0x79, 0x00, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5c, 1710x6d, 0x70, 0x6c, 0x79, 0x00, 0x63, 0x6c, 0x69, 0x63, 0x6b,
1720x01, 0x21, 0x75, 0x73, 0x00, 0x02, 0x01, 0x5f, 0x08, 0x43, 1720x5c, 0x01, 0x21, 0x75, 0x73, 0x00, 0x02, 0x01, 0x5f, 0x08,
1730x6d, 0x70, 0x74, 0x79, 0x4e, 0x04, 0x00, 0x5b, 0x01, 0x03, 1730x44, 0x6d, 0x70, 0x74, 0x79, 0x75, 0x05, 0x00, 0x5b, 0x01,
1740xab, 0x02, 0x35, 0x79, 0x70, 0x65, 0x28, 0x08, 0x23, 0x6f, 1740x02, 0xab, 0x02, 0x35, 0x79, 0x70, 0x65, 0x28, 0x08, 0x23,
1750x72, 0xf8, 0x02, 0x22, 0x00, 0x6f, 0xc5, 0x02, 0x50, 0x6b, 1750x6f, 0x72, 0xf8, 0x02, 0x22, 0x00, 0x6f, 0xc5, 0x02, 0x50,
1760x65, 0x79, 0x62, 0x6f, 0xce, 0x01, 0x21, 0x74, 0x6f, 0x92, 1760x6b, 0x65, 0x79, 0x62, 0x6f, 0xce, 0x01, 0x21, 0x74, 0x6f,
1770x04, 0x01, 0x00, 0x04, 0x03, 0x44, 0x00, 0x14, 0x2e, 0x81, 1770x92, 0x04, 0x02, 0x00, 0x04, 0x02, 0x44, 0x00, 0x14, 0x2e,
1780x03, 0x30, 0x6d, 0x61, 0x6b, 0x43, 0x00, 0x8f, 0x6d, 0x69, 1780x81, 0x03, 0x30, 0x6d, 0x61, 0x6b, 0x43, 0x00, 0x8f, 0x6d,
1790x73, 0x74, 0x61, 0x6b, 0x65, 0x2c, 0x80, 0x00, 0x00, 0x03, 1790x69, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x2c, 0x80, 0x00, 0x01,
1800xf9, 0x01, 0x03, 0xd3, 0x06, 0x08, 0x84, 0x00, 0x81, 0x70, 1800x02, 0xf9, 0x01, 0x03, 0xd3, 0x06, 0x08, 0x84, 0x00, 0x81,
1810x72, 0x65, 0x73, 0x73, 0x00, 0x53, 0x70, 0x0a, 0x07, 0x70, 1810x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x53, 0x70, 0x0a, 0x07,
1820x6f, 0x00, 0x63, 0x6c, 0x65, 0x61, 0x72, 0xf4, 0x01, 0x20, 1820x40, 0x6f, 0x00, 0x63, 0x6c, 0x36, 0x04, 0x50, 0x69, 0x74,
1830x61, 0x67, 0x95, 0x07, 0x61, 0x28, 0x6f, 0x72, 0x00, 0x75, 1830x00, 0x61, 0x67, 0x95, 0x07, 0x62, 0x28, 0x6f, 0x72, 0x00,
1840x73, 0xab, 0x04, 0x00, 0x03, 0x07, 0xa7, 0x6f, 0x00, 0x66, 1840x75, 0x73, 0xab, 0x04, 0xd7, 0x55, 0x6e, 0x64, 0x6f, 0x00,
1850x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x29, 0xff, 0x03, 0x61, 1850x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x29, 0xff, 0x03,
1860x72, 0x69, 0x67, 0x68, 0x74, 0x2d, 0x74, 0x00, 0x01, 0xea, 1860x62, 0x72, 0x69, 0x67, 0x68, 0x74, 0x2d, 0x74, 0x00, 0x01,
1870x00, 0x0f, 0xe2, 0x00, 0x04, 0x03, 0x58, 0x07, 0x11, 0x2c, 1870x5c, 0x04, 0x0f, 0xe2, 0x00, 0x04, 0x02, 0x58, 0x07, 0x12,
1880xc2, 0x00, 0x03, 0x0d, 0x00, 0x05, 0x87, 0x03, 0x51, 0x65, 1880x2c, 0xc2, 0x00, 0x02, 0x0d, 0x00, 0x05, 0x87, 0x03, 0x52,
1890x6e, 0x74, 0x65, 0x72, 0x56, 0x02, 0x07, 0x1e, 0x08, 0x00, 1890x65, 0x6e, 0x74, 0x65, 0x72, 0x56, 0x02, 0x06, 0x1e, 0x08,
1900x8e, 0x06, 0x41, 0x61, 0x00, 0x60, 0x70, 0x62, 0x02, 0x65, 1900x00, 0x8e, 0x06, 0x41, 0x61, 0x00, 0x60, 0x70, 0x62, 0x02,
1910x00, 0x6d, 0x61, 0x72, 0x6b, 0x27, 0xf1, 0x06, 0x02, 0xde, 1910x66, 0x00, 0x6d, 0x61, 0x72, 0x6b, 0x27, 0xf1, 0x06, 0x01,
1920x09, 0x07, 0x1b, 0x00, 0x11, 0x73, 0x94, 0x03, 0x75, 0x6d, 1920xde, 0x09, 0x07, 0x1b, 0x00, 0x11, 0x73, 0x94, 0x03, 0x76,
1930x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0xc5, 0x07, 0x05, 0x51, 1930x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0xc5, 0x07, 0x04,
1940x00, 0x35, 0x61, 0x6d, 0x65, 0x36, 0x01, 0x11, 0x53, 0x08, 1940x51, 0x00, 0x00, 0x2f, 0x03, 0x04, 0x36, 0x01, 0x12, 0x53,
1950x00, 0x05, 0x68, 0x08, 0x36, 0x69, 0x6e, 0x67, 0xed, 0x05, 1950xd0, 0x05, 0x04, 0x68, 0x08, 0x00, 0xd5, 0x04, 0x06, 0xed,
1960x03, 0x39, 0x00, 0x04, 0xf5, 0x03, 0x01, 0x9e, 0x03, 0x04, 1960x05, 0x05, 0xfe, 0x07, 0x02, 0xf5, 0x03, 0x01, 0x9e, 0x03,
1970x29, 0x00, 0x09, 0x6f, 0x00, 0x10, 0x2e, 0xfd, 0x01, 0x04, 1970x03, 0x29, 0x00, 0x09, 0x6f, 0x00, 0x10, 0x2e, 0xfd, 0x01,
1980xc1, 0x05, 0x40, 0x70, 0x61, 0x79, 0x73, 0x7f, 0x05, 0x70, 1980x04, 0xc1, 0x05, 0x40, 0x70, 0x61, 0x79, 0x73, 0x7f, 0x05,
1990x61, 0x74, 0x74, 0x65, 0x6e, 0x74, 0x69, 0xbc, 0x01, 0x18, 1990x50, 0x61, 0x74, 0x74, 0x65, 0x6e, 0xcf, 0x04, 0x01, 0x5e,
2000x6f, 0x2e, 0x00, 0x00, 0x5f, 0x07, 0x10, 0x6f, 0xb5, 0x04, 2000x08, 0x07, 0x2e, 0x00, 0x40, 0x2c, 0x00, 0x73, 0x6f, 0xb5,
2010x00, 0x4f, 0x08, 0x01, 0xe5, 0x05, 0x00, 0x3a, 0x01, 0x04, 2010x04, 0x00, 0x4f, 0x08, 0x02, 0xe5, 0x05, 0x00, 0x3a, 0x01,
2020x5a, 0x01, 0x10, 0x6d, 0xbb, 0x00, 0x00, 0xa9, 0x03, 0x50, 2020x03, 0x5a, 0x01, 0x11, 0x6d, 0xbb, 0x00, 0x50, 0x69, 0x73,
2030x75, 0x70, 0x00, 0x74, 0x6f, 0x1a, 0x00, 0x14, 0x3a, 0x49, 2030x00, 0x75, 0x70, 0x38, 0x00, 0x45, 0x79, 0x6f, 0x75, 0x3a,
2040x07, 0x06, 0x23, 0x00, 0x00, 0x76, 0x0a, 0x30, 0x65, 0x6d, 2040x49, 0x07, 0x05, 0x23, 0x00, 0x00, 0x76, 0x0a, 0x30, 0x65,
2050x69, 0x01, 0x04, 0x10, 0x73, 0x43, 0x01, 0x01, 0x70, 0x05, 2050x6d, 0x69, 0x01, 0x04, 0x12, 0x73, 0x43, 0x01, 0x81, 0x61,
2060x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x34, 0x04, 0x04, 0x32, 2060x00, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0xdd, 0x07, 0x03,
2070x01, 0x41, 0x6e, 0x65, 0x65, 0x64, 0xdb, 0x08, 0x10, 0x62, 2070x32, 0x01, 0x41, 0x6e, 0x65, 0x65, 0x64, 0xdb, 0x08, 0x10,
2080xd4, 0x08, 0x10, 0x2d, 0x27, 0x05, 0x41, 0x69, 0x6e, 0x65, 2080x62, 0xd4, 0x08, 0x10, 0x2d, 0x27, 0x05, 0x42, 0x69, 0x6e,
2090x64, 0xfd, 0x05, 0x01, 0x54, 0x00, 0x42, 0x6b, 0x6e, 0x6f, 2090x65, 0x64, 0xfd, 0x05, 0x00, 0x54, 0x00, 0x42, 0x6b, 0x6e,
2100x77, 0x93, 0x03, 0x4a, 0x61, 0x62, 0x6f, 0x75, 0x45, 0x00, 2100x6f, 0x77, 0x93, 0x03, 0x4b, 0x61, 0x62, 0x6f, 0x75, 0x45,
2110x05, 0xa2, 0x01, 0x2f, 0x6f, 0x72, 0x80, 0x00, 0x02, 0x55, 2110x00, 0x04, 0xa2, 0x01, 0x2f, 0x6f, 0x72, 0x80, 0x00, 0x02,
2120x6c, 0x69, 0x73, 0x74, 0x73, 0xa8, 0x03, 0x5a, 0x6f, 0x73, 2120x55, 0x6c, 0x69, 0x73, 0x74, 0x73, 0xa8, 0x03, 0x5a, 0x6f,
2130x73, 0x69, 0x62, 0x6a, 0x01, 0x11, 0x61, 0x4a, 0x07, 0x04, 2130x73, 0x73, 0x69, 0x62, 0x6a, 0x01, 0x14, 0x61, 0x85, 0x09,
2140x31, 0x07, 0x00, 0x48, 0x00, 0x00, 0xf8, 0x02, 0x20, 0x74, 2140x01, 0x8d, 0x00, 0x01, 0x48, 0x00, 0x50, 0x61, 0x6e, 0x79,
2150x68, 0x62, 0x01, 0x32, 0x65, 0x6c, 0x73, 0x82, 0x00, 0xa2, 2150x74, 0x68, 0x62, 0x01, 0x32, 0x65, 0x6c, 0x73, 0x82, 0x00,
2160x66, 0x65, 0x65, 0x6c, 0x00, 0x6c, 0x69, 0x6b, 0x65, 0x2e, 2160xa2, 0x66, 0x65, 0x65, 0x6c, 0x00, 0x6c, 0x69, 0x6b, 0x65,
2170x3f, 0x03, 0x41, 0x65, 0x72, 0x61, 0x73, 0xa8, 0x0b, 0x49, 2170x2e, 0x3f, 0x03, 0x41, 0x65, 0x72, 0x61, 0x73, 0xa8, 0x0b,
2180x69, 0x6e, 0x67, 0x6c, 0xd3, 0x01, 0x18, 0x2c, 0x5b, 0x02, 2180x49, 0x69, 0x6e, 0x67, 0x6c, 0xd3, 0x01, 0x1c, 0x2c, 0x5b,
2190x0c, 0x1b, 0x02, 0x21, 0x6e, 0x64, 0x58, 0x02, 0x04, 0xde, 2190x02, 0x08, 0x1b, 0x02, 0x22, 0x6e, 0x64, 0x58, 0x02, 0x05,
2200x01, 0x04, 0x88, 0x00, 0x02, 0xb8, 0x02, 0x01, 0x15, 0x08, 2200xde, 0x01, 0x03, 0x52, 0x02, 0x01, 0xb8, 0x02, 0x01, 0x15,
2210x29, 0x6c, 0x6c, 0x83, 0x01, 0x0a, 0x9c, 0x02, 0x22, 0x72, 2210x08, 0x2a, 0x6c, 0x6c, 0x20, 0x02, 0x09, 0x9c, 0x02, 0x22,
2220x65, 0x79, 0x00, 0x61, 0x64, 0x00, 0x77, 0x68, 0x65, 0x6e, 2220x72, 0x65, 0x79, 0x00, 0x30, 0x64, 0x00, 0x77, 0xa3, 0x02,
2230x99, 0x00, 0x33, 0x6c, 0x65, 0x66, 0x6c, 0x00, 0x06, 0x5e, 2230x00, 0x99, 0x00, 0x34, 0x6c, 0x65, 0x66, 0x6c, 0x00, 0x05,
2240x00, 0x17, 0x61, 0x14, 0x01, 0x0f, 0x2a, 0x00, 0x01, 0x07, 2240x5e, 0x00, 0x18, 0x61, 0x14, 0x01, 0x0f, 0x2a, 0x00, 0x05,
2250x43, 0x03, 0x10, 0x73, 0x43, 0x03, 0x36, 0x2e, 0x00, 0x52, 2250x02, 0x43, 0x03, 0x10, 0x73, 0x43, 0x03, 0x36, 0x2e, 0x00,
2260xb3, 0x00, 0x35, 0x69, 0x6e, 0x67, 0x20, 0x00, 0x00, 0xde, 2260x52, 0xb3, 0x00, 0x00, 0xf7, 0x00, 0x05, 0x20, 0x00, 0x00,
2270x00, 0x02, 0x23, 0x00, 0x01, 0xf4, 0x02, 0x00, 0x58, 0x02, 2270x0d, 0x00, 0x01, 0x23, 0x00, 0x02, 0xf4, 0x02, 0x01, 0x58,
2280x03, 0xfb, 0x00, 0x0c, 0x56, 0x02, 0x0b, 0x53, 0x09, 0x05, 2280x02, 0x02, 0xfb, 0x00, 0x0c, 0x56, 0x02, 0x0b, 0x53, 0x09,
2290x7f, 0x03, 0x60, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x11, 2290x04, 0x7f, 0x03, 0x60, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72,
2300x04, 0x01, 0xe1, 0x01, 0x31, 0x6d, 0x6f, 0x76, 0x18, 0x00, 2300x11, 0x04, 0x01, 0xe1, 0x01, 0x32, 0x6d, 0x6f, 0x76, 0x18,
2310x01, 0x38, 0x00, 0x30, 0x00, 0x61, 0x72, 0x29, 0x05, 0x05, 2310x00, 0x00, 0x38, 0x00, 0x31, 0x00, 0x61, 0x72, 0x29, 0x05,
2320x98, 0x08, 0x33, 0x2e, 0x00, 0x50, 0x74, 0x00, 0x03, 0xde, 2320x04, 0x98, 0x08, 0x34, 0x2e, 0x00, 0x50, 0x74, 0x00, 0x02,
2330x0a, 0x40, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x00, 0x86, 0x00, 2330xde, 0x0a, 0x40, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x00, 0x86,
2340x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x73, 0x3a, 0x00, 0x10, 2340x00, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x73, 0x3a, 0x00,
2350x28, 0x9b, 0x0c, 0x00, 0xe8, 0x00, 0x52, 0x6f, 0x72, 0x6d, 2350x11, 0x28, 0x9b, 0x0c, 0x82, 0x61, 0x00, 0x6e, 0x6f, 0x72,
2360x61, 0x6c, 0x14, 0x00, 0x00, 0x13, 0x0d, 0x08, 0x97, 0x00, 2360x6d, 0x61, 0x6c, 0x14, 0x00, 0x00, 0x13, 0x0d, 0x08, 0x97,
2370x24, 0x29, 0x2c, 0x12, 0x01, 0x35, 0x69, 0x6e, 0x67, 0x14, 2370x00, 0x24, 0x29, 0x2c, 0x12, 0x01, 0x01, 0xd3, 0x00, 0x04,
2380x01, 0x00, 0x51, 0x01, 0x2f, 0x69, 0x73, 0xbb, 0x03, 0x02, 2380x6b, 0x01, 0x20, 0x69, 0x6e, 0xb5, 0x02, 0x0f, 0xbb, 0x03,
2390x04, 0x73, 0x04, 0x00, 0x86, 0x08, 0x80, 0x72, 0x6f, 0x70, 2390x03, 0x03, 0x0e, 0x00, 0x80, 0x61, 0x70, 0x70, 0x72, 0x6f,
2400x72, 0x69, 0x61, 0x74, 0x65, 0xda, 0x0c, 0x13, 0x3b, 0x44, 2400x70, 0x72, 0x69, 0xfa, 0x05, 0x44, 0x77, 0x61, 0x79, 0x3b,
2410x00, 0x02, 0x8c, 0x01, 0x20, 0x30, 0x00, 0x5e, 0x04, 0x04, 2410x44, 0x00, 0x01, 0x8c, 0x01, 0x21, 0x30, 0x00, 0x5e, 0x04,
2420xa6, 0x00, 0x03, 0x1e, 0x01, 0x22, 0x62, 0x61, 0x16, 0x04, 2420x04, 0xa6, 0x00, 0x02, 0x1e, 0x01, 0x23, 0x62, 0x61, 0x16,
2430x03, 0x8a, 0x04, 0x13, 0x61, 0x9b, 0x03, 0x05, 0xbd, 0x03, 2430x04, 0x02, 0x8a, 0x04, 0x14, 0x61, 0x52, 0x0d, 0x04, 0xbd,
2440x42, 0x00, 0x00, 0x28, 0x41, 0x15, 0x09, 0x00, 0x28, 0x0b, 2440x03, 0x43, 0x00, 0x00, 0x28, 0x41, 0x15, 0x09, 0x30, 0x61,
2450x00, 0x8a, 0x08, 0x82, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 2450x63, 0x74, 0x8a, 0x08, 0x82, 0x00, 0x64, 0x65, 0x73, 0x63,
2460x69, 0x62, 0x84, 0x00, 0x31, 0x73, 0x65, 0x63, 0x81, 0x03, 2460x72, 0x69, 0x62, 0x84, 0x00, 0x31, 0x73, 0x65, 0x63, 0x81,
2470x30, 0x32, 0x2e, 0x31, 0xe6, 0x01, 0x01, 0x69, 0x01, 0x06, 2470x03, 0x32, 0x32, 0x2e, 0x31, 0x58, 0x0a, 0x00, 0x69, 0x01,
2480x19, 0x0a, 0x22, 0x2e, 0x29, 0xca, 0x05, 0x12, 0x32, 0xca, 2480x05, 0x19, 0x0a, 0x22, 0x2e, 0x29, 0xca, 0x05, 0x12, 0x32,
2490x05, 0x90, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 2490xca, 0x05, 0x60, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x67,
2500x72, 0xcc, 0x05, 0x01, 0xc4, 0x05, 0x00, 0x72, 0x09, 0x22, 2500x08, 0x00, 0xcc, 0x05, 0x00, 0x13, 0x00, 0x00, 0x72, 0x09,
2510x6f, 0x77, 0x8d, 0x09, 0x11, 0x74, 0xfa, 0x03, 0x40, 0x66, 2510x22, 0x6f, 0x77, 0x8d, 0x09, 0x11, 0x74, 0xfa, 0x03, 0x40,
2520x69, 0x67, 0x75, 0xbc, 0x08, 0x10, 0x77, 0x60, 0x0b, 0x00, 2520x66, 0x69, 0x67, 0x75, 0xbc, 0x08, 0x10, 0x77, 0x60, 0x0b,
2530x31, 0x00, 0x10, 0x74, 0x5b, 0x08, 0x40, 0x6d, 0x65, 0x6e, 2530x00, 0x31, 0x00, 0x10, 0x74, 0x5b, 0x08, 0x41, 0x6d, 0x65,
2540x73, 0x7d, 0x00, 0x09, 0xb7, 0x06, 0x02, 0x7d, 0x01, 0x04, 2540x6e, 0x73, 0x7d, 0x00, 0x0a, 0xb7, 0x06, 0x01, 0x5c, 0x08,
2550xbb, 0x05, 0xc6, 0x60, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 2550x03, 0xbb, 0x05, 0xc7, 0x60, 0x54, 0x79, 0x70, 0x65, 0x27,
2560x6d, 0x65, 0x6e, 0x75, 0x3a, 0x59, 0x0c, 0x00, 0x77, 0x07, 2560x00, 0x6d, 0x65, 0x6e, 0x75, 0x3a, 0x59, 0x0c, 0x00, 0x32,
2570x03, 0x99, 0x0d, 0x02, 0x15, 0x0a, 0x0a, 0x1b, 0x00, 0x01, 2570x00, 0x02, 0x99, 0x0d, 0x03, 0x15, 0x0a, 0x0a, 0x1b, 0x00,
2580x5b, 0x0e, 0x11, 0x2c, 0x4d, 0x0a, 0x06, 0x2c, 0x0b, 0x01, 2580x00, 0x5b, 0x0e, 0x12, 0x2c, 0x4d, 0x0a, 0x06, 0x2c, 0x0b,
2590x21, 0x0d, 0x0c, 0x71, 0x0a, 0x47, 0x2e, 0x00, 0x28, 0x54, 2590x01, 0x21, 0x0d, 0x0b, 0x71, 0x0a, 0x47, 0x2e, 0x00, 0x28,
2600x4c, 0x0e, 0x13, 0x61, 0xb2, 0x0d, 0x25, 0x69, 0x73, 0xe5, 2600x54, 0x4c, 0x0e, 0x13, 0x61, 0xb2, 0x0d, 0x25, 0x69, 0x73,
2610x07, 0x23, 0x72, 0x73, 0x0b, 0x0d, 0x5f, 0x69, 0x73, 0x3a, 2610xe5, 0x07, 0x23, 0x72, 0x73, 0x0b, 0x0d, 0x5f, 0x69, 0x73,
2620x00, 0x66, 0x36, 0x09, 0x07, 0x14, 0x32, 0x90, 0x00, 0x01, 2620x3a, 0x00, 0x66, 0x36, 0x09, 0x07, 0x14, 0x32, 0x90, 0x00,
2630x8f, 0x00, 0x12, 0x33, 0x83, 0x00, 0x01, 0xa8, 0x0a, 0x03, 2630x01, 0x8f, 0x00, 0x13, 0x33, 0x83, 0x00, 0x01, 0xa8, 0x0a,
2640x8b, 0x0c, 0x02, 0x5b, 0x00, 0x01, 0x97, 0x01, 0x02, 0x78, 2640x03, 0x8b, 0x0c, 0x02, 0x5b, 0x00, 0x01, 0x97, 0x01, 0x01,
2650x05, 0x19, 0x33, 0x32, 0x00, 0x12, 0x32, 0x10, 0x0f, 0x16, 2650x78, 0x05, 0x19, 0x33, 0x32, 0x00, 0x12, 0x32, 0x10, 0x0f,
2660x29, 0x13, 0x06, 0x14, 0x74, 0x80, 0x06, 0xd1, 0x60, 0x58, 2660x16, 0x29, 0x13, 0x06, 0x14, 0x74, 0x80, 0x06, 0xd2, 0x60,
2670x27, 0x00, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x62, 0x6f, 0x78, 2670x58, 0x27, 0x00, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x62, 0x6f,
2680x2c, 0x61, 0x01, 0x03, 0xff, 0x02, 0x41, 0x70, 0x70, 0x6c, 2680x78, 0x2c, 0x61, 0x01, 0x02, 0xff, 0x02, 0x10, 0x70, 0x28,
2690x79, 0x22, 0x00, 0x04, 0x31, 0x0e, 0x61, 0x00, 0x65, 0x78, 2690x07, 0x00, 0x22, 0x00, 0x04, 0x31, 0x0e, 0x61, 0x00, 0x65,
2700x74, 0x72, 0x61, 0xac, 0x08, 0x84, 0x74, 0x72, 0x61, 0x69, 2700x78, 0x74, 0x72, 0x61, 0xac, 0x08, 0x50, 0x74, 0x72, 0x61,
2710x6e, 0x74, 0x00, 0x74, 0x0c, 0x0b, 0x0e, 0x23, 0x0e, 0x08, 2710x69, 0x6e, 0x07, 0x0b, 0x03, 0x0c, 0x0b, 0x0e, 0x23, 0x0e,
2720x3d, 0x0f, 0x09, 0xa3, 0x05, 0x02, 0x2e, 0x0e, 0x12, 0x66, 2720x08, 0x3d, 0x0f, 0x0a, 0xa3, 0x05, 0x01, 0x2e, 0x0e, 0x13,
2730xc4, 0x0e, 0x04, 0x24, 0x0e, 0x11, 0x28, 0xc6, 0x09, 0x21, 2730x66, 0xc4, 0x0e, 0x03, 0x24, 0x0e, 0x11, 0x28, 0xc6, 0x09,
2740x69, 0x73, 0x1d, 0x0e, 0x51, 0x74, 0x69, 0x6d, 0x65, 0x73, 2740x21, 0x69, 0x73, 0x1d, 0x0e, 0x51, 0x74, 0x69, 0x6d, 0x65,
2750x07, 0x05, 0x44, 0x6e, 0x00, 0x61, 0x73, 0x43, 0x09, 0x67, 2750x73, 0x07, 0x05, 0x10, 0x6e, 0xd4, 0x04, 0x03, 0x43, 0x09,
2760x2d, 0x58, 0x27, 0x00, 0x69, 0x6e, 0x6b, 0x09, 0x2a, 0x2e, 2760x30, 0x2d, 0x58, 0x27, 0x3d, 0x02, 0x06, 0x6b, 0x09, 0x2b,
2770x29, 0x32, 0x0c, 0x07, 0xdc, 0x02, 0x00, 0x98, 0x0e, 0x0f, 2770x2e, 0x29, 0x32, 0x0c, 0x06, 0xdc, 0x02, 0x00, 0x98, 0x0e,
2780x98, 0x00, 0x03, 0x05, 0xbd, 0x0a, 0x00, 0xc4, 0x0c, 0x10, 2780x0f, 0x98, 0x00, 0x05, 0x04, 0xd0, 0x06, 0x40, 0x73, 0x68,
2790x64, 0xb5, 0x02, 0x10, 0x6c, 0x0e, 0x04, 0x00, 0x52, 0x10, 2790x61, 0x64, 0xb5, 0x02, 0x10, 0x6c, 0x0e, 0x04, 0x00, 0x52,
2800x11, 0x6f, 0xcf, 0x00, 0x05, 0x83, 0x05, 0x02, 0xfb, 0x09, 2800x10, 0x12, 0x6f, 0xcf, 0x00, 0x05, 0x83, 0x05, 0x01, 0xfb,
2810x20, 0x65, 0x6e, 0x94, 0x02, 0x2f, 0x64, 0x2e, 0x39, 0x01, 2810x09, 0x20, 0x65, 0x6e, 0x94, 0x02, 0x2f, 0x64, 0x2e, 0x39,
2820x01, 0x11, 0x4a, 0x3a, 0x0d, 0x0f, 0x3e, 0x01, 0x03, 0x41, 2820x01, 0x01, 0x13, 0x4a, 0x3a, 0x0d, 0x0f, 0x3e, 0x01, 0x01,
2830x67, 0x65, 0x6e, 0x65, 0x88, 0x02, 0x72, 0x72, 0x61, 0x6e, 2830x41, 0x67, 0x65, 0x6e, 0x65, 0x88, 0x02, 0x73, 0x72, 0x61,
2840x64, 0x6f, 0x6d, 0x6c, 0x34, 0x0d, 0x09, 0xb3, 0x10, 0x1e, 2840x6e, 0x64, 0x6f, 0x6d, 0x6c, 0x34, 0x0d, 0x08, 0xb3, 0x10,
2850x2e, 0xbf, 0x00, 0x08, 0x58, 0x0e, 0x01, 0x37, 0x02, 0x05, 2850x1e, 0x2e, 0xbf, 0x00, 0x08, 0x58, 0x0e, 0x03, 0xa4, 0x0b,
2860xae, 0x00, 0x00, 0x36, 0x08, 0x12, 0x6e, 0x36, 0x06, 0x02, 2860x03, 0xae, 0x00, 0x00, 0x36, 0x08, 0x13, 0x6e, 0x36, 0x06,
2870xcd, 0x02, 0x5b, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x11, 0x0f, 2870x01, 0xcd, 0x02, 0x5d, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x11,
2880x0d, 0xea, 0x03, 0x22, 0x60, 0x43, 0x04, 0x02, 0x03, 0x2f, 2880x0f, 0x0b, 0xea, 0x03, 0x22, 0x60, 0x43, 0x04, 0x02, 0x03,
2890x0b, 0x30, 0x52, 0x6f, 0x77, 0xf9, 0x0c, 0x41, 0x6f, 0x78, 2890x2f, 0x0b, 0x30, 0x52, 0x6f, 0x77, 0xf9, 0x0c, 0x41, 0x6f,
2900x65, 0x73, 0xe9, 0x0e, 0x00, 0x05, 0x04, 0x01, 0x15, 0x07, 2900x78, 0x65, 0x73, 0xe9, 0x0e, 0x00, 0x05, 0x04, 0x01, 0x15,
2910x50, 0x72, 0x65, 0x61, 0x73, 0x6f, 0xfa, 0x0d, 0x34, 0x79, 2910x07, 0x50, 0x72, 0x65, 0x61, 0x73, 0x6f, 0xfa, 0x0d, 0x34,
2920x00, 0x79, 0x97, 0x11, 0x22, 0x74, 0x6f, 0x4e, 0x00, 0x06, 2920x79, 0x00, 0x79, 0x97, 0x11, 0x22, 0x74, 0x6f, 0x4e, 0x00,
2930x4d, 0x04, 0x10, 0x67, 0x18, 0x0a, 0x22, 0x65, 0x72, 0x24, 2930x06, 0x4d, 0x04, 0x10, 0x67, 0x18, 0x0a, 0x22, 0x65, 0x72,
2940x0c, 0x10, 0x31, 0x64, 0x00, 0x42, 0x62, 0x6f, 0x74, 0x68, 2940x24, 0x0c, 0x10, 0x31, 0x64, 0x00, 0x42, 0x62, 0x6f, 0x74,
2950x50, 0x00, 0x22, 0x3b, 0x00, 0x0e, 0x01, 0x02, 0xd7, 0x0d, 2950x68, 0x50, 0x00, 0x22, 0x3b, 0x00, 0x0e, 0x01, 0x02, 0xd7,
2960x20, 0x68, 0x61, 0x57, 0x00, 0x07, 0x2a, 0x02, 0x03, 0x90, 2960x0d, 0x21, 0x68, 0x61, 0x57, 0x00, 0x07, 0x2a, 0x02, 0x03,
2970x01, 0x05, 0xd9, 0x00, 0x05, 0xb9, 0x0a, 0x00, 0xc2, 0x06, 2970x90, 0x01, 0x05, 0xd9, 0x00, 0x05, 0xb9, 0x0a, 0x00, 0xc2,
2980x02, 0xe4, 0x0c, 0x20, 0x62, 0x65, 0xd2, 0x04, 0x26, 0x72, 2980x06, 0x01, 0xe4, 0x0c, 0x20, 0x62, 0x65, 0xd2, 0x04, 0x26,
2990x69, 0x28, 0x06, 0x2a, 0x69, 0x66, 0x8e, 0x06, 0x3f, 0x00, 2990x72, 0x69, 0x28, 0x06, 0x2a, 0x69, 0x66, 0x8e, 0x06, 0x3f,
3000x69, 0x74, 0x88, 0x01, 0x02, 0x11, 0x4b, 0xe6, 0x0b, 0x0f, 3000x00, 0x69, 0x74, 0x88, 0x01, 0x02, 0x12, 0x4b, 0x41, 0x0e,
3010x88, 0x01, 0x0a, 0x01, 0xbe, 0x06, 0x10, 0x65, 0x2f, 0x01, 3010x0f, 0x88, 0x01, 0x0b, 0x10, 0x61, 0x0e, 0x10, 0x00, 0x2f,
3020x00, 0x03, 0x00, 0x01, 0x02, 0x0e, 0x04, 0x6a, 0x12, 0x2d, 3020x01, 0x00, 0xdc, 0x03, 0x00, 0x02, 0x0e, 0x04, 0x6a, 0x12,
3030x61, 0x72, 0xa5, 0x01, 0x01, 0x9c, 0x00, 0x41, 0x64, 0x72, 3030x2e, 0x61, 0x72, 0xa5, 0x01, 0x00, 0x9c, 0x00, 0x41, 0x64,
3040x61, 0x77, 0x72, 0x0e, 0x00, 0x99, 0x0d, 0x52, 0x75, 0x74, 3040x72, 0x61, 0x77, 0x72, 0x0e, 0x00, 0x99, 0x0d, 0x20, 0x75,
3050x6c, 0x69, 0x6e, 0xc5, 0x03, 0x03, 0xf0, 0x0e, 0x33, 0x65, 3050x74, 0x23, 0x0e, 0x02, 0xc5, 0x03, 0x02, 0xf0, 0x0e, 0x00,
3060x6e, 0x74, 0x40, 0x0e, 0x36, 0x2e, 0x00, 0x45, 0x36, 0x11, 3060x1f, 0x0b, 0x02, 0x40, 0x0e, 0x03, 0x66, 0x12, 0x02, 0x8a,
3070x23, 0x73, 0x65, 0x7e, 0x0d, 0x06, 0x24, 0x11, 0x00, 0x7b, 3070x01, 0x24, 0x73, 0x65, 0x7e, 0x0d, 0x06, 0x24, 0x11, 0x51,
3080x00, 0x20, 0x6d, 0x61, 0xa3, 0x00, 0x00, 0xd4, 0x0e, 0x03, 3080x61, 0x00, 0x73, 0x6d, 0x61, 0x89, 0x0c, 0x00, 0xd4, 0x0e,
3090x77, 0x0d, 0x00, 0x1b, 0x0e, 0x26, 0x77, 0x73, 0x05, 0x0d, 3090x03, 0x77, 0x00, 0x20, 0x73, 0x68, 0xc4, 0x04, 0x05, 0x05,
3100x07, 0x4e, 0x0e, 0x09, 0xc8, 0x02, 0x12, 0x69, 0x23, 0x02, 3100x0d, 0x0c, 0x4e, 0x0e, 0x04, 0xc8, 0x02, 0x13, 0x69, 0x23,
3110x02, 0x55, 0x00, 0x00, 0x35, 0x07, 0x08, 0x4f, 0x10, 0x09, 3110x02, 0x02, 0x55, 0x00, 0x04, 0x4d, 0x11, 0x05, 0x4f, 0x10,
3120xfd, 0x04, 0x21, 0x68, 0x65, 0x10, 0x07, 0x01, 0x35, 0x10, 3120x07, 0xfd, 0x04, 0x22, 0x68, 0x65, 0x10, 0x07, 0x00, 0x35,
3130x71, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x65, 0x00, 3130x10, 0x71, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x65,
3140x04, 0x36, 0x0f, 0x05, 0x0b, 0x01, 0x16, 0x64, 0x10, 0x0d, 3140x00, 0x05, 0x36, 0x0f, 0x04, 0x0b, 0x01, 0x16, 0x64, 0x10,
3150x45, 0x4d, 0x6f, 0x72, 0x65, 0x2e, 0x00, 0x01, 0xa4, 0x0a, 3150x0d, 0x10, 0x4d, 0x66, 0x08, 0x05, 0x2e, 0x00, 0x00, 0xa4,
3160x17, 0x73, 0x2b, 0x05, 0x90, 0x73, 0x00, 0x6c, 0x6f, 0x6f, 3160x0a, 0x17, 0x73, 0x2b, 0x05, 0x60, 0x73, 0x00, 0x6c, 0x6f,
3170x6b, 0x00, 0x70, 0x72, 0x47, 0x11, 0x00, 0xe2, 0x0f, 0x11, 3170x6f, 0x6b, 0x1c, 0x07, 0x30, 0x74, 0x74, 0x69, 0xe2, 0x0f,
3180x75, 0xb8, 0x0e, 0x01, 0x7a, 0x00, 0x00, 0x2d, 0x00, 0x03, 3180x13, 0x75, 0xb8, 0x0e, 0x00, 0x7a, 0x00, 0x01, 0xd1, 0x0a,
3190x77, 0x08, 0x70, 0x65, 0x61, 0x73, 0x69, 0x65, 0x72, 0x2c, 3190x01, 0x77, 0x08, 0x60, 0x65, 0x61, 0x73, 0x69, 0x65, 0x72,
3200x1e, 0x08, 0x01, 0xab, 0x11, 0x06, 0x52, 0x00, 0x07, 0x01, 3200x5a, 0x0b, 0x13, 0x6e, 0xab, 0x11, 0x05, 0x52, 0x00, 0x06,
3210x02, 0x00, 0xae, 0x09, 0x01, 0xc1, 0x0c, 0x21, 0x63, 0x65, 3210x01, 0x02, 0x01, 0xae, 0x09, 0x00, 0xe2, 0x04, 0x22, 0x63,
3220xdc, 0x08, 0x02, 0xdf, 0x0f, 0x02, 0x4b, 0x02, 0x92, 0x6e, 3220x65, 0xdc, 0x08, 0x02, 0xdf, 0x0f, 0x01, 0x4b, 0x02, 0x60,
3230x65, 0x63, 0x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0xe0, 0x02, 3230x6e, 0x65, 0x63, 0x65, 0x73, 0x73, 0x58, 0x10, 0x02, 0xe0,
3240x01, 0x8d, 0x07, 0x70, 0x65, 0x6e, 0x74, 0x2e, 0x00, 0x43, 3240x02, 0x00, 0x8d, 0x07, 0x70, 0x65, 0x6e, 0x74, 0x2e, 0x00,
3250x6f, 0x0c, 0x05, 0x63, 0x74, 0x65, 0x6c, 0x79, 0x00, 0x61, 3250x43, 0x6f, 0x0c, 0x05, 0x63, 0x74, 0x65, 0x6c, 0x79, 0x00,
3260x54, 0x00, 0x24, 0x69, 0x63, 0x9d, 0x00, 0x01, 0xa6, 0x02, 3260x61, 0x54, 0x00, 0x25, 0x69, 0x63, 0x9d, 0x00, 0x02, 0xa6,
3270x02, 0x0f, 0x10, 0x86, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 3270x02, 0x00, 0x0f, 0x10, 0x86, 0x72, 0x65, 0x65, 0x64, 0x6f,
3280x00, 0x74, 0x64, 0x04, 0x00, 0x0e, 0x0d, 0x24, 0x65, 0x77, 3280x6d, 0x00, 0x74, 0x64, 0x04, 0x00, 0x0e, 0x0d, 0x24, 0x65,
3290x44, 0x10, 0x14, 0x73, 0x0b, 0x09, 0x01, 0x9d, 0x06, 0x57, 3290x77, 0x44, 0x10, 0x15, 0x73, 0x0b, 0x09, 0x00, 0x41, 0x01,
3300x46, 0x69, 0x6e, 0x61, 0x6c, 0x0a, 0x11, 0x0a, 0x45, 0x01, 3300x23, 0x46, 0x69, 0xfd, 0x12, 0x04, 0x41, 0x09, 0x0a, 0x45,
3310x01, 0xdf, 0x01, 0x00, 0x6d, 0x09, 0x10, 0x74, 0xf0, 0x0c, 3310x01, 0x00, 0xdf, 0x01, 0x00, 0x6d, 0x09, 0x15, 0x74, 0xf0,
3320x0f, 0x39, 0x01, 0x05, 0x16, 0x44, 0x25, 0x00, 0x52, 0x6c, 3320x0c, 0x0f, 0x39, 0x01, 0x00, 0x16, 0x44, 0x25, 0x00, 0x52,
3330x65, 0x76, 0x65, 0x6c, 0xa9, 0x10, 0x41, 0x6a, 0x75, 0x64, 3330x6c, 0x65, 0x76, 0x65, 0x6c, 0xa9, 0x10, 0x42, 0x6a, 0x75,
3340x67, 0x19, 0x0e, 0x02, 0x0e, 0x08, 0x01, 0xbe, 0x00, 0x26, 3340x64, 0x67, 0x19, 0x0e, 0x01, 0x0e, 0x08, 0x01, 0xbe, 0x00,
3350x78, 0x69, 0x49, 0x00, 0x82, 0x74, 0x65, 0x63, 0x68, 0x6e, 3350x26, 0x78, 0x69, 0x49, 0x00, 0x82, 0x74, 0x65, 0x63, 0x68,
3360x69, 0x71, 0x75, 0xaf, 0x0f, 0x41, 0x64, 0x65, 0x64, 0x75, 3360x6e, 0x69, 0x71, 0x75, 0xaf, 0x0f, 0x42, 0x64, 0x65, 0x64,
3370x09, 0x07, 0x04, 0x83, 0x0f, 0x01, 0x42, 0x0c, 0x57, 0x73, 3370x75, 0x09, 0x07, 0x03, 0x83, 0x0f, 0x01, 0x42, 0x0c, 0x57,
3380x6f, 0x6c, 0x76, 0x65, 0x85, 0x01, 0x11, 0x3a, 0xe6, 0x05, 3380x73, 0x6f, 0x6c, 0x76, 0x65, 0x85, 0x01, 0x12, 0x3a, 0xe6,
3390x02, 0x66, 0x00, 0x06, 0xac, 0x0f, 0x12, 0x61, 0x68, 0x03, 3390x05, 0x01, 0x66, 0x00, 0x06, 0xac, 0x0f, 0x12, 0x61, 0x68,
3400x22, 0x6f, 0x66, 0xbb, 0x03, 0x00, 0x21, 0x0b, 0x03, 0x58, 3400x03, 0x23, 0x6f, 0x66, 0xbb, 0x03, 0x00, 0xa1, 0x07, 0x02,
3410x02, 0x11, 0x77, 0x7b, 0x03, 0x16, 0x74, 0x55, 0x01, 0x02, 3410x58, 0x02, 0x11, 0x77, 0x7b, 0x03, 0x17, 0x74, 0x55, 0x01,
3420xff, 0x01, 0x01, 0x56, 0x01, 0x10, 0x76, 0xad, 0x0e, 0x00, 3420x23, 0x69, 0x6e, 0x32, 0x04, 0x21, 0x65, 0x76, 0xad, 0x0e,
3430x80, 0x05, 0x00, 0x7b, 0x04, 0x07, 0x56, 0x0a, 0x10, 0x2c, 3430x31, 0x6f, 0x6e, 0x65, 0x7b, 0x04, 0x06, 0x56, 0x0a, 0x10,
3440x9f, 0x03, 0x1d, 0x64, 0xd3, 0x00, 0x83, 0x60, 0x54, 0x72, 3440x2c, 0x9f, 0x03, 0x1d, 0x64, 0xd3, 0x00, 0x83, 0x60, 0x54,
3450x69, 0x76, 0x69, 0x61, 0x6c, 0x3e, 0x04, 0x70, 0x42, 0x61, 3450x72, 0x69, 0x76, 0x69, 0x61, 0x6c, 0x3e, 0x04, 0x70, 0x42,
3460x73, 0x69, 0x63, 0x27, 0x00, 0xc7, 0x11, 0x04, 0x98, 0x04, 3460x61, 0x73, 0x69, 0x63, 0x27, 0x00, 0xc7, 0x11, 0x06, 0x98,
3470x06, 0xbd, 0x15, 0x04, 0x4d, 0x01, 0x01, 0x0c, 0x08, 0x04, 3470x04, 0x05, 0xaf, 0x09, 0x04, 0x4d, 0x01, 0x01, 0x02, 0x0d,
3480x5c, 0x15, 0x04, 0x33, 0x0a, 0x06, 0xfa, 0x09, 0x12, 0x74, 3480x06, 0x5c, 0x15, 0x03, 0x33, 0x0a, 0x04, 0xfa, 0x09, 0x12,
3490xe1, 0x02, 0x22, 0x69, 0x6d, 0x80, 0x03, 0x10, 0x65, 0xbe, 3490x74, 0xe1, 0x02, 0x22, 0x69, 0x6d, 0x80, 0x03, 0x10, 0x65,
3500x00, 0x00, 0x16, 0x00, 0x20, 0x60, 0x49, 0x6b, 0x04, 0x30, 3500xbe, 0x00, 0x00, 0x16, 0x00, 0x20, 0x60, 0x49, 0x6b, 0x04,
3510x6d, 0x65, 0x64, 0x87, 0x08, 0x13, 0x27, 0xee, 0x00, 0x20, 3510x30, 0x6d, 0x65, 0x64, 0x87, 0x08, 0x13, 0x27, 0xee, 0x00,
3520x61, 0x6e, 0x3b, 0x11, 0x40, 0x79, 0x6f, 0x6e, 0x64, 0x5e, 3520x20, 0x61, 0x6e, 0x3b, 0x11, 0x42, 0x79, 0x6f, 0x6e, 0x64,
3530x00, 0x07, 0xdc, 0x06, 0x12, 0x74, 0x7f, 0x02, 0x02, 0xc2, 3530x79, 0x11, 0x05, 0xdc, 0x06, 0x13, 0x74, 0x7f, 0x02, 0x01,
3540x00, 0x26, 0x61, 0x6c, 0x4a, 0x01, 0x11, 0x73, 0x33, 0x0b, 3540xc2, 0x00, 0x26, 0x61, 0x6c, 0x4a, 0x01, 0x13, 0x73, 0x33,
3550x01, 0x93, 0x06, 0x03, 0xef, 0x03, 0x04, 0x49, 0x03, 0x06, 3550x0b, 0x01, 0x85, 0x02, 0x02, 0xef, 0x03, 0x04, 0x49, 0x03,
3560xc6, 0x04, 0x13, 0x63, 0x93, 0x11, 0x12, 0x00, 0x3c, 0x0d, 3560x05, 0xc6, 0x04, 0x13, 0x63, 0x93, 0x11, 0x13, 0x00, 0x3c,
3570x07, 0x2c, 0x00, 0x01, 0x22, 0x00, 0x04, 0xbc, 0x0b, 0x05, 3570x0d, 0x07, 0x2c, 0x00, 0x04, 0x46, 0x05, 0x02, 0xc1, 0x11,
3580x28, 0x00, 0x08, 0x95, 0x0a, 0x00, 0x4e, 0x13, 0x51, 0x74, 3580x07, 0x28, 0x00, 0x04, 0xe6, 0x00, 0x00, 0x4e, 0x13, 0x52,
3590x00, 0x60, 0x55, 0x6e, 0x76, 0x01, 0x00, 0x1b, 0x06, 0x04, 3590x74, 0x00, 0x60, 0x55, 0x6e, 0x76, 0x01, 0x00, 0x1b, 0x06,
3600xad, 0x00, 0x03, 0xa9, 0x11, 0x11, 0x74, 0xc7, 0x06, 0x02, 3600x03, 0xad, 0x00, 0x03, 0xa9, 0x11, 0x13, 0x74, 0xc7, 0x06,
3610x82, 0x01, 0x20, 0x65, 0x6e, 0x42, 0x10, 0x38, 0x2c, 0x00, 3610x00, 0x82, 0x01, 0x20, 0x65, 0x6e, 0x42, 0x10, 0x02, 0xe9,
3620x61, 0xc0, 0x00, 0x10, 0x65, 0xd9, 0x0f, 0x01, 0xc3, 0x16, 3620x04, 0x05, 0xc0, 0x00, 0x10, 0x65, 0xd9, 0x0f, 0x02, 0xc3,
3630x09, 0xcb, 0x00, 0x00, 0x98, 0x0b, 0x35, 0x75, 0x65, 0x73, 3630x16, 0x09, 0xcb, 0x00, 0x86, 0x61, 0x00, 0x67, 0x75, 0x65,
3640x6f, 0x08, 0x00, 0x10, 0x05, 0x60, 0x61, 0x63, 0x6b, 0x74, 3640x73, 0x73, 0x2c, 0x93, 0x0d, 0x70, 0x62, 0x61, 0x63, 0x6b,
3650x72, 0x61, 0x30, 0x08, 0x10, 0x66, 0x29, 0x05, 0x00, 0x20, 3650x74, 0x72, 0x61, 0x30, 0x08, 0x10, 0x66, 0x29, 0x05, 0x00,
3660x0a, 0x10, 0x73, 0x8a, 0x04, 0x03, 0x26, 0x03, 0x50, 0x77, 3660x20, 0x0a, 0x10, 0x73, 0x8a, 0x04, 0x03, 0x26, 0x03, 0x50,
3670x72, 0x6f, 0x6e, 0x67, 0xd0, 0x02, 0x11, 0x47, 0x9f, 0x02, 3670x77, 0x72, 0x6f, 0x6e, 0x67, 0xd0, 0x02, 0x12, 0x47, 0x9f,
3680x00, 0xf9, 0x11, 0x06, 0xc4, 0x01, 0x05, 0x25, 0x03, 0x00, 3680x02, 0x00, 0x03, 0x02, 0x05, 0xc4, 0x01, 0x05, 0x25, 0x03,
3690x8f, 0x00, 0x56, 0x74, 0x73, 0x65, 0x6c, 0x66, 0x1c, 0x00, 3690x00, 0x8f, 0x00, 0x56, 0x74, 0x73, 0x65, 0x6c, 0x66, 0x1c,
3700x1a, 0x3a, 0x5c, 0x08, 0x00, 0x10, 0x02, 0x06, 0xe9, 0x0f, 3700x00, 0x1b, 0x3a, 0x5c, 0x08, 0x03, 0x90, 0x07, 0x02, 0xe9,
3710x4e, 0x67, 0x68, 0x65, 0x72, 0x0b, 0x02, 0x03, 0x52, 0x05, 3710x0f, 0x10, 0x67, 0xa5, 0x13, 0x0d, 0x0b, 0x02, 0x03, 0x52,
3720x2a, 0x6d, 0x61, 0xb6, 0x00, 0x01, 0x93, 0x17, 0x00, 0x52, 3720x05, 0x2b, 0x6d, 0x61, 0xb6, 0x00, 0x01, 0x93, 0x17, 0x00,
3730x0d, 0x00, 0x37, 0x0f, 0x01, 0xc8, 0x01, 0x15, 0x67, 0x8c, 3730x52, 0x0d, 0x31, 0x6d, 0x70, 0x74, 0xc8, 0x01, 0x16, 0x67,
3740x00, 0x06, 0x6c, 0x12, 0x30, 0x62, 0x65, 0x66, 0xf1, 0x03, 3740x8c, 0x00, 0x05, 0x6c, 0x12, 0x30, 0x62, 0x65, 0x66, 0xf1,
3750x00, 0x63, 0x17, 0x30, 0x69, 0x6e, 0x64, 0x80, 0x02, 0x00, 3750x03, 0x00, 0x63, 0x17, 0x41, 0x69, 0x6e, 0x64, 0x73, 0x70,
3760x21, 0x06, 0x23, 0x72, 0x64, 0x21, 0x01, 0x22, 0x00, 0x66, 3760x00, 0x10, 0x68, 0x30, 0x0f, 0x02, 0x21, 0x01, 0x22, 0x00,
3770xcc, 0x0c, 0x31, 0x2e, 0x00, 0x42, 0xa5, 0x02, 0x23, 0x70, 3770x66, 0xcc, 0x0c, 0x31, 0x2e, 0x00, 0x42, 0xa5, 0x02, 0x23,
3780x61, 0x0a, 0x03, 0xc1, 0x77, 0x61, 0x69, 0x74, 0x2c, 0x00, 3780x70, 0x61, 0x0a, 0x03, 0xc1, 0x77, 0x61, 0x69, 0x74, 0x2c,
3790x65, 0x73, 0x70, 0x65, 0x63, 0x69, 0x31, 0x01, 0x25, 0x69, 3790x00, 0x65, 0x73, 0x70, 0x65, 0x63, 0x69, 0x31, 0x01, 0x26,
3800x66, 0x9e, 0x06, 0x0a, 0xfe, 0x04, 0x00, 0xb2, 0x05, 0x65, 3800x69, 0x66, 0x9e, 0x06, 0x0a, 0xfe, 0x04, 0x95, 0x64, 0x00,
3810x00, 0x6c, 0x61, 0x72, 0x67, 0x65, 0xe0, 0x12, 0x50, 0x69, 3810x61, 0x00, 0x6c, 0x61, 0x72, 0x67, 0x65, 0xe0, 0x12, 0x50,
3820x7a, 0x65, 0x2e, 0x00, 3820x69, 0x7a, 0x65, 0x2e, 0x00,
383}; 383};
384 384
385const unsigned short help_text_len = 6263; 385const unsigned short help_text_len = 6263;
diff --git a/apps/plugins/puzzles/help/tents.c b/apps/plugins/puzzles/help/tents.c
index 9ff68a3c24..e53f92b0f6 100644
--- a/apps/plugins/puzzles/help/tents.c
+++ b/apps/plugins/puzzles/help/tents.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -17,7 +17,7 @@ struct style_text help_text_style[] = {
17 LAST_STYLE_ITEM 17 LAST_STYLE_ITEM
18}; 18};
19 19
20/* orig 2140 comp 1385 ratio 0.647196 level 11 saved 755 */ 20/* orig 2140 comp 1385 ratio 0.647196 level 10 saved 755 */
21const char help_text[] = { 21const char help_text[] = {
220xf0, 0x26, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 220xf0, 0x26, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
230x32, 0x35, 0x3a, 0x20, 0x54, 0x65, 0x6e, 0x74, 0x73, 0x20, 230x32, 0x35, 0x3a, 0x20, 0x54, 0x65, 0x6e, 0x74, 0x73, 0x20,
@@ -30,17 +30,17 @@ const char help_text[] = {
300x00, 0xf0, 0x04, 0x72, 0x00, 0x61, 0x69, 0x6d, 0x00, 0x69, 300x00, 0xf0, 0x04, 0x72, 0x00, 0x61, 0x69, 0x6d, 0x00, 0x69,
310x73, 0x00, 0x74, 0x6f, 0x00, 0x70, 0x6c, 0x61, 0x63, 0x65, 310x73, 0x00, 0x74, 0x6f, 0x00, 0x70, 0x6c, 0x61, 0x63, 0x65,
320x00, 0x74, 0x57, 0x00, 0x35, 0x00, 0x69, 0x6e, 0x3b, 0x00, 320x00, 0x74, 0x57, 0x00, 0x35, 0x00, 0x69, 0x6e, 0x3b, 0x00,
330xd5, 0x74, 0x68, 0x65, 0x00, 0x72, 0x65, 0x6d, 0x61, 0x69, 330xd6, 0x74, 0x68, 0x65, 0x00, 0x72, 0x65, 0x6d, 0x61, 0x69,
340x6e, 0x69, 0x6e, 0x67, 0x5a, 0x00, 0x01, 0x22, 0x00, 0xe1, 340x6e, 0x69, 0x6e, 0x67, 0x5a, 0x00, 0x00, 0x22, 0x00, 0xe1,
350x75, 0x63, 0x68, 0x00, 0x61, 0x00, 0x77, 0x61, 0x79, 0x00, 350x75, 0x63, 0x68, 0x00, 0x61, 0x00, 0x77, 0x61, 0x79, 0x00,
360x74, 0x68, 0x61, 0x74, 0x2a, 0x00, 0x90, 0x66, 0x6f, 0x6c, 360x74, 0x68, 0x61, 0x74, 0x2a, 0x00, 0x60, 0x66, 0x6f, 0x6c,
370x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x6d, 0x00, 0xf1, 0x0b, 370x6c, 0x6f, 0x77, 0x2a, 0x00, 0xf1, 0x0e, 0x63, 0x6f, 0x6e,
380x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x00, 0x61, 0x72, 380x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x00, 0x61, 0x72,
390x65, 0x00, 0x6d, 0x65, 0x74, 0x3a, 0x00, 0x00, 0x00, 0x2d, 390x65, 0x00, 0x6d, 0x65, 0x74, 0x3a, 0x00, 0x00, 0x00, 0x2d,
400x00, 0x54, 0x68, 0x65, 0x72, 0x65, 0x13, 0x00, 0xf3, 0x00, 400x00, 0x54, 0x68, 0x65, 0x72, 0x65, 0x13, 0x00, 0xf3, 0x00,
410x65, 0x78, 0x61, 0x63, 0x74, 0x6c, 0x79, 0x00, 0x61, 0x73, 410x65, 0x78, 0x61, 0x63, 0x74, 0x6c, 0x79, 0x00, 0x61, 0x73,
420x00, 0x6d, 0x61, 0x6e, 0x79, 0x7b, 0x00, 0x23, 0x61, 0x73, 420x00, 0x6d, 0x61, 0x6e, 0x79, 0x7b, 0x00, 0x24, 0x61, 0x73,
430xa0, 0x00, 0x04, 0x2e, 0x00, 0x04, 0x18, 0x00, 0x22, 0x6e, 430xa0, 0x00, 0x03, 0x2e, 0x00, 0x04, 0x18, 0x00, 0x22, 0x6e,
440x64, 0x19, 0x00, 0xff, 0x03, 0x00, 0x63, 0x61, 0x6e, 0x00, 440x64, 0x19, 0x00, 0xff, 0x03, 0x00, 0x63, 0x61, 0x6e, 0x00,
450x62, 0x65, 0x00, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 450x62, 0x65, 0x00, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64,
460x00, 0x75, 0x70, 0x8d, 0x00, 0x01, 0x41, 0x65, 0x61, 0x63, 460x00, 0x75, 0x70, 0x8d, 0x00, 0x01, 0x41, 0x65, 0x61, 0x63,
@@ -53,108 +53,108 @@ const char help_text[] = {
530x67, 0x6f, 0x6e, 0x14, 0x00, 0x10, 0x29, 0x21, 0x01, 0x62, 530x67, 0x6f, 0x6e, 0x14, 0x00, 0x10, 0x29, 0x21, 0x01, 0x62,
540x69, 0x74, 0x73, 0x00, 0x6f, 0x77, 0x3f, 0x01, 0xc2, 0x2e, 540x69, 0x74, 0x73, 0x00, 0x6f, 0x77, 0x3f, 0x01, 0xc2, 0x2e,
550x00, 0x48, 0x6f, 0x77, 0x65, 0x76, 0x65, 0x72, 0x2c, 0x00, 550x00, 0x48, 0x6f, 0x77, 0x65, 0x76, 0x65, 0x72, 0x2c, 0x00,
560x61, 0x67, 0x00, 0x65, 0x6d, 0x61, 0x79, 0x00, 0x62, 0x65, 560x61, 0x67, 0x00, 0x30, 0x6d, 0x61, 0x79, 0x96, 0x00, 0x05,
570x62, 0x00, 0x00, 0x31, 0x00, 0x51, 0x6f, 0x74, 0x68, 0x65, 570x62, 0x00, 0x83, 0x74, 0x6f, 0x00, 0x6f, 0x74, 0x68, 0x65,
580x72, 0x2f, 0x00, 0x01, 0xd7, 0x00, 0x74, 0x77, 0x65, 0x6c, 580x72, 0xb5, 0x00, 0x70, 0x61, 0x73, 0x00, 0x77, 0x65, 0x6c,
590x6c, 0x00, 0x61, 0x73, 0x48, 0x00, 0x02, 0xe1, 0x00, 0x64, 590x6c, 0x08, 0x00, 0x03, 0x48, 0x00, 0x02, 0xe1, 0x00, 0x64,
600x4e, 0x6f, 0x00, 0x74, 0x77, 0x6f, 0xe4, 0x00, 0x17, 0x72, 600x4e, 0x6f, 0x00, 0x74, 0x77, 0x6f, 0xe4, 0x00, 0x17, 0x72,
610x41, 0x00, 0x08, 0xa2, 0x00, 0x13, 0x2c, 0xa0, 0x00, 0x03, 610x41, 0x00, 0x08, 0xa2, 0x00, 0x17, 0x2c, 0xa0, 0x00, 0x46,
620xae, 0x00, 0x16, 0x20, 0x9a, 0x00, 0x06, 0x27, 0x01, 0x95, 620x00, 0x6f, 0x72, 0x20, 0x9a, 0x00, 0x06, 0x27, 0x01, 0x61,
630x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x00, 0x6f, 0x66, 0xc4, 630x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0xb3, 0x01, 0x04, 0xc4,
640x01, 0x02, 0x05, 0x01, 0x40, 0x72, 0x6f, 0x77, 0x2c, 0x3e, 640x01, 0x01, 0x05, 0x01, 0x41, 0x72, 0x6f, 0x77, 0x2c, 0x3e,
650x01, 0x05, 0x11, 0x00, 0x73, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 650x01, 0x04, 0x11, 0x00, 0x73, 0x63, 0x6f, 0x6c, 0x75, 0x6d,
660x6e, 0x2c, 0x41, 0x01, 0x35, 0x73, 0x00, 0x74, 0x3d, 0x00, 660x6e, 0x2c, 0x41, 0x01, 0x35, 0x73, 0x00, 0x74, 0x3d, 0x00,
670xd1, 0x73, 0x00, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x00, 0x72, 670xd1, 0x73, 0x00, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x00, 0x72,
680x6f, 0x75, 0x6e, 0x64, 0x18, 0x00, 0x53, 0x73, 0x69, 0x64, 680x6f, 0x75, 0x6e, 0x64, 0x18, 0x00, 0x54, 0x73, 0x69, 0x64,
690x65, 0x73, 0x07, 0x02, 0x01, 0x5f, 0x02, 0x00, 0x70, 0x00, 690x65, 0x73, 0x07, 0x02, 0x00, 0x5f, 0x02, 0x00, 0x70, 0x00,
700xb4, 0x54, 0x68, 0x69, 0x73, 0x00, 0x70, 0x75, 0x7a, 0x7a, 700xb4, 0x54, 0x68, 0x69, 0x73, 0x00, 0x70, 0x75, 0x7a, 0x7a,
710x6c, 0x65, 0x8d, 0x01, 0x10, 0x66, 0x32, 0x00, 0x01, 0x88, 710x6c, 0x65, 0x8d, 0x01, 0x11, 0x66, 0x32, 0x00, 0x00, 0x88,
720x01, 0x00, 0x15, 0x01, 0x21, 0x61, 0x6c, 0x4e, 0x02, 0x00, 720x01, 0x00, 0x15, 0x01, 0x22, 0x61, 0x6c, 0x4e, 0x02, 0x41,
730x3a, 0x00, 0x11, 0x6e, 0x3a, 0x00, 0x82, 0x49, 0x6e, 0x74, 730x73, 0x00, 0x6f, 0x6e, 0x3a, 0x00, 0x82, 0x49, 0x6e, 0x74,
740x65, 0x72, 0x6e, 0x65, 0x74, 0x89, 0x00, 0xa1, 0x77, 0x61, 740x65, 0x72, 0x6e, 0x65, 0x74, 0x89, 0x00, 0xa1, 0x77, 0x61,
750x73, 0x00, 0x62, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x27, 0x01, 750x73, 0x00, 0x62, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x27, 0x01,
760x80, 0x6d, 0x79, 0x00, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x2d, 760x50, 0x6d, 0x79, 0x00, 0x61, 0x74, 0xb4, 0x00, 0xf0, 0x28,
770x02, 0xf0, 0x28, 0x00, 0x62, 0x79, 0x00, 0x65, 0x2d, 0x6d, 770x69, 0x6f, 0x6e, 0x00, 0x62, 0x79, 0x00, 0x65, 0x2d, 0x6d,
780x61, 0x69, 0x6c, 0x2e, 0x00, 0x49, 0x00, 0x64, 0x6f, 0x6e, 780x61, 0x69, 0x6c, 0x2e, 0x00, 0x49, 0x00, 0x64, 0x6f, 0x6e,
790x27, 0x74, 0x00, 0x6b, 0x6e, 0x6f, 0x77, 0x00, 0x77, 0x68, 790x27, 0x74, 0x00, 0x6b, 0x6e, 0x6f, 0x77, 0x00, 0x77, 0x68,
800x6f, 0x00, 0x49, 0x00, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 800x6f, 0x00, 0x49, 0x00, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64,
810x00, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x00, 0x66, 0x6f, 810x00, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x00, 0x66, 0x6f,
820x72, 0x00, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x71, 0x02, 820x72, 0x00, 0x69, 0x6e, 0x76, 0x3a, 0x00, 0x50, 0x6e, 0x67,
830x20, 0x69, 0x74, 0x9c, 0x00, 0x43, 0x32, 0x35, 0x2e, 0x31, 830x00, 0x69, 0x74, 0x9c, 0x00, 0x43, 0x32, 0x35, 0x2e, 0x31,
840x1c, 0x03, 0x00, 0xef, 0x02, 0x31, 0x72, 0x6f, 0x6c, 0x25, 840x1c, 0x03, 0x00, 0xef, 0x02, 0x31, 0x72, 0x6f, 0x6c, 0x25,
850x03, 0xa1, 0x4c, 0x65, 0x66, 0x74, 0x2d, 0x63, 0x6c, 0x69, 850x03, 0xa1, 0x4c, 0x65, 0x66, 0x74, 0x2d, 0x63, 0x6c, 0x69,
860x63, 0x6b, 0x2b, 0x00, 0x93, 0x6e, 0x00, 0x61, 0x00, 0x62, 860x63, 0x6b, 0x2b, 0x00, 0x93, 0x6e, 0x00, 0x61, 0x00, 0x62,
870x6c, 0x61, 0x6e, 0x6b, 0xd1, 0x02, 0x43, 0x00, 0x77, 0x69, 870x6c, 0x61, 0x6e, 0x6b, 0xd1, 0x02, 0x43, 0x00, 0x77, 0x69,
880x6c, 0xb4, 0x00, 0x04, 0xd0, 0x01, 0x21, 0x69, 0x6e, 0x52, 880x6c, 0xb4, 0x00, 0x04, 0xd0, 0x01, 0x21, 0x69, 0x6e, 0x52,
890x00, 0x7f, 0x52, 0x69, 0x67, 0x68, 0x74, 0x2d, 0x00, 0x3b, 890x00, 0x7f, 0x52, 0x69, 0x67, 0x68, 0x74, 0x2d, 0x00, 0x3b,
900x00, 0x0c, 0x00, 0x54, 0x01, 0x00, 0x4e, 0x03, 0x80, 0x69, 900x00, 0x0d, 0x30, 0x63, 0x6f, 0x6c, 0x4e, 0x03, 0x80, 0x69,
910x74, 0x00, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x03, 0x40, 910x74, 0x00, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x03, 0x41,
920x64, 0x69, 0x63, 0x61, 0x99, 0x00, 0x02, 0x90, 0x02, 0x31, 920x64, 0x69, 0x63, 0x61, 0x99, 0x00, 0x01, 0x90, 0x02, 0x31,
930x79, 0x6f, 0x75, 0xdf, 0x01, 0x60, 0x73, 0x75, 0x72, 0x65, 930x79, 0x6f, 0x75, 0xdf, 0x01, 0x60, 0x73, 0x75, 0x72, 0x65,
940x00, 0x69, 0x96, 0x02, 0x33, 0x6e, 0x27, 0x74, 0x6c, 0x00, 940x00, 0x69, 0x96, 0x02, 0x00, 0xdb, 0x00, 0x02, 0x6c, 0x00,
950x34, 0x2e, 0x00, 0x43, 0x5f, 0x00, 0x20, 0x65, 0x69, 0x34, 950x34, 0x2e, 0x00, 0x43, 0x5f, 0x00, 0x21, 0x65, 0x69, 0x34,
960x02, 0x00, 0x82, 0x02, 0x31, 0x74, 0x6f, 0x6e, 0x6d, 0x00, 960x02, 0x61, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x6d, 0x00,
970xaa, 0x6e, 0x00, 0x6f, 0x63, 0x63, 0x75, 0x70, 0x69, 0x65, 970xaa, 0x6e, 0x00, 0x6f, 0x63, 0x63, 0x75, 0x70, 0x69, 0x65,
980x64, 0x71, 0x00, 0x43, 0x6c, 0x65, 0x61, 0x72, 0xf4, 0x00, 980x64, 0x71, 0x00, 0x43, 0x6c, 0x65, 0x61, 0x72, 0xf4, 0x00,
990x21, 0x49, 0x66, 0x5f, 0x00, 0x92, 0x64, 0x72, 0x61, 0x67, 990x21, 0x49, 0x66, 0x5f, 0x00, 0x92, 0x64, 0x72, 0x61, 0x67,
1000x00, 0x77, 0x69, 0x74, 0x68, 0xb4, 0x03, 0x00, 0xb9, 0x00, 1000x00, 0x77, 0x69, 0x74, 0x68, 0xb4, 0x03, 0x00, 0xb9, 0x00,
1010x04, 0x49, 0x00, 0x70, 0x61, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 1010x04, 0x49, 0x00, 0x70, 0x61, 0x6c, 0x6f, 0x6e, 0x67, 0x00,
1020x61, 0x0c, 0x02, 0x35, 0x00, 0x6f, 0x72, 0x02, 0x02, 0x00, 1020x61, 0x0c, 0x02, 0x00, 0xed, 0x02, 0x04, 0x02, 0x02, 0x00,
1030xac, 0x01, 0x1a, 0x79, 0xce, 0x00, 0x23, 0x69, 0x6e, 0xf2, 1030xac, 0x01, 0x1a, 0x79, 0xce, 0x00, 0x23, 0x69, 0x6e, 0xf2,
1040x03, 0x41, 0x67, 0x69, 0x6f, 0x6e, 0x57, 0x00, 0x51, 0x63, 1040x03, 0x10, 0x67, 0x8e, 0x01, 0x00, 0x57, 0x00, 0x52, 0x63,
1050x6f, 0x76, 0x65, 0x72, 0x75, 0x00, 0x00, 0xe9, 0x01, 0x62, 1050x6f, 0x76, 0x65, 0x72, 0x75, 0x00, 0x94, 0x62, 0x65, 0x00,
1060x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0xe6, 0x00, 0x02, 0xce, 1060x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0xe6, 0x00, 0x00, 0xce,
1070x01, 0x13, 0x6e, 0xe9, 0x02, 0x04, 0x1c, 0x04, 0x05, 0x2b, 1070x01, 0x14, 0x6e, 0xe9, 0x02, 0x03, 0x1c, 0x04, 0x05, 0x2b,
1080x00, 0xb0, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 1080x00, 0xb1, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64,
1090x2e, 0x00, 0x28, 0x32, 0x02, 0x00, 0x89, 0x03, 0x60, 0x75, 1090x2e, 0x00, 0x28, 0x32, 0x02, 0x91, 0x69, 0x73, 0x00, 0x75,
1100x73, 0x65, 0x66, 0x75, 0x6c, 0xb9, 0x01, 0x02, 0xc1, 0x00, 1100x73, 0x65, 0x66, 0x75, 0x6c, 0xb9, 0x01, 0x01, 0xc1, 0x00,
1110x37, 0x69, 0x6e, 0x67, 0x61, 0x04, 0x11, 0x64, 0xbf, 0x02, 1110x02, 0x1f, 0x01, 0x04, 0x61, 0x04, 0x12, 0x64, 0xbf, 0x02,
1120x04, 0xa7, 0x00, 0x53, 0x6e, 0x63, 0x65, 0x00, 0x79, 0xdc, 1120x03, 0xa7, 0x00, 0x54, 0x6e, 0x63, 0x65, 0x00, 0x79, 0xdc,
1130x04, 0x02, 0x9b, 0x01, 0x50, 0x64, 0x00, 0x61, 0x6c, 0x6c, 1130x04, 0x01, 0x9b, 0x01, 0x51, 0x64, 0x00, 0x61, 0x6c, 0x6c,
1140x3f, 0x03, 0x02, 0xe2, 0x02, 0x23, 0x2e, 0x29, 0xfe, 0x04, 1140x3f, 0x03, 0x01, 0xe2, 0x02, 0x23, 0x2e, 0x29, 0xfe, 0x04,
1150x20, 0x63, 0x61, 0xe2, 0x00, 0x20, 0x73, 0x6f, 0x5f, 0x00, 1150x20, 0x63, 0x61, 0xe2, 0x00, 0x20, 0x73, 0x6f, 0x5f, 0x00,
1160x01, 0x4f, 0x00, 0xb1, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 1160x01, 0x4f, 0x00, 0xb1, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72,
1170x00, 0x6b, 0x65, 0x79, 0x73, 0x61, 0x02, 0x10, 0x6f, 0x1e, 1170x00, 0x6b, 0x65, 0x79, 0x73, 0x61, 0x02, 0x10, 0x6f, 0x1e,
1180x05, 0x01, 0xd5, 0x02, 0x07, 0xc8, 0x02, 0x56, 0x50, 0x72, 1180x05, 0x06, 0xd5, 0x02, 0x02, 0xc8, 0x02, 0x56, 0x50, 0x72,
1190x65, 0x73, 0x73, 0x81, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x32, 1190x65, 0x73, 0x73, 0x81, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x32,
1200x00, 0x10, 0x00, 0xef, 0x00, 0x00, 0x77, 0x01, 0x5f, 0x65, 1200x00, 0x11, 0x00, 0xef, 0x00, 0x8f, 0x61, 0x6e, 0x00, 0x65,
1210x6d, 0x70, 0x74, 0x79, 0x20, 0x02, 0x05, 0x03, 0xca, 0x02, 1210x6d, 0x70, 0x74, 0x79, 0x20, 0x02, 0x06, 0x02, 0xfc, 0x00,
1220x18, 0x70, 0x44, 0x00, 0x20, 0x73, 0x70, 0x1f, 0x00, 0x3a, 1220x18, 0x70, 0x44, 0x00, 0x20, 0x73, 0x70, 0x1f, 0x00, 0x3e,
1230x62, 0x61, 0x72, 0x43, 0x00, 0x0f, 0x28, 0x02, 0x09, 0x12, 1230x62, 0x61, 0x72, 0x43, 0x00, 0x0f, 0x28, 0x02, 0x05, 0x14,
1240x3b, 0xf1, 0x01, 0x01, 0xab, 0x00, 0x07, 0xd8, 0x01, 0x0e, 1240x3b, 0xf1, 0x01, 0x00, 0x79, 0x00, 0x07, 0xd8, 0x01, 0x0e,
1250xf6, 0x01, 0x01, 0x71, 0x04, 0x20, 0x6c, 0x64, 0x6b, 0x00, 1250xf6, 0x01, 0x00, 0x71, 0x04, 0x20, 0x6c, 0x64, 0x6b, 0x00,
1260x59, 0x53, 0x68, 0x69, 0x66, 0x74, 0x7e, 0x00, 0x0c, 0xf4, 1260x5e, 0x53, 0x68, 0x69, 0x66, 0x74, 0x7e, 0x00, 0x08, 0xf4,
1270x00, 0x08, 0x6b, 0x00, 0x09, 0x84, 0x00, 0x12, 0x73, 0x76, 1270x00, 0x08, 0x6b, 0x00, 0x08, 0x84, 0x00, 0x12, 0x73, 0x76,
1280x00, 0x06, 0x4c, 0x00, 0x12, 0x43, 0x23, 0x03, 0x0f, 0x4e, 1280x00, 0x06, 0x4c, 0x00, 0x12, 0x43, 0x23, 0x03, 0x0f, 0x4e,
1290x00, 0x16, 0x02, 0x40, 0x00, 0x59, 0x00, 0x62, 0x6f, 0x74, 1290x00, 0x17, 0x01, 0x40, 0x00, 0x5b, 0x00, 0x62, 0x6f, 0x74,
1300x68, 0x59, 0x00, 0x01, 0x9f, 0x05, 0x07, 0x01, 0x02, 0x12, 1300x68, 0x59, 0x00, 0x00, 0x42, 0x00, 0x06, 0x01, 0x02, 0x12,
1310x74, 0x7c, 0x05, 0x01, 0xc5, 0x05, 0x41, 0x28, 0x41, 0x6c, 1310x74, 0x7c, 0x05, 0x01, 0xc5, 0x05, 0x41, 0x28, 0x41, 0x6c,
1320x6c, 0x54, 0x00, 0x22, 0x61, 0x63, 0x0f, 0x06, 0x83, 0x64, 1320x6c, 0x54, 0x00, 0x22, 0x61, 0x63, 0x0f, 0x06, 0x83, 0x64,
1330x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x30, 0x04, 0x11, 1330x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x30, 0x04, 0x11,
1340x63, 0xf8, 0x03, 0x30, 0x32, 0x2e, 0x31, 0x20, 0x03, 0x02, 1340x63, 0xf8, 0x03, 0x32, 0x32, 0x2e, 0x31, 0xff, 0x04, 0x00,
1350xc8, 0x01, 0xb2, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 1350xc8, 0x01, 0xb2, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62,
1360x6c, 0x65, 0x2e, 0x29, 0xd3, 0x03, 0x13, 0x32, 0xd3, 0x03, 1360x6c, 0x65, 0x2e, 0x29, 0xd3, 0x03, 0x13, 0x32, 0xd3, 0x03,
1370x90, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 1370xb1, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72,
1380xd5, 0x03, 0x00, 0xf6, 0x04, 0x35, 0x73, 0x65, 0x00, 0x14, 1380x73, 0x20, 0x88, 0x04, 0x46, 0x65, 0x73, 0x65, 0x00, 0x14,
1390x00, 0x01, 0x40, 0x05, 0x06, 0x3c, 0x00, 0x51, 0x00, 0x66, 1390x00, 0x02, 0x41, 0x00, 0x04, 0x3c, 0x00, 0x51, 0x00, 0x66,
1400x72, 0x6f, 0x6d, 0x79, 0x00, 0xe0, 0x60, 0x43, 0x75, 0x73, 1400x72, 0x6f, 0x6d, 0x79, 0x00, 0xe1, 0x60, 0x43, 0x75, 0x73,
1410x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 1410x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70,
1420x6f, 0x00, 0x04, 0x98, 0x04, 0xb0, 0x60, 0x54, 0x79, 0x70, 1420x6f, 0x00, 0x03, 0x98, 0x04, 0xb0, 0x60, 0x54, 0x79, 0x70,
1430x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0xab, 0x00, 0x91, 1430x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0xab, 0x00, 0x91,
1440x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 0x48, 0x65, 0x3c, 1440x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 0x48, 0x65, 0x3c,
1450x03, 0x50, 0x00, 0x00, 0x53, 0x69, 0x7a, 0x04, 0x07, 0x02, 1450x03, 0x51, 0x00, 0x00, 0x53, 0x69, 0x7a, 0x04, 0x07, 0x01,
1460x58, 0x07, 0x22, 0x69, 0x6e, 0xe1, 0x00, 0x02, 0x9b, 0x06, 1460x58, 0x07, 0x24, 0x69, 0x6e, 0xe1, 0x00, 0x00, 0x2b, 0x00,
1470xc4, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 1470xc4, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74,
1480x79, 0x00, 0x00, 0x47, 0x01, 0x02, 0x4b, 0x05, 0x15, 0x64, 1480x79, 0x00, 0x00, 0x47, 0x01, 0x02, 0x4b, 0x05, 0x16, 0x64,
1490x1a, 0x00, 0x05, 0x38, 0x05, 0x83, 0x65, 0x6e, 0x65, 0x72, 1490x1a, 0x00, 0x04, 0x38, 0x05, 0x83, 0x65, 0x6e, 0x65, 0x72,
1500x61, 0x74, 0x65, 0x64, 0x35, 0x05, 0x57, 0x2e, 0x00, 0x4d, 1500x61, 0x74, 0x65, 0x64, 0x35, 0x05, 0x57, 0x2e, 0x00, 0x4d,
1510x6f, 0x72, 0x29, 0x00, 0x03, 0x17, 0x00, 0x70, 0x73, 0x00, 1510x6f, 0x72, 0x29, 0x00, 0x03, 0x17, 0x00, 0x70, 0x73, 0x00,
1520x72, 0x65, 0x71, 0x75, 0x69, 0x2d, 0x07, 0x00, 0x1f, 0x00, 1520x72, 0x65, 0x71, 0x75, 0x69, 0x2d, 0x07, 0x00, 0x1f, 0x00,
1530xc2, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x00, 0x64, 1530xc2, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x00, 0x64,
1540x65, 0x64, 0x75, 0x3a, 0x01, 0x02, 0x9a, 0x06, 0x21, 0x61, 1540x65, 0x64, 0x75, 0x3a, 0x01, 0x02, 0x9a, 0x06, 0x21, 0x61,
1550x74, 0xab, 0x01, 0x20, 0x65, 0x6e, 0xa5, 0x06, 0x13, 0x6e, 1550x74, 0xab, 0x01, 0x20, 0x65, 0x6e, 0xa5, 0x06, 0x15, 0x6e,
1560xa4, 0x07, 0x06, 0xf8, 0x00, 0x09, 0x81, 0x00, 0x53, 0x6c, 1560xa4, 0x07, 0x06, 0xf8, 0x00, 0x07, 0x81, 0x00, 0x55, 0x6c,
1570x65, 0x76, 0x65, 0x6c, 0x58, 0x00, 0x01, 0xff, 0x01, 0x80, 1570x65, 0x76, 0x65, 0x6c, 0x58, 0x00, 0xb0, 0x73, 0x00, 0x67,
1580x75, 0x65, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x6b, 0x06, 0x04, 1580x75, 0x65, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x6b, 0x06, 0x04,
1590xe0, 0x62, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x6b, 1590xe0, 0x62, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x6b,
1600x69, 0x6e, 0x67, 0x2e, 0x00, 1600x69, 0x6e, 0x67, 0x2e, 0x00,
diff --git a/apps/plugins/puzzles/help/towers.c b/apps/plugins/puzzles/help/towers.c
index f56ac822ef..62c08e011b 100644
--- a/apps/plugins/puzzles/help/towers.c
+++ b/apps/plugins/puzzles/help/towers.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -14,7 +14,7 @@ struct style_text help_text_style[] = {
14 LAST_STYLE_ITEM 14 LAST_STYLE_ITEM
15}; 15};
16 16
17/* orig 3541 comp 2205 ratio 0.622705 level 5 saved 1336 */ 17/* orig 3541 comp 2203 ratio 0.622141 level 10 saved 1338 */
18const char help_text[] = { 18const char help_text[] = {
190xf4, 0x26, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 190xf4, 0x26, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
200x33, 0x31, 0x3a, 0x20, 0x54, 0x6f, 0x77, 0x65, 0x72, 0x73, 200x33, 0x31, 0x3a, 0x20, 0x54, 0x6f, 0x77, 0x65, 0x72, 0x73,
@@ -68,13 +68,13 @@ const char help_text[] = {
680x01, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x00, 0x28, 0x6f, 0x74, 680x01, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x00, 0x28, 0x6f, 0x74,
690x68, 0x65, 0x72, 0x77, 0x69, 0x73, 0x65, 0xe9, 0x00, 0x90, 690x68, 0x65, 0x72, 0x77, 0x69, 0x73, 0x65, 0xe9, 0x00, 0x90,
700x77, 0x6f, 0x75, 0x6c, 0x64, 0x00, 0x6e, 0x6f, 0x74, 0x02, 700x77, 0x6f, 0x75, 0x6c, 0x64, 0x00, 0x6e, 0x6f, 0x74, 0x02,
710x01, 0x10, 0x61, 0x5d, 0x01, 0x20, 0x74, 0x6f, 0x0a, 0x01, 710x01, 0x30, 0x61, 0x62, 0x6c, 0x4f, 0x00, 0x00, 0x0a, 0x01,
720x47, 0x00, 0x61, 0x6c, 0x6c, 0x5f, 0x00, 0x70, 0x73, 0x29, 720x47, 0x00, 0x61, 0x6c, 0x6c, 0x5f, 0x00, 0x70, 0x73, 0x29,
730x2c, 0x00, 0x77, 0x68, 0x65, 0x4b, 0x00, 0x0c, 0x9a, 0x00, 730x2c, 0x00, 0x77, 0x68, 0x65, 0x4b, 0x00, 0x0c, 0x9a, 0x00,
740x1f, 0x31, 0x9a, 0x00, 0x02, 0x01, 0xe8, 0x00, 0x23, 0x73, 740x1f, 0x31, 0x9a, 0x00, 0x02, 0x01, 0xe8, 0x00, 0x23, 0x73,
750x74, 0x9d, 0x00, 0x10, 0x28, 0x13, 0x00, 0x25, 0x6f, 0x6e, 750x74, 0x9d, 0x00, 0x10, 0x28, 0x13, 0x00, 0x25, 0x6f, 0x6e,
760x35, 0x00, 0x22, 0x35, 0x29, 0xa8, 0x00, 0x10, 0x63, 0x84, 760x35, 0x00, 0x22, 0x35, 0x29, 0xa8, 0x00, 0x30, 0x63, 0x6f,
770x02, 0x50, 0x66, 0x69, 0x72, 0x73, 0x74, 0x7c, 0x02, 0x51, 770x6d, 0xc5, 0x00, 0x30, 0x72, 0x73, 0x74, 0x7c, 0x02, 0x51,
780x49, 0x6e, 0x00, 0x68, 0x61, 0xa5, 0x00, 0xf2, 0x03, 0x6f, 780x49, 0x6e, 0x00, 0x68, 0x61, 0xa5, 0x00, 0xf2, 0x03, 0x6f,
790x72, 0x00, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x72, 0x00, 0x70, 790x72, 0x00, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x72, 0x00, 0x70,
800x75, 0x7a, 0x7a, 0x6c, 0x65, 0x73, 0x2c, 0xaf, 0x02, 0x03, 800x75, 0x7a, 0x7a, 0x6c, 0x65, 0x73, 0x2c, 0xaf, 0x02, 0x03,
@@ -97,146 +97,146 @@ const char help_text[] = {
970x68, 0x6f, 0xfc, 0x00, 0xb1, 0x00, 0x69, 0x6e, 0x76, 0x65, 970x68, 0x6f, 0xfc, 0x00, 0xb1, 0x00, 0x69, 0x6e, 0x76, 0x65,
980x6e, 0x74, 0x65, 0x64, 0x00, 0x69, 0x08, 0x01, 0x44, 0x33, 980x6e, 0x74, 0x65, 0x64, 0x00, 0x69, 0x08, 0x01, 0x44, 0x33,
990x31, 0x2e, 0x31, 0x4b, 0x04, 0x00, 0x03, 0x03, 0x31, 0x72, 990x31, 0x2e, 0x31, 0x4b, 0x04, 0x00, 0x03, 0x03, 0x31, 0x72,
1000x6f, 0x6c, 0x54, 0x04, 0x02, 0x13, 0x00, 0x50, 0x00, 0x73, 1000x6f, 0x6c, 0x54, 0x04, 0x12, 0x54, 0xfe, 0x00, 0x40, 0x73,
1010x68, 0x61, 0x72, 0xb2, 0x00, 0x00, 0x78, 0x03, 0x21, 0x6f, 1010x68, 0x61, 0x72, 0xb2, 0x00, 0x00, 0x78, 0x03, 0x21, 0x6f,
1020x66, 0x1b, 0x04, 0x03, 0x26, 0x00, 0x72, 0x00, 0x73, 0x79, 1020x66, 0x1b, 0x04, 0x03, 0x26, 0x00, 0x72, 0x00, 0x73, 0x79,
1030x73, 0x74, 0x65, 0x6d, 0x33, 0x04, 0xd1, 0x53, 0x6f, 0x6c, 1030x73, 0x74, 0x65, 0x6d, 0x33, 0x04, 0xd1, 0x53, 0x6f, 0x6c,
1040x6f, 0x2c, 0x00, 0x55, 0x6e, 0x65, 0x71, 0x75, 0x61, 0x6c, 1040x6f, 0x2c, 0x00, 0x55, 0x6e, 0x65, 0x71, 0x75, 0x61, 0x6c,
1050xf4, 0x00, 0x41, 0x4b, 0x65, 0x65, 0x6e, 0xda, 0x00, 0x63, 1050xf4, 0x00, 0x51, 0x4b, 0x65, 0x65, 0x6e, 0x2e, 0x48, 0x00,
1060x6f, 0x00, 0x70, 0x6c, 0x61, 0x79, 0x50, 0x00, 0xe1, 0x2c, 1060x53, 0x00, 0x70, 0x6c, 0x61, 0x79, 0x50, 0x00, 0xe1, 0x2c,
1070x00, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x79, 0x00, 0x63, 0x6c, 1070x00, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x79, 0x00, 0x63, 0x6c,
1080x69, 0x63, 0x6b, 0xe0, 0x00, 0x51, 0x6d, 0x6f, 0x75, 0x73, 1080x69, 0x63, 0x6b, 0xe0, 0x00, 0x51, 0x6d, 0x6f, 0x75, 0x73,
1090x65, 0x91, 0x02, 0x74, 0x6e, 0x79, 0x00, 0x65, 0x6d, 0x70, 1090x65, 0x91, 0x02, 0x84, 0x6e, 0x79, 0x00, 0x65, 0x6d, 0x70,
1100x74, 0xf1, 0x03, 0x22, 0x00, 0x61, 0x49, 0x01, 0x50, 0x6e, 1100x74, 0x79, 0x03, 0x03, 0x12, 0x61, 0x49, 0x01, 0x50, 0x6e,
1110x00, 0x74, 0x79, 0x70, 0xdc, 0x04, 0x54, 0x64, 0x69, 0x67, 1110x00, 0x74, 0x79, 0x70, 0xdc, 0x04, 0x54, 0x64, 0x69, 0x67,
1120x69, 0x74, 0x17, 0x01, 0x80, 0x6b, 0x65, 0x79, 0x62, 0x6f, 1120x69, 0x74, 0x17, 0x01, 0x80, 0x6b, 0x65, 0x79, 0x62, 0x6f,
1130x61, 0x72, 0x64, 0x43, 0x02, 0x10, 0x66, 0xa3, 0x01, 0x02, 1130x61, 0x72, 0x64, 0x43, 0x02, 0x10, 0x66, 0xa3, 0x01, 0x02,
1140x13, 0x03, 0x02, 0x3a, 0x00, 0x01, 0x94, 0x00, 0x05, 0x48, 1140x13, 0x03, 0x02, 0x3a, 0x00, 0x01, 0x94, 0x00, 0x05, 0x48,
1150x04, 0x03, 0x8c, 0x04, 0x43, 0x69, 0x76, 0x65, 0x6e, 0xba, 1150x04, 0x03, 0x8c, 0x04, 0x43, 0x69, 0x76, 0x65, 0x6e, 0xba,
1160x02, 0x32, 0x2e, 0x00, 0x49, 0x7b, 0x03, 0x30, 0x6d, 0x61, 1160x02, 0x32, 0x2e, 0x00, 0x49, 0x7b, 0x03, 0x30, 0x6d, 0x61,
1170x6b, 0x5a, 0x00, 0x8f, 0x6d, 0x69, 0x73, 0x74, 0x61, 0x6b, 1170x6b, 0x5a, 0x00, 0x8e, 0x6d, 0x69, 0x73, 0x74, 0x61, 0x6b,
1180x65, 0x2c, 0x97, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x50, 0x69, 1180x65, 0x2c, 0x97, 0x00, 0x02, 0x6d, 0x00, 0x50, 0x69, 0x6e,
1190x6e, 0x63, 0x6f, 0x72, 0x86, 0x03, 0x08, 0x9b, 0x00, 0xa1, 1190x63, 0x6f, 0x72, 0x86, 0x03, 0x08, 0x9b, 0x00, 0xa1, 0x70,
1200x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x53, 0x70, 0x61, 0x63, 1200x72, 0x65, 0x73, 0x73, 0x00, 0x53, 0x70, 0x61, 0x63, 0xc8,
1210xc8, 0x02, 0x21, 0x63, 0x6c, 0x06, 0x03, 0xc0, 0x74, 0x00, 1210x02, 0x21, 0x63, 0x6c, 0x06, 0x03, 0xc0, 0x74, 0x00, 0x61,
1220x61, 0x67, 0x61, 0x69, 0x6e, 0x00, 0x28, 0x6f, 0x72, 0x00, 1220x67, 0x61, 0x69, 0x6e, 0x00, 0x28, 0x6f, 0x72, 0x00, 0x42,
1230x42, 0x00, 0x00, 0x3f, 0x00, 0xd1, 0x55, 0x6e, 0x64, 0x6f, 1230x00, 0x00, 0x3f, 0x00, 0xd1, 0x55, 0x6e, 0x64, 0x6f, 0x00,
1240x00, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x29, 0x7d, 1240x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x29, 0x7d, 0x02,
1250x02, 0x02, 0x7e, 0x00, 0x10, 0x72, 0x8c, 0x00, 0x12, 0x2d, 1250x02, 0x7e, 0x00, 0x10, 0x72, 0x8c, 0x00, 0x12, 0x2d, 0x74,
1260x74, 0x00, 0x01, 0x92, 0x03, 0x0f, 0xf9, 0x00, 0x04, 0x02, 1260x00, 0x01, 0x92, 0x03, 0x0f, 0xf9, 0x00, 0x04, 0x02, 0x4a,
1270x4a, 0x04, 0x12, 0x2c, 0xe3, 0x00, 0x03, 0x57, 0x04, 0x04, 1270x04, 0x12, 0x2c, 0xe3, 0x00, 0x03, 0x57, 0x04, 0x04, 0x97,
1280x97, 0x02, 0x00, 0xcc, 0x01, 0x10, 0x72, 0xce, 0x01, 0x18, 1280x02, 0x00, 0xcc, 0x01, 0x10, 0x72, 0xce, 0x01, 0x18, 0x6e,
1290x6e, 0x3e, 0x04, 0x01, 0x3a, 0x03, 0x71, 0x60, 0x70, 0x65, 1290x3e, 0x04, 0x01, 0x3a, 0x03, 0x71, 0x60, 0x70, 0x65, 0x6e,
1300x6e, 0x63, 0x69, 0x6c, 0x08, 0x03, 0x43, 0x27, 0x2e, 0x00, 1300x63, 0x69, 0x6c, 0x08, 0x03, 0x43, 0x27, 0x2e, 0x00, 0x59,
1310x59, 0xf3, 0x05, 0x01, 0x2a, 0x06, 0x07, 0x1b, 0x00, 0x11, 1310xf3, 0x05, 0x01, 0x2a, 0x06, 0x07, 0x1b, 0x00, 0x11, 0x73,
1320x73, 0xd1, 0x02, 0x74, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 1320xd1, 0x02, 0x74, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c,
1330x6c, 0xb7, 0x04, 0x15, 0x73, 0x51, 0x00, 0x24, 0x61, 0x6d, 1330xb7, 0x04, 0x15, 0x73, 0x51, 0x00, 0x24, 0x61, 0x6d, 0x56,
1340x56, 0x00, 0x34, 0x2e, 0x00, 0x41, 0x60, 0x00, 0x03, 0x2d, 1340x00, 0x34, 0x2e, 0x00, 0x41, 0x60, 0x00, 0x03, 0x2d, 0x05,
1350x05, 0x00, 0xea, 0x03, 0x04, 0x67, 0x01, 0x30, 0x63, 0x61, 1350x00, 0xea, 0x03, 0x04, 0x67, 0x01, 0x30, 0x63, 0x61, 0x6e,
1360x6e, 0xda, 0x03, 0x44, 0x61, 0x6c, 0x73, 0x6f, 0x1f, 0x00, 1360xda, 0x03, 0x44, 0x61, 0x6c, 0x73, 0x6f, 0x1f, 0x00, 0x09,
1370x09, 0x66, 0x00, 0x02, 0xe7, 0x02, 0x30, 0x65, 0x00, 0x67, 1370x66, 0x00, 0x02, 0xe7, 0x02, 0x30, 0x65, 0x00, 0x67, 0x51,
1380x51, 0x00, 0xd0, 0x70, 0x61, 0x79, 0x73, 0x00, 0x6e, 0x6f, 1380x00, 0xd0, 0x70, 0x61, 0x79, 0x73, 0x00, 0x6e, 0x6f, 0x00,
1390x00, 0x61, 0x74, 0x74, 0x65, 0x6e, 0xdc, 0x04, 0x00, 0x42, 1390x61, 0x74, 0x74, 0x65, 0x6e, 0xdc, 0x04, 0x00, 0x42, 0x01,
1400x01, 0x08, 0x2e, 0x00, 0x00, 0x84, 0x03, 0x00, 0xaf, 0x04, 1400x08, 0x2e, 0x00, 0x00, 0x84, 0x03, 0x00, 0xaf, 0x04, 0x60,
1410x60, 0x63, 0x74, 0x6c, 0x79, 0x00, 0x77, 0xf8, 0x00, 0x00, 1410x63, 0x74, 0x6c, 0x79, 0x00, 0x77, 0xf8, 0x00, 0x00, 0x31,
1420x31, 0x01, 0x03, 0x51, 0x01, 0x11, 0x6d, 0xb2, 0x00, 0x50, 1420x01, 0x03, 0x51, 0x01, 0x11, 0x6d, 0xb2, 0x00, 0x50, 0x69,
1430x69, 0x73, 0x00, 0x75, 0x70, 0x38, 0x00, 0x45, 0x79, 0x6f, 1430x73, 0x00, 0x75, 0x70, 0x38, 0x00, 0x45, 0x79, 0x6f, 0x75,
1440x75, 0x3a, 0xd1, 0x06, 0x05, 0x23, 0x00, 0x95, 0x61, 0x73, 1440x3a, 0xd1, 0x06, 0x05, 0x23, 0x00, 0x95, 0x61, 0x73, 0x00,
1450x00, 0x72, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x7b, 0x05, 0x17, 1450x72, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x7b, 0x05, 0x17, 0x61,
1460x61, 0x33, 0x03, 0x04, 0xc9, 0x00, 0x42, 0x6e, 0x65, 0x65, 1460x33, 0x03, 0x04, 0xc9, 0x00, 0x42, 0x6e, 0x65, 0x65, 0x64,
1470x64, 0x7c, 0x06, 0x50, 0x65, 0x00, 0x72, 0x65, 0x2d, 0x21, 1470x7c, 0x06, 0x50, 0x65, 0x00, 0x72, 0x65, 0x2d, 0x21, 0x05,
1480x05, 0x42, 0x69, 0x6e, 0x65, 0x64, 0xe6, 0x05, 0x00, 0x54, 1480x42, 0x69, 0x6e, 0x65, 0x64, 0xe6, 0x05, 0x00, 0x54, 0x00,
1490x00, 0x01, 0x3e, 0x03, 0x20, 0x6d, 0x6f, 0x54, 0x01, 0x3b, 1490x01, 0x3e, 0x03, 0x30, 0x6d, 0x6f, 0x72, 0xb1, 0x04, 0x2b,
1500x62, 0x6f, 0x75, 0x45, 0x00, 0x04, 0x99, 0x01, 0x2f, 0x6f, 1500x6f, 0x75, 0x45, 0x00, 0x04, 0x99, 0x01, 0x2f, 0x6f, 0x72,
1510x72, 0x80, 0x00, 0x02, 0x54, 0x6c, 0x69, 0x73, 0x74, 0x73, 1510x80, 0x00, 0x02, 0x54, 0x6c, 0x69, 0x73, 0x74, 0x73, 0x80,
1520x80, 0x02, 0x05, 0x51, 0x06, 0x07, 0x61, 0x01, 0x13, 0x61, 1520x02, 0x05, 0x51, 0x06, 0x07, 0x61, 0x01, 0x13, 0x61, 0x96,
1530x96, 0x02, 0x04, 0xe2, 0x06, 0x20, 0x6f, 0x72, 0x06, 0x03, 1530x02, 0x04, 0xe2, 0x06, 0x20, 0x6f, 0x72, 0x06, 0x03, 0x20,
1540x20, 0x74, 0x68, 0x58, 0x01, 0x23, 0x65, 0x6c, 0x36, 0x05, 1540x74, 0x68, 0x58, 0x01, 0x23, 0x65, 0x6c, 0x36, 0x05, 0x93,
1550x93, 0x66, 0x65, 0x65, 0x6c, 0x00, 0x6c, 0x69, 0x6b, 0x65, 1550x66, 0x65, 0x65, 0x6c, 0x00, 0x6c, 0x69, 0x6b, 0x65, 0x4f,
1560x4f, 0x03, 0x41, 0x65, 0x72, 0x61, 0x73, 0xeb, 0x07, 0x49, 1560x03, 0x41, 0x65, 0x72, 0x61, 0x73, 0xeb, 0x07, 0x49, 0x69,
1570x69, 0x6e, 0x67, 0x6c, 0xca, 0x01, 0x1c, 0x2c, 0x52, 0x02, 1570x6e, 0x67, 0x6c, 0xca, 0x01, 0x1c, 0x2c, 0x52, 0x02, 0x08,
1580x08, 0x12, 0x02, 0x00, 0x54, 0x02, 0x00, 0x4f, 0x02, 0x05, 1580x12, 0x02, 0x22, 0x6e, 0x64, 0x4f, 0x02, 0x05, 0xd5, 0x01,
1590xd5, 0x01, 0x03, 0x49, 0x02, 0x01, 0xaf, 0x02, 0x00, 0x5b, 1590x03, 0x49, 0x02, 0x01, 0xaf, 0x02, 0x00, 0x5b, 0x00, 0x3a,
1600x00, 0x3a, 0x41, 0x6c, 0x6c, 0x17, 0x02, 0x09, 0x93, 0x02, 1600x41, 0x6c, 0x6c, 0x17, 0x02, 0x09, 0x93, 0x02, 0x22, 0x72,
1610x22, 0x72, 0x65, 0x79, 0x00, 0x10, 0x64, 0x9b, 0x05, 0x12, 1610x65, 0x79, 0x00, 0x10, 0x64, 0x9b, 0x05, 0x12, 0x6e, 0xb8,
1620x6e, 0xb8, 0x06, 0x24, 0x65, 0x66, 0x6c, 0x00, 0x05, 0x5e, 1620x06, 0x24, 0x65, 0x66, 0x6c, 0x00, 0x05, 0x5e, 0x00, 0x18,
1630x00, 0x18, 0x61, 0x14, 0x01, 0x0f, 0x2a, 0x00, 0x05, 0x02, 1630x61, 0x14, 0x01, 0x0f, 0x2a, 0x00, 0x05, 0x02, 0x3a, 0x03,
1640x3a, 0x03, 0x10, 0x73, 0x3a, 0x03, 0x36, 0x2e, 0x00, 0x52, 1640x10, 0x73, 0x3a, 0x03, 0x36, 0x2e, 0x00, 0x52, 0xb3, 0x00,
1650xb3, 0x00, 0x01, 0x4f, 0x02, 0x04, 0x20, 0x00, 0x00, 0x0d, 1650x01, 0x4f, 0x02, 0x04, 0x20, 0x00, 0x00, 0x0d, 0x00, 0x01,
1660x00, 0x01, 0x23, 0x00, 0x02, 0xeb, 0x02, 0x01, 0x58, 0x02, 1660x23, 0x00, 0x02, 0xeb, 0x02, 0x01, 0x58, 0x02, 0x02, 0xfb,
1670x02, 0xfb, 0x00, 0x0c, 0x56, 0x02, 0x12, 0x41, 0xc2, 0x02, 1670x00, 0x0c, 0x56, 0x02, 0x12, 0x41, 0xc2, 0x02, 0x02, 0x84,
1680x02, 0x84, 0x04, 0x01, 0x8a, 0x05, 0x50, 0x75, 0x72, 0x73, 1680x04, 0x01, 0x8a, 0x05, 0x50, 0x75, 0x72, 0x73, 0x6f, 0x72,
1690x6f, 0x72, 0x23, 0x04, 0x14, 0x73, 0x70, 0x07, 0x22, 0x75, 1690x23, 0x04, 0x14, 0x73, 0x70, 0x07, 0x22, 0x75, 0x73, 0x24,
1700x73, 0x24, 0x03, 0x61, 0x63, 0x6f, 0x6e, 0x6a, 0x75, 0x6e, 1700x03, 0x61, 0x63, 0x6f, 0x6e, 0x6a, 0x75, 0x6e, 0x4f, 0x07,
1710x4f, 0x07, 0x02, 0x26, 0x04, 0x00, 0x30, 0x00, 0x02, 0x59, 1710x02, 0x26, 0x04, 0x00, 0x30, 0x00, 0x02, 0x59, 0x04, 0x01,
1720x04, 0x01, 0x2f, 0x00, 0x01, 0x91, 0x06, 0x15, 0x74, 0xa4, 1720x2f, 0x00, 0x01, 0x91, 0x06, 0x15, 0x74, 0xa4, 0x01, 0x2b,
1730x01, 0x2b, 0x6f, 0x72, 0x6e, 0x00, 0x3d, 0x55, 0x73, 0x65, 1730x6f, 0x72, 0x6e, 0x00, 0x3d, 0x55, 0x73, 0x65, 0x63, 0x00,
1740x63, 0x00, 0x51, 0x74, 0x6f, 0x00, 0x6d, 0x6f, 0x7e, 0x09, 1740x51, 0x74, 0x6f, 0x00, 0x6d, 0x6f, 0x7e, 0x09, 0x51, 0x68,
1750x51, 0x68, 0x69, 0x67, 0x68, 0x6c, 0x2f, 0x08, 0x16, 0x61, 1750x69, 0x67, 0x68, 0x6c, 0x2f, 0x08, 0x16, 0x61, 0x08, 0x06,
1760x08, 0x06, 0x03, 0x63, 0x07, 0x2a, 0x6e, 0x64, 0xc8, 0x04, 1760x03, 0x63, 0x07, 0x2a, 0x6e, 0x64, 0xc8, 0x04, 0x22, 0x74,
1770x22, 0x74, 0x6f, 0xbc, 0x03, 0x00, 0x33, 0x04, 0x03, 0xab, 1770x6f, 0xbc, 0x03, 0x00, 0x33, 0x04, 0x03, 0xab, 0x01, 0x05,
1780x01, 0x05, 0x3f, 0x00, 0x25, 0x65, 0x64, 0x73, 0x03, 0x14, 1780x3f, 0x00, 0x25, 0x65, 0x64, 0x73, 0x03, 0x14, 0x50, 0x0c,
1790x50, 0x0c, 0x01, 0x50, 0x72, 0x65, 0x74, 0x75, 0x72, 0x28, 1790x01, 0x50, 0x72, 0x65, 0x74, 0x75, 0x72, 0x28, 0x03, 0x5a,
1800x03, 0x5a, 0x67, 0x67, 0x6c, 0x65, 0x73, 0x30, 0x00, 0x02, 1800x67, 0x67, 0x6c, 0x65, 0x73, 0x30, 0x00, 0x02, 0x3e, 0x08,
1810x3e, 0x08, 0x51, 0x61, 0x00, 0x6d, 0x6f, 0x64, 0xb4, 0x04, 1810x51, 0x61, 0x00, 0x6d, 0x6f, 0x64, 0xb4, 0x04, 0x55, 0x77,
1820x55, 0x77, 0x68, 0x69, 0x63, 0x68, 0x93, 0x02, 0x02, 0x67, 1820x68, 0x69, 0x63, 0x68, 0x93, 0x02, 0x02, 0x67, 0x00, 0x20,
1830x00, 0x20, 0x6f, 0x72, 0x10, 0x03, 0x2e, 0x6f, 0x76, 0x40, 1830x6f, 0x72, 0x10, 0x03, 0x2e, 0x6f, 0x76, 0x40, 0x01, 0x05,
1840x01, 0x05, 0x63, 0x00, 0x12, 0x4d, 0x6b, 0x01, 0x01, 0x4f, 1840x63, 0x00, 0x12, 0x4d, 0x6b, 0x01, 0x01, 0x4f, 0x05, 0x01,
1850x05, 0x01, 0xfd, 0x01, 0x41, 0x66, 0x75, 0x6c, 0x6c, 0x10, 1850xfd, 0x01, 0x41, 0x66, 0x75, 0x6c, 0x6c, 0x10, 0x01, 0x2d,
1860x01, 0x2d, 0x6f, 0x66, 0x1b, 0x02, 0x08, 0x9c, 0x09, 0x03, 1860x6f, 0x66, 0x1b, 0x02, 0x08, 0x9c, 0x09, 0x03, 0xa9, 0x08,
1870xa9, 0x08, 0x31, 0x6f, 0x65, 0x73, 0xde, 0x07, 0x03, 0x8c, 1870x31, 0x6f, 0x65, 0x73, 0xde, 0x07, 0x03, 0x8c, 0x0a, 0x10,
1880x0a, 0x10, 0x6d, 0x03, 0x04, 0x02, 0xed, 0x00, 0x23, 0x69, 1880x6d, 0x03, 0x04, 0x02, 0xed, 0x00, 0x23, 0x69, 0x6e, 0x6f,
1890x6e, 0x6f, 0x06, 0x38, 0x4c, 0x65, 0x66, 0xed, 0x01, 0x02, 1890x06, 0x38, 0x4c, 0x65, 0x66, 0xed, 0x01, 0x02, 0xde, 0x07,
1900xde, 0x07, 0x01, 0xe1, 0x01, 0x00, 0x59, 0x00, 0x01, 0x3f, 1900x01, 0x76, 0x00, 0x00, 0x59, 0x00, 0x01, 0x3f, 0x05, 0x30,
1910x05, 0x10, 0x73, 0xb8, 0x06, 0x70, 0x65, 0x00, 0x28, 0x67, 1910x73, 0x00, 0x64, 0xbe, 0x07, 0x60, 0x28, 0x67, 0x72, 0x65,
1920x72, 0x65, 0x79, 0x11, 0x00, 0x41, 0x6f, 0x75, 0x74, 0x29, 1920x79, 0x00, 0xf1, 0x05, 0x31, 0x75, 0x74, 0x29, 0x4f, 0x02,
1930x4f, 0x02, 0x24, 0x75, 0x6e, 0x24, 0x00, 0x21, 0x69, 0x66, 1930x24, 0x75, 0x6e, 0x24, 0x00, 0x10, 0x69, 0x8a, 0x06, 0x00,
1940x06, 0x00, 0x93, 0x73, 0x00, 0x61, 0x6c, 0x72, 0x65, 0x61, 1940x01, 0x04, 0x73, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79,
1950x64, 0x79, 0xeb, 0x07, 0x60, 0x2e, 0x00, 0x48, 0x6f, 0x6c, 1950xeb, 0x07, 0x60, 0x2e, 0x00, 0x48, 0x6f, 0x6c, 0x64, 0x59,
1960x64, 0x59, 0x00, 0x13, 0x43, 0xa4, 0x06, 0x00, 0x17, 0x02, 1960x00, 0x13, 0x43, 0xa4, 0x06, 0x00, 0x17, 0x02, 0x4a, 0x68,
1970x4a, 0x68, 0x69, 0x66, 0x74, 0x57, 0x02, 0x50, 0x61, 0x6e, 1970x69, 0x66, 0x74, 0x57, 0x02, 0x50, 0x61, 0x6e, 0x00, 0x61,
1980x00, 0x61, 0x72, 0x31, 0x0a, 0x31, 0x6b, 0x65, 0x79, 0x5a, 1980x72, 0x31, 0x0a, 0x31, 0x6b, 0x65, 0x79, 0x5a, 0x03, 0x01,
1990x03, 0x01, 0xa2, 0x08, 0x02, 0xda, 0x00, 0x00, 0x86, 0x06, 1990xa2, 0x08, 0x02, 0xda, 0x00, 0x00, 0x86, 0x06, 0x01, 0x95,
2000x01, 0x95, 0x00, 0x27, 0x69, 0x6e, 0x37, 0x06, 0x05, 0x84, 2000x00, 0x27, 0x69, 0x6e, 0x37, 0x06, 0x05, 0x84, 0x09, 0x00,
2010x09, 0x00, 0xc4, 0x00, 0x21, 0x28, 0x41, 0x6f, 0x06, 0x31, 2010xc4, 0x00, 0x10, 0x28, 0x2a, 0x03, 0x00, 0x1c, 0x00, 0x11,
2020x65, 0x00, 0x61, 0x13, 0x00, 0x15, 0x73, 0xf8, 0x09, 0x01, 2020x61, 0x13, 0x00, 0x15, 0x73, 0xf8, 0x09, 0x11, 0x64, 0xa3,
2030x62, 0x02, 0x12, 0x73, 0x29, 0x00, 0x41, 0x00, 0x32, 0x2e, 2030x0a, 0x12, 0x65, 0x5e, 0x02, 0x31, 0x32, 0x2e, 0x31, 0x36,
2040x31, 0x36, 0x03, 0x01, 0xb9, 0x02, 0x50, 0x61, 0x76, 0x61, 2040x03, 0x01, 0xb9, 0x02, 0x50, 0x61, 0x76, 0x61, 0x69, 0x6c,
2050x69, 0x6c, 0xf2, 0x08, 0x22, 0x2e, 0x29, 0x74, 0x07, 0x14, 2050xf2, 0x08, 0x22, 0x2e, 0x29, 0x74, 0x07, 0x14, 0x32, 0x74,
2060x32, 0x74, 0x07, 0x73, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 2060x07, 0x73, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0xca,
2070x74, 0xca, 0x0b, 0x30, 0x54, 0x68, 0x65, 0xe1, 0x02, 0x05, 2070x0b, 0x30, 0x54, 0x68, 0x65, 0xe1, 0x02, 0x05, 0x14, 0x00,
2080x14, 0x00, 0x02, 0x42, 0x00, 0x04, 0x3d, 0x00, 0x04, 0x15, 2080x02, 0x42, 0x00, 0x04, 0x3d, 0x00, 0x04, 0x15, 0x0a, 0xf1,
2090x0a, 0xf1, 0x01, 0x65, 0x00, 0x60, 0x43, 0x75, 0x73, 0x74, 2090x01, 0x65, 0x00, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d,
2100x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x70, 2100x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x70, 0x00, 0x03,
2110x00, 0x03, 0x18, 0x07, 0xb0, 0x60, 0x54, 0x79, 0x70, 0x65, 2110x18, 0x07, 0xb0, 0x60, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00,
2120x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0xac, 0x00, 0x51, 0x47, 2120x6d, 0x65, 0x6e, 0x75, 0xac, 0x00, 0x51, 0x47, 0x72, 0x69,
2130x72, 0x69, 0x64, 0x20, 0xb0, 0x0b, 0x33, 0x00, 0x00, 0x53, 2130x64, 0x20, 0xb0, 0x0b, 0x33, 0x00, 0x00, 0x53, 0xc2, 0x08,
2140xc2, 0x08, 0x1f, 0x73, 0xc5, 0x0b, 0x04, 0x11, 0x4c, 0xc8, 2140x1f, 0x73, 0xc5, 0x0b, 0x04, 0x11, 0x4c, 0xc8, 0x05, 0x32,
2150x05, 0x32, 0x6c, 0x69, 0x6d, 0x5c, 0x01, 0x68, 0x33, 0x3b, 2150x6c, 0x69, 0x6d, 0x5c, 0x01, 0x68, 0x33, 0x3b, 0x00, 0x75,
2160x00, 0x75, 0x70, 0x70, 0x12, 0x00, 0x74, 0x39, 0x00, 0x28, 2160x70, 0x70, 0x12, 0x00, 0x74, 0x39, 0x00, 0x28, 0x62, 0x65,
2170x62, 0x65, 0x63, 0x61, 0xd7, 0x06, 0x20, 0x75, 0x73, 0xbe, 2170x63, 0x61, 0xd7, 0x06, 0x20, 0x75, 0x73, 0xbe, 0x02, 0x00,
2180x02, 0x00, 0x5d, 0x02, 0x11, 0x66, 0xa7, 0x03, 0x01, 0xde, 2180x5d, 0x02, 0x11, 0x66, 0xa7, 0x03, 0x01, 0xde, 0x09, 0x21,
2190x09, 0x21, 0x62, 0x65, 0x68, 0x09, 0x01, 0x32, 0x05, 0x40, 2190x62, 0x65, 0x68, 0x09, 0x01, 0x32, 0x05, 0x40, 0x64, 0x69,
2200x64, 0x69, 0x66, 0x66, 0x2a, 0x05, 0x12, 0x74, 0x6b, 0x03, 2200x66, 0x66, 0x2a, 0x05, 0x12, 0x74, 0x6b, 0x03, 0x11, 0x60,
2210x11, 0x60, 0x0c, 0x02, 0x60, 0x73, 0x27, 0x00, 0x62, 0x69, 2210x0c, 0x02, 0x70, 0x73, 0x27, 0x00, 0x62, 0x69, 0x67, 0x67,
2220x67, 0x6f, 0x09, 0x71, 0x74, 0x68, 0x61, 0x6e, 0x00, 0x39, 2220xb8, 0x0a, 0x61, 0x68, 0x61, 0x6e, 0x00, 0x39, 0x21, 0x12,
2230x21, 0x12, 0x07, 0x14, 0x44, 0x2b, 0x00, 0x34, 0x79, 0x00, 2230x07, 0x14, 0x44, 0x2b, 0x00, 0x34, 0x79, 0x00, 0x00, 0xbe,
2240x00, 0xbe, 0x01, 0x02, 0xa8, 0x00, 0x16, 0x64, 0x1a, 0x00, 2240x01, 0x13, 0x73, 0x9d, 0x03, 0x05, 0x1a, 0x00, 0x04, 0xae,
2250x04, 0xae, 0x00, 0x50, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x25, 2250x00, 0x50, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x25, 0x03, 0x02,
2260x03, 0x02, 0x32, 0x09, 0x70, 0x2e, 0x00, 0x41, 0x74, 0x00, 2260x32, 0x09, 0x70, 0x2e, 0x00, 0x41, 0x74, 0x00, 0x55, 0x6e,
2270x55, 0x6e, 0x30, 0x0a, 0x21, 0x6f, 0x6e, 0x28, 0x01, 0x53, 2270x30, 0x0a, 0x21, 0x6f, 0x6e, 0x28, 0x01, 0x53, 0x6c, 0x65,
2280x6c, 0x65, 0x76, 0x65, 0x6c, 0xc7, 0x09, 0x72, 0x62, 0x61, 2280x76, 0x65, 0x6c, 0xc7, 0x09, 0x72, 0x62, 0x61, 0x63, 0x6b,
2290x63, 0x6b, 0x74, 0x72, 0x61, 0x71, 0x02, 0x04, 0x36, 0x07, 2290x74, 0x72, 0x61, 0x71, 0x02, 0x04, 0x36, 0x07, 0x82, 0x72,
2300x82, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x2a, 2300x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x2a, 0x09, 0x01,
2310x09, 0x01, 0x0f, 0x01, 0x31, 0x6f, 0x6c, 0x75, 0x48, 0x01, 2310x0f, 0x01, 0x31, 0x6f, 0x6c, 0x75, 0x48, 0x01, 0x21, 0x73,
2320x21, 0x73, 0x68, 0xc8, 0x00, 0x23, 0x73, 0x74, 0x2b, 0x00, 2320x68, 0xc8, 0x00, 0x23, 0x73, 0x74, 0x2b, 0x00, 0x71, 0x75,
2330x71, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x2e, 0xbc, 0x06, 2330x6e, 0x69, 0x71, 0x75, 0x65, 0x2e, 0xbc, 0x06, 0x33, 0x72,
2340x33, 0x72, 0x65, 0x6d, 0xf6, 0x06, 0x01, 0x62, 0x00, 0x14, 2340x65, 0x6d, 0xf6, 0x06, 0x01, 0x62, 0x00, 0x14, 0x73, 0x48,
2350x73, 0x48, 0x00, 0x07, 0xfa, 0x0a, 0x00, 0xdc, 0x08, 0x10, 2350x00, 0x07, 0xfa, 0x0a, 0x00, 0xdc, 0x08, 0x10, 0x6f, 0x65,
2360x6f, 0x65, 0x0b, 0x22, 0x78, 0x00, 0x91, 0x00, 0x01, 0xaf, 2360x0b, 0x22, 0x78, 0x00, 0x91, 0x00, 0x01, 0xaf, 0x0b, 0x00,
2370x0b, 0x00, 0x02, 0x02, 0x30, 0x6f, 0x69, 0x64, 0x1a, 0x03, 2370x02, 0x02, 0x30, 0x6f, 0x69, 0x64, 0x1a, 0x03, 0x03, 0x10,
2380x03, 0x10, 0x00, 0xb0, 0x62, 0x61, 0x63, 0x6b, 0x74, 0x72, 2380x00, 0xb0, 0x62, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63,
2390x61, 0x63, 0x6b, 0x2e, 0x00, 2390x6b, 0x2e, 0x00,
240}; 240};
241 241
242const unsigned short help_text_len = 3541; 242const unsigned short help_text_len = 3541;
diff --git a/apps/plugins/puzzles/help/tracks.c b/apps/plugins/puzzles/help/tracks.c
index b46bd86f9e..d3bdc709be 100644
--- a/apps/plugins/puzzles/help/tracks.c
+++ b/apps/plugins/puzzles/help/tracks.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -15,7 +15,7 @@ struct style_text help_text_style[] = {
15 LAST_STYLE_ITEM 15 LAST_STYLE_ITEM
16}; 16};
17 17
18/* orig 1862 comp 1274 ratio 0.684211 level 11 saved 588 */ 18/* orig 1862 comp 1274 ratio 0.684211 level 10 saved 588 */
19const char help_text[] = { 19const char help_text[] = {
200xf0, 0x2c, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 200xf0, 0x2c, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
210x34, 0x30, 0x3a, 0x20, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x73, 210x34, 0x30, 0x3a, 0x20, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x73,
@@ -31,27 +31,27 @@ const char help_text[] = {
310x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x00, 0x74, 0x68, 0x65, 310x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x00, 0x74, 0x68, 0x65,
320x21, 0x00, 0x70, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x00, 0x41, 320x21, 0x00, 0x70, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x00, 0x41,
330x1d, 0x00, 0x91, 0x42, 0x00, 0x73, 0x6f, 0x00, 0x74, 0x68, 330x1d, 0x00, 0x91, 0x42, 0x00, 0x73, 0x6f, 0x00, 0x74, 0x68,
340x61, 0x74, 0x1e, 0x00, 0xf1, 0x09, 0x72, 0x6f, 0x77, 0x73, 340x61, 0x74, 0x1e, 0x00, 0xf1, 0x06, 0x72, 0x6f, 0x77, 0x73,
350x00, 0x61, 0x6e, 0x64, 0x00, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 350x00, 0x61, 0x6e, 0x64, 0x00, 0x63, 0x6f, 0x6c, 0x75, 0x6d,
360x6e, 0x73, 0x00, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 360x6e, 0x73, 0x00, 0x63, 0x6f, 0x6e, 0x74, 0x58, 0x00, 0xe0,
370x1d, 0x00, 0xe3, 0x73, 0x61, 0x6d, 0x65, 0x00, 0x6e, 0x75, 370x68, 0x65, 0x00, 0x73, 0x61, 0x6d, 0x65, 0x00, 0x6e, 0x75,
380x6d, 0x62, 0x65, 0x72, 0x00, 0x6f, 0x66, 0x4a, 0x00, 0xb1, 380x6d, 0x62, 0x65, 0x72, 0x87, 0x00, 0x02, 0x4a, 0x00, 0xb1,
390x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x00, 0x61, 390x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x00, 0x61,
400x73, 0x93, 0x00, 0xa3, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 400x73, 0x93, 0x00, 0xa3, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61,
410x74, 0x65, 0x64, 0x00, 0x36, 0x00, 0x82, 0x63, 0x6c, 0x75, 410x74, 0x65, 0x64, 0x00, 0x36, 0x00, 0x50, 0x63, 0x6c, 0x75,
420x65, 0x73, 0x00, 0x74, 0x6f, 0x7e, 0x00, 0x21, 0x6f, 0x70, 420x65, 0x73, 0x6a, 0x00, 0x01, 0x7e, 0x00, 0x21, 0x6f, 0x70,
430x5f, 0x00, 0x51, 0x72, 0x69, 0x67, 0x68, 0x74, 0x45, 0x00, 430x5f, 0x00, 0x51, 0x72, 0x69, 0x67, 0x68, 0x74, 0x45, 0x00,
440x21, 0x68, 0x65, 0xe9, 0x00, 0x91, 0x2e, 0x00, 0x00, 0x00, 440x21, 0x68, 0x65, 0xe9, 0x00, 0x91, 0x2e, 0x00, 0x00, 0x00,
450x54, 0x68, 0x65, 0x72, 0x65, 0x45, 0x00, 0x90, 0x6f, 0x6e, 450x54, 0x68, 0x65, 0x72, 0x65, 0x45, 0x00, 0x60, 0x6f, 0x6e,
460x6c, 0x79, 0x00, 0x73, 0x74, 0x72, 0x61, 0x27, 0x00, 0x01, 460x6c, 0x79, 0x00, 0x73, 0xd2, 0x00, 0x00, 0x27, 0x00, 0x00,
470x31, 0x00, 0xf0, 0x08, 0x39, 0x30, 0x00, 0x64, 0x65, 0x67, 470x31, 0x00, 0xf1, 0x08, 0x39, 0x30, 0x00, 0x64, 0x65, 0x67,
480x72, 0x65, 0x65, 0x00, 0x63, 0x75, 0x72, 0x76, 0x65, 0x64, 480x72, 0x65, 0x65, 0x00, 0x63, 0x75, 0x72, 0x76, 0x65, 0x64,
490x00, 0x72, 0x61, 0x69, 0x6c, 0x73, 0x2c, 0x1c, 0x00, 0x07, 490x00, 0x72, 0x61, 0x69, 0x6c, 0x73, 0x2c, 0x1c, 0x00, 0x06,
500xd7, 0x00, 0xf0, 0x05, 0x6d, 0x61, 0x79, 0x00, 0x6e, 0x6f, 500xd7, 0x00, 0xf1, 0x05, 0x6d, 0x61, 0x79, 0x00, 0x6e, 0x6f,
510x74, 0x00, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x00, 0x69, 0x74, 510x74, 0x00, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x00, 0x69, 0x74,
520x73, 0x65, 0x6c, 0x66, 0x5a, 0x00, 0x02, 0x65, 0x01, 0x32, 520x73, 0x65, 0x6c, 0x66, 0x5a, 0x00, 0x01, 0x16, 0x01, 0x32,
530x00, 0x77, 0x61, 0xd1, 0x00, 0x72, 0x72, 0x69, 0x62, 0x75, 530x00, 0x77, 0x61, 0xd1, 0x00, 0x40, 0x72, 0x69, 0x62, 0x75,
540x74, 0x65, 0x64, 0x95, 0x00, 0x20, 0x69, 0x73, 0xed, 0x00, 540xa2, 0x00, 0x01, 0x95, 0x00, 0x20, 0x69, 0x73, 0xed, 0x00,
550xf0, 0x08, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x00, 550xf0, 0x08, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x00,
560x62, 0x79, 0x00, 0x4a, 0x61, 0x6d, 0x65, 0x73, 0x00, 0x48, 560x62, 0x79, 0x00, 0x4a, 0x61, 0x6d, 0x65, 0x73, 0x00, 0x48,
570x61, 0x72, 0x76, 0x65, 0x79, 0x3d, 0x00, 0x44, 0x34, 0x30, 570x61, 0x72, 0x76, 0x65, 0x79, 0x3d, 0x00, 0x44, 0x34, 0x30,
@@ -62,34 +62,34 @@ const char help_text[] = {
620x65, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x00, 0x74, 0x77, 0x6f, 620x65, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x00, 0x74, 0x77, 0x6f,
630xbd, 0x01, 0x7a, 0x00, 0x61, 0x64, 0x64, 0x73, 0x00, 0x61, 630xbd, 0x01, 0x7a, 0x00, 0x61, 0x64, 0x64, 0x73, 0x00, 0x61,
640x34, 0x01, 0x06, 0x29, 0x00, 0x28, 0x68, 0x65, 0x2d, 0x00, 640x34, 0x01, 0x06, 0x29, 0x00, 0x28, 0x68, 0x65, 0x2d, 0x00,
650x6f, 0x2e, 0x00, 0x52, 0x69, 0x67, 0x68, 0x5c, 0x00, 0x02, 650x30, 0x2e, 0x00, 0x52, 0xf8, 0x00, 0x0f, 0x5c, 0x00, 0x02,
660x03, 0x48, 0x00, 0x03, 0xe1, 0x00, 0x11, 0x6f, 0x3b, 0x00, 660x03, 0x48, 0x00, 0x02, 0xe1, 0x00, 0x12, 0x6f, 0x3b, 0x00,
670x01, 0x19, 0x00, 0x14, 0x2c, 0x79, 0x01, 0x00, 0x30, 0x00, 670x00, 0x19, 0x00, 0x14, 0x2c, 0x79, 0x01, 0x00, 0x30, 0x00,
680x23, 0x6e, 0x6f, 0x69, 0x00, 0xa1, 0x69, 0x73, 0x00, 0x70, 680x23, 0x6e, 0x6f, 0x69, 0x00, 0xa1, 0x69, 0x73, 0x00, 0x70,
690x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0xfd, 0x01, 0x3c, 0x72, 690x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0xfd, 0x01, 0x3d, 0x72,
700x65, 0x2e, 0xb8, 0x00, 0x00, 0xa6, 0x01, 0x12, 0x61, 0x79, 700x65, 0x2e, 0xb8, 0x00, 0x10, 0x69, 0x6b, 0x02, 0x02, 0x79,
710x00, 0x06, 0x5d, 0x00, 0x54, 0x6f, 0x6c, 0x6f, 0x75, 0x72, 710x00, 0x05, 0x5d, 0x00, 0x54, 0x6f, 0x6c, 0x6f, 0x75, 0x72,
720x51, 0x00, 0xa2, 0x6f, 0x72, 0x00, 0x73, 0x68, 0x6f, 0x77, 720x51, 0x00, 0x70, 0x6f, 0x72, 0x00, 0x73, 0x68, 0x6f, 0x77,
730x69, 0x6e, 0x67, 0x27, 0x02, 0x80, 0x79, 0x6f, 0x75, 0x00, 730x2c, 0x00, 0x01, 0x27, 0x02, 0x82, 0x79, 0x6f, 0x75, 0x00,
740x6b, 0x6e, 0x6f, 0x77, 0x51, 0x00, 0x04, 0x39, 0x00, 0x44, 740x6b, 0x6e, 0x6f, 0x77, 0x13, 0x02, 0x02, 0x39, 0x00, 0x45,
750x6d, 0x75, 0x73, 0x74, 0x2b, 0x02, 0x04, 0xe6, 0x00, 0x30, 750x6d, 0x75, 0x73, 0x74, 0x2b, 0x02, 0x03, 0xe6, 0x00, 0x30,
760x2c, 0x00, 0x65, 0xc8, 0x02, 0x21, 0x69, 0x66, 0x32, 0x00, 760x2c, 0x00, 0x65, 0xc8, 0x02, 0x21, 0x69, 0x66, 0x32, 0x00,
770x51, 0x64, 0x6f, 0x6e, 0x27, 0x74, 0x38, 0x00, 0x02, 0xbf, 770x52, 0x64, 0x6f, 0x6e, 0x27, 0x74, 0x38, 0x00, 0x02, 0xbf,
780x02, 0x01, 0xb5, 0x00, 0x33, 0x73, 0x00, 0x69, 0xac, 0x01, 780x02, 0x00, 0xb5, 0x00, 0x00, 0xa3, 0x01, 0x02, 0xcb, 0x00,
790x65, 0x65, 0x73, 0x00, 0x79, 0x65, 0x74, 0xf9, 0x00, 0x0e, 790x6d, 0x65, 0x73, 0x00, 0x79, 0x65, 0x74, 0xf9, 0x00, 0x0e,
800x9d, 0x00, 0x0a, 0xfa, 0x00, 0x08, 0xed, 0x00, 0x15, 0x69, 800x9d, 0x00, 0x04, 0xdb, 0x01, 0x06, 0xed, 0x00, 0x15, 0x69,
810x7a, 0x00, 0x4a, 0x73, 0x00, 0x6e, 0x6f, 0x62, 0x01, 0x05, 810x7a, 0x00, 0x16, 0x73, 0xf9, 0x00, 0x03, 0x62, 0x01, 0x05,
820xef, 0x00, 0x32, 0x00, 0x6f, 0x72, 0x74, 0x02, 0x94, 0x2d, 820xef, 0x00, 0x32, 0x00, 0x6f, 0x72, 0x74, 0x02, 0x60, 0x2d,
830x64, 0x72, 0x61, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x7d, 0x01, 830x64, 0x72, 0x61, 0x67, 0x67, 0x38, 0x00, 0x04, 0x7d, 0x01,
840x06, 0xa2, 0x01, 0x50, 0x6c, 0x6c, 0x6f, 0x77, 0x73, 0xad, 840x05, 0xa2, 0x01, 0x20, 0x6c, 0x6c, 0xfd, 0x02, 0x00, 0xad,
850x00, 0x00, 0x18, 0x02, 0x56, 0x6c, 0x61, 0x79, 0x00, 0x61, 850x00, 0x86, 0x74, 0x6f, 0x00, 0x6c, 0x61, 0x79, 0x00, 0x61,
860x83, 0x02, 0x31, 0x6c, 0x69, 0x6e, 0x7b, 0x03, 0x32, 0x69, 860x83, 0x02, 0x31, 0x6c, 0x69, 0x6e, 0x7b, 0x03, 0x32, 0x69,
870x73, 0x2d, 0x61, 0x00, 0x20, 0x6f, 0x72, 0x0c, 0x00, 0x32, 870x73, 0x2d, 0x61, 0x00, 0x20, 0x6f, 0x72, 0x0c, 0x00, 0x33,
880x6e, 0x6f, 0x74, 0x10, 0x00, 0x06, 0x2d, 0x01, 0xd1, 0x73, 880x6e, 0x6f, 0x74, 0x10, 0x00, 0x05, 0x2d, 0x01, 0xd1, 0x73,
890x2c, 0x00, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x00, 0x66, 890x2c, 0x00, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x00, 0x66,
900x6f, 0x72, 0xa1, 0x03, 0x02, 0xc9, 0x00, 0x02, 0x5b, 0x03, 900x6f, 0x72, 0xa1, 0x03, 0x03, 0xc9, 0x00, 0x01, 0x5b, 0x03,
910x23, 0x6f, 0x72, 0x5a, 0x03, 0x01, 0x12, 0x03, 0x54, 0x6d, 910x25, 0x6f, 0x72, 0x5a, 0x03, 0x85, 0x74, 0x6f, 0x00, 0x6d,
920x61, 0x74, 0x63, 0x68, 0x25, 0x03, 0x01, 0x9c, 0x01, 0x41, 920x61, 0x74, 0x63, 0x68, 0x25, 0x03, 0x00, 0xad, 0x00, 0x41,
930x28, 0x41, 0x6c, 0x6c, 0x11, 0x00, 0x11, 0x61, 0x8f, 0x02, 930x28, 0x41, 0x6c, 0x6c, 0x11, 0x00, 0x11, 0x61, 0x8f, 0x02,
940x92, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 940x92, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62,
950x4f, 0x03, 0x13, 0x73, 0xa5, 0x02, 0x41, 0x32, 0x2e, 0x31, 950x4f, 0x03, 0x13, 0x73, 0xa5, 0x02, 0x41, 0x32, 0x2e, 0x31,
@@ -97,17 +97,17 @@ const char help_text[] = {
970x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x29, 970x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x29,
980xad, 0x02, 0x14, 0x32, 0xad, 0x02, 0xb2, 0x70, 0x61, 0x72, 980xad, 0x02, 0x14, 0x32, 0xad, 0x02, 0xb2, 0x70, 0x61, 0x72,
990x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x5e, 0x03, 990x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x5e, 0x03,
1000x35, 0x73, 0x65, 0x00, 0x14, 0x00, 0x01, 0xae, 0x03, 0x06, 1000x36, 0x73, 0x65, 0x00, 0x14, 0x00, 0x02, 0x42, 0x00, 0x04,
1010x3d, 0x00, 0x01, 0x12, 0x04, 0x01, 0x7a, 0x00, 0xe0, 0x60, 1010x3d, 0x00, 0x02, 0x12, 0x04, 0x00, 0x7a, 0x00, 0xe1, 0x60,
1020x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27, 1020x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 0x2e, 0x27,
1030x00, 0x6f, 0x70, 0x70, 0x00, 0x04, 0x68, 0x02, 0xb0, 0x60, 1030x00, 0x6f, 0x70, 0x70, 0x00, 0x03, 0x68, 0x02, 0xb0, 0x60,
1040x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 1040x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75,
1050xac, 0x00, 0x91, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x00, 1050xac, 0x00, 0x91, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x00,
1060x48, 0x65, 0x22, 0x01, 0x68, 0x00, 0x00, 0x53, 0x69, 0x7a, 1060x48, 0x65, 0x22, 0x01, 0x68, 0x00, 0x00, 0x53, 0x69, 0x7a,
1070x65, 0xd3, 0x03, 0x00, 0x93, 0x02, 0x06, 0xd3, 0x02, 0xf3, 1070x65, 0xd3, 0x03, 0x00, 0x93, 0x02, 0x06, 0xd3, 0x02, 0xf3,
1080x01, 0x00, 0x00, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 1080x01, 0x00, 0x00, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75,
1090x6c, 0x74, 0x79, 0x00, 0x00, 0x00, 0x43, 0x49, 0x03, 0x01, 1090x6c, 0x74, 0x79, 0x00, 0x00, 0x00, 0x43, 0x49, 0x03, 0x01,
1100x2e, 0x00, 0x15, 0x64, 0x1a, 0x00, 0x05, 0x40, 0x00, 0x41, 1100x2e, 0x00, 0x16, 0x64, 0x1a, 0x00, 0x04, 0x40, 0x00, 0x41,
1110x65, 0x6e, 0x65, 0x72, 0x46, 0x04, 0xf3, 0x0b, 0x70, 0x75, 1110x65, 0x6e, 0x65, 0x72, 0x46, 0x04, 0xf3, 0x0b, 0x70, 0x75,
1120x7a, 0x7a, 0x6c, 0x65, 0x3a, 0x00, 0x61, 0x74, 0x00, 0x54, 1120x7a, 0x7a, 0x6c, 0x65, 0x3a, 0x00, 0x61, 0x74, 0x00, 0x54,
1130x72, 0x69, 0x63, 0x6b, 0x79, 0x00, 0x6c, 0x65, 0x76, 0x65, 1130x72, 0x69, 0x63, 0x6b, 0x79, 0x00, 0x6c, 0x65, 0x76, 0x65,
@@ -117,33 +117,33 @@ const char help_text[] = {
1170x43, 0x01, 0x60, 0x72, 0x65, 0x67, 0x61, 0x72, 0x64, 0x86, 1170x43, 0x01, 0x60, 0x72, 0x65, 0x67, 0x61, 0x72, 0x64, 0x86,
1180x01, 0x36, 0x64, 0x69, 0x73, 0x0d, 0x00, 0x52, 0x6d, 0x6f, 1180x01, 0x36, 0x64, 0x69, 0x73, 0x0d, 0x00, 0x52, 0x6d, 0x6f,
1190x76, 0x65, 0x73, 0xd3, 0x02, 0x91, 0x77, 0x6f, 0x75, 0x6c, 1190x76, 0x65, 0x73, 0xd3, 0x02, 0x91, 0x77, 0x6f, 0x75, 0x6c,
1200x64, 0x00, 0x6c, 0x65, 0x61, 0x45, 0x00, 0x24, 0x69, 0x6d, 1200x64, 0x00, 0x6c, 0x65, 0x61, 0x45, 0x00, 0x25, 0x69, 0x6d,
1210x34, 0x03, 0x02, 0x6d, 0x02, 0xa2, 0x69, 0x6e, 0x67, 0x73, 1210x34, 0x03, 0x01, 0x6d, 0x02, 0xa2, 0x69, 0x6e, 0x67, 0x73,
1220x00, 0x6c, 0x61, 0x74, 0x65, 0x72, 0xc6, 0x00, 0x11, 0x73, 1220x00, 0x6c, 0x61, 0x74, 0x65, 0x72, 0xc6, 0x00, 0x11, 0x73,
1230x2a, 0x02, 0x00, 0x0b, 0x04, 0xb1, 0x73, 0x65, 0x63, 0x75, 1230x2a, 0x02, 0x00, 0x0b, 0x04, 0xb2, 0x73, 0x65, 0x63, 0x75,
1240x74, 0x69, 0x76, 0x65, 0x20, 0x31, 0x20, 0xe6, 0x04, 0x08, 1240x74, 0x69, 0x76, 0x65, 0x20, 0x31, 0x20, 0xe6, 0x04, 0x07,
1250xd8, 0x00, 0x30, 0x77, 0x68, 0x65, 0x72, 0x03, 0x00, 0xce, 1250xd8, 0x00, 0x30, 0x77, 0x68, 0x65, 0x72, 0x03, 0x01, 0xce,
1260x00, 0x04, 0x7f, 0x04, 0x34, 0x67, 0x61, 0x6d, 0xda, 0x00, 1260x00, 0x03, 0x7f, 0x04, 0x35, 0x67, 0x61, 0x6d, 0xda, 0x00,
1270x01, 0x57, 0x01, 0x71, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 1270x00, 0x57, 0x01, 0x71, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74,
1280x73, 0xfb, 0x03, 0x8f, 0x61, 0x64, 0x6a, 0x61, 0x63, 0x65, 1280x73, 0xfb, 0x03, 0x50, 0x61, 0x64, 0x6a, 0x61, 0x63, 0x14,
1290x6e, 0x74, 0x27, 0x02, 0x01, 0x81, 0x68, 0x61, 0x76, 0x65, 1290x04, 0x0f, 0x27, 0x02, 0x00, 0x81, 0x68, 0x61, 0x76, 0x65,
1300x00, 0x61, 0x00, 0x31, 0x26, 0x02, 0x44, 0x2c, 0x00, 0x6f, 1300x00, 0x61, 0x00, 0x31, 0x26, 0x02, 0x10, 0x2c, 0x1d, 0x00,
1310x72, 0x3a, 0x00, 0x04, 0xb3, 0x05, 0x06, 0x30, 0x00, 0x36, 1310x05, 0x3a, 0x00, 0x02, 0xb3, 0x05, 0x06, 0x30, 0x00, 0x04,
1320x00, 0x6f, 0x66, 0x0f, 0x05, 0xbd, 0x27, 0x73, 0x00, 0x65, 1320x40, 0x01, 0x01, 0x95, 0x02, 0xbd, 0x27, 0x73, 0x00, 0x65,
1330x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x47, 0x00, 0xc2, 1330x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x47, 0x00, 0xc2,
1340x2e, 0x00, 0x42, 0x79, 0x00, 0x64, 0x65, 0x66, 0x61, 0x75, 1340x2e, 0x00, 0x42, 0x79, 0x00, 0x64, 0x65, 0x66, 0x61, 0x75,
1350x6c, 0x74, 0x05, 0x05, 0x20, 0x69, 0x73, 0x3b, 0x05, 0x03, 1350x6c, 0x74, 0x05, 0x05, 0x21, 0x69, 0x73, 0x3b, 0x05, 0x02,
1360x5b, 0x00, 0x60, 0x74, 0x65, 0x64, 0x2c, 0x00, 0x74, 0x5d, 1360x5b, 0x00, 0x60, 0x74, 0x65, 0x64, 0x2c, 0x00, 0x74, 0x5d,
1370x02, 0x86, 0x6f, 0x69, 0x64, 0x00, 0x6c, 0x6f, 0x6e, 0x67, 1370x02, 0x86, 0x6f, 0x69, 0x64, 0x00, 0x6c, 0x6f, 0x6e, 0x67,
1380x0c, 0x03, 0x65, 0x62, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0xf9, 1380x0c, 0x03, 0x30, 0x62, 0x6f, 0x72, 0x40, 0x01, 0x05, 0xf9,
1390x05, 0x05, 0x0b, 0x06, 0x00, 0x8c, 0x05, 0x01, 0x82, 0x01, 1390x05, 0x05, 0x0b, 0x06, 0x00, 0x8c, 0x05, 0x01, 0x82, 0x01,
1400x02, 0xc2, 0x01, 0x00, 0x46, 0x05, 0x02, 0x8c, 0x01, 0x71, 1400x01, 0xc2, 0x01, 0x01, 0x46, 0x05, 0x01, 0x8c, 0x01, 0x71,
1410x74, 0x77, 0x69, 0x64, 0x64, 0x6c, 0x79, 0x20, 0x00, 0x70, 1410x74, 0x77, 0x69, 0x64, 0x64, 0x6c, 0x79, 0x20, 0x00, 0x70,
1420x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0xba, 0x03, 0x32, 1420x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0xba, 0x03, 0x32,
1430x2e, 0x00, 0x49, 0x1c, 0x04, 0x22, 0x77, 0x61, 0xa1, 0x00, 1430x2e, 0x00, 0x49, 0x1c, 0x04, 0x22, 0x77, 0x61, 0xa1, 0x00,
1440x00, 0x18, 0x00, 0x21, 0x6f, 0x72, 0x3f, 0x00, 0x03, 0xb7, 1440x00, 0x18, 0x00, 0x22, 0x6f, 0x72, 0x3f, 0x00, 0x02, 0x83,
1450x04, 0xb1, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2c, 0x00, 0x74, 1450x01, 0xb2, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2c, 0x00, 0x74,
1460x75, 0x72, 0x6e, 0xa5, 0x00, 0x04, 0x91, 0x02, 0x50, 0x6f, 1460x75, 0x72, 0x6e, 0xa5, 0x00, 0x03, 0x91, 0x02, 0x50, 0x6f,
1470x66, 0x66, 0x2e, 0x00, 1470x66, 0x66, 0x2e, 0x00,
148}; 148};
149 149
diff --git a/apps/plugins/puzzles/help/twiddle.c b/apps/plugins/puzzles/help/twiddle.c
index 6666746226..72495874b8 100644
--- a/apps/plugins/puzzles/help/twiddle.c
+++ b/apps/plugins/puzzles/help/twiddle.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -11,7 +11,7 @@ struct style_text help_text_style[] = {
11 LAST_STYLE_ITEM 11 LAST_STYLE_ITEM
12}; 12};
13 13
14/* orig 2926 comp 1865 ratio 0.637389 level 11 saved 1061 */ 14/* orig 2926 comp 1866 ratio 0.637731 level 10 saved 1060 */
15const char help_text[] = { 15const char help_text[] = {
160xf3, 0x07, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 160xf3, 0x07, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
170x37, 0x3a, 0x20, 0x54, 0x77, 0x69, 0x64, 0x64, 0x6c, 0x65, 170x37, 0x3a, 0x20, 0x54, 0x77, 0x69, 0x64, 0x64, 0x6c, 0x65,
@@ -22,107 +22,107 @@ const char help_text[] = {
220x00, 0x76, 0x69, 0x73, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x00, 220x00, 0x76, 0x69, 0x73, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x00,
230x73, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72, 0x00, 0x74, 0x6f, 230x73, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72, 0x00, 0x74, 0x6f,
240x00, 0x53, 0x69, 0x78, 0x74, 0x65, 0x65, 0x6e, 0x00, 0x28, 240x00, 0x53, 0x69, 0x78, 0x74, 0x65, 0x65, 0x6e, 0x00, 0x28,
250x73, 0x65, 0x65, 0x00, 0x63, 0x5f, 0x00, 0xf1, 0x14, 0x00, 250x73, 0x65, 0x65, 0x00, 0x63, 0x5f, 0x00, 0xf0, 0x11, 0x00,
260x36, 0x29, 0x3a, 0x00, 0x79, 0x6f, 0x75, 0x00, 0x61, 0x72, 260x36, 0x29, 0x3a, 0x00, 0x79, 0x6f, 0x75, 0x00, 0x61, 0x72,
270x65, 0x00, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x00, 0x61, 0x00, 270x65, 0x00, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x00, 0x61, 0x00,
280x67, 0x72, 0x69, 0x64, 0x00, 0x6f, 0x66, 0x00, 0x73, 0x71, 280x67, 0x72, 0x69, 0x64, 0x00, 0x6f, 0x66, 0x00, 0x73, 0x71,
290x75, 0x61, 0x72, 0x65, 0x67, 0x00, 0xf0, 0x11, 0x73, 0x2c, 290x75, 0x17, 0x00, 0x00, 0x67, 0x00, 0xf0, 0x11, 0x73, 0x2c,
300x00, 0x65, 0x61, 0x63, 0x68, 0x00, 0x63, 0x6f, 0x6e, 0x74, 300x00, 0x65, 0x61, 0x63, 0x68, 0x00, 0x63, 0x6f, 0x6e, 0x74,
310x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x00, 0x61, 0x00, 0x6e, 310x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x00, 0x61, 0x00, 0x6e,
320x75, 0x6d, 0x62, 0x65, 0x72, 0x2c, 0x00, 0x61, 0x6e, 0x64, 320x75, 0x6d, 0x62, 0x65, 0x72, 0x2c, 0x00, 0x61, 0x6e, 0x64,
330x44, 0x00, 0x80, 0x72, 0x00, 0x61, 0x69, 0x6d, 0x00, 0x69, 330x44, 0x00, 0x50, 0x72, 0x00, 0x61, 0x69, 0x6d, 0x9a, 0x00,
340x73, 0x6c, 0x00, 0x03, 0x94, 0x00, 0x43, 0x00, 0x74, 0x68, 340x33, 0x74, 0x6f, 0x00, 0x94, 0x00, 0x43, 0x00, 0x74, 0x68,
350x65, 0x27, 0x00, 0x40, 0x73, 0x00, 0x69, 0x6e, 0x19, 0x00, 350x65, 0x27, 0x00, 0x40, 0x73, 0x00, 0x69, 0x6e, 0x19, 0x00,
360x50, 0x73, 0x63, 0x65, 0x6e, 0x64, 0x40, 0x00, 0xf4, 0x02, 360x50, 0x73, 0x63, 0x65, 0x6e, 0x64, 0x40, 0x00, 0xf4, 0x02,
370x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x00, 0x00, 0x00, 0x49, 370x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x00, 0x00, 0x00, 0x49,
380x6e, 0x00, 0x62, 0x61, 0x73, 0x69, 0x63, 0xdd, 0x00, 0x12, 380x6e, 0x00, 0x62, 0x61, 0x73, 0x69, 0x63, 0xdd, 0x00, 0x12,
390x2c, 0x4d, 0x00, 0x43, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x00, 390x2c, 0x4d, 0x00, 0x43, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x00,
400x84, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x00, 0x61, 0x92, 400x84, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x00, 0x61, 0x92,
410x00, 0x50, 0x67, 0x72, 0x6f, 0x75, 0x70, 0xa2, 0x00, 0x42, 410x00, 0x50, 0x67, 0x72, 0x6f, 0x75, 0x70, 0xa2, 0x00, 0x10,
420x66, 0x6f, 0x75, 0x72, 0xa0, 0x00, 0x60, 0x00, 0x61, 0x62, 420x66, 0x29, 0x00, 0x01, 0xa0, 0x00, 0x60, 0x00, 0x61, 0x62,
430x6f, 0x75, 0x74, 0x70, 0x00, 0xf0, 0x0f, 0x69, 0x72, 0x00, 430x6f, 0x75, 0x74, 0x70, 0x00, 0xf0, 0x0f, 0x69, 0x72, 0x00,
440x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x00, 0x63, 0x65, 0x6e, 440x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x00, 0x63, 0x65, 0x6e,
450x74, 0x72, 0x65, 0x2e, 0x00, 0x28, 0x4f, 0x72, 0x69, 0x65, 450x74, 0x72, 0x65, 0x2e, 0x00, 0x28, 0x4f, 0x72, 0x69, 0x65,
460x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x00, 0xf0, 460x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x00, 0xf1,
470x03, 0x6e, 0x6f, 0x74, 0x00, 0x73, 0x69, 0x67, 0x6e, 0x69, 470x03, 0x6e, 0x6f, 0x74, 0x00, 0x73, 0x69, 0x67, 0x6e, 0x69,
480x66, 0x69, 0x63, 0x61, 0x6e, 0x74, 0x00, 0x69, 0x6e, 0x38, 480x66, 0x69, 0x63, 0x61, 0x6e, 0x74, 0x00, 0x69, 0x6e, 0xa8,
490x00, 0x02, 0x85, 0x00, 0x05, 0x42, 0x01, 0x81, 0x61, 0x6c, 490x00, 0x02, 0x85, 0x00, 0x04, 0x42, 0x01, 0x81, 0x61, 0x6c,
500x74, 0x68, 0x6f, 0x75, 0x67, 0x68, 0x1e, 0x01, 0xf4, 0x1b, 500x74, 0x68, 0x6f, 0x75, 0x67, 0x68, 0x1e, 0x01, 0xf5, 0x1b,
510x63, 0x61, 0x6e, 0x00, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 510x63, 0x61, 0x6e, 0x00, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74,
520x00, 0x69, 0x74, 0x2e, 0x29, 0x00, 0x4f, 0x6e, 0x00, 0x6d, 520x00, 0x69, 0x74, 0x2e, 0x29, 0x00, 0x4f, 0x6e, 0x00, 0x6d,
530x6f, 0x72, 0x65, 0x00, 0x61, 0x64, 0x76, 0x61, 0x6e, 0x63, 530x6f, 0x72, 0x65, 0x00, 0x61, 0x64, 0x76, 0x61, 0x6e, 0x63,
540x65, 0x64, 0x00, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 540x65, 0x64, 0x00, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67,
550x73, 0x2c, 0x2f, 0x00, 0x06, 0xb4, 0x00, 0x6c, 0x6c, 0x61, 550x73, 0x2c, 0x2f, 0x00, 0x05, 0xb4, 0x00, 0x6d, 0x6c, 0x61,
560x72, 0x67, 0x65, 0x72, 0xbb, 0x00, 0x02, 0xb6, 0x00, 0x01, 560x72, 0x67, 0x65, 0x72, 0xbb, 0x00, 0x01, 0xb6, 0x00, 0x01,
570xff, 0x00, 0xd0, 0x00, 0x66, 0x69, 0x72, 0x73, 0x74, 0x00, 570xff, 0x00, 0xd0, 0x00, 0x66, 0x69, 0x72, 0x73, 0x74, 0x00,
580x73, 0x61, 0x77, 0x00, 0x74, 0x68, 0xf1, 0x00, 0x63, 0x79, 580x73, 0x61, 0x77, 0x00, 0x74, 0x68, 0xf1, 0x00, 0x30, 0x79,
590x70, 0x65, 0x00, 0x6f, 0x66, 0x8a, 0x00, 0x04, 0x9e, 0x00, 590x70, 0x65, 0x22, 0x00, 0x02, 0x8a, 0x00, 0x04, 0x9e, 0x00,
600xf2, 0x13, 0x47, 0x61, 0x6d, 0x65, 0x43, 0x75, 0x62, 0x65, 600xf2, 0x13, 0x47, 0x61, 0x6d, 0x65, 0x43, 0x75, 0x62, 0x65,
610x00, 0x67, 0x61, 0x6d, 0x65, 0x00, 0x60, 0x4d, 0x65, 0x74, 610x00, 0x67, 0x61, 0x6d, 0x65, 0x00, 0x60, 0x4d, 0x65, 0x74,
620x72, 0x6f, 0x69, 0x64, 0x00, 0x50, 0x72, 0x69, 0x6d, 0x65, 620x72, 0x6f, 0x69, 0x64, 0x00, 0x50, 0x72, 0x69, 0x6d, 0x65,
630x00, 0x32, 0x27, 0x2e, 0x00, 0x49, 0x28, 0x00, 0xd0, 0x4d, 630x00, 0x32, 0x27, 0x2e, 0x00, 0x49, 0x28, 0x00, 0xd0, 0x4d,
640x61, 0x69, 0x6e, 0x00, 0x47, 0x79, 0x72, 0x6f, 0x00, 0x43, 640x61, 0x69, 0x6e, 0x00, 0x47, 0x79, 0x72, 0x6f, 0x00, 0x43,
650x68, 0x61, 0x79, 0x01, 0x02, 0x41, 0x00, 0x21, 0x61, 0x74, 650x68, 0x61, 0x79, 0x01, 0x02, 0x41, 0x00, 0x21, 0x61, 0x74,
660x39, 0x00, 0x10, 0x2c, 0x24, 0x00, 0x12, 0x72, 0x40, 0x02, 660x39, 0x00, 0x10, 0x2c, 0x24, 0x00, 0x13, 0x72, 0x40, 0x02,
670x03, 0x61, 0x00, 0x01, 0xb2, 0x00, 0x50, 0x73, 0x6f, 0x6c, 670x03, 0x61, 0x00, 0x00, 0xb2, 0x00, 0x50, 0x73, 0x6f, 0x6c,
680x76, 0x65, 0x6b, 0x01, 0xf2, 0x05, 0x75, 0x6e, 0x6c, 0x6f, 680x76, 0x65, 0x6b, 0x01, 0xf2, 0x05, 0x75, 0x6e, 0x6c, 0x6f,
690x63, 0x6b, 0x00, 0x61, 0x00, 0x64, 0x6f, 0x6f, 0x72, 0x2c, 690x63, 0x6b, 0x00, 0x61, 0x00, 0x64, 0x6f, 0x6f, 0x72, 0x2c,
700x00, 0x77, 0x68, 0x69, 0x63, 0x68, 0x2e, 0x00, 0xb0, 0x73, 700x00, 0x77, 0x68, 0x69, 0x63, 0x68, 0x2e, 0x00, 0xb1, 0x73,
710x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x00, 0x63, 0x61, 0x73, 710x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x00, 0x63, 0x61, 0x73,
720x9f, 0x00, 0x04, 0xae, 0x01, 0xd1, 0x2e, 0x00, 0x49, 0x00, 720x9f, 0x00, 0x03, 0xae, 0x01, 0xd2, 0x2e, 0x00, 0x49, 0x00,
730x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x64, 0xc1, 730x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x64, 0xc1,
740x00, 0x02, 0xa2, 0x00, 0x20, 0x61, 0x73, 0x4a, 0x02, 0x82, 740x00, 0x01, 0xa2, 0x00, 0x20, 0x61, 0x73, 0x4a, 0x02, 0x82,
750x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x69, 0x73, 0x7c, 0x01, 750x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x69, 0x73, 0x7c, 0x01,
760x20, 0x6f, 0x66, 0x8a, 0x00, 0x04, 0xa6, 0x02, 0x00, 0xfd, 760x22, 0x6f, 0x66, 0x8a, 0x00, 0x02, 0x79, 0x00, 0x00, 0xfd,
770x00, 0x35, 0x37, 0x2e, 0x31, 0xdf, 0x02, 0x00, 0x5c, 0x02, 770x00, 0x35, 0x37, 0x2e, 0x31, 0xdf, 0x02, 0x00, 0x5c, 0x02,
780x41, 0x72, 0x6f, 0x6c, 0x73, 0xe8, 0x02, 0x66, 0x6f, 0x00, 780x41, 0x72, 0x6f, 0x6c, 0x73, 0xe8, 0x02, 0x66, 0x6f, 0x00,
790x70, 0x6c, 0x61, 0x79, 0x13, 0x02, 0x51, 0x63, 0x6c, 0x69, 790x70, 0x6c, 0x61, 0x79, 0x13, 0x02, 0x51, 0x63, 0x6c, 0x69,
800x63, 0x6b, 0xe1, 0x00, 0x44, 0x6d, 0x6f, 0x75, 0x73, 0x16, 800x63, 0x6b, 0xe1, 0x00, 0x45, 0x6d, 0x6f, 0x75, 0x73, 0x16,
810x01, 0x03, 0xe3, 0x01, 0x02, 0x59, 0x00, 0x19, 0x65, 0x64, 810x01, 0x02, 0xe3, 0x01, 0x02, 0x59, 0x00, 0x1a, 0x65, 0x64,
820x01, 0x01, 0xd7, 0x00, 0x45, 0x77, 0x69, 0x73, 0x68, 0x41, 820x01, 0x00, 0xd7, 0x00, 0x46, 0x77, 0x69, 0x73, 0x68, 0x41,
830x02, 0x00, 0xab, 0x00, 0x08, 0xea, 0x01, 0x32, 0x6d, 0x6f, 830x02, 0x05, 0x24, 0x01, 0x02, 0xea, 0x01, 0x32, 0x6d, 0x6f,
840x64, 0x6c, 0x02, 0x06, 0xac, 0x01, 0x33, 0x32, 0x78, 0x32, 840x64, 0x6c, 0x02, 0x06, 0xac, 0x01, 0x33, 0x32, 0x78, 0x32,
850x45, 0x00, 0x04, 0xfb, 0x00, 0x51, 0x6d, 0x65, 0x61, 0x6e, 850x45, 0x00, 0x04, 0xfb, 0x00, 0x51, 0x6d, 0x65, 0x61, 0x6e,
860x73, 0x25, 0x00, 0x21, 0x68, 0x61, 0x22, 0x01, 0x03, 0x8a, 860x73, 0x25, 0x00, 0x22, 0x68, 0x61, 0x22, 0x01, 0x02, 0x8a,
870x00, 0xf0, 0x04, 0x61, 0x74, 0x00, 0x61, 0x00, 0x63, 0x6f, 870x00, 0xf1, 0x04, 0x61, 0x74, 0x00, 0x61, 0x00, 0x63, 0x6f,
880x72, 0x6e, 0x65, 0x72, 0x00, 0x70, 0x6f, 0x69, 0x6e, 0x74, 880x72, 0x6e, 0x65, 0x72, 0x00, 0x70, 0x6f, 0x69, 0x6e, 0x74,
890x00, 0x77, 0x59, 0x01, 0x08, 0x92, 0x02, 0x41, 0x6d, 0x65, 890x00, 0x77, 0x59, 0x01, 0x07, 0x92, 0x02, 0x43, 0x6d, 0x65,
900x65, 0x74, 0xe1, 0x01, 0x0b, 0x2d, 0x02, 0x01, 0x79, 0x00, 900x65, 0x74, 0xe0, 0x02, 0x0a, 0x2d, 0x02, 0x00, 0x79, 0x00,
910x02, 0x54, 0x00, 0x82, 0x6d, 0x69, 0x67, 0x68, 0x74, 0x00, 910x02, 0x54, 0x00, 0x82, 0x6d, 0x69, 0x67, 0x68, 0x74, 0x00,
920x62, 0x65, 0x82, 0x00, 0x00, 0x16, 0x03, 0xa4, 0x33, 0x78, 920x62, 0x65, 0x82, 0x00, 0x00, 0x16, 0x03, 0xa4, 0x33, 0x78,
930x33, 0x00, 0x6f, 0x72, 0x00, 0x65, 0x76, 0x65, 0x36, 0x00, 930x33, 0x00, 0x6f, 0x72, 0x00, 0x65, 0x76, 0x65, 0x36, 0x00,
940x11, 0x74, 0xea, 0x03, 0x53, 0x6d, 0x65, 0x3b, 0x00, 0x69, 940x11, 0x74, 0xea, 0x03, 0x53, 0x6d, 0x65, 0x3b, 0x00, 0x69,
950xe6, 0x00, 0x29, 0x69, 0x7a, 0xf2, 0x00, 0x02, 0xcf, 0x01, 950xe6, 0x00, 0x2c, 0x69, 0x7a, 0xf2, 0x00, 0x60, 0x69, 0x73,
960x30, 0x6f, 0x64, 0x64, 0x12, 0x00, 0x12, 0x6e, 0xcf, 0x01, 960x00, 0x6f, 0x64, 0x64, 0x12, 0x00, 0x12, 0x6e, 0xcf, 0x01,
970x52, 0x69, 0x6d, 0x70, 0x6c, 0x79, 0xab, 0x00, 0x08, 0x2b, 970x53, 0x69, 0x6d, 0x70, 0x6c, 0x79, 0xab, 0x00, 0x0a, 0x2b,
980x01, 0x02, 0xce, 0x03, 0x0b, 0x3e, 0x00, 0x02, 0x2a, 0x01, 980x01, 0x00, 0x9c, 0x00, 0x0b, 0x3e, 0x00, 0x01, 0x2a, 0x01,
990x38, 0x61, 0x6e, 0x74, 0x2a, 0x01, 0x30, 0x00, 0x00, 0x43, 990x00, 0x09, 0x03, 0x07, 0x2a, 0x01, 0x30, 0x00, 0x00, 0x43,
1000x3d, 0x00, 0x00, 0x93, 0x00, 0x41, 0x77, 0x69, 0x74, 0x68, 1000x3d, 0x00, 0x00, 0x93, 0x00, 0x41, 0x77, 0x69, 0x74, 0x68,
1010x2f, 0x00, 0x43, 0x6c, 0x65, 0x66, 0x74, 0x7f, 0x01, 0x54, 1010x2f, 0x00, 0x43, 0x6c, 0x65, 0x66, 0x74, 0x7f, 0x01, 0x54,
1020x62, 0x75, 0x74, 0x74, 0x6f, 0xe5, 0x02, 0x44, 0x73, 0x00, 1020x62, 0x75, 0x74, 0x74, 0x6f, 0xe5, 0x02, 0x11, 0x73, 0x1e,
1030x74, 0x68, 0x76, 0x01, 0x50, 0x61, 0x6e, 0x74, 0x69, 0x63, 1030x00, 0x02, 0x76, 0x01, 0x50, 0x61, 0x6e, 0x74, 0x69, 0x63,
1040x43, 0x02, 0x5f, 0x77, 0x69, 0x73, 0x65, 0x2e, 0x45, 0x00, 1040x43, 0x02, 0x5f, 0x77, 0x69, 0x73, 0x65, 0x2e, 0x45, 0x00,
1050x00, 0x10, 0x72, 0xf3, 0x00, 0x0c, 0x40, 0x00, 0x37, 0x69, 1050x00, 0x12, 0x72, 0xf3, 0x00, 0x0a, 0x40, 0x00, 0x37, 0x69,
1060x74, 0x00, 0x35, 0x00, 0x33, 0x00, 0x00, 0x59, 0x45, 0x03, 1060x74, 0x00, 0x35, 0x00, 0x33, 0x00, 0x00, 0x59, 0x45, 0x03,
1070x42, 0x61, 0x6c, 0x73, 0x6f, 0x09, 0x04, 0x95, 0x61, 0x6e, 1070x42, 0x61, 0x6c, 0x73, 0x6f, 0x09, 0x04, 0x95, 0x61, 0x6e,
1080x00, 0x6f, 0x75, 0x74, 0x6c, 0x69, 0x6e, 0xb6, 0x00, 0x51, 1080x00, 0x6f, 0x75, 0x74, 0x6c, 0x69, 0x6e, 0xb6, 0x00, 0x51,
1090x61, 0x72, 0x6f, 0x75, 0x6e, 0xf4, 0x00, 0x01, 0xb1, 0x04, 1090x61, 0x72, 0x6f, 0x75, 0x6e, 0xf4, 0x00, 0x02, 0xb1, 0x04,
1100x06, 0x62, 0x00, 0xca, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 1100x05, 0x62, 0x00, 0xcb, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72,
1110x00, 0x6b, 0x65, 0x79, 0x73, 0x3b, 0x25, 0x01, 0x06, 0x3f, 1110x00, 0x6b, 0x65, 0x79, 0x73, 0x3b, 0x25, 0x01, 0x05, 0x3f,
1120x01, 0x20, 0x61, 0x62, 0x55, 0x00, 0x10, 0x28, 0xf0, 0x01, 1120x01, 0x20, 0x61, 0x62, 0x55, 0x00, 0x10, 0x28, 0xf0, 0x01,
1130xe3, 0x62, 0x79, 0x00, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 1130xb0, 0x62, 0x79, 0x00, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,
1140x74, 0x2c, 0x00, 0x6f, 0x72, 0xaf, 0x03, 0xb2, 0x29, 0x2e, 1140x74, 0x2c, 0x7a, 0x01, 0x02, 0xaf, 0x03, 0x80, 0x29, 0x2e,
1150x00, 0x50, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0xb6, 1150x00, 0x50, 0x72, 0x65, 0x73, 0x73, 0xbb, 0x00, 0x01, 0xb6,
1160x00, 0x50, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x54, 0x00, 0x00, 1160x00, 0x50, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x54, 0x00, 0x00,
1170x24, 0x00, 0x40, 0x73, 0x70, 0x61, 0x63, 0x46, 0x02, 0x63, 1170x24, 0x00, 0x40, 0x73, 0x70, 0x61, 0x63, 0x46, 0x02, 0x64,
1180x72, 0x00, 0x77, 0x69, 0x6c, 0x6c, 0xc6, 0x00, 0x04, 0x7c, 1180x72, 0x00, 0x77, 0x69, 0x6c, 0x6c, 0x3f, 0x02, 0x03, 0x7c,
1190x00, 0x43, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x00, 0x0a, 0x0e, 1190x00, 0x10, 0x72, 0x88, 0x05, 0x04, 0xa4, 0x00, 0x08, 0x0e,
1200x01, 0x00, 0x3a, 0x00, 0x06, 0x0d, 0x00, 0x20, 0x72, 0x65, 1200x01, 0x00, 0x3a, 0x00, 0x06, 0x0d, 0x00, 0x20, 0x72, 0x65,
1210x51, 0x03, 0x60, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x79, 0xf3, 1210x51, 0x03, 0x60, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x79, 0xf3,
1220x00, 0x41, 0x28, 0x41, 0x6c, 0x6c, 0x43, 0x00, 0x20, 0x61, 1220x00, 0x41, 0x28, 0x41, 0x6c, 0x6c, 0x43, 0x00, 0x20, 0x61,
1230x63, 0x2c, 0x03, 0xd0, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63, 1230x63, 0x2c, 0x03, 0xd0, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63,
1240x72, 0x69, 0x62, 0x65, 0x64, 0x00, 0x69, 0x7d, 0x04, 0x11, 1240x72, 0x69, 0x62, 0x65, 0x64, 0x00, 0x69, 0x7d, 0x04, 0x11,
1250x63, 0x42, 0x03, 0x30, 0x32, 0x2e, 0x31, 0xab, 0x05, 0x02, 1250x63, 0x42, 0x03, 0x31, 0x32, 0x2e, 0x31, 0xab, 0x05, 0x01,
1260x19, 0x01, 0xb1, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 1260x19, 0x01, 0xb1, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62,
1270x6c, 0x65, 0x2e, 0x29, 0x4b, 0x03, 0x15, 0x32, 0x4b, 0x03, 1270x6c, 0x65, 0x2e, 0x29, 0x4b, 0x03, 0x15, 0x32, 0x4b, 0x03,
1280xa8, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 1280xa8, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72,
@@ -131,75 +131,75 @@ const char help_text[] = {
1310x53, 0x66, 0x69, 0x67, 0x75, 0x72, 0x9e, 0x03, 0x12, 0x70, 1310x53, 0x66, 0x69, 0x67, 0x75, 0x72, 0x9e, 0x03, 0x12, 0x70,
1320x79, 0x00, 0x31, 0x76, 0x69, 0x61, 0x89, 0x00, 0x83, 0x60, 1320x79, 0x00, 0x31, 0x76, 0x69, 0x61, 0x89, 0x00, 0x83, 0x60,
1330x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x27, 0x19, 0x00, 0x32, 1330x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x27, 0x19, 0x00, 0x32,
1340x00, 0x6f, 0x6e, 0x17, 0x00, 0xf4, 0x00, 0x54, 0x79, 0x70, 1340x00, 0x6f, 0x6e, 0x17, 0x00, 0xf5, 0x00, 0x54, 0x79, 0x70,
1350x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0x3a, 0x00, 0x00, 1350x65, 0x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0x3a, 0x00, 0x00,
1360x00, 0x2d, 0xad, 0x01, 0x05, 0x4e, 0x00, 0x02, 0x0a, 0x01, 1360x00, 0x2d, 0xad, 0x01, 0x04, 0x4e, 0x00, 0x02, 0x0a, 0x01,
1370x51, 0x77, 0x69, 0x64, 0x74, 0x68, 0x1b, 0x06, 0x20, 0x68, 1370x51, 0x77, 0x69, 0x64, 0x74, 0x68, 0x1b, 0x06, 0x21, 0x68,
1380x65, 0xf3, 0x01, 0x03, 0x74, 0x02, 0x02, 0xfc, 0x03, 0x02, 1380x65, 0xf3, 0x01, 0x03, 0x74, 0x02, 0x03, 0x75, 0x04, 0x00,
1390xb3, 0x01, 0x1f, 0x2e, 0x3f, 0x00, 0x03, 0x05, 0xa6, 0x01, 1390xb3, 0x01, 0x1f, 0x2e, 0x3f, 0x00, 0x08, 0x04, 0xe5, 0x02,
1400x07, 0x84, 0x06, 0x10, 0x62, 0x38, 0x01, 0x01, 0x3d, 0x04, 1400x03, 0x49, 0x01, 0x11, 0x62, 0x96, 0x04, 0x01, 0x3d, 0x04,
1410x04, 0x34, 0x02, 0x06, 0x19, 0x03, 0x0a, 0x47, 0x00, 0x52, 1410x04, 0x34, 0x02, 0x05, 0x19, 0x03, 0x0a, 0x47, 0x00, 0x52,
1420x61, 0x73, 0x6b, 0x00, 0x66, 0x42, 0x03, 0x25, 0x72, 0x79, 1420x61, 0x73, 0x6b, 0x00, 0x66, 0x42, 0x03, 0x25, 0x72, 0x79,
1430xfb, 0x01, 0x16, 0x6e, 0x28, 0x02, 0x20, 0x74, 0x6f, 0x71, 1430xfb, 0x01, 0x16, 0x6e, 0x28, 0x02, 0x20, 0x74, 0x6f, 0x71,
1440x03, 0x30, 0x64, 0x69, 0x73, 0x70, 0x03, 0x40, 0x75, 0x69, 1440x03, 0x30, 0x64, 0x69, 0x73, 0x70, 0x03, 0x40, 0x75, 0x69,
1450x73, 0x68, 0x42, 0x01, 0x54, 0x00, 0x28, 0x74, 0x68, 0x65, 1450x73, 0x68, 0x42, 0x01, 0x20, 0x00, 0x28, 0x20, 0x00, 0x03,
1460x08, 0x02, 0x11, 0x29, 0x09, 0x02, 0x1b, 0x79, 0x51, 0x00, 1460x08, 0x02, 0x11, 0x29, 0x09, 0x02, 0x1b, 0x79, 0x51, 0x00,
1470x12, 0x61, 0x56, 0x03, 0x56, 0x69, 0x66, 0x69, 0x65, 0x64, 1470x12, 0x61, 0x56, 0x03, 0x57, 0x69, 0x66, 0x69, 0x65, 0x64,
1480x9c, 0x05, 0x02, 0x27, 0x04, 0x03, 0x56, 0x05, 0x05, 0x7d, 1480x9c, 0x05, 0x02, 0x27, 0x04, 0x02, 0x56, 0x05, 0x05, 0x7d,
1490x04, 0x10, 0x73, 0xbb, 0x00, 0x30, 0x69, 0x64, 0x65, 0xff, 1490x04, 0x10, 0x73, 0xbb, 0x00, 0x30, 0x69, 0x64, 0x65, 0xff,
1500x01, 0x24, 0x61, 0x6c, 0x02, 0x07, 0x04, 0x80, 0x04, 0x0e, 1500x01, 0x24, 0x61, 0x6c, 0x02, 0x07, 0x05, 0x80, 0x04, 0x0e,
1510x49, 0x00, 0x09, 0x3f, 0x07, 0x48, 0x6a, 0x75, 0x73, 0x74, 1510x49, 0x00, 0x08, 0x3f, 0x07, 0x48, 0x6a, 0x75, 0x73, 0x74,
1520x44, 0x07, 0x13, 0x61, 0x19, 0x02, 0x12, 0x31, 0x43, 0x07, 1520x44, 0x07, 0x13, 0x61, 0x19, 0x02, 0x13, 0x31, 0x43, 0x07,
1530x00, 0x0c, 0x00, 0x03, 0x33, 0x06, 0x45, 0x72, 0x6f, 0x77, 1530x00, 0x0c, 0x00, 0x02, 0x33, 0x06, 0x45, 0x72, 0x6f, 0x77,
1540x2c, 0x1f, 0x00, 0x16, 0x32, 0x1f, 0x00, 0x00, 0x2f, 0x02, 1540x2c, 0x1f, 0x00, 0x17, 0x32, 0x1f, 0x00, 0x63, 0x73, 0x65,
1550x30, 0x6f, 0x6e, 0x64, 0x20, 0x00, 0x02, 0x9e, 0x07, 0x5f, 1550x63, 0x6f, 0x6e, 0x64, 0x20, 0x00, 0x8f, 0x6e, 0x64, 0x00,
1560x73, 0x6f, 0x00, 0x6f, 0x6e, 0x6f, 0x01, 0x04, 0x00, 0xb9, 1560x73, 0x6f, 0x00, 0x6f, 0x6e, 0x6f, 0x01, 0x05, 0x30, 0x77,
1570x04, 0x00, 0xbf, 0x00, 0x01, 0x39, 0x00, 0x17, 0x6f, 0x2a, 1570x68, 0x65, 0xbf, 0x00, 0x01, 0x39, 0x00, 0x17, 0x6f, 0x2a,
1580x07, 0x24, 0x6f, 0x66, 0xc9, 0x04, 0x32, 0x61, 0x74, 0x74, 1580x07, 0x24, 0x6f, 0x66, 0xc9, 0x04, 0x32, 0x61, 0x74, 0x74,
1590xbf, 0x00, 0x10, 0x66, 0xa9, 0x00, 0x06, 0x12, 0x01, 0x14, 1590xbf, 0x00, 0x12, 0x66, 0x2c, 0x08, 0x04, 0x12, 0x01, 0x14,
1600x6e, 0x30, 0x00, 0x24, 0x62, 0x6c, 0xd9, 0x01, 0x02, 0x28, 1600x6e, 0x30, 0x00, 0x24, 0x62, 0x6c, 0xd9, 0x01, 0x03, 0x28,
1610x08, 0x01, 0x39, 0x00, 0x01, 0x1d, 0x03, 0x01, 0x37, 0x05, 1610x08, 0x01, 0x66, 0x04, 0x01, 0x1d, 0x03, 0x01, 0x37, 0x05,
1620x00, 0xa9, 0x01, 0xd0, 0x72, 0x69, 0x61, 0x6e, 0x67, 0x6c, 1620xf0, 0x01, 0x61, 0x00, 0x74, 0x72, 0x69, 0x61, 0x6e, 0x67,
1630x65, 0x00, 0x64, 0x72, 0x61, 0x77, 0x6e, 0x39, 0x01, 0x43, 1630x6c, 0x65, 0x00, 0x64, 0x72, 0x61, 0x77, 0x6e, 0x39, 0x01,
1640x69, 0x74, 0x2e, 0x00, 0xf4, 0x02, 0x03, 0x1e, 0x00, 0x01, 1640x44, 0x69, 0x74, 0x2e, 0x00, 0xf4, 0x02, 0x04, 0x1e, 0x00,
1650x6c, 0x00, 0x20, 0x75, 0x73, 0x11, 0x05, 0x01, 0x54, 0x05, 1650x51, 0x73, 0x00, 0x6d, 0x75, 0x73, 0x11, 0x05, 0x01, 0x54,
1660x01, 0x11, 0x05, 0x60, 0x75, 0x70, 0x77, 0x61, 0x72, 0x64, 1660x05, 0x00, 0x7e, 0x03, 0x71, 0x75, 0x70, 0x77, 0x61, 0x72,
1670x07, 0x08, 0x00, 0xd7, 0x07, 0x56, 0x70, 0x6c, 0x65, 0x74, 1670x64, 0x73, 0x7a, 0x05, 0x77, 0x6f, 0x6d, 0x70, 0x6c, 0x65,
1680x65, 0x48, 0x02, 0x0f, 0xfc, 0x01, 0x03, 0x00, 0x75, 0x07, 1680x74, 0x65, 0x48, 0x02, 0x0e, 0xfc, 0x01, 0x02, 0xab, 0x01,
1690x40, 0x69, 0x6d, 0x69, 0x74, 0x98, 0x07, 0x51, 0x68, 0x75, 1690x50, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x98, 0x07, 0x51, 0x68,
1700x66, 0x66, 0x6c, 0x6f, 0x08, 0x22, 0x70, 0x65, 0xe8, 0x02, 1700x75, 0x66, 0x66, 0x6c, 0x6f, 0x08, 0x23, 0x70, 0x65, 0xe8,
1710x03, 0x01, 0x02, 0x92, 0x70, 0x65, 0x72, 0x66, 0x6f, 0x72, 1710x02, 0x02, 0x01, 0x02, 0x94, 0x70, 0x65, 0x72, 0x66, 0x6f,
1720x6d, 0x65, 0x64, 0xd8, 0x02, 0x04, 0x92, 0x02, 0x16, 0x42, 1720x72, 0x6d, 0x65, 0x64, 0xd8, 0x02, 0x02, 0x92, 0x02, 0x17,
1730x0e, 0x04, 0x02, 0x38, 0x03, 0x03, 0xc8, 0x00, 0x03, 0x4a, 1730x42, 0x0e, 0x04, 0x04, 0x38, 0x03, 0x01, 0xc8, 0x00, 0x02,
1740x00, 0x16, 0x65, 0x48, 0x02, 0x00, 0x9a, 0x04, 0x11, 0x75, 1740x4a, 0x00, 0x16, 0x65, 0x48, 0x02, 0x00, 0x9a, 0x04, 0x11,
1750xfb, 0x01, 0x00, 0x8a, 0x02, 0x38, 0x6e, 0x79, 0x00, 0x88, 1750x75, 0xfb, 0x01, 0x00, 0x8a, 0x02, 0x38, 0x6e, 0x79, 0x00,
1760x09, 0x14, 0x69, 0x91, 0x08, 0x20, 0x61, 0x73, 0x77, 0x03, 1760x88, 0x09, 0x14, 0x69, 0x91, 0x08, 0x20, 0x61, 0x73, 0x77,
1770x11, 0x62, 0x22, 0x01, 0x21, 0x61, 0x73, 0x28, 0x00, 0x10, 1770x03, 0x11, 0x62, 0x22, 0x01, 0x21, 0x61, 0x73, 0x28, 0x00,
1780x6f, 0x6e, 0x01, 0x15, 0x2e, 0xb5, 0x00, 0x81, 0x6f, 0x76, 1780x10, 0x6f, 0x6e, 0x01, 0x15, 0x2e, 0xb5, 0x00, 0x82, 0x6f,
1790x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x3c, 0x07, 0x00, 0x8e, 1790x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x3c, 0x07, 0x81,
1800x04, 0x51, 0x72, 0x65, 0x71, 0x75, 0x65, 0x9e, 0x02, 0x00, 1800x62, 0x79, 0x00, 0x72, 0x65, 0x71, 0x75, 0x65, 0x9e, 0x02,
1810xa4, 0x07, 0x54, 0x72, 0x65, 0x63, 0x69, 0x73, 0x45, 0x09, 1810x00, 0xa4, 0x07, 0x54, 0x72, 0x65, 0x63, 0x69, 0x73, 0x45,
1820x36, 0x00, 0x6f, 0x66, 0xd3, 0x00, 0x01, 0x19, 0x05, 0x1c, 1820x09, 0x01, 0x12, 0x03, 0x05, 0xd3, 0x00, 0x00, 0x19, 0x05,
1830x73, 0xcf, 0x00, 0x70, 0x2e, 0x00, 0x54, 0x79, 0x70, 0x69, 1830x1c, 0x73, 0xcf, 0x00, 0x71, 0x2e, 0x00, 0x54, 0x79, 0x70,
1840x63, 0xfd, 0x09, 0x0a, 0x95, 0x09, 0x21, 0x68, 0x65, 0xfb, 1840x69, 0x63, 0xfd, 0x09, 0x09, 0x95, 0x09, 0x21, 0x68, 0x65,
1850x00, 0x10, 0x64, 0x17, 0x04, 0x31, 0x6d, 0x69, 0x6e, 0xca, 1850xfb, 0x00, 0x10, 0x64, 0x17, 0x04, 0x33, 0x6d, 0x69, 0x6e,
1860x00, 0x04, 0x5f, 0x00, 0x00, 0xc0, 0x08, 0x0e, 0x5c, 0x00, 1860x46, 0x01, 0x03, 0x5f, 0x00, 0x3e, 0x73, 0x65, 0x74, 0x5c,
1870x00, 0xaf, 0x00, 0x00, 0x7e, 0x04, 0x31, 0x76, 0x65, 0x72, 1870x00, 0x00, 0xaf, 0x00, 0x00, 0x7e, 0x04, 0x31, 0x76, 0x65,
1880x5a, 0x09, 0xd1, 0x6d, 0x00, 0x65, 0x78, 0x61, 0x63, 0x74, 1880x72, 0x5a, 0x09, 0xa0, 0x6d, 0x00, 0x65, 0x78, 0x61, 0x63,
1890x6c, 0x79, 0x2c, 0x00, 0x73, 0x6f, 0xf8, 0x00, 0x02, 0x0f, 1890x74, 0x6c, 0x79, 0x2c, 0xfd, 0x00, 0x01, 0xf8, 0x00, 0x01,
1900x02, 0xd1, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x00, 0x28, 0x73, 1900x0f, 0x02, 0xd1, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x00, 0x28,
1910x61, 0x79, 0x29, 0x00, 0x61, 0x02, 0x07, 0x10, 0x2d, 0x3f, 1910x73, 0x61, 0x79, 0x29, 0x00, 0x61, 0x02, 0x07, 0x11, 0x2d,
1920x00, 0x04, 0x33, 0x01, 0x01, 0x9a, 0x05, 0x0a, 0x19, 0x00, 1920xb4, 0x05, 0x04, 0x33, 0x01, 0x01, 0x9a, 0x05, 0x09, 0x19,
1930x50, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x92, 0x02, 0x21, 0x4e, 1930x00, 0x50, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x92, 0x02, 0x21,
1940x6f, 0xcf, 0x01, 0x11, 0x61, 0x60, 0x00, 0x01, 0xf1, 0x06, 1940x4e, 0x6f, 0xcf, 0x01, 0x11, 0x61, 0x60, 0x00, 0x02, 0xf1,
1950x02, 0x7a, 0x00, 0x08, 0x68, 0x02, 0x16, 0x2c, 0x1c, 0x00, 1950x06, 0x02, 0x7a, 0x00, 0x07, 0x68, 0x02, 0x16, 0x2c, 0x1c,
1960x80, 0x6c, 0x69, 0x6b, 0x65, 0x6c, 0x79, 0x00, 0x69, 0x61, 1960x00, 0x81, 0x6c, 0x69, 0x6b, 0x65, 0x6c, 0x79, 0x00, 0x69,
1970x01, 0x01, 0x37, 0x00, 0x05, 0x4b, 0x00, 0x71, 0x73, 0x00, 1970x61, 0x01, 0x01, 0x37, 0x00, 0x04, 0x4b, 0x00, 0x71, 0x73,
1980x73, 0x68, 0x6f, 0x72, 0x74, 0xc7, 0x02, 0x22, 0x61, 0x6e, 1980x00, 0x73, 0x68, 0x6f, 0x72, 0x74, 0xc7, 0x02, 0x22, 0x61,
1990x55, 0x02, 0x00, 0xca, 0x05, 0x82, 0x74, 0x00, 0x6c, 0x65, 1990x6e, 0x55, 0x02, 0x00, 0xca, 0x05, 0x82, 0x74, 0x00, 0x6c,
2000x6e, 0x67, 0x74, 0x68, 0xc5, 0x01, 0x01, 0xc5, 0x05, 0x01, 2000x65, 0x6e, 0x67, 0x74, 0x68, 0xc5, 0x01, 0x01, 0xc5, 0x05,
2010x28, 0x0a, 0x12, 0x6f, 0x65, 0x02, 0x80, 0x73, 0x73, 0x69, 2010x01, 0x28, 0x0a, 0x12, 0x6f, 0x65, 0x02, 0x80, 0x73, 0x73,
2020x62, 0x6c, 0x65, 0x2e, 0x00, 2020x69, 0x62, 0x6c, 0x65, 0x2e, 0x00,
203}; 203};
204 204
205const unsigned short help_text_len = 2926; 205const unsigned short help_text_len = 2926;
diff --git a/apps/plugins/puzzles/help/undead.c b/apps/plugins/puzzles/help/undead.c
index 48c26380ea..3af048a3b8 100644
--- a/apps/plugins/puzzles/help/undead.c
+++ b/apps/plugins/puzzles/help/undead.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -15,7 +15,7 @@ struct style_text help_text_style[] = {
15 LAST_STYLE_ITEM 15 LAST_STYLE_ITEM
16}; 16};
17 17
18/* orig 3286 comp 2110 ratio 0.642118 level 11 saved 1176 */ 18/* orig 3286 comp 2109 ratio 0.641814 level 10 saved 1177 */
19const char help_text[] = { 19const char help_text[] = {
200xf0, 0x2c, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 200xf0, 0x2c, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
210x33, 0x37, 0x3a, 0x20, 0x55, 0x6e, 0x64, 0x65, 0x61, 0x64, 210x33, 0x37, 0x3a, 0x20, 0x55, 0x6e, 0x64, 0x65, 0x61, 0x64,
@@ -47,7 +47,7 @@ const char help_text[] = {
470x10, 0x47, 0x6d, 0x00, 0x11, 0x73, 0x30, 0x00, 0xf0, 0x08, 470x10, 0x47, 0x6d, 0x00, 0x11, 0x73, 0x30, 0x00, 0xf0, 0x08,
480x74, 0x68, 0x65, 0x00, 0x6f, 0x70, 0x70, 0x6f, 0x73, 0x69, 480x74, 0x68, 0x65, 0x00, 0x6f, 0x70, 0x70, 0x6f, 0x73, 0x69,
490x74, 0x65, 0x00, 0x77, 0x61, 0x79, 0x00, 0x72, 0x6f, 0x75, 490x74, 0x65, 0x00, 0x77, 0x61, 0x79, 0x00, 0x72, 0x6f, 0x75,
500x6e, 0x64, 0x3a, 0x18, 0x00, 0x18, 0x79, 0x6b, 0x00, 0x07, 500x6e, 0x64, 0x3a, 0x18, 0x00, 0x19, 0x79, 0x6b, 0x00, 0x06,
510x40, 0x00, 0x0f, 0x6d, 0x00, 0x06, 0x95, 0x6c, 0x6f, 0x6f, 510x40, 0x00, 0x0f, 0x6d, 0x00, 0x06, 0x95, 0x6c, 0x6f, 0x6f,
520x6b, 0x65, 0x64, 0x00, 0x61, 0x74, 0x98, 0x00, 0x31, 0x2e, 520x6b, 0x65, 0x64, 0x00, 0x61, 0x74, 0x98, 0x00, 0x31, 0x2e,
530x00, 0x5a, 0xc1, 0x00, 0x02, 0x6c, 0x00, 0x04, 0x2d, 0x00, 530x00, 0x5a, 0xc1, 0x00, 0x02, 0x6c, 0x00, 0x04, 0x2d, 0x00,
@@ -55,179 +55,179 @@ const char help_text[] = {
550x61, 0x6e, 0x73, 0x2e, 0xa4, 0x01, 0x91, 0x61, 0x6c, 0x73, 550x61, 0x6e, 0x73, 0x2e, 0xa4, 0x01, 0x91, 0x61, 0x6c, 0x73,
560x6f, 0x00, 0x74, 0x6f, 0x6c, 0x64, 0x96, 0x00, 0xc0, 0x74, 560x6f, 0x00, 0x74, 0x6f, 0x6c, 0x64, 0x96, 0x00, 0xc0, 0x74,
570x6f, 0x74, 0x61, 0x6c, 0x00, 0x6e, 0x75, 0x6d, 0x62, 0x65, 570x6f, 0x74, 0x61, 0x6c, 0x00, 0x6e, 0x75, 0x6d, 0x62, 0x65,
580x72, 0x34, 0x01, 0x40, 0x65, 0x61, 0x63, 0x68, 0x42, 0x01, 580x72, 0x34, 0x01, 0x41, 0x65, 0x61, 0x63, 0x68, 0x42, 0x01,
590x00, 0x50, 0x01, 0x04, 0x3a, 0x01, 0x30, 0x00, 0x69, 0x6e, 590x00, 0x0d, 0x00, 0x03, 0x3a, 0x01, 0x00, 0x96, 0x00, 0x00,
600x2c, 0x00, 0x01, 0xd6, 0x01, 0x30, 0x2e, 0x00, 0x41, 0x40, 600x2c, 0x00, 0x00, 0xd6, 0x01, 0x30, 0x2e, 0x00, 0x41, 0x40,
610x00, 0x10, 0x61, 0xc1, 0x00, 0x02, 0x42, 0x00, 0x33, 0x65, 610x00, 0x11, 0x61, 0xc1, 0x00, 0x01, 0x16, 0x00, 0x33, 0x65,
620x64, 0x67, 0x7d, 0x01, 0x12, 0x65, 0xf8, 0x01, 0x01, 0xbb, 620x64, 0x67, 0x7d, 0x01, 0x12, 0x65, 0xf8, 0x01, 0x01, 0xbb,
630x01, 0x63, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x59, 0x00, 630x01, 0x63, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x59, 0x00,
640x24, 0x73, 0x2c, 0xcc, 0x01, 0xd0, 0x6e, 0x64, 0x69, 0x63, 640x24, 0x73, 0x2c, 0xcc, 0x01, 0xd1, 0x6e, 0x64, 0x69, 0x63,
650x61, 0x74, 0x65, 0x00, 0x68, 0x6f, 0x77, 0x00, 0x6d, 0x9f, 650x61, 0x74, 0x65, 0x00, 0x68, 0x6f, 0x77, 0x00, 0x6d, 0x9f,
660x00, 0x03, 0x63, 0x00, 0x1a, 0x73, 0x06, 0x01, 0x51, 0x66, 660x00, 0x02, 0x63, 0x00, 0x1a, 0x73, 0x06, 0x01, 0x51, 0x66,
670x00, 0x79, 0x6f, 0x75, 0xea, 0x00, 0x57, 0x00, 0x69, 0x6e, 670x00, 0x79, 0x6f, 0x75, 0xea, 0x00, 0x57, 0x00, 0x69, 0x6e,
680x74, 0x6f, 0x5c, 0x00, 0xa0, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 680x74, 0x6f, 0x5c, 0x00, 0xa0, 0x6c, 0x6f, 0x6e, 0x67, 0x00,
690x61, 0x00, 0x72, 0x6f, 0x77, 0xbb, 0x01, 0xf1, 0x0b, 0x63, 690x61, 0x00, 0x72, 0x6f, 0x77, 0xbb, 0x01, 0xf1, 0x0b, 0x63,
700x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x00, 0x73, 0x74, 0x61, 0x72, 700x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x00, 0x73, 0x74, 0x61, 0x72,
710x74, 0x69, 0x6e, 0x67, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x00, 710x74, 0x69, 0x6e, 0x67, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x00,
720x74, 0x68, 0x61, 0x74, 0x00, 0x6c, 0x01, 0x9c, 0x69, 0x6f, 720x74, 0x68, 0x61, 0x74, 0x00, 0x6c, 0x01, 0x9d, 0x69, 0x6f,
730x6e, 0x2e, 0x00, 0x28, 0x54, 0x68, 0x65, 0x6a, 0x02, 0x01, 730x6e, 0x2e, 0x00, 0x28, 0x54, 0x68, 0x65, 0x6a, 0x02, 0x01,
740x2a, 0x01, 0x04, 0xb7, 0x01, 0xf1, 0x05, 0x69, 0x76, 0x65, 740xa5, 0x00, 0x03, 0xb7, 0x01, 0xf1, 0x05, 0x69, 0x76, 0x65,
750x00, 0x6f, 0x6e, 0x00, 0x62, 0x6f, 0x74, 0x68, 0x00, 0x73, 750x00, 0x6f, 0x6e, 0x00, 0x62, 0x6f, 0x74, 0x68, 0x00, 0x73,
760x69, 0x64, 0x65, 0x73, 0x2e, 0x00, 0x49, 0x81, 0x00, 0x17, 760x69, 0x64, 0x65, 0x73, 0x2e, 0x00, 0x49, 0x81, 0x00, 0x17,
770x72, 0xd9, 0x01, 0x22, 0x6c, 0x69, 0x63, 0x02, 0xd1, 0x73, 770x72, 0xd9, 0x01, 0x22, 0x6c, 0x69, 0x63, 0x02, 0xd1, 0x73,
780x69, 0x67, 0x68, 0x74, 0x00, 0x63, 0x72, 0x6f, 0x73, 0x73, 780x69, 0x67, 0x68, 0x74, 0x00, 0x63, 0x72, 0x6f, 0x73, 0x73,
790x65, 0x73, 0x98, 0x00, 0x45, 0x73, 0x61, 0x6d, 0x65, 0x2a, 790x65, 0x73, 0x98, 0x00, 0x45, 0x73, 0x61, 0x6d, 0x65, 0x2a,
800x01, 0x21, 0x6d, 0x6f, 0xee, 0x01, 0x80, 0x61, 0x6e, 0x00, 800x01, 0x21, 0x6d, 0x6f, 0xee, 0x01, 0x81, 0x61, 0x6e, 0x00,
810x6f, 0x6e, 0x63, 0x65, 0x2c, 0x21, 0x00, 0x04, 0x5d, 0x01, 810x6f, 0x6e, 0x63, 0x65, 0x2c, 0x21, 0x00, 0x03, 0x5d, 0x01,
820xd3, 0x77, 0x69, 0x6c, 0x6c, 0x00, 0x63, 0x6f, 0x75, 0x6e, 820xd3, 0x77, 0x69, 0x6c, 0x6c, 0x00, 0x63, 0x6f, 0x75, 0x6e,
830x74, 0x00, 0x69, 0x74, 0x68, 0x01, 0x30, 0x69, 0x6d, 0x65, 830x74, 0x00, 0x69, 0x74, 0x68, 0x01, 0x30, 0x69, 0x6d, 0x65,
840x0d, 0x00, 0x24, 0x69, 0x73, 0xb6, 0x01, 0x11, 0x2c, 0xec, 840x0d, 0x00, 0x24, 0x69, 0x73, 0xb6, 0x01, 0x11, 0x2c, 0xec,
850x02, 0x41, 0x6a, 0x75, 0x73, 0x74, 0x41, 0x00, 0xf1, 0x00, 850x02, 0x10, 0x6a, 0xe3, 0x02, 0x00, 0x41, 0x00, 0xf2, 0x01,
860x2e, 0x29, 0x00, 0x00, 0x00, 0x54, 0x68, 0x69, 0x73, 0x00, 860x2e, 0x29, 0x00, 0x00, 0x00, 0x54, 0x68, 0x69, 0x73, 0x00,
870x70, 0x75, 0x7a, 0x7a, 0x6c, 0xdc, 0x02, 0x00, 0x41, 0x02, 870x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x9a, 0x01, 0x30, 0x77,
880x10, 0x73, 0x15, 0x02, 0x50, 0x65, 0x6e, 0x74, 0x65, 0x64, 880x61, 0x73, 0x15, 0x02, 0x20, 0x65, 0x6e, 0x99, 0x00, 0xf1,
890xe7, 0x01, 0xd1, 0x44, 0x61, 0x76, 0x69, 0x64, 0x00, 0x4d, 890x01, 0x62, 0x79, 0x00, 0x44, 0x61, 0x76, 0x69, 0x64, 0x00,
900x69, 0x6c, 0x6c, 0x61, 0x72, 0x2c, 0xf6, 0x02, 0x12, 0x72, 900x4d, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x2c, 0xf6, 0x02, 0x12,
910x79, 0x00, 0x00, 0x9a, 0x00, 0x41, 0x60, 0x48, 0x61, 0x75, 910x72, 0x79, 0x00, 0x00, 0x9a, 0x00, 0x41, 0x60, 0x48, 0x61,
920x29, 0x00, 0x12, 0x4d, 0x3f, 0x03, 0xf3, 0x03, 0x4d, 0x61, 920x75, 0x29, 0x00, 0x12, 0x4d, 0x3f, 0x03, 0xf3, 0x03, 0x4d,
930x7a, 0x65, 0x27, 0x2e, 0x00, 0x53, 0x65, 0x65, 0x00, 0x5b, 930x61, 0x7a, 0x65, 0x27, 0x2e, 0x00, 0x53, 0x65, 0x65, 0x00,
940x32, 0x30, 0x5d, 0x00, 0x66, 0x6f, 0xb6, 0x00, 0x61, 0x64, 940x5b, 0x32, 0x30, 0x5d, 0x00, 0x66, 0x6f, 0xb6, 0x00, 0x61,
950x65, 0x74, 0x61, 0x69, 0x6c, 0x2b, 0x02, 0x02, 0xd9, 0x03, 950x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x2b, 0x02, 0x02, 0xd9,
960x00, 0x68, 0x00, 0x01, 0xab, 0x03, 0x40, 0x72, 0x69, 0x62, 960x03, 0x01, 0x68, 0x00, 0x00, 0xab, 0x03, 0x40, 0x72, 0x69,
970x75, 0x42, 0x00, 0x01, 0x89, 0x01, 0x20, 0x69, 0x73, 0x76, 970x62, 0x75, 0x42, 0x00, 0x01, 0x89, 0x01, 0x20, 0x69, 0x73,
980x01, 0x01, 0x38, 0x01, 0x20, 0x6f, 0x6e, 0x7e, 0x00, 0xd0, 980x76, 0x01, 0x01, 0x38, 0x01, 0x20, 0x6f, 0x6e, 0x7e, 0x00,
990x53, 0x74, 0x65, 0x66, 0x66, 0x65, 0x6e, 0x00, 0x42, 0x61, 990xd0, 0x53, 0x74, 0x65, 0x66, 0x66, 0x65, 0x6e, 0x00, 0x42,
1000x75, 0x65, 0x72, 0x3e, 0x00, 0x01, 0x57, 0x00, 0xf4, 0x29, 1000x61, 0x75, 0x65, 0x72, 0x3e, 0x00, 0x01, 0x57, 0x00, 0xf4,
1010x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 1010x29, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77,
1020x2e, 0x6a, 0x61, 0x6e, 0x6b, 0x6f, 0x2e, 0x61, 0x74, 0x2f, 1020x77, 0x2e, 0x6a, 0x61, 0x6e, 0x6b, 0x6f, 0x2e, 0x61, 0x74,
1030x52, 0x61, 0x65, 0x74, 0x73, 0x65, 0x6c, 0x2f, 0x53, 0x70, 1030x2f, 0x52, 0x61, 0x65, 0x74, 0x73, 0x65, 0x6c, 0x2f, 0x53,
1040x75, 0x6b, 0x73, 0x63, 0x68, 0x6c, 0x6f, 0x73, 0x73, 0x2f, 1040x70, 0x75, 0x6b, 0x73, 0x63, 0x68, 0x6c, 0x6f, 0x73, 0x73,
1050x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x00, 1050x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d,
1060x00, 0x00, 0x33, 0x37, 0x2e, 0x31, 0x55, 0x04, 0x01, 0x78, 1060x00, 0x00, 0x00, 0x33, 0x37, 0x2e, 0x31, 0x55, 0x04, 0x01,
1070x00, 0x46, 0x6f, 0x6c, 0x73, 0x20, 0x8f, 0x00, 0xe3, 0x68, 1070x78, 0x00, 0x46, 0x6f, 0x6c, 0x73, 0x20, 0x8f, 0x00, 0xe3,
1080x61, 0x73, 0x00, 0x61, 0x00, 0x73, 0x69, 0x6d, 0x69, 0x6c, 1080x68, 0x61, 0x73, 0x00, 0x61, 0x00, 0x73, 0x69, 0x6d, 0x69,
1090x61, 0x72, 0x00, 0x21, 0x00, 0x70, 0x00, 0x73, 0x79, 0x73, 1090x6c, 0x61, 0x72, 0x00, 0x21, 0x00, 0x70, 0x00, 0x73, 0x79,
1100x74, 0x65, 0x6d, 0x9c, 0x00, 0xf0, 0x08, 0x53, 0x6f, 0x6c, 1100x73, 0x74, 0x65, 0x6d, 0x9c, 0x00, 0xf0, 0x08, 0x53, 0x6f,
1110x6f, 0x2c, 0x00, 0x55, 0x6e, 0x65, 0x71, 0x75, 0x61, 0x6c, 1110x6c, 0x6f, 0x2c, 0x00, 0x55, 0x6e, 0x65, 0x71, 0x75, 0x61,
1120x00, 0x61, 0x6e, 0x64, 0x00, 0x4b, 0x65, 0x65, 0x6e, 0x2e, 1120x6c, 0x00, 0x61, 0x6e, 0x64, 0x00, 0x4b, 0x65, 0x65, 0x6e,
1130x42, 0x01, 0x63, 0x6f, 0x00, 0x70, 0x6c, 0x61, 0x79, 0x49, 1130x2e, 0x42, 0x01, 0x63, 0x6f, 0x00, 0x70, 0x6c, 0x61, 0x79,
1140x00, 0x71, 0x2c, 0x00, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x23, 1140x49, 0x00, 0x71, 0x2c, 0x00, 0x63, 0x6c, 0x69, 0x63, 0x6b,
1150x01, 0x40, 0x6d, 0x6f, 0x75, 0x73, 0x62, 0x03, 0x01, 0x2b, 1150x23, 0x01, 0x40, 0x6d, 0x6f, 0x75, 0x73, 0x62, 0x03, 0x01,
1160x03, 0x45, 0x65, 0x6d, 0x70, 0x74, 0x7d, 0x04, 0x12, 0x61, 1160x2b, 0x03, 0x45, 0x65, 0x6d, 0x70, 0x74, 0x7d, 0x04, 0x12,
1170xdf, 0x02, 0x12, 0x6e, 0x73, 0x01, 0x60, 0x61, 0x00, 0x6c, 1170x61, 0xdf, 0x02, 0x12, 0x6e, 0x73, 0x01, 0x60, 0x61, 0x00,
1180x65, 0x74, 0x74, 0x23, 0x03, 0x02, 0x0b, 0x03, 0x83, 0x6b, 1180x6c, 0x65, 0x74, 0x74, 0x23, 0x03, 0x02, 0x0b, 0x03, 0x84,
1190x65, 0x79, 0x62, 0x6f, 0x61, 0x72, 0x64, 0xd2, 0x02, 0x00, 1190x6b, 0x65, 0x79, 0x62, 0x6f, 0x61, 0x72, 0x64, 0xd2, 0x02,
1200x7d, 0x02, 0x00, 0x18, 0x00, 0x0c, 0x3a, 0x03, 0x50, 0x3a, 1200x00, 0x7d, 0x02, 0x01, 0x4f, 0x03, 0x0a, 0x3a, 0x03, 0x51,
1210x00, 0x60, 0x47, 0x27, 0x63, 0x01, 0x06, 0x7c, 0x04, 0x21, 1210x3a, 0x00, 0x60, 0x47, 0x27, 0x63, 0x01, 0x05, 0x7c, 0x04,
1220x60, 0x56, 0x11, 0x00, 0x0b, 0x84, 0x04, 0x59, 0x60, 0x5a, 1220x24, 0x60, 0x56, 0x11, 0x00, 0x08, 0x84, 0x04, 0x24, 0x60,
1230x27, 0x00, 0x66, 0x8c, 0x04, 0x12, 0x49, 0x04, 0x03, 0x41, 1230x5a, 0x16, 0x00, 0x04, 0x8c, 0x04, 0x12, 0x49, 0x04, 0x03,
1240x6d, 0x61, 0x6b, 0x65, 0xfc, 0x04, 0x5d, 0x73, 0x74, 0x61, 1240x41, 0x6d, 0x61, 0x6b, 0x65, 0xfc, 0x04, 0x5e, 0x73, 0x74,
1250x6b, 0x65, 0xbb, 0x00, 0x04, 0x9b, 0x03, 0x50, 0x69, 0x6e, 1250x61, 0x6b, 0x65, 0xbb, 0x00, 0x03, 0x9b, 0x03, 0x50, 0x69,
1260x63, 0x6f, 0x72, 0x0e, 0x04, 0x08, 0xbf, 0x00, 0xb0, 0x70, 1260x6e, 0x63, 0x6f, 0x72, 0x0e, 0x04, 0x08, 0xbf, 0x00, 0xb0,
1270x72, 0x65, 0x73, 0x73, 0x00, 0x53, 0x70, 0x61, 0x63, 0x65, 1270x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x53, 0x70, 0x61, 0x63,
1280x20, 0x01, 0x50, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x6f, 0x02, 1280x65, 0x20, 0x01, 0x50, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x6f,
1290x20, 0x61, 0x67, 0x7d, 0x05, 0x61, 0x28, 0x6f, 0x72, 0x00, 1290x02, 0x20, 0x61, 0x67, 0x7d, 0x05, 0x62, 0x28, 0x6f, 0x72,
1300x75, 0x73, 0x9c, 0x04, 0x00, 0x19, 0x01, 0xd4, 0x6f, 0x00, 1300x00, 0x75, 0x73, 0x9c, 0x04, 0xd0, 0x55, 0x6e, 0x64, 0x6f,
1310x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x29, 0x2e, 0x00, 1310x00, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x29, 0x32,
1320x00, 0x7e, 0x00, 0x10, 0x72, 0xee, 0x02, 0x11, 0x2d, 0x74, 1320x01, 0x03, 0x7e, 0x00, 0x10, 0x72, 0xee, 0x02, 0x12, 0x2d,
1330x00, 0x01, 0x25, 0x01, 0x0f, 0x1d, 0x01, 0x0b, 0x02, 0xef, 1330x74, 0x00, 0x00, 0x25, 0x01, 0x0f, 0x1d, 0x01, 0x0b, 0x02,
1340x02, 0x01, 0x89, 0x00, 0x82, 0x73, 0x70, 0x6f, 0x6e, 0x64, 1340xef, 0x02, 0x01, 0x89, 0x00, 0x50, 0x73, 0x70, 0x6f, 0x6e,
1350x69, 0x6e, 0x67, 0x09, 0x01, 0x03, 0xfe, 0x02, 0x01, 0xe0, 1350x64, 0x15, 0x01, 0x04, 0x19, 0x03, 0x01, 0xfe, 0x02, 0x00,
1360x03, 0x31, 0x68, 0x6f, 0x77, 0xe7, 0x04, 0xb3, 0x72, 0x65, 1360xe0, 0x03, 0x31, 0x68, 0x6f, 0x77, 0xe7, 0x04, 0xb3, 0x72,
1370x64, 0x75, 0x63, 0x65, 0x64, 0x00, 0x73, 0x69, 0x7a, 0xc6, 1370x65, 0x64, 0x75, 0x63, 0x65, 0x64, 0x00, 0x73, 0x69, 0x7a,
1380x00, 0x14, 0x61, 0xbd, 0x00, 0x21, 0x2c, 0x00, 0xea, 0x01, 1380xc6, 0x00, 0x14, 0x61, 0xbd, 0x00, 0x21, 0x2c, 0x00, 0xea,
1390xe0, 0x60, 0x70, 0x65, 0x6e, 0x63, 0x69, 0x6c, 0x00, 0x6d, 1390x01, 0xe1, 0x60, 0x70, 0x65, 0x6e, 0x63, 0x69, 0x6c, 0x00,
1400x61, 0x72, 0x6b, 0x27, 0x2e, 0xc0, 0x04, 0x01, 0x25, 0x04, 1400x6d, 0x61, 0x72, 0x6b, 0x27, 0x2e, 0xc0, 0x04, 0x00, 0x25,
1410x57, 0x68, 0x61, 0x76, 0x65, 0x00, 0x1b, 0x00, 0x12, 0x73, 1410x04, 0x57, 0x68, 0x61, 0x76, 0x65, 0x00, 0x1b, 0x00, 0x12,
1420xc3, 0x02, 0x65, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x8a, 1420x73, 0xc3, 0x02, 0x65, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c,
1430x03, 0x00, 0x22, 0x03, 0x05, 0x9f, 0x03, 0x03, 0x58, 0x00, 1430x8a, 0x03, 0x00, 0x22, 0x03, 0x06, 0x9f, 0x03, 0x02, 0x58,
1440x33, 0x2e, 0x00, 0x41, 0x0a, 0x00, 0x04, 0x82, 0x06, 0x11, 1440x00, 0x34, 0x2e, 0x00, 0x41, 0xc1, 0x00, 0x03, 0x82, 0x06,
1450x69, 0x4d, 0x04, 0x85, 0x66, 0x75, 0x6c, 0x6c, 0x2d, 0x73, 1450x11, 0x69, 0x4d, 0x04, 0x51, 0x66, 0x75, 0x6c, 0x6c, 0x2d,
1460x69, 0x7a, 0x3d, 0x00, 0x00, 0x68, 0x00, 0x31, 0x6e, 0x6f, 1460x88, 0x00, 0x04, 0xae, 0x00, 0x31, 0x63, 0x61, 0x6e, 0x74,
1470x74, 0x2b, 0x05, 0x04, 0x2b, 0x00, 0x09, 0x73, 0x00, 0x01, 1470x06, 0x00, 0xeb, 0x04, 0x04, 0xad, 0x06, 0x08, 0x73, 0x00,
1480x55, 0x02, 0x00, 0x94, 0x04, 0x00, 0x5d, 0x00, 0x30, 0x70, 1480x01, 0x55, 0x02, 0x00, 0x94, 0x04, 0x00, 0x5d, 0x00, 0x30,
1490x61, 0x79, 0xa3, 0x06, 0x20, 0x00, 0x61, 0xf2, 0x04, 0x01, 1490x70, 0x61, 0x79, 0xa3, 0x06, 0x20, 0x00, 0x61, 0xf2, 0x04,
1500x16, 0x03, 0x28, 0x74, 0x6f, 0x2e, 0x00, 0x01, 0xff, 0x06, 1500x01, 0x16, 0x03, 0x29, 0x74, 0x6f, 0x2e, 0x00, 0x00, 0xff,
1510x40, 0x00, 0x65, 0x78, 0x61, 0xac, 0x05, 0x50, 0x00, 0x77, 1510x06, 0x40, 0x00, 0x65, 0x78, 0x61, 0xac, 0x05, 0x20, 0x00,
1520x68, 0x61, 0x74, 0x5c, 0x01, 0x04, 0x7c, 0x01, 0x10, 0x6d, 1520x77, 0xe8, 0x00, 0x00, 0x5c, 0x01, 0x03, 0x7c, 0x01, 0x11,
1530xbf, 0x00, 0x00, 0x02, 0x04, 0x50, 0x75, 0x70, 0x00, 0x74, 1530x6d, 0xbf, 0x00, 0x50, 0x69, 0x73, 0x00, 0x75, 0x70, 0x38,
1540x6f, 0x1a, 0x00, 0x32, 0x3a, 0x00, 0x79, 0xeb, 0x00, 0x05, 1540x00, 0x63, 0x79, 0x6f, 0x75, 0x3a, 0x00, 0x79, 0xeb, 0x00,
1550x23, 0x00, 0x00, 0x10, 0x01, 0x40, 0x72, 0x65, 0x6d, 0x69, 1550x05, 0x23, 0x00, 0x70, 0x61, 0x73, 0x00, 0x72, 0x65, 0x6d,
1560xda, 0x03, 0x12, 0x73, 0x2a, 0x01, 0x30, 0x61, 0x00, 0x70, 1560x69, 0xda, 0x03, 0x12, 0x73, 0x2a, 0x01, 0x30, 0x61, 0x00,
1570xf4, 0x04, 0x54, 0x63, 0x75, 0x6c, 0x61, 0x72, 0xd5, 0x00, 1570x70, 0xf4, 0x04, 0x20, 0x63, 0x75, 0x0c, 0x03, 0x03, 0xd5,
1580x50, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x45, 0x00, 0x10, 0x62, 1580x00, 0x50, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x45, 0x00, 0x10,
1590xdc, 0x04, 0x91, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x69, 0x6e, 1590x62, 0xdc, 0x04, 0x91, 0x2d, 0x65, 0x78, 0x61, 0x6d, 0x69,
1600x65, 0x64, 0x4a, 0x04, 0x01, 0x54, 0x00, 0x42, 0x6b, 0x6e, 1600x6e, 0x65, 0x64, 0x4a, 0x04, 0x01, 0x54, 0x00, 0x42, 0x6b,
1610x6f, 0x77, 0xed, 0x03, 0x4a, 0x61, 0x62, 0x6f, 0x75, 0x45, 1610x6e, 0x6f, 0x77, 0xed, 0x03, 0x4b, 0x61, 0x62, 0x6f, 0x75,
1620x00, 0x04, 0xfc, 0x00, 0x00, 0x8f, 0x02, 0x0f, 0x81, 0x00, 1620x45, 0x00, 0x03, 0xfc, 0x00, 0x01, 0x8f, 0x02, 0x0f, 0x81,
1630x02, 0x53, 0x6c, 0x69, 0x73, 0x74, 0x73, 0xe9, 0x05, 0x00, 1630x00, 0x01, 0x20, 0x6c, 0x69, 0xce, 0x06, 0x03, 0xe9, 0x05,
1640x5f, 0x05, 0x01, 0xb0, 0x04, 0x08, 0x23, 0x06, 0x12, 0x61, 1640x32, 0x70, 0x6f, 0x73, 0x66, 0x06, 0x07, 0x23, 0x06, 0x13,
1650xff, 0x07, 0x05, 0xc5, 0x01, 0x20, 0x6f, 0x72, 0x56, 0x03, 1650x61, 0xff, 0x07, 0x04, 0xc5, 0x01, 0x20, 0x6f, 0x72, 0x56,
1660x20, 0x74, 0x68, 0x65, 0x01, 0x32, 0x65, 0x6c, 0x73, 0x83, 1660x03, 0x20, 0x74, 0x68, 0x65, 0x01, 0x32, 0x65, 0x6c, 0x73,
1670x00, 0x93, 0x66, 0x65, 0x65, 0x6c, 0x00, 0x6c, 0x69, 0x6b, 1670x83, 0x00, 0x93, 0x66, 0x65, 0x65, 0x6c, 0x00, 0x6c, 0x69,
1680x65, 0x98, 0x03, 0x51, 0x65, 0x72, 0x61, 0x73, 0x65, 0xd7, 1680x6b, 0x65, 0x98, 0x03, 0x51, 0x65, 0x72, 0x61, 0x73, 0x65,
1690x03, 0x39, 0x6e, 0x67, 0x6c, 0xd8, 0x01, 0x18, 0x2c, 0x7e, 1690xd7, 0x03, 0x39, 0x6e, 0x67, 0x6c, 0xd8, 0x01, 0x1c, 0x2c,
1700x02, 0x03, 0xce, 0x01, 0x07, 0x80, 0x02, 0x01, 0x7b, 0x02, 1700x7e, 0x02, 0x01, 0xce, 0x01, 0x07, 0x80, 0x02, 0x00, 0x7b,
1710x05, 0xe2, 0x01, 0x03, 0x82, 0x02, 0x01, 0xdb, 0x02, 0x01, 1710x02, 0x05, 0xe2, 0x01, 0x03, 0x9f, 0x03, 0x01, 0xdb, 0x02,
1720xf3, 0x03, 0x39, 0x41, 0x6c, 0x6c, 0x84, 0x01, 0x0a, 0xbf, 1720x00, 0x5b, 0x00, 0x3a, 0x41, 0x6c, 0x6c, 0x25, 0x02, 0x09,
1730x02, 0x22, 0x72, 0x65, 0x79, 0x00, 0x11, 0x64, 0x53, 0x07, 1730xbf, 0x02, 0x22, 0x72, 0x65, 0x79, 0x00, 0x12, 0x64, 0x53,
1740x02, 0x6d, 0x06, 0x23, 0x65, 0x66, 0x6c, 0x00, 0x06, 0x5e, 1740x07, 0x01, 0x6d, 0x06, 0x24, 0x65, 0x66, 0x6c, 0x00, 0x05,
1750x00, 0x14, 0x61, 0xdf, 0x00, 0x05, 0xe1, 0x02, 0x2f, 0x6f, 1750x5e, 0x00, 0x15, 0x61, 0xdf, 0x00, 0x04, 0xe1, 0x02, 0x2f,
1760x72, 0x32, 0x00, 0x01, 0x0c, 0x6e, 0x03, 0x31, 0x2e, 0x00, 1760x6f, 0x72, 0x32, 0x00, 0x06, 0x07, 0x6e, 0x03, 0x31, 0x2e,
1770x52, 0xbb, 0x00, 0x02, 0xae, 0x03, 0x36, 0x69, 0x6e, 0x67, 1770x00, 0x52, 0xbb, 0x00, 0x02, 0xae, 0x03, 0x01, 0x65, 0x02,
1780x21, 0x00, 0x00, 0x0d, 0x00, 0x10, 0x73, 0x24, 0x00, 0x01, 1780x04, 0x21, 0x00, 0x00, 0x0d, 0x00, 0x11, 0x73, 0x92, 0x03,
1790x12, 0x03, 0x00, 0x62, 0x02, 0x03, 0x04, 0x01, 0x0d, 0x60, 1790x01, 0x12, 0x03, 0x01, 0x62, 0x02, 0x02, 0x04, 0x01, 0x0c,
1800x02, 0x11, 0x41, 0xd9, 0x02, 0x01, 0xd6, 0x04, 0x03, 0x59, 1800x60, 0x02, 0x12, 0x41, 0xd9, 0x02, 0x02, 0xd6, 0x04, 0x01,
1810x03, 0x50, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x7b, 0x04, 0x05, 1810x59, 0x03, 0x50, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x7b, 0x04,
1820x2e, 0x07, 0x21, 0x75, 0x73, 0x74, 0x08, 0x00, 0xa4, 0x02, 1820x05, 0x2e, 0x07, 0x22, 0x75, 0x73, 0x74, 0x08, 0x62, 0x63,
1830x31, 0x6a, 0x75, 0x6e, 0x93, 0x05, 0x02, 0x11, 0x09, 0x23, 1830x6f, 0x6e, 0x6a, 0x75, 0x6e, 0x93, 0x05, 0x01, 0x11, 0x09,
1840x74, 0x68, 0x13, 0x01, 0x03, 0x30, 0x00, 0x11, 0x74, 0x02, 1840x25, 0x74, 0x68, 0x13, 0x01, 0x01, 0x30, 0x00, 0x11, 0x74,
1850x05, 0x17, 0x63, 0x1f, 0x03, 0x2b, 0x6f, 0x72, 0x72, 0x00, 1850x02, 0x05, 0x17, 0x63, 0x1f, 0x03, 0x2b, 0x6f, 0x72, 0x72,
1860x36, 0x55, 0x73, 0x65, 0x67, 0x00, 0x06, 0x37, 0x00, 0x30, 1860x00, 0x3d, 0x55, 0x73, 0x65, 0x67, 0x00, 0x60, 0x74, 0x6f,
1870x6d, 0x6f, 0x76, 0x09, 0x01, 0x50, 0x68, 0x69, 0x67, 0x68, 1870x00, 0x6d, 0x6f, 0x76, 0x09, 0x01, 0x51, 0x68, 0x69, 0x67,
1880x6c, 0xd5, 0x00, 0x03, 0xfb, 0x07, 0x05, 0x93, 0x07, 0x1f, 1880x68, 0x6c, 0xfc, 0x06, 0x07, 0xfb, 0x07, 0x00, 0x93, 0x07,
1890x2c, 0x2f, 0x01, 0x07, 0x00, 0x3f, 0x00, 0x00, 0xa5, 0x06, 1890x1f, 0x2c, 0x2f, 0x01, 0x07, 0x00, 0x3f, 0x00, 0x00, 0xa5,
1900x00, 0x75, 0x04, 0x03, 0xc1, 0x01, 0x06, 0x48, 0x00, 0x25, 1900x06, 0x01, 0x75, 0x04, 0x03, 0xc1, 0x01, 0x05, 0x48, 0x00,
1910x65, 0x64, 0x96, 0x03, 0x14, 0x50, 0x19, 0x01, 0x50, 0x72, 1910x25, 0x65, 0x64, 0x96, 0x03, 0x14, 0x50, 0x19, 0x01, 0x50,
1920x65, 0x74, 0x75, 0x72, 0x3f, 0x03, 0x5a, 0x67, 0x67, 0x6c, 1920x72, 0x65, 0x74, 0x75, 0x72, 0x3f, 0x03, 0x5a, 0x67, 0x67,
1930x65, 0x73, 0x30, 0x00, 0x01, 0x09, 0x08, 0x01, 0x63, 0x00, 1930x6c, 0x65, 0x73, 0x30, 0x00, 0x02, 0x09, 0x08, 0x00, 0x63,
1940x10, 0x64, 0x30, 0x04, 0x02, 0x51, 0x08, 0x04, 0xa9, 0x02, 1940x00, 0x11, 0x64, 0x30, 0x04, 0x02, 0x51, 0x08, 0x04, 0xa9,
1950x03, 0x67, 0x00, 0x20, 0x6f, 0x72, 0x27, 0x03, 0x1b, 0x6f, 1950x02, 0x02, 0x67, 0x00, 0x20, 0x6f, 0x72, 0x27, 0x03, 0x1b,
1960x20, 0x04, 0x06, 0xd0, 0x04, 0x00, 0x83, 0x01, 0x30, 0x66, 1960x6f, 0x20, 0x04, 0x07, 0xd0, 0x04, 0x60, 0x70, 0x72, 0x65,
1970x65, 0x72, 0x0b, 0x01, 0x23, 0x69, 0x6e, 0xa5, 0x00, 0x05, 1970x66, 0x65, 0x72, 0x0b, 0x01, 0x23, 0x69, 0x6e, 0xa5, 0x00,
1980xd3, 0x02, 0x81, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, 0x65, 1980x05, 0xd3, 0x02, 0x81, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62,
1990x74, 0x2b, 0x05, 0x26, 0x75, 0x74, 0xdb, 0x02, 0x50, 0x70, 1990x65, 0x74, 0x2b, 0x05, 0x26, 0x75, 0x74, 0xdb, 0x02, 0x51,
2000x69, 0x63, 0x74, 0x75, 0xc6, 0x0a, 0x04, 0x6e, 0x00, 0x03, 2000x70, 0x69, 0x63, 0x74, 0x75, 0xc6, 0x0a, 0x04, 0x6e, 0x00,
2010xeb, 0x01, 0x63, 0x60, 0x41, 0x27, 0x00, 0x74, 0x6f, 0xae, 2010x02, 0xeb, 0x01, 0x31, 0x60, 0x41, 0x27, 0x13, 0x07, 0x01,
2020x00, 0x81, 0x00, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x6e, 2020xae, 0x00, 0x50, 0x00, 0x62, 0x65, 0x74, 0x77, 0xbc, 0x08,
2030xe1, 0x04, 0x02, 0x0e, 0x06, 0x07, 0x6d, 0x01, 0x28, 0x61, 2030x00, 0xe1, 0x04, 0x04, 0x0e, 0x06, 0x05, 0x6d, 0x01, 0x29,
2040x73, 0x79, 0x01, 0x04, 0x24, 0x00, 0x04, 0x5b, 0x03, 0x03, 2040x61, 0x73, 0x79, 0x01, 0x07, 0x24, 0x00, 0x02, 0x5b, 0x03,
2050x8a, 0x00, 0x01, 0xa9, 0x00, 0x15, 0x4c, 0x55, 0x02, 0x02, 2050x02, 0x8a, 0x00, 0x00, 0xa9, 0x00, 0x15, 0x4c, 0x55, 0x02,
2060x9c, 0x04, 0x31, 0x63, 0x6c, 0x75, 0x2b, 0x02, 0x02, 0xcc, 2060x02, 0x9c, 0x04, 0x33, 0x63, 0x6c, 0x75, 0x2b, 0x02, 0x00,
2070x00, 0x01, 0xbe, 0x05, 0x30, 0x73, 0x00, 0x64, 0xf0, 0x0a, 2070xcc, 0x00, 0x01, 0xbe, 0x05, 0x30, 0x73, 0x00, 0x64, 0xf0,
2080x50, 0x28, 0x67, 0x72, 0x65, 0x79, 0x11, 0x00, 0x41, 0x6f, 2080x0a, 0x50, 0x28, 0x67, 0x72, 0x65, 0x79, 0x11, 0x00, 0x41,
2090x75, 0x74, 0x29, 0x9a, 0x02, 0x24, 0x75, 0x6e, 0x24, 0x00, 2090x6f, 0x75, 0x74, 0x29, 0x9a, 0x02, 0x24, 0x75, 0x6e, 0x24,
2100x23, 0x69, 0x66, 0x57, 0x08, 0x71, 0x61, 0x6c, 0x72, 0x65, 2100x00, 0x23, 0x69, 0x66, 0x57, 0x08, 0x71, 0x61, 0x6c, 0x72,
2110x61, 0x64, 0x79, 0x3d, 0x00, 0x20, 0x65, 0x64, 0x61, 0x00, 2110x65, 0x61, 0x64, 0x79, 0x3d, 0x00, 0x20, 0x65, 0x64, 0x61,
2120x42, 0x28, 0x41, 0x6c, 0x6c, 0xf0, 0x00, 0x01, 0x2f, 0x02, 2120x00, 0x10, 0x28, 0x1a, 0x03, 0x01, 0xf0, 0x00, 0x01, 0x2f,
2130x92, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 2130x02, 0x92, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
2140x49, 0x02, 0x13, 0x73, 0xd8, 0x07, 0x36, 0x32, 0x2e, 0x31, 2140x62, 0x49, 0x02, 0x13, 0x73, 0xd8, 0x07, 0x36, 0x32, 0x2e,
2150x2d, 0x0a, 0xb2, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 2150x31, 0x2d, 0x0a, 0x82, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61,
2160x6c, 0x65, 0x2e, 0x29, 0xa6, 0x07, 0x14, 0x32, 0xa6, 0x07, 2160x62, 0x6c, 0x8f, 0x08, 0x44, 0x33, 0x37, 0x2e, 0x32, 0xa6,
2170x60, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0xbc, 0x00, 0x12, 2170x07, 0x60, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0xbc, 0x00,
2180x20, 0x12, 0x05, 0x34, 0x73, 0x65, 0x00, 0x14, 0x00, 0x02, 2180x12, 0x20, 0x12, 0x05, 0x00, 0xc8, 0x02, 0x05, 0x14, 0x00,
2190x65, 0x09, 0x06, 0x3d, 0x00, 0x04, 0x9d, 0x09, 0xf0, 0x01, 2190x02, 0x42, 0x00, 0x04, 0x3d, 0x00, 0x04, 0x9d, 0x09, 0xf1,
2200x65, 0x00, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 2200x01, 0x65, 0x00, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d,
2210x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x70, 0x00, 0x04, 0x57, 2210x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x70, 0x00, 0x03,
2220x07, 0xb0, 0x60, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 2220x57, 0x07, 0xb0, 0x60, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00,
2230x65, 0x6e, 0x75, 0xac, 0x00, 0x91, 0x57, 0x69, 0x64, 0x74, 2230x6d, 0x65, 0x6e, 0x75, 0xac, 0x00, 0x91, 0x57, 0x69, 0x64,
2240x68, 0x2c, 0x00, 0x48, 0x65, 0x01, 0x02, 0x50, 0x00, 0x00, 2240x74, 0x68, 0x2c, 0x00, 0x48, 0x65, 0x01, 0x02, 0x51, 0x00,
2250x53, 0x69, 0x7a, 0x5e, 0x07, 0x02, 0x0b, 0x0a, 0x14, 0x69, 2250x00, 0x53, 0x69, 0x7a, 0x5e, 0x07, 0x01, 0x0b, 0x0a, 0x14,
2260x6a, 0x04, 0x01, 0x38, 0x01, 0x40, 0x44, 0x69, 0x66, 0x66, 2260x69, 0x6a, 0x04, 0x01, 0x38, 0x01, 0x40, 0x44, 0x69, 0x66,
2270xc9, 0x04, 0x62, 0x74, 0x79, 0x00, 0x00, 0x00, 0x43, 0x1c, 2270x66, 0xc9, 0x04, 0x63, 0x74, 0x79, 0x00, 0x00, 0x00, 0x43,
2280x08, 0x02, 0x42, 0x02, 0x15, 0x64, 0x1a, 0x00, 0x05, 0xa6, 2280x3d, 0x08, 0x01, 0x54, 0x00, 0x16, 0x64, 0x1a, 0x00, 0x04,
2290x0a, 0xf0, 0x02, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 2290xa6, 0x0a, 0x50, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x82, 0x02,
2300x64, 0x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x2e, 0x00, 2300x80, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x2e, 0x00,
231}; 231};
232 232
233const unsigned short help_text_len = 3286; 233const unsigned short help_text_len = 3286;
diff --git a/apps/plugins/puzzles/help/unequal.c b/apps/plugins/puzzles/help/unequal.c
index 723b55967e..8c5d2fa9b8 100644
--- a/apps/plugins/puzzles/help/unequal.c
+++ b/apps/plugins/puzzles/help/unequal.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -15,19 +15,19 @@ struct style_text help_text_style[] = {
15 LAST_STYLE_ITEM 15 LAST_STYLE_ITEM
16}; 16};
17 17
18/* orig 3934 comp 2353 ratio 0.598119 level 11 saved 1581 */ 18/* orig 3934 comp 2352 ratio 0.597865 level 10 saved 1582 */
19const char help_text[] = { 19const char help_text[] = {
200xf4, 0x24, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 200xf4, 0x24, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
210x32, 0x37, 0x3a, 0x20, 0x55, 0x6e, 0x65, 0x71, 0x75, 0x61, 210x32, 0x37, 0x3a, 0x20, 0x55, 0x6e, 0x65, 0x71, 0x75, 0x61,
220x6c, 0x20, 0x00, 0x00, 0x00, 0x59, 0x6f, 0x75, 0x00, 0x68, 220x6c, 0x20, 0x00, 0x00, 0x00, 0x59, 0x6f, 0x75, 0x00, 0x68,
230x61, 0x76, 0x65, 0x00, 0x61, 0x00, 0x73, 0x71, 0x75, 0x61, 230x61, 0x76, 0x65, 0x00, 0x61, 0x00, 0x73, 0x71, 0x75, 0x61,
240x72, 0x65, 0x00, 0x67, 0x72, 0x69, 0x64, 0x3b, 0x00, 0x65, 240x72, 0x65, 0x00, 0x67, 0x72, 0x69, 0x64, 0x3b, 0x00, 0x65,
250x61, 0x63, 0x68, 0x12, 0x00, 0xf2, 0x1d, 0x6d, 0x61, 0x79, 250x61, 0x63, 0x68, 0x12, 0x00, 0xf1, 0x1a, 0x6d, 0x61, 0x79,
260x00, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x00, 0x61, 260x00, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x00, 0x61,
270x00, 0x64, 0x69, 0x67, 0x69, 0x74, 0x00, 0x66, 0x72, 0x6f, 270x00, 0x64, 0x69, 0x67, 0x69, 0x74, 0x00, 0x66, 0x72, 0x6f,
280x6d, 0x00, 0x31, 0x00, 0x74, 0x6f, 0x00, 0x74, 0x68, 0x65, 280x6d, 0x00, 0x31, 0x00, 0x74, 0x6f, 0x00, 0x74, 0x68, 0x65,
290x00, 0x73, 0x69, 0x7a, 0x65, 0x00, 0x6f, 0x66, 0x00, 0x74, 290x00, 0x73, 0x69, 0x7a, 0x65, 0x00, 0x6f, 0x66, 0x0c, 0x00,
300x68, 0x40, 0x00, 0xa3, 0x2c, 0x00, 0x61, 0x6e, 0x64, 0x00, 300x00, 0x40, 0x00, 0xa3, 0x2c, 0x00, 0x61, 0x6e, 0x64, 0x00,
310x73, 0x6f, 0x6d, 0x65, 0x44, 0x00, 0x12, 0x73, 0x65, 0x00, 310x73, 0x6f, 0x6d, 0x65, 0x44, 0x00, 0x12, 0x73, 0x65, 0x00,
320x30, 0x63, 0x6c, 0x75, 0x2d, 0x00, 0xb0, 0x67, 0x6e, 0x73, 320x30, 0x63, 0x6c, 0x75, 0x2d, 0x00, 0xb0, 0x67, 0x6e, 0x73,
330x00, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x33, 0x00, 330x00, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x33, 0x00,
@@ -38,62 +38,62 @@ const char help_text[] = {
380x00, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x00, 0x73, 380x00, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x00, 0x73,
390x75, 0x63, 0x68, 0x00, 0x74, 0x68, 0x61, 0x74, 0x3a, 0x00, 390x75, 0x63, 0x68, 0x00, 0x74, 0x68, 0x61, 0x74, 0x3a, 0x00,
400x00, 0x00, 0x2d, 0x00, 0x45, 0xb2, 0x00, 0x34, 0x72, 0x6f, 400x00, 0x00, 0x2d, 0x00, 0x45, 0xb2, 0x00, 0x34, 0x72, 0x6f,
410x77, 0xab, 0x00, 0xf0, 0x05, 0x73, 0x00, 0x6f, 0x6e, 0x6c, 410x77, 0xab, 0x00, 0xf1, 0x05, 0x73, 0x00, 0x6f, 0x6e, 0x6c,
420x79, 0x00, 0x6f, 0x6e, 0x65, 0x00, 0x6f, 0x63, 0x63, 0x75, 420x79, 0x00, 0x6f, 0x6e, 0x65, 0x00, 0x6f, 0x63, 0x63, 0x75,
430x72, 0x72, 0x65, 0x6e, 0x63, 0xa5, 0x00, 0x01, 0xdb, 0x00, 430x72, 0x72, 0x65, 0x6e, 0x63, 0xa5, 0x00, 0x01, 0xdb, 0x00,
440x02, 0xc6, 0x00, 0x06, 0x38, 0x00, 0x6f, 0x63, 0x6f, 0x6c, 440x02, 0xc6, 0x00, 0x05, 0x38, 0x00, 0x6f, 0x63, 0x6f, 0x6c,
450x75, 0x6d, 0x6e, 0x3b, 0x00, 0x1d, 0x69, 0x41, 0x6c, 0x6c, 450x75, 0x6d, 0x6e, 0x3b, 0x00, 0x1d, 0x31, 0x41, 0x6c, 0x6c,
460x00, 0x74, 0x68, 0xd7, 0x00, 0x00, 0x30, 0x01, 0xf1, 0x03, 460x9c, 0x00, 0x07, 0xd7, 0x00, 0x00, 0x30, 0x01, 0xf1, 0x03,
470x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x64, 0x2e, 470x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x64, 0x2e,
480x00, 0x00, 0x00, 0x54, 0x68, 0x65, 0x72, 0x65, 0x17, 0x00, 480x00, 0x00, 0x00, 0x54, 0x68, 0x65, 0x72, 0x65, 0x17, 0x00,
490xf3, 0x0b, 0x74, 0x77, 0x6f, 0x00, 0x6d, 0x6f, 0x64, 0x65, 490xf3, 0x0b, 0x74, 0x77, 0x6f, 0x00, 0x6d, 0x6f, 0x64, 0x65,
500x73, 0x00, 0x66, 0x6f, 0x72, 0x00, 0x74, 0x68, 0x69, 0x73, 500x73, 0x00, 0x66, 0x6f, 0x72, 0x00, 0x74, 0x68, 0x69, 0x73,
510x00, 0x67, 0x61, 0x6d, 0x65, 0x2c, 0x00, 0x60, 0x90, 0x01, 510x00, 0x67, 0x61, 0x6d, 0x65, 0x2c, 0x00, 0x60, 0x90, 0x01,
520x11, 0x27, 0x36, 0x01, 0xa0, 0x60, 0x41, 0x64, 0x6a, 0x61, 520x11, 0x27, 0x36, 0x01, 0xa0, 0x60, 0x41, 0x64, 0x6a, 0x61,
530x63, 0x65, 0x6e, 0x74, 0x27, 0x3f, 0x00, 0x26, 0x49, 0x6e, 530x63, 0x65, 0x6e, 0x74, 0x27, 0x3f, 0x00, 0x27, 0x49, 0x6e,
540x1f, 0x00, 0x01, 0x3e, 0x00, 0x1c, 0x2c, 0x72, 0x00, 0x02, 540x1f, 0x00, 0x00, 0x3e, 0x00, 0x1e, 0x2c, 0x72, 0x00, 0x00,
550xb4, 0x01, 0xf4, 0x11, 0x65, 0x61, 0x74, 0x65, 0x72, 0x2d, 550x1d, 0x01, 0xf1, 0x0e, 0x65, 0x61, 0x74, 0x65, 0x72, 0x2d,
560x74, 0x68, 0x61, 0x6e, 0x00, 0x73, 0x79, 0x6d, 0x62, 0x6f, 560x74, 0x68, 0x61, 0x6e, 0x00, 0x73, 0x79, 0x6d, 0x62, 0x6f,
570x6c, 0x73, 0x00, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 570x6c, 0x73, 0x00, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74,
580x69, 0x6e, 0x67, 0x00, 0x6f, 0x6e, 0x89, 0x01, 0x50, 0x27, 580x69, 0x6e, 0x67, 0xca, 0x00, 0x02, 0x89, 0x01, 0x50, 0x27,
590x73, 0x00, 0x76, 0x61, 0x3d, 0x00, 0x24, 0x69, 0x73, 0x36, 590x73, 0x00, 0x76, 0x61, 0x3d, 0x00, 0x24, 0x69, 0x73, 0x36,
600x00, 0x11, 0x00, 0x36, 0x00, 0xf1, 0x04, 0x69, 0x74, 0x73, 600x00, 0x11, 0x00, 0x36, 0x00, 0xf0, 0x01, 0x69, 0x74, 0x73,
610x00, 0x6e, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6f, 0x75, 0x72, 610x00, 0x6e, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6f, 0x75, 0x72,
620x27, 0x73, 0x2e, 0x00, 0x49, 0x6e, 0xa4, 0x00, 0x01, 0x75, 620x27, 0x73, 0x2e, 0x7a, 0x00, 0x01, 0xa4, 0x00, 0x00, 0x75,
630x00, 0x81, 0x00, 0x6e, 0x6f, 0x74, 0x00, 0x61, 0x6c, 0x6c, 630x00, 0x81, 0x00, 0x6e, 0x6f, 0x74, 0x00, 0x61, 0x6c, 0x6c,
640x78, 0x00, 0x11, 0x73, 0x11, 0x02, 0xf0, 0x18, 0x62, 0x65, 640x78, 0x00, 0x11, 0x73, 0x11, 0x02, 0xf0, 0x18, 0x62, 0x65,
650x00, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x2c, 0x00, 650x00, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x2c, 0x00,
660x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x75, 0x6c, 0x61, 0x72, 660x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x75, 0x6c, 0x61, 0x72,
670x6c, 0x79, 0x00, 0x61, 0x74, 0x00, 0x68, 0x69, 0x67, 0x68, 670x6c, 0x79, 0x00, 0x61, 0x74, 0x00, 0x68, 0x69, 0x67, 0x68,
680x65, 0x72, 0x00, 0x64, 0x69, 0x66, 0x66, 0x17, 0x00, 0x92, 680x65, 0x72, 0x00, 0x64, 0x69, 0x66, 0x66, 0x17, 0x00, 0x94,
690x74, 0x79, 0x00, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x73, 0xd1, 690x74, 0x79, 0x00, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x73, 0xd1,
700x00, 0x06, 0xe2, 0x00, 0x0f, 0xd2, 0x00, 0x08, 0x3f, 0x62, 700x00, 0x05, 0xe2, 0x00, 0x0f, 0xd2, 0x00, 0x07, 0x3f, 0x62,
710x61, 0x72, 0xc2, 0x00, 0x0f, 0x00, 0x0b, 0x02, 0x60, 0x65, 710x61, 0x72, 0xc2, 0x00, 0x10, 0x90, 0x6e, 0x75, 0x6d, 0x65,
720x72, 0x69, 0x63, 0x61, 0x6c, 0x78, 0x00, 0x03, 0x55, 0x00, 720x72, 0x69, 0x63, 0x61, 0x6c, 0x78, 0x00, 0x03, 0x55, 0x00,
730x60, 0x00, 0x28, 0x69, 0x2e, 0x65, 0x2e, 0x31, 0x00, 0x04, 730x61, 0x00, 0x28, 0x69, 0x2e, 0x65, 0x2e, 0x31, 0x00, 0x03,
740x88, 0x00, 0x21, 0x6f, 0x72, 0x0e, 0x00, 0x6f, 0x6c, 0x6f, 740x88, 0x00, 0x21, 0x6f, 0x72, 0x0e, 0x00, 0x6f, 0x6c, 0x6f,
750x77, 0x65, 0x72, 0x29, 0xee, 0x00, 0x00, 0x0a, 0xec, 0x00, 750x77, 0x65, 0x72, 0x29, 0xee, 0x00, 0x00, 0x0b, 0xec, 0x00,
760x07, 0xe8, 0x00, 0x20, 0x61, 0x72, 0x0e, 0x00, 0x44, 0x77, 760x06, 0xe8, 0x00, 0x20, 0x61, 0x72, 0x0e, 0x00, 0x44, 0x77,
770x61, 0x79, 0x73, 0xec, 0x00, 0x54, 0x3a, 0x00, 0x61, 0x62, 770x61, 0x79, 0x73, 0xec, 0x00, 0x54, 0x3a, 0x00, 0x61, 0x62,
780x73, 0x0e, 0x02, 0x40, 0x61, 0x00, 0x62, 0x61, 0x3e, 0x01, 780x73, 0x0e, 0x02, 0x10, 0x61, 0xa6, 0x00, 0xb1, 0x00, 0x74,
790x81, 0x75, 0x73, 0x00, 0x6d, 0x65, 0x61, 0x6e, 0x73, 0x8d, 790x68, 0x75, 0x73, 0x00, 0x6d, 0x65, 0x61, 0x6e, 0x73, 0x8d,
800x02, 0x2f, 0x00, 0x61, 0xa8, 0x00, 0x00, 0xa0, 0x64, 0x65, 800x02, 0x2f, 0x00, 0x61, 0xa8, 0x00, 0x00, 0xa1, 0x64, 0x65,
810x66, 0x69, 0x6e, 0x69, 0x74, 0x65, 0x6c, 0x79, 0x4a, 0x01, 810x66, 0x69, 0x6e, 0x69, 0x74, 0x65, 0x6c, 0x79, 0x4a, 0x01,
820x0f, 0xb7, 0x00, 0x03, 0x21, 0x74, 0x6f, 0x40, 0x00, 0x07, 820x0f, 0xb7, 0x00, 0x02, 0x22, 0x74, 0x6f, 0x40, 0x00, 0x09,
830x85, 0x01, 0x05, 0x30, 0x01, 0x8d, 0x54, 0x72, 0x69, 0x76, 830x85, 0x01, 0x02, 0x30, 0x01, 0x50, 0x54, 0x72, 0x69, 0x76,
840x69, 0x61, 0x6c, 0x27, 0x52, 0x01, 0xa0, 0x00, 0x28, 0x61, 840x69, 0x01, 0x02, 0x0c, 0x52, 0x01, 0xa0, 0x00, 0x28, 0x61,
850x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x8e, 0x01, 0x11, 850x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x8e, 0x01, 0x11,
860x61, 0x49, 0x01, 0x81, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 860x61, 0x49, 0x01, 0x81, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f,
870x6d, 0x27, 0x5d, 0x02, 0xf5, 0x03, 0x00, 0x74, 0x79, 0x70, 870x6d, 0x27, 0x5d, 0x02, 0xf1, 0x00, 0x00, 0x74, 0x79, 0x70,
880x65, 0x00, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 880x65, 0x00, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72,
890x29, 0x2c, 0x00, 0x74, 0x8f, 0x02, 0x29, 0x6e, 0x6f, 0x37, 890x29, 0x6b, 0x01, 0x03, 0x8f, 0x02, 0x2b, 0x6e, 0x6f, 0x37,
900x02, 0x03, 0x7c, 0x01, 0x1c, 0x69, 0x70, 0x02, 0x11, 0x3b, 900x02, 0x01, 0x7c, 0x01, 0x1c, 0x69, 0x70, 0x02, 0x11, 0x3b,
910x55, 0x00, 0x63, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x9e, 910x55, 0x00, 0x63, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x9e,
920x03, 0x42, 0x73, 0x6f, 0x6c, 0x76, 0x95, 0x03, 0x10, 0x4c, 920x03, 0x42, 0x73, 0x6f, 0x6c, 0x76, 0x95, 0x03, 0x10, 0x4c,
930x9d, 0x01, 0x03, 0xf0, 0x00, 0x01, 0x34, 0x03, 0x00, 0xb2, 930x9d, 0x01, 0x04, 0x27, 0x04, 0x00, 0x34, 0x03, 0x00, 0xb2,
940x00, 0x21, 0x41, 0x74, 0x1c, 0x00, 0x31, 0x74, 0x69, 0x6d, 940x00, 0x21, 0x41, 0x74, 0x1c, 0x00, 0x31, 0x74, 0x69, 0x6d,
950x26, 0x01, 0x30, 0x77, 0x72, 0x69, 0xc2, 0x01, 0x01, 0x7b, 950x26, 0x01, 0x30, 0x77, 0x72, 0x69, 0xc2, 0x01, 0x02, 0xe6,
960x00, 0x0a, 0x5c, 0x00, 0x03, 0x33, 0x04, 0x27, 0x69, 0x73, 960x01, 0x0a, 0x5c, 0x00, 0x02, 0x33, 0x04, 0x27, 0x69, 0x73,
970x5f, 0x00, 0x60, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0xf2, 970x5f, 0x00, 0x60, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0xf2,
980x01, 0x21, 0x69, 0x6e, 0x32, 0x00, 0xf1, 0x06, 0x47, 0x75, 980x01, 0x21, 0x69, 0x6e, 0x32, 0x00, 0xf1, 0x06, 0x47, 0x75,
990x61, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x00, 0x77, 0x65, 0x65, 990x61, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x00, 0x77, 0x65, 0x65,
@@ -113,146 +113,146 @@ const char help_text[] = {
1130x6f, 0x00, 0x70, 0x6c, 0x61, 0x79, 0x3f, 0x00, 0xe1, 0x2c, 1130x6f, 0x00, 0x70, 0x6c, 0x61, 0x79, 0x3f, 0x00, 0xe1, 0x2c,
1140x00, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x79, 0x00, 0x63, 0x6c, 1140x00, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x79, 0x00, 0x63, 0x6c,
1150x69, 0x63, 0x6b, 0xc4, 0x00, 0x60, 0x6d, 0x6f, 0x75, 0x73, 1150x69, 0x63, 0x6b, 0xc4, 0x00, 0x60, 0x6d, 0x6f, 0x75, 0x73,
1160x65, 0x00, 0x58, 0x05, 0x83, 0x6e, 0x79, 0x00, 0x65, 0x6d, 1160x65, 0x00, 0x58, 0x05, 0x84, 0x6e, 0x79, 0x00, 0x65, 0x6d,
1170x70, 0x74, 0x79, 0x4e, 0x01, 0x00, 0x0b, 0x04, 0x00, 0x22, 1170x70, 0x74, 0x79, 0x4e, 0x01, 0x00, 0x0b, 0x04, 0x42, 0x74,
1180x00, 0x11, 0x6e, 0xc2, 0x01, 0x04, 0x77, 0x05, 0x00, 0xcb, 1180x68, 0x65, 0x6e, 0xc2, 0x01, 0x04, 0x77, 0x05, 0x70, 0x6f,
1190x02, 0x40, 0x6c, 0x65, 0x74, 0x74, 0xd5, 0x02, 0x02, 0x1f, 1190x72, 0x00, 0x6c, 0x65, 0x74, 0x74, 0xd5, 0x02, 0x02, 0x1f,
1200x01, 0x81, 0x6b, 0x65, 0x79, 0x62, 0x6f, 0x61, 0x72, 0x64, 1200x01, 0x81, 0x6b, 0x65, 0x79, 0x62, 0x6f, 0x61, 0x72, 0x64,
1210x36, 0x05, 0x31, 0x69, 0x6c, 0x6c, 0x44, 0x02, 0x03, 0x44, 1210x36, 0x05, 0x32, 0x69, 0x6c, 0x6c, 0x44, 0x02, 0x02, 0x44,
1220x00, 0xc0, 0x2e, 0x00, 0x49, 0x66, 0x00, 0x79, 0x6f, 0x75, 1220x00, 0xc0, 0x2e, 0x00, 0x49, 0x66, 0x00, 0x79, 0x6f, 0x75,
1230x00, 0x6d, 0x61, 0x6b, 0x43, 0x00, 0x8c, 0x6d, 0x69, 0x73, 1230x00, 0x6d, 0x61, 0x6b, 0x43, 0x00, 0x8e, 0x6d, 0x69, 0x73,
1240x74, 0x61, 0x6b, 0x65, 0x2c, 0x80, 0x00, 0x04, 0x6b, 0x01, 1240x74, 0x61, 0x6b, 0x65, 0x2c, 0x80, 0x00, 0x02, 0x4c, 0x00,
1250x98, 0x69, 0x6e, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 1250x98, 0x69, 0x6e, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74,
1260x84, 0x00, 0xb0, 0x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x53, 1260x84, 0x00, 0xb0, 0x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x53,
1270x70, 0x61, 0x63, 0x65, 0x64, 0x00, 0xb0, 0x63, 0x6c, 0x65, 1270x70, 0x61, 0x63, 0x65, 0x64, 0x00, 0xb0, 0x63, 0x6c, 0x65,
1280x61, 0x72, 0x00, 0x69, 0x74, 0x00, 0x61, 0x67, 0x0f, 0x06, 1280x61, 0x72, 0x00, 0x69, 0x74, 0x00, 0x61, 0x67, 0x0f, 0x06,
1290x62, 0x28, 0x6f, 0x72, 0x00, 0x75, 0x73, 0x0d, 0x02, 0xd0, 1290x62, 0x28, 0x6f, 0x72, 0x00, 0x75, 0x73, 0x0d, 0x02, 0xd1,
1300x55, 0x6e, 0x64, 0x6f, 0x00, 0x66, 0x65, 0x61, 0x74, 0x75, 1300x55, 0x6e, 0x64, 0x6f, 0x00, 0x66, 0x65, 0x61, 0x74, 0x75,
1310x72, 0x65, 0x29, 0xff, 0x00, 0x03, 0x7e, 0x00, 0x61, 0x72, 1310x72, 0x65, 0x29, 0xbb, 0x02, 0x02, 0x7e, 0x00, 0x62, 0x72,
1320x69, 0x67, 0x68, 0x74, 0x2d, 0x74, 0x00, 0x01, 0xea, 0x00, 1320x69, 0x67, 0x68, 0x74, 0x2d, 0x74, 0x00, 0x01, 0x42, 0x06,
1330x0f, 0xe2, 0x00, 0x04, 0x03, 0xd8, 0x05, 0x11, 0x2c, 0xc2, 1330x0f, 0xe2, 0x00, 0x04, 0x02, 0xd8, 0x05, 0x13, 0x2c, 0x06,
1340x00, 0x03, 0x0d, 0x00, 0x50, 0x00, 0x77, 0x69, 0x6c, 0x6c, 1340x03, 0x01, 0x0d, 0x00, 0x20, 0x00, 0x77, 0xd3, 0x00, 0xa4,
1350x6b, 0x04, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x64, 1350x62, 0x65, 0x00, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x64,
1360xaa, 0x00, 0x05, 0x42, 0x00, 0xf1, 0x03, 0x73, 0x00, 0x61, 1360xaa, 0x00, 0x04, 0x42, 0x00, 0xf1, 0x03, 0x73, 0x00, 0x61,
1370x00, 0x60, 0x70, 0x65, 0x6e, 0x63, 0x69, 0x6c, 0x00, 0x6d, 1370x00, 0x60, 0x70, 0x65, 0x6e, 0x63, 0x69, 0x6c, 0x00, 0x6d,
1380x61, 0x72, 0x6b, 0x27, 0x2e, 0xd1, 0x06, 0x32, 0x63, 0x61, 1380x61, 0x72, 0x6b, 0x27, 0x2e, 0xd1, 0x06, 0x32, 0x63, 0x61,
1390x6e, 0x70, 0x06, 0x07, 0x1b, 0x00, 0x02, 0x76, 0x05, 0x84, 1390x6e, 0x70, 0x06, 0x07, 0x1b, 0x00, 0x02, 0x76, 0x05, 0x85,
1400x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x45, 0x06, 1400x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x45, 0x06,
1410x05, 0x51, 0x00, 0x35, 0x61, 0x6d, 0x65, 0x36, 0x01, 0x12, 1410x04, 0x51, 0x00, 0x00, 0x4c, 0x02, 0x04, 0x36, 0x01, 0x13,
1420x53, 0xb3, 0x06, 0x04, 0x0e, 0x06, 0x31, 0x69, 0x6e, 0x67, 1420x53, 0xb3, 0x06, 0x03, 0x0e, 0x06, 0x00, 0x8d, 0x02, 0x00,
1430x5b, 0x01, 0x54, 0x65, 0x64, 0x2d, 0x69, 0x6e, 0x39, 0x00, 1430x5b, 0x01, 0x55, 0x65, 0x64, 0x2d, 0x69, 0x6e, 0x39, 0x00,
1440x00, 0x64, 0x00, 0x02, 0x15, 0x05, 0x24, 0x73, 0x6f, 0x29, 1440x32, 0x63, 0x61, 0x6e, 0x15, 0x05, 0x25, 0x73, 0x6f, 0x1d,
1450x00, 0x09, 0x6f, 0x00, 0x03, 0xfc, 0x05, 0x02, 0x86, 0x03, 1450x07, 0x08, 0x6f, 0x00, 0x03, 0xfc, 0x05, 0x02, 0x86, 0x03,
1460x40, 0x70, 0x61, 0x79, 0x73, 0x71, 0x03, 0x51, 0x61, 0x74, 1460x10, 0x70, 0x43, 0x04, 0x81, 0x6e, 0x6f, 0x00, 0x61, 0x74,
1470x74, 0x65, 0x6e, 0x7e, 0x02, 0x29, 0x74, 0x6f, 0x2e, 0x00, 1470x74, 0x65, 0x6e, 0x7e, 0x02, 0x29, 0x74, 0x6f, 0x2e, 0x00,
1480xe0, 0x2c, 0x00, 0x73, 0x6f, 0x00, 0x65, 0x78, 0x61, 0x63, 1480xe0, 0x2c, 0x00, 0x73, 0x6f, 0x00, 0x65, 0x78, 0x61, 0x63,
1490x74, 0x6c, 0x79, 0x00, 0x77, 0x01, 0x01, 0x34, 0x79, 0x6f, 1490x74, 0x6c, 0x79, 0x00, 0x77, 0x01, 0x01, 0x00, 0x3a, 0x01,
1500x75, 0x5a, 0x01, 0x10, 0x6d, 0xbb, 0x00, 0x00, 0x1d, 0x03, 1500x03, 0x5a, 0x01, 0x11, 0x6d, 0xbb, 0x00, 0x50, 0x69, 0x73,
1510x50, 0x75, 0x70, 0x00, 0x74, 0x6f, 0x1a, 0x00, 0x32, 0x3a, 1510x00, 0x75, 0x70, 0x38, 0x00, 0x63, 0x79, 0x6f, 0x75, 0x3a,
1520x00, 0x79, 0xe7, 0x00, 0x05, 0x23, 0x00, 0x00, 0x0c, 0x01, 1520x00, 0x79, 0xe7, 0x00, 0x05, 0x23, 0x00, 0x70, 0x61, 0x73,
1530x40, 0x72, 0x65, 0x6d, 0x69, 0x1e, 0x03, 0x04, 0x89, 0x04, 1530x00, 0x72, 0x65, 0x6d, 0x69, 0x1e, 0x03, 0x05, 0x89, 0x04,
1540x07, 0x98, 0x05, 0x04, 0x32, 0x01, 0x40, 0x6e, 0x65, 0x65, 1540x06, 0x98, 0x05, 0x04, 0x32, 0x01, 0x41, 0x6e, 0x65, 0x65,
1550x64, 0xc4, 0x03, 0x00, 0x54, 0x01, 0xd0, 0x72, 0x65, 0x2d, 1550x64, 0xc4, 0x03, 0xf0, 0x01, 0x62, 0x65, 0x00, 0x72, 0x65,
1560x65, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x64, 0x00, 0x6f, 1560x2d, 0x65, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x64, 0x00,
1570xd3, 0x04, 0x00, 0x54, 0x00, 0x70, 0x6b, 0x6e, 0x6f, 0x77, 1570x6f, 0xd3, 0x04, 0x00, 0x54, 0x00, 0x70, 0x6b, 0x6e, 0x6f,
1580x00, 0x6d, 0x6f, 0x5d, 0x01, 0x3a, 0x62, 0x6f, 0x75, 0x45, 1580x77, 0x00, 0x6d, 0x6f, 0x5d, 0x01, 0x3b, 0x62, 0x6f, 0x75,
1590x00, 0x05, 0xa2, 0x01, 0x2f, 0x6f, 0x72, 0x80, 0x00, 0x02, 1590x45, 0x00, 0x04, 0xa2, 0x01, 0x2f, 0x6f, 0x72, 0x80, 0x00,
1600x54, 0x6c, 0x69, 0x73, 0x74, 0x73, 0x07, 0x08, 0x6a, 0x70, 1600x02, 0x54, 0x6c, 0x69, 0x73, 0x74, 0x73, 0x07, 0x08, 0x31,
1610x6f, 0x73, 0x73, 0x69, 0x62, 0x6a, 0x01, 0x64, 0x61, 0x00, 1610x70, 0x6f, 0x73, 0x32, 0x05, 0x08, 0x6a, 0x01, 0x64, 0x61,
1620x67, 0x69, 0x76, 0x65, 0x31, 0x04, 0x00, 0x48, 0x00, 0x00, 1620x00, 0x67, 0x69, 0x76, 0x65, 0x31, 0x04, 0x01, 0x48, 0x00,
1630xf8, 0x02, 0x20, 0x74, 0x68, 0x62, 0x01, 0x32, 0x65, 0x6c, 1630x50, 0x61, 0x6e, 0x79, 0x74, 0x68, 0x62, 0x01, 0x32, 0x65,
1640x73, 0x82, 0x00, 0x93, 0x66, 0x65, 0x65, 0x6c, 0x00, 0x6c, 1640x6c, 0x73, 0x82, 0x00, 0x93, 0x66, 0x65, 0x65, 0x6c, 0x00,
1650x69, 0x6b, 0x65, 0x42, 0x03, 0x41, 0x65, 0x72, 0x61, 0x73, 1650x6c, 0x69, 0x6b, 0x65, 0x42, 0x03, 0x41, 0x65, 0x72, 0x61,
1660x9f, 0x08, 0x49, 0x69, 0x6e, 0x67, 0x6c, 0xd3, 0x01, 0x18, 1660x73, 0x9f, 0x08, 0x49, 0x69, 0x6e, 0x67, 0x6c, 0xd3, 0x01,
1670x2c, 0x5b, 0x02, 0x0c, 0x1b, 0x02, 0x21, 0x6e, 0x64, 0x58, 1670x1c, 0x2c, 0x5b, 0x02, 0x08, 0x1b, 0x02, 0x22, 0x6e, 0x64,
1680x02, 0x04, 0xde, 0x01, 0x04, 0x88, 0x00, 0x02, 0xb8, 0x02, 1680x58, 0x02, 0x05, 0xde, 0x01, 0x03, 0x52, 0x02, 0x01, 0xb8,
1690x01, 0xa7, 0x04, 0x29, 0x6c, 0x6c, 0x83, 0x01, 0x0a, 0x9c, 1690x02, 0x01, 0xa7, 0x04, 0x2a, 0x6c, 0x6c, 0x20, 0x02, 0x09,
1700x02, 0x22, 0x72, 0x65, 0x79, 0x00, 0x61, 0x64, 0x00, 0x77, 1700x9c, 0x02, 0x22, 0x72, 0x65, 0x79, 0x00, 0x30, 0x64, 0x00,
1710x68, 0x65, 0x6e, 0x99, 0x00, 0x33, 0x6c, 0x65, 0x66, 0x6c, 1710x77, 0xa3, 0x02, 0x00, 0x99, 0x00, 0x34, 0x6c, 0x65, 0x66,
1720x00, 0x06, 0x5e, 0x00, 0x17, 0x61, 0x14, 0x01, 0x0f, 0x2a, 1720x6c, 0x00, 0x05, 0x5e, 0x00, 0x18, 0x61, 0x14, 0x01, 0x0f,
1730x00, 0x01, 0x07, 0x43, 0x03, 0x10, 0x73, 0x43, 0x03, 0x36, 1730x2a, 0x00, 0x05, 0x02, 0x43, 0x03, 0x10, 0x73, 0x43, 0x03,
1740x2e, 0x00, 0x52, 0xb3, 0x00, 0x35, 0x69, 0x6e, 0x67, 0x20, 1740x36, 0x2e, 0x00, 0x52, 0xb3, 0x00, 0x00, 0xf7, 0x00, 0x05,
1750x00, 0x00, 0xde, 0x00, 0x02, 0x23, 0x00, 0x01, 0xf4, 0x02, 1750x20, 0x00, 0x00, 0x0d, 0x00, 0x01, 0x23, 0x00, 0x02, 0xf4,
1760x00, 0x58, 0x02, 0x03, 0xfb, 0x00, 0x0d, 0x56, 0x02, 0x11, 1760x02, 0x01, 0x58, 0x02, 0x02, 0xfb, 0x00, 0x0c, 0x56, 0x02,
1770x41, 0xcb, 0x02, 0x01, 0x65, 0x04, 0x03, 0x3b, 0x07, 0x50, 1770x12, 0x41, 0xcb, 0x02, 0x00, 0x65, 0x04, 0x03, 0x3b, 0x07,
1780x75, 0x72, 0x73, 0x6f, 0x72, 0x0b, 0x04, 0x01, 0x97, 0x02, 1780x50, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x0b, 0x04, 0x01, 0x97,
1790x00, 0xdc, 0x01, 0x20, 0x75, 0x73, 0x2d, 0x03, 0x01, 0xd1, 1790x02, 0x00, 0xdc, 0x01, 0x22, 0x75, 0x73, 0x2d, 0x03, 0x62,
1800x08, 0x31, 0x6a, 0x75, 0x6e, 0xf1, 0x04, 0x01, 0x9b, 0x04, 1800x63, 0x6f, 0x6e, 0x6a, 0x75, 0x6e, 0xf1, 0x04, 0x01, 0x9b,
1810x00, 0x30, 0x00, 0x02, 0x4b, 0x04, 0x00, 0x2f, 0x00, 0x02, 1810x04, 0x00, 0x30, 0x00, 0x02, 0x4b, 0x04, 0x01, 0x2f, 0x00,
1820xce, 0x05, 0x25, 0x65, 0x74, 0xa4, 0x01, 0x29, 0x6f, 0x72, 1820x00, 0xce, 0x05, 0x25, 0x65, 0x74, 0xa4, 0x01, 0x2b, 0x6f,
1830x6e, 0x00, 0x05, 0x4e, 0x03, 0x01, 0x8f, 0x00, 0x05, 0xe9, 1830x72, 0x6e, 0x00, 0x04, 0x4e, 0x03, 0x01, 0x8f, 0x00, 0x04,
1840x03, 0x30, 0x60, 0x4d, 0x27, 0x3e, 0x00, 0x00, 0x3d, 0x00, 1840xe9, 0x03, 0x30, 0x60, 0x4d, 0x27, 0x3e, 0x00, 0x00, 0x3d,
1850x51, 0x61, 0x75, 0x74, 0x6f, 0x2d, 0x78, 0x04, 0x54, 0x65, 1850x00, 0x51, 0x61, 0x75, 0x74, 0x6f, 0x2d, 0x78, 0x04, 0x54,
1860x76, 0x65, 0x72, 0x79, 0xda, 0x06, 0xc0, 0x00, 0x68, 0x69, 1860x65, 0x76, 0x65, 0x72, 0x79, 0xda, 0x06, 0xc1, 0x00, 0x68,
1870x6e, 0x74, 0x2c, 0x00, 0x72, 0x65, 0x61, 0x64, 0x79, 0xad, 1870x69, 0x6e, 0x74, 0x2c, 0x00, 0x72, 0x65, 0x61, 0x64, 0x79,
1880x00, 0x00, 0x9b, 0x02, 0x42, 0x6f, 0x76, 0x61, 0x6c, 0xa6, 1880xad, 0x00, 0x72, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x61, 0x6c,
1890x02, 0x60, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x33, 0x01, 1890xa6, 0x02, 0x61, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x33,
1900x02, 0x4f, 0x00, 0x15, 0x48, 0x4f, 0x00, 0x26, 0x64, 0x6f, 1900x01, 0x01, 0x4f, 0x00, 0x15, 0x48, 0x4f, 0x00, 0x26, 0x64,
1910xb0, 0x01, 0x23, 0x62, 0x75, 0x5e, 0x03, 0x22, 0x74, 0x6f, 1910x6f, 0xb0, 0x01, 0x23, 0x62, 0x75, 0x5e, 0x03, 0x22, 0x74,
1920x3f, 0x00, 0x02, 0x9a, 0x07, 0x71, 0x6f, 0x62, 0x76, 0x69, 1920x6f, 0x3f, 0x00, 0x02, 0x9a, 0x07, 0x71, 0x6f, 0x62, 0x76,
1930x6f, 0x75, 0x73, 0x62, 0x00, 0x12, 0x73, 0xc8, 0x01, 0xc0, 1930x69, 0x6f, 0x75, 0x73, 0x62, 0x00, 0x12, 0x73, 0xc8, 0x01,
1940x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 1940xc5, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65,
1950x79, 0x2c, 0xa5, 0x00, 0x0d, 0x15, 0x01, 0x10, 0x74, 0x79, 1950x6c, 0x79, 0x2c, 0xa5, 0x00, 0x08, 0x15, 0x01, 0x10, 0x74,
1960x09, 0x02, 0xb3, 0x06, 0x01, 0xd9, 0x00, 0x75, 0x00, 0x61, 1960x79, 0x09, 0x03, 0xb3, 0x06, 0x00, 0xd9, 0x00, 0x75, 0x00,
1970x72, 0x6f, 0x75, 0x6e, 0x64, 0x58, 0x0a, 0x34, 0x2e, 0x00, 1970x61, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x58, 0x0a, 0x34, 0x2e,
1980x50, 0x83, 0x01, 0x20, 0x74, 0x68, 0x19, 0x03, 0x43, 0x74, 1980x00, 0x50, 0x83, 0x01, 0x20, 0x74, 0x68, 0x19, 0x03, 0x43,
1990x75, 0x72, 0x6e, 0x94, 0x00, 0x56, 0x67, 0x67, 0x6c, 0x65, 1990x74, 0x75, 0x72, 0x6e, 0x94, 0x00, 0x56, 0x67, 0x67, 0x6c,
2000x73, 0x3a, 0x00, 0x10, 0x28, 0xf9, 0x0a, 0x00, 0xf7, 0x01, 2000x65, 0x73, 0x3a, 0x00, 0x11, 0x28, 0xf9, 0x0a, 0x72, 0x61,
2010x42, 0x6f, 0x72, 0x6d, 0x61, 0x27, 0x01, 0x01, 0x08, 0x01, 2010x00, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x27, 0x01, 0x01, 0x08,
2020x08, 0x38, 0x01, 0x24, 0x29, 0x2c, 0x21, 0x02, 0x35, 0x69, 2020x01, 0x08, 0x38, 0x01, 0x24, 0x29, 0x2c, 0x21, 0x02, 0x01,
2030x6e, 0x67, 0x23, 0x02, 0x00, 0x8f, 0x01, 0x2f, 0x69, 0x73, 2030xe2, 0x01, 0x04, 0x7a, 0x02, 0x20, 0x69, 0x6e, 0xc4, 0x03,
2040xca, 0x04, 0x02, 0x04, 0x82, 0x05, 0x00, 0xfe, 0x06, 0x50, 2040x0f, 0xca, 0x04, 0x03, 0x03, 0x0e, 0x00, 0x80, 0x61, 0x70,
2050x72, 0x6f, 0x70, 0x72, 0x69, 0xf5, 0x0a, 0x43, 0x77, 0x61, 2050x70, 0x72, 0x6f, 0x70, 0x72, 0x69, 0xf5, 0x0a, 0x44, 0x77,
2060x79, 0x3b, 0x44, 0x00, 0x02, 0x9b, 0x02, 0x20, 0x30, 0x00, 2060x61, 0x79, 0x3b, 0x44, 0x00, 0x01, 0x9b, 0x02, 0x21, 0x30,
2070x6d, 0x05, 0x04, 0xa6, 0x00, 0x03, 0x2d, 0x02, 0x22, 0x62, 2070x00, 0x6d, 0x05, 0x04, 0xa6, 0x00, 0x02, 0x2d, 0x02, 0x23,
2080x61, 0x25, 0x05, 0x03, 0x99, 0x05, 0x13, 0x61, 0xaa, 0x04, 2080x62, 0x61, 0x25, 0x05, 0x02, 0x99, 0x05, 0x13, 0x61, 0xaa,
2090x05, 0xcc, 0x04, 0x58, 0x00, 0x00, 0x4c, 0x65, 0x66, 0x70, 2090x04, 0x05, 0xcc, 0x04, 0x58, 0x00, 0x00, 0x4c, 0x65, 0x66,
2100x02, 0x00, 0xdb, 0x08, 0x01, 0x64, 0x02, 0x03, 0xbd, 0x00, 2100x70, 0x02, 0x02, 0x69, 0x09, 0x01, 0x33, 0x00, 0x01, 0xbd,
2110x20, 0x69, 0x74, 0x95, 0x01, 0x10, 0x64, 0x21, 0x09, 0x60, 2110x00, 0x20, 0x69, 0x74, 0x95, 0x01, 0x10, 0x64, 0x21, 0x09,
2120x28, 0x67, 0x72, 0x65, 0x79, 0x00, 0x66, 0x06, 0x41, 0x75, 2120x60, 0x28, 0x67, 0x72, 0x65, 0x79, 0x00, 0x66, 0x06, 0x41,
2130x74, 0x29, 0x2c, 0x6e, 0x00, 0x14, 0x6e, 0x24, 0x00, 0x10, 2130x75, 0x74, 0x29, 0x2c, 0x6e, 0x00, 0x14, 0x6e, 0x24, 0x00,
2140x69, 0xee, 0x06, 0x01, 0xa1, 0x07, 0x11, 0x6c, 0xd6, 0x01, 2140x10, 0x69, 0xee, 0x06, 0x01, 0xa1, 0x07, 0x12, 0x6c, 0xd6,
2150x01, 0x3d, 0x00, 0x00, 0xe2, 0x0a, 0x40, 0x48, 0x6f, 0x6c, 2150x01, 0x00, 0x19, 0x00, 0x00, 0xe2, 0x0a, 0x40, 0x48, 0x6f,
2160x64, 0x59, 0x00, 0x13, 0x43, 0x08, 0x07, 0x00, 0x9a, 0x02, 2160x6c, 0x64, 0x59, 0x00, 0x13, 0x43, 0x08, 0x07, 0x00, 0x9a,
2170x4a, 0x68, 0x69, 0x66, 0x74, 0xda, 0x02, 0x00, 0x43, 0x02, 2170x02, 0x4a, 0x68, 0x69, 0x66, 0x74, 0xda, 0x02, 0x00, 0x43,
2180x40, 0x72, 0x72, 0x6f, 0x77, 0x55, 0x01, 0x01, 0xdd, 0x03, 2180x02, 0x10, 0x72, 0x9d, 0x0b, 0x00, 0x55, 0x01, 0x00, 0xdd,
2190x42, 0x77, 0x69, 0x73, 0x65, 0x65, 0x02, 0x00, 0x03, 0x04, 2190x03, 0x43, 0x77, 0x69, 0x73, 0x65, 0x78, 0x03, 0x00, 0xfb,
2200x01, 0x95, 0x00, 0x08, 0x0b, 0x09, 0x07, 0xc3, 0x01, 0x03, 2200x06, 0x01, 0x95, 0x00, 0x0a, 0x0b, 0x09, 0x05, 0xc3, 0x01,
2210x1c, 0x01, 0x03, 0x3b, 0x04, 0x31, 0x64, 0x69, 0x72, 0xc0, 2210x03, 0x1c, 0x01, 0x02, 0x3b, 0x04, 0x32, 0x64, 0x69, 0x72,
2220x07, 0x01, 0xc3, 0x03, 0x14, 0x28, 0x81, 0x0b, 0x11, 0x61, 2220xc0, 0x07, 0x00, 0xdb, 0x00, 0x14, 0x28, 0x81, 0x0b, 0x11,
2230x13, 0x00, 0x00, 0x68, 0x09, 0x52, 0x73, 0x63, 0x72, 0x69, 2230x61, 0x13, 0x00, 0x00, 0x68, 0x09, 0x52, 0x73, 0x63, 0x72,
2240x62, 0x5f, 0x01, 0x13, 0x73, 0xe9, 0x07, 0x30, 0x32, 0x2e, 2240x69, 0x62, 0x5f, 0x01, 0x13, 0x73, 0xe9, 0x07, 0x33, 0x32,
2250x31, 0xd0, 0x03, 0x02, 0x4d, 0x02, 0x05, 0x30, 0x09, 0x22, 2250x2e, 0x31, 0xca, 0x09, 0x35, 0x73, 0x6f, 0x00, 0x30, 0x09,
2260x2e, 0x29, 0xf1, 0x07, 0x15, 0x32, 0xf1, 0x07, 0xb2, 0x70, 2260x22, 0x2e, 0x29, 0xf1, 0x07, 0x15, 0x32, 0xf1, 0x07, 0xb2,
2270x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 2270x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73,
2280xbc, 0x05, 0x35, 0x73, 0x65, 0x00, 0x14, 0x00, 0x01, 0x0d, 2280x20, 0xbc, 0x05, 0x00, 0x7c, 0x03, 0x05, 0x14, 0x00, 0x02,
2290x0a, 0x06, 0x3e, 0x00, 0x01, 0x00, 0x0d, 0x08, 0x6f, 0x09, 2290x43, 0x00, 0x05, 0x6e, 0x09, 0x01, 0x07, 0x02, 0x07, 0x6f,
2300x70, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x71, 0x00, 2300x09, 0x71, 0x2e, 0x2e, 0x2e, 0x27, 0x00, 0x6f, 0x70, 0x71,
2310x04, 0x9b, 0x07, 0xb0, 0x60, 0x54, 0x79, 0x70, 0x65, 0x27, 2310x00, 0x03, 0x9b, 0x07, 0xb0, 0x60, 0x54, 0x79, 0x70, 0x65,
2320x00, 0x6d, 0x65, 0x6e, 0x75, 0xad, 0x00, 0x44, 0x4d, 0x6f, 2320x27, 0x00, 0x6d, 0x65, 0x6e, 0x75, 0xad, 0x00, 0x10, 0x4d,
2330x64, 0x65, 0x07, 0x00, 0x28, 0x6f, 0x66, 0x56, 0x09, 0x16, 2330xf1, 0x08, 0x03, 0x07, 0x00, 0x28, 0x6f, 0x66, 0x56, 0x09,
2340x28, 0x16, 0x09, 0x27, 0x6f, 0x72, 0x1e, 0x0b, 0x00, 0xa2, 2340x16, 0x28, 0x16, 0x09, 0x27, 0x6f, 0x72, 0x1e, 0x0b, 0x00,
2350x00, 0x91, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x28, 0x73, 0x2a, 2350xa2, 0x00, 0x94, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x28, 0x73,
2360x73, 0x0d, 0x00, 0x02, 0x67, 0x0d, 0x03, 0xb4, 0x02, 0x36, 2360x2a, 0x73, 0x0d, 0x00, 0x00, 0x3c, 0x00, 0x02, 0xb4, 0x02,
2370x00, 0x00, 0x44, 0x0f, 0x0a, 0x14, 0x00, 0x81, 0x01, 0x01, 2370x36, 0x00, 0x00, 0x44, 0x0f, 0x0a, 0x14, 0x00, 0x81, 0x01,
2380xac, 0x02, 0x07, 0x29, 0x0a, 0x05, 0x97, 0x0d, 0x83, 0x65, 2380x02, 0xac, 0x02, 0x07, 0x29, 0x0a, 0x04, 0x97, 0x0d, 0x50,
2390x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x76, 0x00, 0x10, 2390x65, 0x6e, 0x65, 0x72, 0x61, 0x0c, 0x09, 0x02, 0x76, 0x00,
2400x2e, 0xa8, 0x09, 0x03, 0x59, 0x0a, 0x02, 0x4d, 0x0a, 0x0f, 2400x10, 0x2e, 0xa8, 0x09, 0x03, 0x59, 0x0a, 0x02, 0x4d, 0x0a,
2410x1d, 0x0a, 0x0e, 0x0f, 0x0b, 0x0a, 0x1b, 0x01, 0x61, 0x00, 2410x0f, 0x1d, 0x0a, 0x0e, 0x0f, 0x0b, 0x0a, 0x1d, 0x50, 0x41,
2420x20, 0x52, 0x65, 0xc5, 0x01, 0x34, 0x69, 0x76, 0x65, 0xb0, 2420x74, 0x00, 0x52, 0x65, 0xc5, 0x01, 0x34, 0x69, 0x76, 0x65,
2430x0a, 0x01, 0x59, 0x0d, 0x0f, 0xb5, 0x0a, 0x1b, 0x81, 0x00, 2430xb0, 0x0a, 0x01, 0x59, 0x0d, 0x0f, 0xb5, 0x0a, 0x1b, 0x82,
2440x62, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0xc1, 0x02, 0x04, 2440x00, 0x62, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0xc1, 0x02,
2450x12, 0x08, 0x07, 0x47, 0x04, 0x21, 0x62, 0x75, 0x71, 0x0a, 2450x04, 0x12, 0x08, 0x06, 0x47, 0x04, 0x00, 0x29, 0x04, 0x01,
2460x00, 0x8c, 0x00, 0x11, 0x75, 0x80, 0x01, 0x93, 0x73, 0x68, 2460x11, 0x03, 0x31, 0x6f, 0x6c, 0x75, 0x80, 0x01, 0x93, 0x73,
2470x6f, 0x75, 0x6c, 0x64, 0x00, 0x73, 0x74, 0x2b, 0x00, 0xa2, 2470x68, 0x6f, 0x75, 0x6c, 0x64, 0x00, 0x73, 0x74, 0x2b, 0x00,
2480x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x2e, 0x00, 0x54, 0x68, 2480x71, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x2e, 0x8f, 0x07,
2490x87, 0x00, 0x01, 0x1c, 0x0d, 0x04, 0x81, 0x0e, 0x03, 0x49, 2490x02, 0x89, 0x0c, 0x00, 0x1f, 0x02, 0x04, 0x81, 0x0e, 0x03,
2500x00, 0x01, 0xfe, 0x08, 0x31, 0x72, 0x65, 0x61, 0x66, 0x06, 2500x49, 0x00, 0x00, 0xfe, 0x08, 0x31, 0x72, 0x65, 0x61, 0x66,
2510x00, 0xef, 0x0e, 0x60, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x00, 2510x06, 0x00, 0xef, 0x0e, 0x60, 0x6d, 0x70, 0x6c, 0x65, 0x78,
2520x12, 0x00, 0x21, 0x6f, 0x6e, 0x73, 0x03, 0x00, 0x3c, 0x02, 2520x00, 0x12, 0x00, 0x21, 0x6f, 0x6e, 0x73, 0x03, 0x00, 0x3c,
2530x30, 0x6f, 0x69, 0x64, 0x59, 0x08, 0x31, 0x69, 0x6e, 0x67, 2530x02, 0x30, 0x6f, 0x69, 0x64, 0x59, 0x08, 0x03, 0x10, 0x00,
2540x44, 0x07, 0xa0, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 2540xb0, 0x62, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x6b,
2550x6b, 0x2e, 0x00, 2550x2e, 0x00,
256}; 256};
257 257
258const unsigned short help_text_len = 3934; 258const unsigned short help_text_len = 3934;
diff --git a/apps/plugins/puzzles/help/unruly.c b/apps/plugins/puzzles/help/unruly.c
index 19c1815991..55c4d5240f 100644
--- a/apps/plugins/puzzles/help/unruly.c
+++ b/apps/plugins/puzzles/help/unruly.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
@@ -15,7 +15,7 @@ struct style_text help_text_style[] = {
15 LAST_STYLE_ITEM 15 LAST_STYLE_ITEM
16}; 16};
17 17
18/* orig 1688 comp 1225 ratio 0.725711 level 11 saved 463 */ 18/* orig 1688 comp 1225 ratio 0.725711 level 10 saved 463 */
19const char help_text[] = { 19const char help_text[] = {
200xf0, 0x4d, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20, 200xf0, 0x4d, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x20,
210x33, 0x38, 0x3a, 0x20, 0x55, 0x6e, 0x72, 0x75, 0x6c, 0x79, 210x33, 0x38, 0x3a, 0x20, 0x55, 0x6e, 0x72, 0x75, 0x6c, 0x79,
@@ -36,13 +36,13 @@ const char help_text[] = {
360x6c, 0x00, 0x69, 0x6e, 0x2e, 0x00, 0x45, 0x61, 0x63, 0x68, 360x6c, 0x00, 0x69, 0x6e, 0x2e, 0x00, 0x45, 0x61, 0x63, 0x68,
370x00, 0x72, 0x6f, 0x77, 0x00, 0x61, 0x6e, 0x64, 0x75, 0x00, 370x00, 0x72, 0x6f, 0x77, 0x00, 0x61, 0x6e, 0x64, 0x75, 0x00,
380x34, 0x75, 0x6d, 0x6e, 0x81, 0x00, 0x51, 0x6e, 0x74, 0x61, 380x34, 0x75, 0x6d, 0x6e, 0x81, 0x00, 0x51, 0x6e, 0x74, 0x61,
390x69, 0x6e, 0x47, 0x00, 0xe2, 0x73, 0x61, 0x6d, 0x65, 0x00, 390x69, 0x6e, 0x47, 0x00, 0xb0, 0x73, 0x61, 0x6d, 0x65, 0x00,
400x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x00, 0x6f, 0x66, 0x8e, 400x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0xb4, 0x00, 0x02, 0x8e,
410x00, 0x00, 0x31, 0x00, 0x02, 0x8f, 0x00, 0x05, 0xc4, 0x00, 410x00, 0x00, 0x31, 0x00, 0x01, 0x8f, 0x00, 0x06, 0xc4, 0x00,
420x01, 0x13, 0x00, 0x21, 0x6e, 0x6f, 0x4f, 0x00, 0x25, 0x6f, 420x00, 0x13, 0x00, 0x21, 0x6e, 0x6f, 0x4f, 0x00, 0x25, 0x6f,
430x72, 0x4e, 0x00, 0x27, 0x61, 0x79, 0x4d, 0x00, 0x30, 0x72, 430x72, 0x4e, 0x00, 0x27, 0x61, 0x79, 0x4d, 0x00, 0x30, 0x72,
440x65, 0x65, 0x0e, 0x00, 0x76, 0x73, 0x65, 0x63, 0x75, 0x74, 440x65, 0x65, 0x0e, 0x00, 0x76, 0x73, 0x65, 0x63, 0x75, 0x74,
450x69, 0x76, 0xc5, 0x00, 0x25, 0x6f, 0x66, 0x6a, 0x00, 0x03, 450x69, 0x76, 0xc5, 0x00, 0x26, 0x6f, 0x66, 0x6a, 0x00, 0x02,
460xfc, 0x00, 0xf1, 0x2d, 0x2e, 0x00, 0x00, 0x00, 0x54, 0x68, 460xfc, 0x00, 0xf1, 0x2d, 0x2e, 0x00, 0x00, 0x00, 0x54, 0x68,
470x69, 0x73, 0x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x00, 470x69, 0x73, 0x00, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x00,
480x74, 0x79, 0x70, 0x65, 0x00, 0x77, 0x61, 0x73, 0x00, 0x69, 480x74, 0x79, 0x70, 0x65, 0x00, 0x77, 0x61, 0x73, 0x00, 0x69,
@@ -54,9 +54,9 @@ const char help_text[] = {
540x00, 0x56, 0x6f, 0x68, 0x75, 0x27, 0x2e, 0x00, 0x53, 0x65, 540x00, 0x56, 0x6f, 0x68, 0x75, 0x27, 0x2e, 0x00, 0x53, 0x65,
550x65, 0x00, 0x5b, 0x32, 0x31, 0x5d, 0x0d, 0x01, 0xc0, 0x6d, 550x65, 0x00, 0x5b, 0x32, 0x31, 0x5d, 0x0d, 0x01, 0xc0, 0x6d,
560x6f, 0x72, 0x65, 0x00, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 560x6f, 0x72, 0x65, 0x00, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c,
570x73, 0x6f, 0x00, 0x02, 0xaf, 0x01, 0x00, 0x65, 0x00, 0x01, 570x73, 0x6f, 0x00, 0x02, 0xaf, 0x01, 0x01, 0x65, 0x00, 0x00,
580xb2, 0x00, 0x70, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 580xb2, 0x00, 0x40, 0x72, 0x69, 0x62, 0x75, 0x68, 0x00, 0x60,
590x30, 0x01, 0x40, 0x74, 0x68, 0x69, 0x73, 0x98, 0x00, 0x70, 590x74, 0x6f, 0x00, 0x74, 0x68, 0x69, 0x14, 0x00, 0x80, 0x6c,
600x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x7b, 0x00, 0xe0, 600x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x7b, 0x00, 0xe0,
610x4c, 0x65, 0x6e, 0x6e, 0x61, 0x72, 0x64, 0x00, 0x53, 0x70, 610x4c, 0x65, 0x6e, 0x6e, 0x61, 0x72, 0x64, 0x00, 0x53, 0x70,
620x72, 0x6f, 0x6e, 0x67, 0x3f, 0x00, 0x01, 0x58, 0x00, 0xf0, 620x72, 0x6f, 0x6e, 0x67, 0x3f, 0x00, 0x01, 0x58, 0x00, 0xf0,
@@ -68,66 +68,66 @@ const char help_text[] = {
680x00, 0x00, 0x00, 0x33, 0x38, 0x2e, 0x31, 0x2d, 0x02, 0x01, 680x00, 0x00, 0x00, 0x33, 0x38, 0x2e, 0x31, 0x2d, 0x02, 0x01,
690x7a, 0x00, 0x40, 0x6f, 0x6c, 0x73, 0x20, 0x00, 0x01, 0x63, 690x7a, 0x00, 0x40, 0x6f, 0x6c, 0x73, 0x20, 0x00, 0x01, 0x63,
700x6f, 0x00, 0x70, 0x6c, 0x61, 0x79, 0x99, 0x00, 0x71, 0x2c, 700x6f, 0x00, 0x70, 0x6c, 0x61, 0x79, 0x99, 0x00, 0x71, 0x2c,
710x00, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0xdd, 0x00, 0xa3, 0x6d, 710x00, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0xdd, 0x00, 0x70, 0x6d,
720x6f, 0x75, 0x73, 0x65, 0x00, 0x69, 0x6e, 0x00, 0x61, 0x43, 720x6f, 0x75, 0x73, 0x65, 0x00, 0x69, 0x4b, 0x02, 0x02, 0x43,
730x01, 0x00, 0xa6, 0x00, 0xa5, 0x63, 0x68, 0x61, 0x6e, 0x67, 730x01, 0x00, 0xa6, 0x00, 0xa5, 0x63, 0x68, 0x61, 0x6e, 0x67,
740x65, 0x00, 0x69, 0x74, 0x73, 0x44, 0x01, 0x51, 0x4c, 0x65, 740x65, 0x00, 0x69, 0x74, 0x73, 0x44, 0x01, 0x51, 0x4c, 0x65,
750x66, 0x74, 0x2d, 0x37, 0x00, 0xc4, 0x69, 0x6e, 0x67, 0x00, 750x66, 0x74, 0x2d, 0x37, 0x00, 0xc4, 0x69, 0x6e, 0x67, 0x00,
760x61, 0x6e, 0x00, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x34, 0x00, 760x61, 0x6e, 0x00, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x34, 0x00,
770x10, 0x77, 0x07, 0x02, 0x72, 0x74, 0x75, 0x72, 0x6e, 0x00, 770x10, 0x77, 0x07, 0x02, 0x72, 0x74, 0x75, 0x72, 0x6e, 0x00,
780x69, 0x74, 0xd7, 0x01, 0x02, 0xc5, 0x01, 0x46, 0x72, 0x69, 780x69, 0x74, 0xd7, 0x01, 0x02, 0xc5, 0x01, 0x47, 0x72, 0x69,
790x67, 0x68, 0x37, 0x00, 0x09, 0x27, 0x00, 0x04, 0x83, 0x02, 790x67, 0x68, 0x37, 0x00, 0x09, 0x27, 0x00, 0x03, 0x83, 0x02,
800x54, 0x4b, 0x65, 0x65, 0x70, 0x00, 0x22, 0x00, 0x06, 0xbc, 800x55, 0x4b, 0x65, 0x65, 0x70, 0x00, 0x22, 0x00, 0x05, 0xbc,
810x01, 0x61, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x8d, 0x00, 810x01, 0x61, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x8d, 0x00,
820x40, 0x79, 0x63, 0x6c, 0x65, 0xf2, 0x01, 0x40, 0x6f, 0x75, 820x40, 0x79, 0x63, 0x6c, 0x65, 0xf2, 0x01, 0x41, 0x6f, 0x75,
830x67, 0x68, 0x21, 0x00, 0x03, 0xfe, 0x01, 0xf1, 0x00, 0x70, 830x67, 0x68, 0x21, 0x00, 0x02, 0xfe, 0x01, 0xf1, 0x00, 0x70,
840x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x00, 0x73, 0x74, 840x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x00, 0x73, 0x74,
850x61, 0x74, 0x65, 0x73, 0x89, 0x01, 0x24, 0x74, 0x68, 0x0a, 850x61, 0x74, 0x65, 0x73, 0x89, 0x01, 0x24, 0x74, 0x68, 0x0a,
860x02, 0x42, 0x2e, 0x00, 0x49, 0x66, 0x06, 0x03, 0x52, 0x69, 860x02, 0x42, 0x2e, 0x00, 0x49, 0x66, 0x06, 0x03, 0x52, 0x69,
870x64, 0x64, 0x6c, 0x65, 0x84, 0x00, 0x09, 0xe8, 0x00, 0x22, 870x64, 0x64, 0x6c, 0x65, 0x84, 0x00, 0x09, 0xe8, 0x00, 0x22,
880x69, 0x74, 0x90, 0x00, 0x11, 0x62, 0xdf, 0x02, 0x52, 0x65, 880x69, 0x74, 0x90, 0x00, 0x11, 0x62, 0xdf, 0x02, 0x20, 0x65,
890x74, 0x00, 0x74, 0x6f, 0xd5, 0x00, 0x13, 0x2e, 0x67, 0x03, 890x74, 0x6c, 0x00, 0x01, 0xd5, 0x00, 0x13, 0x2e, 0x67, 0x03,
900xc1, 0x63, 0x61, 0x6e, 0x00, 0x61, 0x6c, 0x73, 0x6f, 0x00, 900x90, 0x63, 0x61, 0x6e, 0x00, 0x61, 0x6c, 0x73, 0x6f, 0x00,
910x75, 0x73, 0x65, 0x5a, 0x00, 0xb0, 0x63, 0x75, 0x72, 0x73, 910x22, 0x01, 0x00, 0x5a, 0x00, 0xb0, 0x63, 0x75, 0x72, 0x73,
920x6f, 0x72, 0x00, 0x6b, 0x65, 0x79, 0x73, 0x2d, 0x00, 0xb0, 920x6f, 0x72, 0x00, 0x6b, 0x65, 0x79, 0x73, 0x2d, 0x00, 0xb1,
930x6d, 0x6f, 0x76, 0x65, 0x00, 0x61, 0x72, 0x6f, 0x75, 0x6e, 930x6d, 0x6f, 0x76, 0x65, 0x00, 0x61, 0x72, 0x6f, 0x75, 0x6e,
940x64, 0x1f, 0x00, 0x01, 0x8b, 0x03, 0x74, 0x2e, 0x00, 0x50, 940x64, 0x1f, 0x00, 0x00, 0x8b, 0x03, 0x74, 0x2e, 0x00, 0x50,
950x72, 0x65, 0x73, 0x73, 0xcb, 0x00, 0x20, 0x72, 0x65, 0xee, 950x72, 0x65, 0x73, 0x73, 0xcb, 0x00, 0x21, 0x72, 0x65, 0xee,
960x00, 0x00, 0xc5, 0x02, 0x51, 0x73, 0x70, 0x61, 0x63, 0x65, 960x00, 0x82, 0x6f, 0x72, 0x00, 0x73, 0x70, 0x61, 0x63, 0x65,
970x3b, 0x00, 0x06, 0x06, 0x01, 0x0c, 0x47, 0x01, 0x0a, 0x9f, 970x3b, 0x00, 0x06, 0x06, 0x01, 0x0c, 0x47, 0x01, 0x0a, 0x9f,
980x03, 0x01, 0x97, 0x00, 0x30, 0x70, 0x65, 0x63, 0xdf, 0x02, 980x03, 0x00, 0x97, 0x00, 0x30, 0x70, 0x65, 0x63, 0xdf, 0x02,
990x52, 0x6c, 0x79, 0x00, 0x28, 0x61, 0x67, 0x00, 0x15, 0x6e, 990x52, 0x6c, 0x79, 0x00, 0x28, 0x61, 0x67, 0x00, 0x15, 0x6e,
1000x11, 0x01, 0x04, 0xe1, 0x02, 0x28, 0x73, 0x00, 0x5f, 0x03, 1000x11, 0x01, 0x04, 0xe1, 0x02, 0x28, 0x73, 0x00, 0x5f, 0x03,
1010x65, 0x77, 0x61, 0x79, 0x00, 0x61, 0x73, 0xdc, 0x01, 0x04, 1010x30, 0x77, 0x61, 0x79, 0xbd, 0x03, 0x06, 0xdc, 0x01, 0x02,
1020x4a, 0x01, 0x22, 0x73, 0x29, 0x92, 0x01, 0x14, 0x70, 0x9f, 1020x4a, 0x01, 0x22, 0x73, 0x29, 0x92, 0x01, 0x14, 0x70, 0x9f,
1030x00, 0x40, 0x42, 0x61, 0x63, 0x6b, 0x95, 0x00, 0x02, 0xbd, 1030x00, 0x42, 0x42, 0x61, 0x63, 0x6b, 0x95, 0x00, 0x01, 0x90,
1040x01, 0x02, 0x03, 0x01, 0x05, 0x1d, 0x01, 0x09, 0x0c, 0x01, 1040x00, 0x02, 0x03, 0x01, 0x08, 0x05, 0x02, 0x05, 0x0c, 0x01,
1050x41, 0x28, 0x41, 0x6c, 0x6c, 0x50, 0x00, 0x11, 0x61, 0xb4, 1050x41, 0x28, 0x41, 0x6c, 0x6c, 0x50, 0x00, 0x11, 0x61, 0xb4,
1060x02, 0xb0, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 1060x02, 0xb0, 0x73, 0x00, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
1070x62, 0x65, 0x64, 0x79, 0x00, 0x13, 0x73, 0xca, 0x02, 0x30, 1070x62, 0x65, 0x64, 0x79, 0x00, 0x13, 0x73, 0xca, 0x02, 0x31,
1080x32, 0x2e, 0x31, 0x22, 0x04, 0x02, 0x32, 0x01, 0xb2, 0x61, 1080x32, 0x2e, 0x31, 0x22, 0x04, 0x01, 0x32, 0x01, 0xb2, 0x61,
1090x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x29, 1090x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x29,
1100x96, 0x02, 0x14, 0x32, 0x96, 0x02, 0x92, 0x70, 0x61, 0x72, 1100x96, 0x02, 0x14, 0x32, 0x96, 0x02, 0x92, 0x70, 0x61, 0x72,
1110x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x98, 0x02, 0x55, 0x68, 1110x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x98, 0x02, 0x56, 0x68,
1120x65, 0x73, 0x65, 0x00, 0x14, 0x00, 0x01, 0x84, 0x04, 0x06, 1120x65, 0x73, 0x65, 0x00, 0x14, 0x00, 0x02, 0x42, 0x00, 0x04,
1130x3d, 0x00, 0x51, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x7a, 0x00, 1130x3d, 0x00, 0x51, 0x00, 0x66, 0x72, 0x6f, 0x6d, 0x7a, 0x00,
1140xe1, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e, 1140xe1, 0x60, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x2e,
1150x2e, 0x27, 0x00, 0x6f, 0x70, 0x70, 0x00, 0x22, 0x6f, 0x6e, 1150x2e, 0x27, 0x00, 0x6f, 0x70, 0x70, 0x00, 0x22, 0x6f, 0x6e,
1160x1a, 0x00, 0xa0, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d, 1160x1a, 0x00, 0xa0, 0x54, 0x79, 0x70, 0x65, 0x27, 0x00, 0x6d,
1170x65, 0x6e, 0x75, 0xac, 0x00, 0x90, 0x57, 0x69, 0x64, 0x74, 1170x65, 0x6e, 0x75, 0xac, 0x00, 0x90, 0x57, 0x69, 0x64, 0x74,
1180x68, 0x2c, 0x00, 0x48, 0x65, 0x79, 0x02, 0xa2, 0x00, 0x00, 1180x68, 0x2c, 0x00, 0x48, 0x65, 0x79, 0x02, 0x70, 0x00, 0x00,
1190x00, 0x53, 0x69, 0x7a, 0x65, 0x00, 0x6f, 0x66, 0x27, 0x05, 1190x00, 0x53, 0x69, 0x7a, 0x65, 0x14, 0x04, 0x01, 0x27, 0x05,
1200x24, 0x69, 0x6e, 0x27, 0x04, 0x60, 0x2e, 0x00, 0x28, 0x4e, 1200x24, 0x69, 0x6e, 0x27, 0x04, 0x60, 0x2e, 0x00, 0x28, 0x4e,
1210x6f, 0x74, 0x45, 0x01, 0x22, 0x61, 0x74, 0xa9, 0x01, 0x26, 1210x6f, 0x74, 0x45, 0x01, 0x22, 0x61, 0x74, 0xa9, 0x01, 0x26,
1220x75, 0x6c, 0x3d, 0x04, 0x30, 0x67, 0x61, 0x6d, 0x7d, 0x01, 1220x75, 0x6c, 0x3d, 0x04, 0x30, 0x67, 0x61, 0x6d, 0x7d, 0x01,
1230x30, 0x71, 0x75, 0x69, 0x94, 0x01, 0x22, 0x6f, 0x74, 0x76, 1230x30, 0x71, 0x75, 0x69, 0x94, 0x01, 0x22, 0x6f, 0x74, 0x76,
1240x02, 0x10, 0x77, 0x5b, 0x00, 0x01, 0x44, 0x01, 0x12, 0x68, 1240x02, 0x10, 0x77, 0x5b, 0x00, 0x01, 0x44, 0x01, 0x12, 0x68,
1250x5e, 0x00, 0x20, 0x74, 0x6f, 0x3c, 0x02, 0x43, 0x65, 0x76, 1250x5e, 0x00, 0x20, 0x74, 0x6f, 0x3c, 0x02, 0x10, 0x65, 0x88,
1260x65, 0x6e, 0xd4, 0x04, 0x11, 0x73, 0xee, 0x00, 0xe2, 0x44, 1260x05, 0x02, 0xd4, 0x04, 0x11, 0x73, 0xee, 0x00, 0xe3, 0x44,
1270x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x00, 1270x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x00,
1280x00, 0x00, 0x43, 0x85, 0x03, 0x02, 0x90, 0x01, 0x15, 0x64, 1280x00, 0x00, 0x43, 0x85, 0x03, 0x01, 0x42, 0x00, 0x16, 0x64,
1290x1a, 0x00, 0x05, 0x6a, 0x00, 0x83, 0x65, 0x6e, 0x65, 0x72, 1290x1a, 0x00, 0x04, 0x6a, 0x00, 0x50, 0x65, 0x6e, 0x65, 0x72,
1300x61, 0x74, 0x65, 0x64, 0x9d, 0x04, 0x02, 0x3d, 0x04, 0xe2, 1300x61, 0x1c, 0x04, 0x02, 0x9d, 0x04, 0x02, 0x3d, 0x04, 0xe2,
1310x69, 0x71, 0x75, 0x65, 0x20, 0x72, 0x6f, 0x77, 0x73, 0x20, 1310x69, 0x71, 0x75, 0x65, 0x20, 0x72, 0x6f, 0x77, 0x73, 0x20,
1320x61, 0x6e, 0x64, 0x20, 0xff, 0x04, 0x30, 0x73, 0x00, 0x00, 1320x61, 0x6e, 0x64, 0x20, 0xff, 0x04, 0x30, 0x73, 0x00, 0x00,
1330xd2, 0x02, 0x20, 0x65, 0x6e, 0x19, 0x01, 0x20, 0x64, 0x2c, 1330xd2, 0x02, 0x20, 0x65, 0x6e, 0x19, 0x01, 0x20, 0x64, 0x2c,
diff --git a/apps/plugins/puzzles/help/untangle.c b/apps/plugins/puzzles/help/untangle.c
index 193629778f..24f9d83986 100644
--- a/apps/plugins/puzzles/help/untangle.c
+++ b/apps/plugins/puzzles/help/untangle.c
@@ -1,4 +1,4 @@
1/* auto-generated on Apr 24 2018 by genhelp.sh */ 1/* auto-generated on Dec 21 2018 by genhelp.sh */
2/* help text is compressed using LZ4; see compress.c for details */ 2/* help text is compressed using LZ4; see compress.c for details */
3/* DO NOT EDIT! */ 3/* DO NOT EDIT! */
4 4
diff --git a/apps/plugins/puzzles/rockbox.c b/apps/plugins/puzzles/rockbox.c
index 231df5ab48..8a25038255 100644
--- a/apps/plugins/puzzles/rockbox.c
+++ b/apps/plugins/puzzles/rockbox.c
@@ -1661,7 +1661,7 @@ static int process_input(int tmo, bool do_pausemenu)
1661 int new_x = mouse_x, new_y = mouse_y; 1661 int new_x = mouse_x, new_y = mouse_y;
1662 1662
1663 /* in src/misc.c */ 1663 /* in src/misc.c */
1664 move_cursor(state, &new_x, &new_y, LCD_WIDTH, LCD_HEIGHT, FALSE); 1664 move_cursor(state, &new_x, &new_y, LCD_WIDTH, LCD_HEIGHT, false);
1665 1665
1666 int dx = new_x - mouse_x, dy = new_y - mouse_y; 1666 int dx = new_x - mouse_x, dy = new_y - mouse_y;
1667 1667
@@ -1902,7 +1902,7 @@ static void zoom(void)
1902 zoom_clipl = 0; 1902 zoom_clipl = 0;
1903 zoom_clipr = zoom_w; 1903 zoom_clipr = zoom_w;
1904 1904
1905 midend_size(me, &zoom_w, &zoom_h, TRUE); 1905 midend_size(me, &zoom_w, &zoom_h, true);
1906 1906
1907 /* Allocating the framebuffer will mostly likely grab the 1907 /* Allocating the framebuffer will mostly likely grab the
1908 * audiobuffer, which will make impossible to load new fonts, and 1908 * audiobuffer, which will make impossible to load new fonts, and
@@ -2828,7 +2828,7 @@ static void fix_size(void)
2828 rb->lcd_setfont(cur_font = FONT_UI); 2828 rb->lcd_setfont(cur_font = FONT_UI);
2829 rb->lcd_getstringsize("X", NULL, &h_x); 2829 rb->lcd_getstringsize("X", NULL, &h_x);
2830 h -= h_x; 2830 h -= h_x;
2831 midend_size(me, &w, &h, TRUE); 2831 midend_size(me, &w, &h, true);
2832} 2832}
2833 2833
2834static void init_tlsf(void) 2834static void init_tlsf(void)
diff --git a/apps/plugins/puzzles/src/Buildscr b/apps/plugins/puzzles/src/Buildscr
index b2a4dd58db..21a3bdf30c 100644
--- a/apps/plugins/puzzles/src/Buildscr
+++ b/apps/plugins/puzzles/src/Buildscr
@@ -34,7 +34,7 @@ ifneq "$(NOICONS)" yes then
34 in puzzles do make -j$(nproc) 34 in puzzles do make -j$(nproc)
35 35
36 # Now build the screenshots and icons. 36 # Now build the screenshots and icons.
37 in puzzles/icons do xvfb-run -s "-screen 0 1024x768x24" make web winicons gtkicons -j$(nproc) 37 in puzzles/icons do make web winicons gtkicons -j$(nproc)
38 38
39 # Destroy the local binaries and autoconf detritus, mostly to avoid 39 # Destroy the local binaries and autoconf detritus, mostly to avoid
40 # wasting network bandwidth by transferring them to the delegate 40 # wasting network bandwidth by transferring them to the delegate
diff --git a/apps/plugins/puzzles/src/blackbox.c b/apps/plugins/puzzles/src/blackbox.c
index caaa9eb963..c52c50812d 100644
--- a/apps/plugins/puzzles/src/blackbox.c
+++ b/apps/plugins/puzzles/src/blackbox.c
@@ -59,13 +59,13 @@ static const game_params blackbox_presets[] = {
59 { 10, 10, 4, 10 } 59 { 10, 10, 4, 10 }
60}; 60};
61 61
62static int game_fetch_preset(int i, char **name, game_params **params) 62static bool game_fetch_preset(int i, char **name, game_params **params)
63{ 63{
64 char str[80]; 64 char str[80];
65 game_params *ret; 65 game_params *ret;
66 66
67 if (i < 0 || i >= lenof(blackbox_presets)) 67 if (i < 0 || i >= lenof(blackbox_presets))
68 return FALSE; 68 return false;
69 69
70 ret = snew(game_params); 70 ret = snew(game_params);
71 *ret = blackbox_presets[i]; 71 *ret = blackbox_presets[i];
@@ -79,7 +79,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
79 79
80 *name = dupstr(str); 80 *name = dupstr(str);
81 *params = ret; 81 *params = ret;
82 return TRUE; 82 return true;
83} 83}
84 84
85static void free_params(game_params *params) 85static void free_params(game_params *params)
@@ -129,7 +129,7 @@ static void decode_params(game_params *params, char const *string)
129 } 129 }
130} 130}
131 131
132static char *encode_params(const game_params *params, int full) 132static char *encode_params(const game_params *params, bool full)
133{ 133{
134 char str[256]; 134 char str[256];
135 135
@@ -184,7 +184,7 @@ static game_params *custom_params(const config_item *cfg)
184 return ret; 184 return ret;
185} 185}
186 186
187static const char *validate_params(const game_params *params, int full) 187static const char *validate_params(const game_params *params, bool full)
188{ 188{
189 if (params->w < 2 || params->h < 2) 189 if (params->w < 2 || params->h < 2)
190 return "Width and height must both be at least two"; 190 return "Width and height must both be at least two";
@@ -209,7 +209,7 @@ static const char *validate_params(const game_params *params, int full)
209 */ 209 */
210 210
211static char *new_game_desc(const game_params *params, random_state *rs, 211static char *new_game_desc(const game_params *params, random_state *rs,
212 char **aux, int interactive) 212 char **aux, bool interactive)
213{ 213{
214 int nballs = params->minballs, i; 214 int nballs = params->minballs, i;
215 char *grid, *ret; 215 char *grid, *ret;
@@ -242,7 +242,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
242 } 242 }
243 sfree(grid); 243 sfree(grid);
244 244
245 obfuscate_bitmap(bmp, (nballs*2 + 2) * 8, FALSE); 245 obfuscate_bitmap(bmp, (nballs*2 + 2) * 8, false);
246 ret = bin2hex(bmp, nballs*2 + 2); 246 ret = bin2hex(bmp, nballs*2 + 2);
247 sfree(bmp); 247 sfree(bmp);
248 248
@@ -263,7 +263,7 @@ static const char *validate_desc(const game_params *params, const char *desc)
263 return "Game description is wrong length"; 263 return "Game description is wrong length";
264 264
265 bmp = hex2bin(desc, nballs*2 + 2); 265 bmp = hex2bin(desc, nballs*2 + 2);
266 obfuscate_bitmap(bmp, (nballs*2 + 2) * 8, TRUE); 266 obfuscate_bitmap(bmp, (nballs*2 + 2) * 8, true);
267 ret = "Game description is corrupted"; 267 ret = "Game description is corrupted";
268 /* check general grid size */ 268 /* check general grid size */
269 if (bmp[0] != params->w || bmp[1] != params->h) 269 if (bmp[0] != params->w || bmp[1] != params->h)
@@ -299,9 +299,10 @@ struct game_state {
299 int w, h, minballs, maxballs, nballs, nlasers; 299 int w, h, minballs, maxballs, nballs, nlasers;
300 unsigned int *grid; /* (w+2)x(h+2), to allow for laser firing range */ 300 unsigned int *grid; /* (w+2)x(h+2), to allow for laser firing range */
301 unsigned int *exits; /* one per laser */ 301 unsigned int *exits; /* one per laser */
302 int done; /* user has finished placing his own balls. */ 302 bool done; /* user has finished placing his own balls. */
303 int laserno; /* number of next laser to be fired. */ 303 int laserno; /* number of next laser to be fired. */
304 int nguesses, reveal, justwrong, nright, nwrong, nmissed; 304 int nguesses, nright, nwrong, nmissed;
305 bool reveal, justwrong;
305}; 306};
306 307
307#define GRID(s,x,y) ((s)->grid[(y)*((s)->w+2) + (x)]) 308#define GRID(s,x,y) ((s)->grid[(y)*((s)->w+2) + (x)])
@@ -326,18 +327,18 @@ static const char *dirstrs[] = {
326}; 327};
327#endif 328#endif
328 329
329static int range2grid(const game_state *state, int rangeno, int *x, int *y, 330static bool range2grid(const game_state *state, int rangeno, int *x, int *y,
330 int *direction) 331 int *direction)
331{ 332{
332 if (rangeno < 0) 333 if (rangeno < 0)
333 return 0; 334 return false;
334 335
335 if (rangeno < state->w) { 336 if (rangeno < state->w) {
336 /* top row; from (1,0) to (w,0) */ 337 /* top row; from (1,0) to (w,0) */
337 *x = rangeno + 1; 338 *x = rangeno + 1;
338 *y = 0; 339 *y = 0;
339 *direction = DIR_DOWN; 340 *direction = DIR_DOWN;
340 return 1; 341 return true;
341 } 342 }
342 rangeno -= state->w; 343 rangeno -= state->w;
343 if (rangeno < state->h) { 344 if (rangeno < state->h) {
@@ -345,7 +346,7 @@ static int range2grid(const game_state *state, int rangeno, int *x, int *y,
345 *x = state->w+1; 346 *x = state->w+1;
346 *y = rangeno + 1; 347 *y = rangeno + 1;
347 *direction = DIR_LEFT; 348 *direction = DIR_LEFT;
348 return 1; 349 return true;
349 } 350 }
350 rangeno -= state->h; 351 rangeno -= state->h;
351 if (rangeno < state->w) { 352 if (rangeno < state->w) {
@@ -353,7 +354,7 @@ static int range2grid(const game_state *state, int rangeno, int *x, int *y,
353 *x = (state->w - rangeno); 354 *x = (state->w - rangeno);
354 *y = state->h+1; 355 *y = state->h+1;
355 *direction = DIR_UP; 356 *direction = DIR_UP;
356 return 1; 357 return true;
357 } 358 }
358 rangeno -= state->w; 359 rangeno -= state->w;
359 if (rangeno < state->h) { 360 if (rangeno < state->h) {
@@ -361,20 +362,20 @@ static int range2grid(const game_state *state, int rangeno, int *x, int *y,
361 *x = 0; 362 *x = 0;
362 *y = (state->h - rangeno); 363 *y = (state->h - rangeno);
363 *direction = DIR_RIGHT; 364 *direction = DIR_RIGHT;
364 return 1; 365 return true;
365 } 366 }
366 return 0; 367 return false;
367} 368}
368 369
369static int grid2range(const game_state *state, int x, int y, int *rangeno) 370static bool grid2range(const game_state *state, int x, int y, int *rangeno)
370{ 371{
371 int ret, x1 = state->w+1, y1 = state->h+1; 372 int ret, x1 = state->w+1, y1 = state->h+1;
372 373
373 if (x > 0 && x < x1 && y > 0 && y < y1) return 0; /* in arena */ 374 if (x > 0 && x < x1 && y > 0 && y < y1) return false; /* in arena */
374 if (x < 0 || x > x1 || y < 0 || y > y1) return 0; /* outside grid */ 375 if (x < 0 || x > x1 || y < 0 || y > y1) return false; /* outside grid */
375 376
376 if ((x == 0 || x == x1) && (y == 0 || y == y1)) 377 if ((x == 0 || x == x1) && (y == 0 || y == y1))
377 return 0; /* one of 4 corners */ 378 return false; /* one of 4 corners */
378 379
379 if (y == 0) { /* top line */ 380 if (y == 0) { /* top line */
380 ret = x - 1; 381 ret = x - 1;
@@ -387,7 +388,7 @@ static int grid2range(const game_state *state, int x, int y, int *rangeno)
387 } 388 }
388 *rangeno = ret; 389 *rangeno = ret;
389 debug(("grid2range: (%d,%d) rangeno = %d\n", x, y, ret)); 390 debug(("grid2range: (%d,%d) rangeno = %d\n", x, y, ret));
390 return 1; 391 return true;
391} 392}
392 393
393static game_state *new_game(midend *me, const game_params *params, 394static game_state *new_game(midend *me, const game_params *params,
@@ -402,7 +403,7 @@ static game_state *new_game(midend *me, const game_params *params,
402 state->nballs = ((dlen/2)-2)/2; 403 state->nballs = ((dlen/2)-2)/2;
403 404
404 bmp = hex2bin(desc, state->nballs*2 + 2); 405 bmp = hex2bin(desc, state->nballs*2 + 2);
405 obfuscate_bitmap(bmp, (state->nballs*2 + 2) * 8, TRUE); 406 obfuscate_bitmap(bmp, (state->nballs*2 + 2) * 8, true);
406 407
407 state->w = bmp[0]; state->h = bmp[1]; 408 state->w = bmp[0]; state->h = bmp[1];
408 state->nlasers = 2 * (state->w + state->h); 409 state->nlasers = 2 * (state->w + state->h);
@@ -418,8 +419,10 @@ static game_state *new_game(midend *me, const game_params *params,
418 } 419 }
419 sfree(bmp); 420 sfree(bmp);
420 421
421 state->done = state->nguesses = state->reveal = state->justwrong = 422 state->done = false;
422 state->nright = state->nwrong = state->nmissed = 0; 423 state->justwrong = false;
424 state->reveal = false;
425 state->nguesses = state->nright = state->nwrong = state->nmissed = 0;
423 state->laserno = 1; 426 state->laserno = 1;
424 427
425 return state; 428 return state;
@@ -465,9 +468,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
465 return dupstr("S"); 468 return dupstr("S");
466} 469}
467 470
468static int game_can_format_as_text_now(const game_params *params) 471static bool game_can_format_as_text_now(const game_params *params)
469{ 472{
470 return TRUE; 473 return true;
471} 474}
472 475
473static char *game_text_format(const game_state *state) 476static char *game_text_format(const game_state *state)
@@ -477,8 +480,10 @@ static char *game_text_format(const game_state *state)
477 480
478struct game_ui { 481struct game_ui {
479 int flash_laserno; 482 int flash_laserno;
480 int errors, newmove; 483 int errors;
481 int cur_x, cur_y, cur_visible; 484 bool newmove;
485 int cur_x, cur_y;
486 bool cur_visible;
482 int flash_laser; /* 0 = never, 1 = always, 2 = if anim. */ 487 int flash_laser; /* 0 = never, 1 = always, 2 = if anim. */
483}; 488};
484 489
@@ -487,10 +492,10 @@ static game_ui *new_ui(const game_state *state)
487 game_ui *ui = snew(game_ui); 492 game_ui *ui = snew(game_ui);
488 ui->flash_laserno = LASER_EMPTY; 493 ui->flash_laserno = LASER_EMPTY;
489 ui->errors = 0; 494 ui->errors = 0;
490 ui->newmove = FALSE; 495 ui->newmove = false;
491 496
492 ui->cur_x = ui->cur_y = 1; 497 ui->cur_x = ui->cur_y = 1;
493 ui->cur_visible = 0; 498 ui->cur_visible = false;
494 499
495 ui->flash_laser = 0; 500 ui->flash_laser = 0;
496 501
@@ -526,7 +531,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
526 */ 531 */
527 if (newstate->justwrong && ui->newmove) 532 if (newstate->justwrong && ui->newmove)
528 ui->errors++; 533 ui->errors++;
529 ui->newmove = FALSE; 534 ui->newmove = false;
530} 535}
531 536
532#define OFFSET(gx,gy,o) do { \ 537#define OFFSET(gx,gy,o) do { \
@@ -539,7 +544,7 @@ enum { LOOK_LEFT, LOOK_FORWARD, LOOK_RIGHT };
539 544
540/* Given a position and a direction, check whether we can see a ball in front 545/* Given a position and a direction, check whether we can see a ball in front
541 * of us, or to our front-left or front-right. */ 546 * of us, or to our front-left or front-right. */
542static int isball(game_state *state, int gx, int gy, int direction, int lookwhere) 547static bool isball(game_state *state, int gx, int gy, int direction, int lookwhere)
543{ 548{
544 debug(("isball, (%d, %d), dir %s, lookwhere %s\n", gx, gy, dirstrs[direction], 549 debug(("isball, (%d, %d), dir %s, lookwhere %s\n", gx, gy, dirstrs[direction],
545 lookwhere == LOOK_LEFT ? "LEFT" : 550 lookwhere == LOOK_LEFT ? "LEFT" :
@@ -556,17 +561,18 @@ static int isball(game_state *state, int gx, int gy, int direction, int lookwher
556 561
557 /* if we're off the grid (into the firing range) there's never a ball. */ 562 /* if we're off the grid (into the firing range) there's never a ball. */
558 if (gx < 1 || gy < 1 || gx > state->w || gy > state->h) 563 if (gx < 1 || gy < 1 || gx > state->w || gy > state->h)
559 return 0; 564 return false;
560 565
561 if (GRID(state, gx,gy) & BALL_CORRECT) 566 if (GRID(state, gx,gy) & BALL_CORRECT)
562 return 1; 567 return true;
563 568
564 return 0; 569 return false;
565} 570}
566 571
567static int fire_laser_internal(game_state *state, int x, int y, int direction) 572static int fire_laser_internal(game_state *state, int x, int y, int direction)
568{ 573{
569 int unused, lno, tmp; 574 int unused, lno;
575 bool tmp;
570 576
571 tmp = grid2range(state, x, y, &lno); 577 tmp = grid2range(state, x, y, &lno);
572 assert(tmp); 578 assert(tmp);
@@ -629,7 +635,8 @@ static int fire_laser_internal(game_state *state, int x, int y, int direction)
629 635
630static int laser_exit(game_state *state, int entryno) 636static int laser_exit(game_state *state, int entryno)
631{ 637{
632 int tmp, x, y, direction; 638 int x, y, direction;
639 bool tmp;
633 640
634 tmp = range2grid(state, entryno, &x, &y, &direction); 641 tmp = range2grid(state, entryno, &x, &y, &direction);
635 assert(tmp); 642 assert(tmp);
@@ -639,7 +646,8 @@ static int laser_exit(game_state *state, int entryno)
639 646
640static void fire_laser(game_state *state, int entryno) 647static void fire_laser(game_state *state, int entryno)
641{ 648{
642 int tmp, exitno, x, y, direction; 649 int exitno, x, y, direction;
650 bool tmp;
643 651
644 tmp = range2grid(state, entryno, &x, &y, &direction); 652 tmp = range2grid(state, entryno, &x, &y, &direction);
645 assert(tmp); 653 assert(tmp);
@@ -664,10 +672,11 @@ static void fire_laser(game_state *state, int entryno)
664 * have already guessed). This is required because any layout with >4 balls 672 * have already guessed). This is required because any layout with >4 balls
665 * might have multiple valid solutions. Returns non-zero for a 'correct' 673 * might have multiple valid solutions. Returns non-zero for a 'correct'
666 * (i.e. consistent) layout. */ 674 * (i.e. consistent) layout. */
667static int check_guesses(game_state *state, int cagey) 675static int check_guesses(game_state *state, bool cagey)
668{ 676{
669 game_state *solution, *guesses; 677 game_state *solution, *guesses;
670 int i, x, y, n, unused, tmp; 678 int i, x, y, n, unused, tmp;
679 bool tmpb;
671 int ret = 0; 680 int ret = 0;
672 681
673 if (cagey) { 682 if (cagey) {
@@ -720,7 +729,7 @@ static int check_guesses(game_state *state, int cagey)
720 tmp = laser_exit(state, i); 729 tmp = laser_exit(state, i);
721 if (RANGECHECK(state, tmp)) 730 if (RANGECHECK(state, tmp))
722 state->exits[tmp] |= LASER_WRONG; 731 state->exits[tmp] |= LASER_WRONG;
723 state->justwrong = TRUE; 732 state->justwrong = true;
724 free_game(guesses); 733 free_game(guesses);
725 return 0; 734 return 0;
726 } 735 }
@@ -756,7 +765,7 @@ static int check_guesses(game_state *state, int cagey)
756 tmp = laser_exit(state, i); 765 tmp = laser_exit(state, i);
757 if (RANGECHECK(state, tmp)) 766 if (RANGECHECK(state, tmp))
758 state->exits[tmp] |= LASER_OMITTED; 767 state->exits[tmp] |= LASER_OMITTED;
759 state->justwrong = TRUE; 768 state->justwrong = true;
760 free_game(guesses); 769 free_game(guesses);
761 return 0; 770 return 0;
762 } 771 }
@@ -770,8 +779,8 @@ static int check_guesses(game_state *state, int cagey)
770 779
771 /* clear out the lasers of solution */ 780 /* clear out the lasers of solution */
772 for (i = 0; i < solution->nlasers; i++) { 781 for (i = 0; i < solution->nlasers; i++) {
773 tmp = range2grid(solution, i, &x, &y, &unused); 782 tmpb = range2grid(solution, i, &x, &y, &unused);
774 assert(tmp); 783 assert(tmpb);
775 GRID(solution, x, y) = 0; 784 GRID(solution, x, y) = 0;
776 solution->exits[i] = LASER_EMPTY; 785 solution->exits[i] = LASER_EMPTY;
777 } 786 }
@@ -801,8 +810,8 @@ static int check_guesses(game_state *state, int cagey)
801 /* check each game_state's laser against the other; if any differ, return 0 */ 810 /* check each game_state's laser against the other; if any differ, return 0 */
802 ret = 1; 811 ret = 1;
803 for (i = 0; i < solution->nlasers; i++) { 812 for (i = 0; i < solution->nlasers; i++) {
804 tmp = range2grid(solution, i, &x, &y, &unused); 813 tmpb = range2grid(solution, i, &x, &y, &unused);
805 assert(tmp); 814 assert(tmpb);
806 815
807 if (solution->exits[i] != guesses->exits[i]) { 816 if (solution->exits[i] != guesses->exits[i]) {
808 /* If the original state didn't have this shot fired, 817 /* If the original state didn't have this shot fired,
@@ -816,8 +825,8 @@ static int check_guesses(game_state *state, int cagey)
816 else { 825 else {
817 /* add a new shot, incrementing state's laser count. */ 826 /* add a new shot, incrementing state's laser count. */
818 int ex, ey, newno = state->laserno++; 827 int ex, ey, newno = state->laserno++;
819 tmp = range2grid(state, state->exits[i], &ex, &ey, &unused); 828 tmpb = range2grid(state, state->exits[i], &ex, &ey, &unused);
820 assert(tmp); 829 assert(tmpb);
821 GRID(state, x, y) = newno; 830 GRID(state, x, y) = newno;
822 GRID(state, ex, ey) = newno; 831 GRID(state, ex, ey) = newno;
823 } 832 }
@@ -859,7 +868,7 @@ done:
859 } 868 }
860 free_game(solution); 869 free_game(solution);
861 free_game(guesses); 870 free_game(guesses);
862 state->reveal = 1; 871 state->reveal = true;
863 return ret; 872 return ret;
864} 873}
865 874
@@ -875,8 +884,8 @@ done:
875struct game_drawstate { 884struct game_drawstate {
876 int tilesize, crad, rrad, w, h; /* w and h to make macros work... */ 885 int tilesize, crad, rrad, w, h; /* w and h to make macros work... */
877 unsigned int *grid; /* as the game_state grid */ 886 unsigned int *grid; /* as the game_state grid */
878 int started, reveal; 887 bool started, reveal, isflash;
879 int flash_laserno, isflash; 888 int flash_laserno;
880}; 889};
881 890
882static char *interpret_move(const game_state *state, game_ui *ui, 891static char *interpret_move(const game_state *state, game_ui *ui,
@@ -891,7 +900,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
891 if (IS_CURSOR_MOVE(button)) { 900 if (IS_CURSOR_MOVE(button)) {
892 int cx = ui->cur_x, cy = ui->cur_y; 901 int cx = ui->cur_x, cy = ui->cur_y;
893 902
894 move_cursor(button, &cx, &cy, state->w+2, state->h+2, 0); 903 move_cursor(button, &cx, &cy, state->w+2, state->h+2, false);
895 if ((cx == 0 && cy == 0 && !CAN_REVEAL(state)) || 904 if ((cx == 0 && cy == 0 && !CAN_REVEAL(state)) ||
896 (cx == 0 && cy == state->h+1) || 905 (cx == 0 && cy == state->h+1) ||
897 (cx == state->w+1 && cy == 0) || 906 (cx == state->w+1 && cy == 0) ||
@@ -899,14 +908,14 @@ static char *interpret_move(const game_state *state, game_ui *ui,
899 return NULL; /* disallow moving cursor to corners. */ 908 return NULL; /* disallow moving cursor to corners. */
900 ui->cur_x = cx; 909 ui->cur_x = cx;
901 ui->cur_y = cy; 910 ui->cur_y = cy;
902 ui->cur_visible = 1; 911 ui->cur_visible = true;
903 return UI_UPDATE; 912 return UI_UPDATE;
904 } 913 }
905 914
906 if (button == LEFT_BUTTON || button == RIGHT_BUTTON) { 915 if (button == LEFT_BUTTON || button == RIGHT_BUTTON) {
907 gx = FROMDRAW(x); 916 gx = FROMDRAW(x);
908 gy = FROMDRAW(y); 917 gy = FROMDRAW(y);
909 ui->cur_visible = 0; 918 ui->cur_visible = false;
910 wouldflash = 1; 919 wouldflash = 1;
911 } else if (button == LEFT_RELEASE) { 920 } else if (button == LEFT_RELEASE) {
912 ui->flash_laser = 0; 921 ui->flash_laser = 0;
@@ -918,7 +927,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
918 ui->flash_laser = 0; 927 ui->flash_laser = 0;
919 wouldflash = 2; 928 wouldflash = 2;
920 } else { 929 } else {
921 ui->cur_visible = 1; 930 ui->cur_visible = true;
922 return UI_UPDATE; 931 return UI_UPDATE;
923 } 932 }
924 /* Fix up 'button' for the below logic. */ 933 /* Fix up 'button' for the below logic. */
@@ -976,7 +985,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
976 985
977 case REVEAL: 986 case REVEAL:
978 if (!CAN_REVEAL(state)) return nullret; 987 if (!CAN_REVEAL(state)) return nullret;
979 if (ui->cur_visible == 1) ui->cur_x = ui->cur_y = 1; 988 if (ui->cur_visible) ui->cur_x = ui->cur_y = 1;
980 sprintf(buf, "R"); 989 sprintf(buf, "R");
981 break; 990 break;
982 991
@@ -984,7 +993,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
984 return nullret; 993 return nullret;
985 } 994 }
986 if (state->reveal) return nullret; 995 if (state->reveal) return nullret;
987 ui->newmove = TRUE; 996 ui->newmove = true;
988 return dupstr(buf); 997 return dupstr(buf);
989} 998}
990 999
@@ -995,14 +1004,14 @@ static game_state *execute_move(const game_state *from, const char *move)
995 1004
996 if (ret->justwrong) { 1005 if (ret->justwrong) {
997 int i; 1006 int i;
998 ret->justwrong = FALSE; 1007 ret->justwrong = false;
999 for (i = 0; i < ret->nlasers; i++) 1008 for (i = 0; i < ret->nlasers; i++)
1000 if (ret->exits[i] != LASER_EMPTY) 1009 if (ret->exits[i] != LASER_EMPTY)
1001 ret->exits[i] &= ~(LASER_OMITTED | LASER_WRONG); 1010 ret->exits[i] &= ~(LASER_OMITTED | LASER_WRONG);
1002 } 1011 }
1003 1012
1004 if (!strcmp(move, "S")) { 1013 if (!strcmp(move, "S")) {
1005 check_guesses(ret, FALSE); 1014 check_guesses(ret, false);
1006 return ret; 1015 return ret;
1007 } 1016 }
1008 1017
@@ -1036,7 +1045,7 @@ static game_state *execute_move(const game_state *from, const char *move)
1036 if (ret->nguesses < ret->minballs || 1045 if (ret->nguesses < ret->minballs ||
1037 ret->nguesses > ret->maxballs) 1046 ret->nguesses > ret->maxballs)
1038 goto badmove; 1047 goto badmove;
1039 check_guesses(ret, TRUE); 1048 check_guesses(ret, true);
1040 break; 1049 break;
1041 1050
1042 case 'L': 1051 case 'L':
@@ -1159,9 +1168,10 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1159 ds->w = state->w; ds->h = state->h; 1168 ds->w = state->w; ds->h = state->h;
1160 ds->grid = snewn((state->w+2)*(state->h+2), unsigned int); 1169 ds->grid = snewn((state->w+2)*(state->h+2), unsigned int);
1161 memset(ds->grid, 0, (state->w+2)*(state->h+2)*sizeof(unsigned int)); 1170 memset(ds->grid, 0, (state->w+2)*(state->h+2)*sizeof(unsigned int));
1162 ds->started = ds->reveal = 0; 1171 ds->started = false;
1172 ds->reveal = false;
1163 ds->flash_laserno = LASER_EMPTY; 1173 ds->flash_laserno = LASER_EMPTY;
1164 ds->isflash = 0; 1174 ds->isflash = false;
1165 1175
1166 return ds; 1176 return ds;
1167} 1177}
@@ -1184,7 +1194,7 @@ static void draw_square_cursor(drawing *dr, game_drawstate *ds, int dx, int dy)
1184 1194
1185static void draw_arena_tile(drawing *dr, const game_state *gs, 1195static void draw_arena_tile(drawing *dr, const game_state *gs,
1186 game_drawstate *ds, const game_ui *ui, 1196 game_drawstate *ds, const game_ui *ui,
1187 int ax, int ay, int force, int isflash) 1197 int ax, int ay, bool force, bool isflash)
1188{ 1198{
1189 int gx = ax+1, gy = ay+1; 1199 int gx = ax+1, gy = ay+1;
1190 int gs_tile = GRID(gs, gx, gy), ds_tile = GRID(ds, gx, gy); 1200 int gs_tile = GRID(gs, gx, gy), ds_tile = GRID(ds, gx, gy);
@@ -1266,10 +1276,11 @@ static void draw_arena_tile(drawing *dr, const game_state *gs,
1266 1276
1267static void draw_laser_tile(drawing *dr, const game_state *gs, 1277static void draw_laser_tile(drawing *dr, const game_state *gs,
1268 game_drawstate *ds, const game_ui *ui, 1278 game_drawstate *ds, const game_ui *ui,
1269 int lno, int force) 1279 int lno, bool force)
1270{ 1280{
1271 int gx, gy, dx, dy, unused; 1281 int gx, gy, dx, dy, unused;
1272 int wrong, omitted, reflect, hit, laserval, flash = 0, tmp; 1282 int wrong, omitted, laserval;
1283 bool tmp, reflect, hit, flash = false;
1273 unsigned int gs_tile, ds_tile, exitno; 1284 unsigned int gs_tile, ds_tile, exitno;
1274 1285
1275 tmp = range2grid(gs, lno, &gx, &gy, &unused); 1286 tmp = range2grid(gs, lno, &gx, &gy, &unused);
@@ -1293,7 +1304,7 @@ static void draw_laser_tile(drawing *dr, const game_state *gs,
1293 if (exitno == ds->flash_laserno) 1304 if (exitno == ds->flash_laserno)
1294 gs_tile |= LASER_FLASHED; 1305 gs_tile |= LASER_FLASHED;
1295 } 1306 }
1296 if (gs_tile & LASER_FLASHED) flash = 1; 1307 if (gs_tile & LASER_FLASHED) flash = true;
1297 1308
1298 gs_tile |= wrong | omitted; 1309 gs_tile |= wrong | omitted;
1299 1310
@@ -1341,7 +1352,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1341 int dir, const game_ui *ui, 1352 int dir, const game_ui *ui,
1342 float animtime, float flashtime) 1353 float animtime, float flashtime)
1343{ 1354{
1344 int i, x, y, ts = TILE_SIZE, isflash = 0, force = 0; 1355 int i, x, y, ts = TILE_SIZE;
1356 bool isflash = false, force = false;
1345 1357
1346 if (flashtime > 0) { 1358 if (flashtime > 0) {
1347 int frame = (int)(flashtime / FLASH_FRAME); 1359 int frame = (int)(flashtime / FLASH_FRAME);
@@ -1374,11 +1386,11 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1374 1386
1375 draw_update(dr, 0, 0, 1387 draw_update(dr, 0, 0,
1376 TILE_SIZE * (state->w+3), TILE_SIZE * (state->h+3)); 1388 TILE_SIZE * (state->w+3), TILE_SIZE * (state->h+3));
1377 force = 1; 1389 force = true;
1378 ds->started = 1; 1390 ds->started = true;
1379 } 1391 }
1380 1392
1381 if (isflash != ds->isflash) force = 1; 1393 if (isflash != ds->isflash) force = true;
1382 1394
1383 /* draw the arena */ 1395 /* draw the arena */
1384 for (x = 0; x < state->w; x++) { 1396 for (x = 0; x < state->w; x++) {
@@ -1483,9 +1495,9 @@ static int game_status(const game_state *state)
1483 return 0; 1495 return 0;
1484} 1496}
1485 1497
1486static int game_timing_state(const game_state *state, game_ui *ui) 1498static bool game_timing_state(const game_state *state, game_ui *ui)
1487{ 1499{
1488 return TRUE; 1500 return true;
1489} 1501}
1490 1502
1491static void game_print_size(const game_params *params, float *x, float *y) 1503static void game_print_size(const game_params *params, float *x, float *y)
@@ -1508,15 +1520,15 @@ const struct game thegame = {
1508 encode_params, 1520 encode_params,
1509 free_params, 1521 free_params,
1510 dup_params, 1522 dup_params,
1511 TRUE, game_configure, custom_params, 1523 true, game_configure, custom_params,
1512 validate_params, 1524 validate_params,
1513 new_game_desc, 1525 new_game_desc,
1514 validate_desc, 1526 validate_desc,
1515 new_game, 1527 new_game,
1516 dup_game, 1528 dup_game,
1517 free_game, 1529 free_game,
1518 TRUE, solve_game, 1530 true, solve_game,
1519 FALSE, game_can_format_as_text_now, game_text_format, 1531 false, game_can_format_as_text_now, game_text_format,
1520 new_ui, 1532 new_ui,
1521 free_ui, 1533 free_ui,
1522 encode_ui, 1534 encode_ui,
@@ -1533,9 +1545,9 @@ const struct game thegame = {
1533 game_anim_length, 1545 game_anim_length,
1534 game_flash_length, 1546 game_flash_length,
1535 game_status, 1547 game_status,
1536 FALSE, FALSE, game_print_size, game_print, 1548 false, false, game_print_size, game_print,
1537 TRUE, /* wants_statusbar */ 1549 true, /* wants_statusbar */
1538 FALSE, game_timing_state, 1550 false, game_timing_state,
1539 REQUIRE_RBUTTON, /* flags */ 1551 REQUIRE_RBUTTON, /* flags */
1540}; 1552};
1541 1553
diff --git a/apps/plugins/puzzles/src/bridges.c b/apps/plugins/puzzles/src/bridges.c
index 098fea2665..d12aa0bb6c 100644
--- a/apps/plugins/puzzles/src/bridges.c
+++ b/apps/plugins/puzzles/src/bridges.c
@@ -106,7 +106,8 @@ enum {
106struct game_params { 106struct game_params {
107 int w, h, maxb; 107 int w, h, maxb;
108 int islands, expansion; /* %age of island squares, %age chance of expansion */ 108 int islands, expansion; /* %age of island squares, %age chance of expansion */
109 int allowloops, difficulty; 109 bool allowloops;
110 int difficulty;
110}; 111};
111 112
112/* general flags used by all structs */ 113/* general flags used by all structs */
@@ -155,7 +156,9 @@ struct island {
155}; 156};
156 157
157struct game_state { 158struct game_state {
158 int w, h, completed, solved, allowloops, maxb; 159 int w, h, maxb;
160 bool completed, solved;
161 bool allowloops;
159 grid_type *grid; 162 grid_type *grid;
160 struct island *islands; 163 struct island *islands;
161 int n_islands, n_islands_alloc; 164 int n_islands, n_islands_alloc;
@@ -180,7 +183,7 @@ struct game_state {
180 183
181#define GRIDCOUNT(s,x,y,f) ((GRID(s,x,y) & (f)) ? (INDEX(s,lines,x,y)) : 0) 184#define GRIDCOUNT(s,x,y,f) ((GRID(s,x,y) & (f)) ? (INDEX(s,lines,x,y)) : 0)
182 185
183#define WITHIN2(x,min,max) (((x) < (min)) ? 0 : (((x) > (max)) ? 0 : 1)) 186#define WITHIN2(x,min,max) ((x) >= (min) && (x) < (max))
184#define WITHIN(x,min,max) ((min) > (max) ? \ 187#define WITHIN(x,min,max) ((min) > (max) ? \
185 WITHIN2(x,max,min) : WITHIN2(x,min,max)) 188 WITHIN2(x,max,min) : WITHIN2(x,min,max))
186 189
@@ -204,9 +207,9 @@ static void fixup_islands_for_realloc(game_state *state)
204 } 207 }
205} 208}
206 209
207static int game_can_format_as_text_now(const game_params *params) 210static bool game_can_format_as_text_now(const game_params *params)
208{ 211{
209 return TRUE; 212 return true;
210} 213}
211 214
212static char *game_text_format(const game_state *state) 215static char *game_text_format(const game_state *state)
@@ -327,14 +330,14 @@ foundisland:
327 } 330 }
328} 331}
329 332
330static int island_hasbridge(struct island *is, int direction) 333static bool island_hasbridge(struct island *is, int direction)
331{ 334{
332 int x = is->adj.points[direction].x; 335 int x = is->adj.points[direction].x;
333 int y = is->adj.points[direction].y; 336 int y = is->adj.points[direction].y;
334 grid_type gline = is->adj.points[direction].dx ? G_LINEH : G_LINEV; 337 grid_type gline = is->adj.points[direction].dx ? G_LINEH : G_LINEV;
335 338
336 if (GRID(is->state, x, y) & gline) return 1; 339 if (GRID(is->state, x, y) & gline) return true;
337 return 0; 340 return false;
338} 341}
339 342
340static struct island *island_find_connection(struct island *is, int adjpt) 343static struct island *island_find_connection(struct island *is, int adjpt)
@@ -355,7 +358,7 @@ static struct island *island_find_connection(struct island *is, int adjpt)
355static struct island *island_add(game_state *state, int x, int y, int count) 358static struct island *island_add(game_state *state, int x, int y, int count)
356{ 359{
357 struct island *is; 360 struct island *is;
358 int realloced = 0; 361 bool realloced = false;
359 362
360 assert(!(GRID(state,x,y) & G_ISLAND)); 363 assert(!(GRID(state,x,y) & G_ISLAND));
361 GRID(state,x,y) |= G_ISLAND; 364 GRID(state,x,y) |= G_ISLAND;
@@ -365,7 +368,7 @@ static struct island *island_add(game_state *state, int x, int y, int count)
365 state->n_islands_alloc = state->n_islands * 2; 368 state->n_islands_alloc = state->n_islands * 2;
366 state->islands = 369 state->islands =
367 sresize(state->islands, state->n_islands_alloc, struct island); 370 sresize(state->islands, state->n_islands_alloc, struct island);
368 realloced = 1; 371 realloced = true;
369 } 372 }
370 is = &state->islands[state->n_islands-1]; 373 is = &state->islands[state->n_islands-1];
371 374
@@ -386,7 +389,7 @@ static struct island *island_add(game_state *state, int x, int y, int count)
386 389
387 390
388/* n = -1 means 'flip NOLINE flags [and set line to 0].' */ 391/* n = -1 means 'flip NOLINE flags [and set line to 0].' */
389static void island_join(struct island *i1, struct island *i2, int n, int is_max) 392static void island_join(struct island *i1, struct island *i2, int n, bool is_max)
390{ 393{
391 game_state *state = i1->state; 394 game_state *state = i1->state;
392 int s, e, x, y; 395 int s, e, x, y;
@@ -455,7 +458,7 @@ static int island_countbridges(struct island *is)
455 return c; 458 return c;
456} 459}
457 460
458static int island_adjspace(struct island *is, int marks, int missing, 461static int island_adjspace(struct island *is, bool marks, int missing,
459 int direction) 462 int direction)
460{ 463{
461 int x, y, poss, curr, dx; 464 int x, y, poss, curr, dx;
@@ -481,7 +484,7 @@ static int island_adjspace(struct island *is, int marks, int missing,
481 484
482/* Counts the number of bridge spaces left around the island; 485/* Counts the number of bridge spaces left around the island;
483 * expects the possibles to be up-to-date. */ 486 * expects the possibles to be up-to-date. */
484static int island_countspaces(struct island *is, int marks) 487static int island_countspaces(struct island *is, bool marks)
485{ 488{
486 int i, c = 0, missing; 489 int i, c = 0, missing;
487 490
@@ -494,6 +497,7 @@ static int island_countspaces(struct island *is, int marks)
494 return c; 497 return c;
495} 498}
496 499
500/* Returns a bridge count rather than a boolean */
497static int island_isadj(struct island *is, int direction) 501static int island_isadj(struct island *is, int direction)
498{ 502{
499 int x, y; 503 int x, y;
@@ -565,7 +569,7 @@ static void island_togglemark(struct island *is)
565 } 569 }
566} 570}
567 571
568static int island_impossible(struct island *is, int strict) 572static bool island_impossible(struct island *is, bool strict)
569{ 573{
570 int curr = island_countbridges(is), nspc = is->count - curr, nsurrspc; 574 int curr = island_countbridges(is), nspc = is->count - curr, nsurrspc;
571 int i, poss; 575 int i, poss;
@@ -573,13 +577,13 @@ static int island_impossible(struct island *is, int strict)
573 577
574 if (nspc < 0) { 578 if (nspc < 0) {
575 debug(("island at (%d,%d) impossible because full.\n", is->x, is->y)); 579 debug(("island at (%d,%d) impossible because full.\n", is->x, is->y));
576 return 1; /* too many bridges */ 580 return true; /* too many bridges */
577 } else if ((curr + island_countspaces(is, 0)) < is->count) { 581 } else if ((curr + island_countspaces(is, false)) < is->count) {
578 debug(("island at (%d,%d) impossible because not enough spaces.\n", is->x, is->y)); 582 debug(("island at (%d,%d) impossible because not enough spaces.\n", is->x, is->y));
579 return 1; /* impossible to create enough bridges */ 583 return true; /* impossible to create enough bridges */
580 } else if (strict && curr < is->count) { 584 } else if (strict && curr < is->count) {
581 debug(("island at (%d,%d) impossible because locked.\n", is->x, is->y)); 585 debug(("island at (%d,%d) impossible because locked.\n", is->x, is->y));
582 return 1; /* not enough bridges and island is locked */ 586 return true; /* not enough bridges and island is locked */
583 } 587 }
584 588
585 /* Count spaces in surrounding islands. */ 589 /* Count spaces in surrounding islands. */
@@ -618,17 +622,17 @@ static int island_impossible(struct island *is, int strict)
618 if (nsurrspc < nspc) { 622 if (nsurrspc < nspc) {
619 debug(("island at (%d,%d) impossible: surr. islands %d spc, need %d.\n", 623 debug(("island at (%d,%d) impossible: surr. islands %d spc, need %d.\n",
620 is->x, is->y, nsurrspc, nspc)); 624 is->x, is->y, nsurrspc, nspc));
621 return 1; /* not enough spaces around surrounding islands to fill this one. */ 625 return true; /* not enough spaces around surrounding islands to fill this one. */
622 } 626 }
623 627
624 return 0; 628 return false;
625} 629}
626 630
627/* --- Game parameter functions --- */ 631/* --- Game parameter functions --- */
628 632
629#define DEFAULT_PRESET 0 633#define DEFAULT_PRESET 0
630 634
631const struct game_params bridges_presets[] = { 635static const struct game_params bridges_presets[] = {
632 { 7, 7, 2, 30, 10, 1, 0 }, 636 { 7, 7, 2, 30, 10, 1, 0 },
633 { 7, 7, 2, 30, 10, 1, 1 }, 637 { 7, 7, 2, 30, 10, 1, 1 },
634 { 7, 7, 2, 30, 10, 1, 2 }, 638 { 7, 7, 2, 30, 10, 1, 2 },
@@ -648,13 +652,13 @@ static game_params *default_params(void)
648 return ret; 652 return ret;
649} 653}
650 654
651static int game_fetch_preset(int i, char **name, game_params **params) 655static bool game_fetch_preset(int i, char **name, game_params **params)
652{ 656{
653 game_params *ret; 657 game_params *ret;
654 char buf[80]; 658 char buf[80];
655 659
656 if (i < 0 || i >= lenof(bridges_presets)) 660 if (i < 0 || i >= lenof(bridges_presets))
657 return FALSE; 661 return false;
658 662
659 ret = default_params(); 663 ret = default_params();
660 *ret = bridges_presets[i]; 664 *ret = bridges_presets[i];
@@ -665,7 +669,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
665 ret->difficulty == 1 ? "medium" : "hard"); 669 ret->difficulty == 1 ? "medium" : "hard");
666 *name = dupstr(buf); 670 *name = dupstr(buf);
667 671
668 return TRUE; 672 return true;
669} 673}
670 674
671static void free_params(game_params *params) 675static void free_params(game_params *params)
@@ -705,10 +709,10 @@ static void decode_params(game_params *params, char const *string)
705 string++; 709 string++;
706 EATNUM(params->maxb); 710 EATNUM(params->maxb);
707 } 711 }
708 params->allowloops = 1; 712 params->allowloops = true;
709 if (*string == 'L') { 713 if (*string == 'L') {
710 string++; 714 string++;
711 params->allowloops = 0; 715 params->allowloops = false;
712 } 716 }
713 if (*string == 'd') { 717 if (*string == 'd') {
714 string++; 718 string++;
@@ -716,7 +720,7 @@ static void decode_params(game_params *params, char const *string)
716 } 720 }
717} 721}
718 722
719static char *encode_params(const game_params *params, int full) 723static char *encode_params(const game_params *params, bool full)
720{ 724{
721 char buf[80]; 725 char buf[80];
722 726
@@ -795,7 +799,7 @@ static game_params *custom_params(const config_item *cfg)
795 return ret; 799 return ret;
796} 800}
797 801
798static const char *validate_params(const game_params *params, int full) 802static const char *validate_params(const game_params *params, bool full)
799{ 803{
800 if (params->w < 3 || params->h < 3) 804 if (params->w < 3 || params->h < 3)
801 return "Width and height must be at least 3"; 805 return "Width and height must be at least 3";
@@ -922,14 +926,15 @@ static char *game_state_diff(const game_state *src, const game_state *dest)
922 926
923static void map_update_possibles(game_state *state) 927static void map_update_possibles(game_state *state)
924{ 928{
925 int x, y, s, e, bl, i, np, maxb, w = state->w, idx; 929 int x, y, s, e, i, np, maxb, w = state->w, idx;
930 bool bl;
926 struct island *is_s = NULL, *is_f = NULL; 931 struct island *is_s = NULL, *is_f = NULL;
927 932
928 /* Run down vertical stripes [un]setting possv... */ 933 /* Run down vertical stripes [un]setting possv... */
929 for (x = 0; x < state->w; x++) { 934 for (x = 0; x < state->w; x++) {
930 idx = x; 935 idx = x;
931 s = e = -1; 936 s = e = -1;
932 bl = 0; 937 bl = false;
933 maxb = state->params.maxb; /* placate optimiser */ 938 maxb = state->params.maxb; /* placate optimiser */
934 /* Unset possible flags until we find an island. */ 939 /* Unset possible flags until we find an island. */
935 for (y = 0; y < state->h; y++) { 940 for (y = 0; y < state->h; y++) {
@@ -955,12 +960,12 @@ static void map_update_possibles(game_state *state)
955 } 960 }
956 } 961 }
957 s = y+1; 962 s = y+1;
958 bl = 0; 963 bl = false;
959 is_s = is_f; 964 is_s = is_f;
960 maxb = is_s->count; 965 maxb = is_s->count;
961 } else { 966 } else {
962 e = y; 967 e = y;
963 if (IDX(state,grid,idx) & (G_LINEH|G_NOLINEV)) bl = 1; 968 if (IDX(state,grid,idx) & (G_LINEH|G_NOLINEV)) bl = true;
964 } 969 }
965 idx += w; 970 idx += w;
966 } 971 }
@@ -975,7 +980,7 @@ static void map_update_possibles(game_state *state)
975 for (y = 0; y < state->h; y++) { 980 for (y = 0; y < state->h; y++) {
976 idx = y*w; 981 idx = y*w;
977 s = e = -1; 982 s = e = -1;
978 bl = 0; 983 bl = false;
979 maxb = state->params.maxb; /* placate optimiser */ 984 maxb = state->params.maxb; /* placate optimiser */
980 for (x = 0; x < state->w; x++) { 985 for (x = 0; x < state->w; x++) {
981 is_s = IDX(state, gridi, idx); 986 is_s = IDX(state, gridi, idx);
@@ -1000,12 +1005,12 @@ static void map_update_possibles(game_state *state)
1000 } 1005 }
1001 } 1006 }
1002 s = x+1; 1007 s = x+1;
1003 bl = 0; 1008 bl = false;
1004 is_s = is_f; 1009 is_s = is_f;
1005 maxb = is_s->count; 1010 maxb = is_s->count;
1006 } else { 1011 } else {
1007 e = x; 1012 e = x;
1008 if (IDX(state,grid,idx) & (G_LINEV|G_NOLINEH)) bl = 1; 1013 if (IDX(state,grid,idx) & (G_LINEV|G_NOLINEH)) bl = true;
1009 } 1014 }
1010 idx += 1; 1015 idx += 1;
1011 } 1016 }
@@ -1097,12 +1102,12 @@ static int bridges_neighbour(int vertex, void *vctx)
1097 return -1; 1102 return -1;
1098} 1103}
1099 1104
1100static int map_hasloops(game_state *state, int mark) 1105static bool map_hasloops(game_state *state, bool mark)
1101{ 1106{
1102 int x, y; 1107 int x, y;
1103 struct findloopstate *fls; 1108 struct findloopstate *fls;
1104 struct bridges_neighbour_ctx ctx; 1109 struct bridges_neighbour_ctx ctx;
1105 int ret; 1110 bool ret;
1106 1111
1107 fls = findloop_new_state(state->w * state->h); 1112 fls = findloop_new_state(state->w * state->h);
1108 ctx.state = state; 1113 ctx.state = state;
@@ -1172,11 +1177,12 @@ static void map_group(game_state *state)
1172 } 1177 }
1173} 1178}
1174 1179
1175static int map_group_check(game_state *state, int canon, int warn, 1180static bool map_group_check(game_state *state, int canon, bool warn,
1176 int *nislands_r) 1181 int *nislands_r)
1177{ 1182{
1178 int *dsf = state->solver->dsf, nislands = 0; 1183 int *dsf = state->solver->dsf, nislands = 0;
1179 int x, y, i, allfull = 1; 1184 int x, y, i;
1185 bool allfull = true;
1180 struct island *is; 1186 struct island *is;
1181 1187
1182 for (i = 0; i < state->n_islands; i++) { 1188 for (i = 0; i < state->n_islands; i++) {
@@ -1186,7 +1192,7 @@ static int map_group_check(game_state *state, int canon, int warn,
1186 GRID(state, is->x, is->y) |= G_SWEEP; 1192 GRID(state, is->x, is->y) |= G_SWEEP;
1187 nislands++; 1193 nislands++;
1188 if (island_countbridges(is) != is->count) 1194 if (island_countbridges(is) != is->count)
1189 allfull = 0; 1195 allfull = false;
1190 } 1196 }
1191 if (warn && allfull && nislands != state->n_islands) { 1197 if (warn && allfull && nislands != state->n_islands) {
1192 /* we're full and this island group isn't the whole set. 1198 /* we're full and this island group isn't the whole set.
@@ -1204,10 +1210,11 @@ static int map_group_check(game_state *state, int canon, int warn,
1204 return allfull; 1210 return allfull;
1205} 1211}
1206 1212
1207static int map_group_full(game_state *state, int *ngroups_r) 1213static bool map_group_full(game_state *state, int *ngroups_r)
1208{ 1214{
1209 int *dsf = state->solver->dsf, ngroups = 0; 1215 int *dsf = state->solver->dsf, ngroups = 0;
1210 int i, anyfull = 0; 1216 int i;
1217 bool anyfull = false;
1211 struct island *is; 1218 struct island *is;
1212 1219
1213 /* NB this assumes map_group (or sth else) has cleared G_SWEEP. */ 1220 /* NB this assumes map_group (or sth else) has cleared G_SWEEP. */
@@ -1218,31 +1225,31 @@ static int map_group_full(game_state *state, int *ngroups_r)
1218 1225
1219 ngroups++; 1226 ngroups++;
1220 if (map_group_check(state, dsf_canonify(dsf, DINDEX(is->x,is->y)), 1227 if (map_group_check(state, dsf_canonify(dsf, DINDEX(is->x,is->y)),
1221 1, NULL)) 1228 true, NULL))
1222 anyfull = 1; 1229 anyfull = true;
1223 } 1230 }
1224 1231
1225 *ngroups_r = ngroups; 1232 *ngroups_r = ngroups;
1226 return anyfull; 1233 return anyfull;
1227} 1234}
1228 1235
1229static int map_check(game_state *state) 1236static bool map_check(game_state *state)
1230{ 1237{
1231 int ngroups; 1238 int ngroups;
1232 1239
1233 /* Check for loops, if necessary. */ 1240 /* Check for loops, if necessary. */
1234 if (!state->allowloops) { 1241 if (!state->allowloops) {
1235 if (map_hasloops(state, 1)) 1242 if (map_hasloops(state, true))
1236 return 0; 1243 return false;
1237 } 1244 }
1238 1245
1239 /* Place islands into island groups and check for early 1246 /* Place islands into island groups and check for early
1240 * satisfied-groups. */ 1247 * satisfied-groups. */
1241 map_group(state); /* clears WARN and SWEEP */ 1248 map_group(state); /* clears WARN and SWEEP */
1242 if (map_group_full(state, &ngroups)) { 1249 if (map_group_full(state, &ngroups)) {
1243 if (ngroups == 1) return 1; 1250 if (ngroups == 1) return true;
1244 } 1251 }
1245 return 0; 1252 return false;
1246} 1253}
1247 1254
1248static void map_clear(game_state *state) 1255static void map_clear(game_state *state)
@@ -1257,7 +1264,7 @@ static void map_clear(game_state *state)
1257 } 1264 }
1258} 1265}
1259 1266
1260static void solve_join(struct island *is, int direction, int n, int is_max) 1267static void solve_join(struct island *is, int direction, int n, bool is_max)
1261{ 1268{
1262 struct island *is_orth; 1269 struct island *is_orth;
1263 int d1, d2, *dsf = is->state->solver->dsf; 1270 int d1, d2, *dsf = is->state->solver->dsf;
@@ -1290,7 +1297,7 @@ static int solve_fillone(struct island *is)
1290 if (island_hasbridge(is, i)) { 1297 if (island_hasbridge(is, i)) {
1291 /* already attached; do nothing. */; 1298 /* already attached; do nothing. */;
1292 } else { 1299 } else {
1293 solve_join(is, i, 1, 0); 1300 solve_join(is, i, 1, false);
1294 nadded++; 1301 nadded++;
1295 } 1302 }
1296 } 1303 }
@@ -1311,25 +1318,25 @@ static int solve_fill(struct island *is)
1311 1318
1312 /* very like island_countspaces. */ 1319 /* very like island_countspaces. */
1313 for (i = 0; i < is->adj.npoints; i++) { 1320 for (i = 0; i < is->adj.npoints; i++) {
1314 nnew = island_adjspace(is, 1, missing, i); 1321 nnew = island_adjspace(is, true, missing, i);
1315 if (nnew) { 1322 if (nnew) {
1316 ncurr = GRIDCOUNT(is->state, 1323 ncurr = GRIDCOUNT(is->state,
1317 is->adj.points[i].x, is->adj.points[i].y, 1324 is->adj.points[i].x, is->adj.points[i].y,
1318 is->adj.points[i].dx ? G_LINEH : G_LINEV); 1325 is->adj.points[i].dx ? G_LINEH : G_LINEV);
1319 1326
1320 solve_join(is, i, nnew + ncurr, 0); 1327 solve_join(is, i, nnew + ncurr, false);
1321 nadded += nnew; 1328 nadded += nnew;
1322 } 1329 }
1323 } 1330 }
1324 return nadded; 1331 return nadded;
1325} 1332}
1326 1333
1327static int solve_island_stage1(struct island *is, int *didsth_r) 1334static bool solve_island_stage1(struct island *is, bool *didsth_r)
1328{ 1335{
1329 int bridges = island_countbridges(is); 1336 int bridges = island_countbridges(is);
1330 int nspaces = island_countspaces(is, 1); 1337 int nspaces = island_countspaces(is, true);
1331 int nadj = island_countadj(is); 1338 int nadj = island_countadj(is);
1332 int didsth = 0; 1339 bool didsth = false;
1333 1340
1334 assert(didsth_r); 1341 assert(didsth_r);
1335 1342
@@ -1341,64 +1348,68 @@ static int solve_island_stage1(struct island *is, int *didsth_r)
1341 * another island has become wrong, the puzzle must not have had 1348 * another island has become wrong, the puzzle must not have had
1342 * a solution. */ 1349 * a solution. */
1343 debug(("...island at (%d,%d) is overpopulated!\n", is->x, is->y)); 1350 debug(("...island at (%d,%d) is overpopulated!\n", is->x, is->y));
1344 return 0; 1351 return false;
1345 } else if (bridges == is->count) { 1352 } else if (bridges == is->count) {
1346 /* This island is full. Make sure it's marked (and update 1353 /* This island is full. Make sure it's marked (and update
1347 * possibles if we did). */ 1354 * possibles if we did). */
1348 if (!(GRID(is->state, is->x, is->y) & G_MARK)) { 1355 if (!(GRID(is->state, is->x, is->y) & G_MARK)) {
1349 debug(("...marking island (%d,%d) as full.\n", is->x, is->y)); 1356 debug(("...marking island (%d,%d) as full.\n", is->x, is->y));
1350 island_togglemark(is); 1357 island_togglemark(is);
1351 didsth = 1; 1358 didsth = true;
1352 } 1359 }
1353 } else if (GRID(is->state, is->x, is->y) & G_MARK) { 1360 } else if (GRID(is->state, is->x, is->y) & G_MARK) {
1354 debug(("...island (%d,%d) is marked but unfinished!\n", 1361 debug(("...island (%d,%d) is marked but unfinished!\n",
1355 is->x, is->y)); 1362 is->x, is->y));
1356 return 0; /* island has been marked unfinished; no solution from here. */ 1363 return false; /* island has been marked unfinished; no solution from here. */
1357 } else { 1364 } else {
1358 /* This is the interesting bit; we try and fill in more information 1365 /* This is the interesting bit; we try and fill in more information
1359 * about this island. */ 1366 * about this island. */
1360 if (is->count == bridges + nspaces) { 1367 if (is->count == bridges + nspaces) {
1361 if (solve_fill(is) > 0) didsth = 1; 1368 if (solve_fill(is) > 0) didsth = true;
1362 } else if (is->count > ((nadj-1) * is->state->maxb)) { 1369 } else if (is->count > ((nadj-1) * is->state->maxb)) {
1363 /* must have at least one bridge in each possible direction. */ 1370 /* must have at least one bridge in each possible direction. */
1364 if (solve_fillone(is) > 0) didsth = 1; 1371 if (solve_fillone(is) > 0) didsth = true;
1365 } 1372 }
1366 } 1373 }
1367 if (didsth) { 1374 if (didsth) {
1368 map_update_possibles(is->state); 1375 map_update_possibles(is->state);
1369 *didsth_r = 1; 1376 *didsth_r = true;
1370 } 1377 }
1371 return 1; 1378 return true;
1372} 1379}
1373 1380
1374/* returns non-zero if a new line here would cause a loop. */ 1381/* returns true if a new line here would cause a loop. */
1375static int solve_island_checkloop(struct island *is, int direction) 1382static bool solve_island_checkloop(struct island *is, int direction)
1376{ 1383{
1377 struct island *is_orth; 1384 struct island *is_orth;
1378 int *dsf = is->state->solver->dsf, d1, d2; 1385 int *dsf = is->state->solver->dsf, d1, d2;
1379 game_state *state = is->state; 1386 game_state *state = is->state;
1380 1387
1381 if (is->state->allowloops) return 0; /* don't care anyway */ 1388 if (is->state->allowloops)
1382 if (island_hasbridge(is, direction)) return 0; /* already has a bridge */ 1389 return false; /* don't care anyway */
1383 if (island_isadj(is, direction) == 0) return 0; /* no adj island */ 1390 if (island_hasbridge(is, direction))
1391 return false; /* already has a bridge */
1392 if (island_isadj(is, direction) == 0)
1393 return false; /* no adj island */
1384 1394
1385 is_orth = INDEX(is->state, gridi, 1395 is_orth = INDEX(is->state, gridi,
1386 ISLAND_ORTHX(is,direction), 1396 ISLAND_ORTHX(is,direction),
1387 ISLAND_ORTHY(is,direction)); 1397 ISLAND_ORTHY(is,direction));
1388 if (!is_orth) return 0; 1398 if (!is_orth) return false;
1389 1399
1390 d1 = DINDEX(is->x, is->y); 1400 d1 = DINDEX(is->x, is->y);
1391 d2 = DINDEX(is_orth->x, is_orth->y); 1401 d2 = DINDEX(is_orth->x, is_orth->y);
1392 if (dsf_canonify(dsf, d1) == dsf_canonify(dsf, d2)) { 1402 if (dsf_canonify(dsf, d1) == dsf_canonify(dsf, d2)) {
1393 /* two islands are connected already; don't join them. */ 1403 /* two islands are connected already; don't join them. */
1394 return 1; 1404 return true;
1395 } 1405 }
1396 return 0; 1406 return false;
1397} 1407}
1398 1408
1399static int solve_island_stage2(struct island *is, int *didsth_r) 1409static bool solve_island_stage2(struct island *is, bool *didsth_r)
1400{ 1410{
1401 int added = 0, removed = 0, navail = 0, nadj, i; 1411 int navail = 0, nadj, i;
1412 bool added = false, removed = false;
1402 1413
1403 assert(didsth_r); 1414 assert(didsth_r);
1404 1415
@@ -1406,9 +1417,9 @@ static int solve_island_stage2(struct island *is, int *didsth_r)
1406 if (solve_island_checkloop(is, i)) { 1417 if (solve_island_checkloop(is, i)) {
1407 debug(("removing possible loop at (%d,%d) direction %d.\n", 1418 debug(("removing possible loop at (%d,%d) direction %d.\n",
1408 is->x, is->y, i)); 1419 is->x, is->y, i));
1409 solve_join(is, i, -1, 0); 1420 solve_join(is, i, -1, false);
1410 map_update_possibles(is->state); 1421 map_update_possibles(is->state);
1411 removed = 1; 1422 removed = true;
1412 } else { 1423 } else {
1413 navail += island_isadj(is, i); 1424 navail += island_isadj(is, i);
1414 /*debug(("stage2: navail for (%d,%d) direction (%d,%d) is %d.\n", 1425 /*debug(("stage2: navail for (%d,%d) direction (%d,%d) is %d.\n",
@@ -1431,19 +1442,19 @@ static int solve_island_stage2(struct island *is, int *didsth_r)
1431 debug(("island at (%d,%d) direction (%d,%d) must have 1 bridge\n", 1442 debug(("island at (%d,%d) direction (%d,%d) must have 1 bridge\n",
1432 is->x, is->y, 1443 is->x, is->y,
1433 is->adj.points[i].dx, is->adj.points[i].dy)); 1444 is->adj.points[i].dx, is->adj.points[i].dy));
1434 solve_join(is, i, 1, 0); 1445 solve_join(is, i, 1, false);
1435 added = 1; 1446 added = true;
1436 /*debug_state(is->state); 1447 /*debug_state(is->state);
1437 debug_possibles(is->state);*/ 1448 debug_possibles(is->state);*/
1438 } 1449 }
1439 } 1450 }
1440 } 1451 }
1441 if (added) map_update_possibles(is->state); 1452 if (added) map_update_possibles(is->state);
1442 if (added || removed) *didsth_r = 1; 1453 if (added || removed) *didsth_r = true;
1443 return 1; 1454 return true;
1444} 1455}
1445 1456
1446static int solve_island_subgroup(struct island *is, int direction) 1457static bool solve_island_subgroup(struct island *is, int direction)
1447{ 1458{
1448 struct island *is_join; 1459 struct island *is_join;
1449 int nislands, *dsf = is->state->solver->dsf; 1460 int nislands, *dsf = is->state->solver->dsf;
@@ -1454,7 +1465,7 @@ static int solve_island_subgroup(struct island *is, int direction)
1454 /* if is isn't full, return 0. */ 1465 /* if is isn't full, return 0. */
1455 if (island_countbridges(is) < is->count) { 1466 if (island_countbridges(is) < is->count) {
1456 debug(("...orig island (%d,%d) not full.\n", is->x, is->y)); 1467 debug(("...orig island (%d,%d) not full.\n", is->x, is->y));
1457 return 0; 1468 return false;
1458 } 1469 }
1459 1470
1460 if (direction >= 0) { 1471 if (direction >= 0) {
@@ -1467,27 +1478,27 @@ static int solve_island_subgroup(struct island *is, int direction)
1467 if (island_countbridges(is_join) < is_join->count) { 1478 if (island_countbridges(is_join) < is_join->count) {
1468 debug(("...dest island (%d,%d) not full.\n", 1479 debug(("...dest island (%d,%d) not full.\n",
1469 is_join->x, is_join->y)); 1480 is_join->x, is_join->y));
1470 return 0; 1481 return false;
1471 } 1482 }
1472 } 1483 }
1473 1484
1474 /* Check group membership for is->dsf; if it's full return 1. */ 1485 /* Check group membership for is->dsf; if it's full return 1. */
1475 if (map_group_check(state, dsf_canonify(dsf, DINDEX(is->x,is->y)), 1486 if (map_group_check(state, dsf_canonify(dsf, DINDEX(is->x,is->y)),
1476 0, &nislands)) { 1487 false, &nislands)) {
1477 if (nislands < state->n_islands) { 1488 if (nislands < state->n_islands) {
1478 /* we have a full subgroup that isn't the whole set. 1489 /* we have a full subgroup that isn't the whole set.
1479 * This isn't allowed. */ 1490 * This isn't allowed. */
1480 debug(("island at (%d,%d) makes full subgroup, disallowing.\n", 1491 debug(("island at (%d,%d) makes full subgroup, disallowing.\n",
1481 is->x, is->y)); 1492 is->x, is->y));
1482 return 1; 1493 return true;
1483 } else { 1494 } else {
1484 debug(("...has finished puzzle.\n")); 1495 debug(("...has finished puzzle.\n"));
1485 } 1496 }
1486 } 1497 }
1487 return 0; 1498 return false;
1488} 1499}
1489 1500
1490static int solve_island_impossible(game_state *state) 1501static bool solve_island_impossible(game_state *state)
1491{ 1502{
1492 struct island *is; 1503 struct island *is;
1493 int i; 1504 int i;
@@ -1495,31 +1506,32 @@ static int solve_island_impossible(game_state *state)
1495 /* If any islands are impossible, return 1. */ 1506 /* If any islands are impossible, return 1. */
1496 for (i = 0; i < state->n_islands; i++) { 1507 for (i = 0; i < state->n_islands; i++) {
1497 is = &state->islands[i]; 1508 is = &state->islands[i];
1498 if (island_impossible(is, 0)) { 1509 if (island_impossible(is, false)) {
1499 debug(("island at (%d,%d) has become impossible, disallowing.\n", 1510 debug(("island at (%d,%d) has become impossible, disallowing.\n",
1500 is->x, is->y)); 1511 is->x, is->y));
1501 return 1; 1512 return true;
1502 } 1513 }
1503 } 1514 }
1504 return 0; 1515 return false;
1505} 1516}
1506 1517
1507/* Bear in mind that this function is really rather inefficient. */ 1518/* Bear in mind that this function is really rather inefficient. */
1508static int solve_island_stage3(struct island *is, int *didsth_r) 1519static bool solve_island_stage3(struct island *is, bool *didsth_r)
1509{ 1520{
1510 int i, n, x, y, missing, spc, curr, maxb, didsth = 0; 1521 int i, n, x, y, missing, spc, curr, maxb;
1522 bool didsth = false;
1511 int wh = is->state->w * is->state->h; 1523 int wh = is->state->w * is->state->h;
1512 struct solver_state *ss = is->state->solver; 1524 struct solver_state *ss = is->state->solver;
1513 1525
1514 assert(didsth_r); 1526 assert(didsth_r);
1515 1527
1516 missing = is->count - island_countbridges(is); 1528 missing = is->count - island_countbridges(is);
1517 if (missing <= 0) return 1; 1529 if (missing <= 0) return true;
1518 1530
1519 for (i = 0; i < is->adj.npoints; i++) { 1531 for (i = 0; i < is->adj.npoints; i++) {
1520 x = is->adj.points[i].x; 1532 x = is->adj.points[i].x;
1521 y = is->adj.points[i].y; 1533 y = is->adj.points[i].y;
1522 spc = island_adjspace(is, 1, missing, i); 1534 spc = island_adjspace(is, true, missing, i);
1523 if (spc == 0) continue; 1535 if (spc == 0) continue;
1524 1536
1525 curr = GRIDCOUNT(is->state, x, y, 1537 curr = GRIDCOUNT(is->state, x, y,
@@ -1534,7 +1546,7 @@ static int solve_island_stage3(struct island *is, int *didsth_r)
1534 * it is additive only, and can't be removed from. */ 1546 * it is additive only, and can't be removed from. */
1535 memcpy(ss->tmpdsf, ss->dsf, wh*sizeof(int)); 1547 memcpy(ss->tmpdsf, ss->dsf, wh*sizeof(int));
1536 for (n = curr+1; n <= curr+spc; n++) { 1548 for (n = curr+1; n <= curr+spc; n++) {
1537 solve_join(is, i, n, 0); 1549 solve_join(is, i, n, false);
1538 map_update_possibles(is->state); 1550 map_update_possibles(is->state);
1539 1551
1540 if (solve_island_subgroup(is, i) || 1552 if (solve_island_subgroup(is, i) ||
@@ -1547,19 +1559,19 @@ static int solve_island_stage3(struct island *is, int *didsth_r)
1547 break; 1559 break;
1548 } 1560 }
1549 } 1561 }
1550 solve_join(is, i, curr, 0); /* put back to before. */ 1562 solve_join(is, i, curr, false); /* put back to before. */
1551 memcpy(ss->dsf, ss->tmpdsf, wh*sizeof(int)); 1563 memcpy(ss->dsf, ss->tmpdsf, wh*sizeof(int));
1552 1564
1553 if (maxb != -1) { 1565 if (maxb != -1) {
1554 /*debug_state(is->state);*/ 1566 /*debug_state(is->state);*/
1555 if (maxb == 0) { 1567 if (maxb == 0) {
1556 debug(("...adding NOLINE.\n")); 1568 debug(("...adding NOLINE.\n"));
1557 solve_join(is, i, -1, 0); /* we can't have any bridges here. */ 1569 solve_join(is, i, -1, false); /* we can't have any bridges here. */
1558 } else { 1570 } else {
1559 debug(("...setting maximum\n")); 1571 debug(("...setting maximum\n"));
1560 solve_join(is, i, maxb, 1); 1572 solve_join(is, i, maxb, true);
1561 } 1573 }
1562 didsth = 1; 1574 didsth = true;
1563 } 1575 }
1564 map_update_possibles(is->state); 1576 map_update_possibles(is->state);
1565 } 1577 }
@@ -1603,11 +1615,11 @@ static int solve_island_stage3(struct island *is, int *didsth_r)
1603 * recording the idea that at least one of two edges must have 1615 * recording the idea that at least one of two edges must have
1604 * a bridge. 1616 * a bridge.
1605 */ 1617 */
1606 int got = 0; 1618 bool got = false;
1607 int before[4]; 1619 int before[4];
1608 int j; 1620 int j;
1609 1621
1610 spc = island_adjspace(is, 1, missing, i); 1622 spc = island_adjspace(is, true, missing, i);
1611 if (spc == 0) continue; 1623 if (spc == 0) continue;
1612 1624
1613 for (j = 0; j < is->adj.npoints; j++) 1625 for (j = 0; j < is->adj.npoints; j++)
@@ -1620,33 +1632,33 @@ static int solve_island_stage3(struct island *is, int *didsth_r)
1620 memcpy(ss->tmpdsf, ss->dsf, wh*sizeof(int)); 1632 memcpy(ss->tmpdsf, ss->dsf, wh*sizeof(int));
1621 1633
1622 for (j = 0; j < is->adj.npoints; j++) { 1634 for (j = 0; j < is->adj.npoints; j++) {
1623 spc = island_adjspace(is, 1, missing, j); 1635 spc = island_adjspace(is, true, missing, j);
1624 if (spc == 0) continue; 1636 if (spc == 0) continue;
1625 if (j == i) continue; 1637 if (j == i) continue;
1626 solve_join(is, j, before[j] + spc, 0); 1638 solve_join(is, j, before[j] + spc, false);
1627 } 1639 }
1628 map_update_possibles(is->state); 1640 map_update_possibles(is->state);
1629 1641
1630 if (solve_island_subgroup(is, -1)) 1642 if (solve_island_subgroup(is, -1))
1631 got = 1; 1643 got = true;
1632 1644
1633 for (j = 0; j < is->adj.npoints; j++) 1645 for (j = 0; j < is->adj.npoints; j++)
1634 solve_join(is, j, before[j], 0); 1646 solve_join(is, j, before[j], false);
1635 memcpy(ss->dsf, ss->tmpdsf, wh*sizeof(int)); 1647 memcpy(ss->dsf, ss->tmpdsf, wh*sizeof(int));
1636 1648
1637 if (got) { 1649 if (got) {
1638 debug(("island at (%d,%d) must connect in direction (%d,%d) to" 1650 debug(("island at (%d,%d) must connect in direction (%d,%d) to"
1639 " avoid full subgroup.\n", 1651 " avoid full subgroup.\n",
1640 is->x, is->y, is->adj.points[i].dx, is->adj.points[i].dy)); 1652 is->x, is->y, is->adj.points[i].dx, is->adj.points[i].dy));
1641 solve_join(is, i, 1, 0); 1653 solve_join(is, i, 1, false);
1642 didsth = 1; 1654 didsth = true;
1643 } 1655 }
1644 1656
1645 map_update_possibles(is->state); 1657 map_update_possibles(is->state);
1646 } 1658 }
1647 1659
1648 if (didsth) *didsth_r = didsth; 1660 if (didsth) *didsth_r = didsth;
1649 return 1; 1661 return true;
1650} 1662}
1651 1663
1652#define CONTINUE_IF_FULL do { \ 1664#define CONTINUE_IF_FULL do { \
@@ -1658,10 +1670,10 @@ if (GRID(state, is->x, is->y) & G_MARK) { \
1658static int solve_sub(game_state *state, int difficulty, int depth) 1670static int solve_sub(game_state *state, int difficulty, int depth)
1659{ 1671{
1660 struct island *is; 1672 struct island *is;
1661 int i, didsth; 1673 int i;
1662 1674
1663 while (1) { 1675 while (1) {
1664 didsth = 0; 1676 bool didsth = false;
1665 1677
1666 /* First island iteration: things we can work out by looking at 1678 /* First island iteration: things we can work out by looking at
1667 * properties of the island as a whole. */ 1679 * properties of the island as a whole. */
@@ -1747,7 +1759,8 @@ static game_state *new_state(const game_params *params)
1747 ret->gridi = snewn(wh, struct island *); 1759 ret->gridi = snewn(wh, struct island *);
1748 for (i = 0; i < wh; i++) ret->gridi[i] = NULL; 1760 for (i = 0; i < wh; i++) ret->gridi[i] = NULL;
1749 1761
1750 ret->solved = ret->completed = 0; 1762 ret->solved = false;
1763 ret->completed = false;
1751 1764
1752 ret->solver = snew(struct solver_state); 1765 ret->solver = snew(struct solver_state);
1753 ret->solver->dsf = snew_dsf(wh); 1766 ret->solver->dsf = snew_dsf(wh);
@@ -1820,7 +1833,7 @@ static void free_game(game_state *state)
1820#define ORDER(a,b) do { if (a < b) { int tmp=a; int a=b; int b=tmp; } } while(0) 1833#define ORDER(a,b) do { if (a < b) { int tmp=a; int a=b; int b=tmp; } } while(0)
1821 1834
1822static char *new_game_desc(const game_params *params, random_state *rs, 1835static char *new_game_desc(const game_params *params, random_state *rs,
1823 char **aux, int interactive) 1836 char **aux, bool interactive)
1824{ 1837{
1825 game_state *tobuild = NULL; 1838 game_state *tobuild = NULL;
1826 int i, j, wh = params->w * params->h, x, y, dx, dy; 1839 int i, j, wh = params->w * params->h, x, y, dx, dy;
@@ -1920,7 +1933,7 @@ foundmax:
1920 1933
1921 ni_curr++; ni_bad = 0; 1934 ni_curr++; ni_bad = 0;
1922join: 1935join:
1923 island_join(is, is2, random_upto(rs, tobuild->maxb)+1, 0); 1936 island_join(is, is2, random_upto(rs, tobuild->maxb)+1, false);
1924 debug_state(tobuild); 1937 debug_state(tobuild);
1925 continue; 1938 continue;
1926 1939
@@ -2079,17 +2092,19 @@ struct game_ui {
2079 int dragx_src, dragy_src; /* source; -1 means no drag */ 2092 int dragx_src, dragy_src; /* source; -1 means no drag */
2080 int dragx_dst, dragy_dst; /* src's closest orth island. */ 2093 int dragx_dst, dragy_dst; /* src's closest orth island. */
2081 grid_type todraw; 2094 grid_type todraw;
2082 int dragging, drag_is_noline, nlines; 2095 bool dragging, drag_is_noline;
2096 int nlines;
2083 2097
2084 int cur_x, cur_y, cur_visible; /* cursor position */ 2098 int cur_x, cur_y; /* cursor position */
2085 int show_hints; 2099 bool cur_visible;
2100 bool show_hints;
2086}; 2101};
2087 2102
2088static char *ui_cancel_drag(game_ui *ui) 2103static char *ui_cancel_drag(game_ui *ui)
2089{ 2104{
2090 ui->dragx_src = ui->dragy_src = -1; 2105 ui->dragx_src = ui->dragy_src = -1;
2091 ui->dragx_dst = ui->dragy_dst = -1; 2106 ui->dragx_dst = ui->dragy_dst = -1;
2092 ui->dragging = 0; 2107 ui->dragging = false;
2093 return UI_UPDATE; 2108 return UI_UPDATE;
2094} 2109}
2095 2110
@@ -2099,8 +2114,8 @@ static game_ui *new_ui(const game_state *state)
2099 ui_cancel_drag(ui); 2114 ui_cancel_drag(ui);
2100 ui->cur_x = state->islands[0].x; 2115 ui->cur_x = state->islands[0].x;
2101 ui->cur_y = state->islands[0].y; 2116 ui->cur_y = state->islands[0].y;
2102 ui->cur_visible = 0; 2117 ui->cur_visible = false;
2103 ui->show_hints = 0; 2118 ui->show_hints = false;
2104 return ui; 2119 return ui;
2105} 2120}
2106 2121
@@ -2128,7 +2143,7 @@ struct game_drawstate {
2128 int w, h; 2143 int w, h;
2129 unsigned long *grid, *newgrid; 2144 unsigned long *grid, *newgrid;
2130 int *lv, *lh; 2145 int *lv, *lh;
2131 int started, dragging; 2146 bool started, dragging;
2132}; 2147};
2133 2148
2134/* 2149/*
@@ -2312,12 +2327,12 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2312 int gx = FROMCOORD(x), gy = FROMCOORD(y); 2327 int gx = FROMCOORD(x), gy = FROMCOORD(y);
2313 char buf[80], *ret; 2328 char buf[80], *ret;
2314 grid_type ggrid = INGRID(state,gx,gy) ? GRID(state,gx,gy) : 0; 2329 grid_type ggrid = INGRID(state,gx,gy) ? GRID(state,gx,gy) : 0;
2315 int shift = button & MOD_SHFT, control = button & MOD_CTRL; 2330 bool shift = button & MOD_SHFT, control = button & MOD_CTRL;
2316 button &= ~MOD_MASK; 2331 button &= ~MOD_MASK;
2317 2332
2318 if (button == LEFT_BUTTON || button == RIGHT_BUTTON) { 2333 if (button == LEFT_BUTTON || button == RIGHT_BUTTON) {
2319 if (!INGRID(state, gx, gy)) return NULL; 2334 if (!INGRID(state, gx, gy)) return NULL;
2320 ui->cur_visible = 0; 2335 ui->cur_visible = false;
2321 if (ggrid & G_ISLAND) { 2336 if (ggrid & G_ISLAND) {
2322 ui->dragx_src = gx; 2337 ui->dragx_src = gx;
2323 ui->dragy_src = gy; 2338 ui->dragy_src = gy;
@@ -2328,8 +2343,8 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2328 if (INGRID(state, ui->dragx_src, ui->dragy_src) 2343 if (INGRID(state, ui->dragx_src, ui->dragy_src)
2329 && (gx != ui->dragx_src || gy != ui->dragy_src) 2344 && (gx != ui->dragx_src || gy != ui->dragy_src)
2330 && !(GRID(state,ui->dragx_src,ui->dragy_src) & G_MARK)) { 2345 && !(GRID(state,ui->dragx_src,ui->dragy_src) & G_MARK)) {
2331 ui->dragging = 1; 2346 ui->dragging = true;
2332 ui->drag_is_noline = (button == RIGHT_DRAG) ? 1 : 0; 2347 ui->drag_is_noline = (button == RIGHT_DRAG);
2333 return update_drag_dst(state, ui, ds, x, y); 2348 return update_drag_dst(state, ui, ds, x, y);
2334 } else { 2349 } else {
2335 /* cancel a drag when we go back to the starting point */ 2350 /* cancel a drag when we go back to the starting point */
@@ -2358,17 +2373,17 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2358 free_game(solved); 2373 free_game(solved);
2359 return ret; 2374 return ret;
2360 } else if (IS_CURSOR_MOVE(button)) { 2375 } else if (IS_CURSOR_MOVE(button)) {
2361 ui->cur_visible = 1; 2376 ui->cur_visible = true;
2362 if (control || shift) { 2377 if (control || shift) {
2363 ui->dragx_src = ui->cur_x; 2378 ui->dragx_src = ui->cur_x;
2364 ui->dragy_src = ui->cur_y; 2379 ui->dragy_src = ui->cur_y;
2365 ui->dragging = TRUE; 2380 ui->dragging = true;
2366 ui->drag_is_noline = !control; 2381 ui->drag_is_noline = !control;
2367 } 2382 }
2368 if (ui->dragging) { 2383 if (ui->dragging) {
2369 int nx = ui->cur_x, ny = ui->cur_y; 2384 int nx = ui->cur_x, ny = ui->cur_y;
2370 2385
2371 move_cursor(button, &nx, &ny, state->w, state->h, 0); 2386 move_cursor(button, &nx, &ny, state->w, state->h, false);
2372 if (nx == ui->cur_x && ny == ui->cur_y) 2387 if (nx == ui->cur_x && ny == ui->cur_y)
2373 return NULL; 2388 return NULL;
2374 update_drag_dst(state, ui, ds, 2389 update_drag_dst(state, ui, ds,
@@ -2398,23 +2413,25 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2398 * before closer islands slightly offset). Swap the order of 2413 * before closer islands slightly offset). Swap the order of
2399 * these two loops to change to breadth-first search. */ 2414 * these two loops to change to breadth-first search. */
2400 for (orth = 0; ; orth++) { 2415 for (orth = 0; ; orth++) {
2401 int oingrid = 0; 2416 bool oingrid = false;
2402 for (dir = 1; ; dir++) { 2417 for (dir = 1; ; dir++) {
2403 int dingrid = 0; 2418 bool dingrid = false;
2404 2419
2405 if (orth > dir) continue; /* only search in cone outwards. */ 2420 if (orth > dir) continue; /* only search in cone outwards. */
2406 2421
2407 nx = ui->cur_x + dir*dx + orth*dorthx*orthorder; 2422 nx = ui->cur_x + dir*dx + orth*dorthx*orthorder;
2408 ny = ui->cur_y + dir*dy + orth*dorthy*orthorder; 2423 ny = ui->cur_y + dir*dy + orth*dorthy*orthorder;
2409 if (INGRID(state, nx, ny)) { 2424 if (INGRID(state, nx, ny)) {
2410 dingrid = oingrid = 1; 2425 dingrid = true;
2426 oingrid = true;
2411 if (GRID(state, nx, ny) & G_ISLAND) goto found; 2427 if (GRID(state, nx, ny) & G_ISLAND) goto found;
2412 } 2428 }
2413 2429
2414 nx = ui->cur_x + dir*dx - orth*dorthx*orthorder; 2430 nx = ui->cur_x + dir*dx - orth*dorthx*orthorder;
2415 ny = ui->cur_y + dir*dy - orth*dorthy*orthorder; 2431 ny = ui->cur_y + dir*dy - orth*dorthy*orthorder;
2416 if (INGRID(state, nx, ny)) { 2432 if (INGRID(state, nx, ny)) {
2417 dingrid = oingrid = 1; 2433 dingrid = true;
2434 oingrid = true;
2418 if (GRID(state, nx, ny) & G_ISLAND) goto found; 2435 if (GRID(state, nx, ny) & G_ISLAND) goto found;
2419 } 2436 }
2420 2437
@@ -2431,7 +2448,7 @@ found:
2431 } 2448 }
2432 } else if (IS_CURSOR_SELECT(button)) { 2449 } else if (IS_CURSOR_SELECT(button)) {
2433 if (!ui->cur_visible) { 2450 if (!ui->cur_visible) {
2434 ui->cur_visible = 1; 2451 ui->cur_visible = true;
2435 return UI_UPDATE; 2452 return UI_UPDATE;
2436 } 2453 }
2437 if (ui->dragging || button == CURSOR_SELECT2) { 2454 if (ui->dragging || button == CURSOR_SELECT2) {
@@ -2444,11 +2461,11 @@ found:
2444 } else { 2461 } else {
2445 grid_type v = GRID(state, ui->cur_x, ui->cur_y); 2462 grid_type v = GRID(state, ui->cur_x, ui->cur_y);
2446 if (v & G_ISLAND) { 2463 if (v & G_ISLAND) {
2447 ui->dragging = 1; 2464 ui->dragging = true;
2448 ui->dragx_src = ui->cur_x; 2465 ui->dragx_src = ui->cur_x;
2449 ui->dragy_src = ui->cur_y; 2466 ui->dragy_src = ui->cur_y;
2450 ui->dragx_dst = ui->dragy_dst = -1; 2467 ui->dragx_dst = ui->dragy_dst = -1;
2451 ui->drag_is_noline = (button == CURSOR_SELECT2) ? 1 : 0; 2468 ui->drag_is_noline = (button == CURSOR_SELECT2);
2452 return UI_UPDATE; 2469 return UI_UPDATE;
2453 } 2470 }
2454 } 2471 }
@@ -2466,7 +2483,7 @@ found:
2466 number = 10 + button - 'A'; 2483 number = 10 + button - 'A';
2467 2484
2468 if (!ui->cur_visible) { 2485 if (!ui->cur_visible) {
2469 ui->cur_visible = 1; 2486 ui->cur_visible = true;
2470 return UI_UPDATE; 2487 return UI_UPDATE;
2471 } 2488 }
2472 2489
@@ -2498,7 +2515,7 @@ found:
2498 } else 2515 } else
2499 return NULL; 2516 return NULL;
2500 } else if (button == 'g' || button == 'G') { 2517 } else if (button == 'g' || button == 'G') {
2501 ui->show_hints = 1 - ui->show_hints; 2518 ui->show_hints = !ui->show_hints;
2502 return UI_UPDATE; 2519 return UI_UPDATE;
2503 } 2520 }
2504 2521
@@ -2518,7 +2535,7 @@ static game_state *execute_move(const game_state *state, const char *move)
2518 while (*move) { 2535 while (*move) {
2519 c = *move++; 2536 c = *move++;
2520 if (c == 'S') { 2537 if (c == 'S') {
2521 ret->solved = TRUE; 2538 ret->solved = true;
2522 n = 0; 2539 n = 0;
2523 } else if (c == 'L') { 2540 } else if (c == 'L') {
2524 if (sscanf(move, "%d,%d,%d,%d,%d%n", 2541 if (sscanf(move, "%d,%d,%d,%d,%d%n",
@@ -2530,7 +2547,7 @@ static game_state *execute_move(const game_state *state, const char *move)
2530 is2 = INDEX(ret, gridi, x2, y2); 2547 is2 = INDEX(ret, gridi, x2, y2);
2531 if (!is1 || !is2) goto badmove; 2548 if (!is1 || !is2) goto badmove;
2532 if (nl < 0 || nl > state->maxb) goto badmove; 2549 if (nl < 0 || nl > state->maxb) goto badmove;
2533 island_join(is1, is2, nl, 0); 2550 island_join(is1, is2, nl, false);
2534 } else if (c == 'N') { 2551 } else if (c == 'N') {
2535 if (sscanf(move, "%d,%d,%d,%d%n", 2552 if (sscanf(move, "%d,%d,%d,%d%n",
2536 &x1, &y1, &x2, &y2, &n) != 4) 2553 &x1, &y1, &x2, &y2, &n) != 4)
@@ -2540,7 +2557,7 @@ static game_state *execute_move(const game_state *state, const char *move)
2540 is1 = INDEX(ret, gridi, x1, y1); 2557 is1 = INDEX(ret, gridi, x1, y1);
2541 is2 = INDEX(ret, gridi, x2, y2); 2558 is2 = INDEX(ret, gridi, x2, y2);
2542 if (!is1 || !is2) goto badmove; 2559 if (!is1 || !is2) goto badmove;
2543 island_join(is1, is2, -1, 0); 2560 island_join(is1, is2, -1, false);
2544 } else if (c == 'M') { 2561 } else if (c == 'M') {
2545 if (sscanf(move, "%d,%d%n", 2562 if (sscanf(move, "%d,%d%n",
2546 &x1, &y1, &n) != 2) 2563 &x1, &y1, &n) != 2)
@@ -2562,7 +2579,7 @@ static game_state *execute_move(const game_state *state, const char *move)
2562 map_update_possibles(ret); 2579 map_update_possibles(ret);
2563 if (map_check(ret)) { 2580 if (map_check(ret)) {
2564 debug(("Game completed.\n")); 2581 debug(("Game completed.\n"));
2565 ret->completed = 1; 2582 ret->completed = true;
2566 } 2583 }
2567 return ret; 2584 return ret;
2568 2585
@@ -2660,8 +2677,8 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
2660 ds->tilesize = 0; 2677 ds->tilesize = 0;
2661 ds->w = state->w; 2678 ds->w = state->w;
2662 ds->h = state->h; 2679 ds->h = state->h;
2663 ds->started = 0; 2680 ds->started = false;
2664 ds->dragging = 0; 2681 ds->dragging = false;
2665 ds->grid = snewn(wh, unsigned long); 2682 ds->grid = snewn(wh, unsigned long);
2666 for (i = 0; i < wh; i++) 2683 for (i = 0; i < wh; i++)
2667 ds->grid[i] = ~0UL; 2684 ds->grid[i] = ~0UL;
@@ -2688,8 +2705,8 @@ static void game_free_drawstate(drawing *dr, game_drawstate *ds)
2688 2705
2689#define OFFSET(thing) ((TILE_SIZE/2) - ((thing)/2)) 2706#define OFFSET(thing) ((TILE_SIZE/2) - ((thing)/2))
2690 2707
2691static int between_island(const game_state *state, int sx, int sy, 2708static bool between_island(const game_state *state, int sx, int sy,
2692 int dx, int dy) 2709 int dx, int dy)
2693{ 2710{
2694 int x = sx - dx, y = sy - dy; 2711 int x = sx - dx, y = sy - dy;
2695 2712
@@ -2697,14 +2714,14 @@ static int between_island(const game_state *state, int sx, int sy,
2697 if (GRID(state, x, y) & G_ISLAND) goto found; 2714 if (GRID(state, x, y) & G_ISLAND) goto found;
2698 x -= dx; y -= dy; 2715 x -= dx; y -= dy;
2699 } 2716 }
2700 return 0; 2717 return false;
2701found: 2718found:
2702 x = sx + dx, y = sy + dy; 2719 x = sx + dx, y = sy + dy;
2703 while (INGRID(state, x, y)) { 2720 while (INGRID(state, x, y)) {
2704 if (GRID(state, x, y) & G_ISLAND) return 1; 2721 if (GRID(state, x, y) & G_ISLAND) return true;
2705 x += dx; y += dy; 2722 x += dx; y += dy;
2706 } 2723 }
2707 return 0; 2724 return false;
2708} 2725}
2709 2726
2710static void lines_lvlh(const game_state *state, const game_ui *ui, 2727static void lines_lvlh(const game_state *state, const game_ui *ui,
@@ -2945,12 +2962,13 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2945 float animtime, float flashtime) 2962 float animtime, float flashtime)
2946{ 2963{
2947 int x, y, lv, lh; 2964 int x, y, lv, lh;
2948 grid_type v, flash = 0; 2965 grid_type v;
2966 bool flash = false;
2949 struct island *is, *is_drag_src = NULL, *is_drag_dst = NULL; 2967 struct island *is, *is_drag_src = NULL, *is_drag_dst = NULL;
2950 2968
2951 if (flashtime) { 2969 if (flashtime) {
2952 int f = (int)(flashtime * 5 / FLASH_TIME); 2970 int f = (int)(flashtime * 5 / FLASH_TIME);
2953 if (f == 1 || f == 3) flash = TRUE; 2971 if (f == 1 || f == 3) flash = true;
2954 } 2972 }
2955 2973
2956 /* Clear screen, if required. */ 2974 /* Clear screen, if required. */
@@ -2967,11 +2985,11 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2967 draw_update(dr, 0, 0, 2985 draw_update(dr, 0, 0,
2968 TILE_SIZE * ds->w + 2 * BORDER, 2986 TILE_SIZE * ds->w + 2 * BORDER,
2969 TILE_SIZE * ds->h + 2 * BORDER); 2987 TILE_SIZE * ds->h + 2 * BORDER);
2970 ds->started = 1; 2988 ds->started = true;
2971 } 2989 }
2972 2990
2973 if (ui->dragx_src != -1 && ui->dragy_src != -1) { 2991 if (ui->dragx_src != -1 && ui->dragy_src != -1) {
2974 ds->dragging = 1; 2992 ds->dragging = true;
2975 is_drag_src = INDEX(state, gridi, ui->dragx_src, ui->dragy_src); 2993 is_drag_src = INDEX(state, gridi, ui->dragx_src, ui->dragy_src);
2976 assert(is_drag_src); 2994 assert(is_drag_src);
2977 if (ui->dragx_dst != -1 && ui->dragy_dst != -1) { 2995 if (ui->dragx_dst != -1 && ui->dragy_dst != -1) {
@@ -2979,7 +2997,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2979 assert(is_drag_dst); 2997 assert(is_drag_dst);
2980 } 2998 }
2981 } else 2999 } else
2982 ds->dragging = 0; 3000 ds->dragging = false;
2983 3001
2984 /* 3002 /*
2985 * Set up ds->newgrid with the current grid contents. 3003 * Set up ds->newgrid with the current grid contents.
@@ -3031,7 +3049,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
3031 INDEX(ds,newgrid,x,y+1) |= idata << D_L_ISLAND_SHIFT_U; 3049 INDEX(ds,newgrid,x,y+1) |= idata << D_L_ISLAND_SHIFT_U;
3032 } else { 3050 } else {
3033 unsigned long hdata, vdata; 3051 unsigned long hdata, vdata;
3034 int selh = FALSE, selv = FALSE; 3052 bool selh = false, selv = false;
3035 3053
3036 /* 3054 /*
3037 * A line (non-island) square. Compute the drawing 3055 * A line (non-island) square. Compute the drawing
@@ -3044,9 +3062,9 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
3044 WITHIN(x,is_drag_src->x, is_drag_dst->x) && 3062 WITHIN(x,is_drag_src->x, is_drag_dst->x) &&
3045 WITHIN(y,is_drag_src->y, is_drag_dst->y)) { 3063 WITHIN(y,is_drag_src->y, is_drag_dst->y)) {
3046 if (is_drag_src->x != is_drag_dst->x) 3064 if (is_drag_src->x != is_drag_dst->x)
3047 selh = TRUE; 3065 selh = true;
3048 else 3066 else
3049 selv = TRUE; 3067 selv = true;
3050 } 3068 }
3051 lines_lvlh(state, ui, x, y, v, &lv, &lh); 3069 lines_lvlh(state, ui, x, y, v, &lv, &lh);
3052 3070
@@ -3145,9 +3163,9 @@ static int game_status(const game_state *state)
3145 return state->completed ? +1 : 0; 3163 return state->completed ? +1 : 0;
3146} 3164}
3147 3165
3148static int game_timing_state(const game_state *state, game_ui *ui) 3166static bool game_timing_state(const game_state *state, game_ui *ui)
3149{ 3167{
3150 return TRUE; 3168 return true;
3151} 3169}
3152 3170
3153static void game_print_size(const game_params *params, float *x, float *y) 3171static void game_print_size(const game_params *params, float *x, float *y)
@@ -3225,15 +3243,15 @@ const struct game thegame = {
3225 encode_params, 3243 encode_params,
3226 free_params, 3244 free_params,
3227 dup_params, 3245 dup_params,
3228 TRUE, game_configure, custom_params, 3246 true, game_configure, custom_params,
3229 validate_params, 3247 validate_params,
3230 new_game_desc, 3248 new_game_desc,
3231 validate_desc, 3249 validate_desc,
3232 new_game, 3250 new_game,
3233 dup_game, 3251 dup_game,
3234 free_game, 3252 free_game,
3235 TRUE, solve_game, 3253 true, solve_game,
3236 TRUE, game_can_format_as_text_now, game_text_format, 3254 true, game_can_format_as_text_now, game_text_format,
3237 new_ui, 3255 new_ui,
3238 free_ui, 3256 free_ui,
3239 encode_ui, 3257 encode_ui,
@@ -3250,9 +3268,9 @@ const struct game thegame = {
3250 game_anim_length, 3268 game_anim_length,
3251 game_flash_length, 3269 game_flash_length,
3252 game_status, 3270 game_status,
3253 TRUE, FALSE, game_print_size, game_print, 3271 true, false, game_print_size, game_print,
3254 FALSE, /* wants_statusbar */ 3272 false, /* wants_statusbar */
3255 FALSE, game_timing_state, 3273 false, game_timing_state,
3256 REQUIRE_RBUTTON, /* flags */ 3274 REQUIRE_RBUTTON, /* flags */
3257}; 3275};
3258 3276
diff --git a/apps/plugins/puzzles/src/cube.c b/apps/plugins/puzzles/src/cube.c
index 749156564d..bda7623f97 100644
--- a/apps/plugins/puzzles/src/cube.c
+++ b/apps/plugins/puzzles/src/cube.c
@@ -178,7 +178,7 @@ struct grid_square {
178 int npoints; 178 int npoints;
179 float points[8]; /* maximum */ 179 float points[8]; /* maximum */
180 int directions[8]; /* bit masks showing point pairs */ 180 int directions[8]; /* bit masks showing point pairs */
181 int flip; 181 bool flip;
182 int tetra_class; 182 int tetra_class;
183}; 183};
184 184
@@ -220,7 +220,7 @@ struct game_state {
220 int dpkey[2]; /* key-point indices into polyhedron */ 220 int dpkey[2]; /* key-point indices into polyhedron */
221 int previous; 221 int previous;
222 float angle; 222 float angle;
223 int completed; 223 int completed; /* stores move count at completion */
224 int movecount; 224 int movecount;
225}; 225};
226 226
@@ -235,7 +235,7 @@ static game_params *default_params(void)
235 return ret; 235 return ret;
236} 236}
237 237
238static int game_fetch_preset(int i, char **name, game_params **params) 238static bool game_fetch_preset(int i, char **name, game_params **params)
239{ 239{
240 game_params *ret = snew(game_params); 240 game_params *ret = snew(game_params);
241 const char *str; 241 const char *str;
@@ -267,12 +267,12 @@ static int game_fetch_preset(int i, char **name, game_params **params)
267 break; 267 break;
268 default: 268 default:
269 sfree(ret); 269 sfree(ret);
270 return FALSE; 270 return false;
271 } 271 }
272 272
273 *name = dupstr(str); 273 *name = dupstr(str);
274 *params = ret; 274 *params = ret;
275 return TRUE; 275 return true;
276} 276}
277 277
278static void free_params(game_params *params) 278static void free_params(game_params *params)
@@ -304,7 +304,7 @@ static void decode_params(game_params *ret, char const *string)
304 } 304 }
305} 305}
306 306
307static char *encode_params(const game_params *params, int full) 307static char *encode_params(const game_params *params, bool full)
308{ 308{
309 char data[256]; 309 char data[256];
310 310
@@ -348,7 +348,7 @@ static void enum_grid_squares(const game_params *params, egc_callback callback,
348 sq.directions[DOWN_LEFT] = 0; /* no diagonals in a square */ 348 sq.directions[DOWN_LEFT] = 0; /* no diagonals in a square */
349 sq.directions[DOWN_RIGHT] = 0; /* no diagonals in a square */ 349 sq.directions[DOWN_RIGHT] = 0; /* no diagonals in a square */
350 350
351 sq.flip = FALSE; 351 sq.flip = false;
352 352
353 /* 353 /*
354 * This is supremely irrelevant, but just to avoid 354 * This is supremely irrelevant, but just to avoid
@@ -406,7 +406,7 @@ static void enum_grid_squares(const game_params *params, egc_callback callback,
406 sq.directions[DOWN_LEFT] = sq.directions[LEFT]; 406 sq.directions[DOWN_LEFT] = sq.directions[LEFT];
407 sq.directions[DOWN_RIGHT] = sq.directions[RIGHT]; 407 sq.directions[DOWN_RIGHT] = sq.directions[RIGHT];
408 408
409 sq.flip = TRUE; 409 sq.flip = true;
410 410
411 if (firstix < 0) 411 if (firstix < 0)
412 firstix = ix & 3; 412 firstix = ix & 3;
@@ -451,7 +451,7 @@ static void enum_grid_squares(const game_params *params, egc_callback callback,
451 sq.directions[UP_LEFT] = sq.directions[LEFT]; 451 sq.directions[UP_LEFT] = sq.directions[LEFT];
452 sq.directions[UP_RIGHT] = sq.directions[RIGHT]; 452 sq.directions[UP_RIGHT] = sq.directions[RIGHT];
453 453
454 sq.flip = FALSE; 454 sq.flip = false;
455 455
456 if (firstix < 0) 456 if (firstix < 0)
457 firstix = (ix - 1) & 3; 457 firstix = (ix - 1) & 3;
@@ -534,7 +534,7 @@ static void count_grid_square_callback(void *ctx, struct grid_square *sq)
534 classes[thisclass]++; 534 classes[thisclass]++;
535} 535}
536 536
537static const char *validate_params(const game_params *params, int full) 537static const char *validate_params(const game_params *params, bool full)
538{ 538{
539 int classes[5]; 539 int classes[5];
540 int i; 540 int i;
@@ -543,8 +543,8 @@ static const char *validate_params(const game_params *params, int full)
543 return "Unrecognised solid type"; 543 return "Unrecognised solid type";
544 544
545 if (solids[params->solid]->order == 4) { 545 if (solids[params->solid]->order == 4) {
546 if (params->d1 <= 0 || params->d2 <= 0) 546 if (params->d1 <= 1 || params->d2 <= 1)
547 return "Both grid dimensions must be greater than zero"; 547 return "Both grid dimensions must be greater than one";
548 } else { 548 } else {
549 if (params->d1 <= 0 && params->d2 <= 0) 549 if (params->d1 <= 0 && params->d2 <= 0)
550 return "At least one grid dimension must be greater than zero"; 550 return "At least one grid dimension must be greater than zero";
@@ -595,11 +595,11 @@ static void classify_grid_square_callback(void *ctx, struct grid_square *sq)
595} 595}
596 596
597static char *new_game_desc(const game_params *params, random_state *rs, 597static char *new_game_desc(const game_params *params, random_state *rs,
598 char **aux, int interactive) 598 char **aux, bool interactive)
599{ 599{
600 struct grid_data data; 600 struct grid_data data;
601 int i, j, k, m, area, facesperclass; 601 int i, j, k, m, area, facesperclass;
602 int *flags; 602 bool *flags;
603 char *desc, *p; 603 char *desc, *p;
604 604
605 /* 605 /*
@@ -634,16 +634,16 @@ static char *new_game_desc(const game_params *params, random_state *rs,
634 * So now we know how many faces to allocate in each class. Get 634 * So now we know how many faces to allocate in each class. Get
635 * on with it. 635 * on with it.
636 */ 636 */
637 flags = snewn(area, int); 637 flags = snewn(area, bool);
638 for (i = 0; i < area; i++) 638 for (i = 0; i < area; i++)
639 flags[i] = FALSE; 639 flags[i] = false;
640 640
641 for (i = 0; i < data.nclasses; i++) { 641 for (i = 0; i < data.nclasses; i++) {
642 for (j = 0; j < facesperclass; j++) { 642 for (j = 0; j < facesperclass; j++) {
643 int n = random_upto(rs, data.nsquares[i]); 643 int n = random_upto(rs, data.nsquares[i]);
644 644
645 assert(!flags[data.gridptrs[i][n]]); 645 assert(!flags[data.gridptrs[i][n]]);
646 flags[data.gridptrs[i][n]] = TRUE; 646 flags[data.gridptrs[i][n]] = true;
647 647
648 /* 648 /*
649 * Move everything else up the array. I ought to use a 649 * Move everything else up the array. I ought to use a
@@ -727,8 +727,8 @@ static int lowest_face(const struct solid *solid)
727 return best; 727 return best;
728} 728}
729 729
730static int align_poly(const struct solid *solid, struct grid_square *sq, 730static bool align_poly(const struct solid *solid, struct grid_square *sq,
731 int *pkey) 731 int *pkey)
732{ 732{
733 float zmin; 733 float zmin;
734 int i, j; 734 int i, j;
@@ -768,14 +768,14 @@ static int align_poly(const struct solid *solid, struct grid_square *sq,
768 } 768 }
769 769
770 if (matches != 1 || index < 0) 770 if (matches != 1 || index < 0)
771 return FALSE; 771 return false;
772 pkey[j] = index; 772 pkey[j] = index;
773 } 773 }
774 774
775 return TRUE; 775 return true;
776} 776}
777 777
778static void flip_poly(struct solid *solid, int flip) 778static void flip_poly(struct solid *solid, bool flip)
779{ 779{
780 int i; 780 int i;
781 781
@@ -791,7 +791,7 @@ static void flip_poly(struct solid *solid, int flip)
791 } 791 }
792} 792}
793 793
794static struct solid *transform_poly(const struct solid *solid, int flip, 794static struct solid *transform_poly(const struct solid *solid, bool flip,
795 int key0, int key1, float angle) 795 int key0, int key1, float angle)
796{ 796{
797 struct solid *ret = snew(struct solid); 797 struct solid *ret = snew(struct solid);
@@ -918,7 +918,7 @@ static game_state *new_game(midend *me, const game_params *params,
918 break; 918 break;
919 } 919 }
920 if (v & j) 920 if (v & j)
921 SET_SQUARE(state, i, TRUE); 921 SET_SQUARE(state, i, true);
922 j >>= 1; 922 j >>= 1;
923 if (j == 0) 923 if (j == 0)
924 j = 8; 924 j = 8;
@@ -938,7 +938,7 @@ static game_state *new_game(midend *me, const game_params *params,
938 */ 938 */
939 { 939 {
940 int pkey[4]; 940 int pkey[4];
941 int ret; 941 bool ret;
942 942
943 ret = align_poly(state->solid, &state->grid->squares[state->current], pkey); 943 ret = align_poly(state->solid, &state->grid->squares[state->current], pkey);
944 assert(ret); 944 assert(ret);
@@ -1005,9 +1005,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1005 return NULL; 1005 return NULL;
1006} 1006}
1007 1007
1008static int game_can_format_as_text_now(const game_params *params) 1008static bool game_can_format_as_text_now(const game_params *params)
1009{ 1009{
1010 return TRUE; 1010 return true;
1011} 1011}
1012 1012
1013static char *game_text_format(const game_state *state) 1013static char *game_text_format(const game_state *state)
@@ -1312,7 +1312,7 @@ static game_state *execute_move(const game_state *from, const char *move)
1312 */ 1312 */
1313 { 1313 {
1314 int all_pkey[4]; 1314 int all_pkey[4];
1315 int success; 1315 bool success;
1316 1316
1317 if (from->solid->order == 4 && direction == UP) 1317 if (from->solid->order == 4 && direction == UP)
1318 angle = -angle; /* HACK */ 1318 angle = -angle; /* HACK */
@@ -1418,7 +1418,7 @@ static game_state *execute_move(const game_state *from, const char *move)
1418 */ 1418 */
1419 { 1419 {
1420 int pkey[4]; 1420 int pkey[4];
1421 int success; 1421 bool success;
1422 1422
1423 success = align_poly(ret->solid, &ret->grid->squares[ret->current], pkey); 1423 success = align_poly(ret->solid, &ret->grid->squares[ret->current], pkey);
1424 assert(success); 1424 assert(success);
@@ -1713,9 +1713,9 @@ static int game_status(const game_state *state)
1713 return state->completed ? +1 : 0; 1713 return state->completed ? +1 : 0;
1714} 1714}
1715 1715
1716static int game_timing_state(const game_state *state, game_ui *ui) 1716static bool game_timing_state(const game_state *state, game_ui *ui)
1717{ 1717{
1718 return TRUE; 1718 return true;
1719} 1719}
1720 1720
1721static void game_print_size(const game_params *params, float *x, float *y) 1721static void game_print_size(const game_params *params, float *x, float *y)
@@ -1738,15 +1738,15 @@ const struct game thegame = {
1738 encode_params, 1738 encode_params,
1739 free_params, 1739 free_params,
1740 dup_params, 1740 dup_params,
1741 TRUE, game_configure, custom_params, 1741 true, game_configure, custom_params,
1742 validate_params, 1742 validate_params,
1743 new_game_desc, 1743 new_game_desc,
1744 validate_desc, 1744 validate_desc,
1745 new_game, 1745 new_game,
1746 dup_game, 1746 dup_game,
1747 free_game, 1747 free_game,
1748 FALSE, solve_game, 1748 false, solve_game,
1749 FALSE, game_can_format_as_text_now, game_text_format, 1749 false, game_can_format_as_text_now, game_text_format,
1750 new_ui, 1750 new_ui,
1751 free_ui, 1751 free_ui,
1752 encode_ui, 1752 encode_ui,
@@ -1763,8 +1763,8 @@ const struct game thegame = {
1763 game_anim_length, 1763 game_anim_length,
1764 game_flash_length, 1764 game_flash_length,
1765 game_status, 1765 game_status,
1766 FALSE, FALSE, game_print_size, game_print, 1766 false, false, game_print_size, game_print,
1767 TRUE, /* wants_statusbar */ 1767 true, /* wants_statusbar */
1768 FALSE, game_timing_state, 1768 false, game_timing_state,
1769 0, /* flags */ 1769 0, /* flags */
1770}; 1770};
diff --git a/apps/plugins/puzzles/src/devel.but b/apps/plugins/puzzles/src/devel.but
index f30e8eecda..9f95ad7dd4 100644
--- a/apps/plugins/puzzles/src/devel.but
+++ b/apps/plugins/puzzles/src/devel.but
@@ -389,23 +389,23 @@ with the default values, and returns a pointer to it.
389 389
390\S{backend-fetch-preset} \cw{fetch_preset()} 390\S{backend-fetch-preset} \cw{fetch_preset()}
391 391
392\c int (*fetch_preset)(int i, char **name, game_params **params); 392\c bool (*fetch_preset)(int i, char **name, game_params **params);
393 393
394This function is one of the two APIs a back end can provide to 394This function is one of the two APIs a back end can provide to
395populate the \q{Type} menu, which provides a list of conveniently 395populate the \q{Type} menu, which provides a list of conveniently
396accessible preset parameters for most games. 396accessible preset parameters for most games.
397 397
398The function is called with \c{i} equal to the index of the preset 398The function is called with \c{i} equal to the index of the preset
399required (numbering from zero). It returns \cw{FALSE} if that preset 399required (numbering from zero). It returns \cw{false} if that preset
400does not exist (if \c{i} is less than zero or greater than the 400does not exist (if \c{i} is less than zero or greater than the
401largest preset index). Otherwise, it sets \c{*params} to point at a 401largest preset index). Otherwise, it sets \c{*params} to point at a
402newly allocated \c{game_params} structure containing the preset 402newly allocated \c{game_params} structure containing the preset
403information, sets \c{*name} to point at a newly allocated C string 403information, sets \c{*name} to point at a newly allocated C string
404containing the preset title (to go on the \q{Type} menu), and 404containing the preset title (to go on the \q{Type} menu), and
405returns \cw{TRUE}. 405returns \cw{true}.
406 406
407If the game does not wish to support any presets at all, this 407If the game does not wish to support any presets at all, this
408function is permitted to return \cw{FALSE} always. 408function is permitted to return \cw{false} always.
409 409
410If the game wants to return presets in the form of a hierarchical menu 410If the game wants to return presets in the form of a hierarchical menu
411instead of a flat list (and, indeed, even if it doesn't), then it may 411instead of a flat list (and, indeed, even if it doesn't), then it may
@@ -436,7 +436,7 @@ from the game, and before passing it on to the front end.
436 436
437\S{backend-encode-params} \cw{encode_params()} 437\S{backend-encode-params} \cw{encode_params()}
438 438
439\c char *(*encode_params)(const game_params *params, int full); 439\c char *(*encode_params)(const game_params *params, bool full);
440 440
441The job of this function is to take a \c{game_params}, and encode it 441The job of this function is to take a \c{game_params}, and encode it
442in a string form for use in game IDs. The return value must be a 442in a string form for use in game IDs. The return value must be a
@@ -460,10 +460,10 @@ letter denoting a parameter, followed optionally by a number giving
460the value of that parameter, with a few mandatory parts at the 460the value of that parameter, with a few mandatory parts at the
461beginning such as numeric width and height separated by \cq{x}.) 461beginning such as numeric width and height separated by \cq{x}.)
462 462
463If the \c{full} parameter is \cw{TRUE}, this function should encode 463If the \c{full} parameter is \cw{true}, this function should encode
464absolutely everything in the \c{game_params}, such that a subsequent 464absolutely everything in the \c{game_params}, such that a subsequent
465call to \cw{decode_params()} (\k{backend-decode-params}) will yield 465call to \cw{decode_params()} (\k{backend-decode-params}) will yield
466an identical structure. If \c{full} is \cw{FALSE}, however, you 466an identical structure. If \c{full} is \cw{false}, however, you
467should leave out anything which is not necessary to describe a 467should leave out anything which is not necessary to describe a
468\e{specific puzzle instance}, i.e. anything which only takes effect 468\e{specific puzzle instance}, i.e. anything which only takes effect
469when a new puzzle is \e{generated}. For example, the Solo 469when a new puzzle is \e{generated}. For example, the Solo
@@ -529,13 +529,13 @@ provided as input. It returns a pointer to the new duplicate.
529 529
530\S{backend-can-configure} \c{can_configure} 530\S{backend-can-configure} \c{can_configure}
531 531
532\c int can_configure; 532\c bool can_configure;
533 533
534This boolean data element is set to \cw{TRUE} if the back end 534This data element is set to \cw{true} if the back end supports custom
535supports custom parameter configuration via a dialog box. If it is 535parameter configuration via a dialog box. If it is \cw{true}, then the
536\cw{TRUE}, then the functions \cw{configure()} and 536functions \cw{configure()} and \cw{custom_params()} are expected to
537\cw{custom_params()} are expected to work. See \k{backend-configure} 537work. See \k{backend-configure} and \k{backend-custom-params} for more
538and \k{backend-custom-params} for more details. 538details.
539 539
540\S{backend-configure} \cw{configure()} 540\S{backend-configure} \cw{configure()}
541 541
@@ -665,7 +665,7 @@ function is never called and need not do anything at all.
665\S{backend-validate-params} \cw{validate_params()} 665\S{backend-validate-params} \cw{validate_params()}
666 666
667\c const char *(*validate_params)(const game_params *params, 667\c const char *(*validate_params)(const game_params *params,
668\c int full); 668\c bool full);
669 669
670This function takes a \c{game_params} structure as input, and checks 670This function takes a \c{game_params} structure as input, and checks
671that the parameters described in it fall within sensible limits. (At 671that the parameters described in it fall within sensible limits. (At
@@ -710,7 +710,7 @@ a descriptive-format game ID.
710\S{backend-new-desc} \cw{new_desc()} 710\S{backend-new-desc} \cw{new_desc()}
711 711
712\c char *(*new_desc)(const game_params *params, random_state *rs, 712\c char *(*new_desc)(const game_params *params, random_state *rs,
713\c char **aux, int interactive); 713\c char **aux, bool interactive);
714 714
715This function is where all the really hard work gets done. This is 715This function is where all the really hard work gets done. This is
716the function whose job is to randomly generate a new puzzle, 716the function whose job is to randomly generate a new puzzle,
@@ -1046,11 +1046,11 @@ punishable by assertion failure in the mid-end.
1046 1046
1047\S{backend-can-solve} \c{can_solve} 1047\S{backend-can-solve} \c{can_solve}
1048 1048
1049\c int can_solve; 1049\c bool can_solve;
1050 1050
1051This boolean field is set to \cw{TRUE} if the game's \cw{solve()} 1051This field is set to \cw{true} if the game's \cw{solve()} function
1052function does something. If it's set to \cw{FALSE}, the game will 1052does something. If it's set to \cw{false}, the game will not even
1053not even offer the \q{Solve} menu option. 1053offer the \q{Solve} menu option.
1054 1054
1055\S{backend-solve} \cw{solve()} 1055\S{backend-solve} \cw{solve()}
1056 1056
@@ -1370,27 +1370,27 @@ printing puzzles out on paper.
1370 1370
1371\S{backend-can-print} \c{can_print} 1371\S{backend-can-print} \c{can_print}
1372 1372
1373\c int can_print; 1373\c bool can_print;
1374 1374
1375This flag is set to \cw{TRUE} if the puzzle is capable of printing 1375This flag is set to \cw{true} if the puzzle is capable of printing
1376itself on paper. (This makes sense for some puzzles, such as Solo, 1376itself on paper. (This makes sense for some puzzles, such as Solo,
1377which can be filled in with a pencil. Other puzzles, such as 1377which can be filled in with a pencil. Other puzzles, such as
1378Twiddle, inherently involve moving things around and so would not 1378Twiddle, inherently involve moving things around and so would not
1379make sense to print.) 1379make sense to print.)
1380 1380
1381If this flag is \cw{FALSE}, then the functions \cw{print_size()} 1381If this flag is \cw{false}, then the functions \cw{print_size()}
1382and \cw{print()} will never be called. 1382and \cw{print()} will never be called.
1383 1383
1384\S{backend-can-print-in-colour} \c{can_print_in_colour} 1384\S{backend-can-print-in-colour} \c{can_print_in_colour}
1385 1385
1386\c int can_print_in_colour; 1386\c bool can_print_in_colour;
1387 1387
1388This flag is set to \cw{TRUE} if the puzzle is capable of printing 1388This flag is set to \cw{true} if the puzzle is capable of printing
1389itself differently when colour is available. For example, Map can 1389itself differently when colour is available. For example, Map can
1390actually print coloured regions in different \e{colours} rather than 1390actually print coloured regions in different \e{colours} rather than
1391resorting to cross-hatching. 1391resorting to cross-hatching.
1392 1392
1393If the \c{can_print} flag is \cw{FALSE}, then this flag will be 1393If the \c{can_print} flag is \cw{false}, then this flag will be
1394ignored. 1394ignored.
1395 1395
1396\S{backend-print-size} \cw{print_size()} 1396\S{backend-print-size} \cw{print_size()}
@@ -1462,31 +1462,31 @@ called.
1462 1462
1463\S{backend-can-format-as-text-ever} \c{can_format_as_text_ever} 1463\S{backend-can-format-as-text-ever} \c{can_format_as_text_ever}
1464 1464
1465\c int can_format_as_text_ever; 1465\c bool can_format_as_text_ever;
1466 1466
1467This boolean field is \cw{TRUE} if the game supports formatting a 1467This field is \cw{true} if the game supports formatting a
1468game state as ASCII text (typically ASCII art) for copying to the 1468game state as ASCII text (typically ASCII art) for copying to the
1469clipboard and pasting into other applications. If it is \cw{FALSE}, 1469clipboard and pasting into other applications. If it is \cw{false},
1470front ends will not offer the \q{Copy} command at all. 1470front ends will not offer the \q{Copy} command at all.
1471 1471
1472If this field is \cw{TRUE}, the game does not necessarily have to 1472If this field is \cw{true}, the game does not necessarily have to
1473support text formatting for \e{all} games: e.g. a game which can be 1473support text formatting for \e{all} games: e.g. a game which can be
1474played on a square grid or a triangular one might only support copy 1474played on a square grid or a triangular one might only support copy
1475and paste for the former, because triangular grids in ASCII art are 1475and paste for the former, because triangular grids in ASCII art are
1476just too difficult. 1476just too difficult.
1477 1477
1478If this field is \cw{FALSE}, the functions 1478If this field is \cw{false}, the functions
1479\cw{can_format_as_text_now()} (\k{backend-can-format-as-text-now}) 1479\cw{can_format_as_text_now()} (\k{backend-can-format-as-text-now})
1480and \cw{text_format()} (\k{backend-text-format}) are never called. 1480and \cw{text_format()} (\k{backend-text-format}) are never called.
1481 1481
1482\S{backend-can-format-as-text-now} \c{can_format_as_text_now()} 1482\S{backend-can-format-as-text-now} \c{can_format_as_text_now()}
1483 1483
1484\c int (*can_format_as_text_now)(const game_params *params); 1484\c bool (*can_format_as_text_now)(const game_params *params);
1485 1485
1486This function is passed a \c{game_params} and returns a boolean, 1486This function is passed a \c{game_params}, and returns \cw{true} if
1487which is \cw{TRUE} if the game can support ASCII text output for 1487the game can support ASCII text output for this particular game type.
1488this particular game type. If it returns \cw{FALSE}, front ends will 1488If it returns \cw{false}, front ends will grey out or otherwise
1489grey out or otherwise disable the \q{Copy} command. 1489disable the \q{Copy} command.
1490 1490
1491Games may enable and disable the copy-and-paste function for 1491Games may enable and disable the copy-and-paste function for
1492different game \e{parameters}, but are currently constrained to 1492different game \e{parameters}, but are currently constrained to
@@ -1530,28 +1530,28 @@ whether that should come with a newline or not.)
1530 1530
1531\S{backend-wants-statusbar} \cw{wants_statusbar} 1531\S{backend-wants-statusbar} \cw{wants_statusbar}
1532 1532
1533\c int wants_statusbar; 1533\c bool wants_statusbar;
1534 1534
1535This boolean field is set to \cw{TRUE} if the puzzle has a use for a 1535This field is set to \cw{true} if the puzzle has a use for a textual
1536textual status line (to display score, completion status, currently 1536status line (to display score, completion status, currently active
1537active tiles, etc). 1537tiles, etc).
1538 1538
1539\S{backend-is-timed} \c{is_timed} 1539\S{backend-is-timed} \c{is_timed}
1540 1540
1541\c int is_timed; 1541\c bool is_timed;
1542 1542
1543This boolean field is \cw{TRUE} if the puzzle is time-critical. If 1543This field is \cw{true} if the puzzle is time-critical. If
1544so, the mid-end will maintain a game timer while the user plays. 1544so, the mid-end will maintain a game timer while the user plays.
1545 1545
1546If this field is \cw{FALSE}, then \cw{timing_state()} will never be 1546If this field is \cw{false}, then \cw{timing_state()} will never be
1547called and need not do anything. 1547called and need not do anything.
1548 1548
1549\S{backend-timing-state} \cw{timing_state()} 1549\S{backend-timing-state} \cw{timing_state()}
1550 1550
1551\c int (*timing_state)(const game_state *state, game_ui *ui); 1551\c bool (*timing_state)(const game_state *state, game_ui *ui);
1552 1552
1553This function is passed the current \c{game_state} and the local 1553This function is passed the current \c{game_state} and the local
1554\c{game_ui}; it returns \cw{TRUE} if the game timer should currently 1554\c{game_ui}; it returns \cw{true} if the game timer should currently
1555be running. 1555be running.
1556 1556
1557A typical use for the \c{game_ui} in this function is to note when 1557A typical use for the \c{game_ui} in this function is to note when
@@ -2394,15 +2394,14 @@ capabilities.
2394 2394
2395\S{print-line-dotted} \cw{print_line_dotted()} 2395\S{print-line-dotted} \cw{print_line_dotted()}
2396 2396
2397\c void print_line_dotted(drawing *dr, int dotted); 2397\c void print_line_dotted(drawing *dr, bool dotted);
2398 2398
2399This function is called to toggle the drawing of dotted lines during 2399This function is called to toggle the drawing of dotted lines during
2400printing. It is not supported during drawing. 2400printing. It is not supported during drawing.
2401 2401
2402The parameter \cq{dotted} is a boolean; \cw{TRUE} means that future 2402Setting \cq{dotted} to \cw{true} means that future lines drawn by
2403lines drawn by \cw{draw_line()}, \cw{draw_circle} and 2403\cw{draw_line()}, \cw{draw_circle} and \cw{draw_polygon()} will be
2404\cw{draw_polygon()} will be dotted, and \cw{FALSE} means that they 2404dotted. Setting it to \cw{false} means that they will be solid.
2405will be solid.
2406 2405
2407Some front ends may impose restrictions on the width of dotted 2406Some front ends may impose restrictions on the width of dotted
2408lines. Asking for a dotted line via this front end will override any 2407lines. Asking for a dotted line via this front end will override any
@@ -2854,7 +2853,7 @@ when finished with by passing it to the game's own
2854 2853
2855\H{midend-size} \cw{midend_size()} 2854\H{midend-size} \cw{midend_size()}
2856 2855
2857\c void midend_size(midend *me, int *x, int *y, int user_size); 2856\c void midend_size(midend *me, int *x, int *y, bool user_size);
2858 2857
2859Tells the mid-end to figure out its window size. 2858Tells the mid-end to figure out its window size.
2860 2859
@@ -2872,7 +2871,7 @@ status bar is also not included in this size.)
2872Use \c{user_size} to indicate whether \c{*x} and \c{*y} are a 2871Use \c{user_size} to indicate whether \c{*x} and \c{*y} are a
2873requested size, or just a maximum size. 2872requested size, or just a maximum size.
2874 2873
2875If \c{user_size} is set to \cw{TRUE}, the mid-end will treat the 2874If \c{user_size} is set to \cw{true}, the mid-end will treat the
2876input size as a request, and will pick a tile size which 2875input size as a request, and will pick a tile size which
2877approximates it \e{as closely as possible}, going over the game's 2876approximates it \e{as closely as possible}, going over the game's
2878preferred tile size if necessary to achieve this. The mid-end will 2877preferred tile size if necessary to achieve this. The mid-end will
@@ -2995,7 +2994,7 @@ call to this function. Some back ends require that \cw{midend_size()}
2995 2994
2996\H{midend-process-key} \cw{midend_process_key()} 2995\H{midend-process-key} \cw{midend_process_key()}
2997 2996
2998\c int midend_process_key(midend *me, int x, int y, int button); 2997\c bool midend_process_key(midend *me, int x, int y, int button);
2999 2998
3000The front end calls this function to report a mouse or keyboard 2999The front end calls this function to report a mouse or keyboard
3001event. The parameters \c{x}, \c{y} and \c{button} are almost 3000event. The parameters \c{x}, \c{y} and \c{button} are almost
@@ -3028,10 +3027,10 @@ Calling this function is very likely to result in calls back to the
3028front end's drawing API and/or \cw{activate_timer()} 3027front end's drawing API and/or \cw{activate_timer()}
3029(\k{frontend-activate-timer}). 3028(\k{frontend-activate-timer}).
3030 3029
3031The return value from \cw{midend_process_key()} is non-zero, unless 3030The return value from \cw{midend_process_key()} is \cw{true} unless
3032the effect of the keypress was to request termination of the 3031the effect of the keypress was to request termination of the program.
3033program. A front end should shut down the puzzle in response to a 3032A front end should shut down the puzzle in response to a \cw{false}
3034zero return. 3033return.
3035 3034
3036\H{midend-request-keys} \cw{midend_request_keys()} 3035\H{midend-request-keys} \cw{midend_request_keys()}
3037 3036
@@ -3147,9 +3146,9 @@ of the corresponding \cw{struct preset_menu_entry} returned by
3147 3146
3148\H{midend-wants-statusbar} \cw{midend_wants_statusbar()} 3147\H{midend-wants-statusbar} \cw{midend_wants_statusbar()}
3149 3148
3150\c int midend_wants_statusbar(midend *me); 3149\c bool midend_wants_statusbar(midend *me);
3151 3150
3152This function returns \cw{TRUE} if the puzzle has a use for a 3151This function returns \cw{true} if the puzzle has a use for a
3153textual status line (to display score, completion status, currently 3152textual status line (to display score, completion status, currently
3154active tiles, time, or anything else). 3153active tiles, time, or anything else).
3155 3154
@@ -3267,12 +3266,12 @@ The returned string, if it is non-\cw{NULL}, is dynamically allocated.
3267 3266
3268\H{midend-can-format-as-text-now} \cw{midend_can_format_as_text_now()} 3267\H{midend-can-format-as-text-now} \cw{midend_can_format_as_text_now()}
3269 3268
3270\c int midend_can_format_as_text_now(midend *me); 3269\c bool midend_can_format_as_text_now(midend *me);
3271 3270
3272Returns \cw{TRUE} if the game code is capable of formatting puzzles 3271Returns \cw{true} if the game code is capable of formatting puzzles
3273of the currently selected game type as ASCII. 3272of the currently selected game type as ASCII.
3274 3273
3275If this returns \cw{FALSE}, then \cw{midend_text_format()} 3274If this returns \cw{false}, then \cw{midend_text_format()}
3276(\k{midend-text-format}) will return \cw{NULL}. 3275(\k{midend-text-format}) will return \cw{NULL}.
3277 3276
3278\H{midend-text-format} \cw{midend_text_format()} 3277\H{midend-text-format} \cw{midend_text_format()}
@@ -3324,18 +3323,18 @@ status code.)
3324 3323
3325\H{midend-can-undo} \cw{midend_can_undo()} 3324\H{midend-can-undo} \cw{midend_can_undo()}
3326 3325
3327\c int midend_can_undo(midend *me); 3326\c bool midend_can_undo(midend *me);
3328 3327
3329Returns \cw{TRUE} if the midend is currently in a state where the undo 3328Returns \cw{true} if the midend is currently in a state where the undo
3330operation is meaningful (i.e. at least one position exists on the undo 3329operation is meaningful (i.e. at least one position exists on the undo
3331chain before the present one). Front ends may wish to use this to 3330chain before the present one). Front ends may wish to use this to
3332visually activate and deactivate an undo button. 3331visually activate and deactivate an undo button.
3333 3332
3334\H{midend-can-redo} \cw{midend_can_redo()} 3333\H{midend-can-redo} \cw{midend_can_redo()}
3335 3334
3336\c int midend_can_redo(midend *me); 3335\c bool midend_can_redo(midend *me);
3337 3336
3338Returns \cw{TRUE} if the midend is currently in a state where the redo 3337Returns \cw{true} if the midend is currently in a state where the redo
3339operation is meaningful (i.e. at least one position exists on the redo 3338operation is meaningful (i.e. at least one position exists on the redo
3340chain after the present one). Front ends may wish to use this to 3339chain after the present one). Front ends may wish to use this to
3341visually activate and deactivate a redo button. 3340visually activate and deactivate a redo button.
@@ -3367,7 +3366,7 @@ output string.
3367\H{midend-deserialise} \cw{midend_deserialise()} 3366\H{midend-deserialise} \cw{midend_deserialise()}
3368 3367
3369\c const char *midend_deserialise(midend *me, 3368\c const char *midend_deserialise(midend *me,
3370\c int (*read)(void *ctx, void *buf, int len), void *rctx); 3369\c bool (*read)(void *ctx, void *buf, int len), void *rctx);
3371 3370
3372This function is the counterpart to \cw{midend_serialise()}. It 3371This function is the counterpart to \cw{midend_serialise()}. It
3373calls the supplied \cw{read} function repeatedly to read a quantity 3372calls the supplied \cw{read} function repeatedly to read a quantity
@@ -3376,8 +3375,8 @@ as output by \cw{midend_serialise()}.
3376 3375
3377The \cw{read} function is called with the first parameter (\c{ctx}) 3376The \cw{read} function is called with the first parameter (\c{ctx})
3378equal to \c{rctx}, and should attempt to read \c{len} bytes of data 3377equal to \c{rctx}, and should attempt to read \c{len} bytes of data
3379into the buffer pointed to by \c{buf}. It should return \cw{FALSE} 3378into the buffer pointed to by \c{buf}. It should return \cw{false}
3380on failure or \cw{TRUE} on success. It should not report success 3379on failure or \cw{true} on success. It should not report success
3381unless it has filled the entire buffer; on platforms which might be 3380unless it has filled the entire buffer; on platforms which might be
3382reading from a pipe or other blocking data source, \c{read} is 3381reading from a pipe or other blocking data source, \c{read} is
3383responsible for looping until the whole buffer has been filled. 3382responsible for looping until the whole buffer has been filled.
@@ -3405,7 +3404,7 @@ place.
3405\H{identify-game} \cw{identify_game()} 3404\H{identify-game} \cw{identify_game()}
3406 3405
3407\c const char *identify_game(char **name, 3406\c const char *identify_game(char **name,
3408\c int (*read)(void *ctx, void *buf, int len), void *rctx); 3407\c bool (*read)(void *ctx, void *buf, int len), void *rctx);
3409 3408
3410This function examines a serialised midend stream, of the same kind 3409This function examines a serialised midend stream, of the same kind
3411used by \cw{midend_serialise()} and \cw{midend_deserialise()}, and 3410used by \cw{midend_serialise()} and \cw{midend_deserialise()}, and
@@ -4045,13 +4044,13 @@ Returns the number of elements currently in the tree.
4045 4044
4046\S{utils-splitpos234} \cw{splitpos234()} 4045\S{utils-splitpos234} \cw{splitpos234()}
4047 4046
4048\c tree234 *splitpos234(tree234 *t, int index, int before); 4047\c tree234 *splitpos234(tree234 *t, int index, bool before);
4049 4048
4050Splits the input tree into two pieces at a given position, and 4049Splits the input tree into two pieces at a given position, and
4051creates a new tree containing all the elements on one side of that 4050creates a new tree containing all the elements on one side of that
4052position. 4051position.
4053 4052
4054If \c{before} is \cw{TRUE}, then all the items at or after position 4053If \c{before} is \cw{true}, then all the items at or after position
4055\c{index} are left in the input tree, and the items before that 4054\c{index} are left in the input tree, and the items before that
4056point are returned in the new tree. Otherwise, the reverse happens: 4055point are returned in the new tree. Otherwise, the reverse happens:
4057all the items at or after \c{index} are moved into the new tree, and 4056all the items at or after \c{index} are moved into the new tree, and
diff --git a/apps/plugins/puzzles/src/divvy.c b/apps/plugins/puzzles/src/divvy.c
index 517e3ddbb0..ea018010cf 100644
--- a/apps/plugins/puzzles/src/divvy.c
+++ b/apps/plugins/puzzles/src/divvy.c
@@ -212,7 +212,7 @@
212 * (This only works _because_ we've ensured the omino is simply 212 * (This only works _because_ we've ensured the omino is simply
213 * connected.) 213 * connected.)
214 */ 214 */
215static int addremcommon(int w, int h, int x, int y, int *own, int val) 215static bool addremcommon(int w, int h, int x, int y, int *own, int val)
216{ 216{
217 int neighbours[8]; 217 int neighbours[8];
218 int dir, count; 218 int dir, count;
@@ -233,14 +233,14 @@ static int addremcommon(int w, int h, int x, int y, int *own, int val)
233 */ 233 */
234 if (neighbours[0] != val && neighbours[2] != val && 234 if (neighbours[0] != val && neighbours[2] != val &&
235 neighbours[4] != val && neighbours[6] != val) 235 neighbours[4] != val && neighbours[6] != val)
236 return FALSE; 236 return false;
237 237
238 count = 0; 238 count = 0;
239 239
240 for (dir = 0; dir < 8; dir++) { 240 for (dir = 0; dir < 8; dir++) {
241 int next = (dir + 1) & 7; 241 int next = (dir + 1) & 7;
242 int gotthis = (neighbours[dir] == val); 242 bool gotthis = (neighbours[dir] == val);
243 int gotnext = (neighbours[next] == val); 243 bool gotnext = (neighbours[next] == val);
244 244
245 if (gotthis != gotnext) 245 if (gotthis != gotnext)
246 count++; 246 count++;
@@ -262,7 +262,8 @@ static int addremcommon(int w, int h, int x, int y, int *own, int val)
262 */ 262 */
263static int *divvy_internal(int w, int h, int k, random_state *rs) 263static int *divvy_internal(int w, int h, int k, random_state *rs)
264{ 264{
265 int *order, *queue, *tmp, *own, *sizes, *addable, *removable, *retdsf; 265 int *order, *queue, *tmp, *own, *sizes, *addable, *retdsf;
266 bool *removable;
266 int wh = w*h; 267 int wh = w*h;
267 int i, j, n, x, y, qhead, qtail; 268 int i, j, n, x, y, qhead, qtail;
268 269
@@ -275,7 +276,7 @@ static int *divvy_internal(int w, int h, int k, random_state *rs)
275 sizes = snewn(n, int); 276 sizes = snewn(n, int);
276 queue = snewn(n, int); 277 queue = snewn(n, int);
277 addable = snewn(wh*4, int); 278 addable = snewn(wh*4, int);
278 removable = snewn(wh, int); 279 removable = snewn(wh, bool);
279 280
280 /* 281 /*
281 * Permute the grid squares into a random order, which will be 282 * Permute the grid squares into a random order, which will be
@@ -341,9 +342,9 @@ static int *divvy_internal(int w, int h, int k, random_state *rs)
341 int dir; 342 int dir;
342 343
343 if (curr < 0) { 344 if (curr < 0) {
344 removable[yx] = FALSE; /* can't remove if not owned! */ 345 removable[yx] = false; /* can't remove if not owned! */
345 } else if (sizes[curr] == 1) { 346 } else if (sizes[curr] == 1) {
346 removable[yx] = TRUE; /* can always remove a singleton */ 347 removable[yx] = true; /* can always remove a singleton */
347 } else { 348 } else {
348 /* 349 /*
349 * See if this square can be removed from its 350 * See if this square can be removed from its
diff --git a/apps/plugins/puzzles/src/dominosa.c b/apps/plugins/puzzles/src/dominosa.c
index 73b744d2be..5f035e9250 100644
--- a/apps/plugins/puzzles/src/dominosa.c
+++ b/apps/plugins/puzzles/src/dominosa.c
@@ -13,13 +13,17 @@
13 * * rule out a domino placement if it would divide an unfilled 13 * * rule out a domino placement if it would divide an unfilled
14 * region such that at least one resulting region had an odd 14 * region such that at least one resulting region had an odd
15 * area 15 * area
16 * + use b.f.s. to determine the area of an unfilled region 16 * + Tarjan's bridge-finding algorithm would be a way to find
17 * + a square is unfilled iff it has at least two possible 17 * domino placements that split a connected region in two:
18 * placements, and two adjacent unfilled squares are part 18 * form the graph whose vertices are unpaired squares and
19 * of the same region iff the domino placement joining 19 * whose edges are potential (not placed but also not ruled
20 * them is possible 20 * out) dominoes covering two of them, and any bridge in that
21 * graph is a candidate.
22 * + Then, finding any old spanning forest of the unfilled
23 * squares should be sufficient to determine the area parity
24 * of the region that any such placement would cut off.
21 * 25 *
22 * * perhaps set analysis 26 * * set analysis
23 * + look at all unclaimed squares containing a given number 27 * + look at all unclaimed squares containing a given number
24 * + for each one, find the set of possible numbers that it 28 * + for each one, find the set of possible numbers that it
25 * can connect to (i.e. each neighbouring tile such that 29 * can connect to (i.e. each neighbouring tile such that
@@ -37,6 +41,29 @@
37 * things out after finding the subset, we must be 41 * things out after finding the subset, we must be
38 * careful that we don't rule out precisely the domino 42 * careful that we don't rule out precisely the domino
39 * placement that was _included_ in our set! 43 * placement that was _included_ in our set!
44 *
45 * * playing off the two ends of one potential domino, by
46 * considering the alternatives to that domino that each end
47 * might otherwise be part of.
48 * + if not playing this domino would require each end to be
49 * part of an identical domino, play it. (e.g. the middle of
50 * 5-4-4-5)
51 * + if not playing this domino would guarantee that the two
52 * ends between them used up all of some other square's
53 * choices, play it. (e.g. the middle of 2-3-3-1 if another 3
54 * cell can only link to a 2 or a 1)
55 *
56 * * identify 'forcing chains', in the sense of any path of cells
57 * each of which has only two possible dominoes to be part of,
58 * and each of those rules out one of the choices for the next
59 * cell. Such a chain has the property that either all the odd
60 * dominoes are placed, or all the even ones are placed; so if
61 * either set of those introduces a conflict (e.g. a dupe within
62 * the chain, or using up all of some other square's choices),
63 * then the whole set can be ruled out, and the other set played
64 * immediately.
65 * + this is of course a generalisation of the previous idea,
66 * which is simply a forcing chain of length 3.
40 */ 67 */
41 68
42#include <stdio.h> 69#include <stdio.h>
@@ -71,7 +98,7 @@ enum {
71 98
72struct game_params { 99struct game_params {
73 int n; 100 int n;
74 int unique; 101 bool unique;
75}; 102};
76 103
77struct game_numbers { 104struct game_numbers {
@@ -90,7 +117,7 @@ struct game_state {
90 struct game_numbers *numbers; 117 struct game_numbers *numbers;
91 int *grid; 118 int *grid;
92 unsigned short *edges; /* h x w */ 119 unsigned short *edges; /* h x w */
93 int completed, cheated; 120 bool completed, cheated;
94}; 121};
95 122
96static game_params *default_params(void) 123static game_params *default_params(void)
@@ -98,12 +125,12 @@ static game_params *default_params(void)
98 game_params *ret = snew(game_params); 125 game_params *ret = snew(game_params);
99 126
100 ret->n = 6; 127 ret->n = 6;
101 ret->unique = TRUE; 128 ret->unique = true;
102 129
103 return ret; 130 return ret;
104} 131}
105 132
106static int game_fetch_preset(int i, char **name, game_params **params) 133static bool game_fetch_preset(int i, char **name, game_params **params)
107{ 134{
108 game_params *ret; 135 game_params *ret;
109 int n; 136 int n;
@@ -117,7 +144,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
117 case 4: n = 7; break; 144 case 4: n = 7; break;
118 case 5: n = 8; break; 145 case 5: n = 8; break;
119 case 6: n = 9; break; 146 case 6: n = 9; break;
120 default: return FALSE; 147 default: return false;
121 } 148 }
122 149
123 sprintf(buf, "Up to double-%d", n); 150 sprintf(buf, "Up to double-%d", n);
@@ -125,9 +152,9 @@ static int game_fetch_preset(int i, char **name, game_params **params)
125 152
126 *params = ret = snew(game_params); 153 *params = ret = snew(game_params);
127 ret->n = n; 154 ret->n = n;
128 ret->unique = TRUE; 155 ret->unique = true;
129 156
130 return TRUE; 157 return true;
131} 158}
132 159
133static void free_params(game_params *params) 160static void free_params(game_params *params)
@@ -147,10 +174,10 @@ static void decode_params(game_params *params, char const *string)
147 params->n = atoi(string); 174 params->n = atoi(string);
148 while (*string && isdigit((unsigned char)*string)) string++; 175 while (*string && isdigit((unsigned char)*string)) string++;
149 if (*string == 'a') 176 if (*string == 'a')
150 params->unique = FALSE; 177 params->unique = false;
151} 178}
152 179
153static char *encode_params(const game_params *params, int full) 180static char *encode_params(const game_params *params, bool full)
154{ 181{
155 char buf[80]; 182 char buf[80];
156 sprintf(buf, "%d", params->n); 183 sprintf(buf, "%d", params->n);
@@ -191,7 +218,7 @@ static game_params *custom_params(const config_item *cfg)
191 return ret; 218 return ret;
192} 219}
193 220
194static const char *validate_params(const game_params *params, int full) 221static const char *validate_params(const game_params *params, bool full)
195{ 222{
196 if (params->n < 1) 223 if (params->n < 1)
197 return "Maximum face number must be at least one"; 224 return "Maximum face number must be at least one";
@@ -325,7 +352,7 @@ static int solver(int w, int h, int n, int *grid, int *output)
325#endif 352#endif
326 353
327 while (1) { 354 while (1) {
328 int done_something = FALSE; 355 bool done_something = false;
329 356
330 /* 357 /*
331 * For each domino, look at its possible placements, and 358 * For each domino, look at its possible placements, and
@@ -375,7 +402,7 @@ static int solver(int w, int h, int n, int *grid, int *output)
375 if (placements[j] != -2) { 402 if (placements[j] != -2) {
376 int p1, p2, di; 403 int p1, p2, di;
377 404
378 done_something = TRUE; 405 done_something = true;
379 406
380 /* 407 /*
381 * Rule out this placement. First find what 408 * Rule out this placement. First find what
@@ -464,7 +491,7 @@ static int solver(int w, int h, int n, int *grid, int *output)
464 for (k = heads[adi]; k >= 0; k = placements[k]) 491 for (k = heads[adi]; k >= 0; k = placements[k])
465 nn++; 492 nn++;
466 if (nn > n) { 493 if (nn > n) {
467 done_something = TRUE; 494 done_something = true;
468#ifdef SOLVER_DIAGNOSTICS 495#ifdef SOLVER_DIAGNOSTICS
469 printf("considering square %d,%d: reducing placements " 496 printf("considering square %d,%d: reducing placements "
470 "of domino %d\n", x, y, adi); 497 "of domino %d\n", x, y, adi);
@@ -544,7 +571,7 @@ static int solver(int w, int h, int n, int *grid, int *output)
544 */ 571 */
545 572
546static char *new_game_desc(const game_params *params, random_state *rs, 573static char *new_game_desc(const game_params *params, random_state *rs,
547 char **aux, int interactive) 574 char **aux, bool interactive)
548{ 575{
549 int n = params->n, w = n+2, h = n+1, wh = w*h; 576 int n = params->n, w = n+2, h = n+1, wh = w*h;
550 int *grid, *grid2, *list; 577 int *grid, *grid2, *list;
@@ -834,7 +861,8 @@ static game_state *new_game(midend *me, const game_params *params,
834 state->numbers->numbers[i] = j; 861 state->numbers->numbers[i] = j;
835 } 862 }
836 863
837 state->completed = state->cheated = FALSE; 864 state->completed = false;
865 state->cheated = false;
838 866
839 return state; 867 return state;
840} 868}
@@ -940,7 +968,7 @@ static char *solve_game(const game_state *state, const game_state *currstate,
940 return ret; 968 return ret;
941} 969}
942 970
943static int game_can_format_as_text_now(const game_params *params) 971static bool game_can_format_as_text_now(const game_params *params)
944{ 972{
945 return params->n < 1000; 973 return params->n < 1000;
946} 974}
@@ -1013,14 +1041,15 @@ static char *game_text_format(const game_state *state)
1013} 1041}
1014 1042
1015struct game_ui { 1043struct game_ui {
1016 int cur_x, cur_y, cur_visible, highlight_1, highlight_2; 1044 int cur_x, cur_y, highlight_1, highlight_2;
1045 bool cur_visible;
1017}; 1046};
1018 1047
1019static game_ui *new_ui(const game_state *state) 1048static game_ui *new_ui(const game_state *state)
1020{ 1049{
1021 game_ui *ui = snew(game_ui); 1050 game_ui *ui = snew(game_ui);
1022 ui->cur_x = ui->cur_y = 0; 1051 ui->cur_x = ui->cur_y = 0;
1023 ui->cur_visible = 0; 1052 ui->cur_visible = false;
1024 ui->highlight_1 = ui->highlight_2 = -1; 1053 ui->highlight_1 = ui->highlight_2 = -1;
1025 return ui; 1054 return ui;
1026} 1055}
@@ -1043,7 +1072,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1043 const game_state *newstate) 1072 const game_state *newstate)
1044{ 1073{
1045 if (!oldstate->completed && newstate->completed) 1074 if (!oldstate->completed && newstate->completed)
1046 ui->cur_visible = 0; 1075 ui->cur_visible = false;
1047} 1076}
1048 1077
1049#define PREFERRED_TILESIZE 32 1078#define PREFERRED_TILESIZE 32
@@ -1058,7 +1087,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1058#define FROMCOORD(x) ( ((x) - BORDER + TILESIZE) / TILESIZE - 1 ) 1087#define FROMCOORD(x) ( ((x) - BORDER + TILESIZE) / TILESIZE - 1 )
1059 1088
1060struct game_drawstate { 1089struct game_drawstate {
1061 int started; 1090 bool started;
1062 int w, h, tilesize; 1091 int w, h, tilesize;
1063 unsigned long *visible; 1092 unsigned long *visible;
1064}; 1093};
@@ -1107,13 +1136,13 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1107 (state->grid[d1] != d1 || state->grid[d2] != d2)) 1136 (state->grid[d1] != d1 || state->grid[d2] != d2))
1108 return NULL; 1137 return NULL;
1109 1138
1110 ui->cur_visible = 0; 1139 ui->cur_visible = false;
1111 sprintf(buf, "%c%d,%d", (int)(button == RIGHT_BUTTON ? 'E' : 'D'), d1, d2); 1140 sprintf(buf, "%c%d,%d", (int)(button == RIGHT_BUTTON ? 'E' : 'D'), d1, d2);
1112 return dupstr(buf); 1141 return dupstr(buf);
1113 } else if (IS_CURSOR_MOVE(button)) { 1142 } else if (IS_CURSOR_MOVE(button)) {
1114 ui->cur_visible = 1; 1143 ui->cur_visible = true;
1115 1144
1116 move_cursor(button, &ui->cur_x, &ui->cur_y, 2*w-1, 2*h-1, 0); 1145 move_cursor(button, &ui->cur_x, &ui->cur_y, 2*w-1, 2*h-1, false);
1117 1146
1118 return UI_UPDATE; 1147 return UI_UPDATE;
1119 } else if (IS_CURSOR_SELECT(button)) { 1148 } else if (IS_CURSOR_SELECT(button)) {
@@ -1164,7 +1193,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1164 if (move[0] == 'S') { 1193 if (move[0] == 'S') {
1165 int i; 1194 int i;
1166 1195
1167 ret->cheated = TRUE; 1196 ret->cheated = true;
1168 1197
1169 /* 1198 /*
1170 * Clear the existing edges and domino placements. We 1199 * Clear the existing edges and domino placements. We
@@ -1278,7 +1307,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1278 */ 1307 */
1279 if (!ret->completed) { 1308 if (!ret->completed) {
1280 int i, ok = 0; 1309 int i, ok = 0;
1281 unsigned char *used = snewn(TRI(n+1), unsigned char); 1310 bool *used = snewn(TRI(n+1), bool);
1282 1311
1283 memset(used, 0, TRI(n+1)); 1312 memset(used, 0, TRI(n+1));
1284 for (i = 0; i < wh; i++) 1313 for (i = 0; i < wh; i++)
@@ -1292,14 +1321,14 @@ static game_state *execute_move(const game_state *state, const char *move)
1292 assert(di >= 0 && di < TRI(n+1)); 1321 assert(di >= 0 && di < TRI(n+1));
1293 1322
1294 if (!used[di]) { 1323 if (!used[di]) {
1295 used[di] = 1; 1324 used[di] = true;
1296 ok++; 1325 ok++;
1297 } 1326 }
1298 } 1327 }
1299 1328
1300 sfree(used); 1329 sfree(used);
1301 if (ok == DCOUNT(n)) 1330 if (ok == DCOUNT(n))
1302 ret->completed = TRUE; 1331 ret->completed = true;
1303 } 1332 }
1304 1333
1305 return ret; 1334 return ret;
@@ -1371,7 +1400,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1371 struct game_drawstate *ds = snew(struct game_drawstate); 1400 struct game_drawstate *ds = snew(struct game_drawstate);
1372 int i; 1401 int i;
1373 1402
1374 ds->started = FALSE; 1403 ds->started = false;
1375 ds->w = state->w; 1404 ds->w = state->w;
1376 ds->h = state->h; 1405 ds->h = state->h;
1377 ds->visible = snewn(ds->w * ds->h, unsigned long); 1406 ds->visible = snewn(ds->w * ds->h, unsigned long);
@@ -1542,7 +1571,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1542 game_compute_size(&state->params, TILESIZE, &pw, &ph); 1571 game_compute_size(&state->params, TILESIZE, &pw, &ph);
1543 draw_rect(dr, 0, 0, pw, ph, COL_BACKGROUND); 1572 draw_rect(dr, 0, 0, pw, ph, COL_BACKGROUND);
1544 draw_update(dr, 0, 0, pw, ph); 1573 draw_update(dr, 0, 0, pw, ph);
1545 ds->started = TRUE; 1574 ds->started = true;
1546 } 1575 }
1547 1576
1548 /* 1577 /*
@@ -1645,9 +1674,9 @@ static int game_status(const game_state *state)
1645 return state->completed ? +1 : 0; 1674 return state->completed ? +1 : 0;
1646} 1675}
1647 1676
1648static int game_timing_state(const game_state *state, game_ui *ui) 1677static bool game_timing_state(const game_state *state, game_ui *ui)
1649{ 1678{
1650 return TRUE; 1679 return true;
1651} 1680}
1652 1681
1653static void game_print_size(const game_params *params, float *x, float *y) 1682static void game_print_size(const game_params *params, float *x, float *y)
@@ -1710,15 +1739,15 @@ const struct game thegame = {
1710 encode_params, 1739 encode_params,
1711 free_params, 1740 free_params,
1712 dup_params, 1741 dup_params,
1713 TRUE, game_configure, custom_params, 1742 true, game_configure, custom_params,
1714 validate_params, 1743 validate_params,
1715 new_game_desc, 1744 new_game_desc,
1716 validate_desc, 1745 validate_desc,
1717 new_game, 1746 new_game,
1718 dup_game, 1747 dup_game,
1719 free_game, 1748 free_game,
1720 TRUE, solve_game, 1749 true, solve_game,
1721 TRUE, game_can_format_as_text_now, game_text_format, 1750 true, game_can_format_as_text_now, game_text_format,
1722 new_ui, 1751 new_ui,
1723 free_ui, 1752 free_ui,
1724 encode_ui, 1753 encode_ui,
@@ -1735,9 +1764,9 @@ const struct game thegame = {
1735 game_anim_length, 1764 game_anim_length,
1736 game_flash_length, 1765 game_flash_length,
1737 game_status, 1766 game_status,
1738 TRUE, FALSE, game_print_size, game_print, 1767 true, false, game_print_size, game_print,
1739 FALSE, /* wants_statusbar */ 1768 false, /* wants_statusbar */
1740 FALSE, game_timing_state, 1769 false, game_timing_state,
1741 0, /* flags */ 1770 0, /* flags */
1742}; 1771};
1743 1772
diff --git a/apps/plugins/puzzles/src/drawing.c b/apps/plugins/puzzles/src/drawing.c
index caf0b4b43a..a8eb8cfd5f 100644
--- a/apps/plugins/puzzles/src/drawing.c
+++ b/apps/plugins/puzzles/src/drawing.c
@@ -264,7 +264,7 @@ void print_end_doc(drawing *dr)
264 dr->api->end_doc(dr->handle); 264 dr->api->end_doc(dr->handle);
265} 265}
266 266
267void print_get_colour(drawing *dr, int colour, int printing_in_colour, 267void print_get_colour(drawing *dr, int colour, bool printing_in_colour,
268 int *hatch, float *r, float *g, float *b) 268 int *hatch, float *r, float *g, float *b)
269{ 269{
270 assert(colour >= 0 && colour < dr->ncolours); 270 assert(colour >= 0 && colour < dr->ncolours);
@@ -347,7 +347,7 @@ void print_line_width(drawing *dr, int width)
347 dr->api->line_width(dr->handle, (float)sqrt(dr->scale) * width); 347 dr->api->line_width(dr->handle, (float)sqrt(dr->scale) * width);
348} 348}
349 349
350void print_line_dotted(drawing *dr, int dotted) 350void print_line_dotted(drawing *dr, bool dotted)
351{ 351{
352 dr->api->line_dotted(dr->handle, dotted); 352 dr->api->line_dotted(dr->handle, dotted);
353} 353}
diff --git a/apps/plugins/puzzles/src/dsf.c b/apps/plugins/puzzles/src/dsf.c
index aa22392661..832bb3005a 100644
--- a/apps/plugins/puzzles/src/dsf.c
+++ b/apps/plugins/puzzles/src/dsf.c
@@ -15,7 +15,8 @@
15 int *equal_elements = snewn(size, int); 15 int *equal_elements = snewn(size, int);
16 int *inverse_elements = snewn(size, int); 16 int *inverse_elements = snewn(size, int);
17 int printed_count = 0, equal_count, inverse_count; 17 int printed_count = 0, equal_count, inverse_count;
18 int i, n, inverse; 18 int i, n;
19 bool inverse;
19 20
20 memset(printed_elements, -1, sizeof(int) * size); 21 memset(printed_elements, -1, sizeof(int) * size);
21 22
@@ -92,17 +93,17 @@ int dsf_canonify(int *dsf, int index)
92 93
93void dsf_merge(int *dsf, int v1, int v2) 94void dsf_merge(int *dsf, int v1, int v2)
94{ 95{
95 edsf_merge(dsf, v1, v2, FALSE); 96 edsf_merge(dsf, v1, v2, false);
96} 97}
97 98
98int dsf_size(int *dsf, int index) { 99int dsf_size(int *dsf, int index) {
99 return dsf[dsf_canonify(dsf, index)] >> 2; 100 return dsf[dsf_canonify(dsf, index)] >> 2;
100} 101}
101 102
102int edsf_canonify(int *dsf, int index, int *inverse_return) 103int edsf_canonify(int *dsf, int index, bool *inverse_return)
103{ 104{
104 int start_index = index, canonical_index; 105 int start_index = index, canonical_index;
105 int inverse = 0; 106 bool inverse = false;
106 107
107/* fprintf(stderr, "dsf = %p\n", dsf); */ 108/* fprintf(stderr, "dsf = %p\n", dsf); */
108/* fprintf(stderr, "Canonify %2d\n", index); */ 109/* fprintf(stderr, "Canonify %2d\n", index); */
@@ -128,22 +129,22 @@ int edsf_canonify(int *dsf, int index, int *inverse_return)
128 index = start_index; 129 index = start_index;
129 while (index != canonical_index) { 130 while (index != canonical_index) {
130 int nextindex = dsf[index] >> 2; 131 int nextindex = dsf[index] >> 2;
131 int nextinverse = inverse ^ (dsf[index] & 1); 132 bool nextinverse = inverse ^ (dsf[index] & 1);
132 dsf[index] = (canonical_index << 2) | inverse; 133 dsf[index] = (canonical_index << 2) | inverse;
133 inverse = nextinverse; 134 inverse = nextinverse;
134 index = nextindex; 135 index = nextindex;
135 } 136 }
136 137
137 assert(inverse == 0); 138 assert(!inverse);
138 139
139/* fprintf(stderr, "Return %2d\n", index); */ 140/* fprintf(stderr, "Return %2d\n", index); */
140 141
141 return index; 142 return index;
142} 143}
143 144
144void edsf_merge(int *dsf, int v1, int v2, int inverse) 145void edsf_merge(int *dsf, int v1, int v2, bool inverse)
145{ 146{
146 int i1, i2; 147 bool i1, i2;
147 148
148/* fprintf(stderr, "dsf = %p\n", dsf); */ 149/* fprintf(stderr, "dsf = %p\n", dsf); */
149/* fprintf(stderr, "Merge [%2d,%2d], %d\n", v1, v2, inverse); */ 150/* fprintf(stderr, "Merge [%2d,%2d], %d\n", v1, v2, inverse); */
@@ -160,7 +161,6 @@ void edsf_merge(int *dsf, int v1, int v2, int inverse)
160 if (v1 == v2) 161 if (v1 == v2)
161 assert(!inverse); 162 assert(!inverse);
162 else { 163 else {
163 assert(inverse == 0 || inverse == 1);
164 /* 164 /*
165 * We always make the smaller of v1 and v2 the new canonical 165 * We always make the smaller of v1 and v2 the new canonical
166 * element. This ensures that the canonical element of any 166 * element. This ensures that the canonical element of any
@@ -181,7 +181,7 @@ void edsf_merge(int *dsf, int v1, int v2, int inverse)
181 v2 = v3; 181 v2 = v3;
182 } 182 }
183 dsf[v1] += (dsf[v2] >> 2) << 2; 183 dsf[v1] += (dsf[v2] >> 2) << 2;
184 dsf[v2] = (v1 << 2) | !!inverse; 184 dsf[v2] = (v1 << 2) | inverse;
185 } 185 }
186 186
187 v2 = edsf_canonify(dsf, v2, &i2); 187 v2 = edsf_canonify(dsf, v2, &i2);
diff --git a/apps/plugins/puzzles/src/emcc.c b/apps/plugins/puzzles/src/emcc.c
index 563fbe2799..9a6c742482 100644
--- a/apps/plugins/puzzles/src/emcc.c
+++ b/apps/plugins/puzzles/src/emcc.c
@@ -67,7 +67,7 @@ extern int js_get_selected_preset(void);
67extern void js_select_preset(int n); 67extern void js_select_preset(int n);
68extern void js_get_date_64(unsigned *p); 68extern void js_get_date_64(unsigned *p);
69extern void js_update_permalinks(const char *desc, const char *seed); 69extern void js_update_permalinks(const char *desc, const char *seed);
70extern void js_enable_undo_redo(int undo, int redo); 70extern void js_enable_undo_redo(bool undo, bool redo);
71extern void js_activate_timer(); 71extern void js_activate_timer();
72extern void js_deactivate_timer(); 72extern void js_deactivate_timer();
73extern void js_canvas_start_draw(void); 73extern void js_canvas_start_draw(void);
@@ -101,7 +101,7 @@ extern void js_dialog_init(const char *title);
101extern void js_dialog_string(int i, const char *title, const char *initvalue); 101extern void js_dialog_string(int i, const char *title, const char *initvalue);
102extern void js_dialog_choices(int i, const char *title, const char *choicelist, 102extern void js_dialog_choices(int i, const char *title, const char *choicelist,
103 int initvalue); 103 int initvalue);
104extern void js_dialog_boolean(int i, const char *title, int initvalue); 104extern void js_dialog_boolean(int i, const char *title, bool initvalue);
105extern void js_dialog_launch(void); 105extern void js_dialog_launch(void);
106extern void js_dialog_cleanup(void); 106extern void js_dialog_cleanup(void);
107extern void js_focus_canvas(void); 107extern void js_focus_canvas(void);
@@ -171,17 +171,17 @@ midend *me;
171/* ---------------------------------------------------------------------- 171/* ----------------------------------------------------------------------
172 * Timing functions. 172 * Timing functions.
173 */ 173 */
174int timer_active = FALSE; 174bool timer_active = false;
175void deactivate_timer(frontend *fe) 175void deactivate_timer(frontend *fe)
176{ 176{
177 js_deactivate_timer(); 177 js_deactivate_timer();
178 timer_active = FALSE; 178 timer_active = false;
179} 179}
180void activate_timer(frontend *fe) 180void activate_timer(frontend *fe)
181{ 181{
182 if (!timer_active) { 182 if (!timer_active) {
183 js_activate_timer(); 183 js_activate_timer();
184 timer_active = TRUE; 184 timer_active = true;
185 } 185 }
186} 186}
187void timer_callback(double tplus) 187void timer_callback(double tplus)
@@ -201,7 +201,7 @@ static void resize(void)
201{ 201{
202 int w, h; 202 int w, h;
203 w = h = INT_MAX; 203 w = h = INT_MAX;
204 midend_size(me, &w, &h, FALSE); 204 midend_size(me, &w, &h, false);
205 js_canvas_set_size(w, h); 205 js_canvas_set_size(w, h);
206 canvas_w = w; 206 canvas_w = w;
207 canvas_h = h; 207 canvas_h = h;
@@ -210,7 +210,7 @@ static void resize(void)
210/* Called from JS when the user uses the resize handle */ 210/* Called from JS when the user uses the resize handle */
211void resize_puzzle(int w, int h) 211void resize_puzzle(int w, int h)
212{ 212{
213 midend_size(me, &w, &h, TRUE); 213 midend_size(me, &w, &h, true);
214 if (canvas_w != w || canvas_h != h) { 214 if (canvas_w != w || canvas_h != h) {
215 js_canvas_set_size(w, h); 215 js_canvas_set_size(w, h);
216 canvas_w = w; 216 canvas_w = w;
@@ -277,7 +277,7 @@ void mousemove(int x, int y, int buttons)
277 * Keyboard handler called from JS. 277 * Keyboard handler called from JS.
278 */ 278 */
279void key(int keycode, int charcode, const char *key, const char *chr, 279void key(int keycode, int charcode, const char *key, const char *chr,
280 int shift, int ctrl) 280 bool shift, bool ctrl)
281{ 281{
282 int keyevent = -1; 282 int keyevent = -1;
283 283
@@ -554,7 +554,7 @@ const struct drawing_api js_drawing = {
554 */ 554 */
555static game_params **presets; 555static game_params **presets;
556static int npresets; 556static int npresets;
557int have_presets_dropdown; 557bool have_presets_dropdown;
558 558
559void populate_js_preset_menu(int menuid, struct preset_menu *menu) 559void populate_js_preset_menu(int menuid, struct preset_menu *menu)
560{ 560{
@@ -647,11 +647,11 @@ void dlg_return_ival(int index, int val)
647} 647}
648 648
649/* 649/*
650 * Called when the user clicks OK or Cancel. use_results will be TRUE 650 * Called when the user clicks OK or Cancel. use_results will be true
651 * or FALSE respectively, in those cases. We terminate the dialog box, 651 * or false respectively, in those cases. We terminate the dialog box,
652 * unless the user selected an invalid combination of parameters. 652 * unless the user selected an invalid combination of parameters.
653 */ 653 */
654static void cfg_end(int use_results) 654static void cfg_end(bool use_results)
655{ 655{
656 if (use_results) { 656 if (use_results) {
657 /* 657 /*
@@ -738,11 +738,11 @@ void command(int n)
738 } 738 }
739 break; 739 break;
740 case 3: /* OK clicked in a config box */ 740 case 3: /* OK clicked in a config box */
741 cfg_end(TRUE); 741 cfg_end(true);
742 update_undo_redo(); 742 update_undo_redo();
743 break; 743 break;
744 case 4: /* Cancel clicked in a config box */ 744 case 4: /* Cancel clicked in a config box */
745 cfg_end(FALSE); 745 cfg_end(false);
746 update_undo_redo(); 746 update_undo_redo();
747 break; 747 break;
748 case 5: /* New Game */ 748 case 5: /* New Game */
@@ -806,11 +806,15 @@ char *get_save_file(void)
806 midend_serialise(me, savefile_write, &ctx); 806 midend_serialise(me, savefile_write, &ctx);
807 size = ctx.pos; 807 size = ctx.pos;
808 808
809 /* Second pass, to actually write out the data */ 809 /* Second pass, to actually write out the data. We have to put a
810 ctx.buffer = snewn(size, char); 810 * terminating \0 on the end (which we expect never to show up in
811 * the actual serialisation format - it's text, not binary) so
812 * that the Javascript side can easily find out the length. */
813 ctx.buffer = snewn(size+1, char);
811 ctx.pos = 0; 814 ctx.pos = 0;
812 midend_serialise(me, savefile_write, &ctx); 815 midend_serialise(me, savefile_write, &ctx);
813 assert(ctx.pos == size); 816 assert(ctx.pos == size);
817 ctx.buffer[ctx.pos] = '\0';
814 818
815 return ctx.buffer; 819 return ctx.buffer;
816} 820}
@@ -825,15 +829,15 @@ struct savefile_read_ctx {
825 int len_remaining; 829 int len_remaining;
826}; 830};
827 831
828static int savefile_read(void *vctx, void *buf, int len) 832static bool savefile_read(void *vctx, void *buf, int len)
829{ 833{
830 struct savefile_read_ctx *ctx = (struct savefile_read_ctx *)vctx; 834 struct savefile_read_ctx *ctx = (struct savefile_read_ctx *)vctx;
831 if (ctx->len_remaining < len) 835 if (ctx->len_remaining < len)
832 return FALSE; 836 return false;
833 memcpy(buf, ctx->buffer, len); 837 memcpy(buf, ctx->buffer, len);
834 ctx->len_remaining -= len; 838 ctx->len_remaining -= len;
835 ctx->buffer += len; 839 ctx->buffer += len;
836 return TRUE; 840 return true;
837} 841}
838 842
839void load_game(const char *buffer, int len) 843void load_game(const char *buffer, int len)
@@ -912,7 +916,7 @@ int main(int argc, char **argv)
912 if (thegame.can_configure) 916 if (thegame.can_configure)
913 js_add_preset(0, "Custom", -1); 917 js_add_preset(0, "Custom", -1);
914 918
915 have_presets_dropdown = TRUE; 919 have_presets_dropdown = true;
916 920
917 /* 921 /*
918 * Now ensure the appropriate element of the presets menu 922 * Now ensure the appropriate element of the presets menu
diff --git a/apps/plugins/puzzles/src/fifteen.c b/apps/plugins/puzzles/src/fifteen.c
index 35bcb32a36..ba991e711a 100644
--- a/apps/plugins/puzzles/src/fifteen.c
+++ b/apps/plugins/puzzles/src/fifteen.c
@@ -46,8 +46,8 @@ struct game_state {
46 int w, h, n; 46 int w, h, n;
47 int *tiles; 47 int *tiles;
48 int gap_pos; 48 int gap_pos;
49 int completed; 49 int completed; /* move count at time of completion */
50 int used_solve; /* used to suppress completion flash */ 50 bool used_solve; /* used to suppress completion flash */
51 int movecount; 51 int movecount;
52}; 52};
53 53
@@ -60,14 +60,14 @@ static game_params *default_params(void)
60 return ret; 60 return ret;
61} 61}
62 62
63static int game_fetch_preset(int i, char **name, game_params **params) 63static bool game_fetch_preset(int i, char **name, game_params **params)
64{ 64{
65 if (i == 0) { 65 if (i == 0) {
66 *params = default_params(); 66 *params = default_params();
67 *name = dupstr("4x4"); 67 *name = dupstr("4x4");
68 return TRUE; 68 return true;
69 } 69 }
70 return FALSE; 70 return false;
71} 71}
72 72
73static void free_params(game_params *params) 73static void free_params(game_params *params)
@@ -92,7 +92,7 @@ static void decode_params(game_params *ret, char const *string)
92 } 92 }
93} 93}
94 94
95static char *encode_params(const game_params *params, int full) 95static char *encode_params(const game_params *params, bool full)
96{ 96{
97 char data[256]; 97 char data[256];
98 98
@@ -134,7 +134,7 @@ static game_params *custom_params(const config_item *cfg)
134 return ret; 134 return ret;
135} 135}
136 136
137static const char *validate_params(const game_params *params, int full) 137static const char *validate_params(const game_params *params, bool full)
138{ 138{
139 if (params->w < 2 || params->h < 2) 139 if (params->w < 2 || params->h < 2)
140 return "Width and height must both be at least two"; 140 return "Width and height must both be at least two";
@@ -157,27 +157,28 @@ static int perm_parity(int *perm, int n)
157} 157}
158 158
159static char *new_game_desc(const game_params *params, random_state *rs, 159static char *new_game_desc(const game_params *params, random_state *rs,
160 char **aux, int interactive) 160 char **aux, bool interactive)
161{ 161{
162 int gap, n, i, x; 162 int gap, n, i, x;
163 int x1, x2, p1, p2, parity; 163 int x1, x2, p1, p2, parity;
164 int *tiles, *used; 164 int *tiles;
165 bool *used;
165 char *ret; 166 char *ret;
166 int retlen; 167 int retlen;
167 168
168 n = params->w * params->h; 169 n = params->w * params->h;
169 170
170 tiles = snewn(n, int); 171 tiles = snewn(n, int);
171 used = snewn(n, int); 172 used = snewn(n, bool);
172 173
173 for (i = 0; i < n; i++) { 174 for (i = 0; i < n; i++) {
174 tiles[i] = -1; 175 tiles[i] = -1;
175 used[i] = FALSE; 176 used[i] = false;
176 } 177 }
177 178
178 gap = random_upto(rs, n); 179 gap = random_upto(rs, n);
179 tiles[gap] = 0; 180 tiles[gap] = 0;
180 used[0] = TRUE; 181 used[0] = true;
181 182
182 /* 183 /*
183 * Place everything else except the last two tiles. 184 * Place everything else except the last two tiles.
@@ -191,7 +192,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
191 break; 192 break;
192 193
193 assert(j < n && !used[j]); 194 assert(j < n && !used[j]);
194 used[j] = TRUE; 195 used[j] = true;
195 196
196 while (tiles[x] >= 0) 197 while (tiles[x] >= 0)
197 x++; 198 x++;
@@ -275,15 +276,15 @@ static const char *validate_desc(const game_params *params, const char *desc)
275 const char *p; 276 const char *p;
276 const char *err; 277 const char *err;
277 int i, area; 278 int i, area;
278 int *used; 279 bool *used;
279 280
280 area = params->w * params->h; 281 area = params->w * params->h;
281 p = desc; 282 p = desc;
282 err = NULL; 283 err = NULL;
283 284
284 used = snewn(area, int); 285 used = snewn(area, bool);
285 for (i = 0; i < area; i++) 286 for (i = 0; i < area; i++)
286 used[i] = FALSE; 287 used[i] = false;
287 288
288 for (i = 0; i < area; i++) { 289 for (i = 0; i < area; i++) {
289 const char *q = p; 290 const char *q = p;
@@ -312,7 +313,7 @@ static const char *validate_desc(const game_params *params, const char *desc)
312 err = "Number used twice"; 313 err = "Number used twice";
313 goto leave; 314 goto leave;
314 } 315 }
315 used[n] = TRUE; 316 used[n] = true;
316 317
317 if (*p) p++; /* eat comma */ 318 if (*p) p++; /* eat comma */
318 } 319 }
@@ -350,7 +351,7 @@ static game_state *new_game(midend *me, const game_params *params,
350 assert(state->tiles[state->gap_pos] == 0); 351 assert(state->tiles[state->gap_pos] == 0);
351 352
352 state->completed = state->movecount = 0; 353 state->completed = state->movecount = 0;
353 state->used_solve = FALSE; 354 state->used_solve = false;
354 355
355 return state; 356 return state;
356} 357}
@@ -384,9 +385,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
384 return dupstr("S"); 385 return dupstr("S");
385} 386}
386 387
387static int game_can_format_as_text_now(const game_params *params) 388static bool game_can_format_as_text_now(const game_params *params)
388{ 389{
389 return TRUE; 390 return true;
390} 391}
391 392
392static char *game_text_format(const game_state *state) 393static char *game_text_format(const game_state *state)
@@ -455,7 +456,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
455} 456}
456 457
457struct game_drawstate { 458struct game_drawstate {
458 int started; 459 bool started;
459 int w, h, bgcolour; 460 int w, h, bgcolour;
460 int *tiles; 461 int *tiles;
461 int tilesize; 462 int tilesize;
@@ -521,7 +522,7 @@ static void next_move(int nx, int ny, int ox, int oy, int gx, int gy,
521{ 522{
522 const int to_tile_x = (gx < nx ? +1 : -1); 523 const int to_tile_x = (gx < nx ? +1 : -1);
523 const int to_goal_x = (gx < tx ? +1 : -1); 524 const int to_goal_x = (gx < tx ? +1 : -1);
524 const int gap_x_on_goal_side = ((nx-tx) * (nx-gx) > 0); 525 const bool gap_x_on_goal_side = ((nx-tx) * (nx-gx) > 0);
525 526
526 assert (nx != tx || ny != ty); /* not already in place */ 527 assert (nx != tx || ny != ty); /* not already in place */
527 assert (nx != gx || ny != gy); /* not placing the gap */ 528 assert (nx != gx || ny != gy); /* not placing the gap */
@@ -608,7 +609,7 @@ static void next_move(int nx, int ny, int ox, int oy, int gx, int gy,
608 *dx = to_tile_x; 609 *dx = to_tile_x;
609} 610}
610 611
611static int compute_hint(const game_state *state, int *out_x, int *out_y) 612static bool compute_hint(const game_state *state, int *out_x, int *out_y)
612{ 613{
613 /* The overall solving process is this: 614 /* The overall solving process is this:
614 * 1. Find the next piece to be put in its place 615 * 1. Find the next piece to be put in its place
@@ -657,7 +658,7 @@ static int compute_hint(const game_state *state, int *out_x, int *out_y)
657 } 658 }
658 659
659 if (next_piece == n) 660 if (next_piece == n)
660 return FALSE; 661 return false;
661 662
662 /* 2, 3. Move the next piece towards its place */ 663 /* 2, 3. Move the next piece towards its place */
663 664
@@ -680,7 +681,7 @@ static int compute_hint(const game_state *state, int *out_x, int *out_y)
680 681
681 *out_x = gx + dx; 682 *out_x = gx + dx;
682 *out_y = gy + dy; 683 *out_y = gy + dy;
683 return TRUE; 684 return true;
684} 685}
685 686
686static char *interpret_move(const game_state *state, game_ui *ui, 687static char *interpret_move(const game_state *state, game_ui *ui,
@@ -707,7 +708,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
707 button = flip_cursor(button); /* the default */ 708 button = flip_cursor(button); /* the default */
708 if (invert_cursor) 709 if (invert_cursor)
709 button = flip_cursor(button); /* undoes the first flip */ 710 button = flip_cursor(button); /* undoes the first flip */
710 move_cursor(button, &nx, &ny, state->w, state->h, FALSE); 711 move_cursor(button, &nx, &ny, state->w, state->h, false);
711 } else if ((button == 'h' || button == 'H') && !state->completed) { 712 } else if ((button == 'h' || button == 'H') && !state->completed) {
712 if (!compute_hint(state, &nx, &ny)) 713 if (!compute_hint(state, &nx, &ny))
713 return NULL; /* shouldn't happen, since ^^we^^checked^^ */ 714 return NULL; /* shouldn't happen, since ^^we^^checked^^ */
@@ -746,7 +747,7 @@ static game_state *execute_move(const game_state *from, const char *move)
746 for (i = 0; i < ret->n; i++) 747 for (i = 0; i < ret->n; i++)
747 ret->tiles[i] = (i+1) % ret->n; 748 ret->tiles[i] = (i+1) % ret->n;
748 ret->gap_pos = ret->n-1; 749 ret->gap_pos = ret->n-1;
749 ret->used_solve = TRUE; 750 ret->used_solve = true;
750 ret->completed = ret->movecount = 1; 751 ret->completed = ret->movecount = 1;
751 752
752 return ret; 753 return ret;
@@ -835,7 +836,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
835 struct game_drawstate *ds = snew(struct game_drawstate); 836 struct game_drawstate *ds = snew(struct game_drawstate);
836 int i; 837 int i;
837 838
838 ds->started = FALSE; 839 ds->started = false;
839 ds->w = state->w; 840 ds->w = state->w;
840 ds->h = state->h; 841 ds->h = state->h;
841 ds->bgcolour = COL_BACKGROUND; 842 ds->bgcolour = COL_BACKGROUND;
@@ -929,7 +930,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
929 coords[0] = COORD(0) - HIGHLIGHT_WIDTH; 930 coords[0] = COORD(0) - HIGHLIGHT_WIDTH;
930 draw_polygon(dr, coords, 5, COL_LOWLIGHT, COL_LOWLIGHT); 931 draw_polygon(dr, coords, 5, COL_LOWLIGHT, COL_LOWLIGHT);
931 932
932 ds->started = TRUE; 933 ds->started = true;
933 } 934 }
934 935
935 /* 936 /*
@@ -1065,9 +1066,9 @@ static int game_status(const game_state *state)
1065 return state->completed ? +1 : 0; 1066 return state->completed ? +1 : 0;
1066} 1067}
1067 1068
1068static int game_timing_state(const game_state *state, game_ui *ui) 1069static bool game_timing_state(const game_state *state, game_ui *ui)
1069{ 1070{
1070 return TRUE; 1071 return true;
1071} 1072}
1072 1073
1073static void game_print_size(const game_params *params, float *x, float *y) 1074static void game_print_size(const game_params *params, float *x, float *y)
@@ -1090,15 +1091,15 @@ const struct game thegame = {
1090 encode_params, 1091 encode_params,
1091 free_params, 1092 free_params,
1092 dup_params, 1093 dup_params,
1093 TRUE, game_configure, custom_params, 1094 true, game_configure, custom_params,
1094 validate_params, 1095 validate_params,
1095 new_game_desc, 1096 new_game_desc,
1096 validate_desc, 1097 validate_desc,
1097 new_game, 1098 new_game,
1098 dup_game, 1099 dup_game,
1099 free_game, 1100 free_game,
1100 TRUE, solve_game, 1101 true, solve_game,
1101 TRUE, game_can_format_as_text_now, game_text_format, 1102 true, game_can_format_as_text_now, game_text_format,
1102 new_ui, 1103 new_ui,
1103 free_ui, 1104 free_ui,
1104 encode_ui, 1105 encode_ui,
@@ -1115,9 +1116,9 @@ const struct game thegame = {
1115 game_anim_length, 1116 game_anim_length,
1116 game_flash_length, 1117 game_flash_length,
1117 game_status, 1118 game_status,
1118 FALSE, FALSE, game_print_size, game_print, 1119 false, false, game_print_size, game_print,
1119 TRUE, /* wants_statusbar */ 1120 true, /* wants_statusbar */
1120 FALSE, game_timing_state, 1121 false, game_timing_state,
1121 0, /* flags */ 1122 0, /* flags */
1122}; 1123};
1123 1124
@@ -1129,18 +1130,19 @@ int main(int argc, char **argv)
1129 game_state *state; 1130 game_state *state;
1130 char *id = NULL, *desc; 1131 char *id = NULL, *desc;
1131 const char *err; 1132 const char *err;
1132 int grade = FALSE; 1133 bool grade = false;
1133 char *progname = argv[0]; 1134 char *progname = argv[0];
1134 1135
1135 char buf[80]; 1136 char buf[80];
1136 int limit, x, y, solvable; 1137 int limit, x, y;
1138 bool solvable;
1137 1139
1138 while (--argc > 0) { 1140 while (--argc > 0) {
1139 char *p = *++argv; 1141 char *p = *++argv;
1140 if (!strcmp(p, "-v")) { 1142 if (!strcmp(p, "-v")) {
1141 /* solver_show_working = TRUE; */ 1143 /* solver_show_working = true; */
1142 } else if (!strcmp(p, "-g")) { 1144 } else if (!strcmp(p, "-g")) {
1143 grade = TRUE; 1145 grade = true;
1144 } else if (*p == '-') { 1146 } else if (*p == '-') {
1145 fprintf(stderr, "%s: unrecognised option `%s'\n", progname, p); 1147 fprintf(stderr, "%s: unrecognised option `%s'\n", progname, p);
1146 return 1; 1148 return 1;
diff --git a/apps/plugins/puzzles/src/filling.c b/apps/plugins/puzzles/src/filling.c
index e866a256ce..f67d9fadba 100644
--- a/apps/plugins/puzzles/src/filling.c
+++ b/apps/plugins/puzzles/src/filling.c
@@ -66,7 +66,7 @@
66 66
67#include "puzzles.h" 67#include "puzzles.h"
68 68
69static unsigned char verbose; 69static bool verbose;
70 70
71static void printv(const char *fmt, ...) { 71static void printv(const char *fmt, ...) {
72#if !defined(PALM) && !defined(ROCKBOX) 72#if !defined(PALM) && !defined(ROCKBOX)
@@ -96,7 +96,7 @@ struct shared_state {
96struct game_state { 96struct game_state {
97 int *board; 97 int *board;
98 struct shared_state *shared; 98 struct shared_state *shared;
99 int completed, cheated; 99 bool completed, cheated;
100}; 100};
101 101
102static const struct game_params filling_defaults[3] = { 102static const struct game_params filling_defaults[3] = {
@@ -112,17 +112,17 @@ static game_params *default_params(void)
112 return ret; 112 return ret;
113} 113}
114 114
115static int game_fetch_preset(int i, char **name, game_params **params) 115static bool game_fetch_preset(int i, char **name, game_params **params)
116{ 116{
117 char buf[64]; 117 char buf[64];
118 118
119 if (i < 0 || i >= lenof(filling_defaults)) return FALSE; 119 if (i < 0 || i >= lenof(filling_defaults)) return false;
120 *params = snew(game_params); 120 *params = snew(game_params);
121 **params = filling_defaults[i]; /* struct copy */ 121 **params = filling_defaults[i]; /* struct copy */
122 sprintf(buf, "%dx%d", filling_defaults[i].w, filling_defaults[i].h); 122 sprintf(buf, "%dx%d", filling_defaults[i].w, filling_defaults[i].h);
123 *name = dupstr(buf); 123 *name = dupstr(buf);
124 124
125 return TRUE; 125 return true;
126} 126}
127 127
128static void free_params(game_params *params) 128static void free_params(game_params *params)
@@ -144,7 +144,7 @@ static void decode_params(game_params *ret, char const *string)
144 if (*string == 'x') ret->h = atoi(++string); 144 if (*string == 'x') ret->h = atoi(++string);
145} 145}
146 146
147static char *encode_params(const game_params *params, int full) 147static char *encode_params(const game_params *params, bool full)
148{ 148{
149 char buf[64]; 149 char buf[64];
150 sprintf(buf, "%dx%d", params->w, params->h); 150 sprintf(buf, "%dx%d", params->w, params->h);
@@ -184,7 +184,7 @@ static game_params *custom_params(const config_item *cfg)
184 return ret; 184 return ret;
185} 185}
186 186
187static const char *validate_params(const game_params *params, int full) 187static const char *validate_params(const game_params *params, bool full)
188{ 188{
189 if (params->w < 1) return "Width must be at least one"; 189 if (params->w < 1) return "Width must be at least one";
190 if (params->h < 1) return "Height must be at least one"; 190 if (params->h < 1) return "Height must be at least one";
@@ -268,9 +268,9 @@ static char *board_to_string(int *board, int w, int h) {
268 return repr; 268 return repr;
269} 269}
270 270
271static int game_can_format_as_text_now(const game_params *params) 271static bool game_can_format_as_text_now(const game_params *params)
272{ 272{
273 return TRUE; 273 return true;
274} 274}
275 275
276static char *game_text_format(const game_state *state) 276static char *game_text_format(const game_state *state)
@@ -312,7 +312,7 @@ static void free_game(game_state *);
312 312
313#define SENTINEL sz 313#define SENTINEL sz
314 314
315static int mark_region(int *board, int w, int h, int i, int n, int m) { 315static bool mark_region(int *board, int w, int h, int i, int n, int m) {
316 int j; 316 int j;
317 317
318 board[i] = -1; 318 board[i] = -1;
@@ -320,11 +320,11 @@ static int mark_region(int *board, int w, int h, int i, int n, int m) {
320 for (j = 0; j < 4; ++j) { 320 for (j = 0; j < 4; ++j) {
321 const int x = (i % w) + dx[j], y = (i / w) + dy[j], ii = w*y + x; 321 const int x = (i % w) + dx[j], y = (i / w) + dy[j], ii = w*y + x;
322 if (x < 0 || x >= w || y < 0 || y >= h) continue; 322 if (x < 0 || x >= w || y < 0 || y >= h) continue;
323 if (board[ii] == m) return FALSE; 323 if (board[ii] == m) return false;
324 if (board[ii] != n) continue; 324 if (board[ii] != n) continue;
325 if (!mark_region(board, w, h, ii, n, m)) return FALSE; 325 if (!mark_region(board, w, h, ii, n, m)) return false;
326 } 326 }
327 return TRUE; 327 return true;
328} 328}
329 329
330static int region_size(int *board, int w, int h, int i) { 330static int region_size(int *board, int w, int h, int i) {
@@ -345,15 +345,18 @@ static void merge_ones(int *board, int w, int h)
345{ 345{
346 const int sz = w * h; 346 const int sz = w * h;
347 const int maxsize = min(max(max(w, h), 3), 9); 347 const int maxsize = min(max(max(w, h), 3), 9);
348 int i, j, k, change; 348 int i, j, k;
349 bool change;
349 do { 350 do {
350 change = FALSE; 351 change = false;
351 for (i = 0; i < sz; ++i) { 352 for (i = 0; i < sz; ++i) {
352 if (board[i] != 1) continue; 353 if (board[i] != 1) continue;
353 354
354 for (j = 0; j < 4; ++j, board[i] = 1) { 355 for (j = 0; j < 4; ++j, board[i] = 1) {
355 const int x = (i % w) + dx[j], y = (i / w) + dy[j]; 356 const int x = (i % w) + dx[j], y = (i / w) + dy[j];
356 int oldsize, newsize, ok, ii = w*y + x; 357 int oldsize, newsize, ii = w*y + x;
358 bool ok;
359
357 if (x < 0 || x >= w || y < 0 || y >= h) continue; 360 if (x < 0 || x >= w || y < 0 || y >= h) continue;
358 if (board[ii] == maxsize) continue; 361 if (board[ii] == maxsize) continue;
359 362
@@ -371,7 +374,7 @@ static void merge_ones(int *board, int w, int h)
371 374
372 if (ok) break; 375 if (ok) break;
373 } 376 }
374 if (j < 4) change = TRUE; 377 if (j < 4) change = true;
375 } 378 }
376 } while (change); 379 } while (change);
377} 380}
@@ -387,7 +390,8 @@ static void make_board(int *board, int w, int h, random_state *rs) {
387 /* Note that if 1 in {w, h} then it's impossible to have a region 390 /* Note that if 1 in {w, h} then it's impossible to have a region
388 * of size > w*h, so the special case only affects w=h=2. */ 391 * of size > w*h, so the special case only affects w=h=2. */
389 392
390 int i, change, *dsf; 393 int i, *dsf;
394 bool change;
391 395
392 assert(w >= 1); 396 assert(w >= 1);
393 assert(h >= 1); 397 assert(h >= 1);
@@ -403,11 +407,12 @@ retry:
403 shuffle(board, sz, sizeof (int), rs); 407 shuffle(board, sz, sizeof (int), rs);
404 408
405 do { 409 do {
406 change = FALSE; /* as long as the board potentially has errors */ 410 change = false; /* as long as the board potentially has errors */
407 for (i = 0; i < sz; ++i) { 411 for (i = 0; i < sz; ++i) {
408 const int square = dsf_canonify(dsf, board[i]); 412 const int square = dsf_canonify(dsf, board[i]);
409 const int size = dsf_size(dsf, square); 413 const int size = dsf_size(dsf, square);
410 int merge = SENTINEL, min = maxsize - size + 1, error = FALSE; 414 int merge = SENTINEL, min = maxsize - size + 1;
415 bool error = false;
411 int neighbour, neighbour_size, j; 416 int neighbour, neighbour_size, j;
412 417
413 for (j = 0; j < 4; ++j) { 418 for (j = 0; j < 4; ++j) {
@@ -419,7 +424,7 @@ retry:
419 if (square == neighbour) continue; 424 if (square == neighbour) continue;
420 425
421 neighbour_size = dsf_size(dsf, neighbour); 426 neighbour_size = dsf_size(dsf, neighbour);
422 if (size == neighbour_size) error = TRUE; 427 if (size == neighbour_size) error = true;
423 428
424 /* find the smallest neighbour to merge with, which 429 /* find the smallest neighbour to merge with, which
425 * wouldn't make the region too large. (This is 430 * wouldn't make the region too large. (This is
@@ -441,7 +446,7 @@ retry:
441 446
442 /* merge with the smallest neighbouring workable region. */ 447 /* merge with the smallest neighbouring workable region. */
443 dsf_merge(dsf, square, merge); 448 dsf_merge(dsf, square, merge);
444 change = TRUE; 449 change = true;
445 } 450 }
446 } while (change); 451 } while (change);
447 452
@@ -520,7 +525,7 @@ static void flood_count(int *board, int w, int h, int i, int n, int *c) {
520 } 525 }
521} 526}
522 527
523static int check_capacity(int *board, int w, int h, int i) { 528static bool check_capacity(int *board, int w, int h, int i) {
524 int n = board[i]; 529 int n = board[i];
525 flood_count(board, w, h, i, board[i], &n); 530 flood_count(board, w, h, i, board[i], &n);
526 clear_count(board, w * h); 531 clear_count(board, w * h);
@@ -625,16 +630,16 @@ static void init_solver_state(struct solver_state *s, int w, int h) {
625 else filled_square(s, w, h, i); 630 else filled_square(s, w, h, i);
626} 631}
627 632
628static int learn_expand_or_one(struct solver_state *s, int w, int h) { 633static bool learn_expand_or_one(struct solver_state *s, int w, int h) {
629 const int sz = w * h; 634 const int sz = w * h;
630 int i; 635 int i;
631 int learn = FALSE; 636 bool learn = false;
632 637
633 assert(s); 638 assert(s);
634 639
635 for (i = 0; i < sz; ++i) { 640 for (i = 0; i < sz; ++i) {
636 int j; 641 int j;
637 int one = TRUE; 642 bool one = true;
638 643
639 if (s->board[i] != EMPTY) continue; 644 if (s->board[i] != EMPTY) continue;
640 645
@@ -644,14 +649,14 @@ static int learn_expand_or_one(struct solver_state *s, int w, int h) {
644 const int idx = w*y + x; 649 const int idx = w*y + x;
645 if (x < 0 || x >= w || y < 0 || y >= h) continue; 650 if (x < 0 || x >= w || y < 0 || y >= h) continue;
646 if (s->board[idx] == EMPTY) { 651 if (s->board[idx] == EMPTY) {
647 one = FALSE; 652 one = false;
648 continue; 653 continue;
649 } 654 }
650 if (one && 655 if (one &&
651 (s->board[idx] == 1 || 656 (s->board[idx] == 1 ||
652 (s->board[idx] >= expandsize(s->board, s->dsf, w, h, 657 (s->board[idx] >= expandsize(s->board, s->dsf, w, h,
653 i, s->board[idx])))) 658 i, s->board[idx]))))
654 one = FALSE; 659 one = false;
655 if (dsf_size(s->dsf, idx) == s->board[idx]) continue; 660 if (dsf_size(s->dsf, idx) == s->board[idx]) continue;
656 assert(s->board[i] == EMPTY); 661 assert(s->board[i] == EMPTY);
657 s->board[i] = -SENTINEL; 662 s->board[i] = -SENTINEL;
@@ -659,7 +664,7 @@ static int learn_expand_or_one(struct solver_state *s, int w, int h) {
659 assert(s->board[i] == EMPTY); 664 assert(s->board[i] == EMPTY);
660 printv("learn: expanding in one\n"); 665 printv("learn: expanding in one\n");
661 expand(s, w, h, i, idx); 666 expand(s, w, h, i, idx);
662 learn = TRUE; 667 learn = true;
663 break; 668 break;
664 } 669 }
665 670
@@ -669,16 +674,16 @@ static int learn_expand_or_one(struct solver_state *s, int w, int h) {
669 s->board[i] = 1; 674 s->board[i] = 1;
670 assert(s->nempty); 675 assert(s->nempty);
671 --s->nempty; 676 --s->nempty;
672 learn = TRUE; 677 learn = true;
673 } 678 }
674 } 679 }
675 return learn; 680 return learn;
676} 681}
677 682
678static int learn_blocked_expansion(struct solver_state *s, int w, int h) { 683static bool learn_blocked_expansion(struct solver_state *s, int w, int h) {
679 const int sz = w * h; 684 const int sz = w * h;
680 int i; 685 int i;
681 int learn = FALSE; 686 bool learn = false;
682 687
683 assert(s); 688 assert(s);
684 /* for every connected component */ 689 /* for every connected component */
@@ -758,7 +763,7 @@ static int learn_blocked_expansion(struct solver_state *s, int w, int h) {
758 if (exp == SENTINEL) continue; 763 if (exp == SENTINEL) continue;
759 printv("learning to expand\n"); 764 printv("learning to expand\n");
760 expand(s, w, h, exp, i); 765 expand(s, w, h, exp, i);
761 learn = TRUE; 766 learn = true;
762 767
763 next_i: 768 next_i:
764 ; 769 ;
@@ -767,10 +772,10 @@ static int learn_blocked_expansion(struct solver_state *s, int w, int h) {
767 return learn; 772 return learn;
768} 773}
769 774
770static int learn_critical_square(struct solver_state *s, int w, int h) { 775static bool learn_critical_square(struct solver_state *s, int w, int h) {
771 const int sz = w * h; 776 const int sz = w * h;
772 int i; 777 int i;
773 int learn = FALSE; 778 bool learn = false;
774 assert(s); 779 assert(s);
775 780
776 /* for each connected component */ 781 /* for each connected component */
@@ -804,7 +809,7 @@ static int learn_critical_square(struct solver_state *s, int w, int h) {
804 --s->nempty; 809 --s->nempty;
805 s->board[j] = s->board[i]; 810 s->board[j] = s->board[i];
806 filled_square(s, w, h, j); 811 filled_square(s, w, h, j);
807 learn = TRUE; 812 learn = true;
808 } 813 }
809 } 814 }
810 return learn; 815 return learn;
@@ -824,14 +829,14 @@ static void print_bitmap(int *bitmap, int w, int h) {
824} 829}
825#endif 830#endif
826 831
827static int learn_bitmap_deductions(struct solver_state *s, int w, int h) 832static bool learn_bitmap_deductions(struct solver_state *s, int w, int h)
828{ 833{
829 const int sz = w * h; 834 const int sz = w * h;
830 int *bm = s->bm; 835 int *bm = s->bm;
831 int *dsf = s->bmdsf; 836 int *dsf = s->bmdsf;
832 int *minsize = s->bmminsize; 837 int *minsize = s->bmminsize;
833 int x, y, i, j, n; 838 int x, y, i, j, n;
834 int learn = FALSE; 839 bool learn = false;
835 840
836 /* 841 /*
837 * This function does deductions based on building up a bitmap 842 * This function does deductions based on building up a bitmap
@@ -1058,7 +1063,7 @@ static int learn_bitmap_deductions(struct solver_state *s, int w, int h)
1058 filled_square(s, w, h, i); 1063 filled_square(s, w, h, i);
1059 assert(s->nempty); 1064 assert(s->nempty);
1060 --s->nempty; 1065 --s->nempty;
1061 learn = TRUE; 1066 learn = true;
1062 } 1067 }
1063 } 1068 }
1064 } 1069 }
@@ -1066,7 +1071,7 @@ static int learn_bitmap_deductions(struct solver_state *s, int w, int h)
1066 return learn; 1071 return learn;
1067} 1072}
1068 1073
1069static int solver(const int *orig, int w, int h, char **solution) { 1074static bool solver(const int *orig, int w, int h, char **solution) {
1070 const int sz = w * h; 1075 const int sz = w * h;
1071 1076
1072 struct solver_state ss; 1077 struct solver_state ss;
@@ -1238,7 +1243,7 @@ static int encode_run(char *buffer, int run)
1238} 1243}
1239 1244
1240static char *new_game_desc(const game_params *params, random_state *rs, 1245static char *new_game_desc(const game_params *params, random_state *rs,
1241 char **aux, int interactive) 1246 char **aux, bool interactive)
1242{ 1247{
1243 const int w = params->w, h = params->h, sz = w * h; 1248 const int w = params->w, h = params->h, sz = w * h;
1244 int *board = snewn(sz, int), i, j, run; 1249 int *board = snewn(sz, int), i, j, run;
@@ -1312,7 +1317,8 @@ static game_state *new_game(midend *me, const game_params *params,
1312 int sz = params->w * params->h; 1317 int sz = params->w * params->h;
1313 int i; 1318 int i;
1314 1319
1315 state->cheated = state->completed = FALSE; 1320 state->cheated = false;
1321 state->completed = false;
1316 state->shared = snew(struct shared_state); 1322 state->shared = snew(struct shared_state);
1317 state->shared->refcnt = 1; 1323 state->shared->refcnt = 1;
1318 state->shared->params = *params; /* struct copy */ 1324 state->shared->params = *params; /* struct copy */
@@ -1374,8 +1380,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1374 *****************************************************************************/ 1380 *****************************************************************************/
1375 1381
1376struct game_ui { 1382struct game_ui {
1377 int *sel; /* w*h highlighted squares, or NULL */ 1383 bool *sel; /* w*h highlighted squares, or NULL */
1378 int cur_x, cur_y, cur_visible, keydragging; 1384 int cur_x, cur_y;
1385 bool cur_visible, keydragging;
1379}; 1386};
1380 1387
1381static game_ui *new_ui(const game_state *state) 1388static game_ui *new_ui(const game_state *state)
@@ -1383,7 +1390,9 @@ static game_ui *new_ui(const game_state *state)
1383 game_ui *ui = snew(game_ui); 1390 game_ui *ui = snew(game_ui);
1384 1391
1385 ui->sel = NULL; 1392 ui->sel = NULL;
1386 ui->cur_x = ui->cur_y = ui->cur_visible = ui->keydragging = 0; 1393 ui->cur_x = ui->cur_y = 0;
1394 ui->cur_visible = false;
1395 ui->keydragging = false;
1387 1396
1388 return ui; 1397 return ui;
1389} 1398}
@@ -1412,7 +1421,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1412 sfree(ui->sel); 1421 sfree(ui->sel);
1413 ui->sel = NULL; 1422 ui->sel = NULL;
1414 } 1423 }
1415 ui->keydragging = FALSE; 1424 ui->keydragging = false;
1416} 1425}
1417 1426
1418#define PREFERRED_TILE_SIZE 32 1427#define PREFERRED_TILE_SIZE 32
@@ -1423,7 +1432,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1423struct game_drawstate { 1432struct game_drawstate {
1424 struct game_params params; 1433 struct game_params params;
1425 int tilesize; 1434 int tilesize;
1426 int started; 1435 bool started;
1427 int *v, *flags; 1436 int *v, *flags;
1428 int *dsf_scratch, *border_scratch; 1437 int *dsf_scratch, *border_scratch;
1429}; 1438};
@@ -1456,25 +1465,25 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1456 } 1465 }
1457 if (tx >= 0 && tx < w && ty >= 0 && ty < h) { 1466 if (tx >= 0 && tx < w && ty >= 0 && ty < h) {
1458 if (!ui->sel) { 1467 if (!ui->sel) {
1459 ui->sel = snewn(w*h, int); 1468 ui->sel = snewn(w*h, bool);
1460 memset(ui->sel, 0, w*h*sizeof(int)); 1469 memset(ui->sel, 0, w*h*sizeof(bool));
1461 } 1470 }
1462 if (!state->shared->clues[w*ty+tx]) 1471 if (!state->shared->clues[w*ty+tx])
1463 ui->sel[w*ty+tx] = 1; 1472 ui->sel[w*ty+tx] = true;
1464 } 1473 }
1465 ui->cur_visible = 0; 1474 ui->cur_visible = false;
1466 return UI_UPDATE; 1475 return UI_UPDATE;
1467 } 1476 }
1468 1477
1469 if (IS_CURSOR_MOVE(button)) { 1478 if (IS_CURSOR_MOVE(button)) {
1470 ui->cur_visible = 1; 1479 ui->cur_visible = true;
1471 move_cursor(button, &ui->cur_x, &ui->cur_y, w, h, 0); 1480 move_cursor(button, &ui->cur_x, &ui->cur_y, w, h, false);
1472 if (ui->keydragging) goto select_square; 1481 if (ui->keydragging) goto select_square;
1473 return UI_UPDATE; 1482 return UI_UPDATE;
1474 } 1483 }
1475 if (button == CURSOR_SELECT) { 1484 if (button == CURSOR_SELECT) {
1476 if (!ui->cur_visible) { 1485 if (!ui->cur_visible) {
1477 ui->cur_visible = 1; 1486 ui->cur_visible = true;
1478 return UI_UPDATE; 1487 return UI_UPDATE;
1479 } 1488 }
1480 ui->keydragging = !ui->keydragging; 1489 ui->keydragging = !ui->keydragging;
@@ -1482,23 +1491,23 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1482 1491
1483 select_square: 1492 select_square:
1484 if (!ui->sel) { 1493 if (!ui->sel) {
1485 ui->sel = snewn(w*h, int); 1494 ui->sel = snewn(w*h, bool);
1486 memset(ui->sel, 0, w*h*sizeof(int)); 1495 memset(ui->sel, 0, w*h*sizeof(bool));
1487 } 1496 }
1488 if (!state->shared->clues[w*ui->cur_y + ui->cur_x]) 1497 if (!state->shared->clues[w*ui->cur_y + ui->cur_x])
1489 ui->sel[w*ui->cur_y + ui->cur_x] = 1; 1498 ui->sel[w*ui->cur_y + ui->cur_x] = true;
1490 return UI_UPDATE; 1499 return UI_UPDATE;
1491 } 1500 }
1492 if (button == CURSOR_SELECT2) { 1501 if (button == CURSOR_SELECT2) {
1493 if (!ui->cur_visible) { 1502 if (!ui->cur_visible) {
1494 ui->cur_visible = 1; 1503 ui->cur_visible = true;
1495 return UI_UPDATE; 1504 return UI_UPDATE;
1496 } 1505 }
1497 if (!ui->sel) { 1506 if (!ui->sel) {
1498 ui->sel = snewn(w*h, int); 1507 ui->sel = snewn(w*h, bool);
1499 memset(ui->sel, 0, w*h*sizeof(int)); 1508 memset(ui->sel, 0, w*h*sizeof(bool));
1500 } 1509 }
1501 ui->keydragging = FALSE; 1510 ui->keydragging = false;
1502 if (!state->shared->clues[w*ui->cur_y + ui->cur_x]) 1511 if (!state->shared->clues[w*ui->cur_y + ui->cur_x])
1503 ui->sel[w*ui->cur_y + ui->cur_x] ^= 1; 1512 ui->sel[w*ui->cur_y + ui->cur_x] ^= 1;
1504 for (i = 0; i < w*h && !ui->sel[i]; i++); 1513 for (i = 0; i < w*h && !ui->sel[i]; i++);
@@ -1512,14 +1521,14 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1512 if (button == '\b' || button == 27) { 1521 if (button == '\b' || button == 27) {
1513 sfree(ui->sel); 1522 sfree(ui->sel);
1514 ui->sel = NULL; 1523 ui->sel = NULL;
1515 ui->keydragging = FALSE; 1524 ui->keydragging = false;
1516 return UI_UPDATE; 1525 return UI_UPDATE;
1517 } 1526 }
1518 1527
1519 if (button < '0' || button > '9') return NULL; 1528 if (button < '0' || button > '9') return NULL;
1520 button -= '0'; 1529 button -= '0';
1521 if (button > (w == 2 && h == 2 ? 3 : max(w, h))) return NULL; 1530 if (button > (w == 2 && h == 2 ? 3 : max(w, h))) return NULL;
1522 ui->keydragging = FALSE; 1531 ui->keydragging = false;
1523 1532
1524 for (i = 0; i < w*h; i++) { 1533 for (i = 0; i < w*h; i++) {
1525 char buf[32]; 1534 char buf[32];
@@ -1560,7 +1569,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1560 int i = 0; 1569 int i = 0;
1561 new_state = dup_game(state); 1570 new_state = dup_game(state);
1562 for (++move; i < sz; ++i) new_state->board[i] = move[i] - '0'; 1571 for (++move; i < sz; ++i) new_state->board[i] = move[i] - '0';
1563 new_state->cheated = TRUE; 1572 new_state->cheated = true;
1564 } else { 1573 } else {
1565 int value; 1574 int value;
1566 char *endptr, *delim = strchr(move, '_'); 1575 char *endptr, *delim = strchr(move, '_');
@@ -1592,7 +1601,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1592 for (i = 0; i < sz && new_state->board[i] == dsf_size(dsf, i); ++i); 1601 for (i = 0; i < sz && new_state->board[i] == dsf_size(dsf, i); ++i);
1593 sfree(dsf); 1602 sfree(dsf);
1594 if (i == sz) 1603 if (i == sz)
1595 new_state->completed = TRUE; 1604 new_state->completed = true;
1596 } 1605 }
1597 1606
1598 return new_state; 1607 return new_state;
@@ -1673,7 +1682,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1673 int i; 1682 int i;
1674 1683
1675 ds->tilesize = PREFERRED_TILE_SIZE; 1684 ds->tilesize = PREFERRED_TILE_SIZE;
1676 ds->started = 0; 1685 ds->started = false;
1677 ds->params = state->shared->params; 1686 ds->params = state->shared->params;
1678 ds->v = snewn(ds->params.w * ds->params.h, int); 1687 ds->v = snewn(ds->params.w * ds->params.h, int);
1679 ds->flags = snewn(ds->params.w * ds->params.h, int); 1688 ds->flags = snewn(ds->params.w * ds->params.h, int);
@@ -1836,8 +1845,9 @@ static void draw_square(drawing *dr, game_drawstate *ds, int x, int y,
1836 TILE_SIZE); 1845 TILE_SIZE);
1837} 1846}
1838 1847
1839static void draw_grid(drawing *dr, game_drawstate *ds, const game_state *state, 1848static void draw_grid(
1840 const game_ui *ui, int flashy, int borders, int shading) 1849 drawing *dr, game_drawstate *ds, const game_state *state,
1850 const game_ui *ui, bool flashy, bool borders, bool shading)
1841{ 1851{
1842 const int w = state->shared->params.w; 1852 const int w = state->shared->params.w;
1843 const int h = state->shared->params.h; 1853 const int h = state->shared->params.h;
@@ -1862,7 +1872,7 @@ static void draw_grid(drawing *dr, game_drawstate *ds, const game_state *state,
1862 int v1, s1, v2, s2; 1872 int v1, s1, v2, s2;
1863 1873
1864 for (dx = 0; dx <= 1; dx++) { 1874 for (dx = 0; dx <= 1; dx++) {
1865 int border = FALSE; 1875 bool border = false;
1866 1876
1867 dy = 1 - dx; 1877 dy = 1 - dx;
1868 1878
@@ -1885,16 +1895,16 @@ static void draw_grid(drawing *dr, game_drawstate *ds, const game_state *state,
1885 * contain actual numbers... 1895 * contain actual numbers...
1886 */ 1896 */
1887 if (v1 && v2) 1897 if (v1 && v2)
1888 border = TRUE; 1898 border = true;
1889 1899
1890 /* 1900 /*
1891 * ... or if at least one of them is a 1901 * ... or if at least one of them is a
1892 * completed or overfull omino. 1902 * completed or overfull omino.
1893 */ 1903 */
1894 if (v1 && s1 >= v1) 1904 if (v1 && s1 >= v1)
1895 border = TRUE; 1905 border = true;
1896 if (v2 && s2 >= v2) 1906 if (v2 && s2 >= v2)
1897 border = TRUE; 1907 border = true;
1898 } 1908 }
1899 1909
1900 if (border) 1910 if (border)
@@ -2001,7 +2011,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2001 const int w = state->shared->params.w; 2011 const int w = state->shared->params.w;
2002 const int h = state->shared->params.h; 2012 const int h = state->shared->params.h;
2003 2013
2004 const int flashy = 2014 const bool flashy =
2005 flashtime > 0 && 2015 flashtime > 0 &&
2006 (flashtime <= FLASH_TIME/3 || flashtime >= FLASH_TIME*2/3); 2016 (flashtime <= FLASH_TIME/3 || flashtime >= FLASH_TIME*2/3);
2007 2017
@@ -2025,10 +2035,10 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2025 2035
2026 draw_update(dr, 0, 0, w*TILE_SIZE + 2*BORDER, h*TILE_SIZE + 2*BORDER); 2036 draw_update(dr, 0, 0, w*TILE_SIZE + 2*BORDER, h*TILE_SIZE + 2*BORDER);
2027 2037
2028 ds->started = TRUE; 2038 ds->started = true;
2029 } 2039 }
2030 2040
2031 draw_grid(dr, ds, state, ui, flashy, TRUE, TRUE); 2041 draw_grid(dr, ds, state, ui, flashy, true, true);
2032} 2042}
2033 2043
2034static float game_anim_length(const game_state *oldstate, 2044static float game_anim_length(const game_state *oldstate,
@@ -2055,9 +2065,9 @@ static int game_status(const game_state *state)
2055 return state->completed ? +1 : 0; 2065 return state->completed ? +1 : 0;
2056} 2066}
2057 2067
2058static int game_timing_state(const game_state *state, game_ui *ui) 2068static bool game_timing_state(const game_state *state, game_ui *ui)
2059{ 2069{
2060 return TRUE; 2070 return true;
2061} 2071}
2062 2072
2063static void game_print_size(const game_params *params, float *x, float *y) 2073static void game_print_size(const game_params *params, float *x, float *y)
@@ -2076,7 +2086,8 @@ static void game_print(drawing *dr, const game_state *state, int tilesize)
2076{ 2086{
2077 const int w = state->shared->params.w; 2087 const int w = state->shared->params.w;
2078 const int h = state->shared->params.h; 2088 const int h = state->shared->params.h;
2079 int c, i, borders; 2089 int c, i;
2090 bool borders;
2080 2091
2081 /* Ick: fake up `ds->tilesize' for macro expansion purposes */ 2092 /* Ick: fake up `ds->tilesize' for macro expansion purposes */
2082 game_drawstate *ds = game_new_drawstate(dr, state); 2093 game_drawstate *ds = game_new_drawstate(dr, state);
@@ -2101,16 +2112,16 @@ static void game_print(drawing *dr, const game_state *state, int tilesize)
2101 * We'll draw borders between the ominoes iff the grid is not 2112 * We'll draw borders between the ominoes iff the grid is not
2102 * pristine. So scan it to see if it is. 2113 * pristine. So scan it to see if it is.
2103 */ 2114 */
2104 borders = FALSE; 2115 borders = false;
2105 for (i = 0; i < w*h; i++) 2116 for (i = 0; i < w*h; i++)
2106 if (state->board[i] && !state->shared->clues[i]) 2117 if (state->board[i] && !state->shared->clues[i])
2107 borders = TRUE; 2118 borders = true;
2108 2119
2109 /* 2120 /*
2110 * Draw grid. 2121 * Draw grid.
2111 */ 2122 */
2112 print_line_width(dr, TILE_SIZE / 64); 2123 print_line_width(dr, TILE_SIZE / 64);
2113 draw_grid(dr, ds, state, NULL, FALSE, borders, FALSE); 2124 draw_grid(dr, ds, state, NULL, false, borders, false);
2114 2125
2115 /* 2126 /*
2116 * Clean up. 2127 * Clean up.
@@ -2130,15 +2141,15 @@ const struct game thegame = {
2130 encode_params, 2141 encode_params,
2131 free_params, 2142 free_params,
2132 dup_params, 2143 dup_params,
2133 TRUE, game_configure, custom_params, 2144 true, game_configure, custom_params,
2134 validate_params, 2145 validate_params,
2135 new_game_desc, 2146 new_game_desc,
2136 validate_desc, 2147 validate_desc,
2137 new_game, 2148 new_game,
2138 dup_game, 2149 dup_game,
2139 free_game, 2150 free_game,
2140 TRUE, solve_game, 2151 true, solve_game,
2141 TRUE, game_can_format_as_text_now, game_text_format, 2152 true, game_can_format_as_text_now, game_text_format,
2142 new_ui, 2153 new_ui,
2143 free_ui, 2154 free_ui,
2144 encode_ui, 2155 encode_ui,
@@ -2155,9 +2166,9 @@ const struct game thegame = {
2155 game_anim_length, 2166 game_anim_length,
2156 game_flash_length, 2167 game_flash_length,
2157 game_status, 2168 game_status,
2158 TRUE, FALSE, game_print_size, game_print, 2169 true, false, game_print_size, game_print,
2159 FALSE, /* wants_statusbar */ 2170 false, /* wants_statusbar */
2160 FALSE, game_timing_state, 2171 false, game_timing_state,
2161 REQUIRE_NUMPAD, /* flags */ 2172 REQUIRE_NUMPAD, /* flags */
2162}; 2173};
2163 2174
diff --git a/apps/plugins/puzzles/src/findloop.c b/apps/plugins/puzzles/src/findloop.c
index e6b2654cad..ffda12d716 100644
--- a/apps/plugins/puzzles/src/findloop.c
+++ b/apps/plugins/puzzles/src/findloop.c
@@ -14,7 +14,8 @@
14#include "puzzles.h" 14#include "puzzles.h"
15 15
16struct findloopstate { 16struct findloopstate {
17 int parent, child, sibling, visited; 17 int parent, child, sibling;
18 bool visited;
18 int index, minindex, maxindex; 19 int index, minindex, maxindex;
19 int minreachable, maxreachable; 20 int minreachable, maxreachable;
20 int bridge; 21 int bridge;
@@ -37,7 +38,7 @@ void findloop_free_state(struct findloopstate *state)
37 sfree(state); 38 sfree(state);
38} 39}
39 40
40int findloop_is_loop_edge(struct findloopstate *pv, int u, int v) 41bool findloop_is_loop_edge(struct findloopstate *pv, int u, int v)
41{ 42{
42 /* 43 /*
43 * Since the algorithm is intended for finding bridges, and a 44 * Since the algorithm is intended for finding bridges, and a
@@ -56,8 +57,8 @@ int findloop_is_loop_edge(struct findloopstate *pv, int u, int v)
56 return !(pv[u].bridge == v || pv[v].bridge == u); 57 return !(pv[u].bridge == v || pv[v].bridge == u);
57} 58}
58 59
59int findloop_run(struct findloopstate *pv, int nvertices, 60bool findloop_run(struct findloopstate *pv, int nvertices,
60 neighbour_fn_t neighbour, void *ctx) 61 neighbour_fn_t neighbour, void *ctx)
61{ 62{
62 int u, v, w, root, index; 63 int u, v, w, root, index;
63 int nbridges, nedges; 64 int nbridges, nedges;
@@ -80,7 +81,7 @@ int findloop_run(struct findloopstate *pv, int nvertices,
80 pv[v].parent = root; 81 pv[v].parent = root;
81 pv[v].child = -2; 82 pv[v].child = -2;
82 pv[v].sibling = -1; 83 pv[v].sibling = -1;
83 pv[v].visited = FALSE; 84 pv[v].visited = false;
84 } 85 }
85 pv[root].child = -1; 86 pv[root].child = -1;
86 nedges = 0; 87 nedges = 0;
@@ -98,7 +99,7 @@ int findloop_run(struct findloopstate *pv, int nvertices,
98 u = v; 99 u = v;
99 while (1) { 100 while (1) {
100 if (!pv[u].visited) { 101 if (!pv[u].visited) {
101 pv[u].visited = TRUE; 102 pv[u].visited = true;
102 103
103 /* 104 /*
104 * Enumerate the neighbours of u, and any that are 105 * Enumerate the neighbours of u, and any that are
@@ -169,12 +170,12 @@ int findloop_run(struct findloopstate *pv, int nvertices,
169 debug(("--- begin indexing pass\n")); 170 debug(("--- begin indexing pass\n"));
170 index = 0; 171 index = 0;
171 for (v = 0; v < nvertices; v++) 172 for (v = 0; v < nvertices; v++)
172 pv[v].visited = FALSE; 173 pv[v].visited = false;
173 pv[root].visited = TRUE; 174 pv[root].visited = true;
174 u = pv[root].child; 175 u = pv[root].child;
175 while (1) { 176 while (1) {
176 if (!pv[u].visited) { 177 if (!pv[u].visited) {
177 pv[u].visited = TRUE; 178 pv[u].visited = true;
178 179
179 /* 180 /*
180 * Index this node. 181 * Index this node.
@@ -239,12 +240,12 @@ int findloop_run(struct findloopstate *pv, int nvertices,
239 debug(("--- begin min-max pass\n")); 240 debug(("--- begin min-max pass\n"));
240 nbridges = 0; 241 nbridges = 0;
241 for (v = 0; v < nvertices; v++) 242 for (v = 0; v < nvertices; v++)
242 pv[v].visited = FALSE; 243 pv[v].visited = false;
243 u = pv[root].child; 244 u = pv[root].child;
244 pv[root].visited = TRUE; 245 pv[root].visited = true;
245 while (1) { 246 while (1) {
246 if (!pv[u].visited) { 247 if (!pv[u].visited) {
247 pv[u].visited = TRUE; 248 pv[u].visited = true;
248 249
249 /* 250 /*
250 * Look for vertices reachable directly from u, including 251 * Look for vertices reachable directly from u, including
diff --git a/apps/plugins/puzzles/src/flip.c b/apps/plugins/puzzles/src/flip.c
index 481c4b5ec3..29c888edf2 100644
--- a/apps/plugins/puzzles/src/flip.c
+++ b/apps/plugins/puzzles/src/flip.c
@@ -58,7 +58,8 @@ struct matrix {
58 58
59struct game_state { 59struct game_state {
60 int w, h; 60 int w, h;
61 int moves, completed, cheated, hints_active; 61 int moves;
62 bool completed, cheated, hints_active;
62 unsigned char *grid; /* array of w*h */ 63 unsigned char *grid; /* array of w*h */
63 struct matrix *matrix; 64 struct matrix *matrix;
64}; 65};
@@ -82,13 +83,13 @@ static const struct game_params flip_presets[] = {
82 {5, 5, RANDOM}, 83 {5, 5, RANDOM},
83}; 84};
84 85
85static int game_fetch_preset(int i, char **name, game_params **params) 86static bool game_fetch_preset(int i, char **name, game_params **params)
86{ 87{
87 game_params *ret; 88 game_params *ret;
88 char str[80]; 89 char str[80];
89 90
90 if (i < 0 || i >= lenof(flip_presets)) 91 if (i < 0 || i >= lenof(flip_presets))
91 return FALSE; 92 return false;
92 93
93 ret = snew(game_params); 94 ret = snew(game_params);
94 *ret = flip_presets[i]; 95 *ret = flip_presets[i];
@@ -98,7 +99,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
98 99
99 *name = dupstr(str); 100 *name = dupstr(str);
100 *params = ret; 101 *params = ret;
101 return TRUE; 102 return true;
102} 103}
103 104
104static void free_params(game_params *params) 105static void free_params(game_params *params)
@@ -131,7 +132,7 @@ static void decode_params(game_params *ret, char const *string)
131 } 132 }
132} 133}
133 134
134static char *encode_params(const game_params *params, int full) 135static char *encode_params(const game_params *params, bool full)
135{ 136{
136 char data[256]; 137 char data[256];
137 138
@@ -178,7 +179,7 @@ static game_params *custom_params(const config_item *cfg)
178 return ret; 179 return ret;
179} 180}
180 181
181static const char *validate_params(const game_params *params, int full) 182static const char *validate_params(const game_params *params, bool full)
182{ 183{
183 if (params->w <= 0 || params->h <= 0) 184 if (params->w <= 0 || params->h <= 0)
184 return "Width and height must both be greater than zero"; 185 return "Width and height must both be greater than zero";
@@ -344,7 +345,7 @@ static void addneighbours(tree234 *t, int w, int h, int cx, int cy,
344} 345}
345 346
346static char *new_game_desc(const game_params *params, random_state *rs, 347static char *new_game_desc(const game_params *params, random_state *rs,
347 char **aux, int interactive) 348 char **aux, bool interactive)
348{ 349{
349 int w = params->w, h = params->h, wh = w * h; 350 int w = params->w, h = params->h, wh = w * h;
350 int i, j; 351 int i, j;
@@ -619,9 +620,9 @@ static game_state *new_game(midend *me, const game_params *params,
619 620
620 state->w = w; 621 state->w = w;
621 state->h = h; 622 state->h = h;
622 state->completed = FALSE; 623 state->completed = false;
623 state->cheated = FALSE; 624 state->cheated = false;
624 state->hints_active = FALSE; 625 state->hints_active = false;
625 state->moves = 0; 626 state->moves = 0;
626 state->matrix = snew(struct matrix); 627 state->matrix = snew(struct matrix);
627 state->matrix->refcount = 1; 628 state->matrix->refcount = 1;
@@ -850,9 +851,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
850 return ret; 851 return ret;
851} 852}
852 853
853static int game_can_format_as_text_now(const game_params *params) 854static bool game_can_format_as_text_now(const game_params *params)
854{ 855{
855 return TRUE; 856 return true;
856} 857}
857 858
858#define RIGHT 1 859#define RIGHT 1
@@ -896,13 +897,15 @@ static char *game_text_format(const game_state *state)
896#undef DOWN 897#undef DOWN
897 898
898struct game_ui { 899struct game_ui {
899 int cx, cy, cdraw; 900 int cx, cy;
901 bool cdraw;
900}; 902};
901 903
902static game_ui *new_ui(const game_state *state) 904static game_ui *new_ui(const game_state *state)
903{ 905{
904 game_ui *ui = snew(game_ui); 906 game_ui *ui = snew(game_ui);
905 ui->cx = ui->cy = ui->cdraw = 0; 907 ui->cx = ui->cy = 0;
908 ui->cdraw = false;
906 return ui; 909 return ui;
907} 910}
908 911
@@ -926,7 +929,8 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
926} 929}
927 930
928struct game_drawstate { 931struct game_drawstate {
929 int w, h, started; 932 int w, h;
933 bool started;
930 unsigned char *tiles; 934 unsigned char *tiles;
931 int tilesize; 935 int tilesize;
932}; 936};
@@ -942,10 +946,10 @@ static char *interpret_move(const game_state *state, game_ui *ui,
942 int tx, ty; 946 int tx, ty;
943 if (button == LEFT_BUTTON) { 947 if (button == LEFT_BUTTON) {
944 tx = FROMCOORD(x), ty = FROMCOORD(y); 948 tx = FROMCOORD(x), ty = FROMCOORD(y);
945 ui->cdraw = 0; 949 ui->cdraw = false;
946 } else { 950 } else {
947 tx = ui->cx; ty = ui->cy; 951 tx = ui->cx; ty = ui->cy;
948 ui->cdraw = 1; 952 ui->cdraw = true;
949 } 953 }
950 nullret = UI_UPDATE; 954 nullret = UI_UPDATE;
951 955
@@ -955,10 +959,11 @@ static char *interpret_move(const game_state *state, game_ui *ui,
955 * will have at least one square do nothing whatsoever. 959 * will have at least one square do nothing whatsoever.
956 * If so, we avoid encoding a move at all. 960 * If so, we avoid encoding a move at all.
957 */ 961 */
958 int i = ty*w+tx, j, makemove = FALSE; 962 int i = ty*w+tx, j;
963 bool makemove = false;
959 for (j = 0; j < wh; j++) { 964 for (j = 0; j < wh; j++) {
960 if (state->matrix->matrix[i*wh+j]) 965 if (state->matrix->matrix[i*wh+j])
961 makemove = TRUE; 966 makemove = true;
962 } 967 }
963 if (makemove) { 968 if (makemove) {
964 sprintf(buf, "M%d,%d", tx, ty); 969 sprintf(buf, "M%d,%d", tx, ty);
@@ -980,7 +985,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
980 ui->cx += dx; ui->cy += dy; 985 ui->cx += dx; ui->cy += dy;
981 ui->cx = min(max(ui->cx, 0), state->w - 1); 986 ui->cx = min(max(ui->cx, 0), state->w - 1);
982 ui->cy = min(max(ui->cy, 0), state->h - 1); 987 ui->cy = min(max(ui->cy, 0), state->h - 1);
983 ui->cdraw = 1; 988 ui->cdraw = true;
984 nullret = UI_UPDATE; 989 nullret = UI_UPDATE;
985 } 990 }
986 991
@@ -997,8 +1002,8 @@ static game_state *execute_move(const game_state *from, const char *move)
997 int i; 1002 int i;
998 1003
999 ret = dup_game(from); 1004 ret = dup_game(from);
1000 ret->hints_active = TRUE; 1005 ret->hints_active = true;
1001 ret->cheated = TRUE; 1006 ret->cheated = true;
1002 for (i = 0; i < wh; i++) { 1007 for (i = 0; i < wh; i++) {
1003 ret->grid[i] &= ~2; 1008 ret->grid[i] &= ~2;
1004 if (move[i+1] != '0') 1009 if (move[i+1] != '0')
@@ -1008,7 +1013,8 @@ static game_state *execute_move(const game_state *from, const char *move)
1008 } else if (move[0] == 'M' && 1013 } else if (move[0] == 'M' &&
1009 sscanf(move+1, "%d,%d", &x, &y) == 2 && 1014 sscanf(move+1, "%d,%d", &x, &y) == 2 &&
1010 x >= 0 && x < w && y >= 0 && y < h) { 1015 x >= 0 && x < w && y >= 0 && y < h) {
1011 int i, j, done; 1016 int i, j;
1017 bool done;
1012 1018
1013 ret = dup_game(from); 1019 ret = dup_game(from);
1014 1020
@@ -1017,16 +1023,16 @@ static game_state *execute_move(const game_state *from, const char *move)
1017 1023
1018 i = y * w + x; 1024 i = y * w + x;
1019 1025
1020 done = TRUE; 1026 done = true;
1021 for (j = 0; j < wh; j++) { 1027 for (j = 0; j < wh; j++) {
1022 ret->grid[j] ^= ret->matrix->matrix[i*wh+j]; 1028 ret->grid[j] ^= ret->matrix->matrix[i*wh+j];
1023 if (ret->grid[j] & 1) 1029 if (ret->grid[j] & 1)
1024 done = FALSE; 1030 done = false;
1025 } 1031 }
1026 ret->grid[i] ^= 2; /* toggle hint */ 1032 ret->grid[i] ^= 2; /* toggle hint */
1027 if (done) { 1033 if (done) {
1028 ret->completed = TRUE; 1034 ret->completed = true;
1029 ret->hints_active = FALSE; 1035 ret->hints_active = false;
1030 } 1036 }
1031 1037
1032 return ret; 1038 return ret;
@@ -1094,7 +1100,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1094 struct game_drawstate *ds = snew(struct game_drawstate); 1100 struct game_drawstate *ds = snew(struct game_drawstate);
1095 int i; 1101 int i;
1096 1102
1097 ds->started = FALSE; 1103 ds->started = false;
1098 ds->w = state->w; 1104 ds->w = state->w;
1099 ds->h = state->h; 1105 ds->h = state->h;
1100 ds->tiles = snewn(ds->w*ds->h, unsigned char); 1106 ds->tiles = snewn(ds->w*ds->h, unsigned char);
@@ -1112,7 +1118,7 @@ static void game_free_drawstate(drawing *dr, game_drawstate *ds)
1112} 1118}
1113 1119
1114static void draw_tile(drawing *dr, game_drawstate *ds, const game_state *state, 1120static void draw_tile(drawing *dr, game_drawstate *ds, const game_state *state,
1115 int x, int y, int tile, int anim, float animtime) 1121 int x, int y, int tile, bool anim, float animtime)
1116{ 1122{
1117 int w = ds->w, h = ds->h, wh = w * h; 1123 int w = ds->w, h = ds->h, wh = w * h;
1118 int bx = x * TILE_SIZE + BORDER, by = y * TILE_SIZE + BORDER; 1124 int bx = x * TILE_SIZE + BORDER, by = y * TILE_SIZE + BORDER;
@@ -1214,7 +1220,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1214 draw_update(dr, 0, 0, TILE_SIZE * w + 2 * BORDER, 1220 draw_update(dr, 0, 0, TILE_SIZE * w + 2 * BORDER,
1215 TILE_SIZE * h + 2 * BORDER); 1221 TILE_SIZE * h + 2 * BORDER);
1216 1222
1217 ds->started = TRUE; 1223 ds->started = true;
1218 } 1224 }
1219 1225
1220 if (flashtime) 1226 if (flashtime)
@@ -1289,9 +1295,9 @@ static int game_status(const game_state *state)
1289 return state->completed ? +1 : 0; 1295 return state->completed ? +1 : 0;
1290} 1296}
1291 1297
1292static int game_timing_state(const game_state *state, game_ui *ui) 1298static bool game_timing_state(const game_state *state, game_ui *ui)
1293{ 1299{
1294 return TRUE; 1300 return true;
1295} 1301}
1296 1302
1297static void game_print_size(const game_params *params, float *x, float *y) 1303static void game_print_size(const game_params *params, float *x, float *y)
@@ -1314,15 +1320,15 @@ const struct game thegame = {
1314 encode_params, 1320 encode_params,
1315 free_params, 1321 free_params,
1316 dup_params, 1322 dup_params,
1317 TRUE, game_configure, custom_params, 1323 true, game_configure, custom_params,
1318 validate_params, 1324 validate_params,
1319 new_game_desc, 1325 new_game_desc,
1320 validate_desc, 1326 validate_desc,
1321 new_game, 1327 new_game,
1322 dup_game, 1328 dup_game,
1323 free_game, 1329 free_game,
1324 TRUE, solve_game, 1330 true, solve_game,
1325 TRUE, game_can_format_as_text_now, game_text_format, 1331 true, game_can_format_as_text_now, game_text_format,
1326 new_ui, 1332 new_ui,
1327 free_ui, 1333 free_ui,
1328 encode_ui, 1334 encode_ui,
@@ -1339,8 +1345,8 @@ const struct game thegame = {
1339 game_anim_length, 1345 game_anim_length,
1340 game_flash_length, 1346 game_flash_length,
1341 game_status, 1347 game_status,
1342 FALSE, FALSE, game_print_size, game_print, 1348 false, false, game_print_size, game_print,
1343 TRUE, /* wants_statusbar */ 1349 true, /* wants_statusbar */
1344 FALSE, game_timing_state, 1350 false, game_timing_state,
1345 0, /* flags */ 1351 0, /* flags */
1346}; 1352};
diff --git a/apps/plugins/puzzles/src/flood.c b/apps/plugins/puzzles/src/flood.c
index 840ff64a17..67c3225be4 100644
--- a/apps/plugins/puzzles/src/flood.c
+++ b/apps/plugins/puzzles/src/flood.c
@@ -63,9 +63,9 @@ typedef struct soln {
63struct game_state { 63struct game_state {
64 int w, h, colours; 64 int w, h, colours;
65 int moves, movelimit; 65 int moves, movelimit;
66 int complete; 66 bool complete;
67 char *grid; 67 char *grid;
68 int cheated; 68 bool cheated;
69 int solnpos; 69 int solnpos;
70 soln *soln; 70 soln *soln;
71}; 71};
@@ -101,18 +101,18 @@ static const struct {
101 {{12, 12, 4, 0}, "12x12, 4 colours"}, 101 {{12, 12, 4, 0}, "12x12, 4 colours"},
102}; 102};
103 103
104static int game_fetch_preset(int i, char **name, game_params **params) 104static bool game_fetch_preset(int i, char **name, game_params **params)
105{ 105{
106 game_params *ret; 106 game_params *ret;
107 107
108 if (i < 0 || i >= lenof(flood_presets)) 108 if (i < 0 || i >= lenof(flood_presets))
109 return FALSE; 109 return false;
110 110
111 ret = snew(game_params); 111 ret = snew(game_params);
112 *ret = flood_presets[i].preset; 112 *ret = flood_presets[i].preset;
113 *name = dupstr(flood_presets[i].name); 113 *name = dupstr(flood_presets[i].name);
114 *params = ret; 114 *params = ret;
115 return TRUE; 115 return true;
116} 116}
117 117
118static void free_params(game_params *params) 118static void free_params(game_params *params)
@@ -150,7 +150,7 @@ static void decode_params(game_params *ret, char const *string)
150 } 150 }
151} 151}
152 152
153static char *encode_params(const game_params *params, int full) 153static char *encode_params(const game_params *params, bool full)
154{ 154{
155 char buf[256]; 155 char buf[256];
156 sprintf(buf, "%dx%d", params->w, params->h); 156 sprintf(buf, "%dx%d", params->w, params->h);
@@ -205,7 +205,7 @@ static game_params *custom_params(const config_item *cfg)
205 return ret; 205 return ret;
206} 206}
207 207
208static const char *validate_params(const game_params *params, int full) 208static const char *validate_params(const game_params *params, bool full)
209{ 209{
210 if (params->w * params->h < 2) 210 if (params->w * params->h < 2)
211 return "Grid must contain at least two squares"; 211 return "Grid must contain at least two squares";
@@ -443,16 +443,16 @@ static void fill(int w, int h, char *grid, int x0, int y0, char newcolour,
443/* 443/*
444 * Detect a completed grid. 444 * Detect a completed grid.
445 */ 445 */
446static int completed(int w, int h, char *grid) 446static bool completed(int w, int h, char *grid)
447{ 447{
448 int wh = w*h; 448 int wh = w*h;
449 int i; 449 int i;
450 450
451 for (i = 1; i < wh; i++) 451 for (i = 1; i < wh; i++)
452 if (grid[i] != grid[0]) 452 if (grid[i] != grid[0])
453 return FALSE; 453 return false;
454 454
455 return TRUE; 455 return true;
456} 456}
457 457
458/* 458/*
@@ -542,7 +542,7 @@ static char choosemove(int w, int h, char *grid, int x0, int y0,
542} 542}
543 543
544static char *new_game_desc(const game_params *params, random_state *rs, 544static char *new_game_desc(const game_params *params, random_state *rs,
545 char **aux, int interactive) 545 char **aux, bool interactive)
546{ 546{
547 int w = params->w, h = params->h, wh = w*h; 547 int w = params->w, h = params->h, wh = w*h;
548 int i, moves; 548 int i, moves;
@@ -644,8 +644,8 @@ static game_state *new_game(midend *me, const game_params *params,
644 desc++; 644 desc++;
645 645
646 state->movelimit = atoi(desc); 646 state->movelimit = atoi(desc);
647 state->complete = FALSE; 647 state->complete = false;
648 state->cheated = FALSE; 648 state->cheated = false;
649 state->solnpos = 0; 649 state->solnpos = 0;
650 state->soln = NULL; 650 state->soln = NULL;
651 651
@@ -731,9 +731,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
731 return ret; 731 return ret;
732} 732}
733 733
734static int game_can_format_as_text_now(const game_params *params) 734static bool game_can_format_as_text_now(const game_params *params)
735{ 735{
736 return TRUE; 736 return true;
737} 737}
738 738
739static char *game_text_format(const game_state *state) 739static char *game_text_format(const game_state *state)
@@ -762,7 +762,7 @@ static char *game_text_format(const game_state *state)
762} 762}
763 763
764struct game_ui { 764struct game_ui {
765 int cursor_visible; 765 bool cursor_visible;
766 int cx, cy; 766 int cx, cy;
767 enum { VICTORY, DEFEAT } flash_type; 767 enum { VICTORY, DEFEAT } flash_type;
768}; 768};
@@ -770,7 +770,7 @@ struct game_ui {
770static game_ui *new_ui(const game_state *state) 770static game_ui *new_ui(const game_state *state)
771{ 771{
772 struct game_ui *ui = snew(struct game_ui); 772 struct game_ui *ui = snew(struct game_ui);
773 ui->cursor_visible = FALSE; 773 ui->cursor_visible = false;
774 ui->cx = FILLX; 774 ui->cx = FILLX;
775 ui->cy = FILLY; 775 ui->cy = FILLY;
776 return ui; 776 return ui;
@@ -796,7 +796,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
796} 796}
797 797
798struct game_drawstate { 798struct game_drawstate {
799 int started; 799 bool started;
800 int tilesize; 800 int tilesize;
801 int *grid; 801 int *grid;
802}; 802};
@@ -822,22 +822,22 @@ static char *interpret_move(const game_state *state, game_ui *ui,
822 if (button == LEFT_BUTTON) { 822 if (button == LEFT_BUTTON) {
823 tx = FROMCOORD(x); 823 tx = FROMCOORD(x);
824 ty = FROMCOORD(y); 824 ty = FROMCOORD(y);
825 ui->cursor_visible = FALSE; 825 ui->cursor_visible = false;
826 } else if (button == CURSOR_LEFT && ui->cx > 0) { 826 } else if (button == CURSOR_LEFT && ui->cx > 0) {
827 ui->cx--; 827 ui->cx--;
828 ui->cursor_visible = TRUE; 828 ui->cursor_visible = true;
829 return UI_UPDATE; 829 return UI_UPDATE;
830 } else if (button == CURSOR_RIGHT && ui->cx+1 < w) { 830 } else if (button == CURSOR_RIGHT && ui->cx+1 < w) {
831 ui->cx++; 831 ui->cx++;
832 ui->cursor_visible = TRUE; 832 ui->cursor_visible = true;
833 return UI_UPDATE; 833 return UI_UPDATE;
834 } else if (button == CURSOR_UP && ui->cy > 0) { 834 } else if (button == CURSOR_UP && ui->cy > 0) {
835 ui->cy--; 835 ui->cy--;
836 ui->cursor_visible = TRUE; 836 ui->cursor_visible = true;
837 return UI_UPDATE; 837 return UI_UPDATE;
838 } else if (button == CURSOR_DOWN && ui->cy+1 < h) { 838 } else if (button == CURSOR_DOWN && ui->cy+1 < h) {
839 ui->cy++; 839 ui->cy++;
840 ui->cursor_visible = TRUE; 840 ui->cursor_visible = true;
841 return UI_UPDATE; 841 return UI_UPDATE;
842 } else if (button == CURSOR_SELECT) { 842 } else if (button == CURSOR_SELECT) {
843 tx = ui->cx; 843 tx = ui->cx;
@@ -930,7 +930,7 @@ static game_state *execute_move(const game_state *state, const char *move)
930 } 930 }
931 931
932 ret = dup_game(state); 932 ret = dup_game(state);
933 ret->cheated = TRUE; 933 ret->cheated = true;
934 if (ret->soln && --ret->soln->refcount == 0) { 934 if (ret->soln && --ret->soln->refcount == 0) {
935 sfree(ret->soln->moves); 935 sfree(ret->soln->moves);
936 sfree(ret->soln); 936 sfree(ret->soln);
@@ -1035,7 +1035,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1035 int w = state->w, h = state->h, wh = w*h; 1035 int w = state->w, h = state->h, wh = w*h;
1036 int i; 1036 int i;
1037 1037
1038 ds->started = FALSE; 1038 ds->started = false;
1039 ds->tilesize = 0; 1039 ds->tilesize = 0;
1040 ds->grid = snewn(wh, int); 1040 ds->grid = snewn(wh, int);
1041 for (i = 0; i < wh; i++) 1041 for (i = 0; i < wh; i++)
@@ -1160,7 +1160,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1160 TILESIZE * w + 2 * SEP_WIDTH, TILESIZE * h + 2 * SEP_WIDTH, 1160 TILESIZE * w + 2 * SEP_WIDTH, TILESIZE * h + 2 * SEP_WIDTH,
1161 COL_SEPARATOR); 1161 COL_SEPARATOR);
1162 1162
1163 ds->started = 1; 1163 ds->started = true;
1164 } 1164 }
1165 1165
1166 if (flashtime > 0) { 1166 if (flashtime > 0) {
@@ -1312,9 +1312,9 @@ static float game_flash_length(const game_state *oldstate,
1312 return 0.0F; 1312 return 0.0F;
1313} 1313}
1314 1314
1315static int game_timing_state(const game_state *state, game_ui *ui) 1315static bool game_timing_state(const game_state *state, game_ui *ui)
1316{ 1316{
1317 return TRUE; 1317 return true;
1318} 1318}
1319 1319
1320static void game_print_size(const game_params *params, float *x, float *y) 1320static void game_print_size(const game_params *params, float *x, float *y)
@@ -1337,15 +1337,15 @@ const struct game thegame = {
1337 encode_params, 1337 encode_params,
1338 free_params, 1338 free_params,
1339 dup_params, 1339 dup_params,
1340 TRUE, game_configure, custom_params, 1340 true, game_configure, custom_params,
1341 validate_params, 1341 validate_params,
1342 new_game_desc, 1342 new_game_desc,
1343 validate_desc, 1343 validate_desc,
1344 new_game, 1344 new_game,
1345 dup_game, 1345 dup_game,
1346 free_game, 1346 free_game,
1347 TRUE, solve_game, 1347 true, solve_game,
1348 TRUE, game_can_format_as_text_now, game_text_format, 1348 true, game_can_format_as_text_now, game_text_format,
1349 new_ui, 1349 new_ui,
1350 free_ui, 1350 free_ui,
1351 encode_ui, 1351 encode_ui,
@@ -1362,8 +1362,8 @@ const struct game thegame = {
1362 game_anim_length, 1362 game_anim_length,
1363 game_flash_length, 1363 game_flash_length,
1364 game_status, 1364 game_status,
1365 FALSE, FALSE, game_print_size, game_print, 1365 false, false, game_print_size, game_print,
1366 TRUE, /* wants_statusbar */ 1366 true, /* wants_statusbar */
1367 FALSE, game_timing_state, 1367 false, game_timing_state,
1368 0, /* flags */ 1368 0, /* flags */
1369}; 1369};
diff --git a/apps/plugins/puzzles/src/galaxies.c b/apps/plugins/puzzles/src/galaxies.c
index 11efd34d44..0cc3198ae0 100644
--- a/apps/plugins/puzzles/src/galaxies.c
+++ b/apps/plugins/puzzles/src/galaxies.c
@@ -49,7 +49,7 @@
49#ifdef DEBUGGING 49#ifdef DEBUGGING
50#define solvep debug 50#define solvep debug
51#else 51#else
52int solver_show_working; 52static bool solver_show_working;
53#define solvep(x) do { if (solver_show_working) { printf x; } } while(0) 53#define solvep(x) do { if (solver_show_working) { printf x; } } while(0)
54#endif 54#endif
55 55
@@ -139,7 +139,7 @@ struct game_state {
139 int w, h; /* size from params */ 139 int w, h; /* size from params */
140 int sx, sy; /* allocated size, (2x-1)*(2y-1) */ 140 int sx, sy; /* allocated size, (2x-1)*(2y-1) */
141 space *grid; 141 space *grid;
142 int completed, used_solve; 142 bool completed, used_solve;
143 int ndots; 143 int ndots;
144 space **dots; 144 space **dots;
145 145
@@ -148,7 +148,7 @@ struct game_state {
148 or -1 if stale. */ 148 or -1 if stale. */
149}; 149};
150 150
151static int check_complete(const game_state *state, int *dsf, int *colours); 151static bool check_complete(const game_state *state, int *dsf, int *colours);
152static int solver_state(game_state *state, int maxdiff); 152static int solver_state(game_state *state, int maxdiff);
153static int solver_obvious(game_state *state); 153static int solver_obvious(game_state *state);
154static int solver_obvious_dot(game_state *state, space *dot); 154static int solver_obvious_dot(game_state *state, space *dot);
@@ -171,13 +171,13 @@ static const game_params galaxies_presets[] = {
171 { 15, 15, DIFF_NORMAL }, 171 { 15, 15, DIFF_NORMAL },
172}; 172};
173 173
174static int game_fetch_preset(int i, char **name, game_params **params) 174static bool game_fetch_preset(int i, char **name, game_params **params)
175{ 175{
176 game_params *ret; 176 game_params *ret;
177 char buf[80]; 177 char buf[80];
178 178
179 if (i < 0 || i >= lenof(galaxies_presets)) 179 if (i < 0 || i >= lenof(galaxies_presets))
180 return FALSE; 180 return false;
181 181
182 ret = snew(game_params); 182 ret = snew(game_params);
183 *ret = galaxies_presets[i]; /* structure copy */ 183 *ret = galaxies_presets[i]; /* structure copy */
@@ -187,7 +187,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
187 187
188 if (name) *name = dupstr(buf); 188 if (name) *name = dupstr(buf);
189 *params = ret; 189 *params = ret;
190 return TRUE; 190 return true;
191} 191}
192 192
193static game_params *default_params(void) 193static game_params *default_params(void)
@@ -229,7 +229,7 @@ static void decode_params(game_params *params, char const *string)
229 } 229 }
230} 230}
231 231
232static char *encode_params(const game_params *params, int full) 232static char *encode_params(const game_params *params, bool full)
233{ 233{
234 char str[80]; 234 char str[80];
235 sprintf(str, "%dx%d", params->w, params->h); 235 sprintf(str, "%dx%d", params->w, params->h);
@@ -277,7 +277,7 @@ static game_params *custom_params(const config_item *cfg)
277 return ret; 277 return ret;
278} 278}
279 279
280static const char *validate_params(const game_params *params, int full) 280static const char *validate_params(const game_params *params, bool full)
281{ 281{
282 if (params->w < 3 || params->h < 3) 282 if (params->w < 3 || params->h < 3)
283 return "Width and height must both be at least 3"; 283 return "Width and height must both be at least 3";
@@ -384,9 +384,9 @@ static space *sp2dot(const game_state *state, int x, int y)
384 384
385#define IS_VERTICAL_EDGE(x) ((x % 2) == 0) 385#define IS_VERTICAL_EDGE(x) ((x % 2) == 0)
386 386
387static int game_can_format_as_text_now(const game_params *params) 387static bool game_can_format_as_text_now(const game_params *params)
388{ 388{
389 return TRUE; 389 return true;
390} 390}
391 391
392static char *game_text_format(const game_state *state) 392static char *game_text_format(const game_state *state)
@@ -464,7 +464,8 @@ typedef int (*space_cb)(game_state *state, space *sp, void *ctx);
464static int foreach_sub(game_state *state, space_cb cb, unsigned int f, 464static int foreach_sub(game_state *state, space_cb cb, unsigned int f,
465 void *ctx, int startx, int starty) 465 void *ctx, int startx, int starty)
466{ 466{
467 int x, y, progress = 0, impossible = 0, ret; 467 int x, y, ret;
468 bool progress = false, impossible = false;
468 space *sp; 469 space *sp;
469 470
470 for (y = starty; y < state->sy; y += 2) { 471 for (y = starty; y < state->sy; y += 2) {
@@ -473,14 +474,14 @@ static int foreach_sub(game_state *state, space_cb cb, unsigned int f,
473 ret = cb(state, sp, ctx); 474 ret = cb(state, sp, ctx);
474 if (ret == -1) { 475 if (ret == -1) {
475 if (f & IMPOSSIBLE_QUITS) return -1; 476 if (f & IMPOSSIBLE_QUITS) return -1;
476 impossible = -1; 477 impossible = true;
477 } else if (ret == 1) { 478 } else if (ret == 1) {
478 progress = 1; 479 progress = true;
479 } 480 }
480 sp += 2; 481 sp += 2;
481 } 482 }
482 } 483 }
483 return impossible ? -1 : progress; 484 return impossible ? -1 : progress ? 1 : 0;
484} 485}
485 486
486static int foreach_tile(game_state *state, space_cb cb, unsigned int f, 487static int foreach_tile(game_state *state, space_cb cb, unsigned int f,
@@ -577,15 +578,15 @@ static space *tile_opposite(const game_state *state, const space *sp)
577 return space_opposite_dot(state, sp, dot); 578 return space_opposite_dot(state, sp, dot);
578} 579}
579 580
580static int dotfortile(game_state *state, space *tile, space *dot) 581static bool dotfortile(game_state *state, space *tile, space *dot)
581{ 582{
582 space *tile_opp = space_opposite_dot(state, tile, dot); 583 space *tile_opp = space_opposite_dot(state, tile, dot);
583 584
584 if (!tile_opp) return 0; /* opposite would be off grid */ 585 if (!tile_opp) return false; /* opposite would be off grid */
585 if (tile_opp->flags & F_TILE_ASSOC && 586 if (tile_opp->flags & F_TILE_ASSOC &&
586 (tile_opp->dotx != dot->x || tile_opp->doty != dot->y)) 587 (tile_opp->dotx != dot->x || tile_opp->doty != dot->y))
587 return 0; /* opposite already associated with diff. dot */ 588 return false; /* opposite already associated with diff. dot */
588 return 1; 589 return true;
589} 590}
590 591
591static void adjacencies(game_state *state, space *sp, space **a1s, space **a2s) 592static void adjacencies(game_state *state, space *sp, space **a1s, space **a2s)
@@ -614,33 +615,34 @@ static void adjacencies(game_state *state, space *sp, space **a1s, space **a2s)
614 } 615 }
615} 616}
616 617
617static int outline_tile_fordot(game_state *state, space *tile, int mark) 618static bool outline_tile_fordot(game_state *state, space *tile, bool mark)
618{ 619{
619 space *tadj[4], *eadj[4]; 620 space *tadj[4], *eadj[4];
620 int i, didsth = 0, edge, same; 621 int i;
622 bool didsth = false, edge, same;
621 623
622 assert(tile->type == s_tile); 624 assert(tile->type == s_tile);
623 adjacencies(state, tile, eadj, tadj); 625 adjacencies(state, tile, eadj, tadj);
624 for (i = 0; i < 4; i++) { 626 for (i = 0; i < 4; i++) {
625 if (!eadj[i]) continue; 627 if (!eadj[i]) continue;
626 628
627 edge = (eadj[i]->flags & F_EDGE_SET) ? 1 : 0; 629 edge = eadj[i]->flags & F_EDGE_SET;
628 if (tadj[i]) { 630 if (tadj[i]) {
629 if (!(tile->flags & F_TILE_ASSOC)) 631 if (!(tile->flags & F_TILE_ASSOC))
630 same = (tadj[i]->flags & F_TILE_ASSOC) ? 0 : 1; 632 same = !(tadj[i]->flags & F_TILE_ASSOC);
631 else 633 else
632 same = ((tadj[i]->flags & F_TILE_ASSOC) && 634 same = ((tadj[i]->flags & F_TILE_ASSOC) &&
633 tile->dotx == tadj[i]->dotx && 635 tile->dotx == tadj[i]->dotx &&
634 tile->doty == tadj[i]->doty) ? 1 : 0; 636 tile->doty == tadj[i]->doty);
635 } else 637 } else
636 same = 0; 638 same = false;
637 639
638 if (!edge && !same) { 640 if (!edge && !same) {
639 if (mark) eadj[i]->flags |= F_EDGE_SET; 641 if (mark) eadj[i]->flags |= F_EDGE_SET;
640 didsth = 1; 642 didsth = true;
641 } else if (edge && same) { 643 } else if (edge && same) {
642 if (mark) eadj[i]->flags &= ~F_EDGE_SET; 644 if (mark) eadj[i]->flags &= ~F_EDGE_SET;
643 didsth = 1; 645 didsth = true;
644 } 646 }
645 } 647 }
646 return didsth; 648 return didsth;
@@ -664,7 +666,7 @@ static void tiles_from_edge(game_state *state, space *sp, space **ts)
664/* Returns a move string for use by 'solve', including the initial 666/* Returns a move string for use by 'solve', including the initial
665 * 'S' if issolve is true. */ 667 * 'S' if issolve is true. */
666static char *diff_game(const game_state *src, const game_state *dest, 668static char *diff_game(const game_state *src, const game_state *dest,
667 int issolve) 669 bool issolve)
668{ 670{
669 int movelen = 0, movesize = 256, x, y, len; 671 int movelen = 0, movesize = 256, x, y, len;
670 char *move = snewn(movesize, char), buf[80]; 672 char *move = snewn(movesize, char), buf[80];
@@ -725,9 +727,9 @@ static char *diff_game(const game_state *src, const game_state *dest,
725 return move; 727 return move;
726} 728}
727 729
728/* Returns 1 if a dot here would not be too close to any other dots 730/* Returns true if a dot here would not be too close to any other dots
729 * (and would avoid other game furniture). */ 731 * (and would avoid other game furniture). */
730static int dot_is_possible(game_state *state, space *sp, int allow_assoc) 732static bool dot_is_possible(game_state *state, space *sp, bool allow_assoc)
731{ 733{
732 int bx = 0, by = 0, dx, dy; 734 int bx = 0, by = 0, dx, dy;
733 space *adj; 735 space *adj;
@@ -766,28 +768,28 @@ static int dot_is_possible(game_state *state, space *sp, int allow_assoc)
766 if (col < 0) 768 if (col < 0)
767 col = c; 769 col = c;
768 if (c != col) 770 if (c != col)
769 return 0; /* colour mismatch */ 771 return false; /* colour mismatch */
770 } 772 }
771 } 773 }
772#endif 774#endif
773 775
774 if (!allow_assoc && (adj->flags & F_TILE_ASSOC)) 776 if (!allow_assoc && (adj->flags & F_TILE_ASSOC))
775 return 0; 777 return false;
776 778
777 if (dx != 0 || dy != 0) { 779 if (dx != 0 || dy != 0) {
778 /* Other than our own square, no dots nearby. */ 780 /* Other than our own square, no dots nearby. */
779 if (adj->flags & (F_DOT)) 781 if (adj->flags & (F_DOT))
780 return 0; 782 return false;
781 } 783 }
782 784
783 /* We don't want edges within our rectangle 785 /* We don't want edges within our rectangle
784 * (but don't care about edges on the edge) */ 786 * (but don't care about edges on the edge) */
785 if (abs(dx) < bx && abs(dy) < by && 787 if (abs(dx) < bx && abs(dy) < by &&
786 adj->flags & F_EDGE_SET) 788 adj->flags & F_EDGE_SET)
787 return 0; 789 return false;
788 } 790 }
789 } 791 }
790 return 1; 792 return true;
791} 793}
792 794
793/* ---------------------------------------------------------- 795/* ----------------------------------------------------------
@@ -805,7 +807,8 @@ static game_state *blank_game(int w, int h)
805 state->sx = (w*2)+1; 807 state->sx = (w*2)+1;
806 state->sy = (h*2)+1; 808 state->sy = (h*2)+1;
807 state->grid = snewn(state->sx * state->sy, space); 809 state->grid = snewn(state->sx * state->sy, space);
808 state->completed = state->used_solve = 0; 810 state->completed = false;
811 state->used_solve = false;
809 812
810 for (x = 0; x < state->sx; x++) { 813 for (x = 0; x < state->sx; x++) {
811 for (y = 0; y < state->sy; y++) { 814 for (y = 0; y < state->sy; y++) {
@@ -851,7 +854,7 @@ static void game_update_dots(game_state *state)
851 } 854 }
852} 855}
853 856
854static void clear_game(game_state *state, int cleardots) 857static void clear_game(game_state *state, bool cleardots)
855{ 858{
856 int x, y; 859 int x, y;
857 860
@@ -1004,8 +1007,8 @@ static int movedot_cb(game_state *state, space *tile, void *vctx)
1004 * extra spaces (by checking for empty spaces on the far side), and then 1007 * extra spaces (by checking for empty spaces on the far side), and then
1005 * see if we can move the dot to shift the CoG to include the new spaces. 1008 * see if we can move the dot to shift the CoG to include the new spaces.
1006 */ 1009 */
1007static int dot_expand_or_move(game_state *state, space *dot, 1010static bool dot_expand_or_move(game_state *state, space *dot,
1008 space **toadd, int nadd) 1011 space **toadd, int nadd)
1009{ 1012{
1010 space *tileopp; 1013 space *tileopp;
1011 int i, ret, nnew, cx, cy; 1014 int i, ret, nnew, cx, cy;
@@ -1027,7 +1030,7 @@ static int dot_expand_or_move(game_state *state, space *dot,
1027 for (i = 0; i < nadd; i++) { 1030 for (i = 0; i < nadd; i++) {
1028 if (!(picture[(toadd[i]->y/2) * state->w + (toadd[i]->x/2)]) ^ 1031 if (!(picture[(toadd[i]->y/2) * state->w + (toadd[i]->x/2)]) ^
1029 !(dot->flags & F_DOT_BLACK)) 1032 !(dot->flags & F_DOT_BLACK))
1030 return 0; 1033 return false;
1031 } 1034 }
1032 } 1035 }
1033#endif 1036#endif
@@ -1061,7 +1064,7 @@ static int dot_expand_or_move(game_state *state, space *dot,
1061 dot->x, dot->y)); 1064 dot->x, dot->y));
1062 dbg_state(state); 1065 dbg_state(state);
1063 } 1066 }
1064 return 1; 1067 return true;
1065 1068
1066noexpand: 1069noexpand:
1067 /* Otherwise, try to move dot so as to encompass given spaces: */ 1070 /* Otherwise, try to move dot so as to encompass given spaces: */
@@ -1077,7 +1080,7 @@ noexpand:
1077 if ((cx % nnew) != 0 || (cy % nnew) != 0) { 1080 if ((cx % nnew) != 0 || (cy % nnew) != 0) {
1078 debug(("Unable to move dot %d,%d, CoG not whole number.\n", 1081 debug(("Unable to move dot %d,%d, CoG not whole number.\n",
1079 dot->x, dot->y)); 1082 dot->x, dot->y));
1080 return 0; 1083 return false;
1081 } 1084 }
1082 cx /= nnew; cy /= nnew; 1085 cx /= nnew; cy /= nnew;
1083 1086
@@ -1090,7 +1093,7 @@ noexpand:
1090 if (ret == -1) { 1093 if (ret == -1) {
1091 debug(("Unable to move dot %d,%d, new dot not symmetrical.\n", 1094 debug(("Unable to move dot %d,%d, new dot not symmetrical.\n",
1092 dot->x, dot->y)); 1095 dot->x, dot->y));
1093 return 0; 1096 return false;
1094 } 1097 }
1095 /* Also check whether all spaces we're adding would have a good 1098 /* Also check whether all spaces we're adding would have a good
1096 * opposite wrt the new dot. */ 1099 * opposite wrt the new dot. */
@@ -1103,13 +1106,13 @@ noexpand:
1103 if (!tileopp) { 1106 if (!tileopp) {
1104 debug(("Unable to move dot %d,%d, new dot not symmetrical.\n", 1107 debug(("Unable to move dot %d,%d, new dot not symmetrical.\n",
1105 dot->x, dot->y)); 1108 dot->x, dot->y));
1106 return 0; 1109 return false;
1107 } 1110 }
1108#ifdef STANDALONE_PICTURE_GENERATOR 1111#ifdef STANDALONE_PICTURE_GENERATOR
1109 if (picture) { 1112 if (picture) {
1110 if (!(picture[(tileopp->y/2) * state->w + (tileopp->x/2)]) ^ 1113 if (!(picture[(tileopp->y/2) * state->w + (tileopp->x/2)]) ^
1111 !(dot->flags & F_DOT_BLACK)) 1114 !(dot->flags & F_DOT_BLACK))
1112 return 0; 1115 return false;
1113 } 1116 }
1114#endif 1117#endif
1115 } 1118 }
@@ -1142,7 +1145,7 @@ noexpand:
1142 assert(ret == 1); 1145 assert(ret == 1);
1143 dbg_state(state); 1146 dbg_state(state);
1144 1147
1145 return 1; 1148 return true;
1146} 1149}
1147 1150
1148/* Hard-code to a max. of 2x2 squares, for speed (less malloc) */ 1151/* Hard-code to a max. of 2x2 squares, for speed (less malloc) */
@@ -1151,13 +1154,13 @@ noexpand:
1151 1154
1152#define MAX_TILE_PERC 20 1155#define MAX_TILE_PERC 20
1153 1156
1154static int generate_try_block(game_state *state, random_state *rs, 1157static bool generate_try_block(game_state *state, random_state *rs,
1155 int x1, int y1, int x2, int y2) 1158 int x1, int y1, int x2, int y2)
1156{ 1159{
1157 int x, y, nadd = 0, nout = 0, i, maxsz; 1160 int x, y, nadd = 0, nout = 0, i, maxsz;
1158 space *sp, *toadd[MAX_TOADD], *outside[MAX_OUTSIDE], *dot; 1161 space *sp, *toadd[MAX_TOADD], *outside[MAX_OUTSIDE], *dot;
1159 1162
1160 if (!INGRID(state, x1, y1) || !INGRID(state, x2, y2)) return 0; 1163 if (!INGRID(state, x1, y1) || !INGRID(state, x2, y2)) return false;
1161 1164
1162 /* We limit the maximum size of tiles to be ~2*sqrt(area); so, 1165 /* We limit the maximum size of tiles to be ~2*sqrt(area); so,
1163 * a 5x5 grid shouldn't have anything >10 tiles, a 20x20 grid 1166 * a 5x5 grid shouldn't have anything >10 tiles, a 20x20 grid
@@ -1172,7 +1175,7 @@ static int generate_try_block(game_state *state, random_state *rs,
1172 assert(nadd < MAX_TOADD); 1175 assert(nadd < MAX_TOADD);
1173 sp = &SPACE(state, x, y); 1176 sp = &SPACE(state, x, y);
1174 assert(sp->type == s_tile); 1177 assert(sp->type == s_tile);
1175 if (sp->flags & F_TILE_ASSOC) return 0; 1178 if (sp->flags & F_TILE_ASSOC) return false;
1176 toadd[nadd++] = sp; 1179 toadd[nadd++] = sp;
1177 } 1180 }
1178 } 1181 }
@@ -1202,9 +1205,9 @@ static int generate_try_block(game_state *state, random_state *rs,
1202 dot->x, dot->y, dot->nassoc)); 1205 dot->x, dot->y, dot->nassoc));
1203 continue; 1206 continue;
1204 } 1207 }
1205 if (dot_expand_or_move(state, dot, toadd, nadd)) return 1; 1208 if (dot_expand_or_move(state, dot, toadd, nadd)) return true;
1206 } 1209 }
1207 return 0; 1210 return false;
1208} 1211}
1209 1212
1210#ifdef STANDALONE_SOLVER 1213#ifdef STANDALONE_SOLVER
@@ -1258,7 +1261,7 @@ static void generate_pass(game_state *state, random_state *rs, int *scratch,
1258 1261
1259 /* If we've got here we might want to put a dot down. Check 1262 /* If we've got here we might want to put a dot down. Check
1260 * if we can, and add one if so. */ 1263 * if we can, and add one if so. */
1261 if (dot_is_possible(state, sp, 0)) { 1264 if (dot_is_possible(state, sp, false)) {
1262 add_dot(sp); 1265 add_dot(sp);
1263#ifdef STANDALONE_PICTURE_GENERATOR 1266#ifdef STANDALONE_PICTURE_GENERATOR
1264 if (picture) { 1267 if (picture) {
@@ -1277,19 +1280,20 @@ static void generate_pass(game_state *state, random_state *rs, int *scratch,
1277} 1280}
1278 1281
1279static char *new_game_desc(const game_params *params, random_state *rs, 1282static char *new_game_desc(const game_params *params, random_state *rs,
1280 char **aux, int interactive) 1283 char **aux, bool interactive)
1281{ 1284{
1282 game_state *state = blank_game(params->w, params->h), *copy; 1285 game_state *state = blank_game(params->w, params->h), *copy;
1283 char *desc; 1286 char *desc;
1284 int *scratch, sz = state->sx*state->sy, i; 1287 int *scratch, sz = state->sx*state->sy, i;
1285 int diff, ntries = 0, cc; 1288 int diff, ntries = 0;
1289 bool cc;
1286 1290
1287 /* Random list of squares to try and process, one-by-one. */ 1291 /* Random list of squares to try and process, one-by-one. */
1288 scratch = snewn(sz, int); 1292 scratch = snewn(sz, int);
1289 for (i = 0; i < sz; i++) scratch[i] = i; 1293 for (i = 0; i < sz; i++) scratch[i] = i;
1290 1294
1291generate: 1295generate:
1292 clear_game(state, 1); 1296 clear_game(state, true);
1293 ntries++; 1297 ntries++;
1294 1298
1295 /* generate_pass(state, rs, scratch, 10, GP_DOTS); */ 1299 /* generate_pass(state, rs, scratch, 10, GP_DOTS); */
@@ -1310,12 +1314,12 @@ generate:
1310 1314
1311 for (i = 0; i < state->sx*state->sy; i++) 1315 for (i = 0; i < state->sx*state->sy; i++)
1312 if (state->grid[i].type == s_tile) 1316 if (state->grid[i].type == s_tile)
1313 outline_tile_fordot(state, &state->grid[i], TRUE); 1317 outline_tile_fordot(state, &state->grid[i], true);
1314 cc = check_complete(state, NULL, NULL); 1318 cc = check_complete(state, NULL, NULL);
1315 assert(cc); 1319 assert(cc);
1316 1320
1317 copy = dup_game(state); 1321 copy = dup_game(state);
1318 clear_game(copy, 0); 1322 clear_game(copy, false);
1319 dbg_state(copy); 1323 dbg_state(copy);
1320 diff = solver_state(copy, params->diff); 1324 diff = solver_state(copy, params->diff);
1321 free_game(copy); 1325 free_game(copy);
@@ -1363,7 +1367,7 @@ generate:
1363 for (i = 0; i < nposns; i++) { 1367 for (i = 0; i < nposns; i++) {
1364 int x, y, x0, y0, x1, y1, cx, cy, cn, cx0, cy0, cx1, cy1, tx, ty; 1368 int x, y, x0, y0, x1, y1, cx, cy, cn, cx0, cy0, cx1, cy1, tx, ty;
1365 space *s0, *s1, *ts, *d0, *d1, *dn; 1369 space *s0, *s1, *ts, *d0, *d1, *dn;
1366 int ok; 1370 bool ok;
1367 1371
1368 /* Coordinates of edge space */ 1372 /* Coordinates of edge space */
1369 x = posns[i] % state->sx; 1373 x = posns[i] % state->sx;
@@ -1412,14 +1416,14 @@ generate:
1412 cy0 = ((cy+1) & ~1) - 1; 1416 cy0 = ((cy+1) & ~1) - 1;
1413 cx1 = 2*cx-cx0; /* and reflect about cx to get cx1 */ 1417 cx1 = 2*cx-cx0; /* and reflect about cx to get cx1 */
1414 cy1 = 2*cy-cy0; 1418 cy1 = 2*cy-cy0;
1415 ok = TRUE; 1419 ok = true;
1416 for (ty = cy0; ty <= cy1; ty += 2) 1420 for (ty = cy0; ty <= cy1; ty += 2)
1417 for (tx = cx0; tx <= cx1; tx += 2) { 1421 for (tx = cx0; tx <= cx1; tx += 2) {
1418 ts = &SPACE(state, tx, ty); 1422 ts = &SPACE(state, tx, ty);
1419 assert(ts->type == s_tile); 1423 assert(ts->type == s_tile);
1420 if ((ts->dotx != d0->x || ts->doty != d0->y) && 1424 if ((ts->dotx != d0->x || ts->doty != d0->y) &&
1421 (ts->dotx != d1->x || ts->doty != d1->y)) 1425 (ts->dotx != d1->x || ts->doty != d1->y))
1422 ok = FALSE; 1426 ok = false;
1423 } 1427 }
1424 if (!ok) 1428 if (!ok)
1425 continue; 1429 continue;
@@ -1441,13 +1445,13 @@ generate:
1441 tx1 = 2*cx-tx; 1445 tx1 = 2*cx-tx;
1442 ty1 = 2*cy-ty; 1446 ty1 = 2*cy-ty;
1443 if (!INGRID(state, tx1, ty1)) { 1447 if (!INGRID(state, tx1, ty1)) {
1444 ok = FALSE; 1448 ok = false;
1445 break; 1449 break;
1446 } 1450 }
1447 ts = &SPACE(state, cx+cx-tx, cy+cy-ty); 1451 ts = &SPACE(state, cx+cx-tx, cy+cy-ty);
1448 if ((ts->dotx != d0->x || ts->doty != d0->y) && 1452 if ((ts->dotx != d0->x || ts->doty != d0->y) &&
1449 (ts->dotx != d1->x || ts->doty != d1->y)) { 1453 (ts->dotx != d1->x || ts->doty != d1->y)) {
1450 ok = FALSE; 1454 ok = false;
1451 break; 1455 break;
1452 } 1456 }
1453 } 1457 }
@@ -1482,7 +1486,7 @@ generate:
1482 } 1486 }
1483 1487
1484 copy = dup_game(state); 1488 copy = dup_game(state);
1485 clear_game(copy, 0); 1489 clear_game(copy, false);
1486 dbg_state(copy); 1490 dbg_state(copy);
1487 newdiff = solver_state(copy, params->diff); 1491 newdiff = solver_state(copy, params->diff);
1488 free_game(copy); 1492 free_game(copy);
@@ -1511,7 +1515,7 @@ generate:
1511 return desc; 1515 return desc;
1512} 1516}
1513 1517
1514static int dots_too_close(game_state *state) 1518static bool dots_too_close(game_state *state)
1515{ 1519{
1516 /* Quick-and-dirty check, using half the solver: 1520 /* Quick-and-dirty check, using half the solver:
1517 * solver_obvious will only fail if the dots are 1521 * solver_obvious will only fail if the dots are
@@ -1520,7 +1524,7 @@ static int dots_too_close(game_state *state)
1520 game_state *tmp = dup_game(state); 1524 game_state *tmp = dup_game(state);
1521 int ret = solver_obvious(tmp); 1525 int ret = solver_obvious(tmp);
1522 free_game(tmp); 1526 free_game(tmp);
1523 return (ret == -1) ? 1 : 0; 1527 return ret == -1;
1524} 1528}
1525 1529
1526static game_state *load_game(const game_params *params, const char *desc, 1530static game_state *load_game(const game_params *params, const char *desc,
@@ -1601,7 +1605,7 @@ static game_state *new_game(midend *me, const game_params *params,
1601 * Solver and all its little wizards. 1605 * Solver and all its little wizards.
1602 */ 1606 */
1603 1607
1604int solver_recurse_depth; 1608static int solver_recurse_depth;
1605 1609
1606typedef struct solver_ctx { 1610typedef struct solver_ctx {
1607 game_state *state; 1611 game_state *state;
@@ -1919,13 +1923,13 @@ static int solver_spaces_oneposs_cb(game_state *state, space *tile, void *ctx)
1919 * 1923 *
1920 */ 1924 */
1921 1925
1922/* Returns 1 if this tile is either already associated with this dot, 1926/* Returns true if this tile is either already associated with this dot,
1923 * or blank. */ 1927 * or blank. */
1924static int solver_expand_checkdot(space *tile, space *dot) 1928static bool solver_expand_checkdot(space *tile, space *dot)
1925{ 1929{
1926 if (!(tile->flags & F_TILE_ASSOC)) return 1; 1930 if (!(tile->flags & F_TILE_ASSOC)) return true;
1927 if (tile->dotx == dot->x && tile->doty == dot->y) return 1; 1931 if (tile->dotx == dot->x && tile->doty == dot->y) return true;
1928 return 0; 1932 return false;
1929} 1933}
1930 1934
1931static void solver_expand_fromdot(game_state *state, space *dot, solver_ctx *sctx) 1935static void solver_expand_fromdot(game_state *state, space *dot, solver_ctx *sctx)
@@ -2287,7 +2291,7 @@ solved:
2287 */ 2291 */
2288 for (i = 0; i < tosolve->sx*tosolve->sy; i++) 2292 for (i = 0; i < tosolve->sx*tosolve->sy; i++)
2289 tosolve->grid[i].flags &= ~F_TILE_ASSOC; 2293 tosolve->grid[i].flags &= ~F_TILE_ASSOC;
2290 ret = diff_game(currstate, tosolve, 1); 2294 ret = diff_game(currstate, tosolve, true);
2291 free_game(tosolve); 2295 free_game(tosolve);
2292 return ret; 2296 return ret;
2293} 2297}
@@ -2298,19 +2302,20 @@ solved:
2298 */ 2302 */
2299 2303
2300struct game_ui { 2304struct game_ui {
2301 int dragging; 2305 bool dragging;
2302 int dx, dy; /* pixel coords of drag pos. */ 2306 int dx, dy; /* pixel coords of drag pos. */
2303 int dotx, doty; /* grid coords of dot we're dragging from. */ 2307 int dotx, doty; /* grid coords of dot we're dragging from. */
2304 int srcx, srcy; /* grid coords of drag start */ 2308 int srcx, srcy; /* grid coords of drag start */
2305 int cur_x, cur_y, cur_visible; 2309 int cur_x, cur_y;
2310 bool cur_visible;
2306}; 2311};
2307 2312
2308static game_ui *new_ui(const game_state *state) 2313static game_ui *new_ui(const game_state *state)
2309{ 2314{
2310 game_ui *ui = snew(game_ui); 2315 game_ui *ui = snew(game_ui);
2311 ui->dragging = FALSE; 2316 ui->dragging = false;
2312 ui->cur_x = ui->cur_y = 1; 2317 ui->cur_x = ui->cur_y = 1;
2313 ui->cur_visible = 0; 2318 ui->cur_visible = false;
2314 return ui; 2319 return ui;
2315} 2320}
2316 2321
@@ -2351,7 +2356,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
2351#define CURSOR_SIZE DOT_SIZE 2356#define CURSOR_SIZE DOT_SIZE
2352 2357
2353struct game_drawstate { 2358struct game_drawstate {
2354 int started; 2359 bool started;
2355 int w, h; 2360 int w, h;
2356 int tilesize; 2361 int tilesize;
2357 unsigned long *grid; 2362 unsigned long *grid;
@@ -2359,11 +2364,13 @@ struct game_drawstate {
2359 blitter *bl; 2364 blitter *bl;
2360 blitter *blmirror; 2365 blitter *blmirror;
2361 2366
2362 int dragging, dragx, dragy; 2367 bool dragging;
2368 int dragx, dragy;
2363 2369
2364 int *colour_scratch; 2370 int *colour_scratch;
2365 2371
2366 int cx, cy, cur_visible; 2372 int cx, cy;
2373 bool cur_visible;
2367 blitter *cur_bl; 2374 blitter *cur_bl;
2368}; 2375};
2369 2376
@@ -2474,13 +2481,13 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2474 char *ret; 2481 char *ret;
2475 game_state *tmp = dup_game(state); 2482 game_state *tmp = dup_game(state);
2476 solver_obvious(tmp); 2483 solver_obvious(tmp);
2477 ret = diff_game(state, tmp, 0); 2484 ret = diff_game(state, tmp, false);
2478 free_game(tmp); 2485 free_game(tmp);
2479 return ret; 2486 return ret;
2480 } 2487 }
2481 2488
2482 if (button == LEFT_BUTTON) { 2489 if (button == LEFT_BUTTON) {
2483 ui->cur_visible = 0; 2490 ui->cur_visible = false;
2484 coord_round_to_edge(FROMCOORD((float)x), FROMCOORD((float)y), 2491 coord_round_to_edge(FROMCOORD((float)x), FROMCOORD((float)y),
2485 &px, &py); 2492 &px, &py);
2486 2493
@@ -2495,7 +2502,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2495 } else if (button == RIGHT_BUTTON) { 2502 } else if (button == RIGHT_BUTTON) {
2496 int px1, py1; 2503 int px1, py1;
2497 2504
2498 ui->cur_visible = 0; 2505 ui->cur_visible = false;
2499 2506
2500 px = (int)(2*FROMCOORD((float)x) + 0.5); 2507 px = (int)(2*FROMCOORD((float)x) + 0.5);
2501 py = (int)(2*FROMCOORD((float)y) + 0.5); 2508 py = (int)(2*FROMCOORD((float)y) + 0.5);
@@ -2545,7 +2552,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2545 * Now, if we've managed to find a dot, begin a drag. 2552 * Now, if we've managed to find a dot, begin a drag.
2546 */ 2553 */
2547 if (dot) { 2554 if (dot) {
2548 ui->dragging = TRUE; 2555 ui->dragging = true;
2549 ui->dx = x; 2556 ui->dx = x;
2550 ui->dy = y; 2557 ui->dy = y;
2551 ui->dotx = dot->x; 2558 ui->dotx = dot->x;
@@ -2558,7 +2565,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2558 ui->dy = y; 2565 ui->dy = y;
2559 return UI_UPDATE; 2566 return UI_UPDATE;
2560 } else if (button == RIGHT_RELEASE && ui->dragging) { 2567 } else if (button == RIGHT_RELEASE && ui->dragging) {
2561 ui->dragging = FALSE; 2568 ui->dragging = false;
2562 2569
2563 /* 2570 /*
2564 * Drags are always targeted at a single square. 2571 * Drags are always targeted at a single square.
@@ -2600,10 +2607,10 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2600 else 2607 else
2601 return UI_UPDATE; 2608 return UI_UPDATE;
2602 } else if (IS_CURSOR_MOVE(button)) { 2609 } else if (IS_CURSOR_MOVE(button)) {
2603 move_cursor(button, &ui->cur_x, &ui->cur_y, state->sx-1, state->sy-1, 0); 2610 move_cursor(button, &ui->cur_x, &ui->cur_y, state->sx-1, state->sy-1, false);
2604 if (ui->cur_x < 1) ui->cur_x = 1; 2611 if (ui->cur_x < 1) ui->cur_x = 1;
2605 if (ui->cur_y < 1) ui->cur_y = 1; 2612 if (ui->cur_y < 1) ui->cur_y = 1;
2606 ui->cur_visible = 1; 2613 ui->cur_visible = true;
2607 if (ui->dragging) { 2614 if (ui->dragging) {
2608 ui->dx = SCOORD(ui->cur_x); 2615 ui->dx = SCOORD(ui->cur_x);
2609 ui->dy = SCOORD(ui->cur_y); 2616 ui->dy = SCOORD(ui->cur_y);
@@ -2611,12 +2618,12 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2611 return UI_UPDATE; 2618 return UI_UPDATE;
2612 } else if (IS_CURSOR_SELECT(button)) { 2619 } else if (IS_CURSOR_SELECT(button)) {
2613 if (!ui->cur_visible) { 2620 if (!ui->cur_visible) {
2614 ui->cur_visible = 1; 2621 ui->cur_visible = true;
2615 return UI_UPDATE; 2622 return UI_UPDATE;
2616 } 2623 }
2617 sp = &SPACE(state, ui->cur_x, ui->cur_y); 2624 sp = &SPACE(state, ui->cur_x, ui->cur_y);
2618 if (ui->dragging) { 2625 if (ui->dragging) {
2619 ui->dragging = FALSE; 2626 ui->dragging = false;
2620 2627
2621 if ((ui->srcx != ui->dotx || ui->srcy != ui->doty) && 2628 if ((ui->srcx != ui->dotx || ui->srcy != ui->doty) &&
2622 SPACE(state, ui->srcx, ui->srcy).flags & F_TILE_ASSOC) { 2629 SPACE(state, ui->srcx, ui->srcy).flags & F_TILE_ASSOC) {
@@ -2629,7 +2636,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2629 } 2636 }
2630 return dupstr(buf); 2637 return dupstr(buf);
2631 } else if (sp->flags & F_DOT) { 2638 } else if (sp->flags & F_DOT) {
2632 ui->dragging = TRUE; 2639 ui->dragging = true;
2633 ui->dx = SCOORD(ui->cur_x); 2640 ui->dx = SCOORD(ui->cur_x);
2634 ui->dy = SCOORD(ui->cur_y); 2641 ui->dy = SCOORD(ui->cur_y);
2635 ui->dotx = ui->srcx = ui->cur_x; 2642 ui->dotx = ui->srcx = ui->cur_x;
@@ -2637,7 +2644,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2637 return UI_UPDATE; 2644 return UI_UPDATE;
2638 } else if (sp->flags & F_TILE_ASSOC) { 2645 } else if (sp->flags & F_TILE_ASSOC) {
2639 assert(sp->type == s_tile); 2646 assert(sp->type == s_tile);
2640 ui->dragging = TRUE; 2647 ui->dragging = true;
2641 ui->dx = SCOORD(ui->cur_x); 2648 ui->dx = SCOORD(ui->cur_x);
2642 ui->dy = SCOORD(ui->cur_y); 2649 ui->dy = SCOORD(ui->cur_y);
2643 ui->dotx = sp->dotx; 2650 ui->dotx = sp->dotx;
@@ -2655,24 +2662,26 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2655} 2662}
2656#endif 2663#endif
2657 2664
2658static int check_complete(const game_state *state, int *dsf, int *colours) 2665static bool check_complete(const game_state *state, int *dsf, int *colours)
2659{ 2666{
2660 int w = state->w, h = state->h; 2667 int w = state->w, h = state->h;
2661 int x, y, i, ret; 2668 int x, y, i;
2669 bool ret;
2662 2670
2663 int free_dsf; 2671 bool free_dsf;
2664 struct sqdata { 2672 struct sqdata {
2665 int minx, miny, maxx, maxy; 2673 int minx, miny, maxx, maxy;
2666 int cx, cy; 2674 int cx, cy;
2667 int valid, colour; 2675 bool valid;
2676 int colour;
2668 } *sqdata; 2677 } *sqdata;
2669 2678
2670 if (!dsf) { 2679 if (!dsf) {
2671 dsf = snew_dsf(w*h); 2680 dsf = snew_dsf(w*h);
2672 free_dsf = TRUE; 2681 free_dsf = true;
2673 } else { 2682 } else {
2674 dsf_init(dsf, w*h); 2683 dsf_init(dsf, w*h);
2675 free_dsf = FALSE; 2684 free_dsf = false;
2676 } 2685 }
2677 2686
2678 /* 2687 /*
@@ -2711,7 +2720,7 @@ static int check_complete(const game_state *state, int *dsf, int *colours)
2711 sqdata[i].minx = w+1; 2720 sqdata[i].minx = w+1;
2712 sqdata[i].miny = h+1; 2721 sqdata[i].miny = h+1;
2713 sqdata[i].maxx = sqdata[i].maxy = -1; 2722 sqdata[i].maxx = sqdata[i].maxy = -1;
2714 sqdata[i].valid = FALSE; 2723 sqdata[i].valid = false;
2715 } 2724 }
2716 for (y = 0; y < h; y++) 2725 for (y = 0; y < h; y++)
2717 for (x = 0; x < w; x++) { 2726 for (x = 0; x < w; x++) {
@@ -2724,7 +2733,7 @@ static int check_complete(const game_state *state, int *dsf, int *colours)
2724 sqdata[i].miny = y; 2733 sqdata[i].miny = y;
2725 if (sqdata[i].maxy < y) 2734 if (sqdata[i].maxy < y)
2726 sqdata[i].maxy = y; 2735 sqdata[i].maxy = y;
2727 sqdata[i].valid = TRUE; 2736 sqdata[i].valid = true;
2728 } 2737 }
2729 2738
2730 /* 2739 /*
@@ -2738,12 +2747,12 @@ static int check_complete(const game_state *state, int *dsf, int *colours)
2738 cx = sqdata[i].cx = sqdata[i].minx + sqdata[i].maxx + 1; 2747 cx = sqdata[i].cx = sqdata[i].minx + sqdata[i].maxx + 1;
2739 cy = sqdata[i].cy = sqdata[i].miny + sqdata[i].maxy + 1; 2748 cy = sqdata[i].cy = sqdata[i].miny + sqdata[i].maxy + 1;
2740 if (!(SPACE(state, sqdata[i].cx, sqdata[i].cy).flags & F_DOT)) 2749 if (!(SPACE(state, sqdata[i].cx, sqdata[i].cy).flags & F_DOT))
2741 sqdata[i].valid = FALSE; /* no dot at centre of symmetry */ 2750 sqdata[i].valid = false; /* no dot at centre of symmetry */
2742 if (dsf_canonify(dsf, (cy-1)/2*w+(cx-1)/2) != i || 2751 if (dsf_canonify(dsf, (cy-1)/2*w+(cx-1)/2) != i ||
2743 dsf_canonify(dsf, (cy)/2*w+(cx-1)/2) != i || 2752 dsf_canonify(dsf, (cy)/2*w+(cx-1)/2) != i ||
2744 dsf_canonify(dsf, (cy-1)/2*w+(cx)/2) != i || 2753 dsf_canonify(dsf, (cy-1)/2*w+(cx)/2) != i ||
2745 dsf_canonify(dsf, (cy)/2*w+(cx)/2) != i) 2754 dsf_canonify(dsf, (cy)/2*w+(cx)/2) != i)
2746 sqdata[i].valid = FALSE; /* dot at cx,cy isn't ours */ 2755 sqdata[i].valid = false; /* dot at cx,cy isn't ours */
2747 if (SPACE(state, sqdata[i].cx, sqdata[i].cy).flags & F_DOT_BLACK) 2756 if (SPACE(state, sqdata[i].cx, sqdata[i].cy).flags & F_DOT_BLACK)
2748 sqdata[i].colour = 2; 2757 sqdata[i].colour = 2;
2749 else 2758 else
@@ -2773,7 +2782,7 @@ static int check_complete(const game_state *state, int *dsf, int *colours)
2773 for (cx = (x-1) >> 1; cx <= x >> 1; cx++) { 2782 for (cx = (x-1) >> 1; cx <= x >> 1; cx++) {
2774 i = dsf_canonify(dsf, cy*w+cx); 2783 i = dsf_canonify(dsf, cy*w+cx);
2775 if (x != sqdata[i].cx || y != sqdata[i].cy) 2784 if (x != sqdata[i].cx || y != sqdata[i].cy)
2776 sqdata[i].valid = FALSE; 2785 sqdata[i].valid = false;
2777 } 2786 }
2778 } 2787 }
2779 2788
@@ -2787,7 +2796,7 @@ static int check_complete(const game_state *state, int *dsf, int *colours)
2787 assert((cx1==cx2) ^ (cy1==cy2)); 2796 assert((cx1==cx2) ^ (cy1==cy2));
2788 i = dsf_canonify(dsf, cy1*w+cx1); 2797 i = dsf_canonify(dsf, cy1*w+cx1);
2789 if (i == dsf_canonify(dsf, cy2*w+cx2)) 2798 if (i == dsf_canonify(dsf, cy2*w+cx2))
2790 sqdata[i].valid = FALSE; 2799 sqdata[i].valid = false;
2791 } 2800 }
2792 } 2801 }
2793 2802
@@ -2806,7 +2815,7 @@ static int check_complete(const game_state *state, int *dsf, int *colours)
2806 x2 = sqdata[i].cx - 1 - x; 2815 x2 = sqdata[i].cx - 1 - x;
2807 y2 = sqdata[i].cy - 1 - y; 2816 y2 = sqdata[i].cy - 1 - y;
2808 if (i != dsf_canonify(dsf, y2*w+x2)) 2817 if (i != dsf_canonify(dsf, y2*w+x2))
2809 sqdata[i].valid = FALSE; 2818 sqdata[i].valid = false;
2810 } 2819 }
2811 2820
2812 /* 2821 /*
@@ -2816,10 +2825,10 @@ static int check_complete(const game_state *state, int *dsf, int *colours)
2816 * true/false value depending on whether _every_ square in the 2825 * true/false value depending on whether _every_ square in the
2817 * grid is part of a valid component. 2826 * grid is part of a valid component.
2818 */ 2827 */
2819 ret = TRUE; 2828 ret = true;
2820 for (i = 0; i < w*h; i++) { 2829 for (i = 0; i < w*h; i++) {
2821 int ci = dsf_canonify(dsf, i); 2830 int ci = dsf_canonify(dsf, i);
2822 int thisok = sqdata[ci].valid; 2831 bool thisok = sqdata[ci].valid;
2823 if (colours) 2832 if (colours)
2824 colours[i] = thisok ? sqdata[ci].colour : 0; 2833 colours[i] = thisok ? sqdata[ci].colour : 0;
2825 ret = ret && thisok; 2834 ret = ret && thisok;
@@ -2837,7 +2846,7 @@ static game_state *execute_move(const game_state *state, const char *move)
2837 int x, y, ax, ay, n, dx, dy; 2846 int x, y, ax, ay, n, dx, dy;
2838 game_state *ret = dup_game(state); 2847 game_state *ret = dup_game(state);
2839 space *sp, *dot; 2848 space *sp, *dot;
2840 int currently_solving = FALSE; 2849 bool currently_solving = false;
2841 2850
2842 debug(("%s\n", move)); 2851 debug(("%s\n", move));
2843 2852
@@ -2924,12 +2933,12 @@ static game_state *execute_move(const game_state *state, const char *move)
2924#ifdef EDITOR 2933#ifdef EDITOR
2925 } else if (c == 'C') { 2934 } else if (c == 'C') {
2926 move++; 2935 move++;
2927 clear_game(ret, 1); 2936 clear_game(ret, true);
2928#endif 2937#endif
2929 } else if (c == 'S') { 2938 } else if (c == 'S') {
2930 move++; 2939 move++;
2931 ret->used_solve = 1; 2940 ret->used_solve = true;
2932 currently_solving = TRUE; 2941 currently_solving = true;
2933 } else 2942 } else
2934 goto badmove; 2943 goto badmove;
2935 2944
@@ -2939,7 +2948,7 @@ static game_state *execute_move(const game_state *state, const char *move)
2939 goto badmove; 2948 goto badmove;
2940 } 2949 }
2941 if (check_complete(ret, NULL, NULL)) 2950 if (check_complete(ret, NULL, NULL))
2942 ret->completed = 1; 2951 ret->completed = true;
2943 return ret; 2952 return ret;
2944 2953
2945badmove: 2954badmove:
@@ -3051,7 +3060,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
3051 struct game_drawstate *ds = snew(struct game_drawstate); 3060 struct game_drawstate *ds = snew(struct game_drawstate);
3052 int i; 3061 int i;
3053 3062
3054 ds->started = 0; 3063 ds->started = false;
3055 ds->w = state->w; 3064 ds->w = state->w;
3056 ds->h = state->h; 3065 ds->h = state->h;
3057 3066
@@ -3063,14 +3072,14 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
3063 3072
3064 ds->bl = NULL; 3073 ds->bl = NULL;
3065 ds->blmirror = NULL; 3074 ds->blmirror = NULL;
3066 ds->dragging = FALSE; 3075 ds->dragging = false;
3067 ds->dragx = ds->dragy = 0; 3076 ds->dragx = ds->dragy = 0;
3068 3077
3069 ds->colour_scratch = snewn(ds->w * ds->h, int); 3078 ds->colour_scratch = snewn(ds->w * ds->h, int);
3070 3079
3071 ds->cur_bl = NULL; 3080 ds->cur_bl = NULL;
3072 ds->cx = ds->cy = 0; 3081 ds->cx = ds->cy = 0;
3073 ds->cur_visible = 0; 3082 ds->cur_visible = false;
3074 3083
3075 return ds; 3084 return ds;
3076} 3085}
@@ -3221,7 +3230,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
3221 float animtime, float flashtime) 3230 float animtime, float flashtime)
3222{ 3231{
3223 int w = ds->w, h = ds->h; 3232 int w = ds->w, h = ds->h;
3224 int x, y, flashing = FALSE; 3233 int x, y;
3234 bool flashing = false;
3225 int oppx, oppy; 3235 int oppx, oppy;
3226 3236
3227 if (flashtime > 0) { 3237 if (flashtime > 0) {
@@ -3240,13 +3250,13 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
3240 draw_update(dr, ds->dragx, ds->dragy, TILE_SIZE, TILE_SIZE); 3250 draw_update(dr, ds->dragx, ds->dragy, TILE_SIZE, TILE_SIZE);
3241 blitter_load(dr, ds->blmirror, oppx, oppy); 3251 blitter_load(dr, ds->blmirror, oppx, oppy);
3242 draw_update(dr, oppx, oppy, TILE_SIZE, TILE_SIZE); 3252 draw_update(dr, oppx, oppy, TILE_SIZE, TILE_SIZE);
3243 ds->dragging = FALSE; 3253 ds->dragging = false;
3244 } 3254 }
3245 if (ds->cur_visible) { 3255 if (ds->cur_visible) {
3246 assert(ds->cur_bl); 3256 assert(ds->cur_bl);
3247 blitter_load(dr, ds->cur_bl, ds->cx, ds->cy); 3257 blitter_load(dr, ds->cur_bl, ds->cx, ds->cy);
3248 draw_update(dr, ds->cx, ds->cy, CURSOR_SIZE*2+1, CURSOR_SIZE*2+1); 3258 draw_update(dr, ds->cx, ds->cy, CURSOR_SIZE*2+1, CURSOR_SIZE*2+1);
3249 ds->cur_visible = FALSE; 3259 ds->cur_visible = false;
3250 } 3260 }
3251 3261
3252 if (!ds->started) { 3262 if (!ds->started) {
@@ -3255,7 +3265,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
3255 w*TILE_SIZE + EDGE_THICKNESS*2 - 1, 3265 w*TILE_SIZE + EDGE_THICKNESS*2 - 1,
3256 h*TILE_SIZE + EDGE_THICKNESS*2 - 1, COL_EDGE); 3266 h*TILE_SIZE + EDGE_THICKNESS*2 - 1, COL_EDGE);
3257 draw_update(dr, 0, 0, DRAW_WIDTH, DRAW_HEIGHT); 3267 draw_update(dr, 0, 0, DRAW_WIDTH, DRAW_HEIGHT);
3258 ds->started = TRUE; 3268 ds->started = true;
3259 } 3269 }
3260 3270
3261 check_complete(state, NULL, ds->colour_scratch); 3271 check_complete(state, NULL, ds->colour_scratch);
@@ -3377,7 +3387,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
3377 */ 3387 */
3378 if (ui->cur_visible) { 3388 if (ui->cur_visible) {
3379 space *sp = &SPACE(state, ui->cur_x, ui->cur_y); 3389 space *sp = &SPACE(state, ui->cur_x, ui->cur_y);
3380 ds->cur_visible = TRUE; 3390 ds->cur_visible = true;
3381 ds->cx = SCOORD(ui->cur_x) - CURSOR_SIZE; 3391 ds->cx = SCOORD(ui->cur_x) - CURSOR_SIZE;
3382 ds->cy = SCOORD(ui->cur_y) - CURSOR_SIZE; 3392 ds->cy = SCOORD(ui->cur_y) - CURSOR_SIZE;
3383 blitter_save(dr, ds->cur_bl, ds->cx, ds->cy); 3393 blitter_save(dr, ds->cur_bl, ds->cx, ds->cy);
@@ -3398,7 +3408,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
3398 } 3408 }
3399 3409
3400 if (ui->dragging) { 3410 if (ui->dragging) {
3401 ds->dragging = TRUE; 3411 ds->dragging = true;
3402 ds->dragx = ui->dx - TILE_SIZE/2; 3412 ds->dragx = ui->dx - TILE_SIZE/2;
3403 ds->dragy = ui->dy - TILE_SIZE/2; 3413 ds->dragy = ui->dy - TILE_SIZE/2;
3404 calculate_opposite_point(ui, ds, ui->dx, ui->dy, &oppx, &oppy); 3414 calculate_opposite_point(ui, ds, ui->dx, ui->dy, &oppx, &oppy);
@@ -3442,9 +3452,9 @@ static int game_status(const game_state *state)
3442 return state->completed ? +1 : 0; 3452 return state->completed ? +1 : 0;
3443} 3453}
3444 3454
3445static int game_timing_state(const game_state *state, game_ui *ui) 3455static bool game_timing_state(const game_state *state, game_ui *ui)
3446{ 3456{
3447 return TRUE; 3457 return true;
3448} 3458}
3449 3459
3450#ifndef EDITOR 3460#ifndef EDITOR
@@ -3635,7 +3645,7 @@ const struct game thegame = {
3635 encode_params, 3645 encode_params,
3636 free_params, 3646 free_params,
3637 dup_params, 3647 dup_params,
3638 TRUE, game_configure, custom_params, 3648 true, game_configure, custom_params,
3639 validate_params, 3649 validate_params,
3640 new_game_desc, 3650 new_game_desc,
3641 validate_desc, 3651 validate_desc,
@@ -3643,11 +3653,11 @@ const struct game thegame = {
3643 dup_game, 3653 dup_game,
3644 free_game, 3654 free_game,
3645#ifdef EDITOR 3655#ifdef EDITOR
3646 FALSE, NULL, 3656 false, NULL,
3647#else 3657#else
3648 TRUE, solve_game, 3658 true, solve_game,
3649#endif 3659#endif
3650 TRUE, game_can_format_as_text_now, game_text_format, 3660 true, game_can_format_as_text_now, game_text_format,
3651 new_ui, 3661 new_ui,
3652 free_ui, 3662 free_ui,
3653 encode_ui, 3663 encode_ui,
@@ -3665,13 +3675,13 @@ const struct game thegame = {
3665 game_flash_length, 3675 game_flash_length,
3666 game_status, 3676 game_status,
3667#ifdef EDITOR 3677#ifdef EDITOR
3668 FALSE, FALSE, NULL, NULL, 3678 false, false, NULL, NULL,
3669 TRUE, /* wants_statusbar */ 3679 true, /* wants_statusbar */
3670#else 3680#else
3671 TRUE, FALSE, game_print_size, game_print, 3681 true, false, game_print_size, game_print,
3672 FALSE, /* wants_statusbar */ 3682 false, /* wants_statusbar */
3673#endif 3683#endif
3674 FALSE, game_timing_state, 3684 false, game_timing_state,
3675 REQUIRE_RBUTTON, /* flags */ 3685 REQUIRE_RBUTTON, /* flags */
3676}; 3686};
3677 3687
@@ -3696,7 +3706,7 @@ static void dump_state(game_state *state)
3696 sfree(temp); 3706 sfree(temp);
3697} 3707}
3698 3708
3699static int gen(game_params *p, random_state *rs, int debug) 3709static int gen(game_params *p, random_state *rs, bool debug)
3700{ 3710{
3701 char *desc; 3711 char *desc;
3702 int diff; 3712 int diff;
@@ -3708,7 +3718,7 @@ static int gen(game_params *p, random_state *rs, int debug)
3708 printf("Generating a %dx%d %s puzzle.\n", 3718 printf("Generating a %dx%d %s puzzle.\n",
3709 p->w, p->h, galaxies_diffnames[p->diff]); 3719 p->w, p->h, galaxies_diffnames[p->diff]);
3710 3720
3711 desc = new_game_desc(p, rs, NULL, 0); 3721 desc = new_game_desc(p, rs, NULL, false);
3712 state = new_game(NULL, p, desc); 3722 state = new_game(NULL, p, desc);
3713 dump_state(state); 3723 dump_state(state);
3714 3724
@@ -3731,7 +3741,7 @@ static void soak(game_params *p, random_state *rs)
3731 int diff, n = 0, i, diffs[DIFF_MAX], ndots = 0, nspaces = 0; 3741 int diff, n = 0, i, diffs[DIFF_MAX], ndots = 0, nspaces = 0;
3732 3742
3733#ifndef DEBUGGING 3743#ifndef DEBUGGING
3734 solver_show_working = 0; 3744 solver_show_working = false;
3735#endif 3745#endif
3736 tt_start = tt_now = time(NULL); 3746 tt_start = tt_now = time(NULL);
3737 for (i = 0; i < DIFF_MAX; i++) diffs[i] = 0; 3747 for (i = 0; i < DIFF_MAX; i++) diffs[i] = 0;
@@ -3745,7 +3755,7 @@ static void soak(game_params *p, random_state *rs)
3745 printf("]\n"); 3755 printf("]\n");
3746 3756
3747 while (1) { 3757 while (1) {
3748 desc = new_game_desc(p, rs, NULL, 0); 3758 desc = new_game_desc(p, rs, NULL, false);
3749 st = new_game(NULL, p, desc); 3759 st = new_game(NULL, p, desc);
3750 diff = solver_state(st, p->diff); 3760 diff = solver_state(st, p->diff);
3751 nspaces += st->w*st->h; 3761 nspaces += st->w*st->h;
@@ -3776,7 +3786,8 @@ int main(int argc, char **argv)
3776 char *id = NULL, *desc; 3786 char *id = NULL, *desc;
3777 const char *err; 3787 const char *err;
3778 game_state *s; 3788 game_state *s;
3779 int diff, do_soak = 0, verbose = 0; 3789 int diff;
3790 bool do_soak = false, verbose = false;
3780 random_state *rs; 3791 random_state *rs;
3781 time_t seed = time(NULL); 3792 time_t seed = time(NULL);
3782 3793
@@ -3784,13 +3795,13 @@ int main(int argc, char **argv)
3784 while (--argc > 0) { 3795 while (--argc > 0) {
3785 char *p = *++argv; 3796 char *p = *++argv;
3786 if (!strcmp(p, "-v")) { 3797 if (!strcmp(p, "-v")) {
3787 verbose = 1; 3798 verbose = true;
3788 } else if (!strcmp(p, "--seed")) { 3799 } else if (!strcmp(p, "--seed")) {
3789 if (argc == 0) usage_exit("--seed needs an argument"); 3800 if (argc == 0) usage_exit("--seed needs an argument");
3790 seed = (time_t)atoi(*++argv); 3801 seed = (time_t)atoi(*++argv);
3791 argc--; 3802 argc--;
3792 } else if (!strcmp(p, "--soak")) { 3803 } else if (!strcmp(p, "--soak")) {
3793 do_soak = 1; 3804 do_soak = true;
3794 } else if (*p == '-') { 3805 } else if (*p == '-') {
3795 usage_exit("unrecognised option"); 3806 usage_exit("unrecognised option");
3796 } else { 3807 } else {
@@ -3815,7 +3826,7 @@ int main(int argc, char **argv)
3815 p->w = random_upto(rs, 15) + 3; 3826 p->w = random_upto(rs, 15) + 3;
3816 p->h = random_upto(rs, 15) + 3; 3827 p->h = random_upto(rs, 15) + 3;
3817 p->diff = random_upto(rs, DIFF_UNREASONABLE); 3828 p->diff = random_upto(rs, DIFF_UNREASONABLE);
3818 diff = gen(p, rs, 0); 3829 diff = gen(p, rs, false);
3819 } 3830 }
3820 return 0; 3831 return 0;
3821 } 3832 }
@@ -3826,7 +3837,7 @@ int main(int argc, char **argv)
3826 gen(p, rs, verbose); 3837 gen(p, rs, verbose);
3827 } else { 3838 } else {
3828#ifndef DEBUGGING 3839#ifndef DEBUGGING
3829 solver_show_working = 1; 3840 solver_show_working = true;
3830#endif 3841#endif
3831 *desc++ = '\0'; 3842 *desc++ = '\0';
3832 decode_params(p, id); 3843 decode_params(p, id);
@@ -3977,8 +3988,8 @@ int main(int argc, char **argv)
3977 3988
3978 rs = random_new((void*)&seed, sizeof(time_t)); 3989 rs = random_new((void*)&seed, sizeof(time_t));
3979 3990
3980 desc = new_game_desc(par, rs, NULL, FALSE); 3991 desc = new_game_desc(par, rs, NULL, false);
3981 params = encode_params(par, FALSE); 3992 params = encode_params(par, false);
3982 printf("%s:%s\n", params, desc); 3993 printf("%s:%s\n", params, desc);
3983 3994
3984 sfree(desc); 3995 sfree(desc);
diff --git a/apps/plugins/puzzles/src/grid.c b/apps/plugins/puzzles/src/grid.c
index b5e6bb0937..89bde187be 100644
--- a/apps/plugins/puzzles/src/grid.c
+++ b/apps/plugins/puzzles/src/grid.c
@@ -386,11 +386,11 @@ static void grid_trim_vigorously(grid *g)
386 */ 386 */
387 dots = snewn(g->num_dots, int); 387 dots = snewn(g->num_dots, int);
388 for (i = 0; i < g->num_dots; i++) { 388 for (i = 0; i < g->num_dots; i++) {
389 dots[i] = TRUE; 389 dots[i] = 1;
390 for (j = 0; j < g->num_dots; j++) { 390 for (j = 0; j < g->num_dots; j++) {
391 if ((dotpairs[i*g->num_dots+j] >= 0) ^ 391 if ((dotpairs[i*g->num_dots+j] >= 0) ^
392 (dotpairs[j*g->num_dots+i] >= 0)) 392 (dotpairs[j*g->num_dots+i] >= 0))
393 dots[i] = FALSE; /* non-duplicated edge: coastal dot */ 393 dots[i] = 0; /* non-duplicated edge: coastal dot */
394 } 394 }
395 } 395 }
396 396
@@ -435,14 +435,14 @@ static void grid_trim_vigorously(grid *g)
435 dots[i] = 0; 435 dots[i] = 0;
436 for (i = 0; i < g->num_faces; i++) { 436 for (i = 0; i < g->num_faces; i++) {
437 grid_face *f = g->faces + i; 437 grid_face *f = g->faces + i;
438 int keep = FALSE; 438 bool keep = false;
439 for (k = 0; k < f->order; k++) 439 for (k = 0; k < f->order; k++)
440 if (dsf_canonify(dsf, f->dots[k] - g->dots) == j) 440 if (dsf_canonify(dsf, f->dots[k] - g->dots) == j)
441 keep = TRUE; 441 keep = true;
442 if (keep) { 442 if (keep) {
443 faces[i] = TRUE; 443 faces[i] = 1;
444 for (k = 0; k < f->order; k++) 444 for (k = 0; k < f->order; k++)
445 dots[f->dots[k]-g->dots] = TRUE; 445 dots[f->dots[k]-g->dots] = 1;
446 } 446 }
447 } 447 }
448 448
@@ -700,7 +700,7 @@ static void grid_make_consistent(grid *g)
700 * that face (see diagram). */ 700 * that face (see diagram). */
701 701
702 /* clockwise search */ 702 /* clockwise search */
703 while (TRUE) { 703 while (true) {
704 grid_face *f = d->faces[current_face1]; 704 grid_face *f = d->faces[current_face1];
705 grid_edge *e; 705 grid_edge *e;
706 int j; 706 int j;
@@ -737,7 +737,7 @@ static void grid_make_consistent(grid *g)
737 continue; /* this dot is complete, move on to next dot */ 737 continue; /* this dot is complete, move on to next dot */
738 738
739 /* anticlockwise search */ 739 /* anticlockwise search */
740 while (TRUE) { 740 while (true) {
741 grid_face *f = d->faces[current_face2]; 741 grid_face *f = d->faces[current_face2];
742 grid_edge *e; 742 grid_edge *e;
743 int j; 743 int j;
@@ -813,7 +813,7 @@ static void grid_face_add_new(grid *g, int face_size)
813 for (i = 0; i < face_size; i++) 813 for (i = 0; i < face_size; i++)
814 new_face->dots[i] = NULL; 814 new_face->dots[i] = NULL;
815 new_face->edges = NULL; 815 new_face->edges = NULL;
816 new_face->has_incentre = FALSE; 816 new_face->has_incentre = false;
817 g->num_faces++; 817 g->num_faces++;
818} 818}
819/* Assumes dot list has enough space */ 819/* Assumes dot list has enough space */
@@ -862,13 +862,13 @@ static void grid_face_set_dot(grid *g, grid_dot *d, int position)
862/* 862/*
863 * Helper routines for grid_find_incentre. 863 * Helper routines for grid_find_incentre.
864 */ 864 */
865static int solve_2x2_matrix(double mx[4], double vin[2], double vout[2]) 865static bool solve_2x2_matrix(double mx[4], double vin[2], double vout[2])
866{ 866{
867 double inv[4]; 867 double inv[4];
868 double det; 868 double det;
869 det = (mx[0]*mx[3] - mx[1]*mx[2]); 869 det = (mx[0]*mx[3] - mx[1]*mx[2]);
870 if (det == 0) 870 if (det == 0)
871 return FALSE; 871 return false;
872 872
873 inv[0] = mx[3] / det; 873 inv[0] = mx[3] / det;
874 inv[1] = -mx[1] / det; 874 inv[1] = -mx[1] / det;
@@ -878,9 +878,9 @@ static int solve_2x2_matrix(double mx[4], double vin[2], double vout[2])
878 vout[0] = inv[0]*vin[0] + inv[1]*vin[1]; 878 vout[0] = inv[0]*vin[0] + inv[1]*vin[1];
879 vout[1] = inv[2]*vin[0] + inv[3]*vin[1]; 879 vout[1] = inv[2]*vin[0] + inv[3]*vin[1];
880 880
881 return TRUE; 881 return true;
882} 882}
883static int solve_3x3_matrix(double mx[9], double vin[3], double vout[3]) 883static bool solve_3x3_matrix(double mx[9], double vin[3], double vout[3])
884{ 884{
885 double inv[9]; 885 double inv[9];
886 double det; 886 double det;
@@ -888,7 +888,7 @@ static int solve_3x3_matrix(double mx[9], double vin[3], double vout[3])
888 det = (mx[0]*mx[4]*mx[8] + mx[1]*mx[5]*mx[6] + mx[2]*mx[3]*mx[7] - 888 det = (mx[0]*mx[4]*mx[8] + mx[1]*mx[5]*mx[6] + mx[2]*mx[3]*mx[7] -
889 mx[0]*mx[5]*mx[7] - mx[1]*mx[3]*mx[8] - mx[2]*mx[4]*mx[6]); 889 mx[0]*mx[5]*mx[7] - mx[1]*mx[3]*mx[8] - mx[2]*mx[4]*mx[6]);
890 if (det == 0) 890 if (det == 0)
891 return FALSE; 891 return false;
892 892
893 inv[0] = (mx[4]*mx[8] - mx[5]*mx[7]) / det; 893 inv[0] = (mx[4]*mx[8] - mx[5]*mx[7]) / det;
894 inv[1] = (mx[2]*mx[7] - mx[1]*mx[8]) / det; 894 inv[1] = (mx[2]*mx[7] - mx[1]*mx[8]) / det;
@@ -904,7 +904,7 @@ static int solve_3x3_matrix(double mx[9], double vin[3], double vout[3])
904 vout[1] = inv[3]*vin[0] + inv[4]*vin[1] + inv[5]*vin[2]; 904 vout[1] = inv[3]*vin[0] + inv[4]*vin[1] + inv[5]*vin[2];
905 vout[2] = inv[6]*vin[0] + inv[7]*vin[1] + inv[8]*vin[2]; 905 vout[2] = inv[6]*vin[0] + inv[7]*vin[1] + inv[8]*vin[2];
906 906
907 return TRUE; 907 return true;
908} 908}
909 909
910void grid_find_incentre(grid_face *f) 910void grid_find_incentre(grid_face *f)
@@ -1239,7 +1239,8 @@ void grid_find_incentre(grid_face *f)
1239 * _positive_ epsilon in both the x- and 1239 * _positive_ epsilon in both the x- and
1240 * y-direction.) 1240 * y-direction.)
1241 */ 1241 */
1242 int e, in = 0; 1242 int e;
1243 bool in = false;
1243 for (e = 0; e < f->order; e++) { 1244 for (e = 0; e < f->order; e++) {
1244 int xs = f->edges[e]->dot1->x; 1245 int xs = f->edges[e]->dot1->x;
1245 int xe = f->edges[e]->dot2->x; 1246 int xe = f->edges[e]->dot2->x;
@@ -1265,7 +1266,7 @@ void grid_find_incentre(grid_face *f)
1265 denom = -denom; 1266 denom = -denom;
1266 } 1267 }
1267 if ((x - xs) * denom >= (y - ys) * num) 1268 if ((x - xs) * denom >= (y - ys) * num)
1268 in ^= 1; 1269 in = !in;
1269 } 1270 }
1270 } 1271 }
1271 1272
@@ -1364,7 +1365,7 @@ void grid_find_incentre(grid_face *f)
1364 1365
1365 assert(bestdist > 0); 1366 assert(bestdist > 0);
1366 1367
1367 f->has_incentre = TRUE; 1368 f->has_incentre = true;
1368 f->ix = xbest + 0.5; /* round to nearest */ 1369 f->ix = xbest + 0.5; /* round to nearest */
1369 f->iy = ybest + 0.5; 1370 f->iy = ybest + 0.5;
1370} 1371}
@@ -1611,11 +1612,11 @@ static grid *grid_new_triangular(int width, int height, const char *desc)
1611 f1->edges = NULL; 1612 f1->edges = NULL;
1612 f1->order = 3; 1613 f1->order = 3;
1613 f1->dots = snewn(f1->order, grid_dot*); 1614 f1->dots = snewn(f1->order, grid_dot*);
1614 f1->has_incentre = FALSE; 1615 f1->has_incentre = false;
1615 f2->edges = NULL; 1616 f2->edges = NULL;
1616 f2->order = 3; 1617 f2->order = 3;
1617 f2->dots = snewn(f2->order, grid_dot*); 1618 f2->dots = snewn(f2->order, grid_dot*);
1618 f2->has_incentre = FALSE; 1619 f2->has_incentre = false;
1619 1620
1620 /* face descriptions depend on whether the row-number is 1621 /* face descriptions depend on whether the row-number is
1621 * odd or even */ 1622 * odd or even */
diff --git a/apps/plugins/puzzles/src/grid.h b/apps/plugins/puzzles/src/grid.h
index 26d0b16633..7ca3ff1d5f 100644
--- a/apps/plugins/puzzles/src/grid.h
+++ b/apps/plugins/puzzles/src/grid.h
@@ -50,7 +50,7 @@ struct grid_face {
50 * grid_find_incentre() on a face, and it will fill in ix,iy below 50 * grid_find_incentre() on a face, and it will fill in ix,iy below
51 * and set has_incentre to indicate that it's done so. 51 * and set has_incentre to indicate that it's done so.
52 */ 52 */
53 int has_incentre; 53 bool has_incentre;
54 int ix, iy; /* incentre (centre of largest inscribed circle) */ 54 int ix, iy; /* incentre (centre of largest inscribed circle) */
55}; 55};
56struct grid_edge { 56struct grid_edge {
diff --git a/apps/plugins/puzzles/src/gtk.c b/apps/plugins/puzzles/src/gtk.c
index c3115b5816..d41f8677b9 100644
--- a/apps/plugins/puzzles/src/gtk.c
+++ b/apps/plugins/puzzles/src/gtk.c
@@ -139,6 +139,8 @@ struct font {
139 * particularly good reason not to. 139 * particularly good reason not to.
140 */ 140 */
141struct frontend { 141struct frontend {
142 bool headless; /* true if we're running without GTK, for --screenshot */
143
142 GtkWidget *window; 144 GtkWidget *window;
143 GtkAccelGroup *dummy_accelgroup; 145 GtkAccelGroup *dummy_accelgroup;
144 GtkWidget *area; 146 GtkWidget *area;
@@ -167,12 +169,14 @@ struct frontend {
167#endif 169#endif
168 int ncolours; 170 int ncolours;
169 int bbox_l, bbox_r, bbox_u, bbox_d; 171 int bbox_l, bbox_r, bbox_u, bbox_d;
170 int timer_active, timer_id; 172 bool timer_active;
173 int timer_id;
171 struct timeval last_time; 174 struct timeval last_time;
172 struct font *fonts; 175 struct font *fonts;
173 int nfonts, fontsize; 176 int nfonts, fontsize;
174 config_item *cfg; 177 config_item *cfg;
175 int cfg_which, cfgret; 178 int cfg_which;
179 bool cfgret;
176 GtkWidget *cfgbox; 180 GtkWidget *cfgbox;
177 void *paste_data; 181 void *paste_data;
178 int paste_data_len; 182 int paste_data_len;
@@ -182,12 +186,12 @@ struct frontend {
182 char *filesel_name; 186 char *filesel_name;
183#endif 187#endif
184 GSList *preset_radio; 188 GSList *preset_radio;
185 int preset_threaded; 189 bool preset_threaded;
186 GtkWidget *preset_custom; 190 GtkWidget *preset_custom;
187 GtkWidget *copy_menu_item; 191 GtkWidget *copy_menu_item;
188#if !GTK_CHECK_VERSION(3,0,0) 192#if !GTK_CHECK_VERSION(3,0,0)
189 int drawing_area_shrink_pending; 193 bool drawing_area_shrink_pending;
190 int menubar_is_local; 194 bool menubar_is_local;
191#endif 195#endif
192#if GTK_CHECK_VERSION(3,0,0) 196#if GTK_CHECK_VERSION(3,0,0)
193 /* 197 /*
@@ -219,7 +223,7 @@ struct frontend {
219 * happen, the window's size_allocate handler does a fallback 223 * happen, the window's size_allocate handler does a fallback
220 * puzzle resize when it sees this flag still set to true. 224 * puzzle resize when it sees this flag still set to true.
221 */ 225 */
222 int awaiting_resize_ack; 226 bool awaiting_resize_ack;
223#endif 227#endif
224}; 228};
225 229
@@ -268,6 +272,9 @@ void gtk_status_bar(void *handle, const char *text)
268{ 272{
269 frontend *fe = (frontend *)handle; 273 frontend *fe = (frontend *)handle;
270 274
275 if (fe->headless)
276 return;
277
271 assert(fe->statusbar); 278 assert(fe->statusbar);
272 279
273 gtk_statusbar_pop(GTK_STATUSBAR(fe->statusbar), fe->statusctx); 280 gtk_statusbar_pop(GTK_STATUSBAR(fe->statusbar), fe->statusctx);
@@ -295,7 +302,7 @@ static void teardown_drawing(frontend *fe)
295 fe->cr = NULL; 302 fe->cr = NULL;
296 303
297#ifndef USE_CAIRO_WITHOUT_PIXMAP 304#ifndef USE_CAIRO_WITHOUT_PIXMAP
298 { 305 if (!fe->headless) {
299 cairo_t *cr = gdk_cairo_create(fe->pixmap); 306 cairo_t *cr = gdk_cairo_create(fe->pixmap);
300 cairo_set_source_surface(cr, fe->image, 0, 0); 307 cairo_set_source_surface(cr, fe->image, 0, 0);
301 cairo_rectangle(cr, 308 cairo_rectangle(cr,
@@ -359,7 +366,7 @@ static void set_window_background(frontend *fe, int colour)
359 fe->background.red = fe->colours[3*colour + 0] * 65535; 366 fe->background.red = fe->colours[3*colour + 0] * 65535;
360 fe->background.green = fe->colours[3*colour + 1] * 65535; 367 fe->background.green = fe->colours[3*colour + 1] * 65535;
361 fe->background.blue = fe->colours[3*colour + 2] * 65535; 368 fe->background.blue = fe->colours[3*colour + 2] * 65535;
362 if (!gdk_colormap_alloc_color(colmap, &fe->background, FALSE, FALSE)) { 369 if (!gdk_colormap_alloc_color(colmap, &fe->background, false, false)) {
363 g_error("couldn't allocate background (#%02x%02x%02x)\n", 370 g_error("couldn't allocate background (#%02x%02x%02x)\n",
364 fe->background.red >> 8, fe->background.green >> 8, 371 fe->background.red >> 8, fe->background.green >> 8,
365 fe->background.blue >> 8); 372 fe->background.blue >> 8);
@@ -494,7 +501,7 @@ static void clear_backing_store(frontend *fe)
494} 501}
495 502
496static void wipe_and_maybe_destroy_cairo(frontend *fe, cairo_t *cr, 503static void wipe_and_maybe_destroy_cairo(frontend *fe, cairo_t *cr,
497 int destroy) 504 bool destroy)
498{ 505{
499 cairo_set_source_rgb(cr, fe->colours[0], fe->colours[1], fe->colours[2]); 506 cairo_set_source_rgb(cr, fe->colours[0], fe->colours[1], fe->colours[2]);
500 cairo_paint(cr); 507 cairo_paint(cr);
@@ -505,18 +512,23 @@ static void wipe_and_maybe_destroy_cairo(frontend *fe, cairo_t *cr,
505static void setup_backing_store(frontend *fe) 512static void setup_backing_store(frontend *fe)
506{ 513{
507#ifndef USE_CAIRO_WITHOUT_PIXMAP 514#ifndef USE_CAIRO_WITHOUT_PIXMAP
515 if (fe->headless) {
516 fprintf(stderr, "headless mode does not work with GDK pixmaps\n");
517 exit(1);
518 }
519
508 fe->pixmap = gdk_pixmap_new(gtk_widget_get_window(fe->area), 520 fe->pixmap = gdk_pixmap_new(gtk_widget_get_window(fe->area),
509 fe->pw, fe->ph, -1); 521 fe->pw, fe->ph, -1);
510#endif 522#endif
511 fe->image = cairo_image_surface_create(CAIRO_FORMAT_RGB24, 523 fe->image = cairo_image_surface_create(CAIRO_FORMAT_RGB24,
512 fe->pw, fe->ph); 524 fe->pw, fe->ph);
513 525
514 wipe_and_maybe_destroy_cairo(fe, cairo_create(fe->image), TRUE); 526 wipe_and_maybe_destroy_cairo(fe, cairo_create(fe->image), true);
515#ifndef USE_CAIRO_WITHOUT_PIXMAP 527#ifndef USE_CAIRO_WITHOUT_PIXMAP
516 wipe_and_maybe_destroy_cairo(fe, gdk_cairo_create(fe->pixmap), TRUE); 528 wipe_and_maybe_destroy_cairo(fe, gdk_cairo_create(fe->pixmap), true);
517#endif 529#endif
518#if GTK_CHECK_VERSION(3,22,0) 530#if GTK_CHECK_VERSION(3,22,0)
519 { 531 if (!fe->headless) {
520 GdkWindow *gdkwin; 532 GdkWindow *gdkwin;
521 cairo_region_t *region; 533 cairo_region_t *region;
522 GdkDrawingContext *drawctx; 534 GdkDrawingContext *drawctx;
@@ -526,19 +538,19 @@ static void setup_backing_store(frontend *fe)
526 region = gdk_window_get_clip_region(gdkwin); 538 region = gdk_window_get_clip_region(gdkwin);
527 drawctx = gdk_window_begin_draw_frame(gdkwin, region); 539 drawctx = gdk_window_begin_draw_frame(gdkwin, region);
528 cr = gdk_drawing_context_get_cairo_context(drawctx); 540 cr = gdk_drawing_context_get_cairo_context(drawctx);
529 wipe_and_maybe_destroy_cairo(fe, cr, FALSE); 541 wipe_and_maybe_destroy_cairo(fe, cr, false);
530 gdk_window_end_draw_frame(gdkwin, drawctx); 542 gdk_window_end_draw_frame(gdkwin, drawctx);
531 cairo_region_destroy(region); 543 cairo_region_destroy(region);
532 } 544 }
533#else 545#else
534 wipe_and_maybe_destroy_cairo( 546 wipe_and_maybe_destroy_cairo(
535 fe, gdk_cairo_create(gtk_widget_get_window(fe->area)), TRUE); 547 fe, gdk_cairo_create(gtk_widget_get_window(fe->area)), true);
536#endif 548#endif
537} 549}
538 550
539static int backing_store_ok(frontend *fe) 551static bool backing_store_ok(frontend *fe)
540{ 552{
541 return (!!fe->image); 553 return fe->image != NULL;
542} 554}
543 555
544static void teardown_backing_store(frontend *fe) 556static void teardown_backing_store(frontend *fe)
@@ -586,7 +598,7 @@ static void snaffle_colours(frontend *fe)
586 } 598 }
587 success = snewn(ncolours, gboolean); 599 success = snewn(ncolours, gboolean);
588 gdk_colormap_alloc_colors(fe->colmap, fe->colours, ncolours, 600 gdk_colormap_alloc_colors(fe->colmap, fe->colours, ncolours,
589 FALSE, FALSE, success); 601 false, false, success);
590 for (i = 0; i < ncolours; i++) { 602 for (i = 0; i < ncolours; i++) {
591 if (!success[i]) { 603 if (!success[i]) {
592 g_error("couldn't allocate colour %d (#%02x%02x%02x)\n", 604 g_error("couldn't allocate colour %d (#%02x%02x%02x)\n",
@@ -698,7 +710,7 @@ static void do_draw_poly(frontend *fe, int *coords, int npoints,
698 710
699 if (fillcolour >= 0) { 711 if (fillcolour >= 0) {
700 set_colour(fe, fillcolour); 712 set_colour(fe, fillcolour);
701 gdk_draw_polygon(fe->pixmap, fe->gc, TRUE, points, npoints); 713 gdk_draw_polygon(fe->pixmap, fe->gc, true, points, npoints);
702 } 714 }
703 assert(outlinecolour >= 0); 715 assert(outlinecolour >= 0);
704 set_colour(fe, outlinecolour); 716 set_colour(fe, outlinecolour);
@@ -722,14 +734,14 @@ static void do_draw_circle(frontend *fe, int cx, int cy, int radius,
722{ 734{
723 if (fillcolour >= 0) { 735 if (fillcolour >= 0) {
724 set_colour(fe, fillcolour); 736 set_colour(fe, fillcolour);
725 gdk_draw_arc(fe->pixmap, fe->gc, TRUE, 737 gdk_draw_arc(fe->pixmap, fe->gc, true,
726 cx - radius, cy - radius, 738 cx - radius, cy - radius,
727 2 * radius, 2 * radius, 0, 360 * 64); 739 2 * radius, 2 * radius, 0, 360 * 64);
728 } 740 }
729 741
730 assert(outlinecolour >= 0); 742 assert(outlinecolour >= 0);
731 set_colour(fe, outlinecolour); 743 set_colour(fe, outlinecolour);
732 gdk_draw_arc(fe->pixmap, fe->gc, FALSE, 744 gdk_draw_arc(fe->pixmap, fe->gc, false,
733 cx - radius, cy - radius, 745 cx - radius, cy - radius,
734 2 * radius, 2 * radius, 0, 360 * 64); 746 2 * radius, 2 * radius, 0, 360 * 64);
735} 747}
@@ -778,6 +790,11 @@ static void setup_backing_store(frontend *fe)
778{ 790{
779 GdkGC *gc; 791 GdkGC *gc;
780 792
793 if (fe->headless) {
794 fprintf(stderr, "headless mode does not work with GDK drawing\n");
795 exit(1);
796 }
797
781 fe->pixmap = gdk_pixmap_new(fe->area->window, fe->pw, fe->ph, -1); 798 fe->pixmap = gdk_pixmap_new(fe->area->window, fe->pw, fe->ph, -1);
782 799
783 gc = gdk_gc_new(fe->area->window); 800 gc = gdk_gc_new(fe->area->window);
@@ -812,24 +829,24 @@ static void repaint_rectangle(frontend *fe, GtkWidget *widget,
812#endif 829#endif
813 if (x < fe->ox) { 830 if (x < fe->ox) {
814 gdk_draw_rectangle(gtk_widget_get_window(widget), gc, 831 gdk_draw_rectangle(gtk_widget_get_window(widget), gc,
815 TRUE, x, y, fe->ox - x, h); 832 true, x, y, fe->ox - x, h);
816 w -= (fe->ox - x); 833 w -= (fe->ox - x);
817 x = fe->ox; 834 x = fe->ox;
818 } 835 }
819 if (y < fe->oy) { 836 if (y < fe->oy) {
820 gdk_draw_rectangle(gtk_widget_get_window(widget), gc, 837 gdk_draw_rectangle(gtk_widget_get_window(widget), gc,
821 TRUE, x, y, w, fe->oy - y); 838 true, x, y, w, fe->oy - y);
822 h -= (fe->oy - y); 839 h -= (fe->oy - y);
823 y = fe->oy; 840 y = fe->oy;
824 } 841 }
825 if (w > fe->pw) { 842 if (w > fe->pw) {
826 gdk_draw_rectangle(gtk_widget_get_window(widget), gc, 843 gdk_draw_rectangle(gtk_widget_get_window(widget), gc,
827 TRUE, x + fe->pw, y, w - fe->pw, h); 844 true, x + fe->pw, y, w - fe->pw, h);
828 w = fe->pw; 845 w = fe->pw;
829 } 846 }
830 if (h > fe->ph) { 847 if (h > fe->ph) {
831 gdk_draw_rectangle(gtk_widget_get_window(widget), gc, 848 gdk_draw_rectangle(gtk_widget_get_window(widget), gc,
832 TRUE, x, y + fe->ph, w, h - fe->ph); 849 true, x, y + fe->ph, w, h - fe->ph);
833 h = fe->ph; 850 h = fe->ph;
834 } 851 }
835 gdk_draw_pixmap(gtk_widget_get_window(widget), gc, fe->pixmap, 852 gdk_draw_pixmap(gtk_widget_get_window(widget), gc, fe->pixmap,
@@ -1116,7 +1133,7 @@ void gtk_end_draw(void *handle)
1116 1133
1117 teardown_drawing(fe); 1134 teardown_drawing(fe);
1118 1135
1119 if (fe->bbox_l < fe->bbox_r && fe->bbox_u < fe->bbox_d) { 1136 if (fe->bbox_l < fe->bbox_r && fe->bbox_u < fe->bbox_d && !fe->headless) {
1120#ifdef USE_CAIRO_WITHOUT_PIXMAP 1137#ifdef USE_CAIRO_WITHOUT_PIXMAP
1121 gtk_widget_queue_draw_area(fe->area, 1138 gtk_widget_queue_draw_area(fe->area,
1122 fe->bbox_l - 1 + fe->ox, 1139 fe->bbox_l - 1 + fe->ox,
@@ -1190,11 +1207,11 @@ static gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
1190 int ctrl = (event->state & GDK_CONTROL_MASK) ? MOD_CTRL : 0; 1207 int ctrl = (event->state & GDK_CONTROL_MASK) ? MOD_CTRL : 0;
1191 1208
1192 if (!backing_store_ok(fe)) 1209 if (!backing_store_ok(fe))
1193 return TRUE; 1210 return true;
1194 1211
1195 /* Handle mnemonics. */ 1212 /* Handle mnemonics. */
1196 if (gtk_window_activate_key(GTK_WINDOW(fe->window), event)) 1213 if (gtk_window_activate_key(GTK_WINDOW(fe->window), event))
1197 return TRUE; 1214 return true;
1198 1215
1199 if (event->keyval == GDK_KEY_Up) 1216 if (event->keyval == GDK_KEY_Up)
1200 keyval = shift | ctrl | CURSOR_UP; 1217 keyval = shift | ctrl | CURSOR_UP;
@@ -1249,7 +1266,7 @@ static gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
1249 !midend_process_key(fe->me, 0, 0, keyval)) 1266 !midend_process_key(fe->me, 0, 0, keyval))
1250 gtk_widget_destroy(fe->window); 1267 gtk_widget_destroy(fe->window);
1251 1268
1252 return TRUE; 1269 return true;
1253} 1270}
1254 1271
1255static gint button_event(GtkWidget *widget, GdkEventButton *event, 1272static gint button_event(GtkWidget *widget, GdkEventButton *event,
@@ -1259,10 +1276,10 @@ static gint button_event(GtkWidget *widget, GdkEventButton *event,
1259 int button; 1276 int button;
1260 1277
1261 if (!backing_store_ok(fe)) 1278 if (!backing_store_ok(fe))
1262 return TRUE; 1279 return true;
1263 1280
1264 if (event->type != GDK_BUTTON_PRESS && event->type != GDK_BUTTON_RELEASE) 1281 if (event->type != GDK_BUTTON_PRESS && event->type != GDK_BUTTON_RELEASE)
1265 return TRUE; 1282 return true;
1266 1283
1267 if (event->button == 2 || (event->state & GDK_SHIFT_MASK)) 1284 if (event->button == 2 || (event->state & GDK_SHIFT_MASK))
1268 button = MIDDLE_BUTTON; 1285 button = MIDDLE_BUTTON;
@@ -1275,7 +1292,7 @@ static gint button_event(GtkWidget *widget, GdkEventButton *event,
1275 else if (event->button == 9 && event->type == GDK_BUTTON_PRESS) 1292 else if (event->button == 9 && event->type == GDK_BUTTON_PRESS)
1276 button = 'r'; 1293 button = 'r';
1277 else 1294 else
1278 return FALSE; /* don't even know what button! */ 1295 return false; /* don't even know what button! */
1279 1296
1280 if (event->type == GDK_BUTTON_RELEASE && button >= LEFT_BUTTON) 1297 if (event->type == GDK_BUTTON_RELEASE && button >= LEFT_BUTTON)
1281 button += LEFT_RELEASE - LEFT_BUTTON; 1298 button += LEFT_RELEASE - LEFT_BUTTON;
@@ -1284,7 +1301,7 @@ static gint button_event(GtkWidget *widget, GdkEventButton *event,
1284 event->y - fe->oy, button)) 1301 event->y - fe->oy, button))
1285 gtk_widget_destroy(fe->window); 1302 gtk_widget_destroy(fe->window);
1286 1303
1287 return TRUE; 1304 return true;
1288} 1305}
1289 1306
1290static gint motion_event(GtkWidget *widget, GdkEventMotion *event, 1307static gint motion_event(GtkWidget *widget, GdkEventMotion *event,
@@ -1294,7 +1311,7 @@ static gint motion_event(GtkWidget *widget, GdkEventMotion *event,
1294 int button; 1311 int button;
1295 1312
1296 if (!backing_store_ok(fe)) 1313 if (!backing_store_ok(fe))
1297 return TRUE; 1314 return true;
1298 1315
1299 if (event->state & (GDK_BUTTON2_MASK | GDK_SHIFT_MASK)) 1316 if (event->state & (GDK_BUTTON2_MASK | GDK_SHIFT_MASK))
1300 button = MIDDLE_DRAG; 1317 button = MIDDLE_DRAG;
@@ -1303,7 +1320,7 @@ static gint motion_event(GtkWidget *widget, GdkEventMotion *event,
1303 else if (event->state & GDK_BUTTON3_MASK) 1320 else if (event->state & GDK_BUTTON3_MASK)
1304 button = RIGHT_DRAG; 1321 button = RIGHT_DRAG;
1305 else 1322 else
1306 return FALSE; /* don't even know what button! */ 1323 return false; /* don't even know what button! */
1307 1324
1308 if (!midend_process_key(fe->me, event->x - fe->ox, 1325 if (!midend_process_key(fe->me, event->x - fe->ox,
1309 event->y - fe->oy, button)) 1326 event->y - fe->oy, button))
@@ -1314,7 +1331,7 @@ static gint motion_event(GtkWidget *widget, GdkEventMotion *event,
1314 gdk_window_get_pointer(gtk_widget_get_window(widget), NULL, NULL, NULL); 1331 gdk_window_get_pointer(gtk_widget_get_window(widget), NULL, NULL, NULL);
1315#endif 1332#endif
1316 1333
1317 return TRUE; 1334 return true;
1318} 1335}
1319 1336
1320#if GTK_CHECK_VERSION(3,0,0) 1337#if GTK_CHECK_VERSION(3,0,0)
@@ -1329,7 +1346,7 @@ static gint draw_area(GtkWidget *widget, cairo_t *cr, gpointer data)
1329 dirtyrect.width, dirtyrect.height); 1346 dirtyrect.width, dirtyrect.height);
1330 cairo_fill(cr); 1347 cairo_fill(cr);
1331 1348
1332 return TRUE; 1349 return true;
1333} 1350}
1334#else 1351#else
1335static gint expose_area(GtkWidget *widget, GdkEventExpose *event, 1352static gint expose_area(GtkWidget *widget, GdkEventExpose *event,
@@ -1351,7 +1368,7 @@ static gint expose_area(GtkWidget *widget, GdkEventExpose *event,
1351 event->area.width, event->area.height); 1368 event->area.width, event->area.height);
1352#endif 1369#endif
1353 } 1370 }
1354 return TRUE; 1371 return true;
1355} 1372}
1356#endif 1373#endif
1357 1374
@@ -1367,7 +1384,7 @@ static gint map_window(GtkWidget *widget, GdkEvent *event,
1367 */ 1384 */
1368 gtk_widget_queue_draw(fe->window); 1385 gtk_widget_queue_draw(fe->window);
1369 1386
1370 return TRUE; 1387 return true;
1371} 1388}
1372 1389
1373static void resize_puzzle_to_area(frontend *fe, int x, int y) 1390static void resize_puzzle_to_area(frontend *fe, int x, int y)
@@ -1376,7 +1393,7 @@ static void resize_puzzle_to_area(frontend *fe, int x, int y)
1376 1393
1377 fe->w = x; 1394 fe->w = x;
1378 fe->h = y; 1395 fe->h = y;
1379 midend_size(fe->me, &x, &y, TRUE); 1396 midend_size(fe->me, &x, &y, true);
1380 fe->pw = x; 1397 fe->pw = x;
1381 fe->ph = y; 1398 fe->ph = y;
1382 fe->ox = (fe->w - fe->pw) / 2; 1399 fe->ox = (fe->w - fe->pw) / 2;
@@ -1398,9 +1415,9 @@ static gint configure_area(GtkWidget *widget,
1398 frontend *fe = (frontend *)data; 1415 frontend *fe = (frontend *)data;
1399 resize_puzzle_to_area(fe, event->width, event->height); 1416 resize_puzzle_to_area(fe, event->width, event->height);
1400#if GTK_CHECK_VERSION(3,0,0) 1417#if GTK_CHECK_VERSION(3,0,0)
1401 fe->awaiting_resize_ack = FALSE; 1418 fe->awaiting_resize_ack = false;
1402#endif 1419#endif
1403 return TRUE; 1420 return true;
1404} 1421}
1405 1422
1406#if GTK_CHECK_VERSION(3,0,0) 1423#if GTK_CHECK_VERSION(3,0,0)
@@ -1412,7 +1429,7 @@ static void window_size_alloc(GtkWidget *widget, GtkAllocation *allocation,
1412 GtkAllocation a; 1429 GtkAllocation a;
1413 gtk_widget_get_allocation(fe->area, &a); 1430 gtk_widget_get_allocation(fe->area, &a);
1414 resize_puzzle_to_area(fe, a.width, a.height); 1431 resize_puzzle_to_area(fe, a.width, a.height);
1415 fe->awaiting_resize_ack = FALSE; 1432 fe->awaiting_resize_ack = false;
1416 } 1433 }
1417} 1434}
1418#endif 1435#endif
@@ -1440,7 +1457,7 @@ void deactivate_timer(frontend *fe)
1440 return; /* can happen due to --generate */ 1457 return; /* can happen due to --generate */
1441 if (fe->timer_active) 1458 if (fe->timer_active)
1442 g_source_remove(fe->timer_id); 1459 g_source_remove(fe->timer_id);
1443 fe->timer_active = FALSE; 1460 fe->timer_active = false;
1444} 1461}
1445 1462
1446void activate_timer(frontend *fe) 1463void activate_timer(frontend *fe)
@@ -1451,7 +1468,7 @@ void activate_timer(frontend *fe)
1451 fe->timer_id = g_timeout_add(20, timer_func, fe); 1468 fe->timer_id = g_timeout_add(20, timer_func, fe);
1452 gettimeofday(&fe->last_time, NULL); 1469 gettimeofday(&fe->last_time, NULL);
1453 } 1470 }
1454 fe->timer_active = TRUE; 1471 fe->timer_active = true;
1455} 1472}
1456 1473
1457static void window_destroy(GtkWidget *widget, gpointer data) 1474static void window_destroy(GtkWidget *widget, gpointer data)
@@ -1459,7 +1476,7 @@ static void window_destroy(GtkWidget *widget, gpointer data)
1459 gtk_main_quit(); 1476 gtk_main_quit();
1460} 1477}
1461 1478
1462static int win_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data) 1479static gint win_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data)
1463{ 1480{
1464 GObject *cancelbutton = G_OBJECT(data); 1481 GObject *cancelbutton = G_OBJECT(data);
1465 1482
@@ -1468,10 +1485,10 @@ static int win_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data)
1468 */ 1485 */
1469 if (event->keyval == GDK_KEY_Escape) { 1486 if (event->keyval == GDK_KEY_Escape) {
1470 g_signal_emit_by_name(cancelbutton, "clicked"); 1487 g_signal_emit_by_name(cancelbutton, "clicked");
1471 return TRUE; 1488 return true;
1472 } 1489 }
1473 1490
1474 return FALSE; 1491 return false;
1475} 1492}
1476 1493
1477enum { MB_OK, MB_YESNO }; 1494enum { MB_OK, MB_YESNO };
@@ -1494,8 +1511,8 @@ static void align_label(GtkLabel *label, double x, double y)
1494} 1511}
1495 1512
1496#if GTK_CHECK_VERSION(3,0,0) 1513#if GTK_CHECK_VERSION(3,0,0)
1497int message_box(GtkWidget *parent, const char *title, const char *msg, 1514bool message_box(GtkWidget *parent, const char *title, const char *msg,
1498 int centre, int type) 1515 bool centre, int type)
1499{ 1516{
1500 GtkWidget *window; 1517 GtkWidget *window;
1501 gint ret; 1518 gint ret;
@@ -1509,7 +1526,7 @@ int message_box(GtkWidget *parent, const char *title, const char *msg,
1509 gtk_window_set_title(GTK_WINDOW(window), title); 1526 gtk_window_set_title(GTK_WINDOW(window), title);
1510 ret = gtk_dialog_run(GTK_DIALOG(window)); 1527 ret = gtk_dialog_run(GTK_DIALOG(window));
1511 gtk_widget_destroy(window); 1528 gtk_widget_destroy(window);
1512 return (type == MB_OK ? TRUE : (ret == GTK_RESPONSE_YES)); 1529 return (type == MB_OK ? true : (ret == GTK_RESPONSE_YES));
1513} 1530}
1514#else /* GTK_CHECK_VERSION(3,0,0) */ 1531#else /* GTK_CHECK_VERSION(3,0,0) */
1515static void msgbox_button_clicked(GtkButton *button, gpointer data) 1532static void msgbox_button_clicked(GtkButton *button, gpointer data)
@@ -1524,8 +1541,8 @@ static void msgbox_button_clicked(GtkButton *button, gpointer data)
1524 gtk_widget_destroy(GTK_WIDGET(data)); 1541 gtk_widget_destroy(GTK_WIDGET(data));
1525} 1542}
1526 1543
1527int message_box(GtkWidget *parent, const char *title, const char *msg, 1544bool message_box(GtkWidget *parent, const char *title, const char *msg,
1528 int centre, int type) 1545 bool centre, int type)
1529{ 1546{
1530 GtkWidget *window, *hbox, *text, *button; 1547 GtkWidget *window, *hbox, *text, *button;
1531 char *titles; 1548 char *titles;
@@ -1534,15 +1551,15 @@ int message_box(GtkWidget *parent, const char *title, const char *msg,
1534 window = gtk_dialog_new(); 1551 window = gtk_dialog_new();
1535 text = gtk_label_new(msg); 1552 text = gtk_label_new(msg);
1536 align_label(GTK_LABEL(text), 0.0, 0.0); 1553 align_label(GTK_LABEL(text), 0.0, 0.0);
1537 hbox = gtk_hbox_new(FALSE, 0); 1554 hbox = gtk_hbox_new(false, 0);
1538 gtk_box_pack_start(GTK_BOX(hbox), text, FALSE, FALSE, 20); 1555 gtk_box_pack_start(GTK_BOX(hbox), text, false, false, 20);
1539 gtk_box_pack_start 1556 gtk_box_pack_start
1540 (GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(window))), 1557 (GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(window))),
1541 hbox, FALSE, FALSE, 20); 1558 hbox, false, false, 20);
1542 gtk_widget_show(text); 1559 gtk_widget_show(text);
1543 gtk_widget_show(hbox); 1560 gtk_widget_show(hbox);
1544 gtk_window_set_title(GTK_WINDOW(window), title); 1561 gtk_window_set_title(GTK_WINDOW(window), title);
1545 gtk_label_set_line_wrap(GTK_LABEL(text), TRUE); 1562 gtk_label_set_line_wrap(GTK_LABEL(text), true);
1546 1563
1547 if (type == MB_OK) { 1564 if (type == MB_OK) {
1548 titles = LABEL_OK "\0"; 1565 titles = LABEL_OK "\0";
@@ -1559,10 +1576,10 @@ int message_box(GtkWidget *parent, const char *title, const char *msg,
1559 button = gtk_button_new_with_our_label(titles); 1576 button = gtk_button_new_with_our_label(titles);
1560 gtk_box_pack_end 1577 gtk_box_pack_end
1561 (GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(window))), 1578 (GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(window))),
1562 button, FALSE, FALSE, 0); 1579 button, false, false, 0);
1563 gtk_widget_show(button); 1580 gtk_widget_show(button);
1564 if (i == def) { 1581 if (i == def) {
1565 gtk_widget_set_can_default(button, TRUE); 1582 gtk_widget_set_can_default(button, true);
1566 gtk_window_set_default(GTK_WINDOW(window), button); 1583 gtk_window_set_default(GTK_WINDOW(window), button);
1567 } 1584 }
1568 if (i == cancel) { 1585 if (i == cancel) {
@@ -1579,19 +1596,19 @@ int message_box(GtkWidget *parent, const char *title, const char *msg,
1579 g_object_set_data(G_OBJECT(window), "user-data", &i); 1596 g_object_set_data(G_OBJECT(window), "user-data", &i);
1580 g_signal_connect(G_OBJECT(window), "destroy", 1597 g_signal_connect(G_OBJECT(window), "destroy",
1581 G_CALLBACK(window_destroy), NULL); 1598 G_CALLBACK(window_destroy), NULL);
1582 gtk_window_set_modal(GTK_WINDOW(window), TRUE); 1599 gtk_window_set_modal(GTK_WINDOW(window), true);
1583 gtk_window_set_transient_for(GTK_WINDOW(window), GTK_WINDOW(parent)); 1600 gtk_window_set_transient_for(GTK_WINDOW(window), GTK_WINDOW(parent));
1584 /* set_transient_window_pos(parent, window); */ 1601 /* set_transient_window_pos(parent, window); */
1585 gtk_widget_show(window); 1602 gtk_widget_show(window);
1586 i = -1; 1603 i = -1;
1587 gtk_main(); 1604 gtk_main();
1588 return (type == MB_YESNO ? i == 1 : TRUE); 1605 return (type == MB_YESNO ? i == 1 : true);
1589} 1606}
1590#endif /* GTK_CHECK_VERSION(3,0,0) */ 1607#endif /* GTK_CHECK_VERSION(3,0,0) */
1591 1608
1592void error_box(GtkWidget *parent, const char *msg) 1609void error_box(GtkWidget *parent, const char *msg)
1593{ 1610{
1594 message_box(parent, "Error", msg, FALSE, MB_OK); 1611 message_box(parent, "Error", msg, false, MB_OK);
1595} 1612}
1596 1613
1597static void config_ok_button_clicked(GtkButton *button, gpointer data) 1614static void config_ok_button_clicked(GtkButton *button, gpointer data)
@@ -1604,7 +1621,7 @@ static void config_ok_button_clicked(GtkButton *button, gpointer data)
1604 if (err) 1621 if (err)
1605 error_box(fe->cfgbox, err); 1622 error_box(fe->cfgbox, err);
1606 else { 1623 else {
1607 fe->cfgret = TRUE; 1624 fe->cfgret = true;
1608 gtk_widget_destroy(fe->cfgbox); 1625 gtk_widget_destroy(fe->cfgbox);
1609 changed_preset(fe); 1626 changed_preset(fe);
1610 } 1627 }
@@ -1617,7 +1634,7 @@ static void config_cancel_button_clicked(GtkButton *button, gpointer data)
1617 gtk_widget_destroy(fe->cfgbox); 1634 gtk_widget_destroy(fe->cfgbox);
1618} 1635}
1619 1636
1620static int editbox_key(GtkWidget *widget, GdkEventKey *event, gpointer data) 1637static gint editbox_key(GtkWidget *widget, GdkEventKey *event, gpointer data)
1621{ 1638{
1622 /* 1639 /*
1623 * GtkEntry has a nasty habit of eating the Return key, which 1640 * GtkEntry has a nasty habit of eating the Return key, which
@@ -1636,7 +1653,7 @@ static int editbox_key(GtkWidget *widget, GdkEventKey *event, gpointer data)
1636 "key_press_event", event, &return_val); 1653 "key_press_event", event, &return_val);
1637 return return_val; 1654 return return_val;
1638 } 1655 }
1639 return FALSE; 1656 return false;
1640} 1657}
1641 1658
1642static void editbox_changed(GtkEditable *ed, gpointer data) 1659static void editbox_changed(GtkEditable *ed, gpointer data)
@@ -1664,7 +1681,7 @@ static void droplist_sel(GtkComboBox *combo, gpointer data)
1664 i->u.choices.selected = gtk_combo_box_get_active(combo); 1681 i->u.choices.selected = gtk_combo_box_get_active(combo);
1665} 1682}
1666 1683
1667static int get_config(frontend *fe, int which) 1684static bool get_config(frontend *fe, int which)
1668{ 1685{
1669 GtkWidget *w, *table, *cancel; 1686 GtkWidget *w, *table, *cancel;
1670 GtkBox *content_box, *button_box; 1687 GtkBox *content_box, *button_box;
@@ -1674,22 +1691,22 @@ static int get_config(frontend *fe, int which)
1674 1691
1675 fe->cfg = midend_get_config(fe->me, which, &title); 1692 fe->cfg = midend_get_config(fe->me, which, &title);
1676 fe->cfg_which = which; 1693 fe->cfg_which = which;
1677 fe->cfgret = FALSE; 1694 fe->cfgret = false;
1678 1695
1679#if GTK_CHECK_VERSION(3,0,0) 1696#if GTK_CHECK_VERSION(3,0,0)
1680 /* GtkDialog isn't quite flexible enough */ 1697 /* GtkDialog isn't quite flexible enough */
1681 fe->cfgbox = gtk_window_new(GTK_WINDOW_TOPLEVEL); 1698 fe->cfgbox = gtk_window_new(GTK_WINDOW_TOPLEVEL);
1682 content_box = GTK_BOX(gtk_vbox_new(FALSE, 8)); 1699 content_box = GTK_BOX(gtk_vbox_new(false, 8));
1683 g_object_set(G_OBJECT(content_box), "margin", 8, (const char *)NULL); 1700 g_object_set(G_OBJECT(content_box), "margin", 8, (const char *)NULL);
1684 gtk_widget_show(GTK_WIDGET(content_box)); 1701 gtk_widget_show(GTK_WIDGET(content_box));
1685 gtk_container_add(GTK_CONTAINER(fe->cfgbox), GTK_WIDGET(content_box)); 1702 gtk_container_add(GTK_CONTAINER(fe->cfgbox), GTK_WIDGET(content_box));
1686 button_box = GTK_BOX(gtk_hbox_new(FALSE, 8)); 1703 button_box = GTK_BOX(gtk_hbox_new(false, 8));
1687 gtk_widget_show(GTK_WIDGET(button_box)); 1704 gtk_widget_show(GTK_WIDGET(button_box));
1688 gtk_box_pack_end(content_box, GTK_WIDGET(button_box), FALSE, FALSE, 0); 1705 gtk_box_pack_end(content_box, GTK_WIDGET(button_box), false, false, 0);
1689 { 1706 {
1690 GtkWidget *sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); 1707 GtkWidget *sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
1691 gtk_widget_show(sep); 1708 gtk_widget_show(sep);
1692 gtk_box_pack_end(content_box, sep, FALSE, FALSE, 0); 1709 gtk_box_pack_end(content_box, sep, false, false, 0);
1693 } 1710 }
1694#else 1711#else
1695 fe->cfgbox = gtk_dialog_new(); 1712 fe->cfgbox = gtk_dialog_new();
@@ -1700,16 +1717,16 @@ static int get_config(frontend *fe, int which)
1700 sfree(title); 1717 sfree(title);
1701 1718
1702 w = gtk_button_new_with_our_label(LABEL_CANCEL); 1719 w = gtk_button_new_with_our_label(LABEL_CANCEL);
1703 gtk_box_pack_end(button_box, w, FALSE, FALSE, 0); 1720 gtk_box_pack_end(button_box, w, false, false, 0);
1704 gtk_widget_show(w); 1721 gtk_widget_show(w);
1705 g_signal_connect(G_OBJECT(w), "clicked", 1722 g_signal_connect(G_OBJECT(w), "clicked",
1706 G_CALLBACK(config_cancel_button_clicked), fe); 1723 G_CALLBACK(config_cancel_button_clicked), fe);
1707 cancel = w; 1724 cancel = w;
1708 1725
1709 w = gtk_button_new_with_our_label(LABEL_OK); 1726 w = gtk_button_new_with_our_label(LABEL_OK);
1710 gtk_box_pack_end(button_box, w, FALSE, FALSE, 0); 1727 gtk_box_pack_end(button_box, w, false, false, 0);
1711 gtk_widget_show(w); 1728 gtk_widget_show(w);
1712 gtk_widget_set_can_default(w, TRUE); 1729 gtk_widget_set_can_default(w, true);
1713 gtk_window_set_default(GTK_WINDOW(fe->cfgbox), w); 1730 gtk_window_set_default(GTK_WINDOW(fe->cfgbox), w);
1714 g_signal_connect(G_OBJECT(w), "clicked", 1731 g_signal_connect(G_OBJECT(w), "clicked",
1715 G_CALLBACK(config_ok_button_clicked), fe); 1732 G_CALLBACK(config_ok_button_clicked), fe);
@@ -1717,10 +1734,10 @@ static int get_config(frontend *fe, int which)
1717#if GTK_CHECK_VERSION(3,0,0) 1734#if GTK_CHECK_VERSION(3,0,0)
1718 table = gtk_grid_new(); 1735 table = gtk_grid_new();
1719#else 1736#else
1720 table = gtk_table_new(1, 2, FALSE); 1737 table = gtk_table_new(1, 2, false);
1721#endif 1738#endif
1722 y = 0; 1739 y = 0;
1723 gtk_box_pack_start(content_box, table, FALSE, FALSE, 0); 1740 gtk_box_pack_start(content_box, table, false, false, 0);
1724 gtk_widget_show(table); 1741 gtk_widget_show(table);
1725 1742
1726 for (i = fe->cfg; i->type != C_END; i++) { 1743 for (i = fe->cfg; i->type != C_END; i++) {
@@ -1749,7 +1766,7 @@ static int get_config(frontend *fe, int which)
1749 w = gtk_entry_new(); 1766 w = gtk_entry_new();
1750#if GTK_CHECK_VERSION(3,0,0) 1767#if GTK_CHECK_VERSION(3,0,0)
1751 gtk_grid_attach(GTK_GRID(table), w, 1, y, 1, 1); 1768 gtk_grid_attach(GTK_GRID(table), w, 1, y, 1, 1);
1752 g_object_set(G_OBJECT(w), "hexpand", TRUE, (const char *)NULL); 1769 g_object_set(G_OBJECT(w), "hexpand", true, (const char *)NULL);
1753#else 1770#else
1754 gtk_table_attach(GTK_TABLE(table), w, 1, 2, y, y+1, 1771 gtk_table_attach(GTK_TABLE(table), w, 1, 2, y, y+1,
1755 GTK_EXPAND | GTK_SHRINK | GTK_FILL, 1772 GTK_EXPAND | GTK_SHRINK | GTK_FILL,
@@ -1774,7 +1791,7 @@ static int get_config(frontend *fe, int which)
1774 G_CALLBACK(button_toggled), i); 1791 G_CALLBACK(button_toggled), i);
1775#if GTK_CHECK_VERSION(3,0,0) 1792#if GTK_CHECK_VERSION(3,0,0)
1776 gtk_grid_attach(GTK_GRID(table), w, 0, y, 2, 1); 1793 gtk_grid_attach(GTK_GRID(table), w, 0, y, 2, 1);
1777 g_object_set(G_OBJECT(w), "hexpand", TRUE, (const char *)NULL); 1794 g_object_set(G_OBJECT(w), "hexpand", true, (const char *)NULL);
1778#else 1795#else
1779 gtk_table_attach(GTK_TABLE(table), w, 0, 2, y, y+1, 1796 gtk_table_attach(GTK_TABLE(table), w, 0, 2, y, y+1,
1780 GTK_EXPAND | GTK_SHRINK | GTK_FILL, 1797 GTK_EXPAND | GTK_SHRINK | GTK_FILL,
@@ -1839,7 +1856,7 @@ static int get_config(frontend *fe, int which)
1839 i->u.choices.selected); 1856 i->u.choices.selected);
1840 1857
1841 cr = gtk_cell_renderer_text_new(); 1858 cr = gtk_cell_renderer_text_new();
1842 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(w), cr, TRUE); 1859 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(w), cr, true);
1843 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(w), cr, 1860 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(w), cr,
1844 "text", 0, NULL); 1861 "text", 0, NULL);
1845 1862
@@ -1849,7 +1866,7 @@ static int get_config(frontend *fe, int which)
1849 1866
1850#if GTK_CHECK_VERSION(3,0,0) 1867#if GTK_CHECK_VERSION(3,0,0)
1851 gtk_grid_attach(GTK_GRID(table), w, 1, y, 1, 1); 1868 gtk_grid_attach(GTK_GRID(table), w, 1, y, 1, 1);
1852 g_object_set(G_OBJECT(w), "hexpand", TRUE, (const char *)NULL); 1869 g_object_set(G_OBJECT(w), "hexpand", true, (const char *)NULL);
1853#else 1870#else
1854 gtk_table_attach(GTK_TABLE(table), w, 1, 2, y, y+1, 1871 gtk_table_attach(GTK_TABLE(table), w, 1, 2, y, y+1,
1855 GTK_EXPAND | GTK_SHRINK | GTK_FILL, 1872 GTK_EXPAND | GTK_SHRINK | GTK_FILL,
@@ -1867,7 +1884,7 @@ static int get_config(frontend *fe, int which)
1867 G_CALLBACK(window_destroy), NULL); 1884 G_CALLBACK(window_destroy), NULL);
1868 g_signal_connect(G_OBJECT(fe->cfgbox), "key_press_event", 1885 g_signal_connect(G_OBJECT(fe->cfgbox), "key_press_event",
1869 G_CALLBACK(win_key_press), cancel); 1886 G_CALLBACK(win_key_press), cancel);
1870 gtk_window_set_modal(GTK_WINDOW(fe->cfgbox), TRUE); 1887 gtk_window_set_modal(GTK_WINDOW(fe->cfgbox), true);
1871 gtk_window_set_transient_for(GTK_WINDOW(fe->cfgbox), 1888 gtk_window_set_transient_for(GTK_WINDOW(fe->cfgbox),
1872 GTK_WINDOW(fe->window)); 1889 GTK_WINDOW(fe->window));
1873 /* set_transient_window_pos(fe->window, fe->cfgbox); */ 1890 /* set_transient_window_pos(fe->window, fe->cfgbox); */
@@ -1906,7 +1923,7 @@ static void get_size(frontend *fe, int *px, int *py)
1906 */ 1923 */
1907 x = INT_MAX; 1924 x = INT_MAX;
1908 y = INT_MAX; 1925 y = INT_MAX;
1909 midend_size(fe->me, &x, &y, FALSE); 1926 midend_size(fe->me, &x, &y, false);
1910 *px = x; 1927 *px = x;
1911 *py = y; 1928 *py = y;
1912} 1929}
@@ -1924,11 +1941,11 @@ static void changed_preset(frontend *fe)
1924{ 1941{
1925 int n = midend_which_preset(fe->me); 1942 int n = midend_which_preset(fe->me);
1926 1943
1927 fe->preset_threaded = TRUE; 1944 fe->preset_threaded = true;
1928 if (n < 0 && fe->preset_custom) { 1945 if (n < 0 && fe->preset_custom) {
1929 gtk_check_menu_item_set_active( 1946 gtk_check_menu_item_set_active(
1930 GTK_CHECK_MENU_ITEM(fe->preset_custom), 1947 GTK_CHECK_MENU_ITEM(fe->preset_custom),
1931 TRUE); 1948 true);
1932 } else { 1949 } else {
1933 GSList *gs = fe->preset_radio; 1950 GSList *gs = fe->preset_radio;
1934 GSList *found = NULL; 1951 GSList *found = NULL;
@@ -1939,27 +1956,27 @@ static void changed_preset(frontend *fe)
1939 G_OBJECT(gs->data), "user-data"); 1956 G_OBJECT(gs->data), "user-data");
1940 if (!entry || entry->id != n) 1957 if (!entry || entry->id != n)
1941 gtk_check_menu_item_set_active( 1958 gtk_check_menu_item_set_active(
1942 GTK_CHECK_MENU_ITEM(gs->data), FALSE); 1959 GTK_CHECK_MENU_ITEM(gs->data), false);
1943 else 1960 else
1944 found = gs; 1961 found = gs;
1945 } 1962 }
1946 if (found) 1963 if (found)
1947 gtk_check_menu_item_set_active( 1964 gtk_check_menu_item_set_active(
1948 GTK_CHECK_MENU_ITEM(found->data), TRUE); 1965 GTK_CHECK_MENU_ITEM(found->data), true);
1949 } 1966 }
1950 fe->preset_threaded = FALSE; 1967 fe->preset_threaded = false;
1951 1968
1952 /* 1969 /*
1953 * Update the greying on the Copy menu option. 1970 * Update the greying on the Copy menu option.
1954 */ 1971 */
1955 if (fe->copy_menu_item) { 1972 if (fe->copy_menu_item) {
1956 int enabled = midend_can_format_as_text_now(fe->me); 1973 bool enabled = midend_can_format_as_text_now(fe->me);
1957 gtk_widget_set_sensitive(fe->copy_menu_item, enabled); 1974 gtk_widget_set_sensitive(fe->copy_menu_item, enabled);
1958 } 1975 }
1959} 1976}
1960 1977
1961#if !GTK_CHECK_VERSION(3,0,0) 1978#if !GTK_CHECK_VERSION(3,0,0)
1962static gboolean not_size_allocated_yet(GtkWidget *w) 1979static bool not_size_allocated_yet(GtkWidget *w)
1963{ 1980{
1964 /* 1981 /*
1965 * This function tests whether a widget has not yet taken up space 1982 * This function tests whether a widget has not yet taken up space
@@ -1969,18 +1986,18 @@ static gboolean not_size_allocated_yet(GtkWidget *w)
1969 * space it ever will.) 1986 * space it ever will.)
1970 */ 1987 */
1971 if (!w) 1988 if (!w)
1972 return FALSE; /* nonexistent widgets aren't a problem */ 1989 return false; /* nonexistent widgets aren't a problem */
1973 1990
1974#if GTK_CHECK_VERSION(2,18,0) /* skip if no gtk_widget_get_allocation */ 1991#if GTK_CHECK_VERSION(2,18,0) /* skip if no gtk_widget_get_allocation */
1975 { 1992 {
1976 GtkAllocation a; 1993 GtkAllocation a;
1977 gtk_widget_get_allocation(w, &a); 1994 gtk_widget_get_allocation(w, &a);
1978 if (a.height == 0 || a.width == 0) 1995 if (a.height == 0 || a.width == 0)
1979 return TRUE; /* widget exists but has no size yet */ 1996 return true; /* widget exists but has no size yet */
1980 } 1997 }
1981#endif 1998#endif
1982 1999
1983 return FALSE; 2000 return false;
1984} 2001}
1985 2002
1986static void try_shrink_drawing_area(frontend *fe) 2003static void try_shrink_drawing_area(frontend *fe)
@@ -2004,7 +2021,7 @@ static void try_shrink_drawing_area(frontend *fe)
2004 * shrinking to less than the size we intended. 2021 * shrinking to less than the size we intended.
2005 */ 2022 */
2006 gtk_drawing_area_size(GTK_DRAWING_AREA(fe->area), 1, 1); 2023 gtk_drawing_area_size(GTK_DRAWING_AREA(fe->area), 1, 1);
2007 fe->drawing_area_shrink_pending = FALSE; 2024 fe->drawing_area_shrink_pending = false;
2008 } 2025 }
2009} 2026}
2010#endif /* !GTK_CHECK_VERSION(3,0,0) */ 2027#endif /* !GTK_CHECK_VERSION(3,0,0) */
@@ -2022,7 +2039,7 @@ static gint configure_window(GtkWidget *widget,
2022 frontend *fe = (frontend *)data; 2039 frontend *fe = (frontend *)data;
2023 try_shrink_drawing_area(fe); 2040 try_shrink_drawing_area(fe);
2024#endif 2041#endif
2025 return FALSE; 2042 return false;
2026} 2043}
2027 2044
2028#if GTK_CHECK_VERSION(3,0,0) 2045#if GTK_CHECK_VERSION(3,0,0)
@@ -2051,16 +2068,16 @@ static void resize_fe(frontend *fe)
2051 2068
2052#if GTK_CHECK_VERSION(3,0,0) 2069#if GTK_CHECK_VERSION(3,0,0)
2053 gtk_window_resize(GTK_WINDOW(fe->window), x, y + window_extra_height(fe)); 2070 gtk_window_resize(GTK_WINDOW(fe->window), x, y + window_extra_height(fe));
2054 fe->awaiting_resize_ack = TRUE; 2071 fe->awaiting_resize_ack = true;
2055#else 2072#else
2056 fe->drawing_area_shrink_pending = FALSE; 2073 fe->drawing_area_shrink_pending = false;
2057 gtk_drawing_area_size(GTK_DRAWING_AREA(fe->area), x, y); 2074 gtk_drawing_area_size(GTK_DRAWING_AREA(fe->area), x, y);
2058 { 2075 {
2059 GtkRequisition req; 2076 GtkRequisition req;
2060 gtk_widget_size_request(GTK_WIDGET(fe->window), &req); 2077 gtk_widget_size_request(GTK_WIDGET(fe->window), &req);
2061 gtk_window_resize(GTK_WINDOW(fe->window), req.width, req.height); 2078 gtk_window_resize(GTK_WINDOW(fe->window), req.width, req.height);
2062 } 2079 }
2063 fe->drawing_area_shrink_pending = TRUE; 2080 fe->drawing_area_shrink_pending = true;
2064 try_shrink_drawing_area(fe); 2081 try_shrink_drawing_area(fe);
2065#endif 2082#endif
2066} 2083}
@@ -2084,14 +2101,14 @@ static void menu_preset_event(GtkMenuItem *menuitem, gpointer data)
2084} 2101}
2085 2102
2086GdkAtom compound_text_atom, utf8_string_atom; 2103GdkAtom compound_text_atom, utf8_string_atom;
2087int paste_initialised = FALSE; 2104bool paste_initialised = false;
2088 2105
2089static void set_selection(frontend *fe, GdkAtom selection) 2106static void set_selection(frontend *fe, GdkAtom selection)
2090{ 2107{
2091 if (!paste_initialised) { 2108 if (!paste_initialised) {
2092 compound_text_atom = gdk_atom_intern("COMPOUND_TEXT", FALSE); 2109 compound_text_atom = gdk_atom_intern("COMPOUND_TEXT", false);
2093 utf8_string_atom = gdk_atom_intern("UTF8_STRING", FALSE); 2110 utf8_string_atom = gdk_atom_intern("UTF8_STRING", false);
2094 paste_initialised = TRUE; 2111 paste_initialised = true;
2095 } 2112 }
2096 2113
2097 /* 2114 /*
@@ -2139,7 +2156,7 @@ gint selection_clear(GtkWidget *widget, GdkEventSelection *seldata,
2139 sfree(fe->paste_data); 2156 sfree(fe->paste_data);
2140 fe->paste_data = NULL; 2157 fe->paste_data = NULL;
2141 fe->paste_data_len = 0; 2158 fe->paste_data_len = 0;
2142 return TRUE; 2159 return true;
2143} 2160}
2144 2161
2145static void menu_copy_event(GtkMenuItem *menuitem, gpointer data) 2162static void menu_copy_event(GtkMenuItem *menuitem, gpointer data)
@@ -2177,7 +2194,7 @@ static char *file_selector(frontend *fe, const char *title, int save)
2177 2194
2178 fe->filesel_name = NULL; 2195 fe->filesel_name = NULL;
2179 2196
2180 gtk_window_set_modal(GTK_WINDOW(filesel), TRUE); 2197 gtk_window_set_modal(GTK_WINDOW(filesel), true);
2181 g_object_set_data 2198 g_object_set_data
2182 (G_OBJECT(GTK_FILE_SELECTION(filesel)->ok_button), "user-data", 2199 (G_OBJECT(GTK_FILE_SELECTION(filesel)->ok_button), "user-data",
2183 (gpointer)filesel); 2200 (gpointer)filesel);
@@ -2201,7 +2218,7 @@ static char *file_selector(frontend *fe, const char *title, int save)
2201 2218
2202#else 2219#else
2203 2220
2204static char *file_selector(frontend *fe, const char *title, int save) 2221static char *file_selector(frontend *fe, const char *title, bool save)
2205{ 2222{
2206 char *filesel_name = NULL; 2223 char *filesel_name = NULL;
2207 2224
@@ -2240,7 +2257,7 @@ static void savefile_write(void *wctx, const void *buf, int len)
2240 ctx->error = errno; 2257 ctx->error = errno;
2241} 2258}
2242 2259
2243static int savefile_read(void *wctx, void *buf, int len) 2260static bool savefile_read(void *wctx, void *buf, int len)
2244{ 2261{
2245 FILE *fp = (FILE *)wctx; 2262 FILE *fp = (FILE *)wctx;
2246 int ret; 2263 int ret;
@@ -2254,7 +2271,7 @@ static void menu_save_event(GtkMenuItem *menuitem, gpointer data)
2254 frontend *fe = (frontend *)data; 2271 frontend *fe = (frontend *)data;
2255 char *name; 2272 char *name;
2256 2273
2257 name = file_selector(fe, "Enter name of game file to save", TRUE); 2274 name = file_selector(fe, "Enter name of game file to save", true);
2258 2275
2259 if (name) { 2276 if (name) {
2260 FILE *fp; 2277 FILE *fp;
@@ -2267,7 +2284,7 @@ static void menu_save_event(GtkMenuItem *menuitem, gpointer data)
2267 sprintf(buf, "Are you sure you want to overwrite the" 2284 sprintf(buf, "Are you sure you want to overwrite the"
2268 " file \"%.*s\"?", 2285 " file \"%.*s\"?",
2269 FILENAME_MAX, name); 2286 FILENAME_MAX, name);
2270 if (!message_box(fe->window, "Question", buf, TRUE, MB_YESNO)) 2287 if (!message_box(fe->window, "Question", buf, true, MB_YESNO))
2271 goto free_and_return; 2288 goto free_and_return;
2272 } 2289 }
2273 2290
@@ -2287,7 +2304,7 @@ static void menu_save_event(GtkMenuItem *menuitem, gpointer data)
2287 if (ctx.error) { 2304 if (ctx.error) {
2288 char boxmsg[512]; 2305 char boxmsg[512];
2289 sprintf(boxmsg, "Error writing save file: %.400s", 2306 sprintf(boxmsg, "Error writing save file: %.400s",
2290 strerror(errno)); 2307 strerror(ctx.error));
2291 error_box(fe->window, boxmsg); 2308 error_box(fe->window, boxmsg);
2292 goto free_and_return; 2309 goto free_and_return;
2293 } 2310 }
@@ -2303,7 +2320,7 @@ static void menu_load_event(GtkMenuItem *menuitem, gpointer data)
2303 char *name; 2320 char *name;
2304 const char *err; 2321 const char *err;
2305 2322
2306 name = file_selector(fe, "Enter name of saved game file to load", FALSE); 2323 name = file_selector(fe, "Enter name of saved game file to load", false);
2307 2324
2308 if (name) { 2325 if (name) {
2309 FILE *fp = fopen(name, "r"); 2326 FILE *fp = fopen(name, "r");
@@ -2393,7 +2410,7 @@ static void menu_about_event(GtkMenuItem *menuitem, gpointer data)
2393 "from Simon Tatham's Portable Puzzle Collection\n\n" 2410 "from Simon Tatham's Portable Puzzle Collection\n\n"
2394 "%.500s", thegame.name, ver); 2411 "%.500s", thegame.name, ver);
2395 2412
2396 message_box(fe->window, titlebuf, textbuf, TRUE, MB_OK); 2413 message_box(fe->window, titlebuf, textbuf, true, MB_OK);
2397#endif 2414#endif
2398} 2415}
2399 2416
@@ -2468,7 +2485,8 @@ static void populate_gtk_preset_menu(frontend *fe, struct preset_menu *menu,
2468 2485
2469enum { ARG_EITHER, ARG_SAVE, ARG_ID }; /* for argtype */ 2486enum { ARG_EITHER, ARG_SAVE, ARG_ID }; /* for argtype */
2470 2487
2471static frontend *new_window(char *arg, int argtype, char **error) 2488static frontend *new_window(
2489 char *arg, int argtype, char **error, bool headless)
2472{ 2490{
2473 frontend *fe; 2491 frontend *fe;
2474 GtkBox *vbox, *hbox; 2492 GtkBox *vbox, *hbox;
@@ -2481,11 +2499,18 @@ static frontend *new_window(char *arg, int argtype, char **error)
2481 struct preset_menu *preset_menu; 2499 struct preset_menu *preset_menu;
2482 2500
2483 fe = snew(frontend); 2501 fe = snew(frontend);
2484#if GTK_CHECK_VERSION(3,20,0) 2502 memset(fe, 0, sizeof(frontend));
2485 fe->css_provider = NULL; 2503
2504#if !GTK_CHECK_VERSION(3,0,0)
2505 if (headless) {
2506 fprintf(stderr, "headless mode not supported below GTK 3\n");
2507 exit(1);
2508 }
2509#else
2510 fe->headless = headless;
2486#endif 2511#endif
2487 2512
2488 fe->timer_active = FALSE; 2513 fe->timer_active = false;
2489 fe->timer_id = -1; 2514 fe->timer_id = -1;
2490 2515
2491 fe->me = midend_new(fe, &thegame, &gtk_drawing, fe); 2516 fe->me = midend_new(fe, &thegame, &gtk_drawing, fe);
@@ -2550,6 +2575,13 @@ static frontend *new_window(char *arg, int argtype, char **error)
2550 midend_new_game(fe->me); 2575 midend_new_game(fe->me);
2551 } 2576 }
2552 2577
2578 if (headless) {
2579 snaffle_colours(fe);
2580 get_size(fe, &fe->pw, &fe->ph);
2581 setup_backing_store(fe);
2582 return fe;
2583 }
2584
2553#if !GTK_CHECK_VERSION(3,0,0) 2585#if !GTK_CHECK_VERSION(3,0,0)
2554 { 2586 {
2555 /* 2587 /*
@@ -2568,7 +2600,7 @@ static frontend *new_window(char *arg, int argtype, char **error)
2568 GtkSettings *settings = gtk_settings_get_default(); 2600 GtkSettings *settings = gtk_settings_get_default();
2569 if (!g_object_class_find_property(G_OBJECT_GET_CLASS(settings), 2601 if (!g_object_class_find_property(G_OBJECT_GET_CLASS(settings),
2570 prop)) { 2602 prop)) {
2571 fe->menubar_is_local = TRUE; 2603 fe->menubar_is_local = true;
2572 } else { 2604 } else {
2573 int unity_mode; 2605 int unity_mode;
2574 g_object_get(gtk_settings_get_default(), 2606 g_object_get(gtk_settings_get_default(),
@@ -2580,13 +2612,13 @@ static frontend *new_window(char *arg, int argtype, char **error)
2580#endif 2612#endif
2581 2613
2582#if GTK_CHECK_VERSION(3,0,0) 2614#if GTK_CHECK_VERSION(3,0,0)
2583 fe->awaiting_resize_ack = FALSE; 2615 fe->awaiting_resize_ack = false;
2584#endif 2616#endif
2585 2617
2586 fe->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); 2618 fe->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
2587 gtk_window_set_title(GTK_WINDOW(fe->window), thegame.name); 2619 gtk_window_set_title(GTK_WINDOW(fe->window), thegame.name);
2588 2620
2589 vbox = GTK_BOX(gtk_vbox_new(FALSE, 0)); 2621 vbox = GTK_BOX(gtk_vbox_new(false, 0));
2590 gtk_container_add(GTK_CONTAINER(fe->window), GTK_WIDGET(vbox)); 2622 gtk_container_add(GTK_CONTAINER(fe->window), GTK_WIDGET(vbox));
2591 gtk_widget_show(GTK_WIDGET(vbox)); 2623 gtk_widget_show(GTK_WIDGET(vbox));
2592 2624
@@ -2596,12 +2628,12 @@ static frontend *new_window(char *arg, int argtype, char **error)
2596 * gtk_window_add_accel_group; see menu_key_event 2628 * gtk_window_add_accel_group; see menu_key_event
2597 */ 2629 */
2598 2630
2599 hbox = GTK_BOX(gtk_hbox_new(FALSE, 0)); 2631 hbox = GTK_BOX(gtk_hbox_new(false, 0));
2600 gtk_box_pack_start(vbox, GTK_WIDGET(hbox), FALSE, FALSE, 0); 2632 gtk_box_pack_start(vbox, GTK_WIDGET(hbox), false, false, 0);
2601 gtk_widget_show(GTK_WIDGET(hbox)); 2633 gtk_widget_show(GTK_WIDGET(hbox));
2602 2634
2603 fe->menubar = gtk_menu_bar_new(); 2635 fe->menubar = gtk_menu_bar_new();
2604 gtk_box_pack_start(hbox, fe->menubar, TRUE, TRUE, 0); 2636 gtk_box_pack_start(hbox, fe->menubar, true, true, 0);
2605 gtk_widget_show(fe->menubar); 2637 gtk_widget_show(fe->menubar);
2606 2638
2607 menuitem = gtk_menu_item_new_with_mnemonic("_Game"); 2639 menuitem = gtk_menu_item_new_with_mnemonic("_Game");
@@ -2637,7 +2669,7 @@ static frontend *new_window(char *arg, int argtype, char **error)
2637 2669
2638 fe->preset_radio = NULL; 2670 fe->preset_radio = NULL;
2639 fe->preset_custom = NULL; 2671 fe->preset_custom = NULL;
2640 fe->preset_threaded = FALSE; 2672 fe->preset_threaded = false;
2641 2673
2642 preset_menu = midend_get_presets(fe->me, NULL); 2674 preset_menu = midend_get_presets(fe->me, NULL);
2643 if (preset_menu->n_entries > 0 || thegame.can_configure) { 2675 if (preset_menu->n_entries > 0 || thegame.can_configure) {
@@ -2725,7 +2757,7 @@ static frontend *new_window(char *arg, int argtype, char **error)
2725 GINT_TO_POINTER(UI_REDO)); 2757 GINT_TO_POINTER(UI_REDO));
2726 g_signal_connect(G_OBJECT(menuitem), "clicked", 2758 g_signal_connect(G_OBJECT(menuitem), "clicked",
2727 G_CALLBACK(menu_key_event), fe); 2759 G_CALLBACK(menu_key_event), fe);
2728 gtk_box_pack_end(hbox, menuitem, FALSE, FALSE, 0); 2760 gtk_box_pack_end(hbox, menuitem, false, false, 0);
2729 gtk_widget_show(menuitem); 2761 gtk_widget_show(menuitem);
2730 2762
2731 menuitem=gtk_button_new_with_mnemonic("_Undo"); 2763 menuitem=gtk_button_new_with_mnemonic("_Undo");
@@ -2733,12 +2765,12 @@ static frontend *new_window(char *arg, int argtype, char **error)
2733 GINT_TO_POINTER(UI_UNDO)); 2765 GINT_TO_POINTER(UI_UNDO));
2734 g_signal_connect(G_OBJECT(menuitem), "clicked", 2766 g_signal_connect(G_OBJECT(menuitem), "clicked",
2735 G_CALLBACK(menu_key_event), fe); 2767 G_CALLBACK(menu_key_event), fe);
2736 gtk_box_pack_end(hbox, menuitem, FALSE, FALSE, 0); 2768 gtk_box_pack_end(hbox, menuitem, false, false, 0);
2737 gtk_widget_show(menuitem); 2769 gtk_widget_show(menuitem);
2738 2770
2739 if (thegame.flags & REQUIRE_NUMPAD) { 2771 if (thegame.flags & REQUIRE_NUMPAD) {
2740 hbox = GTK_BOX(gtk_hbox_new(FALSE, 0)); 2772 hbox = GTK_BOX(gtk_hbox_new(false, 0));
2741 gtk_box_pack_start(vbox, GTK_WIDGET(hbox), FALSE, FALSE, 0); 2773 gtk_box_pack_start(vbox, GTK_WIDGET(hbox), false, false, 0);
2742 gtk_widget_show(GTK_WIDGET(hbox)); 2774 gtk_widget_show(GTK_WIDGET(hbox));
2743 2775
2744 *((int*)errbuf)=0; 2776 *((int*)errbuf)=0;
@@ -2749,7 +2781,7 @@ static frontend *new_window(char *arg, int argtype, char **error)
2749 GINT_TO_POINTER((int)(errbuf[0]))); 2781 GINT_TO_POINTER((int)(errbuf[0])));
2750 g_signal_connect(G_OBJECT(menuitem), "clicked", 2782 g_signal_connect(G_OBJECT(menuitem), "clicked",
2751 G_CALLBACK(menu_key_event), fe); 2783 G_CALLBACK(menu_key_event), fe);
2752 gtk_box_pack_start(hbox, menuitem, TRUE, TRUE, 0); 2784 gtk_box_pack_start(hbox, menuitem, true, true, 0);
2753 gtk_widget_show(menuitem); 2785 gtk_widget_show(menuitem);
2754 } 2786 }
2755 } 2787 }
@@ -2768,7 +2800,7 @@ static frontend *new_window(char *arg, int argtype, char **error)
2768 fe->statusbar = gtk_statusbar_new(); 2800 fe->statusbar = gtk_statusbar_new();
2769 gtk_container_add(GTK_CONTAINER(viewport), fe->statusbar); 2801 gtk_container_add(GTK_CONTAINER(viewport), fe->statusbar);
2770 gtk_widget_show(viewport); 2802 gtk_widget_show(viewport);
2771 gtk_box_pack_end(vbox, viewport, FALSE, FALSE, 0); 2803 gtk_box_pack_end(vbox, viewport, false, false, 0);
2772 gtk_widget_show(fe->statusbar); 2804 gtk_widget_show(fe->statusbar);
2773 fe->statusctx = gtk_statusbar_get_context_id 2805 fe->statusctx = gtk_statusbar_get_context_id
2774 (GTK_STATUSBAR(fe->statusbar), "game"); 2806 (GTK_STATUSBAR(fe->statusbar), "game");
@@ -2785,7 +2817,7 @@ static frontend *new_window(char *arg, int argtype, char **error)
2785 2817
2786 fe->area = gtk_drawing_area_new(); 2818 fe->area = gtk_drawing_area_new();
2787#if GTK_CHECK_VERSION(2,0,0) && !GTK_CHECK_VERSION(3,0,0) 2819#if GTK_CHECK_VERSION(2,0,0) && !GTK_CHECK_VERSION(3,0,0)
2788 gtk_widget_set_double_buffered(fe->area, FALSE); 2820 gtk_widget_set_double_buffered(fe->area, false);
2789#endif 2821#endif
2790 { 2822 {
2791 GdkGeometry geom; 2823 GdkGeometry geom;
@@ -2807,11 +2839,11 @@ static frontend *new_window(char *arg, int argtype, char **error)
2807 gtk_window_set_default_size(GTK_WINDOW(fe->window), 2839 gtk_window_set_default_size(GTK_WINDOW(fe->window),
2808 x, y + window_extra_height(fe)); 2840 x, y + window_extra_height(fe));
2809#else 2841#else
2810 fe->drawing_area_shrink_pending = FALSE; 2842 fe->drawing_area_shrink_pending = false;
2811 gtk_drawing_area_size(GTK_DRAWING_AREA(fe->area), x, y); 2843 gtk_drawing_area_size(GTK_DRAWING_AREA(fe->area), x, y);
2812#endif 2844#endif
2813 2845
2814 gtk_box_pack_end(vbox, fe->area, TRUE, TRUE, 0); 2846 gtk_box_pack_end(vbox, fe->area, true, true, 0);
2815 2847
2816 clear_backing_store(fe); 2848 clear_backing_store(fe);
2817 fe->fonts = NULL; 2849 fe->fonts = NULL;
@@ -2877,7 +2909,7 @@ static frontend *new_window(char *arg, int argtype, char **error)
2877 gtk_widget_show(fe->window); 2909 gtk_widget_show(fe->window);
2878 2910
2879#if !GTK_CHECK_VERSION(3,0,0) 2911#if !GTK_CHECK_VERSION(3,0,0)
2880 fe->drawing_area_shrink_pending = TRUE; 2912 fe->drawing_area_shrink_pending = true;
2881 try_shrink_drawing_area(fe); 2913 try_shrink_drawing_area(fe);
2882#endif 2914#endif
2883 2915
@@ -2893,7 +2925,7 @@ static void list_presets_from_menu(struct preset_menu *menu)
2893 for (i = 0; i < menu->n_entries; i++) { 2925 for (i = 0; i < menu->n_entries; i++) {
2894 if (menu->entries[i].params) { 2926 if (menu->entries[i].params) {
2895 char *paramstr = thegame.encode_params( 2927 char *paramstr = thegame.encode_params(
2896 menu->entries[i].params, TRUE); 2928 menu->entries[i].params, true);
2897 printf("%s %s\n", paramstr, menu->entries[i].title); 2929 printf("%s %s\n", paramstr, menu->entries[i].title);
2898 sfree(paramstr); 2930 sfree(paramstr);
2899 } else { 2931 } else {
@@ -2906,16 +2938,17 @@ int main(int argc, char **argv)
2906{ 2938{
2907 char *pname = argv[0]; 2939 char *pname = argv[0];
2908 char *error; 2940 char *error;
2909 int ngenerate = 0, print = FALSE, px = 1, py = 1; 2941 int ngenerate = 0, px = 1, py = 1;
2910 int time_generation = FALSE, test_solve = FALSE, list_presets = FALSE; 2942 bool print = false;
2911 int soln = FALSE, colour = FALSE; 2943 bool time_generation = false, test_solve = false, list_presets = false;
2944 bool soln = false, colour = false;
2912 float scale = 1.0F; 2945 float scale = 1.0F;
2913 float redo_proportion = 0.0F; 2946 float redo_proportion = 0.0F;
2914 const char *savefile = NULL, *savesuffix = NULL; 2947 const char *savefile = NULL, *savesuffix = NULL;
2915 char *arg = NULL; 2948 char *arg = NULL;
2916 int argtype = ARG_EITHER; 2949 int argtype = ARG_EITHER;
2917 char *screenshot_file = NULL; 2950 char *screenshot_file = NULL;
2918 int doing_opts = TRUE; 2951 bool doing_opts = true;
2919 int ac = argc; 2952 int ac = argc;
2920 char **av = argv; 2953 char **av = argv;
2921 char errbuf[500]; 2954 char errbuf[500];
@@ -2961,11 +2994,11 @@ int main(int argc, char **argv)
2961 } else 2994 } else
2962 ngenerate = 1; 2995 ngenerate = 1;
2963 } else if (doing_opts && !strcmp(p, "--time-generation")) { 2996 } else if (doing_opts && !strcmp(p, "--time-generation")) {
2964 time_generation = TRUE; 2997 time_generation = true;
2965 } else if (doing_opts && !strcmp(p, "--test-solve")) { 2998 } else if (doing_opts && !strcmp(p, "--test-solve")) {
2966 test_solve = TRUE; 2999 test_solve = true;
2967 } else if (doing_opts && !strcmp(p, "--list-presets")) { 3000 } else if (doing_opts && !strcmp(p, "--list-presets")) {
2968 list_presets = TRUE; 3001 list_presets = true;
2969 } else if (doing_opts && !strcmp(p, "--save")) { 3002 } else if (doing_opts && !strcmp(p, "--save")) {
2970 if (--ac > 0) { 3003 if (--ac > 0) {
2971 savefile = *++av; 3004 savefile = *++av;
@@ -2989,7 +3022,7 @@ int main(int argc, char **argv)
2989 pname); 3022 pname);
2990 return 1; 3023 return 1;
2991 } 3024 }
2992 print = TRUE; 3025 print = true;
2993 if (--ac > 0) { 3026 if (--ac > 0) {
2994 char *dim = *++av; 3027 char *dim = *++av;
2995 if (sscanf(dim, "%dx%d", &px, &py) != 2) { 3028 if (sscanf(dim, "%dx%d", &px, &py) != 2) {
@@ -3059,20 +3092,20 @@ int main(int argc, char **argv)
3059 !strcmp(p, "--solution") || 3092 !strcmp(p, "--solution") ||
3060 !strcmp(p, "--solns") || 3093 !strcmp(p, "--solns") ||
3061 !strcmp(p, "--soln"))) { 3094 !strcmp(p, "--soln"))) {
3062 soln = TRUE; 3095 soln = true;
3063 } else if (doing_opts && !strcmp(p, "--colour")) { 3096 } else if (doing_opts && !strcmp(p, "--colour")) {
3064 if (!thegame.can_print_in_colour) { 3097 if (!thegame.can_print_in_colour) {
3065 fprintf(stderr, "%s: this game does not support colour" 3098 fprintf(stderr, "%s: this game does not support colour"
3066 " printing\n", pname); 3099 " printing\n", pname);
3067 return 1; 3100 return 1;
3068 } 3101 }
3069 colour = TRUE; 3102 colour = true;
3070 } else if (doing_opts && !strcmp(p, "--load")) { 3103 } else if (doing_opts && !strcmp(p, "--load")) {
3071 argtype = ARG_SAVE; 3104 argtype = ARG_SAVE;
3072 } else if (doing_opts && !strcmp(p, "--game")) { 3105 } else if (doing_opts && !strcmp(p, "--game")) {
3073 argtype = ARG_ID; 3106 argtype = ARG_ID;
3074 } else if (doing_opts && !strcmp(p, "--")) { 3107 } else if (doing_opts && !strcmp(p, "--")) {
3075 doing_opts = FALSE; 3108 doing_opts = false;
3076 } else if (!doing_opts || p[0] != '-') { 3109 } else if (!doing_opts || p[0] != '-') {
3077 if (arg) { 3110 if (arg) {
3078 fprintf(stderr, "%s: more than one argument supplied\n", 3111 fprintf(stderr, "%s: more than one argument supplied\n",
@@ -3316,10 +3349,12 @@ int main(int argc, char **argv)
3316 return 0; 3349 return 0;
3317 } else { 3350 } else {
3318 frontend *fe; 3351 frontend *fe;
3352 bool headless = screenshot_file != NULL;
3319 3353
3320 gtk_init(&argc, &argv); 3354 if (!headless)
3355 gtk_init(&argc, &argv);
3321 3356
3322 fe = new_window(arg, argtype, &error); 3357 fe = new_window(arg, argtype, &error, headless);
3323 3358
3324 if (!fe) { 3359 if (!fe) {
3325 fprintf(stderr, "%s: %s\n", pname, error); 3360 fprintf(stderr, "%s: %s\n", pname, error);
diff --git a/apps/plugins/puzzles/src/guess.c b/apps/plugins/puzzles/src/guess.c
index 98019d272b..e5ebd5509b 100644
--- a/apps/plugins/puzzles/src/guess.c
+++ b/apps/plugins/puzzles/src/guess.c
@@ -24,7 +24,7 @@ enum {
24 24
25struct game_params { 25struct game_params {
26 int ncolours, npegs, nguesses; 26 int ncolours, npegs, nguesses;
27 int allow_blank, allow_multiple; 27 bool allow_blank, allow_multiple;
28}; 28};
29 29
30#define FEEDBACK_CORRECTPLACE 1 30#define FEEDBACK_CORRECTPLACE 1
@@ -39,7 +39,7 @@ typedef struct pegrow {
39struct game_state { 39struct game_state {
40 game_params params; 40 game_params params;
41 pegrow *guesses; /* length params->nguesses */ 41 pegrow *guesses; /* length params->nguesses */
42 int *holds; 42 bool *holds;
43 pegrow solution; 43 pegrow solution;
44 int next_go; /* from 0 to nguesses-1; 44 int next_go; /* from 0 to nguesses-1;
45 if next_go == nguesses then they've lost. */ 45 if next_go == nguesses then they've lost. */
@@ -55,8 +55,8 @@ static game_params *default_params(void)
55 ret->npegs = 4; 55 ret->npegs = 4;
56 ret->nguesses = 10; 56 ret->nguesses = 10;
57 57
58 ret->allow_blank = 0; 58 ret->allow_blank = false;
59 ret->allow_multiple = 1; 59 ret->allow_multiple = true;
60 60
61 return ret; 61 return ret;
62} 62}
@@ -77,15 +77,15 @@ static const struct {
77 const char *name; 77 const char *name;
78 game_params params; 78 game_params params;
79} guess_presets[] = { 79} guess_presets[] = {
80 {"Standard", {6, 4, 10, FALSE, TRUE}}, 80 {"Standard", {6, 4, 10, false, true}},
81 {"Super", {8, 5, 12, FALSE, TRUE}}, 81 {"Super", {8, 5, 12, false, true}},
82}; 82};
83 83
84 84
85static int game_fetch_preset(int i, char **name, game_params **params) 85static bool game_fetch_preset(int i, char **name, game_params **params)
86{ 86{
87 if (i < 0 || i >= lenof(guess_presets)) 87 if (i < 0 || i >= lenof(guess_presets))
88 return FALSE; 88 return false;
89 89
90 *name = dupstr(guess_presets[i].name); 90 *name = dupstr(guess_presets[i].name);
91 /* 91 /*
@@ -96,7 +96,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
96 *params = dup_params(&tmp); 96 *params = dup_params(&tmp);
97 } 97 }
98 98
99 return TRUE; 99 return true;
100} 100}
101 101
102static void decode_params(game_params *params, char const *string) 102static void decode_params(game_params *params, char const *string)
@@ -124,19 +124,19 @@ static void decode_params(game_params *params, char const *string)
124 break; 124 break;
125 125
126 case 'b': 126 case 'b':
127 params->allow_blank = 1; 127 params->allow_blank = true;
128 break; 128 break;
129 129
130 case 'B': 130 case 'B':
131 params->allow_blank = 0; 131 params->allow_blank = false;
132 break; 132 break;
133 133
134 case 'm': 134 case 'm':
135 params->allow_multiple = 1; 135 params->allow_multiple = true;
136 break; 136 break;
137 137
138 case 'M': 138 case 'M':
139 params->allow_multiple = 0; 139 params->allow_multiple = false;
140 break; 140 break;
141 141
142 default: 142 default:
@@ -145,7 +145,7 @@ static void decode_params(game_params *params, char const *string)
145 } 145 }
146} 146}
147 147
148static char *encode_params(const game_params *params, int full) 148static char *encode_params(const game_params *params, bool full)
149{ 149{
150 char data[256]; 150 char data[256];
151 151
@@ -206,7 +206,7 @@ static game_params *custom_params(const config_item *cfg)
206 return ret; 206 return ret;
207} 207}
208 208
209static const char *validate_params(const game_params *params, int full) 209static const char *validate_params(const game_params *params, bool full)
210{ 210{
211 if (params->ncolours < 2 || params->npegs < 2) 211 if (params->ncolours < 2 || params->npegs < 2)
212 return "Trivial solutions are uninteresting"; 212 return "Trivial solutions are uninteresting";
@@ -258,7 +258,7 @@ static void free_pegrow(pegrow pegs)
258} 258}
259 259
260static char *new_game_desc(const game_params *params, random_state *rs, 260static char *new_game_desc(const game_params *params, random_state *rs,
261 char **aux, int interactive) 261 char **aux, bool interactive)
262{ 262{
263 unsigned char *bmp = snewn(params->npegs, unsigned char); 263 unsigned char *bmp = snewn(params->npegs, unsigned char);
264 char *ret; 264 char *ret;
@@ -272,7 +272,7 @@ newcol:
272 colcount->pegs[c]++; 272 colcount->pegs[c]++;
273 bmp[i] = (unsigned char)(c+1); 273 bmp[i] = (unsigned char)(c+1);
274 } 274 }
275 obfuscate_bitmap(bmp, params->npegs*8, FALSE); 275 obfuscate_bitmap(bmp, params->npegs*8, false);
276 276
277 ret = bin2hex(bmp, params->npegs); 277 ret = bin2hex(bmp, params->npegs);
278 sfree(bmp); 278 sfree(bmp);
@@ -291,7 +291,7 @@ static const char *validate_desc(const game_params *params, const char *desc)
291 if (strlen(desc) != params->npegs * 2) 291 if (strlen(desc) != params->npegs * 2)
292 return "Game description is wrong length"; 292 return "Game description is wrong length";
293 bmp = hex2bin(desc, params->npegs); 293 bmp = hex2bin(desc, params->npegs);
294 obfuscate_bitmap(bmp, params->npegs*8, TRUE); 294 obfuscate_bitmap(bmp, params->npegs*8, true);
295 for (i = 0; i < params->npegs; i++) { 295 for (i = 0; i < params->npegs; i++) {
296 if (bmp[i] < 1 || bmp[i] > params->ncolours) { 296 if (bmp[i] < 1 || bmp[i] > params->ncolours) {
297 sfree(bmp); 297 sfree(bmp);
@@ -314,16 +314,16 @@ static game_state *new_game(midend *me, const game_params *params,
314 state->guesses = snewn(params->nguesses, pegrow); 314 state->guesses = snewn(params->nguesses, pegrow);
315 for (i = 0; i < params->nguesses; i++) 315 for (i = 0; i < params->nguesses; i++)
316 state->guesses[i] = new_pegrow(params->npegs); 316 state->guesses[i] = new_pegrow(params->npegs);
317 state->holds = snewn(params->npegs, int); 317 state->holds = snewn(params->npegs, bool);
318 state->solution = new_pegrow(params->npegs); 318 state->solution = new_pegrow(params->npegs);
319 319
320 bmp = hex2bin(desc, params->npegs); 320 bmp = hex2bin(desc, params->npegs);
321 obfuscate_bitmap(bmp, params->npegs*8, TRUE); 321 obfuscate_bitmap(bmp, params->npegs*8, true);
322 for (i = 0; i < params->npegs; i++) 322 for (i = 0; i < params->npegs; i++)
323 state->solution->pegs[i] = (int)bmp[i]; 323 state->solution->pegs[i] = (int)bmp[i];
324 sfree(bmp); 324 sfree(bmp);
325 325
326 memset(state->holds, 0, sizeof(int) * params->npegs); 326 memset(state->holds, 0, sizeof(bool) * params->npegs);
327 state->next_go = state->solved = 0; 327 state->next_go = state->solved = 0;
328 328
329 return state; 329 return state;
@@ -339,8 +339,8 @@ static game_state *dup_game(const game_state *state)
339 ret->guesses = snewn(state->params.nguesses, pegrow); 339 ret->guesses = snewn(state->params.nguesses, pegrow);
340 for (i = 0; i < state->params.nguesses; i++) 340 for (i = 0; i < state->params.nguesses; i++)
341 ret->guesses[i] = dup_pegrow(state->guesses[i]); 341 ret->guesses[i] = dup_pegrow(state->guesses[i]);
342 ret->holds = snewn(state->params.npegs, int); 342 ret->holds = snewn(state->params.npegs, bool);
343 memcpy(ret->holds, state->holds, sizeof(int) * state->params.npegs); 343 memcpy(ret->holds, state->holds, sizeof(bool) * state->params.npegs);
344 ret->solution = dup_pegrow(state->solution); 344 ret->solution = dup_pegrow(state->solution);
345 345
346 return ret; 346 return ret;
@@ -365,9 +365,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
365 return dupstr("S"); 365 return dupstr("S");
366} 366}
367 367
368static int game_can_format_as_text_now(const game_params *params) 368static bool game_can_format_as_text_now(const game_params *params)
369{ 369{
370 return TRUE; 370 return true;
371} 371}
372 372
373static char *game_text_format(const game_state *state) 373static char *game_text_format(const game_state *state)
@@ -375,9 +375,10 @@ static char *game_text_format(const game_state *state)
375 return NULL; 375 return NULL;
376} 376}
377 377
378static int is_markable(const game_params *params, pegrow pegs) 378static bool is_markable(const game_params *params, pegrow pegs)
379{ 379{
380 int i, nset = 0, nrequired, ret = 0; 380 int i, nset = 0, nrequired;
381 bool ret = false;
381 pegrow colcount = new_pegrow(params->ncolours); 382 pegrow colcount = new_pegrow(params->ncolours);
382 383
383 nrequired = params->allow_blank ? 1 : params->npegs; 384 nrequired = params->allow_blank ? 1 : params->npegs;
@@ -396,7 +397,7 @@ static int is_markable(const game_params *params, pegrow pegs)
396 if (colcount->pegs[i] > 1) goto done; 397 if (colcount->pegs[i] > 1) goto done;
397 } 398 }
398 } 399 }
399 ret = 1; 400 ret = true;
400done: 401done:
401 free_pegrow(colcount); 402 free_pegrow(colcount);
402 return ret; 403 return ret;
@@ -405,15 +406,15 @@ done:
405struct game_ui { 406struct game_ui {
406 game_params params; 407 game_params params;
407 pegrow curr_pegs; /* half-finished current move */ 408 pegrow curr_pegs; /* half-finished current move */
408 int *holds; 409 bool *holds;
409 int colour_cur; /* position of up-down colour picker cursor */ 410 int colour_cur; /* position of up-down colour picker cursor */
410 int peg_cur; /* position of left-right peg picker cursor */ 411 int peg_cur; /* position of left-right peg picker cursor */
411 int display_cur, markable; 412 bool display_cur, markable;
412 413
413 int drag_col, drag_x, drag_y; /* x and y are *center* of peg! */ 414 int drag_col, drag_x, drag_y; /* x and y are *center* of peg! */
414 int drag_opeg; /* peg index, if dragged from a peg (from current guess), otherwise -1 */ 415 int drag_opeg; /* peg index, if dragged from a peg (from current guess), otherwise -1 */
415 416
416 int show_labels; /* label the colours with letters */ 417 bool show_labels; /* label the colours with letters */
417 pegrow hint; 418 pegrow hint;
418}; 419};
419 420
@@ -423,8 +424,8 @@ static game_ui *new_ui(const game_state *state)
423 memset(ui, 0, sizeof(game_ui)); 424 memset(ui, 0, sizeof(game_ui));
424 ui->params = state->params; /* structure copy */ 425 ui->params = state->params; /* structure copy */
425 ui->curr_pegs = new_pegrow(state->params.npegs); 426 ui->curr_pegs = new_pegrow(state->params.npegs);
426 ui->holds = snewn(state->params.npegs, int); 427 ui->holds = snewn(state->params.npegs, bool);
427 memset(ui->holds, 0, sizeof(int)*state->params.npegs); 428 memset(ui->holds, 0, sizeof(bool)*state->params.npegs);
428 ui->drag_opeg = -1; 429 ui->drag_opeg = -1;
429 return ui; 430 return ui;
430} 431}
@@ -470,10 +471,10 @@ static void decode_ui(game_ui *ui, const char *encoding)
470 while (*p && isdigit((unsigned char)*p)) p++; 471 while (*p && isdigit((unsigned char)*p)) p++;
471 if (*p == '_') { 472 if (*p == '_') {
472 /* NB: old versions didn't store holds */ 473 /* NB: old versions didn't store holds */
473 ui->holds[i] = 1; 474 ui->holds[i] = true;
474 p++; 475 p++;
475 } else 476 } else
476 ui->holds[i] = 0; 477 ui->holds[i] = false;
477 if (*p == ',') p++; 478 if (*p == ',') p++;
478 } 479 }
479 ui->markable = is_markable(&ui->params, ui->curr_pegs); 480 ui->markable = is_markable(&ui->params, ui->curr_pegs);
@@ -494,7 +495,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
494 * for undo. */ 495 * for undo. */
495 for (i = 0; i < newstate->solution->npegs; i++) { 496 for (i = 0; i < newstate->solution->npegs; i++) {
496 if (newstate->solved) 497 if (newstate->solved)
497 ui->holds[i] = 0; 498 ui->holds[i] = false;
498 else 499 else
499 ui->holds[i] = newstate->holds[i]; 500 ui->holds[i] = newstate->holds[i];
500 if (newstate->solved || (newstate->next_go == 0) || !ui->holds[i]) { 501 if (newstate->solved || (newstate->next_go == 0) || !ui->holds[i]) {
@@ -559,7 +560,9 @@ struct game_drawstate {
559 int guessx, guessy; /* origin of guesses */ 560 int guessx, guessy; /* origin of guesses */
560 int solnx, solny; /* origin of solution */ 561 int solnx, solny; /* origin of solution */
561 int hintw; /* no. of hint tiles we're wide per row */ 562 int hintw; /* no. of hint tiles we're wide per row */
562 int w, h, started, solved; 563 int w, h;
564 bool started;
565 int solved;
563 566
564 int next_go; 567 int next_go;
565 568
@@ -729,9 +732,9 @@ increase_mincolour:
729 for (i = 0; i < state->params.npegs; ++i) 732 for (i = 0; i < state->params.npegs; ++i)
730 ui->curr_pegs->pegs[i] = ui->hint->pegs[i]; 733 ui->curr_pegs->pegs[i] = ui->hint->pegs[i];
731 734
732 ui->markable = TRUE; 735 ui->markable = true;
733 ui->peg_cur = state->params.npegs; 736 ui->peg_cur = state->params.npegs;
734 ui->display_cur = 1; 737 ui->display_cur = true;
735 return; 738 return;
736 739
737 increment_pegrow: 740 increment_pegrow:
@@ -747,9 +750,9 @@ increase_mincolour:
747 * should it ever happen, update the ui in some trivial way. This gives 750 * should it ever happen, update the ui in some trivial way. This gives
748 * the user a sense of broken(ish)ness and futility. */ 751 * the user a sense of broken(ish)ness and futility. */
749 if (!ui->display_cur) { 752 if (!ui->display_cur) {
750 ui->display_cur = 1; 753 ui->display_cur = true;
751 } else if (state->params.npegs == 1) { 754 } else if (state->params.npegs == 1) {
752 ui->display_cur = 0; 755 ui->display_cur = false;
753 } else { 756 } else {
754 ui->peg_cur = (ui->peg_cur + 1) % state->params.npegs; 757 ui->peg_cur = (ui->peg_cur + 1) % state->params.npegs;
755 } 758 }
@@ -763,7 +766,7 @@ static char *interpret_move(const game_state *from, game_ui *ui,
763 int over_guess = -1; /* zero-indexed */ 766 int over_guess = -1; /* zero-indexed */
764 int over_past_guess_y = -1; /* zero-indexed */ 767 int over_past_guess_y = -1; /* zero-indexed */
765 int over_past_guess_x = -1; /* zero-indexed */ 768 int over_past_guess_x = -1; /* zero-indexed */
766 int over_hint = 0; /* zero or one */ 769 bool over_hint = false;
767 char *ret = NULL; 770 char *ret = NULL;
768 771
769 int guess_ox = GUESS_X(from->next_go, 0); 772 int guess_ox = GUESS_X(from->next_go, 0);
@@ -789,7 +792,7 @@ static char *interpret_move(const game_state *from, game_ui *ui,
789 over_guess = (x - guess_ox) / PEGOFF; 792 over_guess = (x - guess_ox) / PEGOFF;
790 assert(over_guess >= 0 && over_guess < ds->solution->npegs); 793 assert(over_guess >= 0 && over_guess < ds->solution->npegs);
791 } else { 794 } else {
792 over_hint = 1; 795 over_hint = true;
793 } 796 }
794 } else if (x >= guess_ox && x < (guess_ox + GUESS_W) && 797 } else if (x >= guess_ox && x < (guess_ox + GUESS_W) &&
795 y >= GUESS_OY && y < guess_oy) { 798 y >= GUESS_OY && y < guess_oy) {
@@ -852,14 +855,14 @@ static char *interpret_move(const game_state *from, game_ui *ui,
852 } 855 }
853 ui->drag_col = 0; 856 ui->drag_col = 0;
854 ui->drag_opeg = -1; 857 ui->drag_opeg = -1;
855 ui->display_cur = 0; 858 ui->display_cur = false;
856 debug(("Stop dragging.")); 859 debug(("Stop dragging."));
857 ret = UI_UPDATE; 860 ret = UI_UPDATE;
858 } else if (button == RIGHT_BUTTON) { 861 } else if (button == RIGHT_BUTTON) {
859 if (over_guess > -1) { 862 if (over_guess > -1) {
860 /* we use ths feedback in the game_ui to signify 863 /* we use ths feedback in the game_ui to signify
861 * 'carry this peg to the next guess as well'. */ 864 * 'carry this peg to the next guess as well'. */
862 ui->holds[over_guess] = 1 - ui->holds[over_guess]; 865 ui->holds[over_guess] ^= 1;
863 ret = UI_UPDATE; 866 ret = UI_UPDATE;
864 } 867 }
865 } else if (button == LEFT_RELEASE && over_hint && ui->markable) { 868 } else if (button == LEFT_RELEASE && over_hint && ui->markable) {
@@ -870,7 +873,7 @@ static char *interpret_move(const game_state *from, game_ui *ui,
870 873
871 /* keyboard input */ 874 /* keyboard input */
872 if (button == CURSOR_UP || button == CURSOR_DOWN) { 875 if (button == CURSOR_UP || button == CURSOR_DOWN) {
873 ui->display_cur = 1; 876 ui->display_cur = true;
874 if (button == CURSOR_DOWN && (ui->colour_cur+1) < from->params.ncolours) 877 if (button == CURSOR_DOWN && (ui->colour_cur+1) < from->params.ncolours)
875 ui->colour_cur++; 878 ui->colour_cur++;
876 if (button == CURSOR_UP && ui->colour_cur > 0) 879 if (button == CURSOR_UP && ui->colour_cur > 0)
@@ -883,14 +886,14 @@ static char *interpret_move(const game_state *from, game_ui *ui,
883 int maxcur = from->params.npegs; 886 int maxcur = from->params.npegs;
884 if (ui->markable) maxcur++; 887 if (ui->markable) maxcur++;
885 888
886 ui->display_cur = 1; 889 ui->display_cur = true;
887 if (button == CURSOR_RIGHT && (ui->peg_cur+1) < maxcur) 890 if (button == CURSOR_RIGHT && (ui->peg_cur+1) < maxcur)
888 ui->peg_cur++; 891 ui->peg_cur++;
889 if (button == CURSOR_LEFT && ui->peg_cur > 0) 892 if (button == CURSOR_LEFT && ui->peg_cur > 0)
890 ui->peg_cur--; 893 ui->peg_cur--;
891 ret = UI_UPDATE; 894 ret = UI_UPDATE;
892 } else if (IS_CURSOR_SELECT(button)) { 895 } else if (IS_CURSOR_SELECT(button)) {
893 ui->display_cur = 1; 896 ui->display_cur = true;
894 if (ui->peg_cur == from->params.npegs) { 897 if (ui->peg_cur == from->params.npegs) {
895 ret = encode_move(from, ui); 898 ret = encode_move(from, ui);
896 } else { 899 } else {
@@ -898,14 +901,14 @@ static char *interpret_move(const game_state *from, game_ui *ui,
898 ret = UI_UPDATE; 901 ret = UI_UPDATE;
899 } 902 }
900 } else if (button == 'D' || button == 'd' || button == '\b') { 903 } else if (button == 'D' || button == 'd' || button == '\b') {
901 ui->display_cur = 1; 904 ui->display_cur = true;
902 set_peg(&from->params, ui, ui->peg_cur, 0); 905 set_peg(&from->params, ui, ui->peg_cur, 0);
903 ret = UI_UPDATE; 906 ret = UI_UPDATE;
904 } else if (button == CURSOR_SELECT2) { 907 } else if (button == CURSOR_SELECT2) {
905 if (ui->peg_cur == from->params.npegs) 908 if (ui->peg_cur == from->params.npegs)
906 return NULL; 909 return NULL;
907 ui->display_cur = 1; 910 ui->display_cur = true;
908 ui->holds[ui->peg_cur] = 1 - ui->holds[ui->peg_cur]; 911 ui->holds[ui->peg_cur] ^= 1;
909 ret = UI_UPDATE; 912 ret = UI_UPDATE;
910 } 913 }
911 return ret; 914 return ret;
@@ -936,10 +939,10 @@ static game_state *execute_move(const game_state *from, const char *move)
936 ret->guesses[from->next_go]->pegs[i] = atoi(p); 939 ret->guesses[from->next_go]->pegs[i] = atoi(p);
937 while (*p && isdigit((unsigned char)*p)) p++; 940 while (*p && isdigit((unsigned char)*p)) p++;
938 if (*p == '_') { 941 if (*p == '_') {
939 ret->holds[i] = 1; 942 ret->holds[i] = true;
940 p++; 943 p++;
941 } else 944 } else
942 ret->holds[i] = 0; 945 ret->holds[i] = false;
943 if (*p == ',') p++; 946 if (*p == ',') p++;
944 } 947 }
945 948
@@ -1172,7 +1175,7 @@ static void game_free_drawstate(drawing *dr, game_drawstate *ds)
1172} 1175}
1173 1176
1174static void draw_peg(drawing *dr, game_drawstate *ds, int cx, int cy, 1177static void draw_peg(drawing *dr, game_drawstate *ds, int cx, int cy,
1175 int moving, int labelled, int col) 1178 bool moving, bool labelled, int col)
1176{ 1179{
1177 /* 1180 /*
1178 * Some platforms antialias circles, which means we shouldn't 1181 * Some platforms antialias circles, which means we shouldn't
@@ -1210,8 +1213,8 @@ static void draw_cursor(drawing *dr, game_drawstate *ds, int x, int y)
1210} 1213}
1211 1214
1212static void guess_redraw(drawing *dr, game_drawstate *ds, int guess, 1215static void guess_redraw(drawing *dr, game_drawstate *ds, int guess,
1213 pegrow src, int *holds, int cur_col, int force, 1216 pegrow src, bool *holds, int cur_col, bool force,
1214 int labelled) 1217 bool labelled)
1215{ 1218{
1216 pegrow dest; 1219 pegrow dest;
1217 int rowx, rowy, i, scol; 1220 int rowx, rowy, i, scol;
@@ -1236,7 +1239,7 @@ static void guess_redraw(drawing *dr, game_drawstate *ds, int guess,
1236 if (labelled) 1239 if (labelled)
1237 scol |= 0x4000; 1240 scol |= 0x4000;
1238 if ((dest->pegs[i] != scol) || force) { 1241 if ((dest->pegs[i] != scol) || force) {
1239 draw_peg(dr, ds, rowx + PEGOFF * i, rowy, FALSE, labelled, 1242 draw_peg(dr, ds, rowx + PEGOFF * i, rowy, false, labelled,
1240 scol &~ 0x7000); 1243 scol &~ 0x7000);
1241 /* 1244 /*
1242 * Hold marker. 1245 * Hold marker.
@@ -1253,11 +1256,11 @@ static void guess_redraw(drawing *dr, game_drawstate *ds, int guess,
1253} 1256}
1254 1257
1255static void hint_redraw(drawing *dr, game_drawstate *ds, int guess, 1258static void hint_redraw(drawing *dr, game_drawstate *ds, int guess,
1256 pegrow src, int force, int cursor, int markable) 1259 pegrow src, bool force, bool cursor, bool markable)
1257{ 1260{
1258 pegrow dest = ds->guesses[guess]; 1261 pegrow dest = ds->guesses[guess];
1259 int rowx, rowy, i, scol, col, hintlen; 1262 int rowx, rowy, i, scol, col, hintlen;
1260 int need_redraw; 1263 bool need_redraw;
1261 int emptycol = (markable ? COL_FLASH : COL_EMPTY); 1264 int emptycol = (markable ? COL_FLASH : COL_EMPTY);
1262 1265
1263 if (src) assert(src->npegs == dest->npegs); 1266 if (src) assert(src->npegs == dest->npegs);
@@ -1268,7 +1271,7 @@ static void hint_redraw(drawing *dr, game_drawstate *ds, int guess,
1268 * Because of the possible presence of the cursor around this 1271 * Because of the possible presence of the cursor around this
1269 * entire section, we redraw all or none of it but never part. 1272 * entire section, we redraw all or none of it but never part.
1270 */ 1273 */
1271 need_redraw = FALSE; 1274 need_redraw = false;
1272 1275
1273 for (i = 0; i < dest->npegs; i++) { 1276 for (i = 0; i < dest->npegs; i++) {
1274 scol = src ? src->feedback[i] : 0; 1277 scol = src ? src->feedback[i] : 0;
@@ -1277,7 +1280,7 @@ static void hint_redraw(drawing *dr, game_drawstate *ds, int guess,
1277 if (i == 0 && markable) 1280 if (i == 0 && markable)
1278 scol |= 0x2000; 1281 scol |= 0x2000;
1279 if ((scol != dest->feedback[i]) || force) { 1282 if ((scol != dest->feedback[i]) || force) {
1280 need_redraw = TRUE; 1283 need_redraw = true;
1281 } 1284 }
1282 dest->feedback[i] = scol; 1285 dest->feedback[i] = scol;
1283 } 1286 }
@@ -1340,7 +1343,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1340 int dir, const game_ui *ui, 1343 int dir, const game_ui *ui,
1341 float animtime, float flashtime) 1344 float animtime, float flashtime)
1342{ 1345{
1343 int i, new_move; 1346 int i;
1347 bool new_move;
1344 1348
1345 new_move = (state->next_go != ds->next_go) || !ds->started; 1349 new_move = (state->next_go != ds->next_go) || !ds->started;
1346 1350
@@ -1364,7 +1368,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1364 if (ui->show_labels) 1368 if (ui->show_labels)
1365 val |= 0x2000; 1369 val |= 0x2000;
1366 if (ds->colours->pegs[i] != val) { 1370 if (ds->colours->pegs[i] != val) {
1367 draw_peg(dr, ds, COL_X(i), COL_Y(i), FALSE, ui->show_labels, i+1); 1371 draw_peg(dr, ds, COL_X(i), COL_Y(i), false, ui->show_labels, i+1);
1368 if (val & 0x1000) 1372 if (val & 0x1000)
1369 draw_cursor(dr, ds, COL_X(i), COL_Y(i)); 1373 draw_cursor(dr, ds, COL_X(i), COL_Y(i));
1370 ds->colours->pegs[i] = val; 1374 ds->colours->pegs[i] = val;
@@ -1377,23 +1381,23 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1377 for (i = state->params.nguesses - 1; i >= 0; i--) { 1381 for (i = state->params.nguesses - 1; i >= 0; i--) {
1378 if (i < state->next_go || state->solved) { 1382 if (i < state->next_go || state->solved) {
1379 /* this info is stored in the game_state already */ 1383 /* this info is stored in the game_state already */
1380 guess_redraw(dr, ds, i, state->guesses[i], NULL, -1, 0, 1384 guess_redraw(dr, ds, i, state->guesses[i], NULL, -1, false,
1381 ui->show_labels); 1385 ui->show_labels);
1382 hint_redraw(dr, ds, i, state->guesses[i], 1386 hint_redraw(dr, ds, i, state->guesses[i],
1383 i == (state->next_go-1) ? 1 : 0, FALSE, FALSE); 1387 i == (state->next_go-1), false, false);
1384 } else if (i > state->next_go) { 1388 } else if (i > state->next_go) {
1385 /* we've not got here yet; it's blank. */ 1389 /* we've not got here yet; it's blank. */
1386 guess_redraw(dr, ds, i, NULL, NULL, -1, 0, ui->show_labels); 1390 guess_redraw(dr, ds, i, NULL, NULL, -1, false, ui->show_labels);
1387 hint_redraw(dr, ds, i, NULL, 0, FALSE, FALSE); 1391 hint_redraw(dr, ds, i, NULL, false, false, false);
1388 } 1392 }
1389 } 1393 }
1390 if (!state->solved) { 1394 if (!state->solved) {
1391 /* this is the one we're on; the (incomplete) guess is stored in 1395 /* this is the one we're on; the (incomplete) guess is stored in
1392 * the game_ui. */ 1396 * the game_ui. */
1393 guess_redraw(dr, ds, state->next_go, ui->curr_pegs, 1397 guess_redraw(dr, ds, state->next_go, ui->curr_pegs,
1394 ui->holds, ui->display_cur ? ui->peg_cur : -1, 0, 1398 ui->holds, ui->display_cur ? ui->peg_cur : -1, false,
1395 ui->show_labels); 1399 ui->show_labels);
1396 hint_redraw(dr, ds, state->next_go, NULL, 1, 1400 hint_redraw(dr, ds, state->next_go, NULL, true,
1397 ui->display_cur && ui->peg_cur == state->params.npegs, 1401 ui->display_cur && ui->peg_cur == state->params.npegs,
1398 ui->markable); 1402 ui->markable);
1399 } 1403 }
@@ -1425,11 +1429,11 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1425 ds->blit_ox = ox - 1; ds->blit_oy = oy - 1; 1429 ds->blit_ox = ox - 1; ds->blit_oy = oy - 1;
1426 debug(("Saving to blitter at (%d,%d)", ds->blit_ox, ds->blit_oy)); 1430 debug(("Saving to blitter at (%d,%d)", ds->blit_ox, ds->blit_oy));
1427 blitter_save(dr, ds->blit_peg, ds->blit_ox, ds->blit_oy); 1431 blitter_save(dr, ds->blit_peg, ds->blit_ox, ds->blit_oy);
1428 draw_peg(dr, ds, ox, oy, TRUE, ui->show_labels, ui->drag_col); 1432 draw_peg(dr, ds, ox, oy, true, ui->show_labels, ui->drag_col);
1429 } 1433 }
1430 ds->drag_col = ui->drag_col; 1434 ds->drag_col = ui->drag_col;
1431 1435
1432 ds->started = 1; 1436 ds->started = true;
1433} 1437}
1434 1438
1435static float game_anim_length(const game_state *oldstate, 1439static float game_anim_length(const game_state *oldstate,
@@ -1455,9 +1459,9 @@ static int game_status(const game_state *state)
1455 return state->solved; 1459 return state->solved;
1456} 1460}
1457 1461
1458static int game_timing_state(const game_state *state, game_ui *ui) 1462static bool game_timing_state(const game_state *state, game_ui *ui)
1459{ 1463{
1460 return TRUE; 1464 return true;
1461} 1465}
1462 1466
1463static void game_print_size(const game_params *params, float *x, float *y) 1467static void game_print_size(const game_params *params, float *x, float *y)
@@ -1480,15 +1484,15 @@ const struct game thegame = {
1480 encode_params, 1484 encode_params,
1481 free_params, 1485 free_params,
1482 dup_params, 1486 dup_params,
1483 TRUE, game_configure, custom_params, 1487 true, game_configure, custom_params,
1484 validate_params, 1488 validate_params,
1485 new_game_desc, 1489 new_game_desc,
1486 validate_desc, 1490 validate_desc,
1487 new_game, 1491 new_game,
1488 dup_game, 1492 dup_game,
1489 free_game, 1493 free_game,
1490 TRUE, solve_game, 1494 true, solve_game,
1491 FALSE, game_can_format_as_text_now, game_text_format, 1495 false, game_can_format_as_text_now, game_text_format,
1492 new_ui, 1496 new_ui,
1493 free_ui, 1497 free_ui,
1494 encode_ui, 1498 encode_ui,
@@ -1505,9 +1509,9 @@ const struct game thegame = {
1505 game_anim_length, 1509 game_anim_length,
1506 game_flash_length, 1510 game_flash_length,
1507 game_status, 1511 game_status,
1508 FALSE, FALSE, game_print_size, game_print, 1512 false, false, game_print_size, game_print,
1509 FALSE, /* wants_statusbar */ 1513 false, /* wants_statusbar */
1510 FALSE, game_timing_state, 1514 false, game_timing_state,
1511 0, /* flags */ 1515 0, /* flags */
1512}; 1516};
1513 1517
diff --git a/apps/plugins/puzzles/src/html/rect.html b/apps/plugins/puzzles/src/html/rect.html
index d23d827663..4cd22db70c 100644
--- a/apps/plugins/puzzles/src/html/rect.html
+++ b/apps/plugins/puzzles/src/html/rect.html
@@ -1,4 +1,4 @@
1docname=rectangles:Rectangles 1docname=rect:Rectangles
2<p> 2<p>
3Draw lines along the grid edges to divide the grid into rectangles, 3Draw lines along the grid edges to divide the grid into rectangles,
4so that each rectangle contains exactly one numbered square and its 4so that each rectangle contains exactly one numbered square and its
diff --git a/apps/plugins/puzzles/src/inertia.c b/apps/plugins/puzzles/src/inertia.c
index 8206d00e79..838f8dee96 100644
--- a/apps/plugins/puzzles/src/inertia.c
+++ b/apps/plugins/puzzles/src/inertia.c
@@ -77,8 +77,8 @@ struct game_state {
77 int gems; 77 int gems;
78 char *grid; 78 char *grid;
79 int distance_moved; 79 int distance_moved;
80 int dead; 80 bool dead;
81 int cheated; 81 bool cheated;
82 int solnpos; 82 int solnpos;
83 soln *soln; 83 soln *soln;
84}; 84};
@@ -120,14 +120,14 @@ static const struct game_params inertia_presets[] = {
120#endif 120#endif
121}; 121};
122 122
123static int game_fetch_preset(int i, char **name, game_params **params) 123static bool game_fetch_preset(int i, char **name, game_params **params)
124{ 124{
125 game_params p, *ret; 125 game_params p, *ret;
126 char *retname; 126 char *retname;
127 char namebuf[80]; 127 char namebuf[80];
128 128
129 if (i < 0 || i >= lenof(inertia_presets)) 129 if (i < 0 || i >= lenof(inertia_presets))
130 return FALSE; 130 return false;
131 131
132 p = inertia_presets[i]; 132 p = inertia_presets[i];
133 ret = dup_params(&p); 133 ret = dup_params(&p);
@@ -136,7 +136,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
136 136
137 *params = ret; 137 *params = ret;
138 *name = retname; 138 *name = retname;
139 return TRUE; 139 return true;
140} 140}
141 141
142static void decode_params(game_params *params, char const *string) 142static void decode_params(game_params *params, char const *string)
@@ -149,7 +149,7 @@ static void decode_params(game_params *params, char const *string)
149 } 149 }
150} 150}
151 151
152static char *encode_params(const game_params *params, int full) 152static char *encode_params(const game_params *params, bool full)
153{ 153{
154 char data[256]; 154 char data[256];
155 155
@@ -191,7 +191,7 @@ static game_params *custom_params(const config_item *cfg)
191 return ret; 191 return ret;
192} 192}
193 193
194static const char *validate_params(const game_params *params, int full) 194static const char *validate_params(const game_params *params, bool full)
195{ 195{
196 /* 196 /*
197 * Avoid completely degenerate cases which only have one 197 * Avoid completely degenerate cases which only have one
@@ -220,7 +220,7 @@ static const char *validate_params(const game_params *params, int full)
220 */ 220 */
221 221
222struct solver_scratch { 222struct solver_scratch {
223 unsigned char *reachable_from, *reachable_to; 223 bool *reachable_from, *reachable_to;
224 int *positions; 224 int *positions;
225}; 225};
226 226
@@ -228,8 +228,8 @@ static struct solver_scratch *new_scratch(int w, int h)
228{ 228{
229 struct solver_scratch *sc = snew(struct solver_scratch); 229 struct solver_scratch *sc = snew(struct solver_scratch);
230 230
231 sc->reachable_from = snewn(w * h * DIRECTIONS, unsigned char); 231 sc->reachable_from = snewn(w * h * DIRECTIONS, bool);
232 sc->reachable_to = snewn(w * h * DIRECTIONS, unsigned char); 232 sc->reachable_to = snewn(w * h * DIRECTIONS, bool);
233 sc->positions = snewn(w * h * DIRECTIONS, int); 233 sc->positions = snewn(w * h * DIRECTIONS, int);
234 234
235 return sc; 235 return sc;
@@ -243,11 +243,11 @@ static void free_scratch(struct solver_scratch *sc)
243 sfree(sc); 243 sfree(sc);
244} 244}
245 245
246static int can_go(int w, int h, char *grid, 246static bool can_go(int w, int h, char *grid,
247 int x1, int y1, int dir1, int x2, int y2, int dir2) 247 int x1, int y1, int dir1, int x2, int y2, int dir2)
248{ 248{
249 /* 249 /*
250 * Returns TRUE if we can transition directly from (x1,y1) 250 * Returns true if we can transition directly from (x1,y1)
251 * going in direction dir1, to (x2,y2) going in direction dir2. 251 * going in direction dir1, to (x2,y2) going in direction dir2.
252 */ 252 */
253 253
@@ -257,7 +257,7 @@ static int can_go(int w, int h, char *grid,
257 */ 257 */
258 if (AT(w, h, grid, x1, y1) == WALL || 258 if (AT(w, h, grid, x1, y1) == WALL ||
259 AT(w, h, grid, x1, y1) == MINE) 259 AT(w, h, grid, x1, y1) == MINE)
260 return FALSE; 260 return false;
261 261
262 /* 262 /*
263 * If a move is capable of stopping at x1,y1,dir1, and x2,y2 is 263 * If a move is capable of stopping at x1,y1,dir1, and x2,y2 is
@@ -271,7 +271,7 @@ static int can_go(int w, int h, char *grid,
271 (AT(w, h, grid, x1, y1) == STOP || 271 (AT(w, h, grid, x1, y1) == STOP ||
272 AT(w, h, grid, x1, y1) == START || 272 AT(w, h, grid, x1, y1) == START ||
273 AT(w, h, grid, x1+DX(dir1), y1+DY(dir1)) == WALL)) 273 AT(w, h, grid, x1+DX(dir1), y1+DY(dir1)) == WALL))
274 return TRUE; 274 return true;
275 275
276 /* 276 /*
277 * If a move is capable of continuing here, then x1,y1,dir1 can 277 * If a move is capable of continuing here, then x1,y1,dir1 can
@@ -282,12 +282,12 @@ static int can_go(int w, int h, char *grid,
282 AT(w, h, grid, x2, y2) == GEM || 282 AT(w, h, grid, x2, y2) == GEM ||
283 AT(w, h, grid, x2, y2) == STOP || 283 AT(w, h, grid, x2, y2) == STOP ||
284 AT(w, h, grid, x2, y2) == START)) 284 AT(w, h, grid, x2, y2) == START))
285 return TRUE; 285 return true;
286 286
287 /* 287 /*
288 * That's it. 288 * That's it.
289 */ 289 */
290 return FALSE; 290 return false;
291} 291}
292 292
293static int find_gem_candidates(int w, int h, char *grid, 293static int find_gem_candidates(int w, int h, char *grid,
@@ -317,8 +317,8 @@ static int find_gem_candidates(int w, int h, char *grid,
317 * flags set. 317 * flags set.
318 */ 318 */
319 319
320 memset(sc->reachable_from, 0, wh * DIRECTIONS); 320 memset(sc->reachable_from, 0, wh * DIRECTIONS * sizeof(bool));
321 memset(sc->reachable_to, 0, wh * DIRECTIONS); 321 memset(sc->reachable_to, 0, wh * DIRECTIONS * sizeof(bool));
322 322
323 /* 323 /*
324 * Find the starting square. 324 * Find the starting square.
@@ -334,8 +334,7 @@ static int find_gem_candidates(int w, int h, char *grid,
334 assert(sy < h); 334 assert(sy < h);
335 335
336 for (pass = 0; pass < 2; pass++) { 336 for (pass = 0; pass < 2; pass++) {
337 unsigned char *reachable = (pass == 0 ? sc->reachable_from : 337 bool *reachable = (pass == 0 ? sc->reachable_from : sc->reachable_to);
338 sc->reachable_to);
339 int sign = (pass == 0 ? +1 : -1); 338 int sign = (pass == 0 ? +1 : -1);
340 int dir; 339 int dir;
341 340
@@ -351,7 +350,7 @@ static int find_gem_candidates(int w, int h, char *grid,
351 for (dir = 0; dir < DIRECTIONS; dir++) { 350 for (dir = 0; dir < DIRECTIONS; dir++) {
352 int index = (sy*w+sx)*DIRECTIONS+dir; 351 int index = (sy*w+sx)*DIRECTIONS+dir;
353 sc->positions[tail++] = index; 352 sc->positions[tail++] = index;
354 reachable[index] = TRUE; 353 reachable[index] = true;
355#ifdef SOLVER_DIAGNOSTICS 354#ifdef SOLVER_DIAGNOSTICS
356 printf("starting point %d,%d,%d\n", sx, sy, dir); 355 printf("starting point %d,%d,%d\n", sx, sy, dir);
357#endif 356#endif
@@ -392,7 +391,7 @@ static int find_gem_candidates(int w, int h, char *grid,
392 if (x2 >= 0 && x2 < w && 391 if (x2 >= 0 && x2 < w &&
393 y2 >= 0 && y2 < h && 392 y2 >= 0 && y2 < h &&
394 !reachable[i2]) { 393 !reachable[i2]) {
395 int ok; 394 bool ok;
396#ifdef SOLVER_DIAGNOSTICS 395#ifdef SOLVER_DIAGNOSTICS
397 printf(" trying point %d,%d,%d", x2, y2, d2); 396 printf(" trying point %d,%d,%d", x2, y2, d2);
398#endif 397#endif
@@ -405,7 +404,7 @@ static int find_gem_candidates(int w, int h, char *grid,
405#endif 404#endif
406 if (ok) { 405 if (ok) {
407 sc->positions[tail++] = i2; 406 sc->positions[tail++] = i2;
408 reachable[i2] = TRUE; 407 reachable[i2] = true;
409 } 408 }
410 } 409 }
411 } 410 }
@@ -580,7 +579,7 @@ static char *gengrid(int w, int h, random_state *rs)
580} 579}
581 580
582static char *new_game_desc(const game_params *params, random_state *rs, 581static char *new_game_desc(const game_params *params, random_state *rs,
583 char **aux, int interactive) 582 char **aux, bool interactive)
584{ 583{
585 return gengrid(params->w, params->h, rs); 584 return gengrid(params->w, params->h, rs);
586} 585}
@@ -642,9 +641,9 @@ static game_state *new_game(midend *me, const game_params *params,
642 assert(state->px >= 0 && state->py >= 0); 641 assert(state->px >= 0 && state->py >= 0);
643 642
644 state->distance_moved = 0; 643 state->distance_moved = 0;
645 state->dead = FALSE; 644 state->dead = false;
646 645
647 state->cheated = FALSE; 646 state->cheated = false;
648 state->solnpos = 0; 647 state->solnpos = 0;
649 state->soln = NULL; 648 state->soln = NULL;
650 649
@@ -662,7 +661,7 @@ static game_state *dup_game(const game_state *state)
662 ret->gems = state->gems; 661 ret->gems = state->gems;
663 ret->grid = snewn(wh, char); 662 ret->grid = snewn(wh, char);
664 ret->distance_moved = state->distance_moved; 663 ret->distance_moved = state->distance_moved;
665 ret->dead = FALSE; 664 ret->dead = false;
666 memcpy(ret->grid, state->grid, wh); 665 memcpy(ret->grid, state->grid, wh);
667 ret->cheated = state->cheated; 666 ret->cheated = state->cheated;
668 ret->soln = state->soln; 667 ret->soln = state->soln;
@@ -892,10 +891,10 @@ static char *solve_game(const game_state *state, const game_state *currstate,
892 */ 891 */
893 unvisited = snewn(wh, int); 892 unvisited = snewn(wh, int);
894 for (i = 0; i < wh; i++) 893 for (i = 0; i < wh; i++)
895 unvisited[i] = FALSE; 894 unvisited[i] = false;
896 for (i = 0; i < wh; i++) 895 for (i = 0; i < wh; i++)
897 if (currstate->grid[i] == GEM) 896 if (currstate->grid[i] == GEM)
898 unvisited[i] = TRUE; 897 unvisited[i] = true;
899 898
900 /* 899 /*
901 * Allocate space for doing bfses inside the main loop. 900 * Allocate space for doing bfses inside the main loop.
@@ -1175,7 +1174,7 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1175 for (i = n1; i <= n2; i++) { 1174 for (i = n1; i <= n2; i++) {
1176 int pos = nodes[circuit[i]] / DP1; 1175 int pos = nodes[circuit[i]] / DP1;
1177 assert(pos >= 0 && pos < wh); 1176 assert(pos >= 0 && pos < wh);
1178 unvisited[pos] = FALSE; 1177 unvisited[pos] = false;
1179 } 1178 }
1180 } 1179 }
1181 1180
@@ -1443,9 +1442,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1443 return soln; 1442 return soln;
1444} 1443}
1445 1444
1446static int game_can_format_as_text_now(const game_params *params) 1445static bool game_can_format_as_text_now(const game_params *params)
1447{ 1446{
1448 return TRUE; 1447 return true;
1449} 1448}
1450 1449
1451static char *game_text_format(const game_state *state) 1450static char *game_text_format(const game_state *state)
@@ -1491,8 +1490,8 @@ struct game_ui {
1491 float anim_length; 1490 float anim_length;
1492 int flashtype; 1491 int flashtype;
1493 int deaths; 1492 int deaths;
1494 int just_made_move; 1493 bool just_made_move;
1495 int just_died; 1494 bool just_died;
1496}; 1495};
1497 1496
1498static game_ui *new_ui(const game_state *state) 1497static game_ui *new_ui(const game_state *state)
@@ -1501,8 +1500,8 @@ static game_ui *new_ui(const game_state *state)
1501 ui->anim_length = 0.0F; 1500 ui->anim_length = 0.0F;
1502 ui->flashtype = 0; 1501 ui->flashtype = 0;
1503 ui->deaths = 0; 1502 ui->deaths = 0;
1504 ui->just_made_move = FALSE; 1503 ui->just_made_move = false;
1505 ui->just_died = FALSE; 1504 ui->just_died = false;
1506 return ui; 1505 return ui;
1507} 1506}
1508 1507
@@ -1539,20 +1538,21 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1539 if (!oldstate->dead && newstate->dead && ui->just_made_move && 1538 if (!oldstate->dead && newstate->dead && ui->just_made_move &&
1540 oldstate->gems) { 1539 oldstate->gems) {
1541 ui->deaths++; 1540 ui->deaths++;
1542 ui->just_died = TRUE; 1541 ui->just_died = true;
1543 } else { 1542 } else {
1544 ui->just_died = FALSE; 1543 ui->just_died = false;
1545 } 1544 }
1546 ui->just_made_move = FALSE; 1545 ui->just_made_move = false;
1547} 1546}
1548 1547
1549struct game_drawstate { 1548struct game_drawstate {
1550 game_params p; 1549 game_params p;
1551 int tilesize; 1550 int tilesize;
1552 int started; 1551 bool started;
1553 unsigned short *grid; 1552 unsigned short *grid;
1554 blitter *player_background; 1553 blitter *player_background;
1555 int player_bg_saved, pbgx, pbgy; 1554 bool player_bg_saved;
1555 int pbgx, pbgy;
1556}; 1556};
1557 1557
1558#define PREFERRED_TILESIZE 32 1558#define PREFERRED_TILESIZE 32
@@ -1637,7 +1637,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1637 * Otherwise, we can make the move. All we need to specify is 1637 * Otherwise, we can make the move. All we need to specify is
1638 * the direction. 1638 * the direction.
1639 */ 1639 */
1640 ui->just_made_move = TRUE; 1640 ui->just_made_move = true;
1641 sprintf(buf, "%d", dir); 1641 sprintf(buf, "%d", dir);
1642 return dupstr(buf); 1642 return dupstr(buf);
1643} 1643}
@@ -1662,7 +1662,7 @@ static void install_new_solution(game_state *ret, const char *move)
1662 ret->soln = sol; 1662 ret->soln = sol;
1663 sol->refcount = 1; 1663 sol->refcount = 1;
1664 1664
1665 ret->cheated = TRUE; 1665 ret->cheated = true;
1666 ret->solnpos = 0; 1666 ret->solnpos = 0;
1667} 1667}
1668 1668
@@ -1716,7 +1716,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1716 } 1716 }
1717 1717
1718 if (AT(w, h, ret->grid, ret->px, ret->py) == MINE) { 1718 if (AT(w, h, ret->grid, ret->px, ret->py) == MINE) {
1719 ret->dead = TRUE; 1719 ret->dead = true;
1720 break; 1720 break;
1721 } 1721 }
1722 1722
@@ -1823,11 +1823,11 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1823 /* We can't allocate the blitter rectangle for the player background 1823 /* We can't allocate the blitter rectangle for the player background
1824 * until we know what size to make it. */ 1824 * until we know what size to make it. */
1825 ds->player_background = NULL; 1825 ds->player_background = NULL;
1826 ds->player_bg_saved = FALSE; 1826 ds->player_bg_saved = false;
1827 ds->pbgx = ds->pbgy = -1; 1827 ds->pbgx = ds->pbgy = -1;
1828 1828
1829 ds->p = state->p; /* structure copy */ 1829 ds->p = state->p; /* structure copy */
1830 ds->started = FALSE; 1830 ds->started = false;
1831 ds->grid = snewn(wh, unsigned short); 1831 ds->grid = snewn(wh, unsigned short);
1832 for (i = 0; i < wh; i++) 1832 for (i = 0; i < wh; i++)
1833 ds->grid[i] = UNDRAWN; 1833 ds->grid[i] = UNDRAWN;
@@ -1844,7 +1844,7 @@ static void game_free_drawstate(drawing *dr, game_drawstate *ds)
1844} 1844}
1845 1845
1846static void draw_player(drawing *dr, game_drawstate *ds, int x, int y, 1846static void draw_player(drawing *dr, game_drawstate *ds, int x, int y,
1847 int dead, int hintdir) 1847 bool dead, int hintdir)
1848{ 1848{
1849 if (dead) { 1849 if (dead) {
1850 int coords[DIRECTIONS*4]; 1850 int coords[DIRECTIONS*4];
@@ -2006,7 +2006,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2006 assert(ds->player_background); 2006 assert(ds->player_background);
2007 blitter_load(dr, ds->player_background, ds->pbgx, ds->pbgy); 2007 blitter_load(dr, ds->player_background, ds->pbgx, ds->pbgy);
2008 draw_update(dr, ds->pbgx, ds->pbgy, TILESIZE, TILESIZE); 2008 draw_update(dr, ds->pbgx, ds->pbgy, TILESIZE, TILESIZE);
2009 ds->player_bg_saved = FALSE; 2009 ds->player_bg_saved = false;
2010 } 2010 }
2011 2011
2012 /* 2012 /*
@@ -2032,7 +2032,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2032 draw_line(dr, COORD(x), COORD(0), COORD(x), COORD(h), 2032 draw_line(dr, COORD(x), COORD(0), COORD(x), COORD(h),
2033 COL_LOWLIGHT); 2033 COL_LOWLIGHT);
2034 2034
2035 ds->started = TRUE; 2035 ds->started = true;
2036 } 2036 }
2037 2037
2038 /* 2038 /*
@@ -2158,7 +2158,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2158 (state->dead && !oldstate), 2158 (state->dead && !oldstate),
2159 (!oldstate && state->soln ? 2159 (!oldstate && state->soln ?
2160 state->soln->list[state->solnpos] : -1)); 2160 state->soln->list[state->solnpos] : -1));
2161 ds->player_bg_saved = TRUE; 2161 ds->player_bg_saved = true;
2162} 2162}
2163 2163
2164static float game_anim_length(const game_state *oldstate, 2164static float game_anim_length(const game_state *oldstate,
@@ -2196,9 +2196,9 @@ static int game_status(const game_state *state)
2196 return state->gems == 0 ? +1 : 0; 2196 return state->gems == 0 ? +1 : 0;
2197} 2197}
2198 2198
2199static int game_timing_state(const game_state *state, game_ui *ui) 2199static bool game_timing_state(const game_state *state, game_ui *ui)
2200{ 2200{
2201 return TRUE; 2201 return true;
2202} 2202}
2203 2203
2204static void game_print_size(const game_params *params, float *x, float *y) 2204static void game_print_size(const game_params *params, float *x, float *y)
@@ -2221,15 +2221,15 @@ const struct game thegame = {
2221 encode_params, 2221 encode_params,
2222 free_params, 2222 free_params,
2223 dup_params, 2223 dup_params,
2224 TRUE, game_configure, custom_params, 2224 true, game_configure, custom_params,
2225 validate_params, 2225 validate_params,
2226 new_game_desc, 2226 new_game_desc,
2227 validate_desc, 2227 validate_desc,
2228 new_game, 2228 new_game,
2229 dup_game, 2229 dup_game,
2230 free_game, 2230 free_game,
2231 TRUE, solve_game, 2231 true, solve_game,
2232 TRUE, game_can_format_as_text_now, game_text_format, 2232 true, game_can_format_as_text_now, game_text_format,
2233 new_ui, 2233 new_ui,
2234 free_ui, 2234 free_ui,
2235 encode_ui, 2235 encode_ui,
@@ -2246,8 +2246,8 @@ const struct game thegame = {
2246 game_anim_length, 2246 game_anim_length,
2247 game_flash_length, 2247 game_flash_length,
2248 game_status, 2248 game_status,
2249 FALSE, FALSE, game_print_size, game_print, 2249 false, false, game_print_size, game_print,
2250 TRUE, /* wants_statusbar */ 2250 true, /* wants_statusbar */
2251 FALSE, game_timing_state, 2251 false, game_timing_state,
2252 0, /* flags */ 2252 0, /* flags */
2253}; 2253};
diff --git a/apps/plugins/puzzles/src/keen.c b/apps/plugins/puzzles/src/keen.c
index 423ec8c446..baa1d81802 100644
--- a/apps/plugins/puzzles/src/keen.c
+++ b/apps/plugins/puzzles/src/keen.c
@@ -62,7 +62,8 @@ enum {
62}; 62};
63 63
64struct game_params { 64struct game_params {
65 int w, diff, multiplication_only; 65 int w, diff;
66 bool multiplication_only;
66}; 67};
67 68
68struct clues { 69struct clues {
@@ -77,7 +78,7 @@ struct game_state {
77 struct clues *clues; 78 struct clues *clues;
78 digit *grid; 79 digit *grid;
79 int *pencil; /* bitmaps using bits 1<<1..1<<n */ 80 int *pencil; /* bitmaps using bits 1<<1..1<<n */
80 int completed, cheated; 81 bool completed, cheated;
81}; 82};
82 83
83static game_params *default_params(void) 84static game_params *default_params(void)
@@ -86,31 +87,31 @@ static game_params *default_params(void)
86 87
87 ret->w = 6; 88 ret->w = 6;
88 ret->diff = DIFF_NORMAL; 89 ret->diff = DIFF_NORMAL;
89 ret->multiplication_only = FALSE; 90 ret->multiplication_only = false;
90 91
91 return ret; 92 return ret;
92} 93}
93 94
94static const struct game_params keen_presets[] = { 95static const struct game_params keen_presets[] = {
95 { 4, DIFF_EASY, FALSE }, 96 { 4, DIFF_EASY, false },
96 { 5, DIFF_EASY, FALSE }, 97 { 5, DIFF_EASY, false },
97 { 5, DIFF_EASY, TRUE }, 98 { 5, DIFF_EASY, true },
98 { 6, DIFF_EASY, FALSE }, 99 { 6, DIFF_EASY, false },
99 { 6, DIFF_NORMAL, FALSE }, 100 { 6, DIFF_NORMAL, false },
100 { 6, DIFF_NORMAL, TRUE }, 101 { 6, DIFF_NORMAL, true },
101 { 6, DIFF_HARD, FALSE }, 102 { 6, DIFF_HARD, false },
102 { 6, DIFF_EXTREME, FALSE }, 103 { 6, DIFF_EXTREME, false },
103 { 6, DIFF_UNREASONABLE, FALSE }, 104 { 6, DIFF_UNREASONABLE, false },
104 { 9, DIFF_NORMAL, FALSE }, 105 { 9, DIFF_NORMAL, false },
105}; 106};
106 107
107static int game_fetch_preset(int i, char **name, game_params **params) 108static bool game_fetch_preset(int i, char **name, game_params **params)
108{ 109{
109 game_params *ret; 110 game_params *ret;
110 char buf[80]; 111 char buf[80];
111 112
112 if (i < 0 || i >= lenof(keen_presets)) 113 if (i < 0 || i >= lenof(keen_presets))
113 return FALSE; 114 return false;
114 115
115 ret = snew(game_params); 116 ret = snew(game_params);
116 *ret = keen_presets[i]; /* structure copy */ 117 *ret = keen_presets[i]; /* structure copy */
@@ -120,7 +121,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
120 121
121 *name = dupstr(buf); 122 *name = dupstr(buf);
122 *params = ret; 123 *params = ret;
123 return TRUE; 124 return true;
124} 125}
125 126
126static void free_params(game_params *params) 127static void free_params(game_params *params)
@@ -157,11 +158,11 @@ static void decode_params(game_params *params, char const *string)
157 158
158 if (*p == 'm') { 159 if (*p == 'm') {
159 p++; 160 p++;
160 params->multiplication_only = TRUE; 161 params->multiplication_only = true;
161 } 162 }
162} 163}
163 164
164static char *encode_params(const game_params *params, int full) 165static char *encode_params(const game_params *params, bool full)
165{ 166{
166 char ret[80]; 167 char ret[80];
167 168
@@ -211,7 +212,7 @@ static game_params *custom_params(const config_item *cfg)
211 return ret; 212 return ret;
212} 213}
213 214
214static const char *validate_params(const game_params *params, int full) 215static const char *validate_params(const game_params *params, bool full)
215{ 216{
216 if (params->w < 3 || params->w > 9) 217 if (params->w < 3 || params->w > 9)
217 return "Grid size must be between 3 and 9"; 218 return "Grid size must be between 3 and 9";
@@ -673,10 +674,11 @@ static char *encode_block_structure(char *p, int w, int *dsf)
673 * means 26, zb 27 etc). 674 * means 26, zb 27 etc).
674 */ 675 */
675 for (i = 0; i <= 2*w*(w-1); i++) { 676 for (i = 0; i <= 2*w*(w-1); i++) {
676 int x, y, p0, p1, edge; 677 int x, y, p0, p1;
678 bool edge;
677 679
678 if (i == 2*w*(w-1)) { 680 if (i == 2*w*(w-1)) {
679 edge = TRUE; /* terminating virtual edge */ 681 edge = true; /* terminating virtual edge */
680 } else { 682 } else {
681 if (i < w*(w-1)) { 683 if (i < w*(w-1)) {
682 y = i/(w-1); 684 y = i/(w-1);
@@ -736,7 +738,8 @@ static const char *parse_block_structure(const char **p, int w, int *dsf)
736 dsf_init(dsf, a); 738 dsf_init(dsf, a);
737 739
738 while (**p && (repn > 0 || **p != ',')) { 740 while (**p && (repn > 0 || **p != ',')) {
739 int c, adv; 741 int c;
742 bool adv;
740 743
741 if (repn > 0) { 744 if (repn > 0) {
742 repn--; 745 repn--;
@@ -797,7 +800,7 @@ static const char *parse_block_structure(const char **p, int w, int *dsf)
797} 800}
798 801
799static char *new_game_desc(const game_params *params, random_state *rs, 802static char *new_game_desc(const game_params *params, random_state *rs,
800 char **aux, int interactive) 803 char **aux, bool interactive)
801{ 804{
802 int w = params->w, a = w*w; 805 int w = params->w, a = w*w;
803 digit *grid, *soln; 806 digit *grid, *soln;
@@ -864,7 +867,7 @@ done
864 revorder[order[i]] = i; 867 revorder[order[i]] = i;
865 868
866 for (i = 0; i < a; i++) 869 for (i = 0; i < a; i++)
867 singletons[i] = TRUE; 870 singletons[i] = true;
868 871
869 dsf_init(dsf, a); 872 dsf_init(dsf, a);
870 873
@@ -897,7 +900,7 @@ done
897 * shapes. 900 * shapes.
898 */ 901 */
899 if (best >= 0 && random_upto(rs, 4)) { 902 if (best >= 0 && random_upto(rs, 4)) {
900 singletons[i] = singletons[best] = FALSE; 903 singletons[i] = singletons[best] = false;
901 dsf_merge(dsf, i, best); 904 dsf_merge(dsf, i, best);
902 } 905 }
903 } 906 }
@@ -925,7 +928,7 @@ done
925 best = i+w; 928 best = i+w;
926 929
927 if (best >= 0) { 930 if (best >= 0) {
928 singletons[i] = singletons[best] = FALSE; 931 singletons[i] = singletons[best] = false;
929 dsf_merge(dsf, i, best); 932 dsf_merge(dsf, i, best);
930 } 933 }
931 } 934 }
@@ -1040,7 +1043,7 @@ done
1040 for (i = 0; i < a; i++) 1043 for (i = 0; i < a; i++)
1041 clues[i] = 0; 1044 clues[i] = 0;
1042 while (1) { 1045 while (1) {
1043 int done_something = FALSE; 1046 bool done_something = false;
1044 1047
1045 for (k = 0; k < 4; k++) { 1048 for (k = 0; k < 4; k++) {
1046 long clue; 1049 long clue;
@@ -1073,7 +1076,7 @@ done
1073 } 1076 }
1074 } 1077 }
1075 if (i < a) 1078 if (i < a)
1076 done_something = TRUE; 1079 done_something = true;
1077 } 1080 }
1078 1081
1079 if (!done_something) 1082 if (!done_something)
@@ -1327,7 +1330,8 @@ static game_state *new_game(midend *me, const game_params *params,
1327 state->pencil[i] = 0; 1330 state->pencil[i] = 0;
1328 } 1331 }
1329 1332
1330 state->completed = state->cheated = FALSE; 1333 state->completed = false;
1334 state->cheated = false;
1331 1335
1332 return state; 1336 return state;
1333} 1337}
@@ -1400,9 +1404,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1400 return out; 1404 return out;
1401} 1405}
1402 1406
1403static int game_can_format_as_text_now(const game_params *params) 1407static bool game_can_format_as_text_now(const game_params *params)
1404{ 1408{
1405 return TRUE; 1409 return true;
1406} 1410}
1407 1411
1408static char *game_text_format(const game_state *state) 1412static char *game_text_format(const game_state *state)
@@ -1413,28 +1417,28 @@ static char *game_text_format(const game_state *state)
1413struct game_ui { 1417struct game_ui {
1414 /* 1418 /*
1415 * These are the coordinates of the currently highlighted 1419 * These are the coordinates of the currently highlighted
1416 * square on the grid, if hshow = 1. 1420 * square on the grid, if hshow is true.
1417 */ 1421 */
1418 int hx, hy; 1422 int hx, hy;
1419 /* 1423 /*
1420 * This indicates whether the current highlight is a 1424 * This indicates whether the current highlight is a
1421 * pencil-mark one or a real one. 1425 * pencil-mark one or a real one.
1422 */ 1426 */
1423 int hpencil; 1427 bool hpencil;
1424 /* 1428 /*
1425 * This indicates whether or not we're showing the highlight 1429 * This indicates whether or not we're showing the highlight
1426 * (used to be hx = hy = -1); important so that when we're 1430 * (used to be hx = hy = -1); important so that when we're
1427 * using the cursor keys it doesn't keep coming back at a 1431 * using the cursor keys it doesn't keep coming back at a
1428 * fixed position. When hshow = 1, pressing a valid number 1432 * fixed position. When true, pressing a valid number or letter
1429 * or letter key or Space will enter that number or letter in the grid. 1433 * key or Space will enter that number or letter in the grid.
1430 */ 1434 */
1431 int hshow; 1435 bool hshow;
1432 /* 1436 /*
1433 * This indicates whether we're using the highlight as a cursor; 1437 * This indicates whether we're using the highlight as a cursor;
1434 * it means that it doesn't vanish on a keypress, and that it is 1438 * it means that it doesn't vanish on a keypress, and that it is
1435 * allowed on immutable squares. 1439 * allowed on immutable squares.
1436 */ 1440 */
1437 int hcursor; 1441 bool hcursor;
1438}; 1442};
1439 1443
1440static game_ui *new_ui(const game_state *state) 1444static game_ui *new_ui(const game_state *state)
@@ -1442,7 +1446,9 @@ static game_ui *new_ui(const game_state *state)
1442 game_ui *ui = snew(game_ui); 1446 game_ui *ui = snew(game_ui);
1443 1447
1444 ui->hx = ui->hy = 0; 1448 ui->hx = ui->hy = 0;
1445 ui->hpencil = ui->hshow = ui->hcursor = 0; 1449 ui->hpencil = false;
1450 ui->hshow = false;
1451 ui->hcursor = false;
1446 1452
1447 return ui; 1453 return ui;
1448} 1454}
@@ -1473,7 +1479,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1473 */ 1479 */
1474 if (ui->hshow && ui->hpencil && !ui->hcursor && 1480 if (ui->hshow && ui->hpencil && !ui->hcursor &&
1475 newstate->grid[ui->hy * w + ui->hx] != 0) { 1481 newstate->grid[ui->hy * w + ui->hx] != 0) {
1476 ui->hshow = 0; 1482 ui->hshow = false;
1477 } 1483 }
1478} 1484}
1479 1485
@@ -1495,26 +1501,27 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1495 1501
1496struct game_drawstate { 1502struct game_drawstate {
1497 int tilesize; 1503 int tilesize;
1498 int started; 1504 bool started;
1499 long *tiles; 1505 long *tiles;
1500 long *errors; 1506 long *errors;
1501 char *minus_sign, *times_sign, *divide_sign; 1507 char *minus_sign, *times_sign, *divide_sign;
1502}; 1508};
1503 1509
1504static int check_errors(const game_state *state, long *errors) 1510static bool check_errors(const game_state *state, long *errors)
1505{ 1511{
1506 int w = state->par.w, a = w*w; 1512 int w = state->par.w, a = w*w;
1507 int i, j, x, y, errs = FALSE; 1513 int i, j, x, y;
1514 bool errs = false;
1508 long *cluevals; 1515 long *cluevals;
1509 int *full; 1516 bool *full;
1510 1517
1511 cluevals = snewn(a, long); 1518 cluevals = snewn(a, long);
1512 full = snewn(a, int); 1519 full = snewn(a, bool);
1513 1520
1514 if (errors) 1521 if (errors)
1515 for (i = 0; i < a; i++) { 1522 for (i = 0; i < a; i++) {
1516 errors[i] = 0; 1523 errors[i] = 0;
1517 full[i] = TRUE; 1524 full[i] = true;
1518 } 1525 }
1519 1526
1520 for (i = 0; i < a; i++) { 1527 for (i = 0; i < a; i++) {
@@ -1550,14 +1557,14 @@ static int check_errors(const game_state *state, long *errors)
1550 } 1557 }
1551 1558
1552 if (!state->grid[i]) 1559 if (!state->grid[i])
1553 full[j] = FALSE; 1560 full[j] = false;
1554 } 1561 }
1555 1562
1556 for (i = 0; i < a; i++) { 1563 for (i = 0; i < a; i++) {
1557 j = dsf_canonify(state->clues->dsf, i); 1564 j = dsf_canonify(state->clues->dsf, i);
1558 if (j == i) { 1565 if (j == i) {
1559 if ((state->clues->clues[j] & ~CMASK) != cluevals[i]) { 1566 if ((state->clues->clues[j] & ~CMASK) != cluevals[i]) {
1560 errs = TRUE; 1567 errs = true;
1561 if (errors && full[j]) 1568 if (errors && full[j])
1562 errors[j] |= DF_ERR_CLUE; 1569 errors[j] |= DF_ERR_CLUE;
1563 } 1570 }
@@ -1576,7 +1583,7 @@ static int check_errors(const game_state *state, long *errors)
1576 } 1583 }
1577 1584
1578 if (mask != (1 << (w+1)) - (1 << 1)) { 1585 if (mask != (1 << (w+1)) - (1 << 1)) {
1579 errs = TRUE; 1586 errs = true;
1580 errmask &= ~1; 1587 errmask &= ~1;
1581 if (errors) { 1588 if (errors) {
1582 for (x = 0; x < w; x++) 1589 for (x = 0; x < w; x++)
@@ -1595,7 +1602,7 @@ static int check_errors(const game_state *state, long *errors)
1595 } 1602 }
1596 1603
1597 if (mask != (1 << (w+1)) - (1 << 1)) { 1604 if (mask != (1 << (w+1)) - (1 << 1)) {
1598 errs = TRUE; 1605 errs = true;
1599 errmask &= ~1; 1606 errmask &= ~1;
1600 if (errors) { 1607 if (errors) {
1601 for (y = 0; y < w; y++) 1608 for (y = 0; y < w; y++)
@@ -1624,15 +1631,15 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1624 if (tx >= 0 && tx < w && ty >= 0 && ty < w) { 1631 if (tx >= 0 && tx < w && ty >= 0 && ty < w) {
1625 if (button == LEFT_BUTTON) { 1632 if (button == LEFT_BUTTON) {
1626 if (tx == ui->hx && ty == ui->hy && 1633 if (tx == ui->hx && ty == ui->hy &&
1627 ui->hshow && ui->hpencil == 0) { 1634 ui->hshow && !ui->hpencil) {
1628 ui->hshow = 0; 1635 ui->hshow = false;
1629 } else { 1636 } else {
1630 ui->hx = tx; 1637 ui->hx = tx;
1631 ui->hy = ty; 1638 ui->hy = ty;
1632 ui->hshow = 1; 1639 ui->hshow = true;
1633 ui->hpencil = 0; 1640 ui->hpencil = false;
1634 } 1641 }
1635 ui->hcursor = 0; 1642 ui->hcursor = false;
1636 return UI_UPDATE; 1643 return UI_UPDATE;
1637 } 1644 }
1638 if (button == RIGHT_BUTTON) { 1645 if (button == RIGHT_BUTTON) {
@@ -1642,29 +1649,30 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1642 if (state->grid[ty*w+tx] == 0) { 1649 if (state->grid[ty*w+tx] == 0) {
1643 if (tx == ui->hx && ty == ui->hy && 1650 if (tx == ui->hx && ty == ui->hy &&
1644 ui->hshow && ui->hpencil) { 1651 ui->hshow && ui->hpencil) {
1645 ui->hshow = 0; 1652 ui->hshow = false;
1646 } else { 1653 } else {
1647 ui->hpencil = 1; 1654 ui->hpencil = true;
1648 ui->hx = tx; 1655 ui->hx = tx;
1649 ui->hy = ty; 1656 ui->hy = ty;
1650 ui->hshow = 1; 1657 ui->hshow = true;
1651 } 1658 }
1652 } else { 1659 } else {
1653 ui->hshow = 0; 1660 ui->hshow = false;
1654 } 1661 }
1655 ui->hcursor = 0; 1662 ui->hcursor = false;
1656 return UI_UPDATE; 1663 return UI_UPDATE;
1657 } 1664 }
1658 } 1665 }
1659 if (IS_CURSOR_MOVE(button)) { 1666 if (IS_CURSOR_MOVE(button)) {
1660 move_cursor(button, &ui->hx, &ui->hy, w, w, 0); 1667 move_cursor(button, &ui->hx, &ui->hy, w, w, false);
1661 ui->hshow = ui->hcursor = 1; 1668 ui->hshow = true;
1669 ui->hcursor = true;
1662 return UI_UPDATE; 1670 return UI_UPDATE;
1663 } 1671 }
1664 if (ui->hshow && 1672 if (ui->hshow &&
1665 (button == CURSOR_SELECT)) { 1673 (button == CURSOR_SELECT)) {
1666 ui->hpencil = 1 - ui->hpencil; 1674 ui->hpencil ^= 1;
1667 ui->hcursor = 1; 1675 ui->hcursor = true;
1668 return UI_UPDATE; 1676 return UI_UPDATE;
1669 } 1677 }
1670 1678
@@ -1685,7 +1693,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1685 sprintf(buf, "%c%d,%d,%d", 1693 sprintf(buf, "%c%d,%d,%d",
1686 (char)(ui->hpencil && n > 0 ? 'P' : 'R'), ui->hx, ui->hy, n); 1694 (char)(ui->hpencil && n > 0 ? 'P' : 'R'), ui->hx, ui->hy, n);
1687 1695
1688 if (!ui->hcursor) ui->hshow = 0; 1696 if (!ui->hcursor) ui->hshow = false;
1689 1697
1690 return dupstr(buf); 1698 return dupstr(buf);
1691 } 1699 }
@@ -1704,7 +1712,7 @@ static game_state *execute_move(const game_state *from, const char *move)
1704 1712
1705 if (move[0] == 'S') { 1713 if (move[0] == 'S') {
1706 ret = dup_game(from); 1714 ret = dup_game(from);
1707 ret->completed = ret->cheated = TRUE; 1715 ret->completed = ret->cheated = true;
1708 1716
1709 for (i = 0; i < a; i++) { 1717 for (i = 0; i < a; i++) {
1710 if (move[i+1] < '1' || move[i+1] > '0'+w) { 1718 if (move[i+1] < '1' || move[i+1] > '0'+w) {
@@ -1733,7 +1741,7 @@ static game_state *execute_move(const game_state *from, const char *move)
1733 ret->pencil[y*w+x] = 0; 1741 ret->pencil[y*w+x] = 0;
1734 1742
1735 if (!ret->completed && !check_errors(ret, NULL)) 1743 if (!ret->completed && !check_errors(ret, NULL))
1736 ret->completed = TRUE; 1744 ret->completed = true;
1737 } 1745 }
1738 return ret; 1746 return ret;
1739 } else if (move[0] == 'M') { 1747 } else if (move[0] == 'M') {
@@ -1816,7 +1824,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1816 int i; 1824 int i;
1817 1825
1818 ds->tilesize = 0; 1826 ds->tilesize = 0;
1819 ds->started = FALSE; 1827 ds->started = false;
1820 ds->tiles = snewn(a, long); 1828 ds->tiles = snewn(a, long);
1821 for (i = 0; i < a; i++) 1829 for (i = 0; i < a; i++)
1822 ds->tiles[i] = -1; 1830 ds->tiles[i] = -1;
@@ -1839,7 +1847,7 @@ static void game_free_drawstate(drawing *dr, game_drawstate *ds)
1839} 1847}
1840 1848
1841static void draw_tile(drawing *dr, game_drawstate *ds, struct clues *clues, 1849static void draw_tile(drawing *dr, game_drawstate *ds, struct clues *clues,
1842 int x, int y, long tile, int only_one_op) 1850 int x, int y, long tile, bool only_one_op)
1843{ 1851{
1844 int w = clues->w /* , a = w*w */; 1852 int w = clues->w /* , a = w*w */;
1845 int tx, ty, tw, th; 1853 int tx, ty, tw, th;
@@ -2056,7 +2064,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2056 2064
2057 draw_update(dr, 0, 0, SIZE(w), SIZE(w)); 2065 draw_update(dr, 0, 0, SIZE(w), SIZE(w));
2058 2066
2059 ds->started = TRUE; 2067 ds->started = true;
2060 } 2068 }
2061 2069
2062 check_errors(state, ds->errors); 2070 check_errors(state, ds->errors);
@@ -2109,11 +2117,11 @@ static int game_status(const game_state *state)
2109 return state->completed ? +1 : 0; 2117 return state->completed ? +1 : 0;
2110} 2118}
2111 2119
2112static int game_timing_state(const game_state *state, game_ui *ui) 2120static bool game_timing_state(const game_state *state, game_ui *ui)
2113{ 2121{
2114 if (state->completed) 2122 if (state->completed)
2115 return FALSE; 2123 return false;
2116 return TRUE; 2124 return true;
2117} 2125}
2118 2126
2119static void game_print_size(const game_params *params, float *x, float *y) 2127static void game_print_size(const game_params *params, float *x, float *y)
@@ -2362,15 +2370,15 @@ const struct game thegame = {
2362 encode_params, 2370 encode_params,
2363 free_params, 2371 free_params,
2364 dup_params, 2372 dup_params,
2365 TRUE, game_configure, custom_params, 2373 true, game_configure, custom_params,
2366 validate_params, 2374 validate_params,
2367 new_game_desc, 2375 new_game_desc,
2368 validate_desc, 2376 validate_desc,
2369 new_game, 2377 new_game,
2370 dup_game, 2378 dup_game,
2371 free_game, 2379 free_game,
2372 TRUE, solve_game, 2380 true, solve_game,
2373 FALSE, game_can_format_as_text_now, game_text_format, 2381 false, game_can_format_as_text_now, game_text_format,
2374 new_ui, 2382 new_ui,
2375 free_ui, 2383 free_ui,
2376 encode_ui, 2384 encode_ui,
@@ -2387,9 +2395,9 @@ const struct game thegame = {
2387 game_anim_length, 2395 game_anim_length,
2388 game_flash_length, 2396 game_flash_length,
2389 game_status, 2397 game_status,
2390 TRUE, FALSE, game_print_size, game_print, 2398 true, false, game_print_size, game_print,
2391 FALSE, /* wants_statusbar */ 2399 false, /* wants_statusbar */
2392 FALSE, game_timing_state, 2400 false, game_timing_state,
2393 REQUIRE_RBUTTON | REQUIRE_NUMPAD, /* flags */ 2401 REQUIRE_RBUTTON | REQUIRE_NUMPAD, /* flags */
2394}; 2402};
2395 2403
@@ -2403,15 +2411,16 @@ int main(int argc, char **argv)
2403 game_state *s; 2411 game_state *s;
2404 char *id = NULL, *desc; 2412 char *id = NULL, *desc;
2405 const char *err; 2413 const char *err;
2406 int grade = FALSE; 2414 bool grade = false;
2407 int ret, diff, really_show_working = FALSE; 2415 int ret, diff;
2416 bool really_show_working = false;
2408 2417
2409 while (--argc > 0) { 2418 while (--argc > 0) {
2410 char *p = *++argv; 2419 char *p = *++argv;
2411 if (!strcmp(p, "-v")) { 2420 if (!strcmp(p, "-v")) {
2412 really_show_working = TRUE; 2421 really_show_working = true;
2413 } else if (!strcmp(p, "-g")) { 2422 } else if (!strcmp(p, "-g")) {
2414 grade = TRUE; 2423 grade = true;
2415 } else if (*p == '-') { 2424 } else if (*p == '-') {
2416 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p); 2425 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p);
2417 return 1; 2426 return 1;
@@ -2447,7 +2456,7 @@ int main(int argc, char **argv)
2447 * the puzzle internally before doing anything else. 2456 * the puzzle internally before doing anything else.
2448 */ 2457 */
2449 ret = -1; /* placate optimiser */ 2458 ret = -1; /* placate optimiser */
2450 solver_show_working = FALSE; 2459 solver_show_working = 0;
2451 for (diff = 0; diff < DIFFCOUNT; diff++) { 2460 for (diff = 0; diff < DIFFCOUNT; diff++) {
2452 memset(s->grid, 0, p->w * p->w); 2461 memset(s->grid, 0, p->w * p->w);
2453 ret = solver(p->w, s->clues->dsf, s->clues->clues, 2462 ret = solver(p->w, s->clues->dsf, s->clues->clues,
@@ -2468,7 +2477,7 @@ int main(int argc, char **argv)
2468 else 2477 else
2469 printf("Difficulty rating: %s\n", keen_diffnames[ret]); 2478 printf("Difficulty rating: %s\n", keen_diffnames[ret]);
2470 } else { 2479 } else {
2471 solver_show_working = really_show_working; 2480 solver_show_working = really_show_working ? 1 : 0;
2472 memset(s->grid, 0, p->w * p->w); 2481 memset(s->grid, 0, p->w * p->w);
2473 ret = solver(p->w, s->clues->dsf, s->clues->clues, 2482 ret = solver(p->w, s->clues->dsf, s->clues->clues,
2474 s->grid, diff); 2483 s->grid, diff);
diff --git a/apps/plugins/puzzles/src/latin.c b/apps/plugins/puzzles/src/latin.c
index 6e805455bf..9d06ccd938 100644
--- a/apps/plugins/puzzles/src/latin.c
+++ b/apps/plugins/puzzles/src/latin.c
@@ -43,21 +43,21 @@ void latin_solver_place(struct latin_solver *solver, int x, int y, int n)
43 */ 43 */
44 for (i = 1; i <= o; i++) 44 for (i = 1; i <= o; i++)
45 if (i != n) 45 if (i != n)
46 cube(x,y,i) = FALSE; 46 cube(x,y,i) = false;
47 47
48 /* 48 /*
49 * Rule out this number in all other positions in the row. 49 * Rule out this number in all other positions in the row.
50 */ 50 */
51 for (i = 0; i < o; i++) 51 for (i = 0; i < o; i++)
52 if (i != y) 52 if (i != y)
53 cube(x,i,n) = FALSE; 53 cube(x,i,n) = false;
54 54
55 /* 55 /*
56 * Rule out this number in all other positions in the column. 56 * Rule out this number in all other positions in the column.
57 */ 57 */
58 for (i = 0; i < o; i++) 58 for (i = 0; i < o; i++)
59 if (i != x) 59 if (i != x)
60 cube(i,y,n) = FALSE; 60 cube(i,y,n) = false;
61 61
62 /* 62 /*
63 * Enter the number in the result grid. 63 * Enter the number in the result grid.
@@ -68,7 +68,7 @@ void latin_solver_place(struct latin_solver *solver, int x, int y, int n)
68 * Cross out this number from the list of numbers left to place 68 * Cross out this number from the list of numbers left to place
69 * in its row, its column and its block. 69 * in its row, its column and its block.
70 */ 70 */
71 solver->row[y*o+n-1] = solver->col[x*o+n-1] = TRUE; 71 solver->row[y*o+n-1] = solver->col[x*o+n-1] = true;
72} 72}
73 73
74int latin_solver_elim(struct latin_solver *solver, int start, int step 74int latin_solver_elim(struct latin_solver *solver, int start, int step
@@ -170,8 +170,8 @@ int latin_solver_set(struct latin_solver *solver,
170 * any row with a solitary 1 - and discarding that row and the 170 * any row with a solitary 1 - and discarding that row and the
171 * column containing the 1. 171 * column containing the 1.
172 */ 172 */
173 memset(rowidx, TRUE, o); 173 memset(rowidx, true, o);
174 memset(colidx, TRUE, o); 174 memset(colidx, true, o);
175 for (i = 0; i < o; i++) { 175 for (i = 0; i < o; i++) {
176 int count = 0, first = -1; 176 int count = 0, first = -1;
177 for (j = 0; j < o; j++) 177 for (j = 0; j < o; j++)
@@ -180,7 +180,7 @@ int latin_solver_set(struct latin_solver *solver,
180 180
181 if (count == 0) return -1; 181 if (count == 0) return -1;
182 if (count == 1) 182 if (count == 1)
183 rowidx[i] = colidx[first] = FALSE; 183 rowidx[i] = colidx[first] = false;
184 } 184 }
185 185
186 /* 186 /*
@@ -226,10 +226,10 @@ int latin_solver_set(struct latin_solver *solver,
226 */ 226 */
227 int rows = 0; 227 int rows = 0;
228 for (i = 0; i < n; i++) { 228 for (i = 0; i < n; i++) {
229 int ok = TRUE; 229 bool ok = true;
230 for (j = 0; j < n; j++) 230 for (j = 0; j < n; j++)
231 if (set[j] && grid[i*o+j]) { 231 if (set[j] && grid[i*o+j]) {
232 ok = FALSE; 232 ok = false;
233 break; 233 break;
234 } 234 }
235 if (ok) 235 if (ok)
@@ -261,7 +261,7 @@ int latin_solver_set(struct latin_solver *solver,
261 } 261 }
262 262
263 if (rows >= n - count) { 263 if (rows >= n - count) {
264 int progress = FALSE; 264 bool progress = false;
265 265
266 /* 266 /*
267 * We've got one! Now, for each row which _doesn't_ 267 * We've got one! Now, for each row which _doesn't_
@@ -275,10 +275,10 @@ int latin_solver_set(struct latin_solver *solver,
275 * positions in the cube to meddle with. 275 * positions in the cube to meddle with.
276 */ 276 */
277 for (i = 0; i < n; i++) { 277 for (i = 0; i < n; i++) {
278 int ok = TRUE; 278 bool ok = true;
279 for (j = 0; j < n; j++) 279 for (j = 0; j < n; j++)
280 if (set[j] && grid[i*o+j]) { 280 if (set[j] && grid[i*o+j]) {
281 ok = FALSE; 281 ok = false;
282 break; 282 break;
283 } 283 }
284 if (!ok) { 284 if (!ok) {
@@ -310,8 +310,8 @@ int latin_solver_set(struct latin_solver *solver,
310 names[pn-1], px+1, py+1); 310 names[pn-1], px+1, py+1);
311 } 311 }
312#endif 312#endif
313 progress = TRUE; 313 progress = true;
314 solver->cube[fpos] = FALSE; 314 solver->cube[fpos] = false;
315 } 315 }
316 } 316 }
317 } 317 }
@@ -522,7 +522,7 @@ int latin_solver_forcing(struct latin_solver *solver,
522 xt+1, yt+1); 522 xt+1, yt+1);
523 } 523 }
524#endif 524#endif
525 cube(xt, yt, orign) = FALSE; 525 cube(xt, yt, orign) = false;
526 return 1; 526 return 1;
527 } 527 }
528 } 528 }
@@ -570,12 +570,12 @@ void latin_solver_alloc(struct latin_solver *solver, digit *grid, int o)
570 solver->o = o; 570 solver->o = o;
571 solver->cube = snewn(o*o*o, unsigned char); 571 solver->cube = snewn(o*o*o, unsigned char);
572 solver->grid = grid; /* write straight back to the input */ 572 solver->grid = grid; /* write straight back to the input */
573 memset(solver->cube, TRUE, o*o*o); 573 memset(solver->cube, 1, o*o*o);
574 574
575 solver->row = snewn(o*o, unsigned char); 575 solver->row = snewn(o*o, unsigned char);
576 solver->col = snewn(o*o, unsigned char); 576 solver->col = snewn(o*o, unsigned char);
577 memset(solver->row, FALSE, o*o); 577 memset(solver->row, 0, o*o);
578 memset(solver->col, FALSE, o*o); 578 memset(solver->col, 0, o*o);
579 579
580 for (x = 0; x < o; x++) 580 for (x = 0; x < o; x++)
581 for (y = 0; y < o; y++) 581 for (y = 0; y < o; y++)
@@ -650,7 +650,7 @@ int latin_solver_diff_simple(struct latin_solver *solver)
650 650
651int latin_solver_diff_set(struct latin_solver *solver, 651int latin_solver_diff_set(struct latin_solver *solver,
652 struct latin_solver_scratch *scratch, 652 struct latin_solver_scratch *scratch,
653 int extreme) 653 bool extreme)
654{ 654{
655 int x, y, n, ret, o = solver->o; 655 int x, y, n, ret, o = solver->o;
656#ifdef STANDALONE_SOLVER 656#ifdef STANDALONE_SOLVER
@@ -908,9 +908,9 @@ static int latin_solver_top(struct latin_solver *solver, int maxdiff,
908 if (ret == 0 && i == diff_simple) 908 if (ret == 0 && i == diff_simple)
909 ret = latin_solver_diff_simple(solver); 909 ret = latin_solver_diff_simple(solver);
910 if (ret == 0 && i == diff_set_0) 910 if (ret == 0 && i == diff_set_0)
911 ret = latin_solver_diff_set(solver, scratch, 0); 911 ret = latin_solver_diff_set(solver, scratch, false);
912 if (ret == 0 && i == diff_set_1) 912 if (ret == 0 && i == diff_set_1)
913 ret = latin_solver_diff_set(solver, scratch, 1); 913 ret = latin_solver_diff_set(solver, scratch, true);
914 if (ret == 0 && i == diff_forcing) 914 if (ret == 0 && i == diff_forcing)
915 ret = latin_solver_forcing(solver, scratch); 915 ret = latin_solver_forcing(solver, scratch);
916 916
@@ -1244,12 +1244,12 @@ static int latin_check_cmp(void *v1, void *v2)
1244 1244
1245#define ELT(sq,x,y) (sq[((y)*order)+(x)]) 1245#define ELT(sq,x,y) (sq[((y)*order)+(x)])
1246 1246
1247/* returns non-zero if sq is not a latin square. */ 1247/* returns true if sq is not a latin square. */
1248int latin_check(digit *sq, int order) 1248bool latin_check(digit *sq, int order)
1249{ 1249{
1250 tree234 *dict = newtree234(latin_check_cmp); 1250 tree234 *dict = newtree234(latin_check_cmp);
1251 int c, r; 1251 int c, r;
1252 int ret = 0; 1252 bool ret = false;
1253 lcparams *lcp, lc, *aret; 1253 lcparams *lcp, lc, *aret;
1254 1254
1255 /* Use a tree234 as a simple hash table, go through the square 1255 /* Use a tree234 as a simple hash table, go through the square
@@ -1272,10 +1272,10 @@ int latin_check(digit *sq, int order)
1272 1272
1273 /* There should be precisely 'order' letters in the alphabet, 1273 /* There should be precisely 'order' letters in the alphabet,
1274 * each occurring 'order' times (making the OxO tree) */ 1274 * each occurring 'order' times (making the OxO tree) */
1275 if (count234(dict) != order) ret = 1; 1275 if (count234(dict) != order) ret = true;
1276 else { 1276 else {
1277 for (c = 0; (lcp = index234(dict, c)) != NULL; c++) { 1277 for (c = 0; (lcp = index234(dict, c)) != NULL; c++) {
1278 if (lcp->count != order) ret = 1; 1278 if (lcp->count != order) ret = true;
1279 } 1279 }
1280 } 1280 }
1281 for (c = 0; (lcp = index234(dict, c)) != NULL; c++) 1281 for (c = 0; (lcp = index234(dict, c)) != NULL; c++)
diff --git a/apps/plugins/puzzles/src/latin.h b/apps/plugins/puzzles/src/latin.h
index e13050e9a8..ff6f07c922 100644
--- a/apps/plugins/puzzles/src/latin.h
+++ b/apps/plugins/puzzles/src/latin.h
@@ -14,11 +14,11 @@ extern int solver_show_working, solver_recurse_depth;
14struct latin_solver { 14struct latin_solver {
15 int o; /* order of latin square */ 15 int o; /* order of latin square */
16 unsigned char *cube; /* o^3, indexed by x, y, and digit: 16 unsigned char *cube; /* o^3, indexed by x, y, and digit:
17 TRUE in that position indicates a possibility */ 17 true in that position indicates a possibility */
18 digit *grid; /* o^2, indexed by x and y: for final deductions */ 18 digit *grid; /* o^2, indexed by x and y: for final deductions */
19 19
20 unsigned char *row; /* o^2: row[y*cr+n-1] TRUE if n is in row y */ 20 unsigned char *row; /* o^2: row[y*cr+n-1] true if n is in row y */
21 unsigned char *col; /* o^2: col[x*cr+n-1] TRUE if n is in col x */ 21 unsigned char *col; /* o^2: col[x*cr+n-1] true if n is in col x */
22 22
23#ifdef STANDALONE_SOLVER 23#ifdef STANDALONE_SOLVER
24 char **names; /* o: names[n-1] gives name of 'digit' n */ 24 char **names; /* o: names[n-1] gives name of 'digit' n */
@@ -78,11 +78,11 @@ void latin_solver_free_scratch(struct latin_solver_scratch *scratch);
78/* Looped positional elimination */ 78/* Looped positional elimination */
79int latin_solver_diff_simple(struct latin_solver *solver); 79int latin_solver_diff_simple(struct latin_solver *solver);
80 80
81/* Looped set elimination; *extreme is set if it used 81/* Looped set elimination; extreme permits use of the more difficult
82 * the more difficult single-number elimination. */ 82 * single-number elimination. */
83int latin_solver_diff_set(struct latin_solver *solver, 83int latin_solver_diff_set(struct latin_solver *solver,
84 struct latin_solver_scratch *scratch, 84 struct latin_solver_scratch *scratch,
85 int extreme); 85 bool extreme);
86 86
87typedef int (*usersolver_t)(struct latin_solver *solver, void *ctx); 87typedef int (*usersolver_t)(struct latin_solver *solver, void *ctx);
88typedef void *(*ctxnew_t)(void *ctx); 88typedef void *(*ctxnew_t)(void *ctx);
@@ -115,7 +115,7 @@ digit *latin_generate(int o, random_state *rs);
115/* The order of the latin rectangle is max(w,h). */ 115/* The order of the latin rectangle is max(w,h). */
116digit *latin_generate_rect(int w, int h, random_state *rs); 116digit *latin_generate_rect(int w, int h, random_state *rs);
117 117
118int latin_check(digit *sq, int order); /* !0 => not a latin square */ 118bool latin_check(digit *sq, int order); /* true => not a latin square */
119 119
120void latin_debug(digit *sq, int order); 120void latin_debug(digit *sq, int order);
121 121
diff --git a/apps/plugins/puzzles/src/lightup.c b/apps/plugins/puzzles/src/lightup.c
index acee853366..90811d5475 100644
--- a/apps/plugins/puzzles/src/lightup.c
+++ b/apps/plugins/puzzles/src/lightup.c
@@ -117,7 +117,7 @@ struct game_state {
117 of surrounding lights. For non-black squares, 117 of surrounding lights. For non-black squares,
118 the number of times it's lit. size h*w*/ 118 the number of times it's lit. size h*w*/
119 unsigned int *flags; /* size h*w */ 119 unsigned int *flags; /* size h*w */
120 int completed, used_solve; 120 bool completed, used_solve;
121}; 121};
122 122
123#define GRID(gs,grid,x,y) (gs->grid[(y)*((gs)->w) + (x)]) 123#define GRID(gs,grid,x,y) (gs->grid[(y)*((gs)->w) + (x)])
@@ -129,7 +129,7 @@ struct game_state {
129typedef struct { 129typedef struct {
130 int ox,oy; 130 int ox,oy;
131 int minx, maxx, miny, maxy; 131 int minx, maxx, miny, maxy;
132 int include_origin; 132 bool include_origin;
133} ll_data; 133} ll_data;
134 134
135/* Macro that executes 'block' once per light in lld, including 135/* Macro that executes 'block' once per light in lld, including
@@ -179,7 +179,7 @@ static void get_surrounds(const game_state *state, int ox, int oy,
179 179
180#define DEFAULT_PRESET 0 180#define DEFAULT_PRESET 0
181 181
182const struct game_params lightup_presets[] = { 182static const struct game_params lightup_presets[] = {
183 { 7, 7, 20, SYMM_ROT4, 0 }, 183 { 7, 7, 20, SYMM_ROT4, 0 },
184 { 7, 7, 20, SYMM_ROT4, 1 }, 184 { 7, 7, 20, SYMM_ROT4, 1 },
185 { 7, 7, 20, SYMM_ROT4, 2 }, 185 { 7, 7, 20, SYMM_ROT4, 2 },
@@ -204,13 +204,13 @@ static game_params *default_params(void)
204 return ret; 204 return ret;
205} 205}
206 206
207static int game_fetch_preset(int i, char **name, game_params **params) 207static bool game_fetch_preset(int i, char **name, game_params **params)
208{ 208{
209 game_params *ret; 209 game_params *ret;
210 char buf[80]; 210 char buf[80];
211 211
212 if (i < 0 || i >= lenof(lightup_presets)) 212 if (i < 0 || i >= lenof(lightup_presets))
213 return FALSE; 213 return false;
214 214
215 ret = default_params(); 215 ret = default_params();
216 *ret = lightup_presets[i]; 216 *ret = lightup_presets[i];
@@ -222,7 +222,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
222 ret->difficulty == 1 ? "tricky" : "easy"); 222 ret->difficulty == 1 ? "tricky" : "easy");
223 *name = dupstr(buf); 223 *name = dupstr(buf);
224 224
225 return TRUE; 225 return true;
226} 226}
227 227
228static void free_params(game_params *params) 228static void free_params(game_params *params)
@@ -274,7 +274,7 @@ static void decode_params(game_params *params, char const *string)
274 } 274 }
275} 275}
276 276
277static char *encode_params(const game_params *params, int full) 277static char *encode_params(const game_params *params, bool full)
278{ 278{
279 char buf[80]; 279 char buf[80];
280 280
@@ -342,7 +342,7 @@ static game_params *custom_params(const config_item *cfg)
342 return ret; 342 return ret;
343} 343}
344 344
345static const char *validate_params(const game_params *params, int full) 345static const char *validate_params(const game_params *params, bool full)
346{ 346{
347 if (params->w < 2 || params->h < 2) 347 if (params->w < 2 || params->h < 2)
348 return "Width and height must be at least 2"; 348 return "Width and height must be at least 2";
@@ -374,7 +374,8 @@ static game_state *new_state(const game_params *params)
374 memset(ret->lights, 0, ret->w * ret->h * sizeof(int)); 374 memset(ret->lights, 0, ret->w * ret->h * sizeof(int));
375 ret->flags = snewn(ret->w * ret->h, unsigned int); 375 ret->flags = snewn(ret->w * ret->h, unsigned int);
376 memset(ret->flags, 0, ret->w * ret->h * sizeof(unsigned int)); 376 memset(ret->flags, 0, ret->w * ret->h * sizeof(unsigned int));
377 ret->completed = ret->used_solve = 0; 377 ret->completed = false;
378 ret->used_solve = false;
378 return ret; 379 return ret;
379} 380}
380 381
@@ -445,8 +446,8 @@ static void debug_state(game_state *state)
445/* These are split up because occasionally functions are only 446/* These are split up because occasionally functions are only
446 * interested in one particular aspect. */ 447 * interested in one particular aspect. */
447 448
448/* Returns non-zero if all grid spaces are lit. */ 449/* Returns true if all grid spaces are lit. */
449static int grid_lit(game_state *state) 450static bool grid_lit(game_state *state)
450{ 451{
451 int x, y; 452 int x, y;
452 453
@@ -454,14 +455,14 @@ static int grid_lit(game_state *state)
454 for (y = 0; y < state->h; y++) { 455 for (y = 0; y < state->h; y++) {
455 if (GRID(state,flags,x,y) & F_BLACK) continue; 456 if (GRID(state,flags,x,y) & F_BLACK) continue;
456 if (GRID(state,lights,x,y) == 0) 457 if (GRID(state,lights,x,y) == 0)
457 return 0; 458 return false;
458 } 459 }
459 } 460 }
460 return 1; 461 return true;
461} 462}
462 463
463/* Returns non-zero if any lights are lit by other lights. */ 464/* Returns non-zero if any lights are lit by other lights. */
464static int grid_overlap(game_state *state) 465static bool grid_overlap(game_state *state)
465{ 466{
466 int x, y; 467 int x, y;
467 468
@@ -469,13 +470,13 @@ static int grid_overlap(game_state *state)
469 for (y = 0; y < state->h; y++) { 470 for (y = 0; y < state->h; y++) {
470 if (!(GRID(state, flags, x, y) & F_LIGHT)) continue; 471 if (!(GRID(state, flags, x, y) & F_LIGHT)) continue;
471 if (GRID(state, lights, x, y) > 1) 472 if (GRID(state, lights, x, y) > 1)
472 return 1; 473 return true;
473 } 474 }
474 } 475 }
475 return 0; 476 return false;
476} 477}
477 478
478static int number_wrong(const game_state *state, int x, int y) 479static bool number_wrong(const game_state *state, int x, int y)
479{ 480{
480 surrounds s; 481 surrounds s;
481 int i, n, empty, lights = GRID(state, lights, x, y); 482 int i, n, empty, lights = GRID(state, lights, x, y);
@@ -511,7 +512,7 @@ static int number_wrong(const game_state *state, int x, int y)
511 return (n > lights || (n + empty < lights)); 512 return (n > lights || (n + empty < lights));
512} 513}
513 514
514static int number_correct(game_state *state, int x, int y) 515static bool number_correct(game_state *state, int x, int y)
515{ 516{
516 surrounds s; 517 surrounds s;
517 int n = 0, i, lights = GRID(state, lights, x, y); 518 int n = 0, i, lights = GRID(state, lights, x, y);
@@ -522,34 +523,34 @@ static int number_correct(game_state *state, int x, int y)
522 if (GRID(state,flags,s.points[i].x,s.points[i].y) & F_LIGHT) 523 if (GRID(state,flags,s.points[i].x,s.points[i].y) & F_LIGHT)
523 n++; 524 n++;
524 } 525 }
525 return (n == lights) ? 1 : 0; 526 return n == lights;
526} 527}
527 528
528/* Returns non-zero if any numbers add up incorrectly. */ 529/* Returns true if any numbers add up incorrectly. */
529static int grid_addsup(game_state *state) 530static bool grid_addsup(game_state *state)
530{ 531{
531 int x, y; 532 int x, y;
532 533
533 for (x = 0; x < state->w; x++) { 534 for (x = 0; x < state->w; x++) {
534 for (y = 0; y < state->h; y++) { 535 for (y = 0; y < state->h; y++) {
535 if (!(GRID(state, flags, x, y) & F_NUMBERED)) continue; 536 if (!(GRID(state, flags, x, y) & F_NUMBERED)) continue;
536 if (!number_correct(state, x, y)) return 0; 537 if (!number_correct(state, x, y)) return false;
537 } 538 }
538 } 539 }
539 return 1; 540 return true;
540} 541}
541 542
542static int grid_correct(game_state *state) 543static bool grid_correct(game_state *state)
543{ 544{
544 if (grid_lit(state) && 545 if (grid_lit(state) &&
545 !grid_overlap(state) && 546 !grid_overlap(state) &&
546 grid_addsup(state)) return 1; 547 grid_addsup(state)) return true;
547 return 0; 548 return false;
548} 549}
549 550
550/* --- Board initial setup (blacks, lights, numbers) --- */ 551/* --- Board initial setup (blacks, lights, numbers) --- */
551 552
552static void clean_board(game_state *state, int leave_blacks) 553static void clean_board(game_state *state, bool leave_blacks)
553{ 554{
554 int x,y; 555 int x,y;
555 for (x = 0; x < state->w; x++) { 556 for (x = 0; x < state->w; x++) {
@@ -567,18 +568,19 @@ static void clean_board(game_state *state, int leave_blacks)
567static void set_blacks(game_state *state, const game_params *params, 568static void set_blacks(game_state *state, const game_params *params,
568 random_state *rs) 569 random_state *rs)
569{ 570{
570 int x, y, degree = 0, rotate = 0, nblack; 571 int x, y, degree = 0, nblack;
572 bool rotate = false;
571 int rh, rw, i; 573 int rh, rw, i;
572 int wodd = (state->w % 2) ? 1 : 0; 574 int wodd = (state->w % 2) ? 1 : 0;
573 int hodd = (state->h % 2) ? 1 : 0; 575 int hodd = (state->h % 2) ? 1 : 0;
574 int xs[4], ys[4]; 576 int xs[4], ys[4];
575 577
576 switch (params->symm) { 578 switch (params->symm) {
577 case SYMM_NONE: degree = 1; rotate = 0; break; 579 case SYMM_NONE: degree = 1; rotate = false; break;
578 case SYMM_ROT2: degree = 2; rotate = 1; break; 580 case SYMM_ROT2: degree = 2; rotate = true; break;
579 case SYMM_REF2: degree = 2; rotate = 0; break; 581 case SYMM_REF2: degree = 2; rotate = false; break;
580 case SYMM_ROT4: degree = 4; rotate = 1; break; 582 case SYMM_ROT4: degree = 4; rotate = true; break;
581 case SYMM_REF4: degree = 4; rotate = 0; break; 583 case SYMM_REF4: degree = 4; rotate = false; break;
582 default: assert(!"Unknown symmetry type"); 584 default: assert(!"Unknown symmetry type");
583 } 585 }
584 if (params->symm == SYMM_ROT4 && (state->h != state->w)) 586 if (params->symm == SYMM_ROT4 && (state->h != state->w))
@@ -599,7 +601,7 @@ static void set_blacks(game_state *state, const game_params *params,
599 } 601 }
600 602
601 /* clear, then randomise, required region. */ 603 /* clear, then randomise, required region. */
602 clean_board(state, 0); 604 clean_board(state, false);
603 nblack = (rw * rh * params->blackpc) / 100; 605 nblack = (rw * rh * params->blackpc) / 100;
604 for (i = 0; i < nblack; i++) { 606 for (i = 0; i < nblack; i++) {
605 do { 607 do {
@@ -647,9 +649,9 @@ static void set_blacks(game_state *state, const game_params *params,
647} 649}
648 650
649/* Fills in (does not allocate) a ll_data with all the tiles that would 651/* Fills in (does not allocate) a ll_data with all the tiles that would
650 * be illuminated by a light at point (ox,oy). If origin=1 then the 652 * be illuminated by a light at point (ox,oy). If origin is true then the
651 * origin is included in this list. */ 653 * origin is included in this list. */
652static void list_lights(game_state *state, int ox, int oy, int origin, 654static void list_lights(game_state *state, int ox, int oy, bool origin,
653 ll_data *lld) 655 ll_data *lld)
654{ 656{
655 int x,y; 657 int x,y;
@@ -681,7 +683,7 @@ static void list_lights(game_state *state, int ox, int oy, int origin,
681 683
682/* Makes sure a light is the given state, editing the lights table to suit the 684/* Makes sure a light is the given state, editing the lights table to suit the
683 * new state if necessary. */ 685 * new state if necessary. */
684static void set_light(game_state *state, int ox, int oy, int on) 686static void set_light(game_state *state, int ox, int oy, bool on)
685{ 687{
686 ll_data lld; 688 ll_data lld;
687 int diff = 0; 689 int diff = 0;
@@ -699,7 +701,7 @@ static void set_light(game_state *state, int ox, int oy, int on)
699 } 701 }
700 702
701 if (diff != 0) { 703 if (diff != 0) {
702 list_lights(state,ox,oy,1,&lld); 704 list_lights(state,ox,oy,true,&lld);
703 FOREACHLIT(&lld, GRID(state,lights,lx,ly) += diff; ); 705 FOREACHLIT(&lld, GRID(state,lights,lx,ly) += diff; );
704 } 706 }
705} 707}
@@ -709,7 +711,7 @@ static int check_dark(game_state *state, int x, int y)
709{ 711{
710 ll_data lld; 712 ll_data lld;
711 713
712 list_lights(state, x, y, 1, &lld); 714 list_lights(state, x, y, true, &lld);
713 FOREACHLIT(&lld, if (GRID(state,lights,lx,ly) == 1) { return 1; } ); 715 FOREACHLIT(&lld, if (GRID(state,lights,lx,ly) == 1) { return 1; } );
714 return 0; 716 return 0;
715} 717}
@@ -731,7 +733,7 @@ static void place_lights(game_state *state, random_state *rs)
731 for (y = 0; y < state->h; y++) { 733 for (y = 0; y < state->h; y++) {
732 GRID(state, flags, x, y) &= ~F_MARK; /* we use this later. */ 734 GRID(state, flags, x, y) &= ~F_MARK; /* we use this later. */
733 if (GRID(state, flags, x, y) & F_BLACK) continue; 735 if (GRID(state, flags, x, y) & F_BLACK) continue;
734 set_light(state, x, y, 1); 736 set_light(state, x, y, true);
735 } 737 }
736 } 738 }
737 739
@@ -740,7 +742,7 @@ static void place_lights(game_state *state, random_state *rs)
740 x = numindices[i] % state->w; 742 x = numindices[i] % state->w;
741 if (!(GRID(state, flags, x, y) & F_LIGHT)) continue; 743 if (!(GRID(state, flags, x, y) & F_LIGHT)) continue;
742 if (GRID(state, flags, x, y) & F_MARK) continue; 744 if (GRID(state, flags, x, y) & F_MARK) continue;
743 list_lights(state, x, y, 0, &lld); 745 list_lights(state, x, y, false, &lld);
744 746
745 /* If we're not lighting any lights ourself, don't remove anything. */ 747 /* If we're not lighting any lights ourself, don't remove anything. */
746 n = 0; 748 n = 0;
@@ -753,7 +755,7 @@ static void place_lights(game_state *state, random_state *rs)
753 FOREACHLIT(&lld, if (GRID(state,flags,lx,ly) & F_LIGHT) { n += check_dark(state,lx,ly); } ); 755 FOREACHLIT(&lld, if (GRID(state,flags,lx,ly) & F_LIGHT) { n += check_dark(state,lx,ly); } );
754 if (n == 0) { 756 if (n == 0) {
755 /* No, it wouldn't, so we can remove them all. */ 757 /* No, it wouldn't, so we can remove them all. */
756 FOREACHLIT(&lld, set_light(state,lx,ly, 0); ); 758 FOREACHLIT(&lld, set_light(state,lx,ly, false); );
757 GRID(state,flags,x,y) |= F_MARK; 759 GRID(state,flags,x,y) |= F_MARK;
758 } 760 }
759 761
@@ -802,57 +804,58 @@ static void tsl_callback(game_state *state,
802 *x = lx; *y = ly; (*n)++; 804 *x = lx; *y = ly; (*n)++;
803} 805}
804 806
805static int try_solve_light(game_state *state, int ox, int oy, 807static bool try_solve_light(game_state *state, int ox, int oy,
806 unsigned int flags, int lights) 808 unsigned int flags, int lights)
807{ 809{
808 ll_data lld; 810 ll_data lld;
809 int sx = 0, sy = 0, n = 0; 811 int sx = 0, sy = 0, n = 0;
810 812
811 if (lights > 0) return 0; 813 if (lights > 0) return false;
812 if (flags & F_BLACK) return 0; 814 if (flags & F_BLACK) return false;
813 815
814 /* We have an unlit square; count how many ways there are left to 816 /* We have an unlit square; count how many ways there are left to
815 * place a light that lights us (including this square); if only 817 * place a light that lights us (including this square); if only
816 * one, we must put a light there. Squares that could light us 818 * one, we must put a light there. Squares that could light us
817 * are, of course, the same as the squares we would light... */ 819 * are, of course, the same as the squares we would light... */
818 list_lights(state, ox, oy, 1, &lld); 820 list_lights(state, ox, oy, true, &lld);
819 FOREACHLIT(&lld, { tsl_callback(state, lx, ly, &sx, &sy, &n); }); 821 FOREACHLIT(&lld, { tsl_callback(state, lx, ly, &sx, &sy, &n); });
820 if (n == 1) { 822 if (n == 1) {
821 set_light(state, sx, sy, 1); 823 set_light(state, sx, sy, true);
822#ifdef SOLVER_DIAGNOSTICS 824#ifdef SOLVER_DIAGNOSTICS
823 debug(("(%d,%d) can only be lit from (%d,%d); setting to LIGHT\n", 825 debug(("(%d,%d) can only be lit from (%d,%d); setting to LIGHT\n",
824 ox,oy,sx,sy)); 826 ox,oy,sx,sy));
825 if (verbose) debug_state(state); 827 if (verbose) debug_state(state);
826#endif 828#endif
827 return 1; 829 return true;
828 } 830 }
829 831
830 return 0; 832 return false;
831} 833}
832 834
833static int could_place_light(unsigned int flags, int lights) 835static bool could_place_light(unsigned int flags, int lights)
834{ 836{
835 if (flags & (F_BLACK | F_IMPOSSIBLE)) return 0; 837 if (flags & (F_BLACK | F_IMPOSSIBLE)) return false;
836 return (lights > 0) ? 0 : 1; 838 return !(lights > 0);
837} 839}
838 840
839static int could_place_light_xy(game_state *state, int x, int y) 841static bool could_place_light_xy(game_state *state, int x, int y)
840{ 842{
841 int lights = GRID(state,lights,x,y); 843 int lights = GRID(state,lights,x,y);
842 unsigned int flags = GRID(state,flags,x,y); 844 unsigned int flags = GRID(state,flags,x,y);
843 return (could_place_light(flags, lights)) ? 1 : 0; 845 return could_place_light(flags, lights);
844} 846}
845 847
846/* For a given number square, determine whether we have enough info 848/* For a given number square, determine whether we have enough info
847 * to unambiguously place its lights. */ 849 * to unambiguously place its lights. */
848static int try_solve_number(game_state *state, int nx, int ny, 850static bool try_solve_number(game_state *state, int nx, int ny,
849 unsigned int nflags, int nlights) 851 unsigned int nflags, int nlights)
850{ 852{
851 surrounds s; 853 surrounds s;
852 int x, y, nl, ns, i, ret = 0, lights; 854 int x, y, nl, ns, i, lights;
855 bool ret = false;
853 unsigned int flags; 856 unsigned int flags;
854 857
855 if (!(nflags & F_NUMBERED)) return 0; 858 if (!(nflags & F_NUMBERED)) return false;
856 nl = nlights; 859 nl = nlights;
857 get_surrounds(state,nx,ny,&s); 860 get_surrounds(state,nx,ny,&s);
858 ns = s.npoints; 861 ns = s.npoints;
@@ -873,7 +876,7 @@ static int try_solve_number(game_state *state, int nx, int ny,
873 s.points[i].f |= F_MARK; 876 s.points[i].f |= F_MARK;
874 } 877 }
875 } 878 }
876 if (ns == 0) return 0; /* nowhere to put anything. */ 879 if (ns == 0) return false; /* nowhere to put anything. */
877 if (nl == 0) { 880 if (nl == 0) {
878 /* we have placed all lights we need to around here; all remaining 881 /* we have placed all lights we need to around here; all remaining
879 * surrounds are therefore IMPOSSIBLE. */ 882 * surrounds are therefore IMPOSSIBLE. */
@@ -881,7 +884,7 @@ static int try_solve_number(game_state *state, int nx, int ny,
881 for (i = 0; i < s.npoints; i++) { 884 for (i = 0; i < s.npoints; i++) {
882 if (!(s.points[i].f & F_MARK)) { 885 if (!(s.points[i].f & F_MARK)) {
883 GRID(state,flags,s.points[i].x,s.points[i].y) |= F_IMPOSSIBLE; 886 GRID(state,flags,s.points[i].x,s.points[i].y) |= F_IMPOSSIBLE;
884 ret = 1; 887 ret = true;
885 } 888 }
886 } 889 }
887#ifdef SOLVER_DIAGNOSTICS 890#ifdef SOLVER_DIAGNOSTICS
@@ -894,8 +897,8 @@ static int try_solve_number(game_state *state, int nx, int ny,
894 GRID(state,flags,nx,ny) |= F_NUMBERUSED; 897 GRID(state,flags,nx,ny) |= F_NUMBERUSED;
895 for (i = 0; i < s.npoints; i++) { 898 for (i = 0; i < s.npoints; i++) {
896 if (!(s.points[i].f & F_MARK)) { 899 if (!(s.points[i].f & F_MARK)) {
897 set_light(state, s.points[i].x,s.points[i].y, 1); 900 set_light(state, s.points[i].x,s.points[i].y, true);
898 ret = 1; 901 ret = true;
899 } 902 }
900 } 903 }
901#ifdef SOLVER_DIAGNOSTICS 904#ifdef SOLVER_DIAGNOSTICS
@@ -992,7 +995,7 @@ static void trl_callback_search(game_state *state, int dx, int dy,
992static void trl_callback_discount(game_state *state, int dx, int dy, 995static void trl_callback_discount(game_state *state, int dx, int dy,
993 struct setscratch *scratch, int n, void *ctx) 996 struct setscratch *scratch, int n, void *ctx)
994{ 997{
995 int *didsth = (int *)ctx; 998 bool *didsth = (bool *)ctx;
996 int i; 999 int i;
997 1000
998 if (GRID(state,flags,dx,dy) & F_IMPOSSIBLE) { 1001 if (GRID(state,flags,dx,dy) & F_IMPOSSIBLE) {
@@ -1025,7 +1028,7 @@ static void trl_callback_discount(game_state *state, int dx, int dy,
1025 if (verbose) debug_state(state); 1028 if (verbose) debug_state(state);
1026#endif 1029#endif
1027 1030
1028 *didsth = 1; 1031 *didsth = true;
1029} 1032}
1030 1033
1031static void trl_callback_incn(game_state *state, int dx, int dy, 1034static void trl_callback_incn(game_state *state, int dx, int dy,
@@ -1050,7 +1053,7 @@ static void try_rule_out(game_state *state, int x, int y,
1050 /* Find all squares that would rule out a light at (x,y) and call trl_cb 1053 /* Find all squares that would rule out a light at (x,y) and call trl_cb
1051 * with them: anything that would light (x,y)... */ 1054 * with them: anything that would light (x,y)... */
1052 1055
1053 list_lights(state, x, y, 0, &lld); 1056 list_lights(state, x, y, false, &lld);
1054 FOREACHLIT(&lld, { if (could_place_light_xy(state, lx, ly)) { cb(state, lx, ly, scratch, n, ctx); } }); 1057 FOREACHLIT(&lld, { if (could_place_light_xy(state, lx, ly)) { cb(state, lx, ly, scratch, n, ctx); } });
1055 1058
1056 /* ... as well as any empty space (that isn't x,y) next to any clue square 1059 /* ... as well as any empty space (that isn't x,y) next to any clue square
@@ -1095,15 +1098,16 @@ static void debug_scratch(const char *msg, struct setscratch *scratch, int n)
1095} 1098}
1096#endif 1099#endif
1097 1100
1098static int discount_set(game_state *state, 1101static bool discount_set(game_state *state,
1099 struct setscratch *scratch, int n) 1102 struct setscratch *scratch, int n)
1100{ 1103{
1101 int i, besti, bestn, didsth = 0; 1104 int i, besti, bestn;
1105 bool didsth = false;
1102 1106
1103#ifdef SOLVER_DIAGNOSTICS 1107#ifdef SOLVER_DIAGNOSTICS
1104 if (verbose > 1) debug_scratch("discount_set", scratch, n); 1108 if (verbose > 1) debug_scratch("discount_set", scratch, n);
1105#endif 1109#endif
1106 if (n == 0) return 0; 1110 if (n == 0) return false;
1107 1111
1108 for (i = 0; i < n; i++) { 1112 for (i = 0; i < n; i++) {
1109 try_rule_out(state, scratch[i].x, scratch[i].y, scratch, n, 1113 try_rule_out(state, scratch[i].x, scratch[i].y, scratch, n,
@@ -1149,11 +1153,12 @@ static void unlit_cb(game_state *state, int lx, int ly,
1149} 1153}
1150 1154
1151/* Construct a MAKESLIGHT set from an unlit square. */ 1155/* Construct a MAKESLIGHT set from an unlit square. */
1152static int discount_unlit(game_state *state, int x, int y, 1156static bool discount_unlit(game_state *state, int x, int y,
1153 struct setscratch *scratch) 1157 struct setscratch *scratch)
1154{ 1158{
1155 ll_data lld; 1159 ll_data lld;
1156 int n, didsth; 1160 int n;
1161 bool didsth;
1157 1162
1158#ifdef SOLVER_DIAGNOSTICS 1163#ifdef SOLVER_DIAGNOSTICS
1159 if (verbose) debug(("Trying to discount for unlit square at (%d,%d).\n", x, y)); 1164 if (verbose) debug(("Trying to discount for unlit square at (%d,%d).\n", x, y));
@@ -1162,7 +1167,7 @@ static int discount_unlit(game_state *state, int x, int y,
1162 1167
1163 discount_clear(state, scratch, &n); 1168 discount_clear(state, scratch, &n);
1164 1169
1165 list_lights(state, x, y, 1, &lld); 1170 list_lights(state, x, y, true, &lld);
1166 FOREACHLIT(&lld, { unlit_cb(state, lx, ly, scratch, &n); }); 1171 FOREACHLIT(&lld, { unlit_cb(state, lx, ly, scratch, &n); });
1167 didsth = discount_set(state, scratch, n); 1172 didsth = discount_set(state, scratch, n);
1168#ifdef SOLVER_DIAGNOSTICS 1173#ifdef SOLVER_DIAGNOSTICS
@@ -1177,15 +1182,16 @@ static int discount_unlit(game_state *state, int x, int y,
1177 * subset of size N-M+1 of those N spaces forms such a set. 1182 * subset of size N-M+1 of those N spaces forms such a set.
1178 */ 1183 */
1179 1184
1180static int discount_clue(game_state *state, int x, int y, 1185static bool discount_clue(game_state *state, int x, int y,
1181 struct setscratch *scratch) 1186 struct setscratch *scratch)
1182{ 1187{
1183 int slen, m = GRID(state, lights, x, y), n, i, didsth = 0, lights; 1188 int slen, m = GRID(state, lights, x, y), n, i, lights;
1189 bool didsth = false;
1184 unsigned int flags; 1190 unsigned int flags;
1185 surrounds s, sempty; 1191 surrounds s, sempty;
1186 combi_ctx *combi; 1192 combi_ctx *combi;
1187 1193
1188 if (m == 0) return 0; 1194 if (m == 0) return false;
1189 1195
1190#ifdef SOLVER_DIAGNOSTICS 1196#ifdef SOLVER_DIAGNOSTICS
1191 if (verbose) debug(("Trying to discount for sets at clue (%d,%d).\n", x, y)); 1197 if (verbose) debug(("Trying to discount for sets at clue (%d,%d).\n", x, y));
@@ -1213,9 +1219,9 @@ static int discount_clue(game_state *state, int x, int y,
1213 } 1219 }
1214 } 1220 }
1215 n = sempty.npoints; /* sempty is now a surrounds of only blank squares. */ 1221 n = sempty.npoints; /* sempty is now a surrounds of only blank squares. */
1216 if (n == 0) return 0; /* clue is full already. */ 1222 if (n == 0) return false; /* clue is full already. */
1217 1223
1218 if (m < 0 || m > n) return 0; /* become impossible. */ 1224 if (m < 0 || m > n) return false; /* become impossible. */
1219 1225
1220 combi = new_combi(n - m + 1, n); 1226 combi = new_combi(n - m + 1, n);
1221 while (next_combi(combi)) { 1227 while (next_combi(combi)) {
@@ -1225,7 +1231,7 @@ static int discount_clue(game_state *state, int x, int y,
1225 scratch[slen].y = sempty.points[combi->a[i]].y; 1231 scratch[slen].y = sempty.points[combi->a[i]].y;
1226 slen++; 1232 slen++;
1227 } 1233 }
1228 if (discount_set(state, scratch, slen)) didsth = 1; 1234 if (discount_set(state, scratch, slen)) didsth = true;
1229 } 1235 }
1230 free_combi(combi); 1236 free_combi(combi);
1231#ifdef SOLVER_DIAGNOSTICS 1237#ifdef SOLVER_DIAGNOSTICS
@@ -1254,7 +1260,8 @@ static int solve_sub(game_state *state,
1254 int *maxdepth) 1260 int *maxdepth)
1255{ 1261{
1256 unsigned int flags; 1262 unsigned int flags;
1257 int x, y, didstuff, ncanplace, lights; 1263 int x, y, ncanplace, lights;
1264 bool didstuff;
1258 int bestx, besty, n, bestn, copy_soluble, self_soluble, ret, maxrecurse = 0; 1265 int bestx, besty, n, bestn, copy_soluble, self_soluble, ret, maxrecurse = 0;
1259 game_state *scopy; 1266 game_state *scopy;
1260 ll_data lld; 1267 ll_data lld;
@@ -1278,7 +1285,7 @@ static int solve_sub(game_state *state,
1278 if (grid_correct(state)) { ret = 1; goto done; } 1285 if (grid_correct(state)) { ret = 1; goto done; }
1279 1286
1280 ncanplace = 0; 1287 ncanplace = 0;
1281 didstuff = 0; 1288 didstuff = false;
1282 /* These 2 loops, and the functions they call, are the critical loops 1289 /* These 2 loops, and the functions they call, are the critical loops
1283 * for timing; any optimisations should look here first. */ 1290 * for timing; any optimisations should look here first. */
1284 for (x = 0; x < state->w; x++) { 1291 for (x = 0; x < state->w; x++) {
@@ -1287,8 +1294,10 @@ static int solve_sub(game_state *state,
1287 lights = GRID(state,lights,x,y); 1294 lights = GRID(state,lights,x,y);
1288 ncanplace += could_place_light(flags, lights); 1295 ncanplace += could_place_light(flags, lights);
1289 1296
1290 if (try_solve_light(state, x, y, flags, lights)) didstuff = 1; 1297 if (try_solve_light(state, x, y, flags, lights))
1291 if (try_solve_number(state, x, y, flags, lights)) didstuff = 1; 1298 didstuff = true;
1299 if (try_solve_number(state, x, y, flags, lights))
1300 didstuff = true;
1292 } 1301 }
1293 } 1302 }
1294 if (didstuff) continue; 1303 if (didstuff) continue;
@@ -1307,12 +1316,12 @@ static int solve_sub(game_state *state,
1307 1316
1308 if (!(flags & F_BLACK) && lights == 0) { 1317 if (!(flags & F_BLACK) && lights == 0) {
1309 if (discount_unlit(state, x, y, sscratch)) { 1318 if (discount_unlit(state, x, y, sscratch)) {
1310 didstuff = 1; 1319 didstuff = true;
1311 goto reduction_success; 1320 goto reduction_success;
1312 } 1321 }
1313 } else if (flags & F_NUMBERED) { 1322 } else if (flags & F_NUMBERED) {
1314 if (discount_clue(state, x, y, sscratch)) { 1323 if (discount_clue(state, x, y, sscratch)) {
1315 didstuff = 1; 1324 didstuff = true;
1316 goto reduction_success; 1325 goto reduction_success;
1317 } 1326 }
1318 } 1327 }
@@ -1342,7 +1351,7 @@ reduction_success:
1342 if (!could_place_light(flags, lights)) continue; 1351 if (!could_place_light(flags, lights)) continue;
1343 1352
1344 n = 0; 1353 n = 0;
1345 list_lights(state, x, y, 1, &lld); 1354 list_lights(state, x, y, true, &lld);
1346 FOREACHLIT(&lld, { if (GRID(state,lights,lx,ly) == 0) n++; }); 1355 FOREACHLIT(&lld, { if (GRID(state,lights,lx,ly) == 0) n++; });
1347 if (n > bestn) { 1356 if (n > bestn) {
1348 bestn = n; bestx = x; besty = y; 1357 bestn = n; bestx = x; besty = y;
@@ -1373,7 +1382,7 @@ reduction_success:
1373#ifdef SOLVER_DIAGNOSTICS 1382#ifdef SOLVER_DIAGNOSTICS
1374 debug(("Recursing #2: trying (%d,%d) as LIGHT\n", bestx, besty)); 1383 debug(("Recursing #2: trying (%d,%d) as LIGHT\n", bestx, besty));
1375#endif 1384#endif
1376 set_light(scopy, bestx, besty, 1); 1385 set_light(scopy, bestx, besty, true);
1377 copy_soluble = solve_sub(scopy, solve_flags, depth+1, maxdepth); 1386 copy_soluble = solve_sub(scopy, solve_flags, depth+1, maxdepth);
1378 1387
1379 /* If we wanted a unique solution but we hit our recursion limit 1388 /* If we wanted a unique solution but we hit our recursion limit
@@ -1453,14 +1462,14 @@ static void unplace_lights(game_state *state)
1453 for (x = 0; x < state->w; x++) { 1462 for (x = 0; x < state->w; x++) {
1454 for (y = 0; y < state->h; y++) { 1463 for (y = 0; y < state->h; y++) {
1455 if (GRID(state,flags,x,y) & F_LIGHT) 1464 if (GRID(state,flags,x,y) & F_LIGHT)
1456 set_light(state,x,y,0); 1465 set_light(state,x,y,false);
1457 GRID(state,flags,x,y) &= ~F_IMPOSSIBLE; 1466 GRID(state,flags,x,y) &= ~F_IMPOSSIBLE;
1458 GRID(state,flags,x,y) &= ~F_NUMBERUSED; 1467 GRID(state,flags,x,y) &= ~F_NUMBERUSED;
1459 } 1468 }
1460 } 1469 }
1461} 1470}
1462 1471
1463static int puzzle_is_good(game_state *state, int difficulty) 1472static bool puzzle_is_good(game_state *state, int difficulty)
1464{ 1473{
1465 int nsol, mdepth = 0; 1474 int nsol, mdepth = 0;
1466 unsigned int sflags = flags_from_difficulty(difficulty); 1475 unsigned int sflags = flags_from_difficulty(difficulty);
@@ -1477,13 +1486,13 @@ static int puzzle_is_good(game_state *state, int difficulty)
1477 /* if we wanted an easy puzzle, make sure we didn't need recursion. */ 1486 /* if we wanted an easy puzzle, make sure we didn't need recursion. */
1478 if (!(sflags & F_SOLVE_ALLOWRECURSE) && mdepth > 0) { 1487 if (!(sflags & F_SOLVE_ALLOWRECURSE) && mdepth > 0) {
1479 debug(("Ignoring recursive puzzle.\n")); 1488 debug(("Ignoring recursive puzzle.\n"));
1480 return 0; 1489 return false;
1481 } 1490 }
1482 1491
1483 debug(("%d solutions found.\n", nsol)); 1492 debug(("%d solutions found.\n", nsol));
1484 if (nsol <= 0) return 0; 1493 if (nsol <= 0) return false;
1485 if (nsol > 1) return 0; 1494 if (nsol > 1) return false;
1486 return 1; 1495 return true;
1487} 1496}
1488 1497
1489/* --- New game creation and user input code. --- */ 1498/* --- New game creation and user input code. --- */
@@ -1514,7 +1523,7 @@ static int puzzle_is_good(game_state *state, int difficulty)
1514#define MAX_GRIDGEN_TRIES 20 1523#define MAX_GRIDGEN_TRIES 20
1515 1524
1516static char *new_game_desc(const game_params *params_in, random_state *rs, 1525static char *new_game_desc(const game_params *params_in, random_state *rs,
1517 char **aux, int interactive) 1526 char **aux, bool interactive)
1518{ 1527{
1519 game_params params_copy = *params_in; /* structure copy */ 1528 game_params params_copy = *params_in; /* structure copy */
1520 game_params *params = &params_copy; 1529 game_params *params = &params_copy;
@@ -1750,9 +1759,9 @@ done:
1750 return move; 1759 return move;
1751} 1760}
1752 1761
1753static int game_can_format_as_text_now(const game_params *params) 1762static bool game_can_format_as_text_now(const game_params *params)
1754{ 1763{
1755 return TRUE; 1764 return true;
1756} 1765}
1757 1766
1758/* 'borrowed' from slant.c, mainly. I could have printed it one 1767/* 'borrowed' from slant.c, mainly. I could have printed it one
@@ -1811,13 +1820,15 @@ static char *game_text_format(const game_state *state)
1811} 1820}
1812 1821
1813struct game_ui { 1822struct game_ui {
1814 int cur_x, cur_y, cur_visible; 1823 int cur_x, cur_y;
1824 bool cur_visible;
1815}; 1825};
1816 1826
1817static game_ui *new_ui(const game_state *state) 1827static game_ui *new_ui(const game_state *state)
1818{ 1828{
1819 game_ui *ui = snew(game_ui); 1829 game_ui *ui = snew(game_ui);
1820 ui->cur_x = ui->cur_y = ui->cur_visible = 0; 1830 ui->cur_x = ui->cur_y = 0;
1831 ui->cur_visible = false;
1821 return ui; 1832 return ui;
1822} 1833}
1823 1834
@@ -1841,7 +1852,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1841 const game_state *newstate) 1852 const game_state *newstate)
1842{ 1853{
1843 if (newstate->completed) 1854 if (newstate->completed)
1844 ui->cur_visible = 0; 1855 ui->cur_visible = false;
1845} 1856}
1846 1857
1847#define DF_BLACK 1 /* black square */ 1858#define DF_BLACK 1 /* black square */
@@ -1858,7 +1869,7 @@ struct game_drawstate {
1858 int tilesize, crad; 1869 int tilesize, crad;
1859 int w, h; 1870 int w, h;
1860 unsigned int *flags; /* width * height */ 1871 unsigned int *flags; /* width * height */
1861 int started; 1872 bool started;
1862}; 1873};
1863 1874
1864 1875
@@ -1882,7 +1893,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1882 if (button == LEFT_BUTTON || button == RIGHT_BUTTON) { 1893 if (button == LEFT_BUTTON || button == RIGHT_BUTTON) {
1883 if (ui->cur_visible) 1894 if (ui->cur_visible)
1884 nullret = empty; 1895 nullret = empty;
1885 ui->cur_visible = 0; 1896 ui->cur_visible = false;
1886 cx = FROMCOORD(x); 1897 cx = FROMCOORD(x);
1887 cy = FROMCOORD(y); 1898 cy = FROMCOORD(y);
1888 action = (button == LEFT_BUTTON) ? FLIP_LIGHT : FLIP_IMPOSSIBLE; 1899 action = (button == LEFT_BUTTON) ? FLIP_LIGHT : FLIP_IMPOSSIBLE;
@@ -1897,10 +1908,10 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1897 action = (button == 'i' || button == 'I' || button == CURSOR_SELECT2) ? 1908 action = (button == 'i' || button == 'I' || button == CURSOR_SELECT2) ?
1898 FLIP_IMPOSSIBLE : FLIP_LIGHT; 1909 FLIP_IMPOSSIBLE : FLIP_LIGHT;
1899 } 1910 }
1900 ui->cur_visible = 1; 1911 ui->cur_visible = true;
1901 } else if (IS_CURSOR_MOVE(button)) { 1912 } else if (IS_CURSOR_MOVE(button)) {
1902 move_cursor(button, &ui->cur_x, &ui->cur_y, state->w, state->h, 0); 1913 move_cursor(button, &ui->cur_x, &ui->cur_y, state->w, state->h, false);
1903 ui->cur_visible = 1; 1914 ui->cur_visible = true;
1904 nullret = empty; 1915 nullret = empty;
1905 } else 1916 } else
1906 return NULL; 1917 return NULL;
@@ -1951,7 +1962,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1951 while (*move) { 1962 while (*move) {
1952 c = *move; 1963 c = *move;
1953 if (c == 'S') { 1964 if (c == 'S') {
1954 ret->used_solve = TRUE; 1965 ret->used_solve = true;
1955 move++; 1966 move++;
1956 } else if (c == 'L' || c == 'I') { 1967 } else if (c == 'L' || c == 'I') {
1957 move++; 1968 move++;
@@ -1965,9 +1976,9 @@ static game_state *execute_move(const game_state *state, const char *move)
1965 /* LIGHT and IMPOSSIBLE are mutually exclusive. */ 1976 /* LIGHT and IMPOSSIBLE are mutually exclusive. */
1966 if (c == 'L') { 1977 if (c == 'L') {
1967 GRID(ret, flags, x, y) &= ~F_IMPOSSIBLE; 1978 GRID(ret, flags, x, y) &= ~F_IMPOSSIBLE;
1968 set_light(ret, x, y, (flags & F_LIGHT) ? 0 : 1); 1979 set_light(ret, x, y, !(flags & F_LIGHT));
1969 } else { 1980 } else {
1970 set_light(ret, x, y, 0); 1981 set_light(ret, x, y, false);
1971 GRID(ret, flags, x, y) ^= F_IMPOSSIBLE; 1982 GRID(ret, flags, x, y) ^= F_IMPOSSIBLE;
1972 } 1983 }
1973 move += n; 1984 move += n;
@@ -1977,7 +1988,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1977 move++; 1988 move++;
1978 else if (*move) goto badmove; 1989 else if (*move) goto badmove;
1979 } 1990 }
1980 if (grid_correct(ret)) ret->completed = 1; 1991 if (grid_correct(ret)) ret->completed = true;
1981 return ret; 1992 return ret;
1982 1993
1983badmove: 1994badmove:
@@ -2047,7 +2058,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
2047 for (i = 0; i < ds->w*ds->h; i++) 2058 for (i = 0; i < ds->w*ds->h; i++)
2048 ds->flags[i] = -1; 2059 ds->flags[i] = -1;
2049 2060
2050 ds->started = 0; 2061 ds->started = false;
2051 2062
2052 return ds; 2063 return ds;
2053} 2064}
@@ -2066,7 +2077,7 @@ static void game_free_drawstate(drawing *dr, game_drawstate *ds)
2066#define HINT_NUMBERS 2077#define HINT_NUMBERS
2067 2078
2068static unsigned int tile_flags(game_drawstate *ds, const game_state *state, 2079static unsigned int tile_flags(game_drawstate *ds, const game_state *state,
2069 const game_ui *ui, int x, int y, int flashing) 2080 const game_ui *ui, int x, int y, bool flashing)
2070{ 2081{
2071 unsigned int flags = GRID(state, flags, x, y); 2082 unsigned int flags = GRID(state, flags, x, y);
2072 int lights = GRID(state, lights, x, y); 2083 int lights = GRID(state, lights, x, y);
@@ -2159,7 +2170,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2159 int dir, const game_ui *ui, 2170 int dir, const game_ui *ui,
2160 float animtime, float flashtime) 2171 float animtime, float flashtime)
2161{ 2172{
2162 int flashing = FALSE; 2173 bool flashing = false;
2163 int x,y; 2174 int x,y;
2164 2175
2165 if (flashtime) flashing = (int)(flashtime * 3 / FLASH_TIME) != 1; 2176 if (flashtime) flashing = (int)(flashtime * 3 / FLASH_TIME) != 1;
@@ -2177,7 +2188,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2177 draw_update(dr, 0, 0, 2188 draw_update(dr, 0, 0,
2178 TILE_SIZE * ds->w + 2 * BORDER, 2189 TILE_SIZE * ds->w + 2 * BORDER,
2179 TILE_SIZE * ds->h + 2 * BORDER); 2190 TILE_SIZE * ds->h + 2 * BORDER);
2180 ds->started = 1; 2191 ds->started = true;
2181 } 2192 }
2182 2193
2183 for (x = 0; x < ds->w; x++) { 2194 for (x = 0; x < ds->w; x++) {
@@ -2211,9 +2222,9 @@ static int game_status(const game_state *state)
2211 return state->completed ? +1 : 0; 2222 return state->completed ? +1 : 0;
2212} 2223}
2213 2224
2214static int game_timing_state(const game_state *state, game_ui *ui) 2225static bool game_timing_state(const game_state *state, game_ui *ui)
2215{ 2226{
2216 return TRUE; 2227 return true;
2217} 2228}
2218 2229
2219static void game_print_size(const game_params *params, float *x, float *y) 2230static void game_print_size(const game_params *params, float *x, float *y)
@@ -2260,7 +2271,7 @@ static void game_print(drawing *dr, const game_state *state, int tilesize)
2260 */ 2271 */
2261 for (y = 0; y < h; y++) 2272 for (y = 0; y < h; y++)
2262 for (x = 0; x < w; x++) { 2273 for (x = 0; x < w; x++) {
2263 unsigned int ds_flags = tile_flags(ds, state, NULL, x, y, FALSE); 2274 unsigned int ds_flags = tile_flags(ds, state, NULL, x, y, false);
2264 int dx = COORD(x), dy = COORD(y); 2275 int dx = COORD(x), dy = COORD(y);
2265 if (ds_flags & DF_BLACK) { 2276 if (ds_flags & DF_BLACK) {
2266 draw_rect(dr, dx, dy, TILE_SIZE, TILE_SIZE, ink); 2277 draw_rect(dr, dx, dy, TILE_SIZE, TILE_SIZE, ink);
@@ -2290,15 +2301,15 @@ const struct game thegame = {
2290 encode_params, 2301 encode_params,
2291 free_params, 2302 free_params,
2292 dup_params, 2303 dup_params,
2293 TRUE, game_configure, custom_params, 2304 true, game_configure, custom_params,
2294 validate_params, 2305 validate_params,
2295 new_game_desc, 2306 new_game_desc,
2296 validate_desc, 2307 validate_desc,
2297 new_game, 2308 new_game,
2298 dup_game, 2309 dup_game,
2299 free_game, 2310 free_game,
2300 TRUE, solve_game, 2311 true, solve_game,
2301 TRUE, game_can_format_as_text_now, game_text_format, 2312 true, game_can_format_as_text_now, game_text_format,
2302 new_ui, 2313 new_ui,
2303 free_ui, 2314 free_ui,
2304 encode_ui, 2315 encode_ui,
@@ -2315,9 +2326,9 @@ const struct game thegame = {
2315 game_anim_length, 2326 game_anim_length,
2316 game_flash_length, 2327 game_flash_length,
2317 game_status, 2328 game_status,
2318 TRUE, FALSE, game_print_size, game_print, 2329 true, false, game_print_size, game_print,
2319 FALSE, /* wants_statusbar */ 2330 false, /* wants_statusbar */
2320 FALSE, game_timing_state, 2331 false, game_timing_state,
2321 0, /* flags */ 2332 0, /* flags */
2322}; 2333};
2323 2334
diff --git a/apps/plugins/puzzles/src/loopgen.c b/apps/plugins/puzzles/src/loopgen.c
index 0b6990455f..e738d4a26d 100644
--- a/apps/plugins/puzzles/src/loopgen.c
+++ b/apps/plugins/puzzles/src/loopgen.c
@@ -75,16 +75,16 @@ static int black_sort_cmpfn(void *v1, void *v2)
75/* 'board' is an array of enum face_colour, indicating which faces are 75/* 'board' is an array of enum face_colour, indicating which faces are
76 * currently black/white/grey. 'colour' is FACE_WHITE or FACE_BLACK. 76 * currently black/white/grey. 'colour' is FACE_WHITE or FACE_BLACK.
77 * Returns whether it's legal to colour the given face with this colour. */ 77 * Returns whether it's legal to colour the given face with this colour. */
78static int can_colour_face(grid *g, char* board, int face_index, 78static bool can_colour_face(grid *g, char* board, int face_index,
79 enum face_colour colour) 79 enum face_colour colour)
80{ 80{
81 int i, j; 81 int i, j;
82 grid_face *test_face = g->faces + face_index; 82 grid_face *test_face = g->faces + face_index;
83 grid_face *starting_face, *current_face; 83 grid_face *starting_face, *current_face;
84 grid_dot *starting_dot; 84 grid_dot *starting_dot;
85 int transitions; 85 int transitions;
86 int current_state, s; /* booleans: equal or not-equal to 'colour' */ 86 bool current_state, s; /* equal or not-equal to 'colour' */
87 int found_same_coloured_neighbour = FALSE; 87 bool found_same_coloured_neighbour = false;
88 assert(board[face_index] != colour); 88 assert(board[face_index] != colour);
89 89
90 /* Can only consider a face for colouring if it's adjacent to a face 90 /* Can only consider a face for colouring if it's adjacent to a face
@@ -93,12 +93,12 @@ static int can_colour_face(grid *g, char* board, int face_index,
93 grid_edge *e = test_face->edges[i]; 93 grid_edge *e = test_face->edges[i];
94 grid_face *f = (e->face1 == test_face) ? e->face2 : e->face1; 94 grid_face *f = (e->face1 == test_face) ? e->face2 : e->face1;
95 if (FACE_COLOUR(f) == colour) { 95 if (FACE_COLOUR(f) == colour) {
96 found_same_coloured_neighbour = TRUE; 96 found_same_coloured_neighbour = true;
97 break; 97 break;
98 } 98 }
99 } 99 }
100 if (!found_same_coloured_neighbour) 100 if (!found_same_coloured_neighbour)
101 return FALSE; 101 return false;
102 102
103 /* Need to avoid creating a loop of faces of this colour around some 103 /* Need to avoid creating a loop of faces of this colour around some
104 * differently-coloured faces. 104 * differently-coloured faces.
@@ -158,11 +158,11 @@ static int can_colour_face(grid *g, char* board, int face_index,
158 current_state = (FACE_COLOUR(current_face) == colour); 158 current_state = (FACE_COLOUR(current_face) == colour);
159 starting_dot = NULL; 159 starting_dot = NULL;
160 starting_face = NULL; 160 starting_face = NULL;
161 while (TRUE) { 161 while (true) {
162 /* Advance to next face. 162 /* Advance to next face.
163 * Need to loop here because it might take several goes to 163 * Need to loop here because it might take several goes to
164 * find it. */ 164 * find it. */
165 while (TRUE) { 165 while (true) {
166 j++; 166 j++;
167 if (j == test_face->dots[i]->order) 167 if (j == test_face->dots[i]->order)
168 j = 0; 168 j = 0;
@@ -206,7 +206,7 @@ static int can_colour_face(grid *g, char* board, int face_index,
206 } 206 }
207 } 207 }
208 208
209 return (transitions == 2) ? TRUE : FALSE; 209 return (transitions == 2) ? true : false;
210} 210}
211 211
212/* Count the number of neighbours of 'face', having colour 'colour' */ 212/* Count the number of neighbours of 'face', having colour 'colour' */
@@ -306,7 +306,7 @@ void generate_loop(grid *g, char *board, random_state *rs,
306 tree234 *lightable_faces_sorted; 306 tree234 *lightable_faces_sorted;
307 tree234 *darkable_faces_sorted; 307 tree234 *darkable_faces_sorted;
308 int *face_list; 308 int *face_list;
309 int do_random_pass; 309 bool do_random_pass;
310 310
311 /* Make a board */ 311 /* Make a board */
312 memset(board, FACE_GREY, num_faces); 312 memset(board, FACE_GREY, num_faces);
@@ -361,7 +361,7 @@ void generate_loop(grid *g, char *board, random_state *rs,
361 } 361 }
362 362
363 /* Colour faces one at a time until no more faces are colourable. */ 363 /* Colour faces one at a time until no more faces are colourable. */
364 while (TRUE) 364 while (true)
365 { 365 {
366 enum face_colour colour; 366 enum face_colour colour;
367 tree234 *faces_to_pick; 367 tree234 *faces_to_pick;
@@ -501,12 +501,12 @@ void generate_loop(grid *g, char *board, random_state *rs,
501 * make some illicit deductions. To combat this (and make the path more 501 * make some illicit deductions. To combat this (and make the path more
502 * interesting), we do one final pass making random flips. */ 502 * interesting), we do one final pass making random flips. */
503 503
504 /* Set to TRUE for final pass */ 504 /* Set to true for final pass */
505 do_random_pass = FALSE; 505 do_random_pass = false;
506 506
507 while (TRUE) { 507 while (true) {
508 /* Remember whether a flip occurred during this pass */ 508 /* Remember whether a flip occurred during this pass */
509 int flipped = FALSE; 509 bool flipped = false;
510 510
511 for (i = 0; i < num_faces; ++i) { 511 for (i = 0; i < num_faces; ++i) {
512 int j = face_list[i]; 512 int j = face_list[i];
@@ -522,14 +522,14 @@ void generate_loop(grid *g, char *board, random_state *rs,
522 /* normal pass - flip when neighbour count is 1 */ 522 /* normal pass - flip when neighbour count is 1 */
523 if (face_num_neighbours(g, board, face, opp) == 1) { 523 if (face_num_neighbours(g, board, face, opp) == 1) {
524 board[j] = opp; 524 board[j] = opp;
525 flipped = TRUE; 525 flipped = true;
526 } 526 }
527 } 527 }
528 } 528 }
529 } 529 }
530 530
531 if (do_random_pass) break; 531 if (do_random_pass) break;
532 if (!flipped) do_random_pass = TRUE; 532 if (!flipped) do_random_pass = true;
533 } 533 }
534 534
535 sfree(face_list); 535 sfree(face_list);
diff --git a/apps/plugins/puzzles/src/loopy.c b/apps/plugins/puzzles/src/loopy.c
index f5f8917052..f2875a2e93 100644
--- a/apps/plugins/puzzles/src/loopy.c
+++ b/apps/plugins/puzzles/src/loopy.c
@@ -117,11 +117,11 @@ struct game_state {
117 * YES, NO or UNKNOWN */ 117 * YES, NO or UNKNOWN */
118 char *lines; 118 char *lines;
119 119
120 unsigned char *line_errors; 120 bool *line_errors;
121 int exactly_one_loop; 121 bool exactly_one_loop;
122 122
123 int solved; 123 bool solved;
124 int cheated; 124 bool cheated;
125 125
126 /* Used in game_text_format(), so that it knows what type of 126 /* Used in game_text_format(), so that it knows what type of
127 * grid it's trying to render as ASCII text. */ 127 * grid it's trying to render as ASCII text. */
@@ -152,7 +152,7 @@ typedef struct solver_state {
152 char *dot_no_count; 152 char *dot_no_count;
153 char *face_yes_count; 153 char *face_yes_count;
154 char *face_no_count; 154 char *face_no_count;
155 char *dot_solved, *face_solved; 155 bool *dot_solved, *face_solved;
156 int *dotdsf; 156 int *dotdsf;
157 157
158 /* Information for Normal level deductions: 158 /* Information for Normal level deductions:
@@ -223,13 +223,13 @@ enum line_drawstate { DS_LINE_YES, DS_LINE_UNKNOWN,
223 223
224 224
225struct game_drawstate { 225struct game_drawstate {
226 int started; 226 bool started;
227 int tilesize; 227 int tilesize;
228 int flashing; 228 bool flashing;
229 int *textx, *texty; 229 int *textx, *texty;
230 char *lines; 230 char *lines;
231 char *clue_error; 231 bool *clue_error;
232 char *clue_satisfied; 232 bool *clue_satisfied;
233}; 233};
234 234
235static const char *validate_desc(const game_params *params, const char *desc); 235static const char *validate_desc(const game_params *params, const char *desc);
@@ -319,11 +319,11 @@ static grid *loopy_generate_grid(const game_params *params,
319 319
320#define BIT_SET(field, bit) ((field) & (1<<(bit))) 320#define BIT_SET(field, bit) ((field) & (1<<(bit)))
321 321
322#define SET_BIT(field, bit) (BIT_SET(field, bit) ? FALSE : \ 322#define SET_BIT(field, bit) (BIT_SET(field, bit) ? false : \
323 ((field) |= (1<<(bit)), TRUE)) 323 ((field) |= (1<<(bit)), true))
324 324
325#define CLEAR_BIT(field, bit) (BIT_SET(field, bit) ? \ 325#define CLEAR_BIT(field, bit) (BIT_SET(field, bit) ? \
326 ((field) &= ~(1<<(bit)), TRUE) : FALSE) 326 ((field) &= ~(1<<(bit)), true) : false)
327 327
328#define CLUE2CHAR(c) \ 328#define CLUE2CHAR(c) \
329 ((c < 0) ? ' ' : c < 10 ? c + '0' : c - 10 + 'A') 329 ((c < 0) ? ' ' : c < 10 ? c + '0' : c - 10 + 'A')
@@ -348,8 +348,9 @@ static game_state *dup_game(const game_state *state)
348 ret->lines = snewn(state->game_grid->num_edges, char); 348 ret->lines = snewn(state->game_grid->num_edges, char);
349 memcpy(ret->lines, state->lines, state->game_grid->num_edges); 349 memcpy(ret->lines, state->lines, state->game_grid->num_edges);
350 350
351 ret->line_errors = snewn(state->game_grid->num_edges, unsigned char); 351 ret->line_errors = snewn(state->game_grid->num_edges, bool);
352 memcpy(ret->line_errors, state->line_errors, state->game_grid->num_edges); 352 memcpy(ret->line_errors, state->line_errors,
353 state->game_grid->num_edges * sizeof(bool));
353 ret->exactly_one_loop = state->exactly_one_loop; 354 ret->exactly_one_loop = state->exactly_one_loop;
354 355
355 ret->grid_type = state->grid_type; 356 ret->grid_type = state->grid_type;
@@ -386,10 +387,10 @@ static solver_state *new_solver_state(const game_state *state, int diff) {
386 ret->looplen[i] = 1; 387 ret->looplen[i] = 1;
387 } 388 }
388 389
389 ret->dot_solved = snewn(num_dots, char); 390 ret->dot_solved = snewn(num_dots, bool);
390 ret->face_solved = snewn(num_faces, char); 391 ret->face_solved = snewn(num_faces, bool);
391 memset(ret->dot_solved, FALSE, num_dots); 392 memset(ret->dot_solved, 0, num_dots * sizeof(bool));
392 memset(ret->face_solved, FALSE, num_faces); 393 memset(ret->face_solved, 0, num_faces * sizeof(bool));
393 394
394 ret->dot_yes_count = snewn(num_dots, char); 395 ret->dot_yes_count = snewn(num_dots, char);
395 memset(ret->dot_yes_count, 0, num_dots); 396 memset(ret->dot_yes_count, 0, num_dots);
@@ -455,10 +456,10 @@ static solver_state *dup_solver_state(const solver_state *sstate) {
455 memcpy(ret->looplen, sstate->looplen, 456 memcpy(ret->looplen, sstate->looplen,
456 num_dots * sizeof(int)); 457 num_dots * sizeof(int));
457 458
458 ret->dot_solved = snewn(num_dots, char); 459 ret->dot_solved = snewn(num_dots, bool);
459 ret->face_solved = snewn(num_faces, char); 460 ret->face_solved = snewn(num_faces, bool);
460 memcpy(ret->dot_solved, sstate->dot_solved, num_dots); 461 memcpy(ret->dot_solved, sstate->dot_solved, num_dots * sizeof(bool));
461 memcpy(ret->face_solved, sstate->face_solved, num_faces); 462 memcpy(ret->face_solved, sstate->face_solved, num_faces * sizeof(bool));
462 463
463 ret->dot_yes_count = snewn(num_dots, char); 464 ret->dot_yes_count = snewn(num_dots, char);
464 memcpy(ret->dot_yes_count, sstate->dot_yes_count, num_dots); 465 memcpy(ret->dot_yes_count, sstate->dot_yes_count, num_dots);
@@ -624,7 +625,7 @@ static void decode_params(game_params *params, char const *string)
624 } 625 }
625} 626}
626 627
627static char *encode_params(const game_params *params, int full) 628static char *encode_params(const game_params *params, bool full)
628{ 629{
629 char str[80]; 630 char str[80];
630 sprintf(str, "%dx%dt%d", params->w, params->h, params->type); 631 sprintf(str, "%dx%dt%d", params->w, params->h, params->type);
@@ -678,7 +679,7 @@ static game_params *custom_params(const config_item *cfg)
678 return ret; 679 return ret;
679} 680}
680 681
681static const char *validate_params(const game_params *params, int full) 682static const char *validate_params(const game_params *params, bool full)
682{ 683{
683 if (params->type < 0 || params->type >= NUM_GRID_TYPES) 684 if (params->type < 0 || params->type >= NUM_GRID_TYPES)
684 return "Illegal grid type"; 685 return "Illegal grid type";
@@ -946,17 +947,17 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
946 int i; 947 int i;
947 948
948 ds->tilesize = 0; 949 ds->tilesize = 0;
949 ds->started = 0; 950 ds->started = false;
950 ds->lines = snewn(num_edges, char); 951 ds->lines = snewn(num_edges, char);
951 ds->clue_error = snewn(num_faces, char); 952 ds->clue_error = snewn(num_faces, bool);
952 ds->clue_satisfied = snewn(num_faces, char); 953 ds->clue_satisfied = snewn(num_faces, bool);
953 ds->textx = snewn(num_faces, int); 954 ds->textx = snewn(num_faces, int);
954 ds->texty = snewn(num_faces, int); 955 ds->texty = snewn(num_faces, int);
955 ds->flashing = 0; 956 ds->flashing = false;
956 957
957 memset(ds->lines, LINE_UNKNOWN, num_edges); 958 memset(ds->lines, LINE_UNKNOWN, num_edges);
958 memset(ds->clue_error, 0, num_faces); 959 memset(ds->clue_error, 0, num_faces * sizeof(bool));
959 memset(ds->clue_satisfied, 0, num_faces); 960 memset(ds->clue_satisfied, 0, num_faces * sizeof(bool));
960 for (i = 0; i < num_faces; i++) 961 for (i = 0; i < num_faces; i++)
961 ds->textx[i] = ds->texty[i] = -1; 962 ds->textx[i] = ds->texty[i] = -1;
962 963
@@ -973,9 +974,9 @@ static void game_free_drawstate(drawing *dr, game_drawstate *ds)
973 sfree(ds); 974 sfree(ds);
974} 975}
975 976
976static int game_timing_state(const game_state *state, game_ui *ui) 977static bool game_timing_state(const game_state *state, game_ui *ui)
977{ 978{
978 return TRUE; 979 return true;
979} 980}
980 981
981static float game_anim_length(const game_state *oldstate, 982static float game_anim_length(const game_state *oldstate,
@@ -984,11 +985,11 @@ static float game_anim_length(const game_state *oldstate,
984 return 0.0F; 985 return 0.0F;
985} 986}
986 987
987static int game_can_format_as_text_now(const game_params *params) 988static bool game_can_format_as_text_now(const game_params *params)
988{ 989{
989 if (params->type != 0) 990 if (params->type != 0)
990 return FALSE; 991 return false;
991 return TRUE; 992 return true;
992} 993}
993 994
994static char *game_text_format(const game_state *state) 995static char *game_text_format(const game_state *state)
@@ -1106,13 +1107,13 @@ static void check_caches(const solver_state* sstate)
1106 1107
1107/* Sets the line (with index i) to the new state 'line_new', and updates 1108/* Sets the line (with index i) to the new state 'line_new', and updates
1108 * the cached counts of any affected faces and dots. 1109 * the cached counts of any affected faces and dots.
1109 * Returns TRUE if this actually changed the line's state. */ 1110 * Returns true if this actually changed the line's state. */
1110static int solver_set_line(solver_state *sstate, int i, 1111static bool solver_set_line(solver_state *sstate, int i,
1111 enum line_state line_new 1112 enum line_state line_new
1112#ifdef SHOW_WORKING 1113#ifdef SHOW_WORKING
1113 , const char *reason 1114 , const char *reason
1114#endif 1115#endif
1115 ) 1116 )
1116{ 1117{
1117 game_state *state = sstate->state; 1118 game_state *state = sstate->state;
1118 grid *g; 1119 grid *g;
@@ -1123,7 +1124,7 @@ static int solver_set_line(solver_state *sstate, int i,
1123 check_caches(sstate); 1124 check_caches(sstate);
1124 1125
1125 if (state->lines[i] == line_new) { 1126 if (state->lines[i] == line_new) {
1126 return FALSE; /* nothing changed */ 1127 return false; /* nothing changed */
1127 } 1128 }
1128 state->lines[i] = line_new; 1129 state->lines[i] = line_new;
1129 1130
@@ -1158,7 +1159,7 @@ static int solver_set_line(solver_state *sstate, int i,
1158 } 1159 }
1159 1160
1160 check_caches(sstate); 1161 check_caches(sstate);
1161 return TRUE; 1162 return true;
1162} 1163}
1163 1164
1164#ifdef SHOW_WORKING 1165#ifdef SHOW_WORKING
@@ -1170,10 +1171,10 @@ static int solver_set_line(solver_state *sstate, int i,
1170 * Merge two dots due to the existence of an edge between them. 1171 * Merge two dots due to the existence of an edge between them.
1171 * Updates the dsf tracking equivalence classes, and keeps track of 1172 * Updates the dsf tracking equivalence classes, and keeps track of
1172 * the length of path each dot is currently a part of. 1173 * the length of path each dot is currently a part of.
1173 * Returns TRUE if the dots were already linked, ie if they are part of a 1174 * Returns true if the dots were already linked, ie if they are part of a
1174 * closed loop, and false otherwise. 1175 * closed loop, and false otherwise.
1175 */ 1176 */
1176static int merge_dots(solver_state *sstate, int edge_index) 1177static bool merge_dots(solver_state *sstate, int edge_index)
1177{ 1178{
1178 int i, j, len; 1179 int i, j, len;
1179 grid *g = sstate->state->game_grid; 1180 grid *g = sstate->state->game_grid;
@@ -1186,26 +1187,26 @@ static int merge_dots(solver_state *sstate, int edge_index)
1186 j = dsf_canonify(sstate->dotdsf, j); 1187 j = dsf_canonify(sstate->dotdsf, j);
1187 1188
1188 if (i == j) { 1189 if (i == j) {
1189 return TRUE; 1190 return true;
1190 } else { 1191 } else {
1191 len = sstate->looplen[i] + sstate->looplen[j]; 1192 len = sstate->looplen[i] + sstate->looplen[j];
1192 dsf_merge(sstate->dotdsf, i, j); 1193 dsf_merge(sstate->dotdsf, i, j);
1193 i = dsf_canonify(sstate->dotdsf, i); 1194 i = dsf_canonify(sstate->dotdsf, i);
1194 sstate->looplen[i] = len; 1195 sstate->looplen[i] = len;
1195 return FALSE; 1196 return false;
1196 } 1197 }
1197} 1198}
1198 1199
1199/* Merge two lines because the solver has deduced that they must be either 1200/* Merge two lines because the solver has deduced that they must be either
1200 * identical or opposite. Returns TRUE if this is new information, otherwise 1201 * identical or opposite. Returns true if this is new information, otherwise
1201 * FALSE. */ 1202 * false. */
1202static int merge_lines(solver_state *sstate, int i, int j, int inverse 1203static bool merge_lines(solver_state *sstate, int i, int j, bool inverse
1203#ifdef SHOW_WORKING 1204#ifdef SHOW_WORKING
1204 , const char *reason 1205 , const char *reason
1205#endif 1206#endif
1206 ) 1207 )
1207{ 1208{
1208 int inv_tmp; 1209 bool inv_tmp;
1209 1210
1210 assert(i < sstate->state->game_grid->num_edges); 1211 assert(i < sstate->state->game_grid->num_edges);
1211 assert(j < sstate->state->game_grid->num_edges); 1212 assert(j < sstate->state->game_grid->num_edges);
@@ -1268,17 +1269,17 @@ static int face_order(const game_state* state, int face, char line_type)
1268 1269
1269/* Set all lines bordering a dot of type old_type to type new_type 1270/* Set all lines bordering a dot of type old_type to type new_type
1270 * Return value tells caller whether this function actually did anything */ 1271 * Return value tells caller whether this function actually did anything */
1271static int dot_setall(solver_state *sstate, int dot, 1272static bool dot_setall(solver_state *sstate, int dot,
1272 char old_type, char new_type) 1273 char old_type, char new_type)
1273{ 1274{
1274 int retval = FALSE, r; 1275 bool retval = false, r;
1275 game_state *state = sstate->state; 1276 game_state *state = sstate->state;
1276 grid *g; 1277 grid *g;
1277 grid_dot *d; 1278 grid_dot *d;
1278 int i; 1279 int i;
1279 1280
1280 if (old_type == new_type) 1281 if (old_type == new_type)
1281 return FALSE; 1282 return false;
1282 1283
1283 g = state->game_grid; 1284 g = state->game_grid;
1284 d = g->dots + dot; 1285 d = g->dots + dot;
@@ -1287,25 +1288,25 @@ static int dot_setall(solver_state *sstate, int dot,
1287 int line_index = d->edges[i] - g->edges; 1288 int line_index = d->edges[i] - g->edges;
1288 if (state->lines[line_index] == old_type) { 1289 if (state->lines[line_index] == old_type) {
1289 r = solver_set_line(sstate, line_index, new_type); 1290 r = solver_set_line(sstate, line_index, new_type);
1290 assert(r == TRUE); 1291 assert(r);
1291 retval = TRUE; 1292 retval = true;
1292 } 1293 }
1293 } 1294 }
1294 return retval; 1295 return retval;
1295} 1296}
1296 1297
1297/* Set all lines bordering a face of type old_type to type new_type */ 1298/* Set all lines bordering a face of type old_type to type new_type */
1298static int face_setall(solver_state *sstate, int face, 1299static bool face_setall(solver_state *sstate, int face,
1299 char old_type, char new_type) 1300 char old_type, char new_type)
1300{ 1301{
1301 int retval = FALSE, r; 1302 bool retval = false, r;
1302 game_state *state = sstate->state; 1303 game_state *state = sstate->state;
1303 grid *g; 1304 grid *g;
1304 grid_face *f; 1305 grid_face *f;
1305 int i; 1306 int i;
1306 1307
1307 if (old_type == new_type) 1308 if (old_type == new_type)
1308 return FALSE; 1309 return false;
1309 1310
1310 g = state->game_grid; 1311 g = state->game_grid;
1311 f = g->faces + face; 1312 f = g->faces + face;
@@ -1314,8 +1315,8 @@ static int face_setall(solver_state *sstate, int face,
1314 int line_index = f->edges[i] - g->edges; 1315 int line_index = f->edges[i] - g->edges;
1315 if (state->lines[line_index] == old_type) { 1316 if (state->lines[line_index] == old_type) {
1316 r = solver_set_line(sstate, line_index, new_type); 1317 r = solver_set_line(sstate, line_index, new_type);
1317 assert(r == TRUE); 1318 assert(r);
1318 retval = TRUE; 1319 retval = true;
1319 } 1320 }
1320 } 1321 }
1321 return retval; 1322 return retval;
@@ -1356,9 +1357,9 @@ static void add_full_clues(game_state *state, random_state *rs)
1356} 1357}
1357 1358
1358 1359
1359static int game_has_unique_soln(const game_state *state, int diff) 1360static bool game_has_unique_soln(const game_state *state, int diff)
1360{ 1361{
1361 int ret; 1362 bool ret;
1362 solver_state *sstate_new; 1363 solver_state *sstate_new;
1363 solver_state *sstate = new_solver_state((game_state *)state, diff); 1364 solver_state *sstate = new_solver_state((game_state *)state, diff);
1364 1365
@@ -1412,7 +1413,7 @@ static game_state *remove_clues(game_state *state, random_state *rs,
1412 1413
1413 1414
1414static char *new_game_desc(const game_params *params, random_state *rs, 1415static char *new_game_desc(const game_params *params, random_state *rs,
1415 char **aux, int interactive) 1416 char **aux, bool interactive)
1416{ 1417{
1417 /* solution and description both use run-length encoding in obvious ways */ 1418 /* solution and description both use run-length encoding in obvious ways */
1418 char *retval, *game_desc, *grid_desc; 1419 char *retval, *game_desc, *grid_desc;
@@ -1425,17 +1426,18 @@ static char *new_game_desc(const game_params *params, random_state *rs,
1425 1426
1426 state->clues = snewn(g->num_faces, signed char); 1427 state->clues = snewn(g->num_faces, signed char);
1427 state->lines = snewn(g->num_edges, char); 1428 state->lines = snewn(g->num_edges, char);
1428 state->line_errors = snewn(g->num_edges, unsigned char); 1429 state->line_errors = snewn(g->num_edges, bool);
1429 state->exactly_one_loop = FALSE; 1430 state->exactly_one_loop = false;
1430 1431
1431 state->grid_type = params->type; 1432 state->grid_type = params->type;
1432 1433
1433 newboard_please: 1434 newboard_please:
1434 1435
1435 memset(state->lines, LINE_UNKNOWN, g->num_edges); 1436 memset(state->lines, LINE_UNKNOWN, g->num_edges);
1436 memset(state->line_errors, 0, g->num_edges); 1437 memset(state->line_errors, 0, g->num_edges * sizeof(bool));
1437 1438
1438 state->solved = state->cheated = FALSE; 1439 state->solved = false;
1440 state->cheated = false;
1439 1441
1440 /* Get a new random solvable board with all its clues filled in. Yes, this 1442 /* Get a new random solvable board with all its clues filled in. Yes, this
1441 * can loop for ever if the params are suitably unfavourable, but 1443 * can loop for ever if the params are suitably unfavourable, but
@@ -1497,10 +1499,10 @@ static game_state *new_game(midend *me, const game_params *params,
1497 1499
1498 state->clues = snewn(num_faces, signed char); 1500 state->clues = snewn(num_faces, signed char);
1499 state->lines = snewn(num_edges, char); 1501 state->lines = snewn(num_edges, char);
1500 state->line_errors = snewn(num_edges, unsigned char); 1502 state->line_errors = snewn(num_edges, bool);
1501 state->exactly_one_loop = FALSE; 1503 state->exactly_one_loop = false;
1502 1504
1503 state->solved = state->cheated = FALSE; 1505 state->solved = state->cheated = false;
1504 1506
1505 state->grid_type = params->type; 1507 state->grid_type = params->type;
1506 1508
@@ -1528,21 +1530,22 @@ static game_state *new_game(midend *me, const game_params *params,
1528 } 1530 }
1529 1531
1530 memset(state->lines, LINE_UNKNOWN, num_edges); 1532 memset(state->lines, LINE_UNKNOWN, num_edges);
1531 memset(state->line_errors, 0, num_edges); 1533 memset(state->line_errors, 0, num_edges * sizeof(bool));
1532 return state; 1534 return state;
1533} 1535}
1534 1536
1535/* Calculates the line_errors data, and checks if the current state is a 1537/* Calculates the line_errors data, and checks if the current state is a
1536 * solution */ 1538 * solution */
1537static int check_completion(game_state *state) 1539static bool check_completion(game_state *state)
1538{ 1540{
1539 grid *g = state->game_grid; 1541 grid *g = state->game_grid;
1540 int i, ret; 1542 int i;
1543 bool ret;
1541 int *dsf, *component_state; 1544 int *dsf, *component_state;
1542 int nsilly, nloop, npath, largest_comp, largest_size, total_pathsize; 1545 int nsilly, nloop, npath, largest_comp, largest_size, total_pathsize;
1543 enum { COMP_NONE, COMP_LOOP, COMP_PATH, COMP_SILLY, COMP_EMPTY }; 1546 enum { COMP_NONE, COMP_LOOP, COMP_PATH, COMP_SILLY, COMP_EMPTY };
1544 1547
1545 memset(state->line_errors, 0, g->num_edges); 1548 memset(state->line_errors, 0, g->num_edges * sizeof(bool));
1546 1549
1547 /* 1550 /*
1548 * Find loops in the grid, and determine whether the puzzle is 1551 * Find loops in the grid, and determine whether the puzzle is
@@ -1659,7 +1662,7 @@ static int check_completion(game_state *state)
1659 for (j = 0; j < d->order; j++) { 1662 for (j = 0; j < d->order; j++) {
1660 int e = d->edges[j] - g->edges; 1663 int e = d->edges[j] - g->edges;
1661 if (state->lines[e] == LINE_YES) 1664 if (state->lines[e] == LINE_YES)
1662 state->line_errors[e] = TRUE; 1665 state->line_errors[e] = true;
1663 } 1666 }
1664 /* And mark this component as not worthy of further 1667 /* And mark this component as not worthy of further
1665 * consideration. */ 1668 * consideration. */
@@ -1727,7 +1730,7 @@ static int check_completion(game_state *state)
1727 -1 != largest_comp) || 1730 -1 != largest_comp) ||
1728 (component_state[comp] == COMP_LOOP && 1731 (component_state[comp] == COMP_LOOP &&
1729 comp != largest_comp)) 1732 comp != largest_comp))
1730 state->line_errors[i] = TRUE; 1733 state->line_errors[i] = true;
1731 } 1734 }
1732 } 1735 }
1733 } 1736 }
@@ -1737,12 +1740,12 @@ static int check_completion(game_state *state)
1737 * If there is exactly one component and it is a loop, then 1740 * If there is exactly one component and it is a loop, then
1738 * the puzzle is potentially complete, so check the clues. 1741 * the puzzle is potentially complete, so check the clues.
1739 */ 1742 */
1740 ret = TRUE; 1743 ret = true;
1741 1744
1742 for (i = 0; i < g->num_faces; i++) { 1745 for (i = 0; i < g->num_faces; i++) {
1743 int c = state->clues[i]; 1746 int c = state->clues[i];
1744 if (c >= 0 && face_order(state, i, LINE_YES) != c) { 1747 if (c >= 0 && face_order(state, i, LINE_YES) != c) {
1745 ret = FALSE; 1748 ret = false;
1746 break; 1749 break;
1747 } 1750 }
1748 } 1751 }
@@ -1753,10 +1756,10 @@ static int check_completion(game_state *state)
1753 * nothing else, which will be used to vary the semantics of 1756 * nothing else, which will be used to vary the semantics of
1754 * clue highlighting at display time. 1757 * clue highlighting at display time.
1755 */ 1758 */
1756 state->exactly_one_loop = TRUE; 1759 state->exactly_one_loop = true;
1757 } else { 1760 } else {
1758 ret = FALSE; 1761 ret = false;
1759 state->exactly_one_loop = FALSE; 1762 state->exactly_one_loop = false;
1760 } 1763 }
1761 1764
1762 sfree(component_state); 1765 sfree(component_state);
@@ -1795,7 +1798,7 @@ static int check_completion(game_state *state)
1795 * A dline can be uniquely identified by an edge/dot combination, given that 1798 * A dline can be uniquely identified by an edge/dot combination, given that
1796 * a dline-pair always goes clockwise around its common dot. The edge/dot 1799 * a dline-pair always goes clockwise around its common dot. The edge/dot
1797 * combination can be represented by an edge/bool combination - if bool is 1800 * combination can be represented by an edge/bool combination - if bool is
1798 * TRUE, use edge->dot1 else use edge->dot2. So the total number of dlines is 1801 * true, use edge->dot1 else use edge->dot2. So the total number of dlines is
1799 * exactly twice the number of edges in the grid - although the dlines 1802 * exactly twice the number of edges in the grid - although the dlines
1800 * spanning the infinite face are not all that useful to the solver. 1803 * spanning the infinite face are not all that useful to the solver.
1801 * Note that, by convention, a dline goes clockwise around its common dot, 1804 * Note that, by convention, a dline goes clockwise around its common dot,
@@ -1850,19 +1853,19 @@ static int dline_index_from_face(grid *g, grid_face *f, int i)
1850#endif 1853#endif
1851 return ret; 1854 return ret;
1852} 1855}
1853static int is_atleastone(const char *dline_array, int index) 1856static bool is_atleastone(const char *dline_array, int index)
1854{ 1857{
1855 return BIT_SET(dline_array[index], 0); 1858 return BIT_SET(dline_array[index], 0);
1856} 1859}
1857static int set_atleastone(char *dline_array, int index) 1860static bool set_atleastone(char *dline_array, int index)
1858{ 1861{
1859 return SET_BIT(dline_array[index], 0); 1862 return SET_BIT(dline_array[index], 0);
1860} 1863}
1861static int is_atmostone(const char *dline_array, int index) 1864static bool is_atmostone(const char *dline_array, int index)
1862{ 1865{
1863 return BIT_SET(dline_array[index], 1); 1866 return BIT_SET(dline_array[index], 1);
1864} 1867}
1865static int set_atmostone(char *dline_array, int index) 1868static bool set_atmostone(char *dline_array, int index)
1866{ 1869{
1867 return SET_BIT(dline_array[index], 1); 1870 return SET_BIT(dline_array[index], 1);
1868} 1871}
@@ -1886,8 +1889,8 @@ static void array_setall(char *array, char from, char to, int len)
1886 * will find the opposite UNKNOWNS (if they are adjacent to one another) 1889 * will find the opposite UNKNOWNS (if they are adjacent to one another)
1887 * and set their corresponding dline to atleastone. (Setting atmostone 1890 * and set their corresponding dline to atleastone. (Setting atmostone
1888 * already happens in earlier dline deductions) */ 1891 * already happens in earlier dline deductions) */
1889static int dline_set_opp_atleastone(solver_state *sstate, 1892static bool dline_set_opp_atleastone(solver_state *sstate,
1890 grid_dot *d, int edge) 1893 grid_dot *d, int edge)
1891{ 1894{
1892 game_state *state = sstate->state; 1895 game_state *state = sstate->state;
1893 grid *g = state->game_grid; 1896 grid *g = state->game_grid;
@@ -1912,26 +1915,27 @@ static int dline_set_opp_atleastone(solver_state *sstate,
1912 opp_dline_index = dline_index_from_dot(g, d, opp); 1915 opp_dline_index = dline_index_from_dot(g, d, opp);
1913 return set_atleastone(sstate->dlines, opp_dline_index); 1916 return set_atleastone(sstate->dlines, opp_dline_index);
1914 } 1917 }
1915 return FALSE; 1918 return false;
1916} 1919}
1917 1920
1918 1921
1919/* Set pairs of lines around this face which are known to be identical, to 1922/* Set pairs of lines around this face which are known to be identical, to
1920 * the given line_state */ 1923 * the given line_state */
1921static int face_setall_identical(solver_state *sstate, int face_index, 1924static bool face_setall_identical(solver_state *sstate, int face_index,
1922 enum line_state line_new) 1925 enum line_state line_new)
1923{ 1926{
1924 /* can[dir] contains the canonical line associated with the line in 1927 /* can[dir] contains the canonical line associated with the line in
1925 * direction dir from the square in question. Similarly inv[dir] is 1928 * direction dir from the square in question. Similarly inv[dir] is
1926 * whether or not the line in question is inverse to its canonical 1929 * whether or not the line in question is inverse to its canonical
1927 * element. */ 1930 * element. */
1928 int retval = FALSE; 1931 bool retval = false;
1929 game_state *state = sstate->state; 1932 game_state *state = sstate->state;
1930 grid *g = state->game_grid; 1933 grid *g = state->game_grid;
1931 grid_face *f = g->faces + face_index; 1934 grid_face *f = g->faces + face_index;
1932 int N = f->order; 1935 int N = f->order;
1933 int i, j; 1936 int i, j;
1934 int can1, can2, inv1, inv2; 1937 int can1, can2;
1938 bool inv1, inv2;
1935 1939
1936 for (i = 0; i < N; i++) { 1940 for (i = 0; i < N; i++) {
1937 int line1_index = f->edges[i] - g->edges; 1941 int line1_index = f->edges[i] - g->edges;
@@ -1996,7 +2000,7 @@ static int parity_deductions(solver_state *sstate,
1996 } else if (unknown_count == 3) { 2000 } else if (unknown_count == 3) {
1997 int e[3]; 2001 int e[3];
1998 int can[3]; /* canonical edges */ 2002 int can[3]; /* canonical edges */
1999 int inv[3]; /* whether can[x] is inverse to e[x] */ 2003 bool inv[3]; /* whether can[x] is inverse to e[x] */
2000 find_unknowns(state, edge_list, 3, e); 2004 find_unknowns(state, edge_list, 3, e);
2001 can[0] = edsf_canonify(linedsf, e[0], inv); 2005 can[0] = edsf_canonify(linedsf, e[0], inv);
2002 can[1] = edsf_canonify(linedsf, e[1], inv+1); 2006 can[1] = edsf_canonify(linedsf, e[1], inv+1);
@@ -2019,7 +2023,7 @@ static int parity_deductions(solver_state *sstate,
2019 } else if (unknown_count == 4) { 2023 } else if (unknown_count == 4) {
2020 int e[4]; 2024 int e[4];
2021 int can[4]; /* canonical edges */ 2025 int can[4]; /* canonical edges */
2022 int inv[4]; /* whether can[x] is inverse to e[x] */ 2026 bool inv[4]; /* whether can[x] is inverse to e[x] */
2023 find_unknowns(state, edge_list, 4, e); 2027 find_unknowns(state, edge_list, 4, e);
2024 can[0] = edsf_canonify(linedsf, e[0], inv); 2028 can[0] = edsf_canonify(linedsf, e[0], inv);
2025 can[1] = edsf_canonify(linedsf, e[1], inv+1); 2029 can[1] = edsf_canonify(linedsf, e[1], inv+1);
@@ -2102,7 +2106,7 @@ static int trivial_deductions(solver_state *sstate)
2102 current_no = sstate->face_no_count[i]; 2106 current_no = sstate->face_no_count[i];
2103 2107
2104 if (current_yes + current_no == f->order) { 2108 if (current_yes + current_no == f->order) {
2105 sstate->face_solved[i] = TRUE; 2109 sstate->face_solved[i] = true;
2106 continue; 2110 continue;
2107 } 2111 }
2108 2112
@@ -2123,7 +2127,7 @@ static int trivial_deductions(solver_state *sstate)
2123 if (state->clues[i] == current_yes) { 2127 if (state->clues[i] == current_yes) {
2124 if (face_setall(sstate, i, LINE_UNKNOWN, LINE_NO)) 2128 if (face_setall(sstate, i, LINE_UNKNOWN, LINE_NO))
2125 diff = min(diff, DIFF_EASY); 2129 diff = min(diff, DIFF_EASY);
2126 sstate->face_solved[i] = TRUE; 2130 sstate->face_solved[i] = true;
2127 continue; 2131 continue;
2128 } 2132 }
2129 2133
@@ -2134,7 +2138,7 @@ static int trivial_deductions(solver_state *sstate)
2134 if (f->order - state->clues[i] == current_no) { 2138 if (f->order - state->clues[i] == current_no) {
2135 if (face_setall(sstate, i, LINE_UNKNOWN, LINE_YES)) 2139 if (face_setall(sstate, i, LINE_UNKNOWN, LINE_YES))
2136 diff = min(diff, DIFF_EASY); 2140 diff = min(diff, DIFF_EASY);
2137 sstate->face_solved[i] = TRUE; 2141 sstate->face_solved[i] = true;
2138 continue; 2142 continue;
2139 } 2143 }
2140 2144
@@ -2182,7 +2186,7 @@ static int trivial_deductions(solver_state *sstate)
2182 for (j = 0; j < f->order; j++) { 2186 for (j = 0; j < f->order; j++) {
2183 e = f->edges[j] - g->edges; 2187 e = f->edges[j] - g->edges;
2184 if (state->lines[e] == LINE_UNKNOWN && e != e1 && e != e2) { 2188 if (state->lines[e] == LINE_UNKNOWN && e != e1 && e != e2) {
2185 int r = solver_set_line(sstate, e, LINE_YES); 2189 bool r = solver_set_line(sstate, e, LINE_YES);
2186 assert(r); 2190 assert(r);
2187 diff = min(diff, DIFF_EASY); 2191 diff = min(diff, DIFF_EASY);
2188 } 2192 }
@@ -2206,11 +2210,11 @@ static int trivial_deductions(solver_state *sstate)
2206 2210
2207 if (yes == 0) { 2211 if (yes == 0) {
2208 if (unknown == 0) { 2212 if (unknown == 0) {
2209 sstate->dot_solved[i] = TRUE; 2213 sstate->dot_solved[i] = true;
2210 } else if (unknown == 1) { 2214 } else if (unknown == 1) {
2211 dot_setall(sstate, i, LINE_UNKNOWN, LINE_NO); 2215 dot_setall(sstate, i, LINE_UNKNOWN, LINE_NO);
2212 diff = min(diff, DIFF_EASY); 2216 diff = min(diff, DIFF_EASY);
2213 sstate->dot_solved[i] = TRUE; 2217 sstate->dot_solved[i] = true;
2214 } 2218 }
2215 } else if (yes == 1) { 2219 } else if (yes == 1) {
2216 if (unknown == 0) { 2220 if (unknown == 0) {
@@ -2225,7 +2229,7 @@ static int trivial_deductions(solver_state *sstate)
2225 dot_setall(sstate, i, LINE_UNKNOWN, LINE_NO); 2229 dot_setall(sstate, i, LINE_UNKNOWN, LINE_NO);
2226 diff = min(diff, DIFF_EASY); 2230 diff = min(diff, DIFF_EASY);
2227 } 2231 }
2228 sstate->dot_solved[i] = TRUE; 2232 sstate->dot_solved[i] = true;
2229 } else { 2233 } else {
2230 sstate->solver_status = SOLVER_MISTAKE; 2234 sstate->solver_status = SOLVER_MISTAKE;
2231 return DIFF_EASY; 2235 return DIFF_EASY;
@@ -2627,7 +2631,8 @@ static int linedsf_deductions(solver_state *sstate)
2627 int dline_index = dline_index_from_dot(g, d, j); 2631 int dline_index = dline_index_from_dot(g, d, j);
2628 int line1_index; 2632 int line1_index;
2629 int line2_index; 2633 int line2_index;
2630 int can1, can2, inv1, inv2; 2634 int can1, can2;
2635 bool inv1, inv2;
2631 int j2; 2636 int j2;
2632 line1_index = d->edges[j] - g->edges; 2637 line1_index = d->edges[j] - g->edges;
2633 if (state->lines[line1_index] != LINE_UNKNOWN) 2638 if (state->lines[line1_index] != LINE_UNKNOWN)
@@ -2651,7 +2656,7 @@ static int linedsf_deductions(solver_state *sstate)
2651 /* Infer linedsf from dline flags */ 2656 /* Infer linedsf from dline flags */
2652 if (is_atmostone(dlines, dline_index) 2657 if (is_atmostone(dlines, dline_index)
2653 && is_atleastone(dlines, dline_index)) { 2658 && is_atleastone(dlines, dline_index)) {
2654 if (merge_lines(sstate, line1_index, line2_index, 1)) 2659 if (merge_lines(sstate, line1_index, line2_index, true))
2655 diff = min(diff, DIFF_HARD); 2660 diff = min(diff, DIFF_HARD);
2656 } 2661 }
2657 } 2662 }
@@ -2671,7 +2676,8 @@ static int linedsf_deductions(solver_state *sstate)
2671 /* If the state of a line is known, deduce the state of its canonical line 2676 /* If the state of a line is known, deduce the state of its canonical line
2672 * too, and vice versa. */ 2677 * too, and vice versa. */
2673 for (i = 0; i < g->num_edges; i++) { 2678 for (i = 0; i < g->num_edges; i++) {
2674 int can, inv; 2679 int can;
2680 bool inv;
2675 enum line_state s; 2681 enum line_state s;
2676 can = edsf_canonify(sstate->linedsf, i, &inv); 2682 can = edsf_canonify(sstate->linedsf, i, &inv);
2677 if (can == i) 2683 if (can == i)
@@ -2698,9 +2704,9 @@ static int loop_deductions(solver_state *sstate)
2698 game_state *state = sstate->state; 2704 game_state *state = sstate->state;
2699 grid *g = state->game_grid; 2705 grid *g = state->game_grid;
2700 int shortest_chainlen = g->num_dots; 2706 int shortest_chainlen = g->num_dots;
2701 int loop_found = FALSE; 2707 bool loop_found = false;
2702 int dots_connected; 2708 int dots_connected;
2703 int progress = FALSE; 2709 bool progress = false;
2704 int i; 2710 int i;
2705 2711
2706 /* 2712 /*
@@ -2745,7 +2751,7 @@ static int loop_deductions(solver_state *sstate)
2745 sstate->solver_status = SOLVER_SOLVED; 2751 sstate->solver_status = SOLVER_SOLVED;
2746 /* This discovery clearly counts as progress, even if we haven't 2752 /* This discovery clearly counts as progress, even if we haven't
2747 * just added any lines or anything */ 2753 * just added any lines or anything */
2748 progress = TRUE; 2754 progress = true;
2749 goto finished_loop_deductionsing; 2755 goto finished_loop_deductionsing;
2750 } 2756 }
2751 2757
@@ -2833,7 +2839,7 @@ static int loop_deductions(solver_state *sstate)
2833 * make. 2839 * make.
2834 */ 2840 */
2835 progress = solver_set_line(sstate, i, val); 2841 progress = solver_set_line(sstate, i, val);
2836 assert(progress == TRUE); 2842 assert(progress);
2837 if (val == LINE_YES) { 2843 if (val == LINE_YES) {
2838 sstate->solver_status = SOLVER_AMBIGUOUS; 2844 sstate->solver_status = SOLVER_AMBIGUOUS;
2839 goto finished_loop_deductionsing; 2845 goto finished_loop_deductionsing;
@@ -3096,7 +3102,7 @@ static game_state *execute_move(const game_state *state, const char *move)
3096 3102
3097 if (move[0] == 'S') { 3103 if (move[0] == 'S') {
3098 move++; 3104 move++;
3099 newstate->cheated = TRUE; 3105 newstate->cheated = true;
3100 } 3106 }
3101 3107
3102 while (*move) { 3108 while (*move) {
@@ -3123,7 +3129,7 @@ static game_state *execute_move(const game_state *state, const char *move)
3123 * Check for completion. 3129 * Check for completion.
3124 */ 3130 */
3125 if (check_completion(newstate)) 3131 if (check_completion(newstate))
3126 newstate->solved = TRUE; 3132 newstate->solved = true;
3127 3133
3128 return newstate; 3134 return newstate;
3129 3135
@@ -3304,8 +3310,8 @@ static void game_redraw_dot(drawing *dr, game_drawstate *ds,
3304 draw_circle(dr, x, y, 2, COL_FOREGROUND, COL_FOREGROUND); 3310 draw_circle(dr, x, y, 2, COL_FOREGROUND, COL_FOREGROUND);
3305} 3311}
3306 3312
3307static int boxes_intersect(int x0, int y0, int w0, int h0, 3313static bool boxes_intersect(int x0, int y0, int w0, int h0,
3308 int x1, int y1, int w1, int h1) 3314 int x1, int y1, int w1, int h1)
3309{ 3315{
3310 /* 3316 /*
3311 * Two intervals intersect iff neither is wholly on one side of 3317 * Two intervals intersect iff neither is wholly on one side of
@@ -3360,8 +3366,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
3360 grid *g = state->game_grid; 3366 grid *g = state->game_grid;
3361 int border = BORDER(ds->tilesize); 3367 int border = BORDER(ds->tilesize);
3362 int i; 3368 int i;
3363 int flash_changed; 3369 bool flash_changed;
3364 int redraw_everything = FALSE; 3370 bool redraw_everything = false;
3365 3371
3366 int edges[REDRAW_OBJECTS_LIMIT], nedges = 0; 3372 int edges[REDRAW_OBJECTS_LIMIT], nedges = 0;
3367 int faces[REDRAW_OBJECTS_LIMIT], nfaces = 0; 3373 int faces[REDRAW_OBJECTS_LIMIT], nfaces = 0;
@@ -3392,7 +3398,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
3392 */ 3398 */
3393 3399
3394 if (!ds->started) { 3400 if (!ds->started) {
3395 redraw_everything = TRUE; 3401 redraw_everything = true;
3396 /* 3402 /*
3397 * But we must still go through the upcoming loops, so that we 3403 * But we must still go through the upcoming loops, so that we
3398 * set up stuff in ds correctly for the initial redraw. 3404 * set up stuff in ds correctly for the initial redraw.
@@ -3404,8 +3410,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
3404 grid_face *f = g->faces + i; 3410 grid_face *f = g->faces + i;
3405 int sides = f->order; 3411 int sides = f->order;
3406 int yes_order, no_order; 3412 int yes_order, no_order;
3407 int clue_mistake; 3413 bool clue_mistake;
3408 int clue_satisfied; 3414 bool clue_satisfied;
3409 int n = state->clues[i]; 3415 int n = state->clues[i];
3410 if (n < 0) 3416 if (n < 0)
3411 continue; 3417 continue;
@@ -3456,7 +3462,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
3456 ds->clue_error[i] = clue_mistake; 3462 ds->clue_error[i] = clue_mistake;
3457 ds->clue_satisfied[i] = clue_satisfied; 3463 ds->clue_satisfied[i] = clue_satisfied;
3458 if (nfaces == REDRAW_OBJECTS_LIMIT) 3464 if (nfaces == REDRAW_OBJECTS_LIMIT)
3459 redraw_everything = TRUE; 3465 redraw_everything = true;
3460 else 3466 else
3461 faces[nfaces++] = i; 3467 faces[nfaces++] = i;
3462 } 3468 }
@@ -3467,10 +3473,10 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
3467 (flashtime <= FLASH_TIME/3 || 3473 (flashtime <= FLASH_TIME/3 ||
3468 flashtime >= FLASH_TIME*2/3)) { 3474 flashtime >= FLASH_TIME*2/3)) {
3469 flash_changed = !ds->flashing; 3475 flash_changed = !ds->flashing;
3470 ds->flashing = TRUE; 3476 ds->flashing = true;
3471 } else { 3477 } else {
3472 flash_changed = ds->flashing; 3478 flash_changed = ds->flashing;
3473 ds->flashing = FALSE; 3479 ds->flashing = false;
3474 } 3480 }
3475 3481
3476 /* Now, trundle through the edges. */ 3482 /* Now, trundle through the edges. */
@@ -3481,7 +3487,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
3481 (flash_changed && state->lines[i] == LINE_YES)) { 3487 (flash_changed && state->lines[i] == LINE_YES)) {
3482 ds->lines[i] = new_ds; 3488 ds->lines[i] = new_ds;
3483 if (nedges == REDRAW_OBJECTS_LIMIT) 3489 if (nedges == REDRAW_OBJECTS_LIMIT)
3484 redraw_everything = TRUE; 3490 redraw_everything = true;
3485 else 3491 else
3486 edges[nedges++] = i; 3492 edges[nedges++] = i;
3487 } 3493 }
@@ -3517,7 +3523,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
3517 } 3523 }
3518 } 3524 }
3519 3525
3520 ds->started = TRUE; 3526 ds->started = true;
3521} 3527}
3522 3528
3523static float game_flash_length(const game_state *oldstate, 3529static float game_flash_length(const game_state *oldstate,
@@ -3645,7 +3651,7 @@ const struct game thegame = {
3645 encode_params, 3651 encode_params,
3646 free_params, 3652 free_params,
3647 dup_params, 3653 dup_params,
3648 TRUE, game_configure, custom_params, 3654 true, game_configure, custom_params,
3649 validate_params, 3655 validate_params,
3650 new_game_desc, 3656 new_game_desc,
3651 validate_desc, 3657 validate_desc,
@@ -3653,7 +3659,7 @@ const struct game thegame = {
3653 dup_game, 3659 dup_game,
3654 free_game, 3660 free_game,
3655 1, solve_game, 3661 1, solve_game,
3656 TRUE, game_can_format_as_text_now, game_text_format, 3662 true, game_can_format_as_text_now, game_text_format,
3657 new_ui, 3663 new_ui,
3658 free_ui, 3664 free_ui,
3659 encode_ui, 3665 encode_ui,
@@ -3670,9 +3676,9 @@ const struct game thegame = {
3670 game_anim_length, 3676 game_anim_length,
3671 game_flash_length, 3677 game_flash_length,
3672 game_status, 3678 game_status,
3673 TRUE, FALSE, game_print_size, game_print, 3679 true, false, game_print_size, game_print,
3674 FALSE /* wants_statusbar */, 3680 false /* wants_statusbar */,
3675 FALSE, game_timing_state, 3681 false, game_timing_state,
3676 0, /* mouse_priorities */ 3682 0, /* mouse_priorities */
3677}; 3683};
3678 3684
@@ -3694,21 +3700,21 @@ int main(int argc, char **argv)
3694 game_state *s; 3700 game_state *s;
3695 char *id = NULL, *desc; 3701 char *id = NULL, *desc;
3696 const char *err; 3702 const char *err;
3697 int grade = FALSE; 3703 bool grade = false;
3698 int ret, diff; 3704 int ret, diff;
3699#if 0 /* verbose solver not supported here (yet) */ 3705#if 0 /* verbose solver not supported here (yet) */
3700 int really_verbose = FALSE; 3706 bool really_verbose = false;
3701#endif 3707#endif
3702 3708
3703 while (--argc > 0) { 3709 while (--argc > 0) {
3704 char *p = *++argv; 3710 char *p = *++argv;
3705#if 0 /* verbose solver not supported here (yet) */ 3711#if 0 /* verbose solver not supported here (yet) */
3706 if (!strcmp(p, "-v")) { 3712 if (!strcmp(p, "-v")) {
3707 really_verbose = TRUE; 3713 really_verbose = true;
3708 } else 3714 } else
3709#endif 3715#endif
3710 if (!strcmp(p, "-g")) { 3716 if (!strcmp(p, "-g")) {
3711 grade = TRUE; 3717 grade = true;
3712 } else if (*p == '-') { 3718 } else if (*p == '-') {
3713 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p); 3719 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p);
3714 return 1; 3720 return 1;
diff --git a/apps/plugins/puzzles/src/magnets.c b/apps/plugins/puzzles/src/magnets.c
index c9f97b63dd..1a5f37f1fd 100644
--- a/apps/plugins/puzzles/src/magnets.c
+++ b/apps/plugins/puzzles/src/magnets.c
@@ -41,7 +41,7 @@
41#include "puzzles.h" 41#include "puzzles.h"
42 42
43#ifdef STANDALONE_SOLVER 43#ifdef STANDALONE_SOLVER
44int verbose = 0; 44bool verbose = 0;
45#endif 45#endif
46 46
47enum { 47enum {
@@ -88,7 +88,8 @@ static char const magnets_diffchars[] = DIFFLIST(ENCODE);
88/* Game parameter functions. */ 88/* Game parameter functions. */
89 89
90struct game_params { 90struct game_params {
91 int w, h, diff, stripclues; 91 int w, h, diff;
92 bool stripclues;
92}; 93};
93 94
94#define DEFAULT_PRESET 2 95#define DEFAULT_PRESET 2
@@ -113,12 +114,12 @@ static game_params *default_params(void)
113 return ret; 114 return ret;
114} 115}
115 116
116static int game_fetch_preset(int i, char **name, game_params **params) 117static bool game_fetch_preset(int i, char **name, game_params **params)
117{ 118{
118 game_params *ret; 119 game_params *ret;
119 char buf[64]; 120 char buf[64];
120 121
121 if (i < 0 || i >= lenof(magnets_presets)) return FALSE; 122 if (i < 0 || i >= lenof(magnets_presets)) return false;
122 123
123 ret = default_params(); 124 ret = default_params();
124 *ret = magnets_presets[i]; /* struct copy */ 125 *ret = magnets_presets[i]; /* struct copy */
@@ -130,7 +131,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
130 magnets_presets[i].stripclues ? ", strip clues" : ""); 131 magnets_presets[i].stripclues ? ", strip clues" : "");
131 *name = dupstr(buf); 132 *name = dupstr(buf);
132 133
133 return TRUE; 134 return true;
134} 135}
135 136
136static void free_params(game_params *params) 137static void free_params(game_params *params)
@@ -165,14 +166,14 @@ static void decode_params(game_params *ret, char const *string)
165 if (*string) string++; 166 if (*string) string++;
166 } 167 }
167 168
168 ret->stripclues = 0; 169 ret->stripclues = false;
169 if (*string == 'S') { 170 if (*string == 'S') {
170 string++; 171 string++;
171 ret->stripclues = 1; 172 ret->stripclues = true;
172 } 173 }
173} 174}
174 175
175static char *encode_params(const game_params *params, int full) 176static char *encode_params(const game_params *params, bool full)
176{ 177{
177 char buf[256]; 178 char buf[256];
178 sprintf(buf, "%dx%d", params->w, params->h); 179 sprintf(buf, "%dx%d", params->w, params->h);
@@ -227,7 +228,7 @@ static game_params *custom_params(const config_item *cfg)
227 return ret; 228 return ret;
228} 229}
229 230
230static const char *validate_params(const game_params *params, int full) 231static const char *validate_params(const game_params *params, bool full)
231{ 232{
232 if (params->w < 2) return "Width must be at least one"; 233 if (params->w < 2) return "Width must be at least one";
233 if (params->h < 2) return "Height must be at least one"; 234 if (params->h < 2) return "Height must be at least one";
@@ -267,8 +268,8 @@ struct game_state {
267 int w, h, wh; 268 int w, h, wh;
268 int *grid; /* size w*h, for cell state (pos/neg) */ 269 int *grid; /* size w*h, for cell state (pos/neg) */
269 unsigned int *flags; /* size w*h */ 270 unsigned int *flags; /* size w*h */
270 int solved, completed, numbered; 271 bool solved, completed, numbered;
271 unsigned char *counts_done; 272 bool *counts_done;
272 273
273 struct game_common *common; /* domino layout never changes. */ 274 struct game_common *common; /* domino layout never changes. */
274}; 275};
@@ -277,11 +278,13 @@ static void clear_state(game_state *ret)
277{ 278{
278 int i; 279 int i;
279 280
280 ret->solved = ret->completed = ret->numbered = 0; 281 ret->solved = false;
282 ret->completed = false;
283 ret->numbered = false;
281 284
282 memset(ret->common->rowcount, 0, ret->h*3*sizeof(int)); 285 memset(ret->common->rowcount, 0, ret->h*3*sizeof(int));
283 memset(ret->common->colcount, 0, ret->w*3*sizeof(int)); 286 memset(ret->common->colcount, 0, ret->w*3*sizeof(int));
284 memset(ret->counts_done, 0, (ret->h + ret->w) * 2 * sizeof(unsigned char)); 287 memset(ret->counts_done, 0, (ret->h + ret->w) * 2 * sizeof(bool));
285 288
286 for (i = 0; i < ret->wh; i++) { 289 for (i = 0; i < ret->wh; i++) {
287 ret->grid[i] = EMPTY; 290 ret->grid[i] = EMPTY;
@@ -301,7 +304,7 @@ static game_state *new_state(int w, int h)
301 304
302 ret->grid = snewn(ret->wh, int); 305 ret->grid = snewn(ret->wh, int);
303 ret->flags = snewn(ret->wh, unsigned int); 306 ret->flags = snewn(ret->wh, unsigned int);
304 ret->counts_done = snewn((ret->h + ret->w) * 2, unsigned char); 307 ret->counts_done = snewn((ret->h + ret->w) * 2, bool);
305 308
306 ret->common = snew(struct game_common); 309 ret->common = snew(struct game_common);
307 ret->common->refcount = 1; 310 ret->common->refcount = 1;
@@ -333,9 +336,9 @@ static game_state *dup_game(const game_state *src)
333 dest->grid = snewn(dest->wh, int); 336 dest->grid = snewn(dest->wh, int);
334 memcpy(dest->grid, src->grid, dest->wh*sizeof(int)); 337 memcpy(dest->grid, src->grid, dest->wh*sizeof(int));
335 338
336 dest->counts_done = snewn((dest->h + dest->w) * 2, unsigned char); 339 dest->counts_done = snewn((dest->h + dest->w) * 2, bool);
337 memcpy(dest->counts_done, src->counts_done, 340 memcpy(dest->counts_done, src->counts_done,
338 (dest->h + dest->w) * 2 * sizeof(unsigned char)); 341 (dest->h + dest->w) * 2 * sizeof(bool));
339 342
340 dest->flags = snewn(dest->wh, unsigned int); 343 dest->flags = snewn(dest->wh, unsigned int);
341 memcpy(dest->flags, src->flags, dest->wh*sizeof(unsigned int)); 344 memcpy(dest->flags, src->flags, dest->wh*sizeof(unsigned int));
@@ -518,7 +521,7 @@ nextchar:
518 } 521 }
519 } 522 }
520 /* Success. */ 523 /* Success. */
521 state->numbered = 1; 524 state->numbered = true;
522 goto done; 525 goto done;
523 526
524badchar: 527badchar:
@@ -599,9 +602,9 @@ static void game_text_hborder(const game_state *state, char **p_r)
599 *p_r = p; 602 *p_r = p;
600} 603}
601 604
602static int game_can_format_as_text_now(const game_params *params) 605static bool game_can_format_as_text_now(const game_params *params)
603{ 606{
604 return TRUE; 607 return true;
605} 608}
606 609
607static char *game_text_format(const game_state *state) 610static char *game_text_format(const game_state *state)
@@ -728,21 +731,22 @@ static int count_rowcol(const game_state *state, int num, int roworcol,
728} 731}
729 732
730static void check_rowcol(game_state *state, int num, int roworcol, int which, 733static void check_rowcol(game_state *state, int num, int roworcol, int which,
731 int *wrong, int *incomplete) 734 bool *wrong, bool *incomplete)
732{ 735{
733 int count, target = mkrowcol(state, num, roworcol).targets[which]; 736 int count, target = mkrowcol(state, num, roworcol).targets[which];
734 737
735 if (target == -1) return; /* no number to check against. */ 738 if (target == -1) return; /* no number to check against. */
736 739
737 count = count_rowcol(state, num, roworcol, which); 740 count = count_rowcol(state, num, roworcol, which);
738 if (count < target) *incomplete = 1; 741 if (count < target) *incomplete = true;
739 if (count > target) *wrong = 1; 742 if (count > target) *wrong = true;
740} 743}
741 744
742static int check_completion(game_state *state) 745static int check_completion(game_state *state)
743{ 746{
744 int i, j, x, y, idx, w = state->w, h = state->h; 747 int i, j, x, y, idx, w = state->w, h = state->h;
745 int which = POSITIVE, wrong = 0, incomplete = 0; 748 int which = POSITIVE;
749 bool wrong = false, incomplete = false;
746 750
747 /* Check row and column counts for magnets. */ 751 /* Check row and column counts for magnets. */
748 for (which = POSITIVE, j = 0; j < 2; which = OPPOSITE(which), j++) { 752 for (which = POSITIVE, j = 0; j < 2; which = OPPOSITE(which), j++) {
@@ -762,14 +766,14 @@ static int check_completion(game_state *state)
762 continue; /* no domino here */ 766 continue; /* no domino here */
763 767
764 if (!(state->flags[idx] & GS_SET)) 768 if (!(state->flags[idx] & GS_SET))
765 incomplete = 1; 769 incomplete = true;
766 770
767 which = state->grid[idx]; 771 which = state->grid[idx];
768 if (which != NEUTRAL) { 772 if (which != NEUTRAL) {
769#define CHECK(xx,yy) do { \ 773#define CHECK(xx,yy) do { \
770 if (INGRID(state,xx,yy) && \ 774 if (INGRID(state,xx,yy) && \
771 (state->grid[(yy)*w+(xx)] == which)) { \ 775 (state->grid[(yy)*w+(xx)] == which)) { \
772 wrong = 1; \ 776 wrong = true; \
773 state->flags[(yy)*w+(xx)] |= GS_ERROR; \ 777 state->flags[(yy)*w+(xx)] |= GS_ERROR; \
774 state->flags[y*w+x] |= GS_ERROR; \ 778 state->flags[y*w+x] |= GS_ERROR; \
775 } \ 779 } \
@@ -1100,7 +1104,8 @@ static int solve_neither(game_state *state)
1100 1104
1101static int solve_advancedfull(game_state *state, rowcol rc, int *counts) 1105static int solve_advancedfull(game_state *state, rowcol rc, int *counts)
1102{ 1106{
1103 int i, j, nfound = 0, clearpos = 0, clearneg = 0, ret = 0; 1107 int i, j, nfound = 0, ret = 0;
1108 bool clearpos = false, clearneg = false;
1104 1109
1105 /* For this row/col, look for a domino entirely within the row where 1110 /* For this row/col, look for a domino entirely within the row where
1106 * both ends can only be + or - (but isn't held). 1111 * both ends can only be + or - (but isn't held).
@@ -1146,11 +1151,11 @@ static int solve_advancedfull(game_state *state, rowcol rc, int *counts)
1146 1151
1147 if (rc.targets[POSITIVE] >= 0 && counts[POSITIVE] == rc.targets[POSITIVE]) { 1152 if (rc.targets[POSITIVE] >= 0 && counts[POSITIVE] == rc.targets[POSITIVE]) {
1148 debug(("%s %d has now filled POSITIVE:", rc.name, rc.num)); 1153 debug(("%s %d has now filled POSITIVE:", rc.name, rc.num));
1149 clearpos = 1; 1154 clearpos = true;
1150 } 1155 }
1151 if (rc.targets[NEGATIVE] >= 0 && counts[NEGATIVE] == rc.targets[NEGATIVE]) { 1156 if (rc.targets[NEGATIVE] >= 0 && counts[NEGATIVE] == rc.targets[NEGATIVE]) {
1152 debug(("%s %d has now filled NEGATIVE:", rc.name, rc.num)); 1157 debug(("%s %d has now filled NEGATIVE:", rc.name, rc.num));
1153 clearneg = 1; 1158 clearneg = true;
1154 } 1159 }
1155 1160
1156 if (!clearpos && !clearneg) return 0; 1161 if (!clearpos && !clearneg) return 0;
@@ -1202,7 +1207,8 @@ static int solve_nonneutral(game_state *state, rowcol rc, int *counts)
1202static int solve_oddlength(game_state *state, rowcol rc, int *counts) 1207static int solve_oddlength(game_state *state, rowcol rc, int *counts)
1203{ 1208{
1204 int i, j, ret = 0, extra, tpos, tneg; 1209 int i, j, ret = 0, extra, tpos, tneg;
1205 int start = -1, length = 0, inempty = 0, startodd = -1; 1210 int start = -1, length = 0, startodd = -1;
1211 bool inempty = false;
1206 1212
1207 /* need zero neutral cells still to find... */ 1213 /* need zero neutral cells still to find... */
1208 if (rc.targets[NEUTRAL] != counts[NEUTRAL]) 1214 if (rc.targets[NEUTRAL] != counts[NEUTRAL])
@@ -1225,7 +1231,7 @@ static int solve_oddlength(game_state *state, rowcol rc, int *counts)
1225 if (startodd != -1) goto twoodd; 1231 if (startodd != -1) goto twoodd;
1226 startodd = start; 1232 startodd = start;
1227 } 1233 }
1228 inempty = 0; 1234 inempty = false;
1229 } 1235 }
1230 } else { 1236 } else {
1231 if (inempty) 1237 if (inempty)
@@ -1233,7 +1239,7 @@ static int solve_oddlength(game_state *state, rowcol rc, int *counts)
1233 else { 1239 else {
1234 start = i; 1240 start = i;
1235 length = 1; 1241 length = 1;
1236 inempty = 1; 1242 inempty = true;
1237 } 1243 }
1238 } 1244 }
1239 } 1245 }
@@ -1259,7 +1265,8 @@ twoodd:
1259 * or to the #remaining negative, no empty cells can be neutral. */ 1265 * or to the #remaining negative, no empty cells can be neutral. */
1260static int solve_countdominoes_neutral(game_state *state, rowcol rc, int *counts) 1266static int solve_countdominoes_neutral(game_state *state, rowcol rc, int *counts)
1261{ 1267{
1262 int i, j, ndom = 0, nonn = 0, ret = 0; 1268 int i, j, ndom = 0, ret = 0;
1269 bool nonn = false;
1263 1270
1264 if ((rc.targets[POSITIVE] == -1) && (rc.targets[NEGATIVE] == -1)) 1271 if ((rc.targets[POSITIVE] == -1) && (rc.targets[NEGATIVE] == -1))
1265 return 0; /* need at least one target to compare. */ 1272 return 0; /* need at least one target to compare. */
@@ -1278,10 +1285,10 @@ static int solve_countdominoes_neutral(game_state *state, rowcol rc, int *counts
1278 1285
1279 if ((rc.targets[POSITIVE] != -1) && 1286 if ((rc.targets[POSITIVE] != -1) &&
1280 (rc.targets[POSITIVE]-counts[POSITIVE] == ndom)) 1287 (rc.targets[POSITIVE]-counts[POSITIVE] == ndom))
1281 nonn = 1; 1288 nonn = true;
1282 if ((rc.targets[NEGATIVE] != -1) && 1289 if ((rc.targets[NEGATIVE] != -1) &&
1283 (rc.targets[NEGATIVE]-counts[NEGATIVE] == ndom)) 1290 (rc.targets[NEGATIVE]-counts[NEGATIVE] == ndom))
1284 nonn = 1; 1291 nonn = true;
1285 1292
1286 if (!nonn) return 0; 1293 if (!nonn) return 0;
1287 1294
@@ -1400,7 +1407,7 @@ static int solve_state(game_state *state, int diff)
1400 1407
1401 1408
1402static char *game_state_diff(const game_state *src, const game_state *dst, 1409static char *game_state_diff(const game_state *src, const game_state *dst,
1403 int issolve) 1410 bool issolve)
1404{ 1411{
1405 char *ret = NULL, buf[80], c; 1412 char *ret = NULL, buf[80], c;
1406 int retlen = 0, x, y, i, k; 1413 int retlen = 0, x, y, i, k;
@@ -1473,7 +1480,7 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1473 return NULL; 1480 return NULL;
1474 1481
1475solved: 1482solved:
1476 move = game_state_diff(currstate, solved, 1); 1483 move = game_state_diff(currstate, solved, true);
1477 free_game(solved); 1484 free_game(solved);
1478 return move; 1485 return move;
1479} 1486}
@@ -1598,7 +1605,7 @@ static void gen_game(game_state *new, random_state *rs)
1598 new->common->rowcount[y*3+val]++; 1605 new->common->rowcount[y*3+val]++;
1599 } 1606 }
1600 } 1607 }
1601 new->numbered = 1; 1608 new->numbered = true;
1602 1609
1603 sfree(scratch); 1610 sfree(scratch);
1604} 1611}
@@ -1684,7 +1691,7 @@ static int check_difficulty(const game_params *params, game_state *new,
1684} 1691}
1685 1692
1686static char *new_game_desc(const game_params *params, random_state *rs, 1693static char *new_game_desc(const game_params *params, random_state *rs,
1687 char **aux_r, int interactive) 1694 char **aux_r, bool interactive)
1688{ 1695{
1689 game_state *new = new_state(params->w, params->h); 1696 game_state *new = new_state(params->w, params->h);
1690 char *desc, *aux = snewn(new->wh+1, char); 1697 char *desc, *aux = snewn(new->wh+1, char);
@@ -1705,14 +1712,15 @@ static char *new_game_desc(const game_params *params, random_state *rs,
1705} 1712}
1706 1713
1707struct game_ui { 1714struct game_ui {
1708 int cur_x, cur_y, cur_visible; 1715 int cur_x, cur_y;
1716 bool cur_visible;
1709}; 1717};
1710 1718
1711static game_ui *new_ui(const game_state *state) 1719static game_ui *new_ui(const game_state *state)
1712{ 1720{
1713 game_ui *ui = snew(game_ui); 1721 game_ui *ui = snew(game_ui);
1714 ui->cur_x = ui->cur_y = 0; 1722 ui->cur_x = ui->cur_y = 0;
1715 ui->cur_visible = 0; 1723 ui->cur_visible = false;
1716 return ui; 1724 return ui;
1717} 1725}
1718 1726
@@ -1734,11 +1742,12 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1734 const game_state *newstate) 1742 const game_state *newstate)
1735{ 1743{
1736 if (!oldstate->completed && newstate->completed) 1744 if (!oldstate->completed && newstate->completed)
1737 ui->cur_visible = 0; 1745 ui->cur_visible = false;
1738} 1746}
1739 1747
1740struct game_drawstate { 1748struct game_drawstate {
1741 int tilesize, started, solved; 1749 int tilesize;
1750 bool started, solved;
1742 int w, h; 1751 int w, h;
1743 unsigned long *what; /* size w*h */ 1752 unsigned long *what; /* size w*h */
1744 unsigned long *colwhat, *rowwhat; /* size 3*w, 3*h */ 1753 unsigned long *colwhat, *rowwhat; /* size 3*w, 3*h */
@@ -1761,15 +1770,15 @@ struct game_drawstate {
1761#define COORD(x) ( (x+1) * TILE_SIZE + BORDER ) 1770#define COORD(x) ( (x+1) * TILE_SIZE + BORDER )
1762#define FROMCOORD(x) ( (x - BORDER) / TILE_SIZE - 1 ) 1771#define FROMCOORD(x) ( (x - BORDER) / TILE_SIZE - 1 )
1763 1772
1764static int is_clue(const game_state *state, int x, int y) 1773static bool is_clue(const game_state *state, int x, int y)
1765{ 1774{
1766 int h = state->h, w = state->w; 1775 int h = state->h, w = state->w;
1767 1776
1768 if (((x == -1 || x == w) && y >= 0 && y < h) || 1777 if (((x == -1 || x == w) && y >= 0 && y < h) ||
1769 ((y == -1 || y == h) && x >= 0 && x < w)) 1778 ((y == -1 || y == h) && x >= 0 && x < w))
1770 return TRUE; 1779 return true;
1771 1780
1772 return FALSE; 1781 return false;
1773} 1782}
1774 1783
1775static int clue_index(const game_state *state, int x, int y) 1784static int clue_index(const game_state *state, int x, int y)
@@ -1797,12 +1806,12 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1797 enum { CYCLE_MAGNET, CYCLE_NEUTRAL } action; 1806 enum { CYCLE_MAGNET, CYCLE_NEUTRAL } action;
1798 1807
1799 if (IS_CURSOR_MOVE(button)) { 1808 if (IS_CURSOR_MOVE(button)) {
1800 move_cursor(button, &ui->cur_x, &ui->cur_y, state->w, state->h, 0); 1809 move_cursor(button, &ui->cur_x, &ui->cur_y, state->w, state->h, false);
1801 ui->cur_visible = 1; 1810 ui->cur_visible = true;
1802 return UI_UPDATE; 1811 return UI_UPDATE;
1803 } else if (IS_CURSOR_SELECT(button)) { 1812 } else if (IS_CURSOR_SELECT(button)) {
1804 if (!ui->cur_visible) { 1813 if (!ui->cur_visible) {
1805 ui->cur_visible = 1; 1814 ui->cur_visible = true;
1806 return UI_UPDATE; 1815 return UI_UPDATE;
1807 } 1816 }
1808 action = (button == CURSOR_SELECT) ? CYCLE_MAGNET : CYCLE_NEUTRAL; 1817 action = (button == CURSOR_SELECT) ? CYCLE_MAGNET : CYCLE_NEUTRAL;
@@ -1811,7 +1820,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1811 } else if (INGRID(state, gx, gy) && 1820 } else if (INGRID(state, gx, gy) &&
1812 (button == LEFT_BUTTON || button == RIGHT_BUTTON)) { 1821 (button == LEFT_BUTTON || button == RIGHT_BUTTON)) {
1813 if (ui->cur_visible) { 1822 if (ui->cur_visible) {
1814 ui->cur_visible = 0; 1823 ui->cur_visible = false;
1815 nullret = UI_UPDATE; 1824 nullret = UI_UPDATE;
1816 } 1825 }
1817 action = (button == LEFT_BUTTON) ? CYCLE_MAGNET : CYCLE_NEUTRAL; 1826 action = (button == LEFT_BUTTON) ? CYCLE_MAGNET : CYCLE_NEUTRAL;
@@ -1865,7 +1874,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1865 while (*move) { 1874 while (*move) {
1866 c = *move++; 1875 c = *move++;
1867 if (c == 'S') { 1876 if (c == 'S') {
1868 ret->solved = TRUE; 1877 ret->solved = true;
1869 n = 0; 1878 n = 0;
1870 } else if (c == '+' || c == '-' || 1879 } else if (c == '+' || c == '-' ||
1871 c == '.' || c == ' ' || c == '?') { 1880 c == '.' || c == ' ' || c == '?') {
@@ -1905,7 +1914,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1905 else if (*move) goto badmove; 1914 else if (*move) goto badmove;
1906 } 1915 }
1907 if (check_completion(ret) == 1) 1916 if (check_completion(ret) == 1)
1908 ret->completed = 1; 1917 ret->completed = true;
1909 1918
1910 return ret; 1919 return ret;
1911 1920
@@ -1973,7 +1982,9 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1973{ 1982{
1974 struct game_drawstate *ds = snew(struct game_drawstate); 1983 struct game_drawstate *ds = snew(struct game_drawstate);
1975 1984
1976 ds->tilesize = ds->started = ds->solved = 0; 1985 ds->tilesize = 0;
1986 ds->started = false;
1987 ds->solved = false;
1977 ds->w = state->w; 1988 ds->w = state->w;
1978 ds->h = state->h; 1989 ds->h = state->h;
1979 1990
@@ -2188,7 +2199,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2188 int dir, const game_ui *ui, 2199 int dir, const game_ui *ui,
2189 float animtime, float flashtime) 2200 float animtime, float flashtime)
2190{ 2201{
2191 int x, y, w = state->w, h = state->h, which, i, j, flash; 2202 int x, y, w = state->w, h = state->h, which, i, j;
2203 bool flash;
2192 2204
2193 flash = (int)(flashtime * 5 / FLASH_TIME) % 2; 2205 flash = (int)(flashtime * 5 / FLASH_TIME) % 2;
2194 2206
@@ -2261,7 +2273,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2261 } 2273 }
2262 } 2274 }
2263 2275
2264 ds->started = 1; 2276 ds->started = true;
2265} 2277}
2266 2278
2267static float game_anim_length(const game_state *oldstate, 2279static float game_anim_length(const game_state *oldstate,
@@ -2284,9 +2296,9 @@ static int game_status(const game_state *state)
2284 return state->completed ? +1 : 0; 2296 return state->completed ? +1 : 0;
2285} 2297}
2286 2298
2287static int game_timing_state(const game_state *state, game_ui *ui) 2299static bool game_timing_state(const game_state *state, game_ui *ui)
2288{ 2300{
2289 return TRUE; 2301 return true;
2290} 2302}
2291 2303
2292static void game_print_size(const game_params *params, float *x, float *y) 2304static void game_print_size(const game_params *params, float *x, float *y)
@@ -2396,15 +2408,15 @@ const struct game thegame = {
2396 encode_params, 2408 encode_params,
2397 free_params, 2409 free_params,
2398 dup_params, 2410 dup_params,
2399 TRUE, game_configure, custom_params, 2411 true, game_configure, custom_params,
2400 validate_params, 2412 validate_params,
2401 new_game_desc, 2413 new_game_desc,
2402 validate_desc, 2414 validate_desc,
2403 new_game, 2415 new_game,
2404 dup_game, 2416 dup_game,
2405 free_game, 2417 free_game,
2406 TRUE, solve_game, 2418 true, solve_game,
2407 TRUE, game_can_format_as_text_now, game_text_format, 2419 true, game_can_format_as_text_now, game_text_format,
2408 new_ui, 2420 new_ui,
2409 free_ui, 2421 free_ui,
2410 encode_ui, 2422 encode_ui,
@@ -2421,9 +2433,9 @@ const struct game thegame = {
2421 game_anim_length, 2433 game_anim_length,
2422 game_flash_length, 2434 game_flash_length,
2423 game_status, 2435 game_status,
2424 TRUE, FALSE, game_print_size, game_print, 2436 true, false, game_print_size, game_print,
2425 FALSE, /* wants_statusbar */ 2437 false, /* wants_statusbar */
2426 FALSE, game_timing_state, 2438 false, game_timing_state,
2427 REQUIRE_RBUTTON, /* flags */ 2439 REQUIRE_RBUTTON, /* flags */
2428}; 2440};
2429 2441
@@ -2433,7 +2445,7 @@ const struct game thegame = {
2433#include <stdarg.h> 2445#include <stdarg.h>
2434 2446
2435const char *quis = NULL; 2447const char *quis = NULL;
2436int csv = 0; 2448bool csv = false;
2437 2449
2438void usage(FILE *out) { 2450void usage(FILE *out) {
2439 fprintf(out, "usage: %s [-v] [--print] <params>|<game id>\n", quis); 2451 fprintf(out, "usage: %s [-v] [--print] <params>|<game id>\n", quis);
@@ -2535,7 +2547,8 @@ static void start_soak(game_params *p, random_state *rs)
2535 2547
2536int main(int argc, const char *argv[]) 2548int main(int argc, const char *argv[])
2537{ 2549{
2538 int print = 0, soak = 0, solved = 0, ret; 2550 bool print = false, soak = false, solved = false;
2551 int ret;
2539 char *id = NULL, *desc, *desc_gen = NULL, *aux = NULL; 2552 char *id = NULL, *desc, *desc_gen = NULL, *aux = NULL;
2540 const char *err; 2553 const char *err;
2541 game_state *s = NULL; 2554 game_state *s = NULL;
@@ -2549,16 +2562,16 @@ int main(int argc, const char *argv[])
2549 while (--argc > 0) { 2562 while (--argc > 0) {
2550 char *p = (char*)(*++argv); 2563 char *p = (char*)(*++argv);
2551 if (!strcmp(p, "-v") || !strcmp(p, "--verbose")) { 2564 if (!strcmp(p, "-v") || !strcmp(p, "--verbose")) {
2552 verbose = 1; 2565 verbose = true;
2553 } else if (!strcmp(p, "--csv")) { 2566 } else if (!strcmp(p, "--csv")) {
2554 csv = 1; 2567 csv = true;
2555 } else if (!strcmp(p, "-e") || !strcmp(p, "--seed")) { 2568 } else if (!strcmp(p, "-e") || !strcmp(p, "--seed")) {
2556 seed = atoi(*++argv); 2569 seed = atoi(*++argv);
2557 argc--; 2570 argc--;
2558 } else if (!strcmp(p, "-p") || !strcmp(p, "--print")) { 2571 } else if (!strcmp(p, "-p") || !strcmp(p, "--print")) {
2559 print = 1; 2572 print = true;
2560 } else if (!strcmp(p, "-s") || !strcmp(p, "--soak")) { 2573 } else if (!strcmp(p, "-s") || !strcmp(p, "--soak")) {
2561 soak = 1; 2574 soak = true;
2562 } else if (*p == '-') { 2575 } else if (*p == '-') {
2563 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p); 2576 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p);
2564 usage(stderr); 2577 usage(stderr);
@@ -2579,7 +2592,7 @@ int main(int argc, const char *argv[])
2579 2592
2580 p = default_params(); 2593 p = default_params();
2581 decode_params(p, id); 2594 decode_params(p, id);
2582 err = validate_params(p, 1); 2595 err = validate_params(p, true);
2583 if (err) { 2596 if (err) {
2584 fprintf(stderr, "%s: %s", argv[0], err); 2597 fprintf(stderr, "%s: %s", argv[0], err);
2585 goto done; 2598 goto done;
@@ -2595,7 +2608,7 @@ int main(int argc, const char *argv[])
2595 } 2608 }
2596 2609
2597 if (!desc) 2610 if (!desc)
2598 desc = desc_gen = new_game_desc(p, rs, &aux, 0); 2611 desc = desc_gen = new_game_desc(p, rs, &aux, false);
2599 2612
2600 err = validate_desc(p, desc); 2613 err = validate_desc(p, desc);
2601 if (err) { 2614 if (err) {
@@ -2609,17 +2622,17 @@ int main(int argc, const char *argv[])
2609 if (verbose || print) { 2622 if (verbose || print) {
2610 doprint(s); 2623 doprint(s);
2611 solve_from_aux(s, aux); 2624 solve_from_aux(s, aux);
2612 solved = 1; 2625 solved = true;
2613 } 2626 }
2614 } else { 2627 } else {
2615 doprint(s); 2628 doprint(s);
2616 verbose = 1; 2629 verbose = true;
2617 ret = solve_state(s, DIFFCOUNT); 2630 ret = solve_state(s, DIFFCOUNT);
2618 if (ret < 0) printf("Puzzle is impossible.\n"); 2631 if (ret < 0) printf("Puzzle is impossible.\n");
2619 else if (ret == 0) printf("Puzzle is ambiguous.\n"); 2632 else if (ret == 0) printf("Puzzle is ambiguous.\n");
2620 else printf("Puzzle was solved.\n"); 2633 else printf("Puzzle was solved.\n");
2621 verbose = 0; 2634 verbose = false;
2622 solved = 1; 2635 solved = true;
2623 } 2636 }
2624 if (solved) doprint(s); 2637 if (solved) doprint(s);
2625 2638
diff --git a/apps/plugins/puzzles/src/map.c b/apps/plugins/puzzles/src/map.c
index 203751016c..4e65aa91a6 100644
--- a/apps/plugins/puzzles/src/map.c
+++ b/apps/plugins/puzzles/src/map.c
@@ -25,9 +25,9 @@
25 */ 25 */
26#if defined STANDALONE_SOLVER 26#if defined STANDALONE_SOLVER
27#define SOLVER_DIAGNOSTICS 27#define SOLVER_DIAGNOSTICS
28int verbose = FALSE; 28bool verbose = false;
29#elif defined SOLVER_DIAGNOSTICS 29#elif defined SOLVER_DIAGNOSTICS
30#define verbose TRUE 30#define verbose true
31#endif 31#endif
32 32
33/* 33/*
@@ -84,7 +84,7 @@ struct map {
84 int *graph; 84 int *graph;
85 int n; 85 int n;
86 int ngraph; 86 int ngraph;
87 int *immutable; 87 bool *immutable;
88 int *edgex, *edgey; /* position of a point on each edge */ 88 int *edgex, *edgey; /* position of a point on each edge */
89 int *regionx, *regiony; /* position of a point in each region */ 89 int *regionx, *regiony; /* position of a point in each region */
90}; 90};
@@ -93,7 +93,7 @@ struct game_state {
93 game_params p; 93 game_params p;
94 struct map *map; 94 struct map *map;
95 int *colouring, *pencil; 95 int *colouring, *pencil;
96 int completed, cheated; 96 bool completed, cheated;
97}; 97};
98 98
99static game_params *default_params(void) 99static game_params *default_params(void)
@@ -131,13 +131,13 @@ static const struct game_params map_presets[] = {
131#endif 131#endif
132}; 132};
133 133
134static int game_fetch_preset(int i, char **name, game_params **params) 134static bool game_fetch_preset(int i, char **name, game_params **params)
135{ 135{
136 game_params *ret; 136 game_params *ret;
137 char str[80]; 137 char str[80];
138 138
139 if (i < 0 || i >= lenof(map_presets)) 139 if (i < 0 || i >= lenof(map_presets))
140 return FALSE; 140 return false;
141 141
142 ret = snew(game_params); 142 ret = snew(game_params);
143 *ret = map_presets[i]; 143 *ret = map_presets[i];
@@ -147,7 +147,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
147 147
148 *name = dupstr(str); 148 *name = dupstr(str);
149 *params = ret; 149 *params = ret;
150 return TRUE; 150 return true;
151} 151}
152 152
153static void free_params(game_params *params) 153static void free_params(game_params *params)
@@ -192,7 +192,7 @@ static void decode_params(game_params *params, char const *string)
192 } 192 }
193} 193}
194 194
195static char *encode_params(const game_params *params, int full) 195static char *encode_params(const game_params *params, bool full)
196{ 196{
197 char ret[400]; 197 char ret[400];
198 198
@@ -248,7 +248,7 @@ static game_params *custom_params(const config_item *cfg)
248 return ret; 248 return ret;
249} 249}
250 250
251static const char *validate_params(const game_params *params, int full) 251static const char *validate_params(const game_params *params, bool full)
252{ 252{
253 if (params->w < 2 || params->h < 2) 253 if (params->w < 2 || params->h < 2)
254 return "Width and height must be at least two"; 254 return "Width and height must be at least two";
@@ -680,8 +680,8 @@ static int graph_vertex_start(int *graph, int n, int ngraph, int i)
680 * the sake of the Palm port and its limited stack. 680 * the sake of the Palm port and its limited stack.
681 */ 681 */
682 682
683static int fourcolour_recurse(int *graph, int n, int ngraph, 683static bool fourcolour_recurse(int *graph, int n, int ngraph,
684 int *colouring, int *scratch, random_state *rs) 684 int *colouring, int *scratch, random_state *rs)
685{ 685{
686 int nfree, nvert, start, i, j, k, c, ci; 686 int nfree, nvert, start, i, j, k, c, ci;
687 int cs[FOUR]; 687 int cs[FOUR];
@@ -706,7 +706,7 @@ static int fourcolour_recurse(int *graph, int n, int ngraph,
706 * If there aren't any uncoloured vertices at all, we're done. 706 * If there aren't any uncoloured vertices at all, we're done.
707 */ 707 */
708 if (nvert == 0) 708 if (nvert == 0)
709 return TRUE; /* we've got a colouring! */ 709 return true; /* we've got a colouring! */
710 710
711 /* 711 /*
712 * Pick a random vertex in that set. 712 * Pick a random vertex in that set.
@@ -752,7 +752,7 @@ static int fourcolour_recurse(int *graph, int n, int ngraph,
752 * Recurse. 752 * Recurse.
753 */ 753 */
754 if (fourcolour_recurse(graph, n, ngraph, colouring, scratch, rs)) 754 if (fourcolour_recurse(graph, n, ngraph, colouring, scratch, rs))
755 return TRUE; /* got one! */ 755 return true; /* got one! */
756 756
757 /* 757 /*
758 * If that didn't work, clean up and try again with a 758 * If that didn't work, clean up and try again with a
@@ -775,7 +775,7 @@ static int fourcolour_recurse(int *graph, int n, int ngraph,
775 * violation if we get all the way back up to the top level and 775 * violation if we get all the way back up to the top level and
776 * still fail.) 776 * still fail.)
777 */ 777 */
778 return FALSE; 778 return false;
779} 779}
780 780
781static void fourcolour(int *graph, int n, int ngraph, int *colouring, 781static void fourcolour(int *graph, int n, int ngraph, int *colouring,
@@ -783,6 +783,7 @@ static void fourcolour(int *graph, int n, int ngraph, int *colouring,
783{ 783{
784 int *scratch; 784 int *scratch;
785 int i; 785 int i;
786 bool retd;
786 787
787 /* 788 /*
788 * For each vertex and each colour, we store the number of 789 * For each vertex and each colour, we store the number of
@@ -799,8 +800,8 @@ static void fourcolour(int *graph, int n, int ngraph, int *colouring,
799 for (i = 0; i < n; i++) 800 for (i = 0; i < n; i++)
800 colouring[i] = -1; 801 colouring[i] = -1;
801 802
802 i = fourcolour_recurse(graph, n, ngraph, colouring, scratch, rs); 803 retd = fourcolour_recurse(graph, n, ngraph, colouring, scratch, rs);
803 assert(i); /* by the Four Colour Theorem :-) */ 804 assert(retd); /* by the Four Colour Theorem :-) */
804 805
805 sfree(scratch); 806 sfree(scratch);
806} 807}
@@ -870,12 +871,12 @@ static int bitcount(int word)
870static const char colnames[FOUR] = { 'R', 'Y', 'G', 'B' }; 871static const char colnames[FOUR] = { 'R', 'Y', 'G', 'B' };
871#endif 872#endif
872 873
873static int place_colour(struct solver_scratch *sc, 874static bool place_colour(struct solver_scratch *sc,
874 int *colouring, int index, int colour 875 int *colouring, int index, int colour
875#ifdef SOLVER_DIAGNOSTICS 876#ifdef SOLVER_DIAGNOSTICS
876 , const char *verb 877 , const char *verb
877#endif 878#endif
878 ) 879 )
879{ 880{
880 int *graph = sc->graph, n = sc->n, ngraph = sc->ngraph; 881 int *graph = sc->graph, n = sc->n, ngraph = sc->ngraph;
881 int j, k; 882 int j, k;
@@ -886,7 +887,7 @@ static int place_colour(struct solver_scratch *sc,
886 printf("%*scannot place %c in region %d\n", 2*sc->depth, "", 887 printf("%*scannot place %c in region %d\n", 2*sc->depth, "",
887 colnames[colour], index); 888 colnames[colour], index);
888#endif 889#endif
889 return FALSE; /* can't do it */ 890 return false; /* can't do it */
890 } 891 }
891 892
892 sc->possible[index] = 1 << colour; 893 sc->possible[index] = 1 << colour;
@@ -912,7 +913,7 @@ static int place_colour(struct solver_scratch *sc,
912 sc->possible[k] &= ~(1 << colour); 913 sc->possible[k] &= ~(1 << colour);
913 } 914 }
914 915
915 return TRUE; 916 return true;
916} 917}
917 918
918#ifdef SOLVER_DIAGNOSTICS 919#ifdef SOLVER_DIAGNOSTICS
@@ -974,7 +975,7 @@ static int map_solver(struct solver_scratch *sc,
974 * Now repeatedly loop until we find nothing further to do. 975 * Now repeatedly loop until we find nothing further to do.
975 */ 976 */
976 while (1) { 977 while (1) {
977 int done_something = FALSE; 978 bool done_something = false;
978 979
979 if (difficulty < DIFF_EASY) 980 if (difficulty < DIFF_EASY)
980 break; /* can't do anything at all! */ 981 break; /* can't do anything at all! */
@@ -996,7 +997,8 @@ static int map_solver(struct solver_scratch *sc,
996 } 997 }
997 998
998 if ((p & (p-1)) == 0) { /* p is a power of two */ 999 if ((p & (p-1)) == 0) { /* p is a power of two */
999 int c, ret; 1000 int c;
1001 bool ret;
1000 for (c = 0; c < FOUR; c++) 1002 for (c = 0; c < FOUR; c++)
1001 if (p == (1 << c)) 1003 if (p == (1 << c))
1002 break; 1004 break;
@@ -1015,7 +1017,7 @@ static int map_solver(struct solver_scratch *sc,
1015 * friendly error code. 1017 * friendly error code.
1016 */ 1018 */
1017 assert(ret); 1019 assert(ret);
1018 done_something = TRUE; 1020 done_something = true;
1019 } 1021 }
1020 } 1022 }
1021 1023
@@ -1040,7 +1042,7 @@ static int map_solver(struct solver_scratch *sc,
1040 int j1 = graph[i] / n, j2 = graph[i] % n; 1042 int j1 = graph[i] / n, j2 = graph[i] % n;
1041 int j, k, v, v2; 1043 int j, k, v, v2;
1042#ifdef SOLVER_DIAGNOSTICS 1044#ifdef SOLVER_DIAGNOSTICS
1043 int started = FALSE; 1045 bool started = false;
1044#endif 1046#endif
1045 1047
1046 if (j1 > j2) 1048 if (j1 > j2)
@@ -1084,13 +1086,13 @@ static int map_solver(struct solver_scratch *sc,
1084 printf("%*sadjacent regions %d,%d share colours" 1086 printf("%*sadjacent regions %d,%d share colours"
1085 " %s\n", 2*sc->depth, "", j1, j2, 1087 " %s\n", 2*sc->depth, "", j1, j2,
1086 colourset(buf, v)); 1088 colourset(buf, v));
1087 started = TRUE; 1089 started = true;
1088 printf("%*s ruling out %s in region %d\n",2*sc->depth, 1090 printf("%*s ruling out %s in region %d\n",2*sc->depth,
1089 "", colourset(buf, sc->possible[k] & v), k); 1091 "", colourset(buf, sc->possible[k] & v), k);
1090 } 1092 }
1091#endif 1093#endif
1092 sc->possible[k] &= ~v; 1094 sc->possible[k] &= ~v;
1093 done_something = TRUE; 1095 done_something = true;
1094 } 1096 }
1095 } 1097 }
1096 } 1098 }
@@ -1231,7 +1233,7 @@ static int map_solver(struct solver_scratch *sc,
1231 } 1233 }
1232#endif 1234#endif
1233 sc->possible[k] &= ~origc; 1235 sc->possible[k] &= ~origc;
1234 done_something = TRUE; 1236 done_something = true;
1235 } 1237 }
1236 } 1238 }
1237 } 1239 }
@@ -1279,7 +1281,7 @@ static int map_solver(struct solver_scratch *sc,
1279 struct solver_scratch *rsc; 1281 struct solver_scratch *rsc;
1280 int *subcolouring, *origcolouring; 1282 int *subcolouring, *origcolouring;
1281 int ret, subret; 1283 int ret, subret;
1282 int we_already_got_one; 1284 bool we_already_got_one;
1283 1285
1284 best = -1; 1286 best = -1;
1285 bestc = FIVE; 1287 bestc = FIVE;
@@ -1315,7 +1317,7 @@ static int map_solver(struct solver_scratch *sc,
1315 origcolouring = snewn(n, int); 1317 origcolouring = snewn(n, int);
1316 memcpy(origcolouring, colouring, n * sizeof(int)); 1318 memcpy(origcolouring, colouring, n * sizeof(int));
1317 subcolouring = snewn(n, int); 1319 subcolouring = snewn(n, int);
1318 we_already_got_one = FALSE; 1320 we_already_got_one = false;
1319 ret = 0; 1321 ret = 0;
1320 1322
1321 for (i = 0; i < FOUR; i++) { 1323 for (i = 0; i < FOUR; i++) {
@@ -1359,7 +1361,7 @@ static int map_solver(struct solver_scratch *sc,
1359 */ 1361 */
1360 if (subret == 1) { 1362 if (subret == 1) {
1361 memcpy(colouring, subcolouring, n * sizeof(int)); 1363 memcpy(colouring, subcolouring, n * sizeof(int));
1362 we_already_got_one = TRUE; 1364 we_already_got_one = true;
1363 ret = 1; 1365 ret = 1;
1364 } 1366 }
1365 1367
@@ -1390,7 +1392,7 @@ static int map_solver(struct solver_scratch *sc,
1390 */ 1392 */
1391 1393
1392static char *new_game_desc(const game_params *params, random_state *rs, 1394static char *new_game_desc(const game_params *params, random_state *rs,
1393 char **aux, int interactive) 1395 char **aux, bool interactive)
1394{ 1396{
1395 struct solver_scratch *sc = NULL; 1397 struct solver_scratch *sc = NULL;
1396 int *map, *graph, ngraph, *colouring, *colouring2, *regions; 1398 int *map, *graph, ngraph, *colouring, *colouring2, *regions;
@@ -1601,7 +1603,8 @@ static char *new_game_desc(const game_params *params, random_state *rs,
1601 ret = NULL; 1603 ret = NULL;
1602 1604
1603 { 1605 {
1604 int run, pv; 1606 int run;
1607 bool pv;
1605 1608
1606 /* 1609 /*
1607 * Start with a notional non-edge, so that there'll be an 1610 * Start with a notional non-edge, so that there'll be an
@@ -1609,10 +1612,11 @@ static char *new_game_desc(const game_params *params, random_state *rs,
1609 * an edge. 1612 * an edge.
1610 */ 1613 */
1611 run = 1; 1614 run = 1;
1612 pv = 0; 1615 pv = false;
1613 1616
1614 for (i = 0; i < w*(h-1) + (w-1)*h; i++) { 1617 for (i = 0; i < w*(h-1) + (w-1)*h; i++) {
1615 int x, y, dx, dy, v; 1618 int x, y, dx, dy;
1619 bool v;
1616 1620
1617 if (i < w*(h-1)) { 1621 if (i < w*(h-1)) {
1618 /* Horizontal edge. */ 1622 /* Horizontal edge. */
@@ -1704,13 +1708,14 @@ static const char *parse_edge_list(const game_params *params,
1704 const char **desc, int *map) 1708 const char **desc, int *map)
1705{ 1709{
1706 int w = params->w, h = params->h, wh = w*h, n = params->n; 1710 int w = params->w, h = params->h, wh = w*h, n = params->n;
1707 int i, k, pos, state; 1711 int i, k, pos;
1712 bool state;
1708 const char *p = *desc; 1713 const char *p = *desc;
1709 1714
1710 dsf_init(map+wh, wh); 1715 dsf_init(map+wh, wh);
1711 1716
1712 pos = -1; 1717 pos = -1;
1713 state = 0; 1718 state = false;
1714 1719
1715 /* 1720 /*
1716 * Parse the game description to get the list of edges, and 1721 * Parse the game description to get the list of edges, and
@@ -1828,16 +1833,17 @@ static game_state *new_game(midend *me, const game_params *params,
1828 for (i = 0; i < n; i++) 1833 for (i = 0; i < n; i++)
1829 state->pencil[i] = 0; 1834 state->pencil[i] = 0;
1830 1835
1831 state->completed = state->cheated = FALSE; 1836 state->completed = false;
1837 state->cheated = false;
1832 1838
1833 state->map = snew(struct map); 1839 state->map = snew(struct map);
1834 state->map->refcount = 1; 1840 state->map->refcount = 1;
1835 state->map->map = snewn(wh*4, int); 1841 state->map->map = snewn(wh*4, int);
1836 state->map->graph = snewn(n*n, int); 1842 state->map->graph = snewn(n*n, int);
1837 state->map->n = n; 1843 state->map->n = n;
1838 state->map->immutable = snewn(n, int); 1844 state->map->immutable = snewn(n, bool);
1839 for (i = 0; i < n; i++) 1845 for (i = 0; i < n; i++)
1840 state->map->immutable[i] = FALSE; 1846 state->map->immutable[i] = false;
1841 1847
1842 p = desc; 1848 p = desc;
1843 1849
@@ -1863,7 +1869,7 @@ static game_state *new_game(midend *me, const game_params *params,
1863 while (*p) { 1869 while (*p) {
1864 if (*p >= '0' && *p < '0'+FOUR) { 1870 if (*p >= '0' && *p < '0'+FOUR) {
1865 state->colouring[pos] = *p - '0'; 1871 state->colouring[pos] = *p - '0';
1866 state->map->immutable[pos] = TRUE; 1872 state->map->immutable[pos] = true;
1867 pos++; 1873 pos++;
1868 } else { 1874 } else {
1869 assert(*p >= 'a' && *p <= 'z'); 1875 assert(*p >= 'a' && *p <= 'z');
@@ -1882,14 +1888,14 @@ static game_state *new_game(midend *me, const game_params *params,
1882 { 1888 {
1883 random_state *rs = random_new(desc, strlen(desc)); 1889 random_state *rs = random_new(desc, strlen(desc));
1884 int *squares = snewn(wh, int); 1890 int *squares = snewn(wh, int);
1885 int done_something; 1891 bool done_something;
1886 1892
1887 for (i = 0; i < wh; i++) 1893 for (i = 0; i < wh; i++)
1888 squares[i] = i; 1894 squares[i] = i;
1889 shuffle(squares, wh, sizeof(*squares), rs); 1895 shuffle(squares, wh, sizeof(*squares), rs);
1890 1896
1891 do { 1897 do {
1892 done_something = FALSE; 1898 done_something = false;
1893 for (i = 0; i < wh; i++) { 1899 for (i = 0; i < wh; i++) {
1894 int y = squares[i] / w, x = squares[i] % w; 1900 int y = squares[i] / w, x = squares[i] % w;
1895 int c = state->map->map[y*w+x]; 1901 int c = state->map->map[y*w+x];
@@ -1920,7 +1926,7 @@ static game_state *new_game(midend *me, const game_params *params,
1920 state->map->map[BE * wh + y*w+x] = bc; 1926 state->map->map[BE * wh + y*w+x] = bc;
1921 state->map->map[LE * wh + y*w+x] = lc; 1927 state->map->map[LE * wh + y*w+x] = lc;
1922 state->map->map[RE * wh + y*w+x] = rc; 1928 state->map->map[RE * wh + y*w+x] = rc;
1923 done_something = TRUE; 1929 done_something = true;
1924 } 1930 }
1925 } 1931 }
1926 } 1932 }
@@ -2246,9 +2252,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
2246 return dupstr(aux); 2252 return dupstr(aux);
2247} 2253}
2248 2254
2249static int game_can_format_as_text_now(const game_params *params) 2255static bool game_can_format_as_text_now(const game_params *params)
2250{ 2256{
2251 return TRUE; 2257 return true;
2252} 2258}
2253 2259
2254static char *game_text_format(const game_state *state) 2260static char *game_text_format(const game_state *state)
@@ -2268,9 +2274,10 @@ struct game_ui {
2268 int drag_colour; 2274 int drag_colour;
2269 int drag_pencil; 2275 int drag_pencil;
2270 int dragx, dragy; 2276 int dragx, dragy;
2271 int show_numbers; 2277 bool show_numbers;
2272 2278
2273 int cur_x, cur_y, cur_visible, cur_moved, cur_lastmove; 2279 int cur_x, cur_y, cur_lastmove;
2280 bool cur_visible, cur_moved;
2274}; 2281};
2275 2282
2276static game_ui *new_ui(const game_state *state) 2283static game_ui *new_ui(const game_state *state)
@@ -2279,8 +2286,10 @@ static game_ui *new_ui(const game_state *state)
2279 ui->dragx = ui->dragy = -1; 2286 ui->dragx = ui->dragy = -1;
2280 ui->drag_colour = -2; 2287 ui->drag_colour = -2;
2281 ui->drag_pencil = 0; 2288 ui->drag_pencil = 0;
2282 ui->show_numbers = FALSE; 2289 ui->show_numbers = false;
2283 ui->cur_x = ui->cur_y = ui->cur_visible = ui->cur_moved = 0; 2290 ui->cur_x = ui->cur_y = 0;
2291 ui->cur_visible = false;
2292 ui->cur_moved = false;
2284 ui->cur_lastmove = 0; 2293 ui->cur_lastmove = 0;
2285 return ui; 2294 return ui;
2286} 2295}
@@ -2307,8 +2316,9 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
2307struct game_drawstate { 2316struct game_drawstate {
2308 int tilesize; 2317 int tilesize;
2309 unsigned long *drawn, *todraw; 2318 unsigned long *drawn, *todraw;
2310 int started; 2319 bool started;
2311 int dragx, dragy, drag_visible; 2320 int dragx, dragy;
2321 bool drag_visible;
2312 blitter *bl; 2322 blitter *bl;
2313}; 2323};
2314 2324
@@ -2383,7 +2393,8 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2383 int x, int y, int button) 2393 int x, int y, int button)
2384{ 2394{
2385 char *bufp, buf[256]; 2395 char *bufp, buf[256];
2386 int alt_button, drop_region; 2396 bool alt_button;
2397 int drop_region;
2387 2398
2388 /* 2399 /*
2389 * Enable or disable numeric labels on regions. 2400 * Enable or disable numeric labels on regions.
@@ -2394,15 +2405,16 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2394 } 2405 }
2395 2406
2396 if (IS_CURSOR_MOVE(button)) { 2407 if (IS_CURSOR_MOVE(button)) {
2397 move_cursor(button, &ui->cur_x, &ui->cur_y, state->p.w, state->p.h, 0); 2408 move_cursor(button, &ui->cur_x, &ui->cur_y, state->p.w, state->p.h,
2398 ui->cur_visible = 1; 2409 false);
2399 ui->cur_moved = 1; 2410 ui->cur_visible = true;
2411 ui->cur_moved = true;
2400 ui->cur_lastmove = button; 2412 ui->cur_lastmove = button;
2401 return UI_UPDATE; 2413 return UI_UPDATE;
2402 } 2414 }
2403 if (IS_CURSOR_SELECT(button)) { 2415 if (IS_CURSOR_SELECT(button)) {
2404 if (!ui->cur_visible) { 2416 if (!ui->cur_visible) {
2405 ui->cur_visible = 1; 2417 ui->cur_visible = true;
2406 return UI_UPDATE; 2418 return UI_UPDATE;
2407 } 2419 }
2408 if (ui->drag_colour == -2) { /* not currently cursor-dragging, start. */ 2420 if (ui->drag_colour == -2) { /* not currently cursor-dragging, start. */
@@ -2414,10 +2426,10 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2414 ui->drag_colour = -1; 2426 ui->drag_colour = -1;
2415 ui->drag_pencil = 0; 2427 ui->drag_pencil = 0;
2416 } 2428 }
2417 ui->cur_moved = 0; 2429 ui->cur_moved = false;
2418 return UI_UPDATE; 2430 return UI_UPDATE;
2419 } else { /* currently cursor-dragging; drop the colour in the new region. */ 2431 } else { /* currently cursor-dragging; drop the colour in the new region. */
2420 alt_button = (button == CURSOR_SELECT2) ? 1 : 0; 2432 alt_button = (button == CURSOR_SELECT2);
2421 /* Double-select removes current colour. */ 2433 /* Double-select removes current colour. */
2422 if (!ui->cur_moved) ui->drag_colour = -1; 2434 if (!ui->cur_moved) ui->drag_colour = -1;
2423 drop_region = region_from_ui_cursor(state, ui); 2435 drop_region = region_from_ui_cursor(state, ui);
@@ -2439,7 +2451,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2439 } 2451 }
2440 ui->dragx = x; 2452 ui->dragx = x;
2441 ui->dragy = y; 2453 ui->dragy = y;
2442 ui->cur_visible = 0; 2454 ui->cur_visible = false;
2443 return UI_UPDATE; 2455 return UI_UPDATE;
2444 } 2456 }
2445 2457
@@ -2452,7 +2464,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2452 2464
2453 if ((button == LEFT_RELEASE || button == RIGHT_RELEASE) && 2465 if ((button == LEFT_RELEASE || button == RIGHT_RELEASE) &&
2454 ui->drag_colour > -2) { 2466 ui->drag_colour > -2) {
2455 alt_button = (button == RIGHT_RELEASE) ? 1 : 0; 2467 alt_button = (button == RIGHT_RELEASE);
2456 drop_region = region_from_coords(state, ds, x, y); 2468 drop_region = region_from_coords(state, ds, x, y);
2457 goto drag_dropped; 2469 goto drag_dropped;
2458 } 2470 }
@@ -2518,11 +2530,11 @@ static game_state *execute_move(const game_state *state, const char *move)
2518 int c, k, adv, i; 2530 int c, k, adv, i;
2519 2531
2520 while (*move) { 2532 while (*move) {
2521 int pencil = FALSE; 2533 bool pencil = false;
2522 2534
2523 c = *move; 2535 c = *move;
2524 if (c == 'p') { 2536 if (c == 'p') {
2525 pencil = TRUE; 2537 pencil = true;
2526 c = *++move; 2538 c = *++move;
2527 } 2539 }
2528 if ((c == 'C' || (c >= '0' && c < '0'+FOUR)) && 2540 if ((c == 'C' || (c >= '0' && c < '0'+FOUR)) &&
@@ -2544,7 +2556,7 @@ static game_state *execute_move(const game_state *state, const char *move)
2544 } 2556 }
2545 } else if (*move == 'S') { 2557 } else if (*move == 'S') {
2546 move++; 2558 move++;
2547 ret->cheated = TRUE; 2559 ret->cheated = true;
2548 } else { 2560 } else {
2549 free_game(ret); 2561 free_game(ret);
2550 return NULL; 2562 return NULL;
@@ -2562,11 +2574,11 @@ static game_state *execute_move(const game_state *state, const char *move)
2562 * Check for completion. 2574 * Check for completion.
2563 */ 2575 */
2564 if (!ret->completed) { 2576 if (!ret->completed) {
2565 int ok = TRUE; 2577 bool ok = true;
2566 2578
2567 for (i = 0; i < n; i++) 2579 for (i = 0; i < n; i++)
2568 if (ret->colouring[i] < 0) { 2580 if (ret->colouring[i] < 0) {
2569 ok = FALSE; 2581 ok = false;
2570 break; 2582 break;
2571 } 2583 }
2572 2584
@@ -2575,14 +2587,14 @@ static game_state *execute_move(const game_state *state, const char *move)
2575 int j = ret->map->graph[i] / n; 2587 int j = ret->map->graph[i] / n;
2576 int k = ret->map->graph[i] % n; 2588 int k = ret->map->graph[i] % n;
2577 if (ret->colouring[j] == ret->colouring[k]) { 2589 if (ret->colouring[j] == ret->colouring[k]) {
2578 ok = FALSE; 2590 ok = false;
2579 break; 2591 break;
2580 } 2592 }
2581 } 2593 }
2582 } 2594 }
2583 2595
2584 if (ok) 2596 if (ok)
2585 ret->completed = TRUE; 2597 ret->completed = true;
2586 } 2598 }
2587 2599
2588 return ret; 2600 return ret;
@@ -2612,7 +2624,7 @@ static void game_set_size(drawing *dr, game_drawstate *ds,
2612 ds->bl = blitter_new(dr, TILESIZE+3, TILESIZE+3); 2624 ds->bl = blitter_new(dr, TILESIZE+3, TILESIZE+3);
2613} 2625}
2614 2626
2615const float map_colours[FOUR][3] = { 2627static const float map_colours[FOUR][3] = {
2616#ifdef VIVID_COLOURS 2628#ifdef VIVID_COLOURS
2617 /* Use more vivid colours (e.g. on the Pocket PC) */ 2629 /* Use more vivid colours (e.g. on the Pocket PC) */
2618 {0.75F, 0.25F, 0.25F}, 2630 {0.75F, 0.25F, 0.25F},
@@ -2626,7 +2638,7 @@ const float map_colours[FOUR][3] = {
2626 {0.55F, 0.45F, 0.35F}, 2638 {0.55F, 0.45F, 0.35F},
2627#endif 2639#endif
2628}; 2640};
2629const int map_hatching[FOUR] = { 2641static const int map_hatching[FOUR] = {
2630 HATCH_VERT, HATCH_SLASH, HATCH_HORIZ, HATCH_BACKSLASH 2642 HATCH_VERT, HATCH_SLASH, HATCH_HORIZ, HATCH_BACKSLASH
2631}; 2643};
2632 2644
@@ -2667,9 +2679,9 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
2667 for (i = 0; i < state->p.w * state->p.h; i++) 2679 for (i = 0; i < state->p.w * state->p.h; i++)
2668 ds->drawn[i] = 0xFFFFL; 2680 ds->drawn[i] = 0xFFFFL;
2669 ds->todraw = snewn(state->p.w * state->p.h, unsigned long); 2681 ds->todraw = snewn(state->p.w * state->p.h, unsigned long);
2670 ds->started = FALSE; 2682 ds->started = false;
2671 ds->bl = NULL; 2683 ds->bl = NULL;
2672 ds->drag_visible = FALSE; 2684 ds->drag_visible = false;
2673 ds->dragx = ds->dragy = -1; 2685 ds->dragx = ds->dragy = -1;
2674 2686
2675 return ds; 2687 return ds;
@@ -2857,7 +2869,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2857 if (ds->drag_visible) { 2869 if (ds->drag_visible) {
2858 blitter_load(dr, ds->bl, ds->dragx, ds->dragy); 2870 blitter_load(dr, ds->bl, ds->dragx, ds->dragy);
2859 draw_update(dr, ds->dragx, ds->dragy, TILESIZE + 3, TILESIZE + 3); 2871 draw_update(dr, ds->dragx, ds->dragy, TILESIZE + 3, TILESIZE + 3);
2860 ds->drag_visible = FALSE; 2872 ds->drag_visible = false;
2861 } 2873 }
2862 2874
2863 /* 2875 /*
@@ -2875,7 +2887,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2875 COL_GRID); 2887 COL_GRID);
2876 2888
2877 draw_update(dr, 0, 0, ww, wh); 2889 draw_update(dr, 0, 0, ww, wh);
2878 ds->started = TRUE; 2890 ds->started = true;
2879 } 2891 }
2880 2892
2881 if (flashtime) { 2893 if (flashtime) {
@@ -2987,7 +2999,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2987 * Draw the dragged colour blob if any. 2999 * Draw the dragged colour blob if any.
2988 */ 3000 */
2989 if ((ui->drag_colour > -2) || ui->cur_visible) { 3001 if ((ui->drag_colour > -2) || ui->cur_visible) {
2990 int bg, iscur = 0, cursor_x, cursor_y; 3002 int bg, cursor_x, cursor_y;
3003 bool iscur = false;
2991 if (ui->drag_colour >= 0) 3004 if (ui->drag_colour >= 0)
2992 bg = COL_0 + ui->drag_colour; 3005 bg = COL_0 + ui->drag_colour;
2993 else if (ui->drag_colour == -1) { 3006 else if (ui->drag_colour == -1) {
@@ -2997,7 +3010,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2997 int c = (r < 0) ? -1 : state->colouring[r]; 3010 int c = (r < 0) ? -1 : state->colouring[r];
2998 /*bg = COL_GRID;*/ 3011 /*bg = COL_GRID;*/
2999 bg = (c < 0) ? COL_BACKGROUND : COL_0 + c; 3012 bg = (c < 0) ? COL_BACKGROUND : COL_0 + c;
3000 iscur = 1; 3013 iscur = true;
3001 } 3014 }
3002 3015
3003 if (ui->cur_visible) { 3016 if (ui->cur_visible) {
@@ -3020,7 +3033,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
3020 cursor_y + (i*2-3) * TILESIZE/10, 3033 cursor_y + (i*2-3) * TILESIZE/10,
3021 TILESIZE/8, COL_0 + i, COL_0 + i); 3034 TILESIZE/8, COL_0 + i, COL_0 + i);
3022 draw_update(dr, ds->dragx, ds->dragy, TILESIZE + 3, TILESIZE + 3); 3035 draw_update(dr, ds->dragx, ds->dragy, TILESIZE + 3, TILESIZE + 3);
3023 ds->drag_visible = TRUE; 3036 ds->drag_visible = true;
3024 } 3037 }
3025} 3038}
3026 3039
@@ -3053,9 +3066,9 @@ static int game_status(const game_state *state)
3053 return state->completed ? +1 : 0; 3066 return state->completed ? +1 : 0;
3054} 3067}
3055 3068
3056static int game_timing_state(const game_state *state, game_ui *ui) 3069static bool game_timing_state(const game_state *state, game_ui *ui)
3057{ 3070{
3058 return TRUE; 3071 return true;
3059} 3072}
3060 3073
3061static void game_print_size(const game_params *params, float *x, float *y) 3074static void game_print_size(const game_params *params, float *x, float *y)
@@ -3223,15 +3236,15 @@ const struct game thegame = {
3223 encode_params, 3236 encode_params,
3224 free_params, 3237 free_params,
3225 dup_params, 3238 dup_params,
3226 TRUE, game_configure, custom_params, 3239 true, game_configure, custom_params,
3227 validate_params, 3240 validate_params,
3228 new_game_desc, 3241 new_game_desc,
3229 validate_desc, 3242 validate_desc,
3230 new_game, 3243 new_game,
3231 dup_game, 3244 dup_game,
3232 free_game, 3245 free_game,
3233 TRUE, solve_game, 3246 true, solve_game,
3234 FALSE, game_can_format_as_text_now, game_text_format, 3247 false, game_can_format_as_text_now, game_text_format,
3235 new_ui, 3248 new_ui,
3236 free_ui, 3249 free_ui,
3237 encode_ui, 3250 encode_ui,
@@ -3248,9 +3261,9 @@ const struct game thegame = {
3248 game_anim_length, 3261 game_anim_length,
3249 game_flash_length, 3262 game_flash_length,
3250 game_status, 3263 game_status,
3251 TRUE, TRUE, game_print_size, game_print, 3264 true, true, game_print_size, game_print,
3252 FALSE, /* wants_statusbar */ 3265 false, /* wants_statusbar */
3253 FALSE, game_timing_state, 3266 false, game_timing_state,
3254 0, /* flags */ 3267 0, /* flags */
3255}; 3268};
3256 3269
@@ -3262,17 +3275,18 @@ int main(int argc, char **argv)
3262 game_state *s; 3275 game_state *s;
3263 char *id = NULL, *desc; 3276 char *id = NULL, *desc;
3264 const char *err; 3277 const char *err;
3265 int grade = FALSE; 3278 bool grade = false;
3266 int ret, diff, really_verbose = FALSE; 3279 int ret, diff;
3280 bool really_verbose = false;
3267 struct solver_scratch *sc; 3281 struct solver_scratch *sc;
3268 int i; 3282 int i;
3269 3283
3270 while (--argc > 0) { 3284 while (--argc > 0) {
3271 char *p = *++argv; 3285 char *p = *++argv;
3272 if (!strcmp(p, "-v")) { 3286 if (!strcmp(p, "-v")) {
3273 really_verbose = TRUE; 3287 really_verbose = true;
3274 } else if (!strcmp(p, "-g")) { 3288 } else if (!strcmp(p, "-g")) {
3275 grade = TRUE; 3289 grade = true;
3276 } else if (*p == '-') { 3290 } else if (*p == '-') {
3277 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p); 3291 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p);
3278 return 1; 3292 return 1;
diff --git a/apps/plugins/puzzles/src/matching.c b/apps/plugins/puzzles/src/matching.c
index 89f67ee83e..9078f6c36a 100644
--- a/apps/plugins/puzzles/src/matching.c
+++ b/apps/plugins/puzzles/src/matching.c
@@ -135,7 +135,7 @@ int matching_with_scratch(void *scratchv,
135 135
136 layer = 0; 136 layer = 0;
137 while (1) { 137 while (1) {
138 int found_free_R_vertex = FALSE; 138 bool found_free_R_vertex = false;
139 139
140 Rqs = 0; 140 Rqs = 0;
141 for (i = 0; i < Lqs; i++) { 141 for (i = 0; i < Lqs; i++) {
@@ -148,7 +148,7 @@ int matching_with_scratch(void *scratchv,
148 s->Rlayer[R] = layer+1; 148 s->Rlayer[R] = layer+1;
149 s->Rqueue[Rqs++] = R; 149 s->Rqueue[Rqs++] = R;
150 if (s->RtoL[R] == -1) 150 if (s->RtoL[R] == -1)
151 found_free_R_vertex = TRUE; 151 found_free_R_vertex = true;
152 } 152 }
153 } 153 }
154 } 154 }
@@ -685,7 +685,7 @@ int main(int argc, char **argv)
685{ 685{
686 static const char stdin_identifier[] = "<standard input>"; 686 static const char stdin_identifier[] = "<standard input>";
687 const char *infile = NULL; 687 const char *infile = NULL;
688 int doing_opts = TRUE; 688 bool doing_opts = true;
689 enum { USER_INPUT, AUTOTEST } mode = USER_INPUT; 689 enum { USER_INPUT, AUTOTEST } mode = USER_INPUT;
690 690
691 while (--argc > 0) { 691 while (--argc > 0) {
@@ -693,7 +693,7 @@ int main(int argc, char **argv)
693 693
694 if (doing_opts && arg[0] == '-' && arg[1]) { 694 if (doing_opts && arg[0] == '-' && arg[1]) {
695 if (!strcmp(arg, "--")) { 695 if (!strcmp(arg, "--")) {
696 doing_opts = FALSE; 696 doing_opts = false;
697 } else if (!strcmp(arg, "--random")) { 697 } else if (!strcmp(arg, "--random")) {
698 char buf[64]; 698 char buf[64];
699 int len = sprintf(buf, "%lu", (unsigned long)time(NULL)); 699 int len = sprintf(buf, "%lu", (unsigned long)time(NULL));
diff --git a/apps/plugins/puzzles/src/midend.c b/apps/plugins/puzzles/src/midend.c
index a42e51639e..036c8569c7 100644
--- a/apps/plugins/puzzles/src/midend.c
+++ b/apps/plugins/puzzles/src/midend.c
@@ -69,7 +69,7 @@ struct midend {
69 struct midend_state_entry *states; 69 struct midend_state_entry *states;
70 70
71 struct midend_serialise_buf newgame_undo, newgame_redo; 71 struct midend_serialise_buf newgame_undo, newgame_redo;
72 int newgame_can_store_undo; 72 bool newgame_can_store_undo;
73 73
74 game_params *params, *curparams; 74 game_params *params, *curparams;
75 game_drawstate *drawstate; 75 game_drawstate *drawstate;
@@ -80,7 +80,7 @@ struct midend {
80 float flash_time, flash_pos; 80 float flash_time, flash_pos;
81 int dir; 81 int dir;
82 82
83 int timing; 83 bool timing;
84 float elapsed; 84 float elapsed;
85 char *laststatus; 85 char *laststatus;
86 86
@@ -122,7 +122,7 @@ struct deserialise_data {
122 * Forward reference. 122 * Forward reference.
123 */ 123 */
124static const char *midend_deserialise_internal( 124static const char *midend_deserialise_internal(
125 midend *me, int (*read)(void *ctx, void *buf, int len), void *rctx, 125 midend *me, bool (*read)(void *ctx, void *buf, int len), void *rctx,
126 const char *(*check)(void *ctx, midend *, const struct deserialise_data *), 126 const char *(*check)(void *ctx, midend *, const struct deserialise_data *),
127 void *cctx); 127 void *cctx);
128 128
@@ -167,7 +167,7 @@ midend *midend_new(frontend *fe, const game *ourgame,
167 me->newgame_undo.size = me->newgame_undo.len = 0; 167 me->newgame_undo.size = me->newgame_undo.len = 0;
168 me->newgame_redo.buf = NULL; 168 me->newgame_redo.buf = NULL;
169 me->newgame_redo.size = me->newgame_redo.len = 0; 169 me->newgame_redo.size = me->newgame_redo.len = 0;
170 me->newgame_can_store_undo = FALSE; 170 me->newgame_can_store_undo = false;
171 me->params = ourgame->default_params(); 171 me->params = ourgame->default_params();
172 me->game_id_change_notify_function = NULL; 172 me->game_id_change_notify_function = NULL;
173 me->game_id_change_notify_ctx = NULL; 173 me->game_id_change_notify_ctx = NULL;
@@ -202,7 +202,7 @@ midend *midend_new(frontend *fe, const game *ourgame,
202 me->ui = NULL; 202 me->ui = NULL;
203 me->pressed_mouse_button = 0; 203 me->pressed_mouse_button = 0;
204 me->laststatus = NULL; 204 me->laststatus = NULL;
205 me->timing = FALSE; 205 me->timing = false;
206 me->elapsed = 0.0F; 206 me->elapsed = 0.0F;
207 me->tilesize = me->winwidth = me->winheight = 0; 207 me->tilesize = me->winwidth = me->winheight = 0;
208 if (drapi) 208 if (drapi)
@@ -297,7 +297,7 @@ static void midend_size_new_drawstate(midend *me)
297 } 297 }
298} 298}
299 299
300void midend_size(midend *me, int *x, int *y, int user_size) 300void midend_size(midend *me, int *x, int *y, bool user_size)
301{ 301{
302 int min, max; 302 int min, max;
303 int rx, ry; 303 int rx, ry;
@@ -315,7 +315,7 @@ void midend_size(midend *me, int *x, int *y, int user_size)
315 315
316 /* 316 /*
317 * Find the tile size that best fits within the given space. If 317 * Find the tile size that best fits within the given space. If
318 * `user_size' is TRUE, we must actually find the _largest_ such 318 * `user_size' is true, we must actually find the _largest_ such
319 * tile size, in order to get as close to the user's explicit 319 * tile size, in order to get as close to the user's explicit
320 * request as possible; otherwise, we bound above at the game's 320 * request as possible; otherwise, we bound above at the game's
321 * preferred tile size, so that the game gets what it wants 321 * preferred tile size, so that the game gets what it wants
@@ -542,15 +542,15 @@ void midend_new_game(midend *me)
542 if (me->game_id_change_notify_function) 542 if (me->game_id_change_notify_function)
543 me->game_id_change_notify_function(me->game_id_change_notify_ctx); 543 me->game_id_change_notify_function(me->game_id_change_notify_ctx);
544 544
545 me->newgame_can_store_undo = TRUE; 545 me->newgame_can_store_undo = true;
546} 546}
547 547
548int midend_can_undo(midend *me) 548bool midend_can_undo(midend *me)
549{ 549{
550 return (me->statepos > 1 || me->newgame_undo.len); 550 return (me->statepos > 1 || me->newgame_undo.len);
551} 551}
552 552
553int midend_can_redo(midend *me) 553bool midend_can_redo(midend *me)
554{ 554{
555 return (me->statepos < me->nstates || me->newgame_redo.len); 555 return (me->statepos < me->nstates || me->newgame_redo.len);
556} 556}
@@ -560,18 +560,20 @@ struct newgame_undo_deserialise_read_ctx {
560 int len, pos; 560 int len, pos;
561}; 561};
562 562
563static int newgame_undo_deserialise_read(void *ctx, void *buf, int len) 563static bool newgame_undo_deserialise_read(void *ctx, void *buf, int len)
564{ 564{
565 struct newgame_undo_deserialise_read_ctx *const rctx = ctx; 565 struct newgame_undo_deserialise_read_ctx *const rctx = ctx;
566 566
567 int use = min(len, rctx->len - rctx->pos); 567 if (len > rctx->len - rctx->pos)
568 memcpy(buf, rctx->ser->buf + rctx->pos, use); 568 return false;
569 rctx->pos += use; 569
570 return use; 570 memcpy(buf, rctx->ser->buf + rctx->pos, len);
571 rctx->pos += len;
572 return true;
571} 573}
572 574
573struct newgame_undo_deserialise_check_ctx { 575struct newgame_undo_deserialise_check_ctx {
574 int refused; 576 bool refused;
575}; 577};
576 578
577static const char *newgame_undo_deserialise_check( 579static const char *newgame_undo_deserialise_check(
@@ -604,19 +606,19 @@ static const char *newgame_undo_deserialise_check(
604 * We check both params and cparams, to be as safe as possible. 606 * We check both params and cparams, to be as safe as possible.
605 */ 607 */
606 608
607 old = me->ourgame->encode_params(me->params, TRUE); 609 old = me->ourgame->encode_params(me->params, true);
608 new = me->ourgame->encode_params(data->params, TRUE); 610 new = me->ourgame->encode_params(data->params, true);
609 if (strcmp(old, new)) { 611 if (strcmp(old, new)) {
610 /* Set a flag to distinguish this deserialise failure 612 /* Set a flag to distinguish this deserialise failure
611 * from one due to faulty decoding */ 613 * from one due to faulty decoding */
612 ctx->refused = TRUE; 614 ctx->refused = true;
613 return "Undoing this new-game operation would change params"; 615 return "Undoing this new-game operation would change params";
614 } 616 }
615 617
616 old = me->ourgame->encode_params(me->curparams, TRUE); 618 old = me->ourgame->encode_params(me->curparams, true);
617 new = me->ourgame->encode_params(data->cparams, TRUE); 619 new = me->ourgame->encode_params(data->cparams, true);
618 if (strcmp(old, new)) { 620 if (strcmp(old, new)) {
619 ctx->refused = TRUE; 621 ctx->refused = true;
620 return "Undoing this new-game operation would change params"; 622 return "Undoing this new-game operation would change params";
621 } 623 }
622 624
@@ -626,7 +628,7 @@ static const char *newgame_undo_deserialise_check(
626 return NULL; 628 return NULL;
627} 629}
628 630
629static int midend_undo(midend *me) 631static bool midend_undo(midend *me)
630{ 632{
631 const char *deserialise_error; 633 const char *deserialise_error;
632 634
@@ -637,7 +639,7 @@ static int midend_undo(midend *me)
637 me->states[me->statepos-2].state); 639 me->states[me->statepos-2].state);
638 me->statepos--; 640 me->statepos--;
639 me->dir = -1; 641 me->dir = -1;
640 return 1; 642 return true;
641 } else if (me->newgame_undo.len) { 643 } else if (me->newgame_undo.len) {
642 struct newgame_undo_deserialise_read_ctx rctx; 644 struct newgame_undo_deserialise_read_ctx rctx;
643 struct newgame_undo_deserialise_check_ctx cctx; 645 struct newgame_undo_deserialise_check_ctx cctx;
@@ -655,7 +657,7 @@ static int midend_undo(midend *me)
655 rctx.ser = &me->newgame_undo; 657 rctx.ser = &me->newgame_undo;
656 rctx.len = me->newgame_undo.len; /* copy for reentrancy safety */ 658 rctx.len = me->newgame_undo.len; /* copy for reentrancy safety */
657 rctx.pos = 0; 659 rctx.pos = 0;
658 cctx.refused = FALSE; 660 cctx.refused = false;
659 deserialise_error = midend_deserialise_internal( 661 deserialise_error = midend_deserialise_internal(
660 me, newgame_undo_deserialise_read, &rctx, 662 me, newgame_undo_deserialise_read, &rctx,
661 newgame_undo_deserialise_check, &cctx); 663 newgame_undo_deserialise_check, &cctx);
@@ -667,7 +669,7 @@ static int midend_undo(midend *me)
667 * function, which we ignore.) 669 * function, which we ignore.)
668 */ 670 */
669 sfree(serbuf.buf); 671 sfree(serbuf.buf);
670 return 0; 672 return false;
671 } else { 673 } else {
672 /* 674 /*
673 * There should never be any _other_ deserialisation 675 * There should never be any _other_ deserialisation
@@ -693,13 +695,13 @@ static int midend_undo(midend *me)
693 newgame_serialise_write(&me->newgame_redo, serbuf.buf, serbuf.len); 695 newgame_serialise_write(&me->newgame_redo, serbuf.buf, serbuf.len);
694 696
695 sfree(serbuf.buf); 697 sfree(serbuf.buf);
696 return 1; 698 return true;
697 } 699 }
698 } else 700 } else
699 return 0; 701 return false;
700} 702}
701 703
702static int midend_redo(midend *me) 704static bool midend_redo(midend *me)
703{ 705{
704 const char *deserialise_error; 706 const char *deserialise_error;
705 707
@@ -710,7 +712,7 @@ static int midend_redo(midend *me)
710 me->states[me->statepos].state); 712 me->states[me->statepos].state);
711 me->statepos++; 713 me->statepos++;
712 me->dir = +1; 714 me->dir = +1;
713 return 1; 715 return true;
714 } else if (me->newgame_redo.len) { 716 } else if (me->newgame_redo.len) {
715 struct newgame_undo_deserialise_read_ctx rctx; 717 struct newgame_undo_deserialise_read_ctx rctx;
716 struct newgame_undo_deserialise_check_ctx cctx; 718 struct newgame_undo_deserialise_check_ctx cctx;
@@ -728,7 +730,7 @@ static int midend_redo(midend *me)
728 rctx.ser = &me->newgame_redo; 730 rctx.ser = &me->newgame_redo;
729 rctx.len = me->newgame_redo.len; /* copy for reentrancy safety */ 731 rctx.len = me->newgame_redo.len; /* copy for reentrancy safety */
730 rctx.pos = 0; 732 rctx.pos = 0;
731 cctx.refused = FALSE; 733 cctx.refused = false;
732 deserialise_error = midend_deserialise_internal( 734 deserialise_error = midend_deserialise_internal(
733 me, newgame_undo_deserialise_read, &rctx, 735 me, newgame_undo_deserialise_read, &rctx,
734 newgame_undo_deserialise_check, &cctx); 736 newgame_undo_deserialise_check, &cctx);
@@ -740,7 +742,7 @@ static int midend_redo(midend *me)
740 * function, which we ignore.) 742 * function, which we ignore.)
741 */ 743 */
742 sfree(serbuf.buf); 744 sfree(serbuf.buf);
743 return 0; 745 return false;
744 } else { 746 } else {
745 /* 747 /*
746 * There should never be any _other_ deserialisation 748 * There should never be any _other_ deserialisation
@@ -766,10 +768,10 @@ static int midend_redo(midend *me)
766 newgame_serialise_write(&me->newgame_undo, serbuf.buf, serbuf.len); 768 newgame_serialise_write(&me->newgame_undo, serbuf.buf, serbuf.len);
767 769
768 sfree(serbuf.buf); 770 sfree(serbuf.buf);
769 return 1; 771 return true;
770 } 772 }
771 } else 773 } else
772 return 0; 774 return false;
773} 775}
774 776
775static void midend_finish_move(midend *me) 777static void midend_finish_move(midend *me)
@@ -850,11 +852,12 @@ void midend_restart_game(midend *me)
850 midend_set_timer(me); 852 midend_set_timer(me);
851} 853}
852 854
853static int midend_really_process_key(midend *me, int x, int y, int button) 855static bool midend_really_process_key(midend *me, int x, int y, int button)
854{ 856{
855 game_state *oldstate = 857 game_state *oldstate =
856 me->ourgame->dup_game(me->states[me->statepos - 1].state); 858 me->ourgame->dup_game(me->states[me->statepos - 1].state);
857 int type = MOVE, gottype = FALSE, ret = 1; 859 int type = MOVE;
860 bool gottype = false, ret = true;
858 float anim_time; 861 float anim_time;
859 game_state *s; 862 game_state *s;
860 char *movestr = NULL; 863 char *movestr = NULL;
@@ -876,7 +879,7 @@ static int midend_really_process_key(midend *me, int x, int y, int button)
876 button == UI_UNDO) { 879 button == UI_UNDO) {
877 midend_stop_anim(me); 880 midend_stop_anim(me);
878 type = me->states[me->statepos-1].movetype; 881 type = me->states[me->statepos-1].movetype;
879 gottype = TRUE; 882 gottype = true;
880 if (!midend_undo(me)) 883 if (!midend_undo(me))
881 goto done; 884 goto done;
882 } else if (button == 'r' || button == 'R' || 885 } else if (button == 'r' || button == 'R' ||
@@ -891,7 +894,7 @@ static int midend_really_process_key(midend *me, int x, int y, int button)
891 goto done; 894 goto done;
892 } else if (button == 'q' || button == 'Q' || button == '\x11' || 895 } else if (button == 'q' || button == 'Q' || button == '\x11' ||
893 button == UI_QUIT) { 896 button == UI_QUIT) {
894 ret = 0; 897 ret = false;
895 goto done; 898 goto done;
896 } else 899 } else
897 goto done; 900 goto done;
@@ -965,9 +968,9 @@ static int midend_really_process_key(midend *me, int x, int y, int button)
965 return ret; 968 return ret;
966} 969}
967 970
968int midend_process_key(midend *me, int x, int y, int button) 971bool midend_process_key(midend *me, int x, int y, int button)
969{ 972{
970 int ret = 1; 973 bool ret = true;
971 974
972 /* 975 /*
973 * Harmonise mouse drag and release messages. 976 * Harmonise mouse drag and release messages.
@@ -1159,7 +1162,7 @@ void midend_freeze_timer(midend *me, float tprop)
1159 1162
1160void midend_timer(midend *me, float tplus) 1163void midend_timer(midend *me, float tplus)
1161{ 1164{
1162 int need_redraw = (me->anim_time > 0 || me->flash_time > 0); 1165 bool need_redraw = (me->anim_time > 0 || me->flash_time > 0);
1163 1166
1164 me->anim_pos += tplus; 1167 me->anim_pos += tplus;
1165 if (me->anim_pos >= me->anim_time || 1168 if (me->anim_pos >= me->anim_time ||
@@ -1281,7 +1284,7 @@ game_params *preset_menu_lookup_by_id(struct preset_menu *menu, int id)
1281} 1284}
1282 1285
1283static char *preset_menu_add_from_user_env( 1286static char *preset_menu_add_from_user_env(
1284 midend *me, struct preset_menu *menu, char *p, int top_level) 1287 midend *me, struct preset_menu *menu, char *p, bool top_level)
1285{ 1288{
1286 while (*p) { 1289 while (*p) {
1287 char *name, *val; 1290 char *name, *val;
@@ -1302,7 +1305,7 @@ static char *preset_menu_add_from_user_env(
1302 if (*name) { 1305 if (*name) {
1303 struct preset_menu *submenu = 1306 struct preset_menu *submenu =
1304 preset_menu_add_submenu(menu, dupstr(name)); 1307 preset_menu_add_submenu(menu, dupstr(name));
1305 p = preset_menu_add_from_user_env(me, submenu, p, FALSE); 1308 p = preset_menu_add_from_user_env(me, submenu, p, false);
1306 } else { 1309 } else {
1307 /* 1310 /*
1308 * If we get a 'close submenu' indication at the top 1311 * If we get a 'close submenu' indication at the top
@@ -1318,7 +1321,7 @@ static char *preset_menu_add_from_user_env(
1318 preset = me->ourgame->default_params(); 1321 preset = me->ourgame->default_params();
1319 me->ourgame->decode_params(preset, val); 1322 me->ourgame->decode_params(preset, val);
1320 1323
1321 if (me->ourgame->validate_params(preset, TRUE)) { 1324 if (me->ourgame->validate_params(preset, true)) {
1322 /* Drop this one from the list. */ 1325 /* Drop this one from the list. */
1323 me->ourgame->free_params(preset); 1326 me->ourgame->free_params(preset);
1324 continue; 1327 continue;
@@ -1349,7 +1352,7 @@ static void preset_menu_encode_params(midend *me, struct preset_menu *menu)
1349 for (i = 0; i < menu->n_entries; i++) { 1352 for (i = 0; i < menu->n_entries; i++) {
1350 if (menu->entries[i].params) { 1353 if (menu->entries[i].params) {
1351 me->encoded_presets[menu->entries[i].id] = 1354 me->encoded_presets[menu->entries[i].id] =
1352 me->ourgame->encode_params(menu->entries[i].params, TRUE); 1355 me->ourgame->encode_params(menu->entries[i].params, true);
1353 } else { 1356 } else {
1354 preset_menu_encode_params(me, menu->entries[i].submenu); 1357 preset_menu_encode_params(me, menu->entries[i].submenu);
1355 } 1358 }
@@ -1404,7 +1407,7 @@ struct preset_menu *midend_get_presets(midend *me, int *id_limit)
1404 1407
1405 if ((e = getenv(buf)) != NULL) { 1408 if ((e = getenv(buf)) != NULL) {
1406 e = dupstr(e); 1409 e = dupstr(e);
1407 preset_menu_add_from_user_env(me, me->preset_menu, e, TRUE); 1410 preset_menu_add_from_user_env(me, me->preset_menu, e, true);
1408 sfree(e); 1411 sfree(e);
1409 } 1412 }
1410 } 1413 }
@@ -1428,7 +1431,7 @@ struct preset_menu *midend_get_presets(midend *me, int *id_limit)
1428 1431
1429int midend_which_preset(midend *me) 1432int midend_which_preset(midend *me)
1430{ 1433{
1431 char *encoding = me->ourgame->encode_params(me->params, TRUE); 1434 char *encoding = me->ourgame->encode_params(me->params, true);
1432 int i, ret; 1435 int i, ret;
1433 1436
1434 ret = -1; 1437 ret = -1;
@@ -1443,7 +1446,7 @@ int midend_which_preset(midend *me)
1443 return ret; 1446 return ret;
1444} 1447}
1445 1448
1446int midend_wants_statusbar(midend *me) 1449bool midend_wants_statusbar(midend *me)
1447{ 1450{
1448 return me->ourgame->wants_statusbar; 1451 return me->ourgame->wants_statusbar;
1449} 1452}
@@ -1535,7 +1538,7 @@ static const char *midend_game_id_int(midend *me, const char *id, int defmode)
1535 char *par = NULL; 1538 char *par = NULL;
1536 const char *desc, *seed; 1539 const char *desc, *seed;
1537 game_params *newcurparams, *newparams, *oldparams1, *oldparams2; 1540 game_params *newcurparams, *newparams, *oldparams1, *oldparams2;
1538 int free_params; 1541 bool free_params;
1539 1542
1540 seed = strchr(id, '#'); 1543 seed = strchr(id, '#');
1541 desc = strchr(id, ':'); 1544 desc = strchr(id, ':');
@@ -1650,18 +1653,18 @@ static const char *midend_game_id_int(midend *me, const char *id, int defmode)
1650 1653
1651 newparams = me->ourgame->dup_params(me->params); 1654 newparams = me->ourgame->dup_params(me->params);
1652 1655
1653 tmpstr = me->ourgame->encode_params(newcurparams, FALSE); 1656 tmpstr = me->ourgame->encode_params(newcurparams, false);
1654 me->ourgame->decode_params(newparams, tmpstr); 1657 me->ourgame->decode_params(newparams, tmpstr);
1655 1658
1656 sfree(tmpstr); 1659 sfree(tmpstr);
1657 } else { 1660 } else {
1658 newparams = me->ourgame->dup_params(newcurparams); 1661 newparams = me->ourgame->dup_params(newcurparams);
1659 } 1662 }
1660 free_params = TRUE; 1663 free_params = true;
1661 } else { 1664 } else {
1662 newcurparams = me->curparams; 1665 newcurparams = me->curparams;
1663 newparams = me->params; 1666 newparams = me->params;
1664 free_params = FALSE; 1667 free_params = false;
1665 } 1668 }
1666 1669
1667 if (desc) { 1670 if (desc) {
@@ -1708,7 +1711,7 @@ static const char *midend_game_id_int(midend *me, const char *id, int defmode)
1708 1711
1709 sfree(par); 1712 sfree(par);
1710 1713
1711 me->newgame_can_store_undo = FALSE; 1714 me->newgame_can_store_undo = false;
1712 1715
1713 return NULL; 1716 return NULL;
1714} 1717}
@@ -1722,7 +1725,7 @@ char *midend_get_game_id(midend *me)
1722{ 1725{
1723 char *parstr, *ret; 1726 char *parstr, *ret;
1724 1727
1725 parstr = me->ourgame->encode_params(me->curparams, FALSE); 1728 parstr = me->ourgame->encode_params(me->curparams, false);
1726 assert(parstr); 1729 assert(parstr);
1727 assert(me->desc); 1730 assert(me->desc);
1728 ret = snewn(strlen(parstr) + strlen(me->desc) + 2, char); 1731 ret = snewn(strlen(parstr) + strlen(me->desc) + 2, char);
@@ -1738,7 +1741,7 @@ char *midend_get_random_seed(midend *me)
1738 if (!me->seedstr) 1741 if (!me->seedstr)
1739 return NULL; 1742 return NULL;
1740 1743
1741 parstr = me->ourgame->encode_params(me->curparams, TRUE); 1744 parstr = me->ourgame->encode_params(me->curparams, true);
1742 assert(parstr); 1745 assert(parstr);
1743 ret = snewn(strlen(parstr) + strlen(me->seedstr) + 2, char); 1746 ret = snewn(strlen(parstr) + strlen(me->seedstr) + 2, char);
1744 sprintf(ret, "%s#%s", parstr, me->seedstr); 1747 sprintf(ret, "%s#%s", parstr, me->seedstr);
@@ -1754,7 +1757,7 @@ const char *midend_set_config(midend *me, int which, config_item *cfg)
1754 switch (which) { 1757 switch (which) {
1755 case CFG_SETTINGS: 1758 case CFG_SETTINGS:
1756 params = me->ourgame->custom_params(cfg); 1759 params = me->ourgame->custom_params(cfg);
1757 error = me->ourgame->validate_params(params, TRUE); 1760 error = me->ourgame->validate_params(params, true);
1758 1761
1759 if (error) { 1762 if (error) {
1760 me->ourgame->free_params(params); 1763 me->ourgame->free_params(params);
@@ -1777,12 +1780,12 @@ const char *midend_set_config(midend *me, int which, config_item *cfg)
1777 return NULL; 1780 return NULL;
1778} 1781}
1779 1782
1780int midend_can_format_as_text_now(midend *me) 1783bool midend_can_format_as_text_now(midend *me)
1781{ 1784{
1782 if (me->ourgame->can_format_as_text_ever) 1785 if (me->ourgame->can_format_as_text_ever)
1783 return me->ourgame->can_format_as_text_now(me->params); 1786 return me->ourgame->can_format_as_text_now(me->params);
1784 else 1787 else
1785 return FALSE; 1788 return false;
1786} 1789}
1787 1790
1788char *midend_text_format(midend *me) 1791char *midend_text_format(midend *me)
@@ -1947,7 +1950,7 @@ void midend_serialise(midend *me,
1947 * The current long-term parameters structure, in full. 1950 * The current long-term parameters structure, in full.
1948 */ 1951 */
1949 if (me->params) { 1952 if (me->params) {
1950 char *s = me->ourgame->encode_params(me->params, TRUE); 1953 char *s = me->ourgame->encode_params(me->params, true);
1951 wr("PARAMS", s); 1954 wr("PARAMS", s);
1952 sfree(s); 1955 sfree(s);
1953 } 1956 }
@@ -1956,7 +1959,7 @@ void midend_serialise(midend *me,
1956 * The current short-term parameters structure, in full. 1959 * The current short-term parameters structure, in full.
1957 */ 1960 */
1958 if (me->curparams) { 1961 if (me->curparams) {
1959 char *s = me->ourgame->encode_params(me->curparams, TRUE); 1962 char *s = me->ourgame->encode_params(me->curparams, true);
1960 wr("CPARAMS", s); 1963 wr("CPARAMS", s);
1961 sfree(s); 1964 sfree(s);
1962 } 1965 }
@@ -1985,7 +1988,7 @@ void midend_serialise(midend *me,
1985 len = strlen(me->aux_info); 1988 len = strlen(me->aux_info);
1986 s1 = snewn(len, unsigned char); 1989 s1 = snewn(len, unsigned char);
1987 memcpy(s1, me->aux_info, len); 1990 memcpy(s1, me->aux_info, len);
1988 obfuscate_bitmap(s1, len*8, FALSE); 1991 obfuscate_bitmap(s1, len*8, false);
1989 s2 = bin2hex(s1, len); 1992 s2 = bin2hex(s1, len);
1990 1993
1991 wr("AUXINFO", s2); 1994 wr("AUXINFO", s2);
@@ -2058,13 +2061,13 @@ void midend_serialise(midend *me,
2058 * success, or an error message. 2061 * success, or an error message.
2059 */ 2062 */
2060static const char *midend_deserialise_internal( 2063static const char *midend_deserialise_internal(
2061 midend *me, int (*read)(void *ctx, void *buf, int len), void *rctx, 2064 midend *me, bool (*read)(void *ctx, void *buf, int len), void *rctx,
2062 const char *(*check)(void *ctx, midend *, const struct deserialise_data *), 2065 const char *(*check)(void *ctx, midend *, const struct deserialise_data *),
2063 void *cctx) 2066 void *cctx)
2064{ 2067{
2065 struct deserialise_data data; 2068 struct deserialise_data data;
2066 int gotstates = 0; 2069 int gotstates = 0;
2067 int started = FALSE; 2070 bool started = false;
2068 int i; 2071 int i;
2069 2072
2070 char *val = NULL; 2073 char *val = NULL;
@@ -2144,7 +2147,7 @@ static const char *midend_deserialise_internal(
2144 } 2147 }
2145 /* Now most errors are this one, unless otherwise specified */ 2148 /* Now most errors are this one, unless otherwise specified */
2146 ret = "Saved data ended unexpectedly"; 2149 ret = "Saved data ended unexpectedly";
2147 started = TRUE; 2150 started = true;
2148 } else { 2151 } else {
2149 if (!strcmp(key, "VERSION")) { 2152 if (!strcmp(key, "VERSION")) {
2150 if (strcmp(val, SERIALISE_VERSION)) { 2153 if (strcmp(val, SERIALISE_VERSION)) {
@@ -2181,7 +2184,7 @@ static const char *midend_deserialise_internal(
2181 unsigned char *tmp; 2184 unsigned char *tmp;
2182 int len = strlen(val) / 2; /* length in bytes */ 2185 int len = strlen(val) / 2; /* length in bytes */
2183 tmp = hex2bin(val, len); 2186 tmp = hex2bin(val, len);
2184 obfuscate_bitmap(tmp, len*8, TRUE); 2187 obfuscate_bitmap(tmp, len*8, true);
2185 2188
2186 sfree(data.auxinfo); 2189 sfree(data.auxinfo);
2187 data.auxinfo = snewn(len + 1, char); 2190 data.auxinfo = snewn(len + 1, char);
@@ -2236,17 +2239,17 @@ static const char *midend_deserialise_internal(
2236 2239
2237 data.params = me->ourgame->default_params(); 2240 data.params = me->ourgame->default_params();
2238 me->ourgame->decode_params(data.params, data.parstr); 2241 me->ourgame->decode_params(data.params, data.parstr);
2239 if (me->ourgame->validate_params(data.params, TRUE)) { 2242 if (me->ourgame->validate_params(data.params, true)) {
2240 ret = "Long-term parameters in save file are invalid"; 2243 ret = "Long-term parameters in save file are invalid";
2241 goto cleanup; 2244 goto cleanup;
2242 } 2245 }
2243 data.cparams = me->ourgame->default_params(); 2246 data.cparams = me->ourgame->default_params();
2244 me->ourgame->decode_params(data.cparams, data.cparstr); 2247 me->ourgame->decode_params(data.cparams, data.cparstr);
2245 if (me->ourgame->validate_params(data.cparams, FALSE)) { 2248 if (me->ourgame->validate_params(data.cparams, false)) {
2246 ret = "Short-term parameters in save file are invalid"; 2249 ret = "Short-term parameters in save file are invalid";
2247 goto cleanup; 2250 goto cleanup;
2248 } 2251 }
2249 if (data.seed && me->ourgame->validate_params(data.cparams, TRUE)) { 2252 if (data.seed && me->ourgame->validate_params(data.cparams, true)) {
2250 /* 2253 /*
2251 * The seed's no use with this version, but we can perfectly 2254 * The seed's no use with this version, but we can perfectly
2252 * well use the rest of the data. 2255 * well use the rest of the data.
@@ -2426,7 +2429,7 @@ static const char *midend_deserialise_internal(
2426} 2429}
2427 2430
2428const char *midend_deserialise( 2431const char *midend_deserialise(
2429 midend *me, int (*read)(void *ctx, void *buf, int len), void *rctx) 2432 midend *me, bool (*read)(void *ctx, void *buf, int len), void *rctx)
2430{ 2433{
2431 return midend_deserialise_internal(me, read, rctx, NULL, NULL); 2434 return midend_deserialise_internal(me, read, rctx, NULL, NULL);
2432} 2435}
@@ -2439,11 +2442,11 @@ const char *midend_deserialise(
2439 * failure. 2442 * failure.
2440 */ 2443 */
2441const char *identify_game(char **name, 2444const char *identify_game(char **name,
2442 int (*read)(void *ctx, void *buf, int len), 2445 bool (*read)(void *ctx, void *buf, int len),
2443 void *rctx) 2446 void *rctx)
2444{ 2447{
2445 int nstates = 0, statepos = -1, gotstates = 0; 2448 int nstates = 0, statepos = -1, gotstates = 0;
2446 int started = FALSE; 2449 bool started = false;
2447 2450
2448 char *val = NULL; 2451 char *val = NULL;
2449 /* Initially all errors give the same report */ 2452 /* Initially all errors give the same report */
@@ -2513,7 +2516,7 @@ const char *identify_game(char **name,
2513 } 2516 }
2514 /* Now most errors are this one, unless otherwise specified */ 2517 /* Now most errors are this one, unless otherwise specified */
2515 ret = "Saved data ended unexpectedly"; 2518 ret = "Saved data ended unexpectedly";
2516 started = TRUE; 2519 started = true;
2517 } else { 2520 } else {
2518 if (!strcmp(key, "VERSION")) { 2521 if (!strcmp(key, "VERSION")) {
2519 if (strcmp(val, SERIALISE_VERSION)) { 2522 if (strcmp(val, SERIALISE_VERSION)) {
@@ -2537,7 +2540,7 @@ const char *identify_game(char **name,
2537 return ret; 2540 return ret;
2538} 2541}
2539 2542
2540const char *midend_print_puzzle(midend *me, document *doc, int with_soln) 2543const char *midend_print_puzzle(midend *me, document *doc, bool with_soln)
2541{ 2544{
2542 game_state *soln = NULL; 2545 game_state *soln = NULL;
2543 2546
diff --git a/apps/plugins/puzzles/src/mines.c b/apps/plugins/puzzles/src/mines.c
index 0a66a25d8a..c9d9852573 100644
--- a/apps/plugins/puzzles/src/mines.c
+++ b/apps/plugins/puzzles/src/mines.c
@@ -43,7 +43,7 @@ enum {
43 43
44struct game_params { 44struct game_params {
45 int w, h, n; 45 int w, h, n;
46 int unique; 46 bool unique;
47}; 47};
48 48
49struct mine_layout { 49struct mine_layout {
@@ -52,19 +52,20 @@ struct mine_layout {
52 * given instance of the puzzle, so we reference-count it. 52 * given instance of the puzzle, so we reference-count it.
53 */ 53 */
54 int refcount; 54 int refcount;
55 char *mines; 55 bool *mines;
56 /* 56 /*
57 * If we haven't yet actually generated the mine layout, here's 57 * If we haven't yet actually generated the mine layout, here's
58 * all the data we will need to do so. 58 * all the data we will need to do so.
59 */ 59 */
60 int n, unique; 60 int n;
61 bool unique;
61 random_state *rs; 62 random_state *rs;
62 midend *me; /* to give back the new game desc */ 63 midend *me; /* to give back the new game desc */
63}; 64};
64 65
65struct game_state { 66struct game_state {
66 int w, h, n, dead, won; 67 int w, h, n;
67 int used_solve; 68 bool dead, won, used_solve;
68 struct mine_layout *layout; /* real mine positions */ 69 struct mine_layout *layout; /* real mine positions */
69 signed char *grid; /* player knowledge */ 70 signed char *grid; /* player knowledge */
70 /* 71 /*
@@ -97,29 +98,29 @@ static game_params *default_params(void)
97 98
98 ret->w = ret->h = 9; 99 ret->w = ret->h = 9;
99 ret->n = 10; 100 ret->n = 10;
100 ret->unique = TRUE; 101 ret->unique = true;
101 102
102 return ret; 103 return ret;
103} 104}
104 105
105static const struct game_params mines_presets[] = { 106static const struct game_params mines_presets[] = {
106 {9, 9, 10, TRUE}, 107 {9, 9, 10, true},
107 {9, 9, 35, TRUE}, 108 {9, 9, 35, true},
108 {16, 16, 40, TRUE}, 109 {16, 16, 40, true},
109 {16, 16, 99, TRUE}, 110 {16, 16, 99, true},
110#ifndef SMALL_SCREEN 111#ifndef SMALL_SCREEN
111 {30, 16, 99, TRUE}, 112 {30, 16, 99, true},
112 {30, 16, 170, TRUE}, 113 {30, 16, 170, true},
113#endif 114#endif
114}; 115};
115 116
116static int game_fetch_preset(int i, char **name, game_params **params) 117static bool game_fetch_preset(int i, char **name, game_params **params)
117{ 118{
118 game_params *ret; 119 game_params *ret;
119 char str[80]; 120 char str[80];
120 121
121 if (i < 0 || i >= lenof(mines_presets)) 122 if (i < 0 || i >= lenof(mines_presets))
122 return FALSE; 123 return false;
123 124
124 ret = snew(game_params); 125 ret = snew(game_params);
125 *ret = mines_presets[i]; 126 *ret = mines_presets[i];
@@ -128,7 +129,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
128 129
129 *name = dupstr(str); 130 *name = dupstr(str);
130 *params = ret; 131 *params = ret;
131 return TRUE; 132 return true;
132} 133}
133 134
134static void free_params(game_params *params) 135static void free_params(game_params *params)
@@ -167,13 +168,13 @@ static void decode_params(game_params *params, char const *string)
167 while (*p) { 168 while (*p) {
168 if (*p == 'a') { 169 if (*p == 'a') {
169 p++; 170 p++;
170 params->unique = FALSE; 171 params->unique = false;
171 } else 172 } else
172 p++; /* skip any other gunk */ 173 p++; /* skip any other gunk */
173 } 174 }
174} 175}
175 176
176static char *encode_params(const game_params *params, int full) 177static char *encode_params(const game_params *params, bool full)
177{ 178{
178 char ret[400]; 179 char ret[400];
179 int len; 180 int len;
@@ -239,7 +240,7 @@ static game_params *custom_params(const config_item *cfg)
239 return ret; 240 return ret;
240} 241}
241 242
242static const char *validate_params(const game_params *params, int full) 243static const char *validate_params(const game_params *params, bool full)
243{ 244{
244 /* 245 /*
245 * Lower limit on grid size: each dimension must be at least 3. 246 * Lower limit on grid size: each dimension must be at least 3.
@@ -298,7 +299,7 @@ static int bitcount16(int inword)
298 */ 299 */
299struct set { 300struct set {
300 short x, y, mask, mines; 301 short x, y, mask, mines;
301 int todo; 302 bool todo;
302 struct set *prev, *next; 303 struct set *prev, *next;
303}; 304};
304 305
@@ -342,7 +343,7 @@ static struct setstore *ss_new(void)
342 * with the second. Return the new mask part of the first set. 343 * with the second. Return the new mask part of the first set.
343 */ 344 */
344static int setmunge(int x1, int y1, int mask1, int x2, int y2, int mask2, 345static int setmunge(int x1, int y1, int mask1, int x2, int y2, int mask2,
345 int diff) 346 bool diff)
346{ 347{
347 /* 348 /*
348 * Adjust the second set so that it has the same x,y 349 * Adjust the second set so that it has the same x,y
@@ -403,7 +404,7 @@ static void ss_add_todo(struct setstore *ss, struct set *s)
403 ss->todo_head = s; 404 ss->todo_head = s;
404 ss->todo_tail = s; 405 ss->todo_tail = s;
405 s->next = NULL; 406 s->next = NULL;
406 s->todo = TRUE; 407 s->todo = true;
407} 408}
408 409
409static void ss_add(struct setstore *ss, int x, int y, int mask, int mines) 410static void ss_add(struct setstore *ss, int x, int y, int mask, int mines)
@@ -429,7 +430,7 @@ static void ss_add(struct setstore *ss, int x, int y, int mask, int mines)
429 s->y = y; 430 s->y = y;
430 s->mask = mask; 431 s->mask = mask;
431 s->mines = mines; 432 s->mines = mines;
432 s->todo = FALSE; 433 s->todo = false;
433 if (add234(ss->sets, s) != s) { 434 if (add234(ss->sets, s) != s) {
434 /* 435 /*
435 * This set already existed! Free it and return. 436 * This set already existed! Free it and return.
@@ -465,7 +466,7 @@ static void ss_remove(struct setstore *ss, struct set *s)
465 else if (s == ss->todo_tail) 466 else if (s == ss->todo_tail)
466 ss->todo_tail = prev; 467 ss->todo_tail = prev;
467 468
468 s->todo = FALSE; 469 s->todo = false;
469 470
470 /* 471 /*
471 * Remove s from the tree. 472 * Remove s from the tree.
@@ -509,7 +510,7 @@ static struct set **ss_overlap(struct setstore *ss, int x, int y, int mask)
509 * really overlap, and add it to the list if 510 * really overlap, and add it to the list if
510 * so. 511 * so.
511 */ 512 */
512 if (setmunge(x, y, mask, s->x, s->y, s->mask, FALSE)) { 513 if (setmunge(x, y, mask, s->x, s->y, s->mask, false)) {
513 /* 514 /*
514 * There's an overlap. 515 * There's an overlap.
515 */ 516 */
@@ -544,7 +545,7 @@ static struct set *ss_todo(struct setstore *ss)
544 else 545 else
545 ss->todo_tail = NULL; 546 ss->todo_tail = NULL;
546 ret->next = ret->prev = NULL; 547 ret->next = ret->prev = NULL;
547 ret->todo = FALSE; 548 ret->todo = false;
548 return ret; 549 return ret;
549 } else { 550 } else {
550 return NULL; 551 return NULL;
@@ -571,7 +572,7 @@ typedef int (*open_cb)(void *, int, int);
571static void known_squares(int w, int h, struct squaretodo *std, 572static void known_squares(int w, int h, struct squaretodo *std,
572 signed char *grid, 573 signed char *grid,
573 open_cb open, void *openctx, 574 open_cb open, void *openctx,
574 int x, int y, int mask, int mine) 575 int x, int y, int mask, bool mine)
575{ 576{
576 int xx, yy, bit; 577 int xx, yy, bit;
577 578
@@ -673,7 +674,7 @@ static int minesolve(int w, int h, int n, signed char *grid,
673 * Main deductive loop. 674 * Main deductive loop.
674 */ 675 */
675 while (1) { 676 while (1) {
676 int done_something = FALSE; 677 bool done_something = false;
677 struct set *s; 678 struct set *s;
678 679
679 /* 680 /*
@@ -742,7 +743,7 @@ static int minesolve(int w, int h, int n, signed char *grid,
742 * Compute the mask for this set minus the 743 * Compute the mask for this set minus the
743 * newly known square. 744 * newly known square.
744 */ 745 */
745 newmask = setmunge(s->x, s->y, s->mask, x, y, 1, TRUE); 746 newmask = setmunge(s->x, s->y, s->mask, x, y, 1, true);
746 747
747 /* 748 /*
748 * Compute the new mine count. 749 * Compute the new mine count.
@@ -770,7 +771,7 @@ static int minesolve(int w, int h, int n, signed char *grid,
770 * Marking a fresh square as known certainly counts as 771 * Marking a fresh square as known certainly counts as
771 * doing something. 772 * doing something.
772 */ 773 */
773 done_something = TRUE; 774 done_something = true;
774 } 775 }
775 776
776 /* 777 /*
@@ -827,9 +828,9 @@ static int minesolve(int w, int h, int n, signed char *grid,
827 * s2-s. 828 * s2-s.
828 */ 829 */
829 swing = setmunge(s->x, s->y, s->mask, s2->x, s2->y, s2->mask, 830 swing = setmunge(s->x, s->y, s->mask, s2->x, s2->y, s2->mask,
830 TRUE); 831 true);
831 s2wing = setmunge(s2->x, s2->y, s2->mask, s->x, s->y, s->mask, 832 s2wing = setmunge(s2->x, s2->y, s2->mask, s->x, s->y, s->mask,
832 TRUE); 833 true);
833 swc = bitcount16(swing); 834 swc = bitcount16(swing);
834 s2wc = bitcount16(s2wing); 835 s2wc = bitcount16(s2wing);
835 836
@@ -876,7 +877,7 @@ static int minesolve(int w, int h, int n, signed char *grid,
876 * _something_, even if it's only reducing the size of 877 * _something_, even if it's only reducing the size of
877 * our to-do list. 878 * our to-do list.
878 */ 879 */
879 done_something = TRUE; 880 done_something = true;
880 } else if (n >= 0) { 881 } else if (n >= 0) {
881 /* 882 /*
882 * We have nothing left on our todo list, which means 883 * We have nothing left on our todo list, which means
@@ -893,7 +894,8 @@ static int minesolve(int w, int h, int n, signed char *grid,
893 */ 894 */
894 895
895 int minesleft, squaresleft; 896 int minesleft, squaresleft;
896 int nsets, setused[10], cursor; 897 int nsets, cursor;
898 bool setused[10];
897 899
898 /* 900 /*
899 * Start by scanning the current grid state to work out 901 * Start by scanning the current grid state to work out
@@ -974,10 +976,9 @@ static int minesolve(int w, int h, int n, signed char *grid,
974 * I'm going to use a virtual recursion within this 976 * I'm going to use a virtual recursion within this
975 * function. The way this works is: 977 * function. The way this works is:
976 * 978 *
977 * - we have an array `setused', such that 979 * - we have an array `setused', such that setused[n]
978 * setused[n] is 0 or 1 depending on whether set 980 * is true if set n is currently in the union we
979 * n is currently in the union we are 981 * are considering.
980 * considering.
981 * 982 *
982 * - we have a value `cursor' which indicates how 983 * - we have a value `cursor' which indicates how
983 * much of `setused' we have so far filled in. 984 * much of `setused' we have so far filled in.
@@ -985,11 +986,10 @@ static int minesolve(int w, int h, int n, signed char *grid,
985 * 986 *
986 * We begin by setting `cursor' to zero. Then: 987 * We begin by setting `cursor' to zero. Then:
987 * 988 *
988 * - if cursor can advance, we advance it by one. 989 * - if cursor can advance, we advance it by one. We
989 * We set the value in `setused' that it went 990 * set the value in `setused' that it went past to
990 * past to 1 if that set is disjoint from 991 * true if that set is disjoint from anything else
991 * anything else currently in `setused', or to 0 992 * currently in `setused', or to false otherwise.
992 * otherwise.
993 * 993 *
994 * - If cursor cannot advance because it has 994 * - If cursor cannot advance because it has
995 * reached the end of the setused list, then we 995 * reached the end of the setused list, then we
@@ -998,10 +998,10 @@ static int minesolve(int w, int h, int n, signed char *grid,
998 * properties. If so, mark all the squares not 998 * properties. If so, mark all the squares not
999 * in the union as known and terminate. 999 * in the union as known and terminate.
1000 * 1000 *
1001 * - If cursor has reached the end of setused and 1001 * - If cursor has reached the end of setused and the
1002 * the algorithm _hasn't_ terminated, back 1002 * algorithm _hasn't_ terminated, back cursor up to
1003 * cursor up to the nearest 1, turn it into a 0 1003 * the nearest true entry, reset it to false, and
1004 * and advance cursor just past it. 1004 * advance cursor just past it.
1005 * 1005 *
1006 * - If we attempt to back up to the nearest 1 and 1006 * - If we attempt to back up to the nearest 1 and
1007 * there isn't one at all, then we have gone 1007 * there isn't one at all, then we have gone
@@ -1017,7 +1017,7 @@ static int minesolve(int w, int h, int n, signed char *grid,
1017 while (1) { 1017 while (1) {
1018 1018
1019 if (cursor < nsets) { 1019 if (cursor < nsets) {
1020 int ok = TRUE; 1020 bool ok = true;
1021 1021
1022 /* See if any existing set overlaps this one. */ 1022 /* See if any existing set overlaps this one. */
1023 for (i = 0; i < cursor; i++) 1023 for (i = 0; i < cursor; i++)
@@ -1026,8 +1026,8 @@ static int minesolve(int w, int h, int n, signed char *grid,
1026 sets[cursor]->y, 1026 sets[cursor]->y,
1027 sets[cursor]->mask, 1027 sets[cursor]->mask,
1028 sets[i]->x, sets[i]->y, sets[i]->mask, 1028 sets[i]->x, sets[i]->y, sets[i]->mask,
1029 FALSE)) { 1029 false)) {
1030 ok = FALSE; 1030 ok = false;
1031 break; 1031 break;
1032 } 1032 }
1033 1033
@@ -1067,15 +1067,15 @@ static int minesolve(int w, int h, int n, signed char *grid,
1067 */ 1067 */
1068 for (i = 0; i < w*h; i++) 1068 for (i = 0; i < w*h; i++)
1069 if (grid[i] == -2) { 1069 if (grid[i] == -2) {
1070 int outside = TRUE; 1070 bool outside = true;
1071 y = i / w; 1071 y = i / w;
1072 x = i % w; 1072 x = i % w;
1073 for (j = 0; j < nsets; j++) 1073 for (j = 0; j < nsets; j++)
1074 if (setused[j] && 1074 if (setused[j] &&
1075 setmunge(sets[j]->x, sets[j]->y, 1075 setmunge(sets[j]->x, sets[j]->y,
1076 sets[j]->mask, x, y, 1, 1076 sets[j]->mask, x, y, 1,
1077 FALSE)) { 1077 false)) {
1078 outside = FALSE; 1078 outside = false;
1079 break; 1079 break;
1080 } 1080 }
1081 if (outside) 1081 if (outside)
@@ -1084,7 +1084,7 @@ static int minesolve(int w, int h, int n, signed char *grid,
1084 x, y, 1, minesleft != 0); 1084 x, y, 1, minesleft != 0);
1085 } 1085 }
1086 1086
1087 done_something = TRUE; 1087 done_something = true;
1088 break; /* return to main deductive loop */ 1088 break; /* return to main deductive loop */
1089 } 1089 }
1090 1090
@@ -1106,7 +1106,7 @@ static int minesolve(int w, int h, int n, signed char *grid,
1106 minesleft += sets[cursor]->mines; 1106 minesleft += sets[cursor]->mines;
1107 squaresleft += bitcount16(sets[cursor]->mask); 1107 squaresleft += bitcount16(sets[cursor]->mask);
1108 1108
1109 setused[cursor++] = 0; 1109 setused[cursor++] = false;
1110 } else { 1110 } else {
1111 /* 1111 /*
1112 * We've backtracked all the way to the 1112 * We've backtracked all the way to the
@@ -1301,10 +1301,10 @@ static int minesolve(int w, int h, int n, signed char *grid,
1301 */ 1301 */
1302 1302
1303struct minectx { 1303struct minectx {
1304 char *grid; 1304 bool *grid;
1305 int w, h; 1305 int w, h;
1306 int sx, sy; 1306 int sx, sy;
1307 int allow_big_perturbs; 1307 bool allow_big_perturbs;
1308 random_state *rs; 1308 random_state *rs;
1309}; 1309};
1310 1310
@@ -1722,15 +1722,15 @@ static struct perturbations *mineperturb(void *vctx, signed char *grid,
1722 return ret; 1722 return ret;
1723} 1723}
1724 1724
1725static char *minegen(int w, int h, int n, int x, int y, int unique, 1725static bool *minegen(int w, int h, int n, int x, int y, bool unique,
1726 random_state *rs) 1726 random_state *rs)
1727{ 1727{
1728 char *ret = snewn(w*h, char); 1728 bool *ret = snewn(w*h, bool);
1729 int success; 1729 bool success;
1730 int ntries = 0; 1730 int ntries = 0;
1731 1731
1732 do { 1732 do {
1733 success = FALSE; 1733 success = false;
1734 ntries++; 1734 ntries++;
1735 1735
1736 memset(ret, 0, w*h); 1736 memset(ret, 0, w*h);
@@ -1758,7 +1758,7 @@ static char *minegen(int w, int h, int n, int x, int y, int unique,
1758 nn = n; 1758 nn = n;
1759 while (nn-- > 0) { 1759 while (nn-- > 0) {
1760 i = random_upto(rs, k); 1760 i = random_upto(rs, k);
1761 ret[tmp[i]] = 1; 1761 ret[tmp[i]] = true;
1762 tmp[i] = tmp[--k]; 1762 tmp[i] = tmp[--k];
1763 } 1763 }
1764 1764
@@ -1816,17 +1816,17 @@ static char *minegen(int w, int h, int n, int x, int y, int unique,
1816 solveret = 1816 solveret =
1817 minesolve(w, h, n, solvegrid, mineopen, mineperturb, ctx, rs); 1817 minesolve(w, h, n, solvegrid, mineopen, mineperturb, ctx, rs);
1818 if (solveret < 0 || (prevret >= 0 && solveret >= prevret)) { 1818 if (solveret < 0 || (prevret >= 0 && solveret >= prevret)) {
1819 success = FALSE; 1819 success = false;
1820 break; 1820 break;
1821 } else if (solveret == 0) { 1821 } else if (solveret == 0) {
1822 success = TRUE; 1822 success = true;
1823 break; 1823 break;
1824 } 1824 }
1825 } 1825 }
1826 1826
1827 sfree(solvegrid); 1827 sfree(solvegrid);
1828 } else { 1828 } else {
1829 success = TRUE; 1829 success = true;
1830 } 1830 }
1831 1831
1832 } while (!success); 1832 } while (!success);
@@ -1834,8 +1834,8 @@ static char *minegen(int w, int h, int n, int x, int y, int unique,
1834 return ret; 1834 return ret;
1835} 1835}
1836 1836
1837static char *describe_layout(char *grid, int area, int x, int y, 1837static char *describe_layout(bool *grid, int area, int x, int y,
1838 int obfuscate) 1838 bool obfuscate)
1839{ 1839{
1840 char *ret, *p; 1840 char *ret, *p;
1841 unsigned char *bmp; 1841 unsigned char *bmp;
@@ -1851,7 +1851,7 @@ static char *describe_layout(char *grid, int area, int x, int y,
1851 bmp[i / 8] |= 0x80 >> (i % 8); 1851 bmp[i / 8] |= 0x80 >> (i % 8);
1852 } 1852 }
1853 if (obfuscate) 1853 if (obfuscate)
1854 obfuscate_bitmap(bmp, area, FALSE); 1854 obfuscate_bitmap(bmp, area, false);
1855 1855
1856 /* 1856 /*
1857 * Now encode the resulting bitmap in hex. We can work to 1857 * Now encode the resulting bitmap in hex. We can work to
@@ -1875,13 +1875,13 @@ static char *describe_layout(char *grid, int area, int x, int y,
1875 return ret; 1875 return ret;
1876} 1876}
1877 1877
1878static char *new_mine_layout(int w, int h, int n, int x, int y, int unique, 1878static bool *new_mine_layout(int w, int h, int n, int x, int y, bool unique,
1879 random_state *rs, char **game_desc) 1879 random_state *rs, char **game_desc)
1880{ 1880{
1881 char *grid; 1881 bool *grid;
1882 1882
1883#ifdef TEST_OBFUSCATION 1883#ifdef TEST_OBFUSCATION
1884 static int tested_obfuscation = FALSE; 1884 static int tested_obfuscation = false;
1885 if (!tested_obfuscation) { 1885 if (!tested_obfuscation) {
1886 /* 1886 /*
1887 * A few simple test vectors for the obfuscator. 1887 * A few simple test vectors for the obfuscator.
@@ -1897,10 +1897,10 @@ static char *new_mine_layout(int w, int h, int n, int x, int y, int unique,
1897 */ 1897 */
1898 { 1898 {
1899 unsigned char bmp1[] = "\x12\x34\x56\x70"; 1899 unsigned char bmp1[] = "\x12\x34\x56\x70";
1900 obfuscate_bitmap(bmp1, 28, FALSE); 1900 obfuscate_bitmap(bmp1, 28, false);
1901 printf("test 1 encode: %s\n", 1901 printf("test 1 encode: %s\n",
1902 memcmp(bmp1, "\x07\xfa\x65\x00", 4) ? "failed" : "passed"); 1902 memcmp(bmp1, "\x07\xfa\x65\x00", 4) ? "failed" : "passed");
1903 obfuscate_bitmap(bmp1, 28, TRUE); 1903 obfuscate_bitmap(bmp1, 28, true);
1904 printf("test 1 decode: %s\n", 1904 printf("test 1 decode: %s\n",
1905 memcmp(bmp1, "\x12\x34\x56\x70", 4) ? "failed" : "passed"); 1905 memcmp(bmp1, "\x12\x34\x56\x70", 4) ? "failed" : "passed");
1906 } 1906 }
@@ -1914,7 +1914,7 @@ static char *new_mine_layout(int w, int h, int n, int x, int y, int unique,
1914 unsigned char bmp2a[50]; 1914 unsigned char bmp2a[50];
1915 memset(bmp2, 0, 50); 1915 memset(bmp2, 0, 50);
1916 memset(bmp2a, 0, 50); 1916 memset(bmp2a, 0, 50);
1917 obfuscate_bitmap(bmp2, 50 * 8, FALSE); 1917 obfuscate_bitmap(bmp2, 50 * 8, false);
1918 /* 1918 /*
1919 * SHA of twenty-five zero bytes plus "0" is 1919 * SHA of twenty-five zero bytes plus "0" is
1920 * b202c07b990c01f6ff2d544707f60e506019b671. SHA of 1920 * b202c07b990c01f6ff2d544707f60e506019b671. SHA of
@@ -1936,7 +1936,7 @@ static char *new_mine_layout(int w, int h, int n, int x, int y, int unique,
1936 "\xb5\xa2\x10\xb0\xaf\x91\x3d\xb8\x5d\x37\xca\x27" 1936 "\xb5\xa2\x10\xb0\xaf\x91\x3d\xb8\x5d\x37\xca\x27"
1937 "\xf5\x2a\x9f\x78\xbb\xa3\xa8\x00\x30\xdb\x3d\x01" 1937 "\xf5\x2a\x9f\x78\xbb\xa3\xa8\x00\x30\xdb\x3d\x01"
1938 "\xd8\xdf\x78", 50) ? "failed" : "passed"); 1938 "\xd8\xdf\x78", 50) ? "failed" : "passed");
1939 obfuscate_bitmap(bmp2, 50 * 8, TRUE); 1939 obfuscate_bitmap(bmp2, 50 * 8, true);
1940 printf("test 2 decode: %s\n", 1940 printf("test 2 decode: %s\n",
1941 memcmp(bmp2, bmp2a, 50) ? "failed" : "passed"); 1941 memcmp(bmp2, bmp2a, 50) ? "failed" : "passed");
1942 } 1942 }
@@ -1946,13 +1946,13 @@ static char *new_mine_layout(int w, int h, int n, int x, int y, int unique,
1946 grid = minegen(w, h, n, x, y, unique, rs); 1946 grid = minegen(w, h, n, x, y, unique, rs);
1947 1947
1948 if (game_desc) 1948 if (game_desc)
1949 *game_desc = describe_layout(grid, w * h, x, y, TRUE); 1949 *game_desc = describe_layout(grid, w * h, x, y, true);
1950 1950
1951 return grid; 1951 return grid;
1952} 1952}
1953 1953
1954static char *new_game_desc(const game_params *params, random_state *rs, 1954static char *new_game_desc(const game_params *params, random_state *rs,
1955 char **aux, int interactive) 1955 char **aux, bool interactive)
1956{ 1956{
1957 /* 1957 /*
1958 * We generate the coordinates of an initial click even if they 1958 * We generate the coordinates of an initial click even if they
@@ -1972,7 +1972,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
1972 /* 1972 /*
1973 * For batch-generated grids, pre-open one square. 1973 * For batch-generated grids, pre-open one square.
1974 */ 1974 */
1975 char *grid; 1975 bool *grid;
1976 char *desc; 1976 char *desc;
1977 1977
1978 grid = new_mine_layout(params->w, params->h, params->n, 1978 grid = new_mine_layout(params->w, params->h, params->n,
@@ -2081,7 +2081,7 @@ static int open_square(game_state *state, int x, int y)
2081 * mine that killed them, but not the rest (in case they 2081 * mine that killed them, but not the rest (in case they
2082 * want to Undo and carry on playing). 2082 * want to Undo and carry on playing).
2083 */ 2083 */
2084 state->dead = TRUE; 2084 state->dead = true;
2085 state->grid[y*w+x] = 65; 2085 state->grid[y*w+x] = 65;
2086 return -1; 2086 return -1;
2087 } 2087 }
@@ -2101,7 +2101,7 @@ static int open_square(game_state *state, int x, int y)
2101 * using repeated N^2 scans of the grid. 2101 * using repeated N^2 scans of the grid.
2102 */ 2102 */
2103 while (1) { 2103 while (1) {
2104 int done_something = FALSE; 2104 bool done_something = false;
2105 2105
2106 for (yy = 0; yy < h; yy++) 2106 for (yy = 0; yy < h; yy++)
2107 for (xx = 0; xx < w; xx++) 2107 for (xx = 0; xx < w; xx++)
@@ -2130,7 +2130,7 @@ static int open_square(game_state *state, int x, int y)
2130 state->grid[(yy+dy)*w+(xx+dx)] = -10; 2130 state->grid[(yy+dy)*w+(xx+dx)] = -10;
2131 } 2131 }
2132 2132
2133 done_something = TRUE; 2133 done_something = true;
2134 } 2134 }
2135 2135
2136 if (!done_something) 2136 if (!done_something)
@@ -2157,7 +2157,7 @@ static int open_square(game_state *state, int x, int y)
2157 if (state->grid[yy*w+xx] < 0) 2157 if (state->grid[yy*w+xx] < 0)
2158 state->grid[yy*w+xx] = -1; 2158 state->grid[yy*w+xx] = -1;
2159 } 2159 }
2160 state->won = TRUE; 2160 state->won = true;
2161 } 2161 }
2162 2162
2163 return 0; 2163 return 0;
@@ -2167,14 +2167,15 @@ static game_state *new_game(midend *me, const game_params *params,
2167 const char *desc) 2167 const char *desc)
2168{ 2168{
2169 game_state *state = snew(game_state); 2169 game_state *state = snew(game_state);
2170 int i, wh, x, y, masked; 2170 int i, wh, x, y;
2171 bool masked;
2171 unsigned char *bmp; 2172 unsigned char *bmp;
2172 2173
2173 state->w = params->w; 2174 state->w = params->w;
2174 state->h = params->h; 2175 state->h = params->h;
2175 state->n = params->n; 2176 state->n = params->n;
2176 state->dead = state->won = FALSE; 2177 state->dead = state->won = false;
2177 state->used_solve = FALSE; 2178 state->used_solve = false;
2178 2179
2179 wh = state->w * state->h; 2180 wh = state->w * state->h;
2180 2181
@@ -2192,9 +2193,9 @@ static game_state *new_game(midend *me, const game_params *params,
2192 desc++; /* skip over mine count */ 2193 desc++; /* skip over mine count */
2193 if (*desc) desc++; /* eat comma */ 2194 if (*desc) desc++; /* eat comma */
2194 if (*desc == 'a') 2195 if (*desc == 'a')
2195 state->layout->unique = FALSE; 2196 state->layout->unique = false;
2196 else 2197 else
2197 state->layout->unique = TRUE; 2198 state->layout->unique = true;
2198 desc++; 2199 desc++;
2199 if (*desc) desc++; /* eat comma */ 2200 if (*desc) desc++; /* eat comma */
2200 2201
@@ -2205,7 +2206,7 @@ static game_state *new_game(midend *me, const game_params *params,
2205 } else { 2206 } else {
2206 state->layout->rs = NULL; 2207 state->layout->rs = NULL;
2207 state->layout->me = NULL; 2208 state->layout->me = NULL;
2208 state->layout->mines = snewn(wh, char); 2209 state->layout->mines = snewn(wh, bool);
2209 2210
2210 if (*desc && isdigit((unsigned char)*desc)) { 2211 if (*desc && isdigit((unsigned char)*desc)) {
2211 x = atoi(desc); 2212 x = atoi(desc);
@@ -2221,7 +2222,7 @@ static game_state *new_game(midend *me, const game_params *params,
2221 } 2222 }
2222 2223
2223 if (*desc == 'm') { 2224 if (*desc == 'm') {
2224 masked = TRUE; 2225 masked = true;
2225 desc++; 2226 desc++;
2226 } else { 2227 } else {
2227 if (*desc == 'u') 2228 if (*desc == 'u')
@@ -2230,7 +2231,7 @@ static game_state *new_game(midend *me, const game_params *params,
2230 * We permit game IDs to be entered by hand without the 2231 * We permit game IDs to be entered by hand without the
2231 * masking transformation. 2232 * masking transformation.
2232 */ 2233 */
2233 masked = FALSE; 2234 masked = false;
2234 } 2235 }
2235 2236
2236 bmp = snewn((wh + 7) / 8, unsigned char); 2237 bmp = snewn((wh + 7) / 8, unsigned char);
@@ -2253,12 +2254,12 @@ static game_state *new_game(midend *me, const game_params *params,
2253 } 2254 }
2254 2255
2255 if (masked) 2256 if (masked)
2256 obfuscate_bitmap(bmp, wh, TRUE); 2257 obfuscate_bitmap(bmp, wh, true);
2257 2258
2258 memset(state->layout->mines, 0, wh); 2259 memset(state->layout->mines, 0, wh * sizeof(bool));
2259 for (i = 0; i < wh; i++) { 2260 for (i = 0; i < wh; i++) {
2260 if (bmp[i / 8] & (0x80 >> (i % 8))) 2261 if (bmp[i / 8] & (0x80 >> (i % 8)))
2261 state->layout->mines[i] = 1; 2262 state->layout->mines[i] = true;
2262 } 2263 }
2263 2264
2264 if (x >= 0 && y >= 0) 2265 if (x >= 0 && y >= 0)
@@ -2310,9 +2311,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
2310 return dupstr("S"); 2311 return dupstr("S");
2311} 2312}
2312 2313
2313static int game_can_format_as_text_now(const game_params *params) 2314static bool game_can_format_as_text_now(const game_params *params)
2314{ 2315{
2315 return TRUE; 2316 return true;
2316} 2317}
2317 2318
2318static char *game_text_format(const game_state *state) 2319static char *game_text_format(const game_state *state)
@@ -2346,9 +2347,11 @@ static char *game_text_format(const game_state *state)
2346struct game_ui { 2347struct game_ui {
2347 int hx, hy, hradius; /* for mouse-down highlights */ 2348 int hx, hy, hradius; /* for mouse-down highlights */
2348 int validradius; 2349 int validradius;
2349 int flash_is_death; 2350 bool flash_is_death;
2350 int deaths, completed; 2351 int deaths;
2351 int cur_x, cur_y, cur_visible; 2352 bool completed;
2353 int cur_x, cur_y;
2354 bool cur_visible;
2352}; 2355};
2353 2356
2354static game_ui *new_ui(const game_state *state) 2357static game_ui *new_ui(const game_state *state)
@@ -2357,9 +2360,10 @@ static game_ui *new_ui(const game_state *state)
2357 ui->hx = ui->hy = -1; 2360 ui->hx = ui->hy = -1;
2358 ui->hradius = ui->validradius = 0; 2361 ui->hradius = ui->validradius = 0;
2359 ui->deaths = 0; 2362 ui->deaths = 0;
2360 ui->completed = FALSE; 2363 ui->completed = false;
2361 ui->flash_is_death = FALSE; /* *shrug* */ 2364 ui->flash_is_death = false; /* *shrug* */
2362 ui->cur_x = ui->cur_y = ui->cur_visible = 0; 2365 ui->cur_x = ui->cur_y = 0;
2366 ui->cur_visible = false;
2363 return ui; 2367 return ui;
2364} 2368}
2365 2369
@@ -2386,18 +2390,19 @@ static void decode_ui(game_ui *ui, const char *encoding)
2386 int p= 0; 2390 int p= 0;
2387 sscanf(encoding, "D%d%n", &ui->deaths, &p); 2391 sscanf(encoding, "D%d%n", &ui->deaths, &p);
2388 if (encoding[p] == 'C') 2392 if (encoding[p] == 'C')
2389 ui->completed = TRUE; 2393 ui->completed = true;
2390} 2394}
2391 2395
2392static void game_changed_state(game_ui *ui, const game_state *oldstate, 2396static void game_changed_state(game_ui *ui, const game_state *oldstate,
2393 const game_state *newstate) 2397 const game_state *newstate)
2394{ 2398{
2395 if (newstate->won) 2399 if (newstate->won)
2396 ui->completed = TRUE; 2400 ui->completed = true;
2397} 2401}
2398 2402
2399struct game_drawstate { 2403struct game_drawstate {
2400 int w, h, started, tilesize, bg; 2404 int w, h, tilesize, bg;
2405 bool started;
2401 signed char *grid; 2406 signed char *grid;
2402 /* 2407 /*
2403 * Items in this `grid' array have all the same values as in 2408 * Items in this `grid' array have all the same values as in
@@ -2426,15 +2431,15 @@ static char *interpret_move(const game_state *from, game_ui *ui,
2426 cy = FROMCOORD(y); 2431 cy = FROMCOORD(y);
2427 2432
2428 if (IS_CURSOR_MOVE(button)) { 2433 if (IS_CURSOR_MOVE(button)) {
2429 move_cursor(button, &ui->cur_x, &ui->cur_y, from->w, from->h, 0); 2434 move_cursor(button, &ui->cur_x, &ui->cur_y, from->w, from->h, false);
2430 ui->cur_visible = 1; 2435 ui->cur_visible = true;
2431 return UI_UPDATE; 2436 return UI_UPDATE;
2432 } 2437 }
2433 if (IS_CURSOR_SELECT(button)) { 2438 if (IS_CURSOR_SELECT(button)) {
2434 int v = from->grid[ui->cur_y * from->w + ui->cur_x]; 2439 int v = from->grid[ui->cur_y * from->w + ui->cur_x];
2435 2440
2436 if (!ui->cur_visible) { 2441 if (!ui->cur_visible) {
2437 ui->cur_visible = 1; 2442 ui->cur_visible = true;
2438 return UI_UPDATE; 2443 return UI_UPDATE;
2439 } 2444 }
2440 if (button == CURSOR_SELECT2) { 2445 if (button == CURSOR_SELECT2) {
@@ -2474,7 +2479,7 @@ static char *interpret_move(const game_state *from, game_ui *ui,
2474 ui->validradius = ui->hradius; 2479 ui->validradius = ui->hradius;
2475 else if (button == MIDDLE_BUTTON) 2480 else if (button == MIDDLE_BUTTON)
2476 ui->validradius = 1; 2481 ui->validradius = 1;
2477 ui->cur_visible = 0; 2482 ui->cur_visible = false;
2478 return UI_UPDATE; 2483 return UI_UPDATE;
2479 } 2484 }
2480 2485
@@ -2645,7 +2650,7 @@ static game_state *execute_move(const game_state *from, const char *move)
2645 } 2650 }
2646 } 2651 }
2647 } 2652 }
2648 ret->used_solve = TRUE; 2653 ret->used_solve = true;
2649 2654
2650 return ret; 2655 return ret;
2651 } else { 2656 } else {
@@ -2799,7 +2804,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
2799 2804
2800 ds->w = state->w; 2805 ds->w = state->w;
2801 ds->h = state->h; 2806 ds->h = state->h;
2802 ds->started = FALSE; 2807 ds->started = false;
2803 ds->tilesize = 0; /* not decided yet */ 2808 ds->tilesize = 0; /* not decided yet */
2804 ds->grid = snewn(ds->w * ds->h, signed char); 2809 ds->grid = snewn(ds->w * ds->h, signed char);
2805 ds->bg = -1; 2810 ds->bg = -1;
@@ -2958,7 +2963,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2958{ 2963{
2959 int x, y; 2964 int x, y;
2960 int mines, markers, closed, bg; 2965 int mines, markers, closed, bg;
2961 int cx = -1, cy = -1, cmoved; 2966 int cx = -1, cy = -1;
2967 bool cmoved;
2962 2968
2963 if (flashtime) { 2969 if (flashtime) {
2964 int frame = (int)(flashtime / FLASH_FRAME); 2970 int frame = (int)(flashtime / FLASH_FRAME);
@@ -2998,7 +3004,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2998 coords[0] = COORD(0) - OUTER_HIGHLIGHT_WIDTH; 3004 coords[0] = COORD(0) - OUTER_HIGHLIGHT_WIDTH;
2999 draw_polygon(dr, coords, 5, COL_LOWLIGHT, COL_LOWLIGHT); 3005 draw_polygon(dr, coords, 5, COL_LOWLIGHT, COL_LOWLIGHT);
3000 3006
3001 ds->started = TRUE; 3007 ds->started = true;
3002 } 3008 }
3003 3009
3004 if (ui->cur_visible) cx = ui->cur_x; 3010 if (ui->cur_visible) cx = ui->cur_x;
@@ -3012,7 +3018,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
3012 mines = markers = closed = 0; 3018 mines = markers = closed = 0;
3013 for (y = 0; y < ds->h; y++) 3019 for (y = 0; y < ds->h; y++)
3014 for (x = 0; x < ds->w; x++) { 3020 for (x = 0; x < ds->w; x++) {
3015 int v = state->grid[y*ds->w+x], cc = 0; 3021 int v = state->grid[y*ds->w+x];
3022 bool cc = false;
3016 3023
3017 if (v < 0) 3024 if (v < 0)
3018 closed++; 3025 closed++;
@@ -3047,7 +3054,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
3047 3054
3048 if (cmoved && /* if cursor has moved, force redraw of curr and prev pos */ 3055 if (cmoved && /* if cursor has moved, force redraw of curr and prev pos */
3049 ((x == cx && y == cy) || (x == ds->cur_x && y == ds->cur_y))) 3056 ((x == cx && y == cy) || (x == ds->cur_x && y == ds->cur_y)))
3050 cc = 1; 3057 cc = true;
3051 3058
3052 if (ds->grid[y*ds->w+x] != v || bg != ds->bg || cc) { 3059 if (ds->grid[y*ds->w+x] != v || bg != ds->bg || cc) {
3053 draw_tile(dr, ds, COORD(x), COORD(y), v, 3060 draw_tile(dr, ds, COORD(x), COORD(y), v,
@@ -3132,11 +3139,11 @@ static float game_flash_length(const game_state *oldstate,
3132 3139
3133 if (dir > 0 && !oldstate->dead && !oldstate->won) { 3140 if (dir > 0 && !oldstate->dead && !oldstate->won) {
3134 if (newstate->dead) { 3141 if (newstate->dead) {
3135 ui->flash_is_death = TRUE; 3142 ui->flash_is_death = true;
3136 return 3 * FLASH_FRAME; 3143 return 3 * FLASH_FRAME;
3137 } 3144 }
3138 if (newstate->won) { 3145 if (newstate->won) {
3139 ui->flash_is_death = FALSE; 3146 ui->flash_is_death = false;
3140 return 2 * FLASH_FRAME; 3147 return 2 * FLASH_FRAME;
3141 } 3148 }
3142 } 3149 }
@@ -3153,11 +3160,11 @@ static int game_status(const game_state *state)
3153 return state->won ? (state->used_solve ? -1 : +1) : 0; 3160 return state->won ? (state->used_solve ? -1 : +1) : 0;
3154} 3161}
3155 3162
3156static int game_timing_state(const game_state *state, game_ui *ui) 3163static bool game_timing_state(const game_state *state, game_ui *ui)
3157{ 3164{
3158 if (state->dead || state->won || ui->completed || !state->layout->mines) 3165 if (state->dead || state->won || ui->completed || !state->layout->mines)
3159 return FALSE; 3166 return false;
3160 return TRUE; 3167 return true;
3161} 3168}
3162 3169
3163static void game_print_size(const game_params *params, float *x, float *y) 3170static void game_print_size(const game_params *params, float *x, float *y)
@@ -3180,15 +3187,15 @@ const struct game thegame = {
3180 encode_params, 3187 encode_params,
3181 free_params, 3188 free_params,
3182 dup_params, 3189 dup_params,
3183 TRUE, game_configure, custom_params, 3190 true, game_configure, custom_params,
3184 validate_params, 3191 validate_params,
3185 new_game_desc, 3192 new_game_desc,
3186 validate_desc, 3193 validate_desc,
3187 new_game, 3194 new_game,
3188 dup_game, 3195 dup_game,
3189 free_game, 3196 free_game,
3190 TRUE, solve_game, 3197 true, solve_game,
3191 TRUE, game_can_format_as_text_now, game_text_format, 3198 true, game_can_format_as_text_now, game_text_format,
3192 new_ui, 3199 new_ui,
3193 free_ui, 3200 free_ui,
3194 encode_ui, 3201 encode_ui,
@@ -3205,9 +3212,9 @@ const struct game thegame = {
3205 game_anim_length, 3212 game_anim_length,
3206 game_flash_length, 3213 game_flash_length,
3207 game_status, 3214 game_status,
3208 FALSE, FALSE, game_print_size, game_print, 3215 false, false, game_print_size, game_print,
3209 TRUE, /* wants_statusbar */ 3216 true, /* wants_statusbar */
3210 TRUE, game_timing_state, 3217 true, game_timing_state,
3211 BUTTON_BEATS(LEFT_BUTTON, RIGHT_BUTTON) | REQUIRE_RBUTTON, 3218 BUTTON_BEATS(LEFT_BUTTON, RIGHT_BUTTON) | REQUIRE_RBUTTON,
3212}; 3219};
3213 3220
diff --git a/apps/plugins/puzzles/src/misc.c b/apps/plugins/puzzles/src/misc.c
index 1d6ec4c547..ed31acbbe4 100644
--- a/apps/plugins/puzzles/src/misc.c
+++ b/apps/plugins/puzzles/src/misc.c
@@ -46,7 +46,7 @@ void free_keys(key_label *keys, int nkeys)
46 * keyless, reversible, but visually completely obfuscatory masking 46 * keyless, reversible, but visually completely obfuscatory masking
47 * function to the mine bitmap. 47 * function to the mine bitmap.
48 */ 48 */
49void obfuscate_bitmap(unsigned char *bmp, int bits, int decode) 49void obfuscate_bitmap(unsigned char *bmp, int bits, bool decode)
50{ 50{
51 int bytes, firsthalf, secondhalf; 51 int bytes, firsthalf, secondhalf;
52 struct step { 52 struct step {
@@ -288,7 +288,7 @@ void draw_rect_corners(drawing *dr, int cx, int cy, int r, int col)
288 draw_line(dr, cx + r, cy + r, cx + r/2, cy + r, col); 288 draw_line(dr, cx + r, cy + r, cx + r/2, cy + r, col);
289} 289}
290 290
291void move_cursor(int button, int *x, int *y, int maxw, int maxh, int wrap) 291void move_cursor(int button, int *x, int *y, int maxw, int maxh, bool wrap)
292{ 292{
293 int dx = 0, dy = 0; 293 int dx = 0, dy = 0;
294 switch (button) { 294 switch (button) {
diff --git a/apps/plugins/puzzles/src/mkfiles.pl b/apps/plugins/puzzles/src/mkfiles.pl
index 142f7ca252..d92bcca11d 100755
--- a/apps/plugins/puzzles/src/mkfiles.pl
+++ b/apps/plugins/puzzles/src/mkfiles.pl
@@ -1707,7 +1707,8 @@ if (defined $makefiles{'nestedvm'}) {
1707if (defined $makefiles{'osx'}) { 1707if (defined $makefiles{'osx'}) {
1708 $mftyp = 'osx'; 1708 $mftyp = 'osx';
1709 $dirpfx = &dirpfx($makefiles{'osx'}, "/"); 1709 $dirpfx = &dirpfx($makefiles{'osx'}, "/");
1710 @osxarchs = ('i386', 'x86_64'); 1710 @osxarchs = ('x86_64');
1711 my $osxminver = "10.6";
1711 1712
1712 ##-- Mac OS X makefile 1713 ##-- Mac OS X makefile
1713 open OUT, ">$makefiles{'osx'}"; select OUT; 1714 open OUT, ">$makefiles{'osx'}"; select OUT;
@@ -1756,7 +1757,7 @@ if (defined $makefiles{'osx'}) {
1756 foreach $arch (@osxarchs) { 1757 foreach $arch (@osxarchs) {
1757 $objstr = &objects($p, "X.${arch}.o", undef, undef); 1758 $objstr = &objects($p, "X.${arch}.o", undef, undef);
1758 print &splitline("${prog}.${arch}.bin: " . $objstr), "\n"; 1759 print &splitline("${prog}.${arch}.bin: " . $objstr), "\n";
1759 print &splitline("\t\$(CC) -arch ${arch} -mmacosx-version-min=10.4 \$(LDFLAGS) -o \$@ " . 1760 print &splitline("\t\$(CC) -arch ${arch} -mmacosx-version-min=${osxminver} \$(LDFLAGS) -o \$@ " .
1760 $objstr . " $libstr", 69), "\n\n"; 1761 $objstr . " $libstr", 69), "\n\n";
1761 $archbins .= " ${prog}.${arch}.bin"; 1762 $archbins .= " ${prog}.${arch}.bin";
1762 } 1763 }
@@ -1771,7 +1772,7 @@ if (defined $makefiles{'osx'}) {
1771 foreach $arch (@osxarchs) { 1772 foreach $arch (@osxarchs) {
1772 $objstr = &objects($p, "X.${arch}.o", undef, undef); 1773 $objstr = &objects($p, "X.${arch}.o", undef, undef);
1773 print &splitline("${prog}.${arch}: " . $objstr), "\n"; 1774 print &splitline("${prog}.${arch}: " . $objstr), "\n";
1774 print &splitline("\t\$(CC) -arch ${arch} -mmacosx-version-min=10.4 \$(ULDFLAGS) -o \$@ " . 1775 print &splitline("\t\$(CC) -arch ${arch} -mmacosx-version-min=${osxminver} \$(ULDFLAGS) -o \$@ " .
1775 $objstr . " $libstr", 69), "\n\n"; 1776 $objstr . " $libstr", 69), "\n\n";
1776 $archbins .= " ${prog}.${arch}"; 1777 $archbins .= " ${prog}.${arch}";
1777 } 1778 }
@@ -1784,10 +1785,10 @@ if (defined $makefiles{'osx'}) {
1784 "\n"; 1785 "\n";
1785 $deflist = join "", map { " -D$_" } @{$d->{defs}}; 1786 $deflist = join "", map { " -D$_" } @{$d->{defs}};
1786 if ($d->{deps}->[0] =~ /\.m$/) { 1787 if ($d->{deps}->[0] =~ /\.m$/) {
1787 print "\t\$(CC) -arch $arch -mmacosx-version-min=10.4 -x objective-c \$(COMPAT) \$(FWHACK) \$(CFLAGS)". 1788 print "\t\$(CC) -arch $arch -mmacosx-version-min=${osxminver} -x objective-c \$(COMPAT) \$(FWHACK) \$(CFLAGS)".
1788 " \$(XFLAGS)$deflist -c \$< -o \$\@\n"; 1789 " \$(XFLAGS)$deflist -c \$< -o \$\@\n";
1789 } else { 1790 } else {
1790 print "\t\$(CC) -arch $arch -mmacosx-version-min=10.4 \$(COMPAT) \$(FWHACK) \$(CFLAGS) \$(XFLAGS)$deflist" . 1791 print "\t\$(CC) -arch $arch -mmacosx-version-min=${osxminver} \$(COMPAT) \$(FWHACK) \$(CFLAGS) \$(XFLAGS)$deflist" .
1791 " -c \$< -o \$\@\n"; 1792 " -c \$< -o \$\@\n";
1792 } 1793 }
1793 } 1794 }
diff --git a/apps/plugins/puzzles/src/nestedvm.c b/apps/plugins/puzzles/src/nestedvm.c
index 0ad0f3fab4..947abe0fae 100644
--- a/apps/plugins/puzzles/src/nestedvm.c
+++ b/apps/plugins/puzzles/src/nestedvm.c
@@ -31,10 +31,11 @@ void fatal(const char *fmt, ...)
31struct frontend { 31struct frontend {
32 // TODO kill unneeded members! 32 // TODO kill unneeded members!
33 midend *me; 33 midend *me;
34 int timer_active; 34 bool timer_active;
35 struct timeval last_time; 35 struct timeval last_time;
36 config_item *cfg; 36 config_item *cfg;
37 int cfg_which, cfgret; 37 int cfg_which;
38 bool cfgret;
38 int ox, oy, w, h; 39 int ox, oy, w, h;
39}; 40};
40 41
@@ -216,7 +217,7 @@ int jcallback_resize(int width, int height)
216 int x, y; 217 int x, y;
217 x = width; 218 x = width;
218 y = height; 219 y = height;
219 midend_size(fe->me, &x, &y, TRUE); 220 midend_size(fe->me, &x, &y, true);
220 fe->ox = (width - x) / 2; 221 fe->ox = (width - x) / 2;
221 fe->oy = (height - y) / 2; 222 fe->oy = (height - y) / 2;
222 fe->w = x; 223 fe->w = x;
@@ -244,7 +245,7 @@ void deactivate_timer(frontend *fe)
244{ 245{
245 if (fe->timer_active) 246 if (fe->timer_active)
246 _call_java(4, 13, 0, 0); 247 _call_java(4, 13, 0, 0);
247 fe->timer_active = FALSE; 248 fe->timer_active = false;
248} 249}
249 250
250void activate_timer(frontend *fe) 251void activate_timer(frontend *fe)
@@ -253,7 +254,7 @@ void activate_timer(frontend *fe)
253 _call_java(4, 12, 0, 0); 254 _call_java(4, 12, 0, 0);
254 gettimeofday(&fe->last_time, NULL); 255 gettimeofday(&fe->last_time, NULL);
255 } 256 }
256 fe->timer_active = TRUE; 257 fe->timer_active = true;
257} 258}
258 259
259void jcallback_config_ok() 260void jcallback_config_ok()
@@ -266,7 +267,7 @@ void jcallback_config_ok()
266 if (err) 267 if (err)
267 _call_java(2, (int) "Error", (int)err, 1); 268 _call_java(2, (int) "Error", (int)err, 1);
268 else { 269 else {
269 fe->cfgret = TRUE; 270 fe->cfgret = true;
270 } 271 }
271} 272}
272 273
@@ -282,7 +283,7 @@ void jcallback_config_set_string(int item_ptr, int char_ptr) {
282void jcallback_config_set_boolean(int item_ptr, int selected) { 283void jcallback_config_set_boolean(int item_ptr, int selected) {
283 config_item *i = (config_item *)item_ptr; 284 config_item *i = (config_item *)item_ptr;
284 assert(i->type == C_BOOLEAN); 285 assert(i->type == C_BOOLEAN);
285 i->u.boolean.bval = selected != 0 ? TRUE : FALSE; 286 i->u.boolean.bval = selected != 0 ? true : false;
286} 287}
287 288
288void jcallback_config_set_choice(int item_ptr, int selected) { 289void jcallback_config_set_choice(int item_ptr, int selected) {
@@ -291,13 +292,13 @@ void jcallback_config_set_choice(int item_ptr, int selected) {
291 i->u.choices.selected = selected; 292 i->u.choices.selected = selected;
292} 293}
293 294
294static int get_config(frontend *fe, int which) 295static bool get_config(frontend *fe, int which)
295{ 296{
296 char *title; 297 char *title;
297 config_item *i; 298 config_item *i;
298 fe->cfg = midend_get_config(fe->me, which, &title); 299 fe->cfg = midend_get_config(fe->me, which, &title);
299 fe->cfg_which = which; 300 fe->cfg_which = which;
300 fe->cfgret = FALSE; 301 fe->cfgret = false;
301 _call_java(10, (int)title, 0, 0); 302 _call_java(10, (int)title, 0, 0);
302 for (i = fe->cfg; i->type != C_END; i++) { 303 for (i = fe->cfg; i->type != C_END; i++) {
303 _call_java(5, (int)i, i->type, (int)i->name); 304 _call_java(5, (int)i, i->type, (int)i->name);
@@ -357,7 +358,7 @@ static void resize_fe(frontend *fe)
357 358
358 x = INT_MAX; 359 x = INT_MAX;
359 y = INT_MAX; 360 y = INT_MAX;
360 midend_size(fe->me, &x, &y, FALSE); 361 midend_size(fe->me, &x, &y, false);
361 _call_java(3, x, y, 0); 362 _call_java(3, x, y, 0);
362} 363}
363 364
@@ -443,7 +444,7 @@ int main(int argc, char **argv)
443 float* colours; 444 float* colours;
444 445
445 _fe = snew(frontend); 446 _fe = snew(frontend);
446 _fe->timer_active = FALSE; 447 _fe->timer_active = false;
447 _fe->me = midend_new(_fe, &thegame, &nestedvm_drawing, _fe); 448 _fe->me = midend_new(_fe, &thegame, &nestedvm_drawing, _fe);
448 if (argc > 1) 449 if (argc > 1)
449 midend_game_id(_fe->me, argv[1]); /* ignore failure */ 450 midend_game_id(_fe->me, argv[1]); /* ignore failure */
diff --git a/apps/plugins/puzzles/src/net.c b/apps/plugins/puzzles/src/net.c
index 224263382f..36f8aca483 100644
--- a/apps/plugins/puzzles/src/net.c
+++ b/apps/plugins/puzzles/src/net.c
@@ -34,11 +34,11 @@
34#define D 0x08 34#define D 0x08
35#define LOCKED 0x10 35#define LOCKED 0x10
36#define ACTIVE 0x20 36#define ACTIVE 0x20
37#define RLOOP (R << 6) 37#define RERR (R << 6)
38#define ULOOP (U << 6) 38#define UERR (U << 6)
39#define LLOOP (L << 6) 39#define LERR (L << 6)
40#define DLOOP (D << 6) 40#define DERR (D << 6)
41#define LOOP(dir) ((dir) << 6) 41#define ERR(dir) ((dir) << 6)
42 42
43/* Rotations: Anticlockwise, Clockwise, Flip, general rotate */ 43/* Rotations: Anticlockwise, Clockwise, Flip, general rotate */
44#define A(x) ( (((x) & 0x07) << 1) | (((x) & 0x08) >> 3) ) 44#define A(x) ( (((x) & 0x07) << 1) | (((x) & 0x08) >> 3) )
@@ -76,15 +76,15 @@ enum {
76 COL_ENDPOINT, 76 COL_ENDPOINT,
77 COL_POWERED, 77 COL_POWERED,
78 COL_BARRIER, 78 COL_BARRIER,
79 COL_LOOP, 79 COL_ERR,
80 NCOLOURS 80 NCOLOURS
81}; 81};
82 82
83struct game_params { 83struct game_params {
84 int width; 84 int width;
85 int height; 85 int height;
86 int wrapping; 86 bool wrapping;
87 int unique; 87 bool unique;
88 float barrier_probability; 88 float barrier_probability;
89}; 89};
90 90
@@ -94,9 +94,10 @@ typedef struct game_immutable_state {
94} game_immutable_state; 94} game_immutable_state;
95 95
96struct game_state { 96struct game_state {
97 int width, height, wrapping, completed; 97 int width, height;
98 bool wrapping, completed;
98 int last_rotate_x, last_rotate_y, last_rotate_dir; 99 int last_rotate_x, last_rotate_y, last_rotate_dir;
99 int used_solve; 100 bool used_solve;
100 unsigned char *tiles; 101 unsigned char *tiles;
101 struct game_immutable_state *imm; 102 struct game_immutable_state *imm;
102}; 103};
@@ -154,37 +155,37 @@ static game_params *default_params(void)
154 155
155 ret->width = 5; 156 ret->width = 5;
156 ret->height = 5; 157 ret->height = 5;
157 ret->wrapping = FALSE; 158 ret->wrapping = false;
158 ret->unique = TRUE; 159 ret->unique = true;
159 ret->barrier_probability = 0.0; 160 ret->barrier_probability = 0.0;
160 161
161 return ret; 162 return ret;
162} 163}
163 164
164static const struct game_params net_presets[] = { 165static const struct game_params net_presets[] = {
165 {5, 5, FALSE, TRUE, 0.0}, 166 {5, 5, false, true, 0.0},
166 {7, 7, FALSE, TRUE, 0.0}, 167 {7, 7, false, true, 0.0},
167 {9, 9, FALSE, TRUE, 0.0}, 168 {9, 9, false, true, 0.0},
168 {11, 11, FALSE, TRUE, 0.0}, 169 {11, 11, false, true, 0.0},
169#ifndef SMALL_SCREEN 170#ifndef SMALL_SCREEN
170 {13, 11, FALSE, TRUE, 0.0}, 171 {13, 11, false, true, 0.0},
171#endif 172#endif
172 {5, 5, TRUE, TRUE, 0.0}, 173 {5, 5, true, true, 0.0},
173 {7, 7, TRUE, TRUE, 0.0}, 174 {7, 7, true, true, 0.0},
174 {9, 9, TRUE, TRUE, 0.0}, 175 {9, 9, true, true, 0.0},
175 {11, 11, TRUE, TRUE, 0.0}, 176 {11, 11, true, true, 0.0},
176#ifndef SMALL_SCREEN 177#ifndef SMALL_SCREEN
177 {13, 11, TRUE, TRUE, 0.0}, 178 {13, 11, true, true, 0.0},
178#endif 179#endif
179}; 180};
180 181
181static int game_fetch_preset(int i, char **name, game_params **params) 182static bool game_fetch_preset(int i, char **name, game_params **params)
182{ 183{
183 game_params *ret; 184 game_params *ret;
184 char str[80]; 185 char str[80];
185 186
186 if (i < 0 || i >= lenof(net_presets)) 187 if (i < 0 || i >= lenof(net_presets))
187 return FALSE; 188 return false;
188 189
189 ret = snew(game_params); 190 ret = snew(game_params);
190 *ret = net_presets[i]; 191 *ret = net_presets[i];
@@ -194,7 +195,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
194 195
195 *name = dupstr(str); 196 *name = dupstr(str);
196 *params = ret; 197 *params = ret;
197 return TRUE; 198 return true;
198} 199}
199 200
200static void free_params(game_params *params) 201static void free_params(game_params *params)
@@ -226,20 +227,20 @@ static void decode_params(game_params *ret, char const *string)
226 while (*p) { 227 while (*p) {
227 if (*p == 'w') { 228 if (*p == 'w') {
228 p++; 229 p++;
229 ret->wrapping = TRUE; 230 ret->wrapping = true;
230 } else if (*p == 'b') { 231 } else if (*p == 'b') {
231 p++; 232 p++;
232 ret->barrier_probability = (float)atof(p); 233 ret->barrier_probability = (float)atof(p);
233 while (*p && (*p == '.' || isdigit((unsigned char)*p))) p++; 234 while (*p && (*p == '.' || isdigit((unsigned char)*p))) p++;
234 } else if (*p == 'a') { 235 } else if (*p == 'a') {
235 p++; 236 p++;
236 ret->unique = FALSE; 237 ret->unique = false;
237 } else 238 } else
238 p++; /* skip any other gunk */ 239 p++; /* skip any other gunk */
239 } 240 }
240} 241}
241 242
242static char *encode_params(const game_params *params, int full) 243static char *encode_params(const game_params *params, bool full)
243{ 244{
244 char ret[400]; 245 char ret[400];
245 int len; 246 int len;
@@ -309,7 +310,7 @@ static game_params *custom_params(const config_item *cfg)
309 return ret; 310 return ret;
310} 311}
311 312
312static const char *validate_params(const game_params *params, int full) 313static const char *validate_params(const game_params *params, bool full)
313{ 314{
314 if (params->width <= 0 || params->height <= 0) 315 if (params->width <= 0 || params->height <= 0)
315 return "Width and height must both be greater than zero"; 316 return "Width and height must both be greater than zero";
@@ -399,7 +400,7 @@ static const char *validate_params(const game_params *params, int full)
399 */ 400 */
400 401
401struct todo { 402struct todo {
402 unsigned char *marked; 403 bool *marked;
403 int *buffer; 404 int *buffer;
404 int buflen; 405 int buflen;
405 int head, tail; 406 int head, tail;
@@ -408,7 +409,7 @@ struct todo {
408static struct todo *todo_new(int maxsize) 409static struct todo *todo_new(int maxsize)
409{ 410{
410 struct todo *todo = snew(struct todo); 411 struct todo *todo = snew(struct todo);
411 todo->marked = snewn(maxsize, unsigned char); 412 todo->marked = snewn(maxsize, bool);
412 memset(todo->marked, 0, maxsize); 413 memset(todo->marked, 0, maxsize);
413 todo->buflen = maxsize + 1; 414 todo->buflen = maxsize + 1;
414 todo->buffer = snewn(todo->buflen, int); 415 todo->buffer = snewn(todo->buflen, int);
@@ -427,7 +428,7 @@ static void todo_add(struct todo *todo, int index)
427{ 428{
428 if (todo->marked[index]) 429 if (todo->marked[index])
429 return; /* already on the list */ 430 return; /* already on the list */
430 todo->marked[index] = TRUE; 431 todo->marked[index] = true;
431 todo->buffer[todo->tail++] = index; 432 todo->buffer[todo->tail++] = index;
432 if (todo->tail == todo->buflen) 433 if (todo->tail == todo->buflen)
433 todo->tail = 0; 434 todo->tail = 0;
@@ -441,7 +442,7 @@ static int todo_get(struct todo *todo) {
441 ret = todo->buffer[todo->head++]; 442 ret = todo->buffer[todo->head++];
442 if (todo->head == todo->buflen) 443 if (todo->head == todo->buflen)
443 todo->head = 0; 444 todo->head = 0;
444 todo->marked[ret] = FALSE; 445 todo->marked[ret] = false;
445 446
446 return ret; 447 return ret;
447} 448}
@@ -452,7 +453,7 @@ static int todo_get(struct todo *todo) {
452 * fully. 453 * fully.
453 */ 454 */
454static int net_solver(int w, int h, unsigned char *tiles, 455static int net_solver(int w, int h, unsigned char *tiles,
455 unsigned char *barriers, int wrapping) 456 unsigned char *barriers, bool wrapping)
456{ 457{
457 unsigned char *tilestate; 458 unsigned char *tilestate;
458 unsigned char *edgestate; 459 unsigned char *edgestate;
@@ -461,7 +462,7 @@ static int net_solver(int w, int h, unsigned char *tiles,
461 struct todo *todo; 462 struct todo *todo;
462 int i, j, x, y; 463 int i, j, x, y;
463 int area; 464 int area;
464 int done_something; 465 bool done_something;
465 466
466 /* 467 /*
467 * Set up the solver's data structures. 468 * Set up the solver's data structures.
@@ -594,7 +595,7 @@ static int net_solver(int w, int h, unsigned char *tiles,
594 /* 595 /*
595 * Main deductive loop. 596 * Main deductive loop.
596 */ 597 */
597 done_something = TRUE; /* prevent instant termination! */ 598 done_something = true; /* prevent instant termination! */
598 while (1) { 599 while (1) {
599 int index; 600 int index;
600 601
@@ -608,8 +609,8 @@ static int net_solver(int w, int h, unsigned char *tiles,
608 * have no choice but to scan the whole grid for 609 * have no choice but to scan the whole grid for
609 * longer-range things we've missed. Hence, I now add 610 * longer-range things we've missed. Hence, I now add
610 * every square on the grid back on to the to-do list. 611 * every square on the grid back on to the to-do list.
611 * I also set `done_something' to FALSE at this point; 612 * I also set `done_something' to false at this point;
612 * if we later come back here and find it still FALSE, 613 * if we later come back here and find it still false,
613 * we will know we've scanned the entire grid without 614 * we will know we've scanned the entire grid without
614 * finding anything new to do, and we can terminate. 615 * finding anything new to do, and we can terminate.
615 */ 616 */
@@ -617,7 +618,7 @@ static int net_solver(int w, int h, unsigned char *tiles,
617 break; 618 break;
618 for (i = 0; i < w*h; i++) 619 for (i = 0; i < w*h; i++)
619 todo_add(todo, i); 620 todo_add(todo, i);
620 done_something = FALSE; 621 done_something = false;
621 622
622 index = todo_get(todo); 623 index = todo_get(todo);
623 } 624 }
@@ -631,12 +632,12 @@ static int net_solver(int w, int h, unsigned char *tiles,
631 deadendmax[1] = deadendmax[2] = deadendmax[4] = deadendmax[8] = 0; 632 deadendmax[1] = deadendmax[2] = deadendmax[4] = deadendmax[8] = 0;
632 633
633 for (i = j = 0; i < 4 && tilestate[(y*w+x) * 4 + i] != 255; i++) { 634 for (i = j = 0; i < 4 && tilestate[(y*w+x) * 4 + i] != 255; i++) {
634 int valid; 635 bool valid;
635 int nnondeadends, nondeadends[4], deadendtotal; 636 int nnondeadends, nondeadends[4], deadendtotal;
636 int nequiv, equiv[5]; 637 int nequiv, equiv[5];
637 int val = tilestate[(y*w+x) * 4 + i]; 638 int val = tilestate[(y*w+x) * 4 + i];
638 639
639 valid = TRUE; 640 valid = true;
640 nnondeadends = deadendtotal = 0; 641 nnondeadends = deadendtotal = 0;
641 equiv[0] = ourclass; 642 equiv[0] = ourclass;
642 nequiv = 1; 643 nequiv = 1;
@@ -647,7 +648,7 @@ static int net_solver(int w, int h, unsigned char *tiles,
647 */ 648 */
648 if ((edgestate[(y*w+x) * 5 + d] == 1 && !(val & d)) || 649 if ((edgestate[(y*w+x) * 5 + d] == 1 && !(val & d)) ||
649 (edgestate[(y*w+x) * 5 + d] == 2 && (val & d))) 650 (edgestate[(y*w+x) * 5 + d] == 2 && (val & d)))
650 valid = FALSE; 651 valid = false;
651 652
652 if (val & d) { 653 if (val & d) {
653 /* 654 /*
@@ -675,7 +676,7 @@ static int net_solver(int w, int h, unsigned char *tiles,
675 if (k == nequiv) 676 if (k == nequiv)
676 equiv[nequiv++] = c; 677 equiv[nequiv++] = c;
677 else 678 else
678 valid = FALSE; 679 valid = false;
679 } 680 }
680 } 681 }
681 } 682 }
@@ -692,7 +693,7 @@ static int net_solver(int w, int h, unsigned char *tiles,
692 * with a total area of 6, not 5.) 693 * with a total area of 6, not 5.)
693 */ 694 */
694 if (deadendtotal > 0 && deadendtotal+1 < area) 695 if (deadendtotal > 0 && deadendtotal+1 < area)
695 valid = FALSE; 696 valid = false;
696 } else if (nnondeadends == 1) { 697 } else if (nnondeadends == 1) {
697 /* 698 /*
698 * If this orientation links together one or 699 * If this orientation links together one or
@@ -732,7 +733,7 @@ static int net_solver(int w, int h, unsigned char *tiles,
732 } 733 }
733 734
734 if (j < i) { 735 if (j < i) {
735 done_something = TRUE; 736 done_something = true;
736 737
737 /* 738 /*
738 * We have ruled out at least one tile orientation. 739 * We have ruled out at least one tile orientation.
@@ -767,7 +768,7 @@ static int net_solver(int w, int h, unsigned char *tiles,
767 edgestate[(y*w+x) * 5 + d] = 1; 768 edgestate[(y*w+x) * 5 + d] = 1;
768 edgestate[(y2*w+x2) * 5 + d2] = 1; 769 edgestate[(y2*w+x2) * 5 + d2] = 1;
769 dsf_merge(equivalence, y*w+x, y2*w+x2); 770 dsf_merge(equivalence, y*w+x, y2*w+x2);
770 done_something = TRUE; 771 done_something = true;
771 todo_add(todo, y2*w+x2); 772 todo_add(todo, y2*w+x2);
772 } else if (!(o & d)) { 773 } else if (!(o & d)) {
773 /* This edge is closed in all orientations. */ 774 /* This edge is closed in all orientations. */
@@ -776,7 +777,7 @@ static int net_solver(int w, int h, unsigned char *tiles,
776#endif 777#endif
777 edgestate[(y*w+x) * 5 + d] = 2; 778 edgestate[(y*w+x) * 5 + d] = 2;
778 edgestate[(y2*w+x2) * 5 + d2] = 2; 779 edgestate[(y2*w+x2) * 5 + d2] = 2;
779 done_something = TRUE; 780 done_something = true;
780 todo_add(todo, y2*w+x2); 781 todo_add(todo, y2*w+x2);
781 } 782 }
782 } 783 }
@@ -798,7 +799,7 @@ static int net_solver(int w, int h, unsigned char *tiles,
798 x2, y2, d2, deadendmax[d]); 799 x2, y2, d2, deadendmax[d]);
799#endif 800#endif
800 deadends[(y2*w+x2) * 5 + d2] = deadendmax[d]; 801 deadends[(y2*w+x2) * 5 + d2] = deadendmax[d];
801 done_something = TRUE; 802 done_something = true;
802 todo_add(todo, y2*w+x2); 803 todo_add(todo, y2*w+x2);
803 } 804 }
804 } 805 }
@@ -840,7 +841,7 @@ static int net_solver(int w, int h, unsigned char *tiles,
840 * Function to randomly perturb an ambiguous section in a grid, to 841 * Function to randomly perturb an ambiguous section in a grid, to
841 * attempt to ensure unique solvability. 842 * attempt to ensure unique solvability.
842 */ 843 */
843static void perturb(int w, int h, unsigned char *tiles, int wrapping, 844static void perturb(int w, int h, unsigned char *tiles, bool wrapping,
844 random_state *rs, int startx, int starty, int startd) 845 random_state *rs, int startx, int starty, int startd)
845{ 846{
846 struct xyd *perimeter, *perim2, *loop[2], looppos[2]; 847 struct xyd *perimeter, *perim2, *loop[2], looppos[2];
@@ -1128,12 +1129,12 @@ static void perturb(int w, int h, unsigned char *tiles, int wrapping,
1128 sfree(perimeter); 1129 sfree(perimeter);
1129} 1130}
1130 1131
1131static int *compute_loops_inner(int w, int h, int wrapping, 1132static int *compute_loops_inner(int w, int h, bool wrapping,
1132 const unsigned char *tiles, 1133 const unsigned char *tiles,
1133 const unsigned char *barriers); 1134 const unsigned char *barriers);
1134 1135
1135static char *new_game_desc(const game_params *params, random_state *rs, 1136static char *new_game_desc(const game_params *params, random_state *rs,
1136 char **aux, int interactive) 1137 char **aux, bool interactive)
1137{ 1138{
1138 tree234 *possibilities, *barriertree; 1139 tree234 *possibilities, *barriertree;
1139 int w, h, x, y, cx, cy, nbarriers; 1140 int w, h, x, y, cx, cy, nbarriers;
@@ -1643,7 +1644,7 @@ static game_state *new_game(midend *me, const game_params *params,
1643 state->imm = snew(game_immutable_state); 1644 state->imm = snew(game_immutable_state);
1644 state->imm->refcount = 1; 1645 state->imm->refcount = 1;
1645 state->last_rotate_dir = state->last_rotate_x = state->last_rotate_y = 0; 1646 state->last_rotate_dir = state->last_rotate_x = state->last_rotate_y = 0;
1646 state->completed = state->used_solve = FALSE; 1647 state->completed = state->used_solve = false;
1647 state->tiles = snewn(state->width * state->height, unsigned char); 1648 state->tiles = snewn(state->width * state->height, unsigned char);
1648 memset(state->tiles, 0, state->width * state->height); 1649 memset(state->tiles, 0, state->width * state->height);
1649 state->imm->barriers = snewn(state->width * state->height, unsigned char); 1650 state->imm->barriers = snewn(state->width * state->height, unsigned char);
@@ -1699,15 +1700,15 @@ static game_state *new_game(midend *me, const game_params *params,
1699 * description of a non-wrapping game. This is so that we 1700 * description of a non-wrapping game. This is so that we
1700 * can change some aspects of the UI behaviour. 1701 * can change some aspects of the UI behaviour.
1701 */ 1702 */
1702 state->wrapping = FALSE; 1703 state->wrapping = false;
1703 for (x = 0; x < state->width; x++) 1704 for (x = 0; x < state->width; x++)
1704 if (!(barrier(state, x, 0) & U) || 1705 if (!(barrier(state, x, 0) & U) ||
1705 !(barrier(state, x, state->height-1) & D)) 1706 !(barrier(state, x, state->height-1) & D))
1706 state->wrapping = TRUE; 1707 state->wrapping = true;
1707 for (y = 0; y < state->height; y++) 1708 for (y = 0; y < state->height; y++)
1708 if (!(barrier(state, 0, y) & L) || 1709 if (!(barrier(state, 0, y) & L) ||
1709 !(barrier(state, state->width-1, y) & R)) 1710 !(barrier(state, state->width-1, y) & R))
1710 state->wrapping = TRUE; 1711 state->wrapping = true;
1711 } 1712 }
1712 1713
1713 return state; 1714 return state;
@@ -1847,9 +1848,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1847 return ret; 1848 return ret;
1848} 1849}
1849 1850
1850static int game_can_format_as_text_now(const game_params *params) 1851static bool game_can_format_as_text_now(const game_params *params)
1851{ 1852{
1852 return TRUE; 1853 return true;
1853} 1854}
1854 1855
1855static char *game_text_format(const game_state *state) 1856static char *game_text_format(const game_state *state)
@@ -1953,7 +1954,7 @@ static int net_neighbour(int vertex, void *vctx)
1953 return -1; 1954 return -1;
1954} 1955}
1955 1956
1956static int *compute_loops_inner(int w, int h, int wrapping, 1957static int *compute_loops_inner(int w, int h, bool wrapping,
1957 const unsigned char *tiles, 1958 const unsigned char *tiles,
1958 const unsigned char *barriers) 1959 const unsigned char *barriers)
1959{ 1960{
@@ -1982,7 +1983,7 @@ static int *compute_loops_inner(int w, int h, int wrapping,
1982 OFFSETWH(x1, y1, x, y, dir, w, h); 1983 OFFSETWH(x1, y1, x, y, dir, w, h);
1983 if ((tiles[y1*w+x1] & F(dir)) && 1984 if ((tiles[y1*w+x1] & F(dir)) &&
1984 findloop_is_loop_edge(fls, y*w+x, y1*w+x1)) 1985 findloop_is_loop_edge(fls, y*w+x, y1*w+x1))
1985 flags |= LOOP(dir); 1986 flags |= ERR(dir);
1986 } 1987 }
1987 } 1988 }
1988 loops[y*w+x] = flags; 1989 loops[y*w+x] = flags;
@@ -2003,10 +2004,11 @@ struct game_ui {
2003 int org_x, org_y; /* origin */ 2004 int org_x, org_y; /* origin */
2004 int cx, cy; /* source tile (game coordinates) */ 2005 int cx, cy; /* source tile (game coordinates) */
2005 int cur_x, cur_y; 2006 int cur_x, cur_y;
2006 int cur_visible; 2007 bool cur_visible;
2007 random_state *rs; /* used for jumbling */ 2008 random_state *rs; /* used for jumbling */
2008#ifdef USE_DRAGGING 2009#ifdef USE_DRAGGING
2009 int dragtilex, dragtiley, dragstartx, dragstarty, dragged; 2010 int dragtilex, dragtiley, dragstartx, dragstarty;
2011 bool dragged;
2010#endif 2012#endif
2011}; 2013};
2012 2014
@@ -2018,7 +2020,7 @@ static game_ui *new_ui(const game_state *state)
2018 ui->org_x = ui->org_y = 0; 2020 ui->org_x = ui->org_y = 0;
2019 ui->cur_x = ui->cx = state->width / 2; 2021 ui->cur_x = ui->cx = state->width / 2;
2020 ui->cur_y = ui->cy = state->height / 2; 2022 ui->cur_y = ui->cy = state->height / 2;
2021 ui->cur_visible = FALSE; 2023 ui->cur_visible = false;
2022 get_random_seed(&seed, &seedsize); 2024 get_random_seed(&seed, &seedsize);
2023 ui->rs = random_new(seed, seedsize); 2025 ui->rs = random_new(seed, seedsize);
2024 sfree(seed); 2026 sfree(seed);
@@ -2055,7 +2057,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
2055} 2057}
2056 2058
2057struct game_drawstate { 2059struct game_drawstate {
2058 int started; 2060 bool started;
2059 int width, height; 2061 int width, height;
2060 int tilesize; 2062 int tilesize;
2061 unsigned long *visible, *to_draw; 2063 unsigned long *visible, *to_draw;
@@ -2070,7 +2072,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2070{ 2072{
2071 char *nullret; 2073 char *nullret;
2072 int tx = -1, ty = -1, dir = 0; 2074 int tx = -1, ty = -1, dir = 0;
2073 int shift = button & MOD_SHFT, ctrl = button & MOD_CTRL; 2075 bool shift = button & MOD_SHFT, ctrl = button & MOD_CTRL;
2074 enum { 2076 enum {
2075 NONE, ROTATE_LEFT, ROTATE_180, ROTATE_RIGHT, TOGGLE_LOCK, JUMBLE, 2077 NONE, ROTATE_LEFT, ROTATE_180, ROTATE_RIGHT, TOGGLE_LOCK, JUMBLE,
2076 MOVE_ORIGIN, MOVE_SOURCE, MOVE_ORIGIN_AND_SOURCE, MOVE_CURSOR 2078 MOVE_ORIGIN, MOVE_SOURCE, MOVE_ORIGIN_AND_SOURCE, MOVE_CURSOR
@@ -2091,7 +2093,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2091 button == RIGHT_BUTTON) { 2093 button == RIGHT_BUTTON) {
2092 2094
2093 if (ui->cur_visible) { 2095 if (ui->cur_visible) {
2094 ui->cur_visible = FALSE; 2096 ui->cur_visible = false;
2095 nullret = UI_UPDATE; 2097 nullret = UI_UPDATE;
2096 } 2098 }
2097 2099
@@ -2136,7 +2138,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2136 ui->dragtiley = ty; 2138 ui->dragtiley = ty;
2137 ui->dragstartx = x % TILE_SIZE; 2139 ui->dragstartx = x % TILE_SIZE;
2138 ui->dragstarty = y % TILE_SIZE; 2140 ui->dragstarty = y % TILE_SIZE;
2139 ui->dragged = FALSE; 2141 ui->dragged = false;
2140 return nullret; /* no actual action */ 2142 return nullret; /* no actual action */
2141 } else if (button == LEFT_DRAG 2143 } else if (button == LEFT_DRAG
2142#ifndef STYLUS_BASED 2144#ifndef STYLUS_BASED
@@ -2179,17 +2181,17 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2179 action = ROTATE_180; 2181 action = ROTATE_180;
2180 ui->dragstartx = xF; 2182 ui->dragstartx = xF;
2181 ui->dragstarty = yF; 2183 ui->dragstarty = yF;
2182 ui->dragged = TRUE; 2184 ui->dragged = true;
2183 } else if (dA == dmin) { 2185 } else if (dA == dmin) {
2184 action = ROTATE_LEFT; 2186 action = ROTATE_LEFT;
2185 ui->dragstartx = xA; 2187 ui->dragstartx = xA;
2186 ui->dragstarty = yA; 2188 ui->dragstarty = yA;
2187 ui->dragged = TRUE; 2189 ui->dragged = true;
2188 } else /* dC == dmin */ { 2190 } else /* dC == dmin */ {
2189 action = ROTATE_RIGHT; 2191 action = ROTATE_RIGHT;
2190 ui->dragstartx = xC; 2192 ui->dragstartx = xC;
2191 ui->dragstarty = yC; 2193 ui->dragstarty = yC;
2192 ui->dragged = TRUE; 2194 ui->dragged = true;
2193 } 2195 }
2194 } else if (button == LEFT_RELEASE 2196 } else if (button == LEFT_RELEASE
2195#ifndef STYLUS_BASED 2197#ifndef STYLUS_BASED
@@ -2245,7 +2247,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2245 action = ROTATE_RIGHT; 2247 action = ROTATE_RIGHT;
2246 else if (button == 'f' || button == 'F') 2248 else if (button == 'f' || button == 'F')
2247 action = ROTATE_180; 2249 action = ROTATE_180;
2248 ui->cur_visible = TRUE; 2250 ui->cur_visible = true;
2249 } else if (button == 'j' || button == 'J') { 2251 } else if (button == 'j' || button == 'J') {
2250 /* XXX should we have some mouse control for this? */ 2252 /* XXX should we have some mouse control for this? */
2251 action = JUMBLE; 2253 action = JUMBLE;
@@ -2330,7 +2332,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2330 } 2332 }
2331 if (action == MOVE_CURSOR) { 2333 if (action == MOVE_CURSOR) {
2332 OFFSET(ui->cur_x, ui->cur_y, ui->cur_x, ui->cur_y, dir, state); 2334 OFFSET(ui->cur_x, ui->cur_y, ui->cur_x, ui->cur_y, dir, state);
2333 ui->cur_visible = TRUE; 2335 ui->cur_visible = true;
2334 } 2336 }
2335 return UI_UPDATE; 2337 return UI_UPDATE;
2336 } else { 2338 } else {
@@ -2341,20 +2343,21 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2341static game_state *execute_move(const game_state *from, const char *move) 2343static game_state *execute_move(const game_state *from, const char *move)
2342{ 2344{
2343 game_state *ret; 2345 game_state *ret;
2344 int tx = -1, ty = -1, n, noanim, orig; 2346 int tx = -1, ty = -1, n, orig;
2347 bool noanim;
2345 2348
2346 ret = dup_game(from); 2349 ret = dup_game(from);
2347 2350
2348 if (move[0] == 'J' || move[0] == 'S') { 2351 if (move[0] == 'J' || move[0] == 'S') {
2349 if (move[0] == 'S') 2352 if (move[0] == 'S')
2350 ret->used_solve = TRUE; 2353 ret->used_solve = true;
2351 2354
2352 move++; 2355 move++;
2353 if (*move == ';') 2356 if (*move == ';')
2354 move++; 2357 move++;
2355 noanim = TRUE; 2358 noanim = true;
2356 } else 2359 } else
2357 noanim = FALSE; 2360 noanim = false;
2358 2361
2359 ret->last_rotate_dir = 0; /* suppress animation */ 2362 ret->last_rotate_dir = 0; /* suppress animation */
2360 ret->last_rotate_x = ret->last_rotate_y = 0; 2363 ret->last_rotate_x = ret->last_rotate_y = 0;
@@ -2406,7 +2409,7 @@ static game_state *execute_move(const game_state *from, const char *move)
2406 { 2409 {
2407 unsigned char *active; 2410 unsigned char *active;
2408 int pos; 2411 int pos;
2409 int complete = TRUE; 2412 bool complete = true;
2410 2413
2411 for (pos = 0; pos < ret->width * ret->height; pos++) 2414 for (pos = 0; pos < ret->width * ret->height; pos++)
2412 if (ret->tiles[pos] & 0xF) 2415 if (ret->tiles[pos] & 0xF)
@@ -2417,7 +2420,7 @@ static game_state *execute_move(const game_state *from, const char *move)
2417 2420
2418 for (pos = 0; pos < ret->width * ret->height; pos++) 2421 for (pos = 0; pos < ret->width * ret->height; pos++)
2419 if ((ret->tiles[pos] & 0xF) && !active[pos]) { 2422 if ((ret->tiles[pos] & 0xF) && !active[pos]) {
2420 complete = FALSE; 2423 complete = false;
2421 break; 2424 break;
2422 } 2425 }
2423 2426
@@ -2425,7 +2428,7 @@ static game_state *execute_move(const game_state *from, const char *move)
2425 } 2428 }
2426 2429
2427 if (complete) 2430 if (complete)
2428 ret->completed = TRUE; 2431 ret->completed = true;
2429 } 2432 }
2430 2433
2431 return ret; 2434 return ret;
@@ -2441,7 +2444,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
2441 game_drawstate *ds = snew(game_drawstate); 2444 game_drawstate *ds = snew(game_drawstate);
2442 int i, ncells; 2445 int i, ncells;
2443 2446
2444 ds->started = FALSE; 2447 ds->started = false;
2445 ds->width = state->width; 2448 ds->width = state->width;
2446 ds->height = state->height; 2449 ds->height = state->height;
2447 ncells = (state->width+2) * (state->height+2); 2450 ncells = (state->width+2) * (state->height+2);
@@ -2516,11 +2519,11 @@ static float *game_colours(frontend *fe, int *ncolours)
2516 ret[COL_BARRIER * 3 + 2] = 0.0F; 2519 ret[COL_BARRIER * 3 + 2] = 0.0F;
2517 2520
2518 /* 2521 /*
2519 * Highlighted loops are red as well. 2522 * Highlighted errors are red as well.
2520 */ 2523 */
2521 ret[COL_LOOP * 3 + 0] = 1.0F; 2524 ret[COL_ERR * 3 + 0] = 1.0F;
2522 ret[COL_LOOP * 3 + 1] = 0.0F; 2525 ret[COL_ERR * 3 + 1] = 0.0F;
2523 ret[COL_LOOP * 3 + 2] = 0.0F; 2526 ret[COL_ERR * 3 + 2] = 0.0F;
2524 2527
2525 /* 2528 /*
2526 * Unpowered endpoints are blue. 2529 * Unpowered endpoints are blue.
@@ -2559,7 +2562,7 @@ static void rotated_coords(float *ox, float *oy, const float matrix[4],
2559#define TILE_KEYBOARD_CURSOR (1<<8) /* 1 bit if cursor is here */ 2562#define TILE_KEYBOARD_CURSOR (1<<8) /* 1 bit if cursor is here */
2560#define TILE_WIRE_SHIFT 9 /* 8 bits: RR UU LL DD 2563#define TILE_WIRE_SHIFT 9 /* 8 bits: RR UU LL DD
2561 * Each pair: 0=no wire, 1=unpowered, 2564 * Each pair: 0=no wire, 1=unpowered,
2562 * 2=powered, 3=loop err highlight */ 2565 * 2=powered, 3=error highlight */
2563#define TILE_ENDPOINT_SHIFT 17 /* 2 bits: 0=no endpoint, 1=unpowered, 2566#define TILE_ENDPOINT_SHIFT 17 /* 2 bits: 0=no endpoint, 1=unpowered,
2564 * 2=powered, 3=power-source square */ 2567 * 2=powered, 3=power-source square */
2565#define TILE_WIRE_ON_EDGE_SHIFT 19 /* 8 bits: RR UU LL DD, 2568#define TILE_WIRE_ON_EDGE_SHIFT 19 /* 8 bits: RR UU LL DD,
@@ -2574,7 +2577,7 @@ static void draw_wires(drawing *dr, int cx, int cy, int radius,
2574 float fpoints[12*2]; 2577 float fpoints[12*2];
2575 int points[12*2]; 2578 int points[12*2];
2576 int npoints, d, dsh, i; 2579 int npoints, d, dsh, i;
2577 int any_wire_this_colour = FALSE; 2580 bool any_wire_this_colour = false;
2578 float xf, yf; 2581 float xf, yf;
2579 2582
2580 npoints = 0; 2583 npoints = 0;
@@ -2593,7 +2596,7 @@ static void draw_wires(drawing *dr, int cx, int cy, int radius,
2593 fpoints[2*npoints+1] = radius * Y(d) + halfwidth * Y(A(d)); 2596 fpoints[2*npoints+1] = radius * Y(d) + halfwidth * Y(A(d));
2594 npoints++; 2597 npoints++;
2595 2598
2596 any_wire_this_colour = TRUE; 2599 any_wire_this_colour = true;
2597 } 2600 }
2598 } 2601 }
2599 2602
@@ -2708,7 +2711,7 @@ static void draw_tile(drawing *dr, game_drawstate *ds, int x, int y,
2708 for (pass = 0; pass < 2; pass++) { 2711 for (pass = 0; pass < 2; pass++) {
2709 int x, y, w, h; 2712 int x, y, w, h;
2710 int col = (pass == 0 || edgetype == 1 ? COL_WIRE : 2713 int col = (pass == 0 || edgetype == 1 ? COL_WIRE :
2711 edgetype == 2 ? COL_POWERED : COL_LOOP); 2714 edgetype == 2 ? COL_POWERED : COL_ERR);
2712 int halfwidth = pass == 0 ? 2*LINE_THICK-1 : LINE_THICK-1; 2715 int halfwidth = pass == 0 ? 2*LINE_THICK-1 : LINE_THICK-1;
2713 2716
2714 if (X(d) < 0) { 2717 if (X(d) < 0) {
@@ -2760,7 +2763,7 @@ static void draw_tile(drawing *dr, game_drawstate *ds, int x, int y,
2760 draw_wires(dr, cx, cy, radius, tile, 2763 draw_wires(dr, cx, cy, radius, tile,
2761 0x4, COL_POWERED, LINE_THICK-1, matrix); 2764 0x4, COL_POWERED, LINE_THICK-1, matrix);
2762 draw_wires(dr, cx, cy, radius, tile, 2765 draw_wires(dr, cx, cy, radius, tile,
2763 0x8, COL_LOOP, LINE_THICK-1, matrix); 2766 0x8, COL_ERR, LINE_THICK-1, matrix);
2764 2767
2765 /* 2768 /*
2766 * Draw the central box. 2769 * Draw the central box.
@@ -2845,7 +2848,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2845 int w, h; 2848 int w, h;
2846 game_params params; 2849 game_params params;
2847 2850
2848 ds->started = TRUE; 2851 ds->started = true;
2849 2852
2850 params.width = ds->width; 2853 params.width = ds->width;
2851 params.height = ds->height; 2854 params.height = ds->height;
@@ -2918,7 +2921,25 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2918 } 2921 }
2919 2922
2920 if (t & d) { 2923 if (t & d) {
2921 int edgeval = (t & LOOP(d) ? 3 : t & ACTIVE ? 2 : 1); 2924 int edgeval;
2925
2926 /* Highlight as an error any edge in a locked tile that
2927 * is adjacent to a lack-of-edge in another locked tile,
2928 * or to a barrier */
2929 if (t & LOCKED) {
2930 if (barrier(state, gx, gy) & d) {
2931 t |= ERR(d);
2932 } else {
2933 int ox, oy, t2;
2934 OFFSET(ox, oy, gx, gy, d, state);
2935 t2 = tile(state, ox, oy);
2936 if ((t2 & LOCKED) && !(t2 & F(d))) {
2937 t |= ERR(d);
2938 }
2939 }
2940 }
2941
2942 edgeval = (t & ERR(d) ? 3 : t & ACTIVE ? 2 : 1);
2922 todraw(ds, dx, dy) |= edgeval << (TILE_WIRE_SHIFT + dsh*2); 2943 todraw(ds, dx, dy) |= edgeval << (TILE_WIRE_SHIFT + dsh*2);
2923 if (!(gx == tx && gy == ty)) { 2944 if (!(gx == tx && gy == ty)) {
2924 todraw(ds, dx + X(d), dy + Y(d)) |= 2945 todraw(ds, dx + X(d), dy + Y(d)) |=
@@ -2990,17 +3011,17 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2990 { 3011 {
2991 char statusbuf[256], *p; 3012 char statusbuf[256], *p;
2992 int i, n, n2, a; 3013 int i, n, n2, a;
2993 int complete = FALSE; 3014 bool complete = false;
2994 3015
2995 p = statusbuf; 3016 p = statusbuf;
2996 *p = '\0'; /* ensure even an empty status string is terminated */ 3017 *p = '\0'; /* ensure even an empty status string is terminated */
2997 3018
2998 if (state->used_solve) { 3019 if (state->used_solve) {
2999 p += sprintf(p, "Auto-solved. "); 3020 p += sprintf(p, "Auto-solved. ");
3000 complete = TRUE; 3021 complete = true;
3001 } else if (state->completed) { 3022 } else if (state->completed) {
3002 p += sprintf(p, "COMPLETED! "); 3023 p += sprintf(p, "COMPLETED! ");
3003 complete = TRUE; 3024 complete = true;
3004 } 3025 }
3005 3026
3006 /* 3027 /*
@@ -3074,9 +3095,9 @@ static int game_status(const game_state *state)
3074 return state->completed ? +1 : 0; 3095 return state->completed ? +1 : 0;
3075} 3096}
3076 3097
3077static int game_timing_state(const game_state *state, game_ui *ui) 3098static bool game_timing_state(const game_state *state, game_ui *ui)
3078{ 3099{
3079 return TRUE; 3100 return true;
3080} 3101}
3081 3102
3082static void game_print_size(const game_params *params, float *x, float *y) 3103static void game_print_size(const game_params *params, float *x, float *y)
@@ -3092,7 +3113,7 @@ static void game_print_size(const game_params *params, float *x, float *y)
3092} 3113}
3093 3114
3094static void draw_diagram(drawing *dr, game_drawstate *ds, int x, int y, 3115static void draw_diagram(drawing *dr, game_drawstate *ds, int x, int y,
3095 int topleft, int v, int drawlines, int ink) 3116 bool topleft, int v, bool drawlines, int ink)
3096{ 3117{
3097 int tx, ty, cx, cy, r, br, k, thick; 3118 int tx, ty, cx, cy, r, br, k, thick;
3098 3119
@@ -3205,12 +3226,12 @@ static void game_print(drawing *dr, const game_state *state, int tilesize)
3205 /* 3226 /*
3206 * Draw the top left corner diagram. 3227 * Draw the top left corner diagram.
3207 */ 3228 */
3208 draw_diagram(dr, ds, x, y, TRUE, vx, TRUE, ink); 3229 draw_diagram(dr, ds, x, y, true, vx, true, ink);
3209 3230
3210 /* 3231 /*
3211 * Draw the real solution diagram, if we're doing so. 3232 * Draw the real solution diagram, if we're doing so.
3212 */ 3233 */
3213 draw_diagram(dr, ds, x, y, FALSE, v, locked, ink); 3234 draw_diagram(dr, ds, x, y, false, v, locked, ink);
3214 } 3235 }
3215} 3236}
3216 3237
@@ -3226,15 +3247,15 @@ const struct game thegame = {
3226 encode_params, 3247 encode_params,
3227 free_params, 3248 free_params,
3228 dup_params, 3249 dup_params,
3229 TRUE, game_configure, custom_params, 3250 true, game_configure, custom_params,
3230 validate_params, 3251 validate_params,
3231 new_game_desc, 3252 new_game_desc,
3232 validate_desc, 3253 validate_desc,
3233 new_game, 3254 new_game,
3234 dup_game, 3255 dup_game,
3235 free_game, 3256 free_game,
3236 TRUE, solve_game, 3257 true, solve_game,
3237 FALSE, game_can_format_as_text_now, game_text_format, 3258 false, game_can_format_as_text_now, game_text_format,
3238 new_ui, 3259 new_ui,
3239 free_ui, 3260 free_ui,
3240 encode_ui, 3261 encode_ui,
@@ -3251,8 +3272,8 @@ const struct game thegame = {
3251 game_anim_length, 3272 game_anim_length,
3252 game_flash_length, 3273 game_flash_length,
3253 game_status, 3274 game_status,
3254 TRUE, FALSE, game_print_size, game_print, 3275 true, false, game_print_size, game_print,
3255 TRUE, /* wants_statusbar */ 3276 true, /* wants_statusbar */
3256 FALSE, game_timing_state, 3277 false, game_timing_state,
3257 0, /* flags */ 3278 0, /* flags */
3258}; 3279};
diff --git a/apps/plugins/puzzles/src/netslide.c b/apps/plugins/puzzles/src/netslide.c
index af4ef7d81f..727ff0a910 100644
--- a/apps/plugins/puzzles/src/netslide.c
+++ b/apps/plugins/puzzles/src/netslide.c
@@ -77,14 +77,14 @@ enum {
77struct game_params { 77struct game_params {
78 int width; 78 int width;
79 int height; 79 int height;
80 int wrapping; 80 bool wrapping;
81 float barrier_probability; 81 float barrier_probability;
82 int movetarget; 82 int movetarget;
83}; 83};
84 84
85struct game_state { 85struct game_state {
86 int width, height, cx, cy, wrapping, completed; 86 int width, height, cx, cy, completed;
87 int used_solve; 87 bool wrapping, used_solve;
88 int move_count, movetarget; 88 int move_count, movetarget;
89 89
90 /* position (row or col number, starting at 0) of last move. */ 90 /* position (row or col number, starting at 0) of last move. */
@@ -150,7 +150,7 @@ static game_params *default_params(void)
150 150
151 ret->width = 3; 151 ret->width = 3;
152 ret->height = 3; 152 ret->height = 3;
153 ret->wrapping = FALSE; 153 ret->wrapping = false;
154 ret->barrier_probability = 1.0; 154 ret->barrier_probability = 1.0;
155 ret->movetarget = 0; 155 ret->movetarget = 0;
156 156
@@ -159,24 +159,24 @@ static game_params *default_params(void)
159 159
160static const struct { int x, y, wrap, bprob; const char* desc; } 160static const struct { int x, y, wrap, bprob; const char* desc; }
161netslide_presets[] = { 161netslide_presets[] = {
162 {3, 3, FALSE, 1, " easy"}, 162 {3, 3, false, 1, " easy"},
163 {3, 3, FALSE, 0, " medium"}, 163 {3, 3, false, 0, " medium"},
164 {3, 3, TRUE, 0, " hard"}, 164 {3, 3, true, 0, " hard"},
165 {4, 4, FALSE, 1, " easy"}, 165 {4, 4, false, 1, " easy"},
166 {4, 4, FALSE, 0, " medium"}, 166 {4, 4, false, 0, " medium"},
167 {4, 4, TRUE, 0, " hard"}, 167 {4, 4, true, 0, " hard"},
168 {5, 5, FALSE, 1, " easy"}, 168 {5, 5, false, 1, " easy"},
169 {5, 5, FALSE, 0, " medium"}, 169 {5, 5, false, 0, " medium"},
170 {5, 5, TRUE, 0, " hard"}, 170 {5, 5, true, 0, " hard"},
171}; 171};
172 172
173static int game_fetch_preset(int i, char **name, game_params **params) 173static bool game_fetch_preset(int i, char **name, game_params **params)
174{ 174{
175 game_params *ret; 175 game_params *ret;
176 char str[80]; 176 char str[80];
177 177
178 if (i < 0 || i >= lenof(netslide_presets)) 178 if (i < 0 || i >= lenof(netslide_presets))
179 return FALSE; 179 return false;
180 180
181 ret = snew(game_params); 181 ret = snew(game_params);
182 ret->width = netslide_presets[i].x; 182 ret->width = netslide_presets[i].x;
@@ -189,7 +189,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
189 189
190 *name = dupstr(str); 190 *name = dupstr(str);
191 *params = ret; 191 *params = ret;
192 return TRUE; 192 return true;
193} 193}
194 194
195static void free_params(game_params *params) 195static void free_params(game_params *params)
@@ -208,7 +208,7 @@ static void decode_params(game_params *ret, char const *string)
208{ 208{
209 char const *p = string; 209 char const *p = string;
210 210
211 ret->wrapping = FALSE; 211 ret->wrapping = false;
212 ret->barrier_probability = 0.0; 212 ret->barrier_probability = 0.0;
213 ret->movetarget = 0; 213 ret->movetarget = 0;
214 214
@@ -218,7 +218,8 @@ static void decode_params(game_params *ret, char const *string)
218 p++; 218 p++;
219 ret->height = atoi(p); 219 ret->height = atoi(p);
220 while (*p && isdigit((unsigned char)*p)) p++; 220 while (*p && isdigit((unsigned char)*p)) p++;
221 if ( (ret->wrapping = (*p == 'w')) != 0 ) 221 ret->wrapping = (*p == 'w');
222 if (ret->wrapping)
222 p++; 223 p++;
223 if (*p == 'b') { 224 if (*p == 'b') {
224 ret->barrier_probability = (float)atof(++p); 225 ret->barrier_probability = (float)atof(++p);
@@ -232,7 +233,7 @@ static void decode_params(game_params *ret, char const *string)
232 } 233 }
233} 234}
234 235
235static char *encode_params(const game_params *params, int full) 236static char *encode_params(const game_params *params, bool full)
236{ 237{
237 char ret[400]; 238 char ret[400];
238 int len; 239 int len;
@@ -305,7 +306,7 @@ static game_params *custom_params(const config_item *cfg)
305 return ret; 306 return ret;
306} 307}
307 308
308static const char *validate_params(const game_params *params, int full) 309static const char *validate_params(const game_params *params, bool full)
309{ 310{
310 if (params->width <= 1 || params->height <= 1) 311 if (params->width <= 1 || params->height <= 1)
311 return "Width and height must both be greater than one"; 312 return "Width and height must both be greater than one";
@@ -323,7 +324,7 @@ static const char *validate_params(const game_params *params, int full)
323 */ 324 */
324 325
325static char *new_game_desc(const game_params *params, random_state *rs, 326static char *new_game_desc(const game_params *params, random_state *rs,
326 char **aux, int interactive) 327 char **aux, bool interactive)
327{ 328{
328 tree234 *possibilities, *barriertree; 329 tree234 *possibilities, *barriertree;
329 int w, h, x, y, cx, cy, nbarriers; 330 int w, h, x, y, cx, cy, nbarriers;
@@ -744,7 +745,7 @@ static game_state *new_game(midend *me, const game_params *params,
744 state->wrapping = params->wrapping; 745 state->wrapping = params->wrapping;
745 state->movetarget = params->movetarget; 746 state->movetarget = params->movetarget;
746 state->completed = 0; 747 state->completed = 0;
747 state->used_solve = FALSE; 748 state->used_solve = false;
748 state->move_count = 0; 749 state->move_count = 0;
749 state->last_move_row = -1; 750 state->last_move_row = -1;
750 state->last_move_col = -1; 751 state->last_move_col = -1;
@@ -811,25 +812,25 @@ static game_state *new_game(midend *me, const game_params *params,
811 for (dir = 1; dir < 0x10; dir <<= 1) { 812 for (dir = 1; dir < 0x10; dir <<= 1) {
812 int dir2 = A(dir); 813 int dir2 = A(dir);
813 int x1, y1, x2, y2, x3, y3; 814 int x1, y1, x2, y2, x3, y3;
814 int corner = FALSE; 815 bool corner = false;
815 816
816 if (!(barrier(state, x, y) & dir)) 817 if (!(barrier(state, x, y) & dir))
817 continue; 818 continue;
818 819
819 if (barrier(state, x, y) & dir2) 820 if (barrier(state, x, y) & dir2)
820 corner = TRUE; 821 corner = true;
821 822
822 x1 = x + X(dir), y1 = y + Y(dir); 823 x1 = x + X(dir), y1 = y + Y(dir);
823 if (x1 >= 0 && x1 < state->width && 824 if (x1 >= 0 && x1 < state->width &&
824 y1 >= 0 && y1 < state->height && 825 y1 >= 0 && y1 < state->height &&
825 (barrier(state, x1, y1) & dir2)) 826 (barrier(state, x1, y1) & dir2))
826 corner = TRUE; 827 corner = true;
827 828
828 x2 = x + X(dir2), y2 = y + Y(dir2); 829 x2 = x + X(dir2), y2 = y + Y(dir2);
829 if (x2 >= 0 && x2 < state->width && 830 if (x2 >= 0 && x2 < state->width &&
830 y2 >= 0 && y2 < state->height && 831 y2 >= 0 && y2 < state->height &&
831 (barrier(state, x2, y2) & dir)) 832 (barrier(state, x2, y2) & dir))
832 corner = TRUE; 833 corner = true;
833 834
834 if (corner) { 835 if (corner) {
835 barrier(state, x, y) |= (dir << 4); 836 barrier(state, x, y) |= (dir << 4);
@@ -894,9 +895,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
894 return dupstr(aux); 895 return dupstr(aux);
895} 896}
896 897
897static int game_can_format_as_text_now(const game_params *params) 898static bool game_can_format_as_text_now(const game_params *params)
898{ 899{
899 return TRUE; 900 return true;
900} 901}
901 902
902static char *game_text_format(const game_state *state) 903static char *game_text_format(const game_state *state)
@@ -972,7 +973,7 @@ static unsigned char *compute_active(const game_state *state,
972 973
973struct game_ui { 974struct game_ui {
974 int cur_x, cur_y; 975 int cur_x, cur_y;
975 int cur_visible; 976 bool cur_visible;
976}; 977};
977 978
978static game_ui *new_ui(const game_state *state) 979static game_ui *new_ui(const game_state *state)
@@ -980,7 +981,7 @@ static game_ui *new_ui(const game_state *state)
980 game_ui *ui = snew(game_ui); 981 game_ui *ui = snew(game_ui);
981 ui->cur_x = 0; 982 ui->cur_x = 0;
982 ui->cur_y = -1; 983 ui->cur_y = -1;
983 ui->cur_visible = FALSE; 984 ui->cur_visible = false;
984 985
985 return ui; 986 return ui;
986} 987}
@@ -1047,7 +1048,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1047} 1048}
1048 1049
1049struct game_drawstate { 1050struct game_drawstate {
1050 int started; 1051 bool started;
1051 int width, height; 1052 int width, height;
1052 int tilesize; 1053 int tilesize;
1053 unsigned char *visible; 1054 unsigned char *visible;
@@ -1076,21 +1077,21 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1076 } while (ui->cur_x == state->cx || ui->cur_y == state->cy); 1077 } while (ui->cur_x == state->cx || ui->cur_y == state->cy);
1077 } 1078 }
1078 1079
1079 ui->cur_visible = 1; 1080 ui->cur_visible = true;
1080 return UI_UPDATE; 1081 return UI_UPDATE;
1081 } 1082 }
1082 1083
1083 if (button == LEFT_BUTTON || button == RIGHT_BUTTON) { 1084 if (button == LEFT_BUTTON || button == RIGHT_BUTTON) {
1084 cx = (x - (BORDER + WINDOW_OFFSET + TILE_BORDER) + 2*TILE_SIZE) / TILE_SIZE - 2; 1085 cx = (x - (BORDER + WINDOW_OFFSET + TILE_BORDER) + 2*TILE_SIZE) / TILE_SIZE - 2;
1085 cy = (y - (BORDER + WINDOW_OFFSET + TILE_BORDER) + 2*TILE_SIZE) / TILE_SIZE - 2; 1086 cy = (y - (BORDER + WINDOW_OFFSET + TILE_BORDER) + 2*TILE_SIZE) / TILE_SIZE - 2;
1086 ui->cur_visible = 0; 1087 ui->cur_visible = false;
1087 } else if (IS_CURSOR_SELECT(button)) { 1088 } else if (IS_CURSOR_SELECT(button)) {
1088 if (ui->cur_visible) { 1089 if (ui->cur_visible) {
1089 cx = ui->cur_x; 1090 cx = ui->cur_x;
1090 cy = ui->cur_y; 1091 cy = ui->cur_y;
1091 } else { 1092 } else {
1092 /* 'click' when cursor is invisible just makes cursor visible. */ 1093 /* 'click' when cursor is invisible just makes cursor visible. */
1093 ui->cur_visible = 1; 1094 ui->cur_visible = true;
1094 return UI_UPDATE; 1095 return UI_UPDATE;
1095 } 1096 }
1096 } else 1097 } else
@@ -1130,7 +1131,8 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1130static game_state *execute_move(const game_state *from, const char *move) 1131static game_state *execute_move(const game_state *from, const char *move)
1131{ 1132{
1132 game_state *ret; 1133 game_state *ret;
1133 int c, d, col; 1134 int c, d;
1135 bool col;
1134 1136
1135 if ((move[0] == 'C' || move[0] == 'R') && 1137 if ((move[0] == 'C' || move[0] == 'R') &&
1136 sscanf(move+1, "%d,%d", &c, &d) == 2 && 1138 sscanf(move+1, "%d,%d", &c, &d) == 2 &&
@@ -1140,7 +1142,7 @@ static game_state *execute_move(const game_state *from, const char *move)
1140 strlen(move) == from->width * from->height + 1) { 1142 strlen(move) == from->width * from->height + 1) {
1141 int i; 1143 int i;
1142 ret = dup_game(from); 1144 ret = dup_game(from);
1143 ret->used_solve = TRUE; 1145 ret->used_solve = true;
1144 ret->completed = ret->move_count = 1; 1146 ret->completed = ret->move_count = 1;
1145 1147
1146 for (i = 0; i < from->width * from->height; i++) { 1148 for (i = 0; i < from->width * from->height; i++) {
@@ -1179,12 +1181,12 @@ static game_state *execute_move(const game_state *from, const char *move)
1179 if (!ret->completed) { 1181 if (!ret->completed) {
1180 unsigned char *active = compute_active(ret, -1, -1); 1182 unsigned char *active = compute_active(ret, -1, -1);
1181 int x1, y1; 1183 int x1, y1;
1182 int complete = TRUE; 1184 bool complete = true;
1183 1185
1184 for (x1 = 0; x1 < ret->width; x1++) 1186 for (x1 = 0; x1 < ret->width; x1++)
1185 for (y1 = 0; y1 < ret->height; y1++) 1187 for (y1 = 0; y1 < ret->height; y1++)
1186 if (!index(ret, active, x1, y1)) { 1188 if (!index(ret, active, x1, y1)) {
1187 complete = FALSE; 1189 complete = false;
1188 goto break_label; /* break out of two loops at once */ 1190 goto break_label; /* break out of two loops at once */
1189 } 1191 }
1190 break_label: 1192 break_label:
@@ -1206,7 +1208,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1206{ 1208{
1207 game_drawstate *ds = snew(game_drawstate); 1209 game_drawstate *ds = snew(game_drawstate);
1208 1210
1209 ds->started = FALSE; 1211 ds->started = false;
1210 ds->width = state->width; 1212 ds->width = state->width;
1211 ds->height = state->height; 1213 ds->height = state->height;
1212 ds->visible = snewn(state->width * state->height, unsigned char); 1214 ds->visible = snewn(state->width * state->height, unsigned char);
@@ -1535,7 +1537,7 @@ static void draw_tile_barriers(drawing *dr, game_drawstate *ds,
1535} 1537}
1536 1538
1537static void draw_arrow(drawing *dr, game_drawstate *ds, 1539static void draw_arrow(drawing *dr, game_drawstate *ds,
1538 int x, int y, int xdx, int xdy, int cur) 1540 int x, int y, int xdx, int xdy, bool cur)
1539{ 1541{
1540 int coords[14]; 1542 int coords[14];
1541 int ydy = -xdx, ydx = xdy; 1543 int ydy = -xdx, ydx = xdy;
@@ -1559,7 +1561,7 @@ static void draw_arrow(drawing *dr, game_drawstate *ds,
1559} 1561}
1560 1562
1561static void draw_arrow_for_cursor(drawing *dr, game_drawstate *ds, 1563static void draw_arrow_for_cursor(drawing *dr, game_drawstate *ds,
1562 int cur_x, int cur_y, int cur) 1564 int cur_x, int cur_y, bool cur)
1563{ 1565{
1564 if (cur_x == -1 && cur_y == -1) 1566 if (cur_x == -1 && cur_y == -1)
1565 return; /* 'no cursur here */ 1567 return; /* 'no cursur here */
@@ -1598,7 +1600,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1598 if (!ds->started) { 1600 if (!ds->started) {
1599 int phase; 1601 int phase;
1600 1602
1601 ds->started = TRUE; 1603 ds->started = true;
1602 1604
1603 draw_rect(dr, 0, 0, 1605 draw_rect(dr, 0, 0,
1604 BORDER * 2 + WINDOW_OFFSET * 2 + TILE_SIZE * state->width + TILE_BORDER, 1606 BORDER * 2 + WINDOW_OFFSET * 2 + TILE_SIZE * state->width + TILE_BORDER,
@@ -1646,13 +1648,13 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1646 */ 1648 */
1647 for (x = 0; x < ds->width; x++) { 1649 for (x = 0; x < ds->width; x++) {
1648 if (x == state->cx) continue; 1650 if (x == state->cx) continue;
1649 draw_arrow(dr, ds, x, 0, +1, 0, 0); 1651 draw_arrow(dr, ds, x, 0, +1, 0, false);
1650 draw_arrow(dr, ds, x+1, ds->height, -1, 0, 0); 1652 draw_arrow(dr, ds, x+1, ds->height, -1, 0, false);
1651 } 1653 }
1652 for (y = 0; y < ds->height; y++) { 1654 for (y = 0; y < ds->height; y++) {
1653 if (y == state->cy) continue; 1655 if (y == state->cy) continue;
1654 draw_arrow(dr, ds, ds->width, y, 0, +1, 0); 1656 draw_arrow(dr, ds, ds->width, y, 0, +1, false);
1655 draw_arrow(dr, ds, 0, y+1, 0, -1, 0); 1657 draw_arrow(dr, ds, 0, y+1, 0, -1, false);
1656 } 1658 }
1657 } 1659 }
1658 if (ui->cur_visible) { 1660 if (ui->cur_visible) {
@@ -1662,8 +1664,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1662 /* Cursor has changed; redraw two (prev and curr) arrows. */ 1664 /* Cursor has changed; redraw two (prev and curr) arrows. */
1663 assert(cur_x != state->cx && cur_y != state->cy); 1665 assert(cur_x != state->cx && cur_y != state->cy);
1664 1666
1665 draw_arrow_for_cursor(dr, ds, cur_x, cur_y, 1); 1667 draw_arrow_for_cursor(dr, ds, cur_x, cur_y, true);
1666 draw_arrow_for_cursor(dr, ds, ds->cur_x, ds->cur_y, 0); 1668 draw_arrow_for_cursor(dr, ds, ds->cur_x, ds->cur_y, false);
1667 ds->cur_x = cur_x; ds->cur_y = cur_y; 1669 ds->cur_x = cur_x; ds->cur_y = cur_y;
1668 } 1670 }
1669 1671
@@ -1833,9 +1835,9 @@ static int game_status(const game_state *state)
1833 return state->completed ? +1 : 0; 1835 return state->completed ? +1 : 0;
1834} 1836}
1835 1837
1836static int game_timing_state(const game_state *state, game_ui *ui) 1838static bool game_timing_state(const game_state *state, game_ui *ui)
1837{ 1839{
1838 return FALSE; 1840 return false;
1839} 1841}
1840 1842
1841static void game_print_size(const game_params *params, float *x, float *y) 1843static void game_print_size(const game_params *params, float *x, float *y)
@@ -1858,15 +1860,15 @@ const struct game thegame = {
1858 encode_params, 1860 encode_params,
1859 free_params, 1861 free_params,
1860 dup_params, 1862 dup_params,
1861 TRUE, game_configure, custom_params, 1863 true, game_configure, custom_params,
1862 validate_params, 1864 validate_params,
1863 new_game_desc, 1865 new_game_desc,
1864 validate_desc, 1866 validate_desc,
1865 new_game, 1867 new_game,
1866 dup_game, 1868 dup_game,
1867 free_game, 1869 free_game,
1868 TRUE, solve_game, 1870 true, solve_game,
1869 FALSE, game_can_format_as_text_now, game_text_format, 1871 false, game_can_format_as_text_now, game_text_format,
1870 new_ui, 1872 new_ui,
1871 free_ui, 1873 free_ui,
1872 encode_ui, 1874 encode_ui,
@@ -1883,9 +1885,9 @@ const struct game thegame = {
1883 game_anim_length, 1885 game_anim_length,
1884 game_flash_length, 1886 game_flash_length,
1885 game_status, 1887 game_status,
1886 FALSE, FALSE, game_print_size, game_print, 1888 false, false, game_print_size, game_print,
1887 TRUE, /* wants_statusbar */ 1889 true, /* wants_statusbar */
1888 FALSE, game_timing_state, 1890 false, game_timing_state,
1889 0, /* flags */ 1891 0, /* flags */
1890}; 1892};
1891 1893
diff --git a/apps/plugins/puzzles/src/nullfe.c b/apps/plugins/puzzles/src/nullfe.c
index 14b6e096c0..7cba4e0c23 100644
--- a/apps/plugins/puzzles/src/nullfe.c
+++ b/apps/plugins/puzzles/src/nullfe.c
@@ -40,7 +40,7 @@ int print_rgb_grey_colour(drawing *dr, float r, float g, float b, float grey)
40int print_rgb_hatched_colour(drawing *dr, float r, float g, float b, int hatch) 40int print_rgb_hatched_colour(drawing *dr, float r, float g, float b, int hatch)
41{ return 0; } 41{ return 0; }
42void print_line_width(drawing *dr, int width) {} 42void print_line_width(drawing *dr, int width) {}
43void print_line_dotted(drawing *dr, int dotted) {} 43void print_line_dotted(drawing *dr, bool dotted) {}
44void midend_supersede_game_desc(midend *me, const char *desc, 44void midend_supersede_game_desc(midend *me, const char *desc,
45 const char *privdesc) {} 45 const char *privdesc) {}
46void status_bar(drawing *dr, const char *text) {} 46void status_bar(drawing *dr, const char *text) {}
diff --git a/apps/plugins/puzzles/src/nullgame.c b/apps/plugins/puzzles/src/nullgame.c
index 13c464c60d..2fa4da6ffd 100644
--- a/apps/plugins/puzzles/src/nullgame.c
+++ b/apps/plugins/puzzles/src/nullgame.c
@@ -42,9 +42,9 @@ static game_params *default_params(void)
42 return ret; 42 return ret;
43} 43}
44 44
45static int game_fetch_preset(int i, char **name, game_params **params) 45static bool game_fetch_preset(int i, char **name, game_params **params)
46{ 46{
47 return FALSE; 47 return false;
48} 48}
49 49
50static void free_params(game_params *params) 50static void free_params(game_params *params)
@@ -63,7 +63,7 @@ static void decode_params(game_params *params, char const *string)
63{ 63{
64} 64}
65 65
66static char *encode_params(const game_params *params, int full) 66static char *encode_params(const game_params *params, bool full)
67{ 67{
68 return dupstr("FIXME"); 68 return dupstr("FIXME");
69} 69}
@@ -78,13 +78,13 @@ static game_params *custom_params(const config_item *cfg)
78 return NULL; 78 return NULL;
79} 79}
80 80
81static const char *validate_params(const game_params *params, int full) 81static const char *validate_params(const game_params *params, bool full)
82{ 82{
83 return NULL; 83 return NULL;
84} 84}
85 85
86static char *new_game_desc(const game_params *params, random_state *rs, 86static char *new_game_desc(const game_params *params, random_state *rs,
87 char **aux, int interactive) 87 char **aux, bool interactive)
88{ 88{
89 return dupstr("FIXME"); 89 return dupstr("FIXME");
90} 90}
@@ -124,9 +124,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
124 return NULL; 124 return NULL;
125} 125}
126 126
127static int game_can_format_as_text_now(const game_params *params) 127static bool game_can_format_as_text_now(const game_params *params)
128{ 128{
129 return TRUE; 129 return true;
130} 130}
131 131
132static char *game_text_format(const game_state *state) 132static char *game_text_format(const game_state *state)
@@ -247,9 +247,9 @@ static int game_status(const game_state *state)
247 return 0; 247 return 0;
248} 248}
249 249
250static int game_timing_state(const game_state *state, game_ui *ui) 250static bool game_timing_state(const game_state *state, game_ui *ui)
251{ 251{
252 return TRUE; 252 return true;
253} 253}
254 254
255static void game_print_size(const game_params *params, float *x, float *y) 255static void game_print_size(const game_params *params, float *x, float *y)
@@ -272,15 +272,15 @@ const struct game thegame = {
272 encode_params, 272 encode_params,
273 free_params, 273 free_params,
274 dup_params, 274 dup_params,
275 FALSE, game_configure, custom_params, 275 false, game_configure, custom_params,
276 validate_params, 276 validate_params,
277 new_game_desc, 277 new_game_desc,
278 validate_desc, 278 validate_desc,
279 new_game, 279 new_game,
280 dup_game, 280 dup_game,
281 free_game, 281 free_game,
282 FALSE, solve_game, 282 false, solve_game,
283 FALSE, game_can_format_as_text_now, game_text_format, 283 false, game_can_format_as_text_now, game_text_format,
284 new_ui, 284 new_ui,
285 free_ui, 285 free_ui,
286 encode_ui, 286 encode_ui,
@@ -297,8 +297,8 @@ const struct game thegame = {
297 game_anim_length, 297 game_anim_length,
298 game_flash_length, 298 game_flash_length,
299 game_status, 299 game_status,
300 FALSE, FALSE, game_print_size, game_print, 300 false, false, game_print_size, game_print,
301 FALSE, /* wants_statusbar */ 301 false, /* wants_statusbar */
302 FALSE, game_timing_state, 302 false, game_timing_state,
303 0, /* flags */ 303 0, /* flags */
304}; 304};
diff --git a/apps/plugins/puzzles/src/obfusc.c b/apps/plugins/puzzles/src/obfusc.c
index dc0656c20e..c62189c3ad 100644
--- a/apps/plugins/puzzles/src/obfusc.c
+++ b/apps/plugins/puzzles/src/obfusc.c
@@ -36,8 +36,8 @@ int main(int argc, char **argv)
36 char *inhex = NULL; 36 char *inhex = NULL;
37 unsigned char *data; 37 unsigned char *data;
38 int datalen; 38 int datalen;
39 int decode = -1; 39 enum { UNKNOWN, DECODE, ENCODE } mode = UNKNOWN;
40 int doing_opts = TRUE; 40 bool doing_opts = true;
41 41
42 while (--argc > 0) { 42 while (--argc > 0) {
43 char *p = *++argv; 43 char *p = *++argv;
@@ -51,10 +51,10 @@ int main(int argc, char **argv)
51 while (*p) { 51 while (*p) {
52 switch (*p) { 52 switch (*p) {
53 case 'e': 53 case 'e':
54 decode = 0; 54 mode = ENCODE;
55 break; 55 break;
56 case 'd': 56 case 'd':
57 decode = 1; 57 mode = DECODE;
58 break; 58 break;
59 case 'b': 59 case 'b':
60 outputmode = BINARY; 60 outputmode = BINARY;
@@ -79,13 +79,13 @@ int main(int argc, char **argv)
79 } 79 }
80 } 80 }
81 81
82 if (decode < 0) { 82 if (mode == UNKNOWN) {
83 fprintf(stderr, "usage: obfusc < -e | -d > [ -b | -h ] [hex data]\n"); 83 fprintf(stderr, "usage: obfusc < -e | -d > [ -b | -h ] [hex data]\n");
84 return 0; 84 return 0;
85 } 85 }
86 86
87 if (outputmode == DEFAULT) 87 if (outputmode == DEFAULT)
88 outputmode = (decode ? BINARY : HEX); 88 outputmode = (mode == DECODE ? BINARY : HEX);
89 89
90 if (inhex) { 90 if (inhex) {
91 datalen = strlen(inhex) / 2; 91 datalen = strlen(inhex) / 2;
@@ -111,7 +111,7 @@ int main(int argc, char **argv)
111 } 111 }
112 } 112 }
113 113
114 obfuscate_bitmap(data, datalen * 8, decode); 114 obfuscate_bitmap(data, datalen * 8, mode == DECODE);
115 115
116 if (outputmode == BINARY) { 116 if (outputmode == BINARY) {
117 int ret = fwrite(data, 1, datalen, stdout); 117 int ret = fwrite(data, 1, datalen, stdout);
diff --git a/apps/plugins/puzzles/src/osx.m b/apps/plugins/puzzles/src/osx.m
index daa4af1f09..0793817776 100644
--- a/apps/plugins/puzzles/src/osx.m
+++ b/apps/plugins/puzzles/src/osx.m
@@ -158,7 +158,7 @@ static void savefile_write(void *wctx, const void *buf, int len)
158 fwrite(buf, 1, len, fp); 158 fwrite(buf, 1, len, fp);
159} 159}
160 160
161static int savefile_read(void *wctx, void *buf, int len) 161static bool savefile_read(void *wctx, void *buf, int len)
162{ 162{
163 FILE *fp = (FILE *)wctx; 163 FILE *fp = (FILE *)wctx;
164 int ret; 164 int ret;
@@ -392,7 +392,7 @@ struct frontend {
392 MyImageView *view; 392 MyImageView *view;
393 NSColor **colours; 393 NSColor **colours;
394 int ncolours; 394 int ncolours;
395 int clipped; 395 bool clipped;
396 int w, h; 396 int w, h;
397}; 397};
398 398
@@ -522,7 +522,7 @@ struct frontend {
522 frame.origin.x = 0; 522 frame.origin.x = 0;
523 523
524 w = h = INT_MAX; 524 w = h = INT_MAX;
525 midend_size(me, &w, &h, FALSE); 525 midend_size(me, &w, &h, false);
526 frame.size.width = w; 526 frame.size.width = w;
527 frame.size.height = h; 527 frame.size.height = h;
528 fe.w = w; 528 fe.w = w;
@@ -557,7 +557,7 @@ struct frontend {
557 */ 557 */
558 midend_new_game(me); 558 midend_new_game(me);
559 w = h = INT_MAX; 559 w = h = INT_MAX;
560 midend_size(me, &w, &h, FALSE); 560 midend_size(me, &w, &h, false);
561 rect.size.width = w; 561 rect.size.width = w;
562 rect.size.height = h; 562 rect.size.height = h;
563 fe.w = w; 563 fe.w = w;
@@ -654,23 +654,23 @@ struct frontend {
654 * function key codes. 654 * function key codes.
655 */ 655 */
656 if (c >= 0x80) { 656 if (c >= 0x80) {
657 int mods = FALSE; 657 bool mods = false;
658 switch (c) { 658 switch (c) {
659 case NSUpArrowFunctionKey: 659 case NSUpArrowFunctionKey:
660 c = CURSOR_UP; 660 c = CURSOR_UP;
661 mods = TRUE; 661 mods = true;
662 break; 662 break;
663 case NSDownArrowFunctionKey: 663 case NSDownArrowFunctionKey:
664 c = CURSOR_DOWN; 664 c = CURSOR_DOWN;
665 mods = TRUE; 665 mods = true;
666 break; 666 break;
667 case NSLeftArrowFunctionKey: 667 case NSLeftArrowFunctionKey:
668 c = CURSOR_LEFT; 668 c = CURSOR_LEFT;
669 mods = TRUE; 669 mods = true;
670 break; 670 break;
671 case NSRightArrowFunctionKey: 671 case NSRightArrowFunctionKey:
672 c = CURSOR_RIGHT; 672 c = CURSOR_RIGHT;
673 mods = TRUE; 673 mods = true;
674 break; 674 break;
675 default: 675 default:
676 continue; 676 continue;
@@ -750,7 +750,7 @@ struct frontend {
750 NSSavePanel *sp = [NSSavePanel savePanel]; 750 NSSavePanel *sp = [NSSavePanel savePanel];
751 751
752 if ([sp runModal] == NSFileHandlingPanelOKButton) { 752 if ([sp runModal] == NSFileHandlingPanelOKButton) {
753 const char *name = [[sp filename] UTF8String]; 753 const char *name = [[sp URL] fileSystemRepresentation];
754 754
755 FILE *fp = fopen(name, "w"); 755 FILE *fp = fopen(name, "w");
756 756
@@ -770,25 +770,9 @@ struct frontend {
770 770
771 [op setAllowsMultipleSelection:NO]; 771 [op setAllowsMultipleSelection:NO];
772 772
773 if ([op runModalForTypes:nil] == NSOKButton) { 773 if ([op runModal] == NSOKButton) {
774 /* 774 const char *name = [[[op URLs] objectAtIndex:0]
775 * This used to be 775 fileSystemRepresentation];
776 *
777 * [[[op filenames] objectAtIndex:0] cString]
778 *
779 * but the plain cString method became deprecated and Xcode 7
780 * started complaining about it. Since OS X 10.9 we can
781 * apparently use the more modern API
782 *
783 * [[[op URLs] objectAtIndex:0] fileSystemRepresentation]
784 *
785 * but the alternative below still compiles with Xcode 7 and
786 * is a bit more backwards compatible, so I'll try it for the
787 * moment.
788 */
789 const char *name = [[[op filenames] objectAtIndex:0]
790 cStringUsingEncoding:
791 [NSString defaultCStringEncoding]];
792 const char *err; 776 const char *err;
793 777
794 FILE *fp = fopen(name, "r"); 778 FILE *fp = fopen(name, "r");
@@ -973,7 +957,7 @@ struct frontend {
973 int w, h; 957 int w, h;
974 958
975 w = h = INT_MAX; 959 w = h = INT_MAX;
976 midend_size(me, &w, &h, FALSE); 960 midend_size(me, &w, &h, false);
977 size.width = w; 961 size.width = w;
978 size.height = h; 962 size.height = h;
979 fe.w = w; 963 fe.w = w;
@@ -1291,7 +1275,7 @@ struct frontend {
1291 [self startConfigureSheet:CFG_SETTINGS]; 1275 [self startConfigureSheet:CFG_SETTINGS];
1292} 1276}
1293 1277
1294- (void)sheetEndWithStatus:(BOOL)update 1278- (void)sheetEndWithStatus:(bool)update
1295{ 1279{
1296 assert(sheet != NULL); 1280 assert(sheet != NULL);
1297 [app endSheet:sheet]; 1281 [app endSheet:sheet];
@@ -1341,11 +1325,11 @@ struct frontend {
1341} 1325}
1342- (void)sheetOKButton:(id)sender 1326- (void)sheetOKButton:(id)sender
1343{ 1327{
1344 [self sheetEndWithStatus:YES]; 1328 [self sheetEndWithStatus:true];
1345} 1329}
1346- (void)sheetCancelButton:(id)sender 1330- (void)sheetCancelButton:(id)sender
1347{ 1331{
1348 [self sheetEndWithStatus:NO]; 1332 [self sheetEndWithStatus:false];
1349} 1333}
1350 1334
1351- (void)setStatusLine:(const char *)text 1335- (void)setStatusLine:(const char *)text
@@ -1593,20 +1577,20 @@ static void osx_clip(void *handle, int x, int y, int w, int h)
1593 if (!fe->clipped) 1577 if (!fe->clipped)
1594 [[NSGraphicsContext currentContext] saveGraphicsState]; 1578 [[NSGraphicsContext currentContext] saveGraphicsState];
1595 [NSBezierPath clipRect:r]; 1579 [NSBezierPath clipRect:r];
1596 fe->clipped = TRUE; 1580 fe->clipped = true;
1597} 1581}
1598static void osx_unclip(void *handle) 1582static void osx_unclip(void *handle)
1599{ 1583{
1600 frontend *fe = (frontend *)handle; 1584 frontend *fe = (frontend *)handle;
1601 if (fe->clipped) 1585 if (fe->clipped)
1602 [[NSGraphicsContext currentContext] restoreGraphicsState]; 1586 [[NSGraphicsContext currentContext] restoreGraphicsState];
1603 fe->clipped = FALSE; 1587 fe->clipped = false;
1604} 1588}
1605static void osx_start_draw(void *handle) 1589static void osx_start_draw(void *handle)
1606{ 1590{
1607 frontend *fe = (frontend *)handle; 1591 frontend *fe = (frontend *)handle;
1608 [fe->image lockFocus]; 1592 [fe->image lockFocus];
1609 fe->clipped = FALSE; 1593 fe->clipped = false;
1610} 1594}
1611static void osx_end_draw(void *handle) 1595static void osx_end_draw(void *handle)
1612{ 1596{
diff --git a/apps/plugins/puzzles/src/palisade.c b/apps/plugins/puzzles/src/palisade.c
index 0be8ac57f6..759fcaa75d 100644
--- a/apps/plugins/puzzles/src/palisade.c
+++ b/apps/plugins/puzzles/src/palisade.c
@@ -59,8 +59,7 @@ struct game_state {
59 shared_state *shared; 59 shared_state *shared;
60 borderflag *borders; /* length w*h */ 60 borderflag *borders; /* length w*h */
61 61
62 unsigned int completed: 1; 62 bool completed, cheated;
63 unsigned int cheated: 1;
64}; 63};
65 64
66#define DEFAULT_PRESET 0 65#define DEFAULT_PRESET 0
@@ -75,15 +74,15 @@ static game_params *default_params(void)
75 return clone(&presets[DEFAULT_PRESET]); 74 return clone(&presets[DEFAULT_PRESET]);
76} 75}
77 76
78static int game_fetch_preset(int i, char **name, game_params **params) 77static bool game_fetch_preset(int i, char **name, game_params **params)
79{ 78{
80 if (i < 0 || i >= lenof(presets)) return FALSE; 79 if (i < 0 || i >= lenof(presets)) return false;
81 80
82 *params = clone(&presets[i]); 81 *params = clone(&presets[i]);
83 *name = string(60, "%d x %d, regions of size %d", 82 *name = string(60, "%d x %d, regions of size %d",
84 presets[i].w, presets[i].h, presets[i].k); 83 presets[i].w, presets[i].h, presets[i].k);
85 84
86 return TRUE; 85 return true;
87} 86}
88 87
89static void free_params(game_params *params) 88static void free_params(game_params *params)
@@ -107,7 +106,7 @@ static void decode_params(game_params *params, char const *string)
107 if (*string == 'n') params->k = atoi(++string); 106 if (*string == 'n') params->k = atoi(++string);
108} 107}
109 108
110static char *encode_params(const game_params *params, int full) 109static char *encode_params(const game_params *params, bool full)
111{ 110{
112 return string(40, "%dx%dn%d", params->w, params->h, params->k); 111 return string(40, "%dx%dn%d", params->w, params->h, params->k);
113} 112}
@@ -155,7 +154,7 @@ static game_params *custom_params(const config_item *cfg)
155 * +---+ the dominos is horizontal or vertical. +---+---+ 154 * +---+ the dominos is horizontal or vertical. +---+---+
156 */ 155 */
157 156
158static const char *validate_params(const game_params *params, int full) 157static const char *validate_params(const game_params *params, bool full)
159{ 158{
160 int w = params->w, h = params->h, k = params->k, wh = w * h; 159 int w = params->w, h = params->h, k = params->k, wh = w * h;
161 160
@@ -268,7 +267,7 @@ static void connect(solver_ctx *ctx, int i, int j)
268 dsf_merge(ctx->dsf, i, j); 267 dsf_merge(ctx->dsf, i, j);
269} 268}
270 269
271static int connected(solver_ctx *ctx, int i, int j, int dir) 270static bool connected(solver_ctx *ctx, int i, int j, int dir)
272{ 271{
273 if (j == COMPUTE_J) j = i + dx[dir] + ctx->params->w*dy[dir]; 272 if (j == COMPUTE_J) j = i + dx[dir] + ctx->params->w*dy[dir];
274 return dsf_canonify(ctx->dsf, i) == dsf_canonify(ctx->dsf, j); 273 return dsf_canonify(ctx->dsf, i) == dsf_canonify(ctx->dsf, j);
@@ -281,13 +280,13 @@ static void disconnect(solver_ctx *ctx, int i, int j, int dir)
281 ctx->borders[j] |= BORDER(FLIP(dir)); 280 ctx->borders[j] |= BORDER(FLIP(dir));
282} 281}
283 282
284static int disconnected(solver_ctx *ctx, int i, int j, int dir) 283static bool disconnected(solver_ctx *ctx, int i, int j, int dir)
285{ 284{
286 assert (j == COMPUTE_J || j == i + dx[dir] + ctx->params->w*dy[dir]); 285 assert (j == COMPUTE_J || j == i + dx[dir] + ctx->params->w*dy[dir]);
287 return ctx->borders[i] & BORDER(dir); 286 return ctx->borders[i] & BORDER(dir);
288} 287}
289 288
290static int maybe(solver_ctx *ctx, int i, int j, int dir) 289static bool maybe(solver_ctx *ctx, int i, int j, int dir)
291{ 290{
292 assert (j == COMPUTE_J || j == i + dx[dir] + ctx->params->w*dy[dir]); 291 assert (j == COMPUTE_J || j == i + dx[dir] + ctx->params->w*dy[dir]);
293 return !disconnected(ctx, i, j, dir) && !connected(ctx, i, j, dir); 292 return !disconnected(ctx, i, j, dir) && !connected(ctx, i, j, dir);
@@ -315,16 +314,16 @@ static void solver_connected_clues_versus_region_size(solver_ctx *ctx)
315 ctx->params->k != 2)) 314 ctx->params->k != 2))
316 { 315 {
317 disconnect(ctx, i, j, dir); 316 disconnect(ctx, i, j, dir);
318 /* changed = TRUE, but this is a one-shot... */ 317 /* changed = true, but this is a one-shot... */
319 } 318 }
320 } 319 }
321 } 320 }
322} 321}
323 322
324static int solver_number_exhausted(solver_ctx *ctx) 323static bool solver_number_exhausted(solver_ctx *ctx)
325{ 324{
326 int w = ctx->params->w, h = ctx->params->h, wh = w*h, i, dir, off; 325 int w = ctx->params->w, h = ctx->params->h, wh = w*h, i, dir, off;
327 int changed = FALSE; 326 bool changed = false;
328 327
329 for (i = 0; i < wh; ++i) { 328 for (i = 0; i < wh; ++i) {
330 if (ctx->clues[i] == EMPTY) continue; 329 if (ctx->clues[i] == EMPTY) continue;
@@ -334,7 +333,7 @@ static int solver_number_exhausted(solver_ctx *ctx)
334 int j = i + dx[dir] + w*dy[dir]; 333 int j = i + dx[dir] + w*dy[dir];
335 if (!maybe(ctx, i, j, dir)) continue; 334 if (!maybe(ctx, i, j, dir)) continue;
336 connect(ctx, i, j); 335 connect(ctx, i, j);
337 changed = TRUE; 336 changed = true;
338 } 337 }
339 continue; 338 continue;
340 } 339 }
@@ -350,17 +349,17 @@ static int solver_number_exhausted(solver_ctx *ctx)
350 int j = i + dx[dir] + w*dy[dir]; 349 int j = i + dx[dir] + w*dy[dir];
351 if (!maybe(ctx, i, j, dir)) continue; 350 if (!maybe(ctx, i, j, dir)) continue;
352 disconnect(ctx, i, j, dir); 351 disconnect(ctx, i, j, dir);
353 changed = TRUE; 352 changed = true;
354 } 353 }
355 } 354 }
356 355
357 return changed; 356 return changed;
358} 357}
359 358
360static int solver_not_too_big(solver_ctx *ctx) 359static bool solver_not_too_big(solver_ctx *ctx)
361{ 360{
362 int w = ctx->params->w, h = ctx->params->h, wh = w*h, i, dir; 361 int w = ctx->params->w, h = ctx->params->h, wh = w*h, i, dir;
363 int changed = FALSE; 362 bool changed = false;
364 363
365 for (i = 0; i < wh; ++i) { 364 for (i = 0; i < wh; ++i) {
366 int size = dsf_size(ctx->dsf, i); 365 int size = dsf_size(ctx->dsf, i);
@@ -369,17 +368,18 @@ static int solver_not_too_big(solver_ctx *ctx)
369 if (!maybe(ctx, i, j, dir)) continue; 368 if (!maybe(ctx, i, j, dir)) continue;
370 if (size + dsf_size(ctx->dsf, j) <= ctx->params->k) continue; 369 if (size + dsf_size(ctx->dsf, j) <= ctx->params->k) continue;
371 disconnect(ctx, i, j, dir); 370 disconnect(ctx, i, j, dir);
372 changed = TRUE; 371 changed = true;
373 } 372 }
374 } 373 }
375 374
376 return changed; 375 return changed;
377} 376}
378 377
379static int solver_not_too_small(solver_ctx *ctx) 378static bool solver_not_too_small(solver_ctx *ctx)
380{ 379{
381 int w = ctx->params->w, h = ctx->params->h, wh = w*h, i, dir; 380 int w = ctx->params->w, h = ctx->params->h, wh = w*h, i, dir;
382 int *outs, k = ctx->params->k, ci, changed = FALSE; 381 int *outs, k = ctx->params->k, ci;
382 bool changed = false;
383 383
384 snewa(outs, wh); 384 snewa(outs, wh);
385 setmem(outs, -1, wh); 385 setmem(outs, -1, wh);
@@ -400,17 +400,17 @@ static int solver_not_too_small(solver_ctx *ctx)
400 if (i != dsf_canonify(ctx->dsf, i)) continue; 400 if (i != dsf_canonify(ctx->dsf, i)) continue;
401 if (j < 0) continue; 401 if (j < 0) continue;
402 connect(ctx, i, j); /* only one place for i to grow */ 402 connect(ctx, i, j); /* only one place for i to grow */
403 changed = TRUE; 403 changed = true;
404 } 404 }
405 405
406 sfree(outs); 406 sfree(outs);
407 return changed; 407 return changed;
408} 408}
409 409
410static int solver_no_dangling_edges(solver_ctx *ctx) 410static bool solver_no_dangling_edges(solver_ctx *ctx)
411{ 411{
412 int w = ctx->params->w, h = ctx->params->h, r, c; 412 int w = ctx->params->w, h = ctx->params->h, r, c;
413 int changed = FALSE; 413 bool changed = false;
414 414
415 /* for each vertex */ 415 /* for each vertex */
416 for (r = 1; r < h; ++r) 416 for (r = 1; r < h; ++r)
@@ -435,7 +435,7 @@ static int solver_no_dangling_edges(solver_ctx *ctx)
435 if (4 - noline == 1) { 435 if (4 - noline == 1) {
436 assert (e != -1); 436 assert (e != -1);
437 disconnect(ctx, e, COMPUTE_J, de); 437 disconnect(ctx, e, COMPUTE_J, de);
438 changed = TRUE; 438 changed = true;
439 continue; 439 continue;
440 } 440 }
441 441
@@ -447,21 +447,21 @@ static int solver_no_dangling_edges(solver_ctx *ctx)
447 if (ctx->borders[e] & BORDER(de)) { 447 if (ctx->borders[e] & BORDER(de)) {
448 if (!(ctx->borders[f] & BORDER(df))) { 448 if (!(ctx->borders[f] & BORDER(df))) {
449 disconnect(ctx, f, COMPUTE_J, df); 449 disconnect(ctx, f, COMPUTE_J, df);
450 changed = TRUE; 450 changed = true;
451 } 451 }
452 } else if (ctx->borders[f] & BORDER(df)) { 452 } else if (ctx->borders[f] & BORDER(df)) {
453 disconnect(ctx, e, COMPUTE_J, de); 453 disconnect(ctx, e, COMPUTE_J, de);
454 changed = TRUE; 454 changed = true;
455 } 455 }
456 } 456 }
457 457
458 return changed; 458 return changed;
459} 459}
460 460
461static int solver_equivalent_edges(solver_ctx *ctx) 461static bool solver_equivalent_edges(solver_ctx *ctx)
462{ 462{
463 int w = ctx->params->w, h = ctx->params->h, wh = w*h, i, dirj; 463 int w = ctx->params->w, h = ctx->params->h, wh = w*h, i, dirj;
464 int changed = FALSE; 464 bool changed = false;
465 465
466 /* if a square is adjacent to two connected squares, the two 466 /* if a square is adjacent to two connected squares, the two
467 * borders (i,j) and (i,k) are either both on or both off. */ 467 * borders (i,j) and (i,k) are either both on or both off. */
@@ -489,11 +489,11 @@ static int solver_equivalent_edges(solver_ctx *ctx)
489 if (n_on + 2 > ctx->clues[i]) { 489 if (n_on + 2 > ctx->clues[i]) {
490 connect(ctx, i, j); 490 connect(ctx, i, j);
491 connect(ctx, i, k); 491 connect(ctx, i, k);
492 changed = TRUE; 492 changed = true;
493 } else if (n_off + 2 > 4 - ctx->clues[i]) { 493 } else if (n_off + 2 > 4 - ctx->clues[i]) {
494 disconnect(ctx, i, j, dirj); 494 disconnect(ctx, i, j, dirj);
495 disconnect(ctx, i, k, dirk); 495 disconnect(ctx, i, k, dirk);
496 changed = TRUE; 496 changed = true;
497 } 497 }
498 } 498 }
499 } 499 }
@@ -505,7 +505,7 @@ static int solver_equivalent_edges(solver_ctx *ctx)
505#define UNVISITED 6 505#define UNVISITED 6
506 506
507/* build connected components in `dsf', along the lines of `borders'. */ 507/* build connected components in `dsf', along the lines of `borders'. */
508static void dfs_dsf(int i, int w, borderflag *border, int *dsf, int black) 508static void dfs_dsf(int i, int w, borderflag *border, int *dsf, bool black)
509{ 509{
510 int dir; 510 int dir;
511 for (dir = 0; dir < 4; ++dir) { 511 for (dir = 0; dir < 4; ++dir) {
@@ -518,8 +518,8 @@ static void dfs_dsf(int i, int w, borderflag *border, int *dsf, int black)
518 } 518 }
519} 519}
520 520
521static int is_solved(const game_params *params, clue *clues, 521static bool is_solved(const game_params *params, clue *clues,
522 borderflag *border) 522 borderflag *border)
523{ 523{
524 int w = params->w, h = params->h, wh = w*h, k = params->k; 524 int w = params->w, h = params->h, wh = w*h, k = params->k;
525 int i, x, y; 525 int i, x, y;
@@ -536,7 +536,7 @@ static int is_solved(const game_params *params, clue *clues,
536 * - the borders also satisfy the clue set 536 * - the borders also satisfy the clue set
537 */ 537 */
538 for (i = 0; i < wh; ++i) { 538 for (i = 0; i < wh; ++i) {
539 if (dsf[i] == UNVISITED) dfs_dsf(i, params->w, border, dsf, TRUE); 539 if (dsf[i] == UNVISITED) dfs_dsf(i, params->w, border, dsf, true);
540 if (dsf_size(dsf, i) != k) goto error; 540 if (dsf_size(dsf, i) != k) goto error;
541 if (clues[i] == EMPTY) continue; 541 if (clues[i] == EMPTY) continue;
542 if (clues[i] != bitcount[border[i] & BORDER_MASK]) goto error; 542 if (clues[i] != bitcount[border[i] & BORDER_MASK]) goto error;
@@ -563,16 +563,17 @@ static int is_solved(const game_params *params, clue *clues,
563 } 563 }
564 564
565 sfree(dsf); 565 sfree(dsf);
566 return TRUE; 566 return true;
567 567
568error: 568error:
569 sfree(dsf); 569 sfree(dsf);
570 return FALSE; 570 return false;
571} 571}
572 572
573static int solver(const game_params *params, clue *clues, borderflag *borders) 573static bool solver(const game_params *params, clue *clues, borderflag *borders)
574{ 574{
575 int w = params->w, h = params->h, wh = w*h, changed; 575 int w = params->w, h = params->h, wh = w*h;
576 bool changed;
576 solver_ctx ctx; 577 solver_ctx ctx;
577 578
578 ctx.params = params; 579 ctx.params = params;
@@ -582,7 +583,7 @@ static int solver(const game_params *params, clue *clues, borderflag *borders)
582 583
583 solver_connected_clues_versus_region_size(&ctx); /* idempotent */ 584 solver_connected_clues_versus_region_size(&ctx); /* idempotent */
584 do { 585 do {
585 changed = FALSE; 586 changed = false;
586 changed |= solver_number_exhausted(&ctx); 587 changed |= solver_number_exhausted(&ctx);
587 changed |= solver_not_too_big(&ctx); 588 changed |= solver_not_too_big(&ctx);
588 changed |= solver_not_too_small(&ctx); 589 changed |= solver_not_too_small(&ctx);
@@ -617,7 +618,7 @@ static void init_borders(int w, int h, borderflag *borders)
617#define xshuffle(ptr, len, rs) shuffle((ptr), (len), sizeof (ptr)[0], (rs)) 618#define xshuffle(ptr, len, rs) shuffle((ptr), (len), sizeof (ptr)[0], (rs))
618 619
619static char *new_game_desc(const game_params *params, random_state *rs, 620static char *new_game_desc(const game_params *params, random_state *rs,
620 char **aux, int interactive) 621 char **aux, bool interactive)
621{ 622{
622 int w = params->w, h = params->h, wh = w*h, k = params->k; 623 int w = params->w, h = params->h, wh = w*h, k = params->k;
623 624
@@ -750,7 +751,7 @@ static game_state *new_game(midend *me, const game_params *params,
750 init_borders(w, h, state->borders); 751 init_borders(w, h, state->borders);
751 752
752 state->completed = (params->k == wh); 753 state->completed = (params->k == wh);
753 state->cheated = FALSE; 754 state->cheated = false;
754 755
755 return state; 756 return state;
756} 757}
@@ -819,9 +820,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
819 } 820 }
820} 821}
821 822
822static int game_can_format_as_text_now(const game_params *params) 823static bool game_can_format_as_text_now(const game_params *params)
823{ 824{
824 return TRUE; 825 return true;
825} 826}
826 827
827static char *game_text_format(const game_state *state) 828static char *game_text_format(const game_state *state)
@@ -865,16 +866,15 @@ static char *game_text_format(const game_state *state)
865 866
866struct game_ui { 867struct game_ui {
867 int x, y; 868 int x, y;
868 unsigned int show: 1; 869 bool show;
869 unsigned int fake_ctrl: 1; 870 bool fake_ctrl, fake_shift;
870 unsigned int fake_shift: 1;
871}; 871};
872 872
873static game_ui *new_ui(const game_state *state) 873static game_ui *new_ui(const game_state *state)
874{ 874{
875 game_ui *ui = snew(game_ui); 875 game_ui *ui = snew(game_ui);
876 ui->x = ui->y = 0; 876 ui->x = ui->y = 0;
877 ui->show = ui->fake_ctrl = ui->fake_shift = FALSE; 877 ui->show = ui->fake_ctrl = ui->fake_shift = false;
878 return ui; 878 return ui;
879} 879}
880 880
@@ -918,10 +918,10 @@ static char *interpret_move(const game_state *state, game_ui *ui,
918 const game_drawstate *ds, int x, int y, int button) 918 const game_drawstate *ds, int x, int y, int button)
919{ 919{
920 int w = state->shared->params.w, h = state->shared->params.h; 920 int w = state->shared->params.w, h = state->shared->params.h;
921 int control = (button & MOD_CTRL) | ui->fake_ctrl, shift = (button & MOD_SHFT) | ui->fake_shift; 921 bool control = (button & MOD_CTRL) | ui->fake_ctrl, shift = (button & MOD_SHFT) | ui->fake_shift;
922 922
923 /* reset */ 923 /* reset */
924 ui->fake_ctrl = ui->fake_shift = FALSE; 924 ui->fake_ctrl = ui->fake_shift = false;
925 925
926 button &= ~MOD_MASK; 926 button &= ~MOD_MASK;
927 927
@@ -950,7 +950,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
950 950
951 if (OUT_OF_BOUNDS(hx, hy, w, h)) return NULL; 951 if (OUT_OF_BOUNDS(hx, hy, w, h)) return NULL;
952 952
953 ui->show = FALSE; 953 ui->show = false;
954 954
955 i = gy * w + gx; 955 i = gy * w + gx;
956 switch ((button == RIGHT_BUTTON) | 956 switch ((button == RIGHT_BUTTON) |
@@ -974,13 +974,13 @@ static char *interpret_move(const game_state *state, game_ui *ui,
974 } 974 }
975 975
976 if (IS_CURSOR_MOVE(button)) { 976 if (IS_CURSOR_MOVE(button)) {
977 ui->show = TRUE; 977 ui->show = true;
978 if (control || shift) { 978 if (control || shift) {
979 borderflag flag = 0, newflag; 979 borderflag flag = 0, newflag;
980 int dir, i = ui->y * w + ui->x; 980 int dir, i = ui->y * w + ui->x;
981 x = ui->x; 981 x = ui->x;
982 y = ui->y; 982 y = ui->y;
983 move_cursor(button, &x, &y, w, h, FALSE); 983 move_cursor(button, &x, &y, w, h, false);
984 if (OUT_OF_BOUNDS(x, y, w, h)) return NULL; 984 if (OUT_OF_BOUNDS(x, y, w, h)) return NULL;
985 985
986 for (dir = 0; dir < 4; ++dir) 986 for (dir = 0; dir < 4; ++dir)
@@ -1000,7 +1000,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1000 return string(80, "F%d,%d,%dF%d,%d,%d", 1000 return string(80, "F%d,%d,%dF%d,%d,%d",
1001 ui->x, ui->y, flag, x, y, newflag); 1001 ui->x, ui->y, flag, x, y, newflag);
1002 } else { 1002 } else {
1003 move_cursor(button, &ui->x, &ui->y, w, h, FALSE); 1003 move_cursor(button, &ui->x, &ui->y, w, h, false);
1004 return UI_UPDATE; 1004 return UI_UPDATE;
1005 } 1005 }
1006 } 1006 }
@@ -1008,7 +1008,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1008 /* CURSOR_SELECT or CURSOR_SELECT2 tells us to toggle whether 1008 /* CURSOR_SELECT or CURSOR_SELECT2 tells us to toggle whether
1009 * the button press should be interpreted as having CTRL or 1009 * the button press should be interpreted as having CTRL or
1010 * shift pressed along with it, respectively. */ 1010 * shift pressed along with it, respectively. */
1011 ui->show = TRUE; 1011 ui->show = true;
1012 if(button == CURSOR_SELECT2) 1012 if(button == CURSOR_SELECT2)
1013 ui->fake_shift = !ui->fake_shift; 1013 ui->fake_shift = !ui->fake_shift;
1014 else 1014 else
@@ -1031,7 +1031,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1031 ret->borders[i] = 1031 ret->borders[i] =
1032 (move[i] & BORDER_MASK) | DISABLED(~move[i] & BORDER_MASK); 1032 (move[i] & BORDER_MASK) | DISABLED(~move[i] & BORDER_MASK);
1033 if (i < wh || move[i]) return NULL; /* leaks `ret', then we die */ 1033 if (i < wh || move[i]) return NULL; /* leaks `ret', then we die */
1034 ret->cheated = ret->completed = TRUE; 1034 ret->cheated = ret->completed = true;
1035 return ret; 1035 return ret;
1036 } 1036 }
1037 1037
@@ -1205,9 +1205,9 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1205 1205
1206 for (i = 0; i < wh; ++i) { 1206 for (i = 0; i < wh; ++i) {
1207 if (black_border_dsf[i] == UNVISITED) 1207 if (black_border_dsf[i] == UNVISITED)
1208 dfs_dsf(i, w, state->borders, black_border_dsf, TRUE); 1208 dfs_dsf(i, w, state->borders, black_border_dsf, true);
1209 if (yellow_border_dsf[i] == UNVISITED) 1209 if (yellow_border_dsf[i] == UNVISITED)
1210 dfs_dsf(i, w, state->borders, yellow_border_dsf, FALSE); 1210 dfs_dsf(i, w, state->borders, yellow_border_dsf, false);
1211 } 1211 }
1212 1212
1213 for (r = 0; r < h; ++r) 1213 for (r = 0; r < h; ++r)
@@ -1293,10 +1293,10 @@ static int game_status(const game_state *state)
1293 return state->completed ? +1 : 0; 1293 return state->completed ? +1 : 0;
1294} 1294}
1295 1295
1296static int game_timing_state(const game_state *state, game_ui *ui) 1296static bool game_timing_state(const game_state *state, game_ui *ui)
1297{ 1297{
1298 assert (!"this shouldn't get called"); 1298 assert (!"this shouldn't get called");
1299 return 0; /* placate optimiser */ 1299 return false; /* placate optimiser */
1300} 1300}
1301 1301
1302static void game_print_size(const game_params *params, float *x, float *y) 1302static void game_print_size(const game_params *params, float *x, float *y)
@@ -1310,7 +1310,7 @@ static void game_print_size(const game_params *params, float *x, float *y)
1310} 1310}
1311 1311
1312static void print_line(drawing *dr, int x1, int y1, int x2, int y2, 1312static void print_line(drawing *dr, int x1, int y1, int x2, int y2,
1313 int colour, int full) 1313 int colour, bool full)
1314{ 1314{
1315 if (!full) { 1315 if (!full) {
1316 int i, subdivisions = 8; 1316 int i, subdivisions = 8;
@@ -1377,15 +1377,15 @@ const struct game thegame = {
1377 encode_params, 1377 encode_params,
1378 free_params, 1378 free_params,
1379 dup_params, 1379 dup_params,
1380 TRUE, game_configure, custom_params, 1380 true, game_configure, custom_params,
1381 validate_params, 1381 validate_params,
1382 new_game_desc, 1382 new_game_desc,
1383 validate_desc, 1383 validate_desc,
1384 new_game, 1384 new_game,
1385 dup_game, 1385 dup_game,
1386 free_game, 1386 free_game,
1387 TRUE, solve_game, 1387 true, solve_game,
1388 TRUE, game_can_format_as_text_now, game_text_format, 1388 true, game_can_format_as_text_now, game_text_format,
1389 new_ui, 1389 new_ui,
1390 free_ui, 1390 free_ui,
1391 encode_ui, 1391 encode_ui,
@@ -1402,8 +1402,8 @@ const struct game thegame = {
1402 game_anim_length, 1402 game_anim_length,
1403 game_flash_length, 1403 game_flash_length,
1404 game_status, 1404 game_status,
1405 TRUE, FALSE, game_print_size, game_print, 1405 true, false, game_print_size, game_print,
1406 TRUE, /* wants_statusbar */ 1406 true, /* wants_statusbar */
1407 FALSE, game_timing_state, 1407 false, game_timing_state,
1408 0, /* flags */ 1408 0, /* flags */
1409}; 1409};
diff --git a/apps/plugins/puzzles/src/pattern.c b/apps/plugins/puzzles/src/pattern.c
index f715df490e..42f3fc55ce 100644
--- a/apps/plugins/puzzles/src/pattern.c
+++ b/apps/plugins/puzzles/src/pattern.c
@@ -50,14 +50,14 @@ typedef struct game_state_common {
50 int w, h; 50 int w, h;
51 int rowsize; 51 int rowsize;
52 int *rowdata, *rowlen; 52 int *rowdata, *rowlen;
53 unsigned char *immutable; 53 bool *immutable;
54 int refcount; 54 int refcount;
55} game_state_common; 55} game_state_common;
56 56
57struct game_state { 57struct game_state {
58 game_state_common *common; 58 game_state_common *common;
59 unsigned char *grid; 59 unsigned char *grid;
60 int completed, cheated; 60 bool completed, cheated;
61}; 61};
62 62
63#define FLASH_TIME 0.13F 63#define FLASH_TIME 0.13F
@@ -81,13 +81,13 @@ static const struct game_params pattern_presets[] = {
81#endif 81#endif
82}; 82};
83 83
84static int game_fetch_preset(int i, char **name, game_params **params) 84static bool game_fetch_preset(int i, char **name, game_params **params)
85{ 85{
86 game_params *ret; 86 game_params *ret;
87 char str[80]; 87 char str[80];
88 88
89 if (i < 0 || i >= lenof(pattern_presets)) 89 if (i < 0 || i >= lenof(pattern_presets))
90 return FALSE; 90 return false;
91 91
92 ret = snew(game_params); 92 ret = snew(game_params);
93 *ret = pattern_presets[i]; 93 *ret = pattern_presets[i];
@@ -96,7 +96,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
96 96
97 *name = dupstr(str); 97 *name = dupstr(str);
98 *params = ret; 98 *params = ret;
99 return TRUE; 99 return true;
100} 100}
101 101
102static void free_params(game_params *params) 102static void free_params(game_params *params)
@@ -126,7 +126,7 @@ static void decode_params(game_params *ret, char const *string)
126 } 126 }
127} 127}
128 128
129static char *encode_params(const game_params *params, int full) 129static char *encode_params(const game_params *params, bool full)
130{ 130{
131 char ret[400]; 131 char ret[400];
132 int len; 132 int len;
@@ -171,7 +171,7 @@ static game_params *custom_params(const config_item *cfg)
171 return ret; 171 return ret;
172} 172}
173 173
174static const char *validate_params(const game_params *params, int full) 174static const char *validate_params(const game_params *params, bool full)
175{ 175{
176 if (params->w <= 0 || params->h <= 0) 176 if (params->w <= 0 || params->h <= 0)
177 return "Width and height must both be greater than zero"; 177 return "Width and height must both be greater than zero";
@@ -359,10 +359,10 @@ static int compute_rowdata(int *ret, unsigned char *start, int len, int step)
359#define STILL_UNKNOWN 3 359#define STILL_UNKNOWN 3
360 360
361#ifdef STANDALONE_SOLVER 361#ifdef STANDALONE_SOLVER
362int verbose = FALSE; 362bool verbose = false;
363#endif 363#endif
364 364
365static int do_recurse(unsigned char *known, unsigned char *deduced, 365static bool do_recurse(unsigned char *known, unsigned char *deduced,
366 unsigned char *row, 366 unsigned char *row,
367 unsigned char *minpos_done, unsigned char *maxpos_done, 367 unsigned char *minpos_done, unsigned char *maxpos_done,
368 unsigned char *minpos_ok, unsigned char *maxpos_ok, 368 unsigned char *minpos_ok, unsigned char *maxpos_ok,
@@ -416,28 +416,29 @@ static int do_recurse(unsigned char *known, unsigned char *deduced,
416 return lowest >= minpos_ok[ndone] && lowest <= maxpos_ok[ndone]; 416 return lowest >= minpos_ok[ndone] && lowest <= maxpos_ok[ndone];
417 } else { 417 } else {
418 for (i=lowest; i<len; i++) { 418 for (i=lowest; i<len; i++) {
419 if (known[i] == BLOCK) return FALSE; 419 if (known[i] == BLOCK) return false;
420 row[i] = DOT; 420 row[i] = DOT;
421 } 421 }
422 for (i=0; i<len; i++) 422 for (i=0; i<len; i++)
423 deduced[i] |= row[i]; 423 deduced[i] |= row[i];
424 return TRUE; 424 return true;
425 } 425 }
426} 426}
427 427
428 428
429static int do_row(unsigned char *known, unsigned char *deduced, 429static bool do_row(unsigned char *known, unsigned char *deduced,
430 unsigned char *row, 430 unsigned char *row,
431 unsigned char *minpos_done, unsigned char *maxpos_done, 431 unsigned char *minpos_done, unsigned char *maxpos_done,
432 unsigned char *minpos_ok, unsigned char *maxpos_ok, 432 unsigned char *minpos_ok, unsigned char *maxpos_ok,
433 unsigned char *start, int len, int step, int *data, 433 unsigned char *start, int len, int step, int *data,
434 unsigned int *changed 434 unsigned int *changed
435#ifdef STANDALONE_SOLVER 435#ifdef STANDALONE_SOLVER
436 , const char *rowcol, int index, int cluewid 436 , const char *rowcol, int index, int cluewid
437#endif 437#endif
438 ) 438 )
439{ 439{
440 int rowlen, i, freespace, done_any; 440 int rowlen, i, freespace;
441 bool done_any;
441 442
442 freespace = len+1; 443 freespace = len+1;
443 for (rowlen = 0; data[rowlen]; rowlen++) { 444 for (rowlen = 0; data[rowlen]; rowlen++) {
@@ -462,12 +463,12 @@ static int do_row(unsigned char *known, unsigned char *deduced,
462 maxpos_ok, data, len, freespace, 0, 0); 463 maxpos_ok, data, len, freespace, 0, 0);
463 } 464 }
464 465
465 done_any = FALSE; 466 done_any = false;
466 for (i=0; i<len; i++) 467 for (i=0; i<len; i++)
467 if (deduced[i] && deduced[i] != STILL_UNKNOWN && !known[i]) { 468 if (deduced[i] && deduced[i] != STILL_UNKNOWN && !known[i]) {
468 start[i*step] = deduced[i]; 469 start[i*step] = deduced[i];
469 if (changed) changed[i]++; 470 if (changed) changed[i]++;
470 done_any = TRUE; 471 done_any = true;
471 } 472 }
472#ifdef STANDALONE_SOLVER 473#ifdef STANDALONE_SOLVER
473 if (verbose && done_any) { 474 if (verbose && done_any) {
@@ -493,19 +494,20 @@ static int do_row(unsigned char *known, unsigned char *deduced,
493 return done_any; 494 return done_any;
494} 495}
495 496
496static int solve_puzzle(const game_state *state, unsigned char *grid, 497static bool solve_puzzle(const game_state *state, unsigned char *grid,
497 int w, int h, 498 int w, int h,
498 unsigned char *matrix, unsigned char *workspace, 499 unsigned char *matrix, unsigned char *workspace,
499 unsigned int *changed_h, unsigned int *changed_w, 500 unsigned int *changed_h, unsigned int *changed_w,
500 int *rowdata 501 int *rowdata
501#ifdef STANDALONE_SOLVER 502#ifdef STANDALONE_SOLVER
502 , int cluewid 503 , int cluewid
503#else 504#else
504 , int dummy 505 , int dummy
505#endif 506#endif
506 ) 507 )
507{ 508{
508 int i, j, ok, max; 509 int i, j, max;
510 bool ok;
509 int max_h, max_w; 511 int max_h, max_w;
510 512
511 assert((state!=NULL && state->common->rowdata!=NULL) ^ (grid!=NULL)); 513 assert((state!=NULL && state->common->rowdata!=NULL) ^ (grid!=NULL));
@@ -637,11 +639,11 @@ static int solve_puzzle(const game_state *state, unsigned char *grid,
637 } 639 }
638 } while (max_h>0 || max_w>0); 640 } while (max_h>0 || max_w>0);
639 641
640 ok = TRUE; 642 ok = true;
641 for (i=0; i<h; i++) { 643 for (i=0; i<h; i++) {
642 for (j=0; j<w; j++) { 644 for (j=0; j<w; j++) {
643 if (matrix[i*w+j] == UNKNOWN) 645 if (matrix[i*w+j] == UNKNOWN)
644 ok = FALSE; 646 ok = false;
645 } 647 }
646 } 648 }
647 649
@@ -651,7 +653,8 @@ static int solve_puzzle(const game_state *state, unsigned char *grid,
651#ifndef STANDALONE_PICTURE_GENERATOR 653#ifndef STANDALONE_PICTURE_GENERATOR
652static unsigned char *generate_soluble(random_state *rs, int w, int h) 654static unsigned char *generate_soluble(random_state *rs, int w, int h)
653{ 655{
654 int i, j, ok, ntries, max; 656 int i, j, ntries, max;
657 bool ok;
655 unsigned char *grid, *matrix, *workspace; 658 unsigned char *grid, *matrix, *workspace;
656 unsigned int *changed_h, *changed_w; 659 unsigned int *changed_h, *changed_w;
657 int *rowdata; 660 int *rowdata;
@@ -679,14 +682,14 @@ static unsigned char *generate_soluble(random_state *rs, int w, int h)
679 * made for rows/columns that are under 3 squares, 682 * made for rows/columns that are under 3 squares,
680 * otherwise nothing will ever be successfully generated. 683 * otherwise nothing will ever be successfully generated.
681 */ 684 */
682 ok = TRUE; 685 ok = true;
683 if (w > 2) { 686 if (w > 2) {
684 for (i = 0; i < h; i++) { 687 for (i = 0; i < h; i++) {
685 int colours = 0; 688 int colours = 0;
686 for (j = 0; j < w; j++) 689 for (j = 0; j < w; j++)
687 colours |= (grid[i*w+j] == GRID_FULL ? 2 : 1); 690 colours |= (grid[i*w+j] == GRID_FULL ? 2 : 1);
688 if (colours != 3) 691 if (colours != 3)
689 ok = FALSE; 692 ok = false;
690 } 693 }
691 } 694 }
692 if (h > 2) { 695 if (h > 2) {
@@ -695,7 +698,7 @@ static unsigned char *generate_soluble(random_state *rs, int w, int h)
695 for (i = 0; i < h; i++) 698 for (i = 0; i < h; i++)
696 colours |= (grid[i*w+j] == GRID_FULL ? 2 : 1); 699 colours |= (grid[i*w+j] == GRID_FULL ? 2 : 1);
697 if (colours != 3) 700 if (colours != 3)
698 ok = FALSE; 701 ok = false;
699 } 702 }
700 } 703 }
701 if (!ok) 704 if (!ok)
@@ -719,7 +722,7 @@ unsigned char *picture;
719#endif 722#endif
720 723
721static char *new_game_desc(const game_params *params, random_state *rs, 724static char *new_game_desc(const game_params *params, random_state *rs,
722 char **aux, int interactive) 725 char **aux, bool interactive)
723{ 726{
724 unsigned char *grid; 727 unsigned char *grid;
725 int i, j, max, rowlen, *rowdata; 728 int i, j, max, rowlen, *rowdata;
@@ -746,8 +749,9 @@ static char *new_game_desc(const game_params *params, random_state *rs,
746 state->grid = grid; 749 state->grid = grid;
747 state->common = snew(game_state_common); 750 state->common = snew(game_state_common);
748 state->common->rowdata = NULL; 751 state->common->rowdata = NULL;
749 state->common->immutable = snewn(params->w * params->h, unsigned char); 752 state->common->immutable = snewn(params->w * params->h, bool);
750 memset(state->common->immutable, 1, params->w * params->h); 753 for (i = 0; i < params->w * params->h; i++)
754 state->common->immutable[i] = true;
751 755
752 index = snewn(params->w * params->h, int); 756 index = snewn(params->w * params->h, int);
753 for (i = 0; i < params->w * params->h; i++) 757 for (i = 0; i < params->w * params->h; i++)
@@ -761,11 +765,11 @@ static char *new_game_desc(const game_params *params, random_state *rs,
761 unsigned int *changed_w = snewn(max+1, unsigned int); 765 unsigned int *changed_w = snewn(max+1, unsigned int);
762 int *rowdata = snewn(max+1, int); 766 int *rowdata = snewn(max+1, int);
763 for (i = 0; i < params->w * params->h; i++) { 767 for (i = 0; i < params->w * params->h; i++) {
764 state->common->immutable[index[i]] = 0; 768 state->common->immutable[index[i]] = false;
765 if (!solve_puzzle(state, grid, params->w, params->h, 769 if (!solve_puzzle(state, grid, params->w, params->h,
766 matrix, workspace, changed_h, changed_w, 770 matrix, workspace, changed_h, changed_w,
767 rowdata, 0)) 771 rowdata, 0))
768 state->common->immutable[index[i]] = 1; 772 state->common->immutable[index[i]] = true;
769 } 773 }
770 sfree(workspace); 774 sfree(workspace);
771 sfree(changed_h); 775 sfree(changed_h);
@@ -974,14 +978,15 @@ static game_state *new_game(midend *me, const game_params *params,
974 memset(state->grid, GRID_UNKNOWN, state->common->w * state->common->h); 978 memset(state->grid, GRID_UNKNOWN, state->common->w * state->common->h);
975 979
976 state->common->immutable = snewn(state->common->w * state->common->h, 980 state->common->immutable = snewn(state->common->w * state->common->h,
977 unsigned char); 981 bool);
978 memset(state->common->immutable, 0, state->common->w * state->common->h); 982 memset(state->common->immutable, 0,
983 state->common->w * state->common->h * sizeof(bool));
979 984
980 state->common->rowsize = max(state->common->w, state->common->h); 985 state->common->rowsize = max(state->common->w, state->common->h);
981 state->common->rowdata = snewn(state->common->rowsize * (state->common->w + state->common->h), int); 986 state->common->rowdata = snewn(state->common->rowsize * (state->common->w + state->common->h), int);
982 state->common->rowlen = snewn(state->common->w + state->common->h, int); 987 state->common->rowlen = snewn(state->common->w + state->common->h, int);
983 988
984 state->completed = state->cheated = FALSE; 989 state->completed = state->cheated = false;
985 990
986 for (i = 0; i < params->w + params->h; i++) { 991 for (i = 0; i < params->w + params->h; i++) {
987 state->common->rowlen[i] = 0; 992 state->common->rowlen[i] = 0;
@@ -1005,11 +1010,12 @@ static game_state *new_game(midend *me, const game_params *params,
1005 i = 0; 1010 i = 0;
1006 while (i < params->w * params->h) { 1011 while (i < params->w * params->h) {
1007 int c = (unsigned char)*desc++; 1012 int c = (unsigned char)*desc++;
1008 int full = isupper(c), len = tolower(c) - 'a'; 1013 bool full = isupper(c);
1014 int len = tolower(c) - 'a';
1009 i += len; 1015 i += len;
1010 if (len < 25 && i < params->w*params->h) { 1016 if (len < 25 && i < params->w*params->h) {
1011 state->grid[i] = full ? GRID_FULL : GRID_EMPTY; 1017 state->grid[i] = full ? GRID_FULL : GRID_EMPTY;
1012 state->common->immutable[i] = TRUE; 1018 state->common->immutable[i] = true;
1013 i++; 1019 i++;
1014 } 1020 }
1015 } 1021 }
@@ -1053,7 +1059,8 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1053 int w = state->common->w, h = state->common->h; 1059 int w = state->common->w, h = state->common->h;
1054 int i; 1060 int i;
1055 char *ret; 1061 char *ret;
1056 int max, ok; 1062 int max;
1063 bool ok;
1057 unsigned char *workspace; 1064 unsigned char *workspace;
1058 unsigned int *changed_h, *changed_w; 1065 unsigned int *changed_h, *changed_w;
1059 int *rowdata; 1066 int *rowdata;
@@ -1098,9 +1105,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1098 return ret; 1105 return ret;
1099} 1106}
1100 1107
1101static int game_can_format_as_text_now(const game_params *params) 1108static bool game_can_format_as_text_now(const game_params *params)
1102{ 1109{
1103 return TRUE; 1110 return true;
1104} 1111}
1105 1112
1106static char *game_text_format(const game_state *state) 1113static char *game_text_format(const game_state *state)
@@ -1120,11 +1127,12 @@ static char *game_text_format(const game_state *state)
1120 } 1127 }
1121 } 1128 }
1122 for (i = 0; i < h; ++i) { 1129 for (i = 0; i < h; ++i) {
1123 int rowlen = 0, predecessors = FALSE; 1130 int rowlen = 0;
1131 bool predecessors = false;
1124 for (j = 0; j < state->common->rowlen[i+w]; ++j) { 1132 for (j = 0; j < state->common->rowlen[i+w]; ++j) {
1125 int copy = state->common->rowdata[(i+w)*state->common->rowsize + j]; 1133 int copy = state->common->rowdata[(i+w)*state->common->rowsize + j];
1126 rowlen += predecessors; 1134 rowlen += predecessors;
1127 predecessors = TRUE; 1135 predecessors = true;
1128 do ++rowlen; while (copy /= 10); 1136 do ++rowlen; while (copy /= 10);
1129 } 1137 }
1130 left_gap = max(left_gap, rowlen); 1138 left_gap = max(left_gap, rowlen);
@@ -1172,7 +1180,7 @@ static char *game_text_format(const game_state *state)
1172 int cell = topleft + i*cw + j*ch*lw; 1180 int cell = topleft + i*cw + j*ch*lw;
1173 int center = cell + cw/2 + (ch/2)*lw; 1181 int center = cell + cw/2 + (ch/2)*lw;
1174 int dx, dy; 1182 int dx, dy;
1175 board[cell] = 0 ? center : '+'; 1183 board[cell] = false ? center : '+';
1176 for (dx = 1; dx < cw; ++dx) board[cell + dx] = '-'; 1184 for (dx = 1; dx < cw; ++dx) board[cell + dx] = '-';
1177 for (dy = 1; dy < ch; ++dy) board[cell + dy*lw] = '|'; 1185 for (dy = 1; dy < ch; ++dy) board[cell + dy*lw] = '|';
1178 if (state->grid[i*w+j] == GRID_UNKNOWN) continue; 1186 if (state->grid[i*w+j] == GRID_UNKNOWN) continue;
@@ -1191,13 +1199,14 @@ static char *game_text_format(const game_state *state)
1191} 1199}
1192 1200
1193struct game_ui { 1201struct game_ui {
1194 int dragging; 1202 bool dragging;
1195 int drag_start_x; 1203 int drag_start_x;
1196 int drag_start_y; 1204 int drag_start_y;
1197 int drag_end_x; 1205 int drag_end_x;
1198 int drag_end_y; 1206 int drag_end_y;
1199 int drag, release, state; 1207 int drag, release, state;
1200 int cur_x, cur_y, cur_visible; 1208 int cur_x, cur_y;
1209 bool cur_visible;
1201}; 1210};
1202 1211
1203static game_ui *new_ui(const game_state *state) 1212static game_ui *new_ui(const game_state *state)
@@ -1205,8 +1214,9 @@ static game_ui *new_ui(const game_state *state)
1205 game_ui *ret; 1214 game_ui *ret;
1206 1215
1207 ret = snew(game_ui); 1216 ret = snew(game_ui);
1208 ret->dragging = FALSE; 1217 ret->dragging = false;
1209 ret->cur_x = ret->cur_y = ret->cur_visible = 0; 1218 ret->cur_x = ret->cur_y = 0;
1219 ret->cur_visible = false;
1210 1220
1211 return ret; 1221 return ret;
1212} 1222}
@@ -1231,7 +1241,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1231} 1241}
1232 1242
1233struct game_drawstate { 1243struct game_drawstate {
1234 int started; 1244 bool started;
1235 int w, h; 1245 int w, h;
1236 int tilesize; 1246 int tilesize;
1237 unsigned char *visible, *numcolours; 1247 unsigned char *visible, *numcolours;
@@ -1242,7 +1252,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1242 const game_drawstate *ds, 1252 const game_drawstate *ds,
1243 int x, int y, int button) 1253 int x, int y, int button)
1244{ 1254{
1245 int control = button & MOD_CTRL, shift = button & MOD_SHFT; 1255 bool control = button & MOD_CTRL, shift = button & MOD_SHFT;
1246 button &= ~MOD_MASK; 1256 button &= ~MOD_MASK;
1247 1257
1248 x = FROMCOORD(state->common->w, x); 1258 x = FROMCOORD(state->common->w, x);
@@ -1255,7 +1265,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1255 int currstate = state->grid[y * state->common->w + x]; 1265 int currstate = state->grid[y * state->common->w + x];
1256#endif 1266#endif
1257 1267
1258 ui->dragging = TRUE; 1268 ui->dragging = true;
1259 1269
1260 if (button == LEFT_BUTTON) { 1270 if (button == LEFT_BUTTON) {
1261 ui->drag = LEFT_DRAG; 1271 ui->drag = LEFT_DRAG;
@@ -1281,7 +1291,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1281 1291
1282 ui->drag_start_x = ui->drag_end_x = x; 1292 ui->drag_start_x = ui->drag_end_x = x;
1283 ui->drag_start_y = ui->drag_end_y = y; 1293 ui->drag_start_y = ui->drag_end_y = y;
1284 ui->cur_visible = 0; 1294 ui->cur_visible = false;
1285 1295
1286 return UI_UPDATE; 1296 return UI_UPDATE;
1287 } 1297 }
@@ -1317,7 +1327,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1317 1327
1318 if (ui->dragging && button == ui->release) { 1328 if (ui->dragging && button == ui->release) {
1319 int x1, x2, y1, y2, xx, yy; 1329 int x1, x2, y1, y2, xx, yy;
1320 int move_needed = FALSE; 1330 bool move_needed = false;
1321 1331
1322 x1 = min(ui->drag_start_x, ui->drag_end_x); 1332 x1 = min(ui->drag_start_x, ui->drag_end_x);
1323 x2 = max(ui->drag_start_x, ui->drag_end_x); 1333 x2 = max(ui->drag_start_x, ui->drag_end_x);
@@ -1328,9 +1338,9 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1328 for (xx = x1; xx <= x2; xx++) 1338 for (xx = x1; xx <= x2; xx++)
1329 if (!state->common->immutable[yy * state->common->w + xx] && 1339 if (!state->common->immutable[yy * state->common->w + xx] &&
1330 state->grid[yy * state->common->w + xx] != ui->state) 1340 state->grid[yy * state->common->w + xx] != ui->state)
1331 move_needed = TRUE; 1341 move_needed = true;
1332 1342
1333 ui->dragging = FALSE; 1343 ui->dragging = false;
1334 1344
1335 if (move_needed) { 1345 if (move_needed) {
1336 char buf[80]; 1346 char buf[80];
@@ -1346,8 +1356,8 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1346 if (IS_CURSOR_MOVE(button)) { 1356 if (IS_CURSOR_MOVE(button)) {
1347 int x = ui->cur_x, y = ui->cur_y, newstate; 1357 int x = ui->cur_x, y = ui->cur_y, newstate;
1348 char buf[80]; 1358 char buf[80];
1349 move_cursor(button, &ui->cur_x, &ui->cur_y, state->common->w, state->common->h, 0); 1359 move_cursor(button, &ui->cur_x, &ui->cur_y, state->common->w, state->common->h, false);
1350 ui->cur_visible = 1; 1360 ui->cur_visible = true;
1351 if (!control && !shift) return UI_UPDATE; 1361 if (!control && !shift) return UI_UPDATE;
1352 1362
1353 newstate = control ? shift ? GRID_UNKNOWN : GRID_FULL : GRID_EMPTY; 1363 newstate = control ? shift ? GRID_UNKNOWN : GRID_FULL : GRID_EMPTY;
@@ -1367,7 +1377,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1367 char buf[80]; 1377 char buf[80];
1368 1378
1369 if (!ui->cur_visible) { 1379 if (!ui->cur_visible) {
1370 ui->cur_visible = 1; 1380 ui->cur_visible = true;
1371 return UI_UPDATE; 1381 return UI_UPDATE;
1372 } 1382 }
1373 1383
@@ -1403,7 +1413,7 @@ static game_state *execute_move(const game_state *from, const char *move)
1403 for (i = 0; i < ret->common->w * ret->common->h; i++) 1413 for (i = 0; i < ret->common->w * ret->common->h; i++)
1404 ret->grid[i] = (move[i+1] == '1' ? GRID_FULL : GRID_EMPTY); 1414 ret->grid[i] = (move[i+1] == '1' ? GRID_FULL : GRID_EMPTY);
1405 1415
1406 ret->completed = ret->cheated = TRUE; 1416 ret->completed = ret->cheated = true;
1407 1417
1408 return ret; 1418 return ret;
1409 } else if ((move[0] == 'F' || move[0] == 'E' || move[0] == 'U') && 1419 } else if ((move[0] == 'F' || move[0] == 'E' || move[0] == 'U') &&
@@ -1430,7 +1440,7 @@ static game_state *execute_move(const game_state *from, const char *move)
1430 int *rowdata = snewn(ret->common->rowsize, int); 1440 int *rowdata = snewn(ret->common->rowsize, int);
1431 int i, len; 1441 int i, len;
1432 1442
1433 ret->completed = TRUE; 1443 ret->completed = true;
1434 1444
1435 for (i=0; i<ret->common->w; i++) { 1445 for (i=0; i<ret->common->w; i++) {
1436 len = compute_rowdata(rowdata, ret->grid+i, 1446 len = compute_rowdata(rowdata, ret->grid+i,
@@ -1438,7 +1448,7 @@ static game_state *execute_move(const game_state *from, const char *move)
1438 if (len != ret->common->rowlen[i] || 1448 if (len != ret->common->rowlen[i] ||
1439 memcmp(ret->common->rowdata+i*ret->common->rowsize, 1449 memcmp(ret->common->rowdata+i*ret->common->rowsize,
1440 rowdata, len * sizeof(int))) { 1450 rowdata, len * sizeof(int))) {
1441 ret->completed = FALSE; 1451 ret->completed = false;
1442 break; 1452 break;
1443 } 1453 }
1444 } 1454 }
@@ -1449,7 +1459,7 @@ static game_state *execute_move(const game_state *from, const char *move)
1449 memcmp(ret->common->rowdata + 1459 memcmp(ret->common->rowdata +
1450 (i+ret->common->w)*ret->common->rowsize, 1460 (i+ret->common->w)*ret->common->rowsize,
1451 rowdata, len * sizeof(int))) { 1461 rowdata, len * sizeof(int))) {
1452 ret->completed = FALSE; 1462 ret->completed = false;
1453 break; 1463 break;
1454 } 1464 }
1455 } 1465 }
@@ -1537,7 +1547,7 @@ struct errcheck_state {
1537 int ncontig; 1547 int ncontig;
1538}; 1548};
1539 1549
1540static int errcheck_found_run(struct errcheck_state *es, int r) 1550static bool errcheck_found_run(struct errcheck_state *es, int r)
1541{ 1551{
1542/* Macro to handle the pretence that rowdata has a 0 at each end */ 1552/* Macro to handle the pretence that rowdata has a 0 at each end */
1543#define ROWDATA(k) ((k)<0 || (k)>=es->rowlen ? 0 : es->rowdata[(k)]) 1553#define ROWDATA(k) ((k)<0 || (k)>=es->rowlen ? 0 : es->rowdata[(k)])
@@ -1558,17 +1568,17 @@ static int errcheck_found_run(struct errcheck_state *es, int r)
1558 1568
1559 es->rowpos = newpos+1; 1569 es->rowpos = newpos+1;
1560 es->ncontig++; 1570 es->ncontig++;
1561 return TRUE; 1571 return true;
1562 1572
1563 notfound:; 1573 notfound:;
1564 } 1574 }
1565 1575
1566 return FALSE; 1576 return false;
1567 1577
1568#undef ROWDATA 1578#undef ROWDATA
1569} 1579}
1570 1580
1571static int check_errors(const game_state *state, int i) 1581static bool check_errors(const game_state *state, int i)
1572{ 1582{
1573 int start, step, end, j; 1583 int start, step, end, j;
1574 int val, runlen; 1584 int val, runlen;
@@ -1606,7 +1616,7 @@ static int check_errors(const game_state *state, int i)
1606 } else if (val == GRID_EMPTY) { 1616 } else if (val == GRID_EMPTY) {
1607 if (runlen > 0) { 1617 if (runlen > 0) {
1608 if (!errcheck_found_run(es, runlen)) 1618 if (!errcheck_found_run(es, runlen))
1609 return TRUE; /* error! */ 1619 return true; /* error! */
1610 } 1620 }
1611 runlen = 0; 1621 runlen = 0;
1612 } 1622 }
@@ -1616,9 +1626,9 @@ static int check_errors(const game_state *state, int i)
1616 * zero run, which will be marked as contiguous with the previous 1626 * zero run, which will be marked as contiguous with the previous
1617 * run if and only if there hasn't been a GRID_UNKNOWN before. */ 1627 * run if and only if there hasn't been a GRID_UNKNOWN before. */
1618 if (!errcheck_found_run(es, 0)) 1628 if (!errcheck_found_run(es, 0))
1619 return TRUE; /* error at the last minute! */ 1629 return true; /* error at the last minute! */
1620 1630
1621 return FALSE; /* no error */ 1631 return false; /* no error */
1622} 1632}
1623 1633
1624/* ---------------------------------------------------------------------- 1634/* ----------------------------------------------------------------------
@@ -1671,7 +1681,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1671{ 1681{
1672 struct game_drawstate *ds = snew(struct game_drawstate); 1682 struct game_drawstate *ds = snew(struct game_drawstate);
1673 1683
1674 ds->started = FALSE; 1684 ds->started = false;
1675 ds->w = state->common->w; 1685 ds->w = state->common->w;
1676 ds->h = state->common->h; 1686 ds->h = state->common->h;
1677 ds->visible = snewn(ds->w * ds->h, unsigned char); 1687 ds->visible = snewn(ds->w * ds->h, unsigned char);
@@ -1691,7 +1701,7 @@ static void game_free_drawstate(drawing *dr, game_drawstate *ds)
1691} 1701}
1692 1702
1693static void grid_square(drawing *dr, game_drawstate *ds, 1703static void grid_square(drawing *dr, game_drawstate *ds,
1694 int y, int x, int state, int cur) 1704 int y, int x, int state, bool cur)
1695{ 1705{
1696 int xl, xr, yt, yb, dx, dy, dw, dh; 1706 int xl, xr, yt, yb, dx, dy, dw, dh;
1697 1707
@@ -1723,8 +1733,9 @@ static void grid_square(drawing *dr, game_drawstate *ds,
1723/* 1733/*
1724 * Draw the numbers for a single row or column. 1734 * Draw the numbers for a single row or column.
1725 */ 1735 */
1726static void draw_numbers(drawing *dr, game_drawstate *ds, 1736static void draw_numbers(
1727 const game_state *state, int i, int erase, int colour) 1737 drawing *dr, game_drawstate *ds, const game_state *state,
1738 int i, bool erase, int colour)
1728{ 1739{
1729 int rowlen = state->common->rowlen[i]; 1740 int rowlen = state->common->rowlen[i];
1730 int *rowdata = state->common->rowdata + state->common->rowsize * i; 1741 int *rowdata = state->common->rowdata + state->common->rowsize * i;
@@ -1790,7 +1801,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1790{ 1801{
1791 int i, j; 1802 int i, j;
1792 int x1, x2, y1, y2; 1803 int x1, x2, y1, y2;
1793 int cx, cy, cmoved; 1804 int cx, cy;
1805 bool cmoved;
1794 1806
1795 if (!ds->started) { 1807 if (!ds->started) {
1796 /* 1808 /*
@@ -1808,7 +1820,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1808 ds->w * TILE_SIZE + 3, ds->h * TILE_SIZE + 3, 1820 ds->w * TILE_SIZE + 3, ds->h * TILE_SIZE + 3,
1809 COL_GRID); 1821 COL_GRID);
1810 1822
1811 ds->started = TRUE; 1823 ds->started = true;
1812 1824
1813 draw_update(dr, 0, 0, SIZE(ds->w), SIZE(ds->h)); 1825 draw_update(dr, 0, 0, SIZE(ds->w), SIZE(ds->h));
1814 } 1826 }
@@ -1835,7 +1847,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1835 */ 1847 */
1836 for (i = 0; i < ds->h; i++) { 1848 for (i = 0; i < ds->h; i++) {
1837 for (j = 0; j < ds->w; j++) { 1849 for (j = 0; j < ds->w; j++) {
1838 int val, cc = 0; 1850 int val;
1851 bool cc = false;
1839 1852
1840 /* 1853 /*
1841 * Work out what state this square should be drawn in, 1854 * Work out what state this square should be drawn in,
@@ -1850,8 +1863,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1850 if (cmoved) { 1863 if (cmoved) {
1851 /* the cursor has moved; if we were the old or 1864 /* the cursor has moved; if we were the old or
1852 * the new cursor position we need to redraw. */ 1865 * the new cursor position we need to redraw. */
1853 if (j == cx && i == cy) cc = 1; 1866 if (j == cx && i == cy) cc = true;
1854 if (j == ds->cur_x && i == ds->cur_y) cc = 1; 1867 if (j == ds->cur_x && i == ds->cur_y) cc = true;
1855 } 1868 }
1856 1869
1857 /* 1870 /*
@@ -1879,7 +1892,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1879 for (i = 0; i < state->common->w + state->common->h; i++) { 1892 for (i = 0; i < state->common->w + state->common->h; i++) {
1880 int colour = check_errors(state, i) ? COL_ERROR : COL_TEXT; 1893 int colour = check_errors(state, i) ? COL_ERROR : COL_TEXT;
1881 if (ds->numcolours[i] != colour) { 1894 if (ds->numcolours[i] != colour) {
1882 draw_numbers(dr, ds, state, i, TRUE, colour); 1895 draw_numbers(dr, ds, state, i, true, colour);
1883 ds->numcolours[i] = colour; 1896 ds->numcolours[i] = colour;
1884 } 1897 }
1885 } 1898 }
@@ -1905,9 +1918,9 @@ static int game_status(const game_state *state)
1905 return state->completed ? +1 : 0; 1918 return state->completed ? +1 : 0;
1906} 1919}
1907 1920
1908static int game_timing_state(const game_state *state, game_ui *ui) 1921static bool game_timing_state(const game_state *state, game_ui *ui)
1909{ 1922{
1910 return TRUE; 1923 return true;
1911} 1924}
1912 1925
1913static void game_print_size(const game_params *params, float *x, float *y) 1926static void game_print_size(const game_params *params, float *x, float *y)
@@ -1957,7 +1970,7 @@ static void game_print(drawing *dr, const game_state *state, int tilesize)
1957 * Clues. 1970 * Clues.
1958 */ 1971 */
1959 for (i = 0; i < state->common->w + state->common->h; i++) 1972 for (i = 0; i < state->common->w + state->common->h; i++)
1960 draw_numbers(dr, ds, state, i, FALSE, ink); 1973 draw_numbers(dr, ds, state, i, false, ink);
1961 1974
1962 /* 1975 /*
1963 * Solution. 1976 * Solution.
@@ -1987,15 +2000,15 @@ const struct game thegame = {
1987 encode_params, 2000 encode_params,
1988 free_params, 2001 free_params,
1989 dup_params, 2002 dup_params,
1990 TRUE, game_configure, custom_params, 2003 true, game_configure, custom_params,
1991 validate_params, 2004 validate_params,
1992 new_game_desc, 2005 new_game_desc,
1993 validate_desc, 2006 validate_desc,
1994 new_game, 2007 new_game,
1995 dup_game, 2008 dup_game,
1996 free_game, 2009 free_game,
1997 TRUE, solve_game, 2010 true, solve_game,
1998 TRUE, game_can_format_as_text_now, game_text_format, 2011 true, game_can_format_as_text_now, game_text_format,
1999 new_ui, 2012 new_ui,
2000 free_ui, 2013 free_ui,
2001 encode_ui, 2014 encode_ui,
@@ -2012,9 +2025,9 @@ const struct game thegame = {
2012 game_anim_length, 2025 game_anim_length,
2013 game_flash_length, 2026 game_flash_length,
2014 game_status, 2027 game_status,
2015 TRUE, FALSE, game_print_size, game_print, 2028 true, false, game_print_size, game_print,
2016 FALSE, /* wants_statusbar */ 2029 false, /* wants_statusbar */
2017 FALSE, game_timing_state, 2030 false, game_timing_state,
2018 REQUIRE_RBUTTON, /* flags */ 2031 REQUIRE_RBUTTON, /* flags */
2019}; 2032};
2020 2033
@@ -2031,7 +2044,7 @@ int main(int argc, char **argv)
2031 char *p = *++argv; 2044 char *p = *++argv;
2032 if (*p == '-') { 2045 if (*p == '-') {
2033 if (!strcmp(p, "-v")) { 2046 if (!strcmp(p, "-v")) {
2034 verbose = TRUE; 2047 verbose = true;
2035 } else { 2048 } else {
2036 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p); 2049 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p);
2037 return 1; 2050 return 1;
@@ -2251,8 +2264,8 @@ int main(int argc, char **argv)
2251 2264
2252 rs = random_new((void*)&seed, sizeof(time_t)); 2265 rs = random_new((void*)&seed, sizeof(time_t));
2253 2266
2254 desc = new_game_desc(par, rs, NULL, FALSE); 2267 desc = new_game_desc(par, rs, NULL, false);
2255 params = encode_params(par, FALSE); 2268 params = encode_params(par, false);
2256 printf("%s:%s\n", params, desc); 2269 printf("%s:%s\n", params, desc);
2257 2270
2258 sfree(desc); 2271 sfree(desc);
diff --git a/apps/plugins/puzzles/src/pearl.c b/apps/plugins/puzzles/src/pearl.c
index 07949b5a99..ccbba51897 100644
--- a/apps/plugins/puzzles/src/pearl.c
+++ b/apps/plugins/puzzles/src/pearl.c
@@ -113,7 +113,7 @@ static char const pearl_diffchars[] = DIFFLIST(ENCODE);
113struct game_params { 113struct game_params {
114 int w, h; 114 int w, h;
115 int difficulty; 115 int difficulty;
116 int nosolve; /* XXX remove me! */ 116 bool nosolve; /* XXX remove me! */
117}; 117};
118 118
119struct shared_state { 119struct shared_state {
@@ -129,7 +129,7 @@ struct game_state {
129 char *lines; /* size w*h: lines placed */ 129 char *lines; /* size w*h: lines placed */
130 char *errors; /* size w*h: errors detected */ 130 char *errors; /* size w*h: errors detected */
131 char *marks; /* size w*h: 'no line here' marks placed. */ 131 char *marks; /* size w*h: 'no line here' marks placed. */
132 int completed, used_solve; 132 bool completed, used_solve;
133}; 133};
134 134
135#define DEFAULT_PRESET 3 135#define DEFAULT_PRESET 3
@@ -150,17 +150,17 @@ static game_params *default_params(void)
150 game_params *ret = snew(game_params); 150 game_params *ret = snew(game_params);
151 151
152 *ret = pearl_presets[DEFAULT_PRESET]; 152 *ret = pearl_presets[DEFAULT_PRESET];
153 ret->nosolve = FALSE; 153 ret->nosolve = false;
154 154
155 return ret; 155 return ret;
156} 156}
157 157
158static int game_fetch_preset(int i, char **name, game_params **params) 158static bool game_fetch_preset(int i, char **name, game_params **params)
159{ 159{
160 game_params *ret; 160 game_params *ret;
161 char buf[64]; 161 char buf[64];
162 162
163 if (i < 0 || i >= lenof(pearl_presets)) return FALSE; 163 if (i < 0 || i >= lenof(pearl_presets)) return false;
164 164
165 ret = default_params(); 165 ret = default_params();
166 *ret = pearl_presets[i]; /* struct copy */ 166 *ret = pearl_presets[i]; /* struct copy */
@@ -171,7 +171,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
171 pearl_diffnames[pearl_presets[i].difficulty]); 171 pearl_diffnames[pearl_presets[i].difficulty]);
172 *name = dupstr(buf); 172 *name = dupstr(buf);
173 173
174 return TRUE; 174 return true;
175} 175}
176 176
177static void free_params(game_params *params) 177static void free_params(game_params *params)
@@ -206,14 +206,14 @@ static void decode_params(game_params *ret, char const *string)
206 if (*string) string++; 206 if (*string) string++;
207 } 207 }
208 208
209 ret->nosolve = FALSE; 209 ret->nosolve = false;
210 if (*string == 'n') { 210 if (*string == 'n') {
211 ret->nosolve = TRUE; 211 ret->nosolve = true;
212 string++; 212 string++;
213 } 213 }
214} 214}
215 215
216static char *encode_params(const game_params *params, int full) 216static char *encode_params(const game_params *params, bool full)
217{ 217{
218 char buf[256]; 218 char buf[256];
219 sprintf(buf, "%dx%d", params->w, params->h); 219 sprintf(buf, "%dx%d", params->w, params->h);
@@ -268,7 +268,7 @@ static game_params *custom_params(const config_item *cfg)
268 return ret; 268 return ret;
269} 269}
270 270
271static const char *validate_params(const game_params *params, int full) 271static const char *validate_params(const game_params *params, bool full)
272{ 272{
273 if (params->w < 5) return "Width must be at least five"; 273 if (params->w < 5) return "Width must be at least five";
274 if (params->h < 5) return "Height must be at least five"; 274 if (params->h < 5) return "Height must be at least five";
@@ -282,8 +282,8 @@ static const char *validate_params(const game_params *params, int full)
282 * Solver. 282 * Solver.
283 */ 283 */
284 284
285int pearl_solve(int w, int h, char *clues, char *result, 285static int pearl_solve(int w, int h, char *clues, char *result,
286 int difficulty, int partial) 286 int difficulty, bool partial)
287{ 287{
288 int W = 2*w+1, H = 2*h+1; 288 int W = 2*w+1, H = 2*h+1;
289 short *workspace; 289 short *workspace;
@@ -347,7 +347,7 @@ int pearl_solve(int w, int h, char *clues, char *result,
347 * Now repeatedly try to find something we can do. 347 * Now repeatedly try to find something we can do.
348 */ 348 */
349 while (1) { 349 while (1) {
350 int done_something = FALSE; 350 bool done_something = false;
351 351
352#ifdef SOLVER_DIAGNOSTICS 352#ifdef SOLVER_DIAGNOSTICS
353 for (y = 0; y < H; y++) { 353 for (y = 0; y < H; y++) {
@@ -383,7 +383,7 @@ int pearl_solve(int w, int h, char *clues, char *result,
383 ex/2, ey/2, (ex+1)/2, (ey+1)/2, 383 ex/2, ey/2, (ex+1)/2, (ey+1)/2,
384 b, x, y); 384 b, x, y);
385#endif 385#endif
386 done_something = TRUE; 386 done_something = true;
387 break; 387 break;
388 } 388 }
389 } 389 }
@@ -437,7 +437,7 @@ int pearl_solve(int w, int h, char *clues, char *result,
437 437
438 if (!(edgeor & d) && workspace[ey*W+ex] == 3) { 438 if (!(edgeor & d) && workspace[ey*W+ex] == 3) {
439 workspace[ey*W+ex] = 2; 439 workspace[ey*W+ex] = 2;
440 done_something = TRUE; 440 done_something = true;
441#ifdef SOLVER_DIAGNOSTICS 441#ifdef SOLVER_DIAGNOSTICS
442 printf("possible states of square (%d,%d) force edge" 442 printf("possible states of square (%d,%d) force edge"
443 " (%d,%d)-(%d,%d) to be disconnected\n", 443 " (%d,%d)-(%d,%d) to be disconnected\n",
@@ -445,7 +445,7 @@ int pearl_solve(int w, int h, char *clues, char *result,
445#endif 445#endif
446 } else if ((edgeand & d) && workspace[ey*W+ex] == 3) { 446 } else if ((edgeand & d) && workspace[ey*W+ex] == 3) {
447 workspace[ey*W+ex] = 1; 447 workspace[ey*W+ex] = 1;
448 done_something = TRUE; 448 done_something = true;
449#ifdef SOLVER_DIAGNOSTICS 449#ifdef SOLVER_DIAGNOSTICS
450 printf("possible states of square (%d,%d) force edge" 450 printf("possible states of square (%d,%d) force edge"
451 " (%d,%d)-(%d,%d) to be connected\n", 451 " (%d,%d)-(%d,%d) to be connected\n",
@@ -483,7 +483,7 @@ int pearl_solve(int w, int h, char *clues, char *result,
483 */ 483 */
484 if (workspace[fy*W+fx] != (1<<type)) { 484 if (workspace[fy*W+fx] != (1<<type)) {
485 workspace[fy*W+fx] = (1<<type); 485 workspace[fy*W+fx] = (1<<type);
486 done_something = TRUE; 486 done_something = true;
487#ifdef SOLVER_DIAGNOSTICS 487#ifdef SOLVER_DIAGNOSTICS
488 printf("corner clue at (%d,%d) forces square " 488 printf("corner clue at (%d,%d) forces square "
489 "(%d,%d) into state %d\n", x, y, 489 "(%d,%d) into state %d\n", x, y,
@@ -501,7 +501,7 @@ int pearl_solve(int w, int h, char *clues, char *result,
501 */ 501 */
502 if (!(workspace[fy*W+fx] & (1<<type))) { 502 if (!(workspace[fy*W+fx] & (1<<type))) {
503 workspace[ey*W+ex] = 2; 503 workspace[ey*W+ex] = 2;
504 done_something = TRUE; 504 done_something = true;
505#ifdef SOLVER_DIAGNOSTICS 505#ifdef SOLVER_DIAGNOSTICS
506 printf("corner clue at (%d,%d), plus square " 506 printf("corner clue at (%d,%d), plus square "
507 "(%d,%d) not being state %d, " 507 "(%d,%d) not being state %d, "
@@ -535,7 +535,7 @@ int pearl_solve(int w, int h, char *clues, char *result,
535 !(workspace[gy*W+gx] & ((1<<( d |A(d))) | 535 !(workspace[gy*W+gx] & ((1<<( d |A(d))) |
536 (1<<( d |C(d)))))) { 536 (1<<( d |C(d)))))) {
537 workspace[(2*y+1)*W+(2*x+1)] &= ~(1<<type); 537 workspace[(2*y+1)*W+(2*x+1)] &= ~(1<<type);
538 done_something = TRUE; 538 done_something = true;
539#ifdef SOLVER_DIAGNOSTICS 539#ifdef SOLVER_DIAGNOSTICS
540 printf("straight clue at (%d,%d) cannot corner at " 540 printf("straight clue at (%d,%d) cannot corner at "
541 "(%d,%d) or (%d,%d) so is not state %d\n", 541 "(%d,%d) or (%d,%d) so is not state %d\n",
@@ -561,7 +561,7 @@ int pearl_solve(int w, int h, char *clues, char *result,
561 if (!(workspace[fy*W+fx] &~ (bLR|bUD)) && 561 if (!(workspace[fy*W+fx] &~ (bLR|bUD)) &&
562 (workspace[gy*W+gx] &~ (bLU|bLD|bRU|bRD))) { 562 (workspace[gy*W+gx] &~ (bLU|bLD|bRU|bRD))) {
563 workspace[gy*W+gx] &= (bLU|bLD|bRU|bRD); 563 workspace[gy*W+gx] &= (bLU|bLD|bRU|bRD);
564 done_something = TRUE; 564 done_something = true;
565#ifdef SOLVER_DIAGNOSTICS 565#ifdef SOLVER_DIAGNOSTICS
566 printf("straight clue at (%d,%d) connecting to " 566 printf("straight clue at (%d,%d) connecting to "
567 "straight at (%d,%d) makes (%d,%d) a " 567 "straight at (%d,%d) makes (%d,%d) a "
@@ -743,7 +743,7 @@ int pearl_solve(int w, int h, char *clues, char *result,
743 * Yes! Mark this edge disconnected. 743 * Yes! Mark this edge disconnected.
744 */ 744 */
745 workspace[y*W+x] = 2; 745 workspace[y*W+x] = 2;
746 done_something = TRUE; 746 done_something = true;
747#ifdef SOLVER_DIAGNOSTICS 747#ifdef SOLVER_DIAGNOSTICS
748 printf("edge (%d,%d)-(%d,%d) would create" 748 printf("edge (%d,%d)-(%d,%d) would create"
749 " a shortcut loop, hence must be" 749 " a shortcut loop, hence must be"
@@ -804,7 +804,7 @@ int pearl_solve(int w, int h, char *clues, char *result,
804 * state invalid. 804 * state invalid.
805 */ 805 */
806 workspace[y*W+x] &= ~(1<<b); 806 workspace[y*W+x] &= ~(1<<b);
807 done_something = TRUE; 807 done_something = true;
808#ifdef SOLVER_DIAGNOSTICS 808#ifdef SOLVER_DIAGNOSTICS
809 printf("square (%d,%d) would create a " 809 printf("square (%d,%d) would create a "
810 "shortcut loop in state %d, " 810 "shortcut loop in state %d, "
@@ -900,7 +900,7 @@ struct pearl_loopgen_bias_ctx {
900 struct pearl_loopgen_bias_ctx_boundary { 900 struct pearl_loopgen_bias_ctx_boundary {
901 int colour; /* FACE_WHITE or FACE_BLACK */ 901 int colour; /* FACE_WHITE or FACE_BLACK */
902 902
903 char *edges; /* is each edge part of the loop? */ 903 bool *edges; /* is each edge part of the loop? */
904 tdq *edges_todo; 904 tdq *edges_todo;
905 905
906 char *vertextypes; /* bits 0-3 == outgoing edge bitmap; 906 char *vertextypes; /* bits 0-3 == outgoing edge bitmap;
@@ -921,7 +921,7 @@ struct pearl_loopgen_bias_ctx {
921 921
922 grid *g; 922 grid *g;
923}; 923};
924int pearl_loopgen_bias(void *vctx, char *board, int face) 924static int pearl_loopgen_bias(void *vctx, char *board, int face)
925{ 925{
926 struct pearl_loopgen_bias_ctx *ctx = (struct pearl_loopgen_bias_ctx *)vctx; 926 struct pearl_loopgen_bias_ctx *ctx = (struct pearl_loopgen_bias_ctx *)vctx;
927 grid *g = ctx->g; 927 grid *g = ctx->g;
@@ -962,8 +962,8 @@ int pearl_loopgen_bias(void *vctx, char *board, int face)
962 grid_edge *e = &g->edges[j]; 962 grid_edge *e = &g->edges[j];
963 int fc1 = e->face1 ? board[e->face1 - g->faces] : FACE_BLACK; 963 int fc1 = e->face1 ? board[e->face1 - g->faces] : FACE_BLACK;
964 int fc2 = e->face2 ? board[e->face2 - g->faces] : FACE_BLACK; 964 int fc2 = e->face2 ? board[e->face2 - g->faces] : FACE_BLACK;
965 int oldedge = b->edges[j]; 965 bool oldedge = b->edges[j];
966 int newedge = (fc1==c) ^ (fc2==c); 966 bool newedge = (fc1==c) ^ (fc2==c);
967 if (oldedge != newedge) { 967 if (oldedge != newedge) {
968 b->edges[j] = newedge; 968 b->edges[j] = newedge;
969 tdq_add(b->vertextypes_todo, e->dot1 - g->dots); 969 tdq_add(b->vertextypes_todo, e->dot1 - g->dots);
@@ -1048,7 +1048,7 @@ int pearl_loopgen_bias(void *vctx, char *board, int face)
1048 return ctx->score; 1048 return ctx->score;
1049} 1049}
1050 1050
1051void pearl_loopgen(int w, int h, char *lines, random_state *rs) 1051static void pearl_loopgen(int w, int h, char *lines, random_state *rs)
1052{ 1052{
1053 grid *g = grid_new(GRID_SQUARE, w-1, h-1, NULL); 1053 grid *g = grid_new(GRID_SQUARE, w-1, h-1, NULL);
1054 char *board = snewn(g->num_faces, char); 1054 char *board = snewn(g->num_faces, char);
@@ -1070,8 +1070,8 @@ void pearl_loopgen(int w, int h, char *lines, random_state *rs)
1070 biasctx.score = 0; 1070 biasctx.score = 0;
1071 memset(biasctx.faces, FACE_GREY, g->num_faces); 1071 memset(biasctx.faces, FACE_GREY, g->num_faces);
1072 for (i = 0; i < 2; i++) { 1072 for (i = 0; i < 2; i++) {
1073 biasctx.boundaries[i].edges = snewn(g->num_edges, char); 1073 biasctx.boundaries[i].edges = snewn(g->num_edges, bool);
1074 memset(biasctx.boundaries[i].edges, 0, g->num_edges); 1074 memset(biasctx.boundaries[i].edges, 0, g->num_edges * sizeof(bool));
1075 biasctx.boundaries[i].edges_todo = tdq_new(g->num_edges); 1075 biasctx.boundaries[i].edges_todo = tdq_new(g->num_edges);
1076 tdq_fill(biasctx.boundaries[i].edges_todo); 1076 tdq_fill(biasctx.boundaries[i].edges_todo);
1077 biasctx.boundaries[i].vertextypes = snewn(g->num_dots, char); 1077 biasctx.boundaries[i].vertextypes = snewn(g->num_dots, char);
@@ -1247,7 +1247,7 @@ static int new_clues(const game_params *params, random_state *rs,
1247 /* 1247 /*
1248 * See if we can solve the puzzle just like this. 1248 * See if we can solve the puzzle just like this.
1249 */ 1249 */
1250 ret = pearl_solve(w, h, clues, grid, diff, FALSE); 1250 ret = pearl_solve(w, h, clues, grid, diff, false);
1251 assert(ret > 0); /* shouldn't be inconsistent! */ 1251 assert(ret > 0); /* shouldn't be inconsistent! */
1252 if (ret != 1) 1252 if (ret != 1)
1253 continue; /* go round and try again */ 1253 continue; /* go round and try again */
@@ -1256,7 +1256,7 @@ static int new_clues(const game_params *params, random_state *rs,
1256 * Check this puzzle isn't too easy. 1256 * Check this puzzle isn't too easy.
1257 */ 1257 */
1258 if (diff > DIFF_EASY) { 1258 if (diff > DIFF_EASY) {
1259 ret = pearl_solve(w, h, clues, grid, diff-1, FALSE); 1259 ret = pearl_solve(w, h, clues, grid, diff-1, false);
1260 assert(ret > 0); 1260 assert(ret > 0);
1261 if (ret == 1) 1261 if (ret == 1)
1262 continue; /* too easy: try again */ 1262 continue; /* too easy: try again */
@@ -1323,7 +1323,7 @@ static int new_clues(const game_params *params, random_state *rs,
1323 clue = clues[y*w+x]; 1323 clue = clues[y*w+x];
1324 clues[y*w+x] = 0; /* try removing this clue */ 1324 clues[y*w+x] = 0; /* try removing this clue */
1325 1325
1326 ret = pearl_solve(w, h, clues, grid, diff, FALSE); 1326 ret = pearl_solve(w, h, clues, grid, diff, false);
1327 assert(ret > 0); 1327 assert(ret > 0);
1328 if (ret != 1) 1328 if (ret != 1)
1329 clues[y*w+x] = clue; /* oops, put it back again */ 1329 clues[y*w+x] = clue; /* oops, put it back again */
@@ -1351,7 +1351,7 @@ static int new_clues(const game_params *params, random_state *rs,
1351} 1351}
1352 1352
1353static char *new_game_desc(const game_params *params, random_state *rs, 1353static char *new_game_desc(const game_params *params, random_state *rs,
1354 char **aux, int interactive) 1354 char **aux, bool interactive)
1355{ 1355{
1356 char *grid, *clues; 1356 char *grid, *clues;
1357 char *desc; 1357 char *desc;
@@ -1416,7 +1416,8 @@ static game_state *new_game(midend *me, const game_params *params,
1416 game_state *state = snew(game_state); 1416 game_state *state = snew(game_state);
1417 int i, j, sz = params->w*params->h; 1417 int i, j, sz = params->w*params->h;
1418 1418
1419 state->completed = state->used_solve = FALSE; 1419 state->completed = false;
1420 state->used_solve = false;
1420 state->shared = snew(struct shared_state); 1421 state->shared = snew(struct shared_state);
1421 1422
1422 state->shared->w = params->w; 1423 state->shared->w = params->w;
@@ -1508,10 +1509,10 @@ static void dsf_update_completion(game_state *state, int ax, int ay, char dir,
1508 dsf_merge(dsf, ac, bc); 1509 dsf_merge(dsf, ac, bc);
1509} 1510}
1510 1511
1511static void check_completion(game_state *state, int mark) 1512static void check_completion(game_state *state, bool mark)
1512{ 1513{
1513 int w = state->shared->w, h = state->shared->h, x, y, i, d; 1514 int w = state->shared->w, h = state->shared->h, x, y, i, d;
1514 int had_error = FALSE; 1515 bool had_error = false;
1515 int *dsf, *component_state; 1516 int *dsf, *component_state;
1516 int nsilly, nloop, npath, largest_comp, largest_size, total_pathsize; 1517 int nsilly, nloop, npath, largest_comp, largest_size, total_pathsize;
1517 enum { COMP_NONE, COMP_LOOP, COMP_PATH, COMP_SILLY, COMP_EMPTY }; 1518 enum { COMP_NONE, COMP_LOOP, COMP_PATH, COMP_SILLY, COMP_EMPTY };
@@ -1522,7 +1523,7 @@ static void check_completion(game_state *state, int mark)
1522 } 1523 }
1523 } 1524 }
1524 1525
1525#define ERROR(x,y,e) do { had_error = TRUE; if (mark) state->errors[(y)*w+(x)] |= (e); } while(0) 1526#define ERROR(x,y,e) do { had_error = true; if (mark) state->errors[(y)*w+(x)] |= (e); } while(0)
1526 1527
1527 /* 1528 /*
1528 * Analyse the solution into loops, paths and stranger things. 1529 * Analyse the solution into loops, paths and stranger things.
@@ -1690,7 +1691,7 @@ static void check_completion(game_state *state, int mark)
1690 * But if not, then we're done! 1691 * But if not, then we're done!
1691 */ 1692 */
1692 if (!had_error) 1693 if (!had_error)
1693 state->completed = TRUE; 1694 state->completed = true;
1694 } 1695 }
1695} 1696}
1696 1697
@@ -1745,11 +1746,11 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1745 * solution from there go back to original state. */ 1746 * solution from there go back to original state. */
1746 ret = pearl_solve(currstate->shared->w, currstate->shared->h, 1747 ret = pearl_solve(currstate->shared->w, currstate->shared->h,
1747 currstate->shared->clues, solved->lines, 1748 currstate->shared->clues, solved->lines,
1748 DIFFCOUNT, FALSE); 1749 DIFFCOUNT, false);
1749 if (ret < 1) 1750 if (ret < 1)
1750 ret = pearl_solve(state->shared->w, state->shared->h, 1751 ret = pearl_solve(state->shared->w, state->shared->h,
1751 state->shared->clues, solved->lines, 1752 state->shared->clues, solved->lines,
1752 DIFFCOUNT, FALSE); 1753 DIFFCOUNT, false);
1753 1754
1754 } 1755 }
1755 1756
@@ -1765,9 +1766,9 @@ done:
1765 return move; 1766 return move;
1766} 1767}
1767 1768
1768static int game_can_format_as_text_now(const game_params *params) 1769static bool game_can_format_as_text_now(const game_params *params)
1769{ 1770{
1770 return TRUE; 1771 return true;
1771} 1772}
1772 1773
1773static char *game_text_format(const game_state *state) 1774static char *game_text_format(const game_state *state)
@@ -1808,7 +1809,7 @@ struct game_ui {
1808 int clickx, clicky; /* pixel position of initial click */ 1809 int clickx, clicky; /* pixel position of initial click */
1809 1810
1810 int curx, cury; /* grid position of keyboard cursor */ 1811 int curx, cury; /* grid position of keyboard cursor */
1811 int cursor_active; /* TRUE iff cursor is shown */ 1812 bool cursor_active; /* true iff cursor is shown */
1812}; 1813};
1813 1814
1814static game_ui *new_ui(const game_state *state) 1815static game_ui *new_ui(const game_state *state)
@@ -1818,7 +1819,7 @@ static game_ui *new_ui(const game_state *state)
1818 1819
1819 ui->ndragcoords = -1; 1820 ui->ndragcoords = -1;
1820 ui->dragcoords = snewn(sz, int); 1821 ui->dragcoords = snewn(sz, int);
1821 ui->cursor_active = FALSE; 1822 ui->cursor_active = false;
1822 ui->curx = ui->cury = 0; 1823 ui->curx = ui->cury = 0;
1823 1824
1824 return ui; 1825 return ui;
@@ -1882,7 +1883,7 @@ static int get_gui_style(void)
1882 1883
1883struct game_drawstate { 1884struct game_drawstate {
1884 int halfsz; 1885 int halfsz;
1885 int started; 1886 bool started;
1886 1887
1887 int w, h, sz; 1888 int w, h, sz;
1888 unsigned int *lflags; /* size w*h */ 1889 unsigned int *lflags; /* size w*h */
@@ -1963,7 +1964,7 @@ static void update_ui_drag(const game_state *state, game_ui *ui,
1963 * 1964 *
1964 * Call it in a loop, like this: 1965 * Call it in a loop, like this:
1965 * 1966 *
1966 * int clearing = TRUE; 1967 * bool clearing = true;
1967 * for (i = 0; i < ui->ndragcoords - 1; i++) { 1968 * for (i = 0; i < ui->ndragcoords - 1; i++) {
1968 * int sx, sy, dx, dy, dir, oldstate, newstate; 1969 * int sx, sy, dx, dy, dir, oldstate, newstate;
1969 * interpret_ui_drag(state, ui, &clearing, i, &sx, &sy, &dx, &dy, 1970 * interpret_ui_drag(state, ui, &clearing, i, &sx, &sy, &dx, &dy,
@@ -1976,7 +1977,7 @@ static void update_ui_drag(const game_state *state, game_ui *ui,
1976 * } 1977 * }
1977 */ 1978 */
1978static void interpret_ui_drag(const game_state *state, const game_ui *ui, 1979static void interpret_ui_drag(const game_state *state, const game_ui *ui,
1979 int *clearing, int i, int *sx, int *sy, 1980 bool *clearing, int i, int *sx, int *sy,
1980 int *dx, int *dy, int *dir, 1981 int *dx, int *dy, int *dir,
1981 int *oldstate, int *newstate) 1982 int *oldstate, int *newstate)
1982{ 1983{
@@ -2003,12 +2004,12 @@ static void interpret_ui_drag(const game_state *state, const game_ui *ui,
2003 * the drag are set rather than cleared. 2004 * the drag are set rather than cleared.
2004 */ 2005 */
2005 *newstate = *dir; 2006 *newstate = *dir;
2006 *clearing = FALSE; 2007 *clearing = false;
2007 } 2008 }
2008} 2009}
2009 2010
2010static char *mark_in_direction(const game_state *state, int x, int y, int dir, 2011static char *mark_in_direction(const game_state *state, int x, int y, int dir,
2011 int primary, char *buf) 2012 bool primary, char *buf)
2012{ 2013{
2013 int w = state->shared->w /*, h = state->shared->h, sz = state->shared->sz */; 2014 int w = state->shared->w /*, h = state->shared->h, sz = state->shared->sz */;
2014 int x2 = x + DX(dir); 2015 int x2 = x + DX(dir);
@@ -2037,14 +2038,14 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2037{ 2038{
2038 int w = state->shared->w, h = state->shared->h /*, sz = state->shared->sz */; 2039 int w = state->shared->w, h = state->shared->h /*, sz = state->shared->sz */;
2039 int gx = FROMCOORD(x), gy = FROMCOORD(y), i; 2040 int gx = FROMCOORD(x), gy = FROMCOORD(y), i;
2040 int release = FALSE; 2041 bool release = false;
2041 char tmpbuf[80]; 2042 char tmpbuf[80];
2042 2043
2043 int shift = button & MOD_SHFT, control = button & MOD_CTRL; 2044 bool shift = button & MOD_SHFT, control = button & MOD_CTRL;
2044 button &= ~MOD_MASK; 2045 button &= ~MOD_MASK;
2045 2046
2046 if (IS_MOUSE_DOWN(button)) { 2047 if (IS_MOUSE_DOWN(button)) {
2047 ui->cursor_active = FALSE; 2048 ui->cursor_active = false;
2048 2049
2049 if (!INGRID(state, gx, gy)) { 2050 if (!INGRID(state, gx, gy)) {
2050 ui->ndragcoords = -1; 2051 ui->ndragcoords = -1;
@@ -2063,22 +2064,22 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2063 return UI_UPDATE; 2064 return UI_UPDATE;
2064 } 2065 }
2065 2066
2066 if (IS_MOUSE_RELEASE(button)) release = TRUE; 2067 if (IS_MOUSE_RELEASE(button)) release = true;
2067 2068
2068 if (IS_CURSOR_MOVE(button)) { 2069 if (IS_CURSOR_MOVE(button)) {
2069 if (!ui->cursor_active) { 2070 if (!ui->cursor_active) {
2070 ui->cursor_active = TRUE; 2071 ui->cursor_active = true;
2071 } else if (control | shift) { 2072 } else if (control || shift) {
2072 char *move; 2073 char *move;
2073 if (ui->ndragcoords > 0) return NULL; 2074 if (ui->ndragcoords > 0) return NULL;
2074 ui->ndragcoords = -1; 2075 ui->ndragcoords = -1;
2075 move = mark_in_direction(state, ui->curx, ui->cury, 2076 move = mark_in_direction(state, ui->curx, ui->cury,
2076 KEY_DIRECTION(button), control, tmpbuf); 2077 KEY_DIRECTION(button), control, tmpbuf);
2077 if (control && !shift && *move) 2078 if (control && !shift && *move)
2078 move_cursor(button, &ui->curx, &ui->cury, w, h, FALSE); 2079 move_cursor(button, &ui->curx, &ui->cury, w, h, false);
2079 return move; 2080 return move;
2080 } else { 2081 } else {
2081 move_cursor(button, &ui->curx, &ui->cury, w, h, FALSE); 2082 move_cursor(button, &ui->curx, &ui->cury, w, h, false);
2082 if (ui->ndragcoords >= 0) 2083 if (ui->ndragcoords >= 0)
2083 update_ui_drag(state, ui, ui->curx, ui->cury); 2084 update_ui_drag(state, ui, ui->curx, ui->cury);
2084 } 2085 }
@@ -2087,7 +2088,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2087 2088
2088 if (IS_CURSOR_SELECT(button)) { 2089 if (IS_CURSOR_SELECT(button)) {
2089 if (!ui->cursor_active) { 2090 if (!ui->cursor_active) {
2090 ui->cursor_active = TRUE; 2091 ui->cursor_active = true;
2091 return UI_UPDATE; 2092 return UI_UPDATE;
2092 } else if (button == CURSOR_SELECT) { 2093 } else if (button == CURSOR_SELECT) {
2093 if (ui->ndragcoords == -1) { 2094 if (ui->ndragcoords == -1) {
@@ -2096,7 +2097,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2096 ui->clickx = CENTERED_COORD(ui->curx); 2097 ui->clickx = CENTERED_COORD(ui->curx);
2097 ui->clicky = CENTERED_COORD(ui->cury); 2098 ui->clicky = CENTERED_COORD(ui->cury);
2098 return UI_UPDATE; 2099 return UI_UPDATE;
2099 } else release = TRUE; 2100 } else release = true;
2100 } else if (button == CURSOR_SELECT2 && ui->ndragcoords >= 0) { 2101 } else if (button == CURSOR_SELECT2 && ui->ndragcoords >= 0) {
2101 ui->ndragcoords = -1; 2102 ui->ndragcoords = -1;
2102 return UI_UPDATE; 2103 return UI_UPDATE;
@@ -2114,7 +2115,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2114 int buflen = 0, bufsize = 256, tmplen; 2115 int buflen = 0, bufsize = 256, tmplen;
2115 char *buf = NULL; 2116 char *buf = NULL;
2116 const char *sep = ""; 2117 const char *sep = "";
2117 int clearing = TRUE; 2118 bool clearing = true;
2118 2119
2119 for (i = 0; i < ui->ndragcoords - 1; i++) { 2120 for (i = 0; i < ui->ndragcoords - 1; i++) {
2120 int sx, sy, dx, dy, dir, oldstate, newstate; 2121 int sx, sy, dx, dy, dir, oldstate, newstate;
@@ -2197,7 +2198,7 @@ static game_state *execute_move(const game_state *state, const char *move)
2197 while (*move) { 2198 while (*move) {
2198 c = *move; 2199 c = *move;
2199 if (c == 'S') { 2200 if (c == 'S') {
2200 ret->used_solve = TRUE; 2201 ret->used_solve = true;
2201 move++; 2202 move++;
2202 } else if (c == 'L' || c == 'N' || c == 'R' || c == 'F' || c == 'M') { 2203 } else if (c == 'L' || c == 'N' || c == 'R' || c == 'F' || c == 'M') {
2203 /* 'line' or 'noline' or 'replace' or 'flip' or 'mark' */ 2204 /* 'line' or 'noline' or 'replace' or 'flip' or 'mark' */
@@ -2232,7 +2233,7 @@ static game_state *execute_move(const game_state *state, const char *move)
2232 move += n; 2233 move += n;
2233 } else if (strcmp(move, "H") == 0) { 2234 } else if (strcmp(move, "H") == 0) {
2234 pearl_solve(ret->shared->w, ret->shared->h, 2235 pearl_solve(ret->shared->w, ret->shared->h,
2235 ret->shared->clues, ret->lines, DIFFCOUNT, TRUE); 2236 ret->shared->clues, ret->lines, DIFFCOUNT, true);
2236 for (n = 0; n < w*h; n++) 2237 for (n = 0; n < w*h; n++)
2237 ret->marks[n] &= ~ret->lines[n]; /* erase marks too */ 2238 ret->marks[n] &= ~ret->lines[n]; /* erase marks too */
2238 move++; 2239 move++;
@@ -2245,7 +2246,7 @@ static game_state *execute_move(const game_state *state, const char *move)
2245 goto badmove; 2246 goto badmove;
2246 } 2247 }
2247 2248
2248 check_completion(ret, TRUE); 2249 check_completion(ret, true);
2249 2250
2250 return ret; 2251 return ret;
2251 2252
@@ -2317,7 +2318,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
2317 int i; 2318 int i;
2318 2319
2319 ds->halfsz = 0; 2320 ds->halfsz = 0;
2320 ds->started = FALSE; 2321 ds->started = false;
2321 2322
2322 ds->w = state->shared->w; 2323 ds->w = state->shared->w;
2323 ds->h = state->shared->h; 2324 ds->h = state->shared->h;
@@ -2453,7 +2454,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2453 float animtime, float flashtime) 2454 float animtime, float flashtime)
2454{ 2455{
2455 int w = state->shared->w, h = state->shared->h, sz = state->shared->sz; 2456 int w = state->shared->w, h = state->shared->h, sz = state->shared->sz;
2456 int x, y, force = 0, flashing = 0; 2457 int x, y, flashing = 0;
2458 bool force = false;
2457 2459
2458 if (!ds->started) { 2460 if (!ds->started) {
2459 /* 2461 /*
@@ -2477,8 +2479,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2477 2479
2478 draw_update(dr, 0, 0, w*TILE_SIZE + 2*BORDER, h*TILE_SIZE + 2*BORDER); 2480 draw_update(dr, 0, 0, w*TILE_SIZE + 2*BORDER, h*TILE_SIZE + 2*BORDER);
2479 2481
2480 ds->started = TRUE; 2482 ds->started = true;
2481 force = 1; 2483 force = true;
2482 } 2484 }
2483 2485
2484 if (flashtime > 0 && 2486 if (flashtime > 0 &&
@@ -2488,7 +2490,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2488 2490
2489 memset(ds->draglines, 0, sz); 2491 memset(ds->draglines, 0, sz);
2490 if (ui->ndragcoords > 0) { 2492 if (ui->ndragcoords > 0) {
2491 int i, clearing = TRUE; 2493 int i;
2494 bool clearing = true;
2492 for (i = 0; i < ui->ndragcoords - 1; i++) { 2495 for (i = 0; i < ui->ndragcoords - 1; i++) {
2493 int sx, sy, dx, dy, dir, oldstate, newstate; 2496 int sx, sy, dx, dy, dir, oldstate, newstate;
2494 interpret_ui_drag(state, ui, &clearing, i, &sx, &sy, &dx, &dy, 2497 interpret_ui_drag(state, ui, &clearing, i, &sx, &sy, &dx, &dy,
@@ -2544,9 +2547,9 @@ static int game_status(const game_state *state)
2544 return state->completed ? +1 : 0; 2547 return state->completed ? +1 : 0;
2545} 2548}
2546 2549
2547static int game_timing_state(const game_state *state, game_ui *ui) 2550static bool game_timing_state(const game_state *state, game_ui *ui)
2548{ 2551{
2549 return TRUE; 2552 return true;
2550} 2553}
2551 2554
2552static void game_print_size(const game_params *params, float *x, float *y) 2555static void game_print_size(const game_params *params, float *x, float *y)
@@ -2608,15 +2611,15 @@ const struct game thegame = {
2608 encode_params, 2611 encode_params,
2609 free_params, 2612 free_params,
2610 dup_params, 2613 dup_params,
2611 TRUE, game_configure, custom_params, 2614 true, game_configure, custom_params,
2612 validate_params, 2615 validate_params,
2613 new_game_desc, 2616 new_game_desc,
2614 validate_desc, 2617 validate_desc,
2615 new_game, 2618 new_game,
2616 dup_game, 2619 dup_game,
2617 free_game, 2620 free_game,
2618 TRUE, solve_game, 2621 true, solve_game,
2619 TRUE, game_can_format_as_text_now, game_text_format, 2622 true, game_can_format_as_text_now, game_text_format,
2620 new_ui, 2623 new_ui,
2621 free_ui, 2624 free_ui,
2622 encode_ui, 2625 encode_ui,
@@ -2633,9 +2636,9 @@ const struct game thegame = {
2633 game_anim_length, 2636 game_anim_length,
2634 game_flash_length, 2637 game_flash_length,
2635 game_status, 2638 game_status,
2636 TRUE, FALSE, game_print_size, game_print, 2639 true, false, game_print_size, game_print,
2637 FALSE, /* wants_statusbar */ 2640 false, /* wants_statusbar */
2638 FALSE, game_timing_state, 2641 false, game_timing_state,
2639 0, /* flags */ 2642 0, /* flags */
2640}; 2643};
2641 2644
@@ -2669,7 +2672,7 @@ static void start_soak(game_params *p, random_state *rs, int nsecs)
2669 if (nsecs > 0) printf(" for %d seconds", nsecs); 2672 if (nsecs > 0) printf(" for %d seconds", nsecs);
2670 printf(".\n"); 2673 printf(".\n");
2671 2674
2672 p->nosolve = TRUE; 2675 p->nosolve = true;
2673 2676
2674 grid = snewn(p->w*p->h, char); 2677 grid = snewn(p->w*p->h, char);
2675 clues = snewn(p->w*p->h, char); 2678 clues = snewn(p->w*p->h, char);
@@ -2677,7 +2680,7 @@ static void start_soak(game_params *p, random_state *rs, int nsecs)
2677 while (1) { 2680 while (1) {
2678 n += new_clues(p, rs, clues, grid); /* should be 1, with nosolve */ 2681 n += new_clues(p, rs, clues, grid); /* should be 1, with nosolve */
2679 2682
2680 ret = pearl_solve(p->w, p->h, clues, grid, DIFF_TRICKY, FALSE); 2683 ret = pearl_solve(p->w, p->h, clues, grid, DIFF_TRICKY, false);
2681 if (ret <= 0) nimpossible++; 2684 if (ret <= 0) nimpossible++;
2682 if (ret == 1) nsolved++; 2685 if (ret == 1) nsolved++;
2683 2686
@@ -2739,7 +2742,7 @@ int main(int argc, const char *argv[])
2739 } 2742 }
2740 2743
2741 decode_params(p, id); 2744 decode_params(p, id);
2742 err = validate_params(p, 1); 2745 err = validate_params(p, true);
2743 if (err) { 2746 if (err) {
2744 fprintf(stderr, "%s: %s", argv[0], err); 2747 fprintf(stderr, "%s: %s", argv[0], err);
2745 goto done; 2748 goto done;
diff --git a/apps/plugins/puzzles/src/pegs.c b/apps/plugins/puzzles/src/pegs.c
index 823d5c2866..32673d56e7 100644
--- a/apps/plugins/puzzles/src/pegs.c
+++ b/apps/plugins/puzzles/src/pegs.c
@@ -55,7 +55,7 @@ struct game_params {
55 55
56struct game_state { 56struct game_state {
57 int w, h; 57 int w, h;
58 int completed; 58 bool completed;
59 unsigned char *grid; 59 unsigned char *grid;
60}; 60};
61 61
@@ -77,13 +77,13 @@ static const struct game_params pegs_presets[] = {
77 {9, 9, TYPE_RANDOM}, 77 {9, 9, TYPE_RANDOM},
78}; 78};
79 79
80static int game_fetch_preset(int i, char **name, game_params **params) 80static bool game_fetch_preset(int i, char **name, game_params **params)
81{ 81{
82 game_params *ret; 82 game_params *ret;
83 char str[80]; 83 char str[80];
84 84
85 if (i < 0 || i >= lenof(pegs_presets)) 85 if (i < 0 || i >= lenof(pegs_presets))
86 return FALSE; 86 return false;
87 87
88 ret = snew(game_params); 88 ret = snew(game_params);
89 *ret = pegs_presets[i]; 89 *ret = pegs_presets[i];
@@ -94,7 +94,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
94 94
95 *name = dupstr(str); 95 *name = dupstr(str);
96 *params = ret; 96 *params = ret;
97 return TRUE; 97 return true;
98} 98}
99 99
100static void free_params(game_params *params) 100static void free_params(game_params *params)
@@ -129,7 +129,7 @@ static void decode_params(game_params *params, char const *string)
129 params->type = i; 129 params->type = i;
130} 130}
131 131
132static char *encode_params(const game_params *params, int full) 132static char *encode_params(const game_params *params, bool full)
133{ 133{
134 char str[80]; 134 char str[80];
135 135
@@ -178,7 +178,7 @@ static game_params *custom_params(const config_item *cfg)
178 return ret; 178 return ret;
179} 179}
180 180
181static const char *validate_params(const game_params *params, int full) 181static const char *validate_params(const game_params *params, bool full)
182{ 182{
183 if (full && (params->w <= 3 || params->h <= 3)) 183 if (full && (params->w <= 3 || params->h <= 3))
184 return "Width and height must both be greater than three"; 184 return "Width and height must both be greater than three";
@@ -500,7 +500,7 @@ static void pegs_generate(unsigned char *grid, int w, int h, random_state *rs)
500 */ 500 */
501 501
502static char *new_game_desc(const game_params *params, random_state *rs, 502static char *new_game_desc(const game_params *params, random_state *rs,
503 char **aux, int interactive) 503 char **aux, bool interactive)
504{ 504{
505 int w = params->w, h = params->h; 505 int w = params->w, h = params->h;
506 unsigned char *grid; 506 unsigned char *grid;
@@ -677,7 +677,7 @@ static game_state *new_game(midend *me, const game_params *params,
677 677
678 state->w = w; 678 state->w = w;
679 state->h = h; 679 state->h = h;
680 state->completed = 0; 680 state->completed = false;
681 state->grid = snewn(w*h, unsigned char); 681 state->grid = snewn(w*h, unsigned char);
682 for (i = 0; i < w*h; i++) 682 for (i = 0; i < w*h; i++)
683 state->grid[i] = (desc[i] == 'P' ? GRID_PEG : 683 state->grid[i] = (desc[i] == 'P' ? GRID_PEG :
@@ -712,9 +712,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
712 return NULL; 712 return NULL;
713} 713}
714 714
715static int game_can_format_as_text_now(const game_params *params) 715static bool game_can_format_as_text_now(const game_params *params)
716{ 716{
717 return TRUE; 717 return true;
718} 718}
719 719
720static char *game_text_format(const game_state *state) 720static char *game_text_format(const game_state *state)
@@ -737,10 +737,11 @@ static char *game_text_format(const game_state *state)
737} 737}
738 738
739struct game_ui { 739struct game_ui {
740 int dragging; /* boolean: is a drag in progress? */ 740 bool dragging; /* is a drag in progress? */
741 int sx, sy; /* grid coords of drag start cell */ 741 int sx, sy; /* grid coords of drag start cell */
742 int dx, dy; /* pixel coords of current drag posn */ 742 int dx, dy; /* pixel coords of current drag posn */
743 int cur_x, cur_y, cur_visible, cur_jumping; 743 int cur_x, cur_y;
744 bool cur_visible, cur_jumping;
744}; 745};
745 746
746static game_ui *new_ui(const game_state *state) 747static game_ui *new_ui(const game_state *state)
@@ -749,8 +750,9 @@ static game_ui *new_ui(const game_state *state)
749 int x, y, v; 750 int x, y, v;
750 751
751 ui->sx = ui->sy = ui->dx = ui->dy = 0; 752 ui->sx = ui->sy = ui->dx = ui->dy = 0;
752 ui->dragging = FALSE; 753 ui->dragging = false;
753 ui->cur_visible = ui->cur_jumping = 0; 754 ui->cur_visible = false;
755 ui->cur_jumping = false;
754 756
755 /* make sure we start the cursor somewhere on the grid. */ 757 /* make sure we start the cursor somewhere on the grid. */
756 for (x = 0; x < state->w; x++) { 758 for (x = 0; x < state->w; x++) {
@@ -789,7 +791,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
789 * Cancel a drag, in case the source square has become 791 * Cancel a drag, in case the source square has become
790 * unoccupied. 792 * unoccupied.
791 */ 793 */
792 ui->dragging = FALSE; 794 ui->dragging = false;
793} 795}
794 796
795#define PREFERRED_TILE_SIZE 33 797#define PREFERRED_TILE_SIZE 33
@@ -804,10 +806,11 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
804struct game_drawstate { 806struct game_drawstate {
805 int tilesize; 807 int tilesize;
806 blitter *drag_background; 808 blitter *drag_background;
807 int dragging, dragx, dragy; 809 bool dragging;
810 int dragx, dragy;
808 int w, h; 811 int w, h;
809 unsigned char *grid; 812 unsigned char *grid;
810 int started; 813 bool started;
811 int bgcolour; 814 int bgcolour;
812}; 815};
813 816
@@ -838,12 +841,13 @@ static char *interpret_move(const game_state *state, game_ui *ui,
838 ty = FROMCOORD(y); 841 ty = FROMCOORD(y);
839 if (tx >= 0 && tx < w && ty >= 0 && ty < h && 842 if (tx >= 0 && tx < w && ty >= 0 && ty < h &&
840 state->grid[ty*w+tx] == GRID_PEG) { 843 state->grid[ty*w+tx] == GRID_PEG) {
841 ui->dragging = TRUE; 844 ui->dragging = true;
842 ui->sx = tx; 845 ui->sx = tx;
843 ui->sy = ty; 846 ui->sy = ty;
844 ui->dx = x; 847 ui->dx = x;
845 ui->dy = y; 848 ui->dy = y;
846 ui->cur_visible = ui->cur_jumping = 0; 849 ui->cur_visible = false;
850 ui->cur_jumping = false;
847 return UI_UPDATE; 851 return UI_UPDATE;
848 } 852 }
849 } else if (button == LEFT_DRAG && ui->dragging) { 853 } else if (button == LEFT_DRAG && ui->dragging) {
@@ -860,7 +864,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
860 * Button released. Identify the target square of the drag, 864 * Button released. Identify the target square of the drag,
861 * see if it represents a valid move, and if so make it. 865 * see if it represents a valid move, and if so make it.
862 */ 866 */
863 ui->dragging = FALSE; /* cancel the drag no matter what */ 867 ui->dragging = false; /* cancel the drag no matter what */
864 tx = FROMCOORD(x); 868 tx = FROMCOORD(x);
865 ty = FROMCOORD(y); 869 ty = FROMCOORD(y);
866 if (tx < 0 || tx >= w || ty < 0 || ty >= h) 870 if (tx < 0 || tx >= w || ty < 0 || ty >= h)
@@ -888,8 +892,8 @@ static char *interpret_move(const game_state *state, game_ui *ui,
888 /* Not jumping; move cursor as usual, making sure we don't 892 /* Not jumping; move cursor as usual, making sure we don't
889 * leave the gameboard (which may be an irregular shape) */ 893 * leave the gameboard (which may be an irregular shape) */
890 int cx = ui->cur_x, cy = ui->cur_y; 894 int cx = ui->cur_x, cy = ui->cur_y;
891 move_cursor(button, &cx, &cy, w, h, 0); 895 move_cursor(button, &cx, &cy, w, h, false);
892 ui->cur_visible = 1; 896 ui->cur_visible = true;
893 if (state->grid[cy*w+cx] == GRID_HOLE || 897 if (state->grid[cy*w+cx] == GRID_HOLE ||
894 state->grid[cy*w+cx] == GRID_PEG) { 898 state->grid[cy*w+cx] == GRID_PEG) {
895 ui->cur_x = cx; 899 ui->cur_x = cx;
@@ -908,7 +912,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
908 mx = ui->cur_x+dx; my = ui->cur_y+dy; 912 mx = ui->cur_x+dx; my = ui->cur_y+dy;
909 jx = mx+dx; jy = my+dy; 913 jx = mx+dx; jy = my+dy;
910 914
911 ui->cur_jumping = 0; /* reset, whatever. */ 915 ui->cur_jumping = false; /* reset, whatever. */
912 if (jx >= 0 && jy >= 0 && jx < w && jy < h && 916 if (jx >= 0 && jy >= 0 && jx < w && jy < h &&
913 state->grid[my*w+mx] == GRID_PEG && 917 state->grid[my*w+mx] == GRID_PEG &&
914 state->grid[jy*w+jx] == GRID_HOLE) { 918 state->grid[jy*w+jx] == GRID_HOLE) {
@@ -922,16 +926,16 @@ static char *interpret_move(const game_state *state, game_ui *ui,
922 } 926 }
923 } else if (IS_CURSOR_SELECT(button)) { 927 } else if (IS_CURSOR_SELECT(button)) {
924 if (!ui->cur_visible) { 928 if (!ui->cur_visible) {
925 ui->cur_visible = 1; 929 ui->cur_visible = true;
926 return UI_UPDATE; 930 return UI_UPDATE;
927 } 931 }
928 if (ui->cur_jumping) { 932 if (ui->cur_jumping) {
929 ui->cur_jumping = 0; 933 ui->cur_jumping = false;
930 return UI_UPDATE; 934 return UI_UPDATE;
931 } 935 }
932 if (state->grid[ui->cur_y*w+ui->cur_x] == GRID_PEG) { 936 if (state->grid[ui->cur_y*w+ui->cur_x] == GRID_PEG) {
933 /* cursor is on peg: next arrow-move wil jump. */ 937 /* cursor is on peg: next arrow-move wil jump. */
934 ui->cur_jumping = 1; 938 ui->cur_jumping = true;
935 return UI_UPDATE; 939 return UI_UPDATE;
936 } 940 }
937 return NULL; 941 return NULL;
@@ -983,7 +987,7 @@ static game_state *execute_move(const game_state *state, const char *move)
983 if (ret->grid[i] == GRID_PEG) 987 if (ret->grid[i] == GRID_PEG)
984 count++; 988 count++;
985 if (count == 1) 989 if (count == 1)
986 ret->completed = 1; 990 ret->completed = true;
987 } 991 }
988 992
989 return ret; 993 return ret;
@@ -1045,14 +1049,14 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1045 /* We can't allocate the blitter rectangle for the drag background 1049 /* We can't allocate the blitter rectangle for the drag background
1046 * until we know what size to make it. */ 1050 * until we know what size to make it. */
1047 ds->drag_background = NULL; 1051 ds->drag_background = NULL;
1048 ds->dragging = FALSE; 1052 ds->dragging = false;
1049 1053
1050 ds->w = w; 1054 ds->w = w;
1051 ds->h = h; 1055 ds->h = h;
1052 ds->grid = snewn(w*h, unsigned char); 1056 ds->grid = snewn(w*h, unsigned char);
1053 memset(ds->grid, 255, w*h); 1057 memset(ds->grid, 255, w*h);
1054 1058
1055 ds->started = FALSE; 1059 ds->started = false;
1056 ds->bgcolour = -1; 1060 ds->bgcolour = -1;
1057 1061
1058 return ds; 1062 return ds;
@@ -1069,16 +1073,17 @@ static void game_free_drawstate(drawing *dr, game_drawstate *ds)
1069static void draw_tile(drawing *dr, game_drawstate *ds, 1073static void draw_tile(drawing *dr, game_drawstate *ds,
1070 int x, int y, int v, int bgcolour) 1074 int x, int y, int v, int bgcolour)
1071{ 1075{
1072 int cursor = 0, jumping = 0, bg; 1076 bool cursor = false, jumping = false;
1077 int bg;
1073 1078
1074 if (bgcolour >= 0) { 1079 if (bgcolour >= 0) {
1075 draw_rect(dr, x, y, TILESIZE, TILESIZE, bgcolour); 1080 draw_rect(dr, x, y, TILESIZE, TILESIZE, bgcolour);
1076 } 1081 }
1077 if (v >= GRID_JUMPING) { 1082 if (v >= GRID_JUMPING) {
1078 jumping = 1; v -= GRID_JUMPING; 1083 jumping = true; v -= GRID_JUMPING;
1079 } 1084 }
1080 if (v >= GRID_CURSOR) { 1085 if (v >= GRID_CURSOR) {
1081 cursor = 1; v -= GRID_CURSOR; 1086 cursor = true; v -= GRID_CURSOR;
1082 } 1087 }
1083 1088
1084 if (v == GRID_HOLE) { 1089 if (v == GRID_HOLE) {
@@ -1120,7 +1125,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1120 assert(ds->drag_background); 1125 assert(ds->drag_background);
1121 blitter_load(dr, ds->drag_background, ds->dragx, ds->dragy); 1126 blitter_load(dr, ds->drag_background, ds->dragx, ds->dragy);
1122 draw_update(dr, ds->dragx, ds->dragy, TILESIZE, TILESIZE); 1127 draw_update(dr, ds->dragx, ds->dragy, TILESIZE, TILESIZE);
1123 ds->dragging = FALSE; 1128 ds->dragging = false;
1124 } 1129 }
1125 1130
1126 if (!ds->started) { 1131 if (!ds->started) {
@@ -1206,7 +1211,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1206 TILESIZE, COL_BACKGROUND); 1211 TILESIZE, COL_BACKGROUND);
1207 } 1212 }
1208 1213
1209 ds->started = TRUE; 1214 ds->started = true;
1210 1215
1211 draw_update(dr, 0, 0, 1216 draw_update(dr, 0, 0,
1212 TILESIZE * state->w + 2 * BORDER, 1217 TILESIZE * state->w + 2 * BORDER,
@@ -1244,7 +1249,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1244 * Draw the dragging sprite if any. 1249 * Draw the dragging sprite if any.
1245 */ 1250 */
1246 if (ui->dragging) { 1251 if (ui->dragging) {
1247 ds->dragging = TRUE; 1252 ds->dragging = true;
1248 ds->dragx = ui->dx - TILESIZE/2; 1253 ds->dragx = ui->dx - TILESIZE/2;
1249 ds->dragy = ui->dy - TILESIZE/2; 1254 ds->dragy = ui->dy - TILESIZE/2;
1250 blitter_save(dr, ds->drag_background, ds->dragx, ds->dragy); 1255 blitter_save(dr, ds->drag_background, ds->dragx, ds->dragy);
@@ -1278,9 +1283,9 @@ static int game_status(const game_state *state)
1278 return state->completed ? +1 : 0; 1283 return state->completed ? +1 : 0;
1279} 1284}
1280 1285
1281static int game_timing_state(const game_state *state, game_ui *ui) 1286static bool game_timing_state(const game_state *state, game_ui *ui)
1282{ 1287{
1283 return TRUE; 1288 return true;
1284} 1289}
1285 1290
1286static void game_print_size(const game_params *params, float *x, float *y) 1291static void game_print_size(const game_params *params, float *x, float *y)
@@ -1303,15 +1308,15 @@ const struct game thegame = {
1303 encode_params, 1308 encode_params,
1304 free_params, 1309 free_params,
1305 dup_params, 1310 dup_params,
1306 TRUE, game_configure, custom_params, 1311 true, game_configure, custom_params,
1307 validate_params, 1312 validate_params,
1308 new_game_desc, 1313 new_game_desc,
1309 validate_desc, 1314 validate_desc,
1310 new_game, 1315 new_game,
1311 dup_game, 1316 dup_game,
1312 free_game, 1317 free_game,
1313 FALSE, solve_game, 1318 false, solve_game,
1314 TRUE, game_can_format_as_text_now, game_text_format, 1319 true, game_can_format_as_text_now, game_text_format,
1315 new_ui, 1320 new_ui,
1316 free_ui, 1321 free_ui,
1317 encode_ui, 1322 encode_ui,
@@ -1328,9 +1333,9 @@ const struct game thegame = {
1328 game_anim_length, 1333 game_anim_length,
1329 game_flash_length, 1334 game_flash_length,
1330 game_status, 1335 game_status,
1331 FALSE, FALSE, game_print_size, game_print, 1336 false, false, game_print_size, game_print,
1332 FALSE, /* wants_statusbar */ 1337 false, /* wants_statusbar */
1333 FALSE, game_timing_state, 1338 false, game_timing_state,
1334 0, /* flags */ 1339 0, /* flags */
1335}; 1340};
1336 1341
diff --git a/apps/plugins/puzzles/src/printing.c b/apps/plugins/puzzles/src/printing.c
index e921a4d545..98fdd841d3 100644
--- a/apps/plugins/puzzles/src/printing.c
+++ b/apps/plugins/puzzles/src/printing.c
@@ -17,7 +17,7 @@ struct document {
17 int npuzzles; 17 int npuzzles;
18 struct puzzle *puzzles; 18 struct puzzle *puzzles;
19 int puzzlesize; 19 int puzzlesize;
20 int got_solns; 20 bool got_solns;
21 float *colwid, *rowht; 21 float *colwid, *rowht;
22 float userscale; 22 float userscale;
23}; 23};
@@ -35,7 +35,7 @@ document *document_new(int pw, int ph, float userscale)
35 doc->ph = ph; 35 doc->ph = ph;
36 doc->puzzles = NULL; 36 doc->puzzles = NULL;
37 doc->puzzlesize = doc->npuzzles = 0; 37 doc->puzzlesize = doc->npuzzles = 0;
38 doc->got_solns = FALSE; 38 doc->got_solns = false;
39 39
40 doc->colwid = snewn(pw, float); 40 doc->colwid = snewn(pw, float);
41 doc->rowht = snewn(ph, float); 41 doc->rowht = snewn(ph, float);
@@ -85,7 +85,7 @@ void document_add_puzzle(document *doc, const game *game, game_params *par,
85 doc->puzzles[doc->npuzzles].st2 = st2; 85 doc->puzzles[doc->npuzzles].st2 = st2;
86 doc->npuzzles++; 86 doc->npuzzles++;
87 if (st2) 87 if (st2)
88 doc->got_solns = TRUE; 88 doc->got_solns = true;
89} 89}
90 90
91static void get_puzzle_size(document *doc, struct puzzle *pz, 91static void get_puzzle_size(document *doc, struct puzzle *pz,
diff --git a/apps/plugins/puzzles/src/ps.c b/apps/plugins/puzzles/src/ps.c
index ac021aa80a..94a708648a 100644
--- a/apps/plugins/puzzles/src/ps.c
+++ b/apps/plugins/puzzles/src/ps.c
@@ -13,9 +13,9 @@
13 13
14struct psdata { 14struct psdata {
15 FILE *fp; 15 FILE *fp;
16 int colour; 16 bool colour;
17 int ytop; 17 int ytop;
18 int clipped; 18 bool clipped;
19 float hatchthick, hatchspace; 19 float hatchthick, hatchspace;
20 int gamewidth, gameheight; 20 int gamewidth, gameheight;
21 drawing *drawing; 21 drawing *drawing;
@@ -204,7 +204,7 @@ static void ps_unclip(void *handle)
204 204
205 assert(ps->clipped); 205 assert(ps->clipped);
206 ps_printf(ps, "grestore\n"); 206 ps_printf(ps, "grestore\n");
207 ps->clipped = FALSE; 207 ps->clipped = false;
208} 208}
209 209
210static void ps_clip(void *handle, int x, int y, int w, int h) 210static void ps_clip(void *handle, int x, int y, int w, int h)
@@ -222,7 +222,7 @@ static void ps_clip(void *handle, int x, int y, int w, int h)
222 ps_printf(ps, "newpath %g %g moveto %d 0 rlineto 0 %d rlineto" 222 ps_printf(ps, "newpath %g %g moveto %d 0 rlineto 0 %d rlineto"
223 " %d 0 rlineto closepath\n", x - 0.5, y + 0.5, w, -h, -w); 223 " %d 0 rlineto closepath\n", x - 0.5, y + 0.5, w, -h, -w);
224 ps_printf(ps, "clip\n"); 224 ps_printf(ps, "clip\n");
225 ps->clipped = TRUE; 225 ps->clipped = true;
226} 226}
227 227
228static void ps_line_width(void *handle, float width) 228static void ps_line_width(void *handle, float width)
@@ -232,7 +232,7 @@ static void ps_line_width(void *handle, float width)
232 ps_printf(ps, "%g setlinewidth\n", width); 232 ps_printf(ps, "%g setlinewidth\n", width);
233} 233}
234 234
235static void ps_line_dotted(void *handle, int dotted) 235static void ps_line_dotted(void *handle, bool dotted)
236{ 236{
237 psdata *ps = (psdata *)handle; 237 psdata *ps = (psdata *)handle;
238 238
@@ -353,7 +353,7 @@ static void ps_begin_puzzle(void *handle, float xm, float xc,
353 "%g dup scale\n" 353 "%g dup scale\n"
354 "0 -%d translate\n", xm, xc, ym, yc, wmm/pw, ph); 354 "0 -%d translate\n", xm, xc, ym, yc, wmm/pw, ph);
355 ps->ytop = ph; 355 ps->ytop = ph;
356 ps->clipped = FALSE; 356 ps->clipped = false;
357 ps->gamewidth = pw; 357 ps->gamewidth = pw;
358 ps->gameheight = ph; 358 ps->gameheight = ph;
359 ps->hatchthick = 0.2 * pw / wmm; 359 ps->hatchthick = 0.2 * pw / wmm;
@@ -408,14 +408,14 @@ static const struct drawing_api ps_drawing = {
408 ps_text_fallback, 408 ps_text_fallback,
409}; 409};
410 410
411psdata *ps_init(FILE *outfile, int colour) 411psdata *ps_init(FILE *outfile, bool colour)
412{ 412{
413 psdata *ps = snew(psdata); 413 psdata *ps = snew(psdata);
414 414
415 ps->fp = outfile; 415 ps->fp = outfile;
416 ps->colour = colour; 416 ps->colour = colour;
417 ps->ytop = 0; 417 ps->ytop = 0;
418 ps->clipped = FALSE; 418 ps->clipped = false;
419 ps->hatchthick = ps->hatchspace = ps->gamewidth = ps->gameheight = 0; 419 ps->hatchthick = ps->hatchspace = ps->gamewidth = ps->gameheight = 0;
420 ps->drawing = drawing_new(&ps_drawing, NULL, ps); 420 ps->drawing = drawing_new(&ps_drawing, NULL, ps);
421 421
diff --git a/apps/plugins/puzzles/src/puzzles.h b/apps/plugins/puzzles/src/puzzles.h
index 8759139404..48d3d83b6e 100644
--- a/apps/plugins/puzzles/src/puzzles.h
+++ b/apps/plugins/puzzles/src/puzzles.h
@@ -8,13 +8,7 @@
8#include <stdio.h> /* for FILE */ 8#include <stdio.h> /* for FILE */
9#include <stdlib.h> /* for size_t */ 9#include <stdlib.h> /* for size_t */
10#include <limits.h> /* for UINT_MAX */ 10#include <limits.h> /* for UINT_MAX */
11 11#include <stdbool.h>
12#ifndef TRUE
13#define TRUE 1
14#endif
15#ifndef FALSE
16#define FALSE 0
17#endif
18 12
19#define PI 3.141592653589793238462643383279502884197169399 13#define PI 3.141592653589793238462643383279502884197169399
20 14
@@ -163,8 +157,7 @@ struct config_item {
163 int selected; 157 int selected;
164 } choices; 158 } choices;
165 struct { 159 struct {
166 /* just TRUE or FALSE */ 160 bool bval;
167 int bval;
168 } boolean; 161 } boolean;
169 } u; 162 } u;
170}; 163};
@@ -292,7 +285,7 @@ void print_begin_puzzle(drawing *dr, float xm, float xc,
292void print_end_puzzle(drawing *dr); 285void print_end_puzzle(drawing *dr);
293void print_end_page(drawing *dr, int number); 286void print_end_page(drawing *dr, int number);
294void print_end_doc(drawing *dr); 287void print_end_doc(drawing *dr);
295void print_get_colour(drawing *dr, int colour, int printing_in_colour, 288void print_get_colour(drawing *dr, int colour, bool printing_in_colour,
296 int *hatch, float *r, float *g, float *b); 289 int *hatch, float *r, float *g, float *b);
297int print_mono_colour(drawing *dr, int grey); /* 0==black, 1==white */ 290int print_mono_colour(drawing *dr, int grey); /* 0==black, 1==white */
298int print_grey_colour(drawing *dr, float grey); 291int print_grey_colour(drawing *dr, float grey);
@@ -302,7 +295,7 @@ int print_rgb_grey_colour(drawing *dr, float r, float g, float b, float grey);
302int print_rgb_hatched_colour(drawing *dr, float r, float g, float b, 295int print_rgb_hatched_colour(drawing *dr, float r, float g, float b,
303 int hatch); 296 int hatch);
304void print_line_width(drawing *dr, int width); 297void print_line_width(drawing *dr, int width);
305void print_line_dotted(drawing *dr, int dotted); 298void print_line_dotted(drawing *dr, bool dotted);
306 299
307/* 300/*
308 * midend.c 301 * midend.c
@@ -313,12 +306,12 @@ void midend_free(midend *me);
313const game *midend_which_game(midend *me); 306const game *midend_which_game(midend *me);
314void midend_set_params(midend *me, game_params *params); 307void midend_set_params(midend *me, game_params *params);
315game_params *midend_get_params(midend *me); 308game_params *midend_get_params(midend *me);
316void midend_size(midend *me, int *x, int *y, int user_size); 309void midend_size(midend *me, int *x, int *y, bool user_size);
317void midend_reset_tilesize(midend *me); 310void midend_reset_tilesize(midend *me);
318void midend_new_game(midend *me); 311void midend_new_game(midend *me);
319void midend_restart_game(midend *me); 312void midend_restart_game(midend *me);
320void midend_stop_anim(midend *me); 313void midend_stop_anim(midend *me);
321int midend_process_key(midend *me, int x, int y, int button); 314bool midend_process_key(midend *me, int x, int y, int button);
322key_label *midend_request_keys(midend *me, int *nkeys); 315key_label *midend_request_keys(midend *me, int *nkeys);
323void midend_force_redraw(midend *me); 316void midend_force_redraw(midend *me);
324void midend_redraw(midend *me); 317void midend_redraw(midend *me);
@@ -327,19 +320,19 @@ void midend_freeze_timer(midend *me, float tprop);
327void midend_timer(midend *me, float tplus); 320void midend_timer(midend *me, float tplus);
328struct preset_menu *midend_get_presets(midend *me, int *id_limit); 321struct preset_menu *midend_get_presets(midend *me, int *id_limit);
329int midend_which_preset(midend *me); 322int midend_which_preset(midend *me);
330int midend_wants_statusbar(midend *me); 323bool midend_wants_statusbar(midend *me);
331enum { CFG_SETTINGS, CFG_SEED, CFG_DESC, CFG_FRONTEND_SPECIFIC }; 324enum { CFG_SETTINGS, CFG_SEED, CFG_DESC, CFG_FRONTEND_SPECIFIC };
332config_item *midend_get_config(midend *me, int which, char **wintitle); 325config_item *midend_get_config(midend *me, int which, char **wintitle);
333const char *midend_set_config(midend *me, int which, config_item *cfg); 326const char *midend_set_config(midend *me, int which, config_item *cfg);
334const char *midend_game_id(midend *me, const char *id); 327const char *midend_game_id(midend *me, const char *id);
335char *midend_get_game_id(midend *me); 328char *midend_get_game_id(midend *me);
336char *midend_get_random_seed(midend *me); 329char *midend_get_random_seed(midend *me);
337int midend_can_format_as_text_now(midend *me); 330bool midend_can_format_as_text_now(midend *me);
338char *midend_text_format(midend *me); 331char *midend_text_format(midend *me);
339const char *midend_solve(midend *me); 332const char *midend_solve(midend *me);
340int midend_status(midend *me); 333int midend_status(midend *me);
341int midend_can_undo(midend *me); 334bool midend_can_undo(midend *me);
342int midend_can_redo(midend *me); 335bool midend_can_redo(midend *me);
343void midend_supersede_game_desc(midend *me, const char *desc, 336void midend_supersede_game_desc(midend *me, const char *desc,
344 const char *privdesc); 337 const char *privdesc);
345char *midend_rewrite_statusbar(midend *me, const char *text); 338char *midend_rewrite_statusbar(midend *me, const char *text);
@@ -347,14 +340,14 @@ void midend_serialise(midend *me,
347 void (*write)(void *ctx, const void *buf, int len), 340 void (*write)(void *ctx, const void *buf, int len),
348 void *wctx); 341 void *wctx);
349const char *midend_deserialise(midend *me, 342const char *midend_deserialise(midend *me,
350 int (*read)(void *ctx, void *buf, int len), 343 bool (*read)(void *ctx, void *buf, int len),
351 void *rctx); 344 void *rctx);
352const char *identify_game(char **name, 345const char *identify_game(char **name,
353 int (*read)(void *ctx, void *buf, int len), 346 bool (*read)(void *ctx, void *buf, int len),
354 void *rctx); 347 void *rctx);
355void midend_request_id_changes(midend *me, void (*notify)(void *), void *ctx); 348void midend_request_id_changes(midend *me, void (*notify)(void *), void *ctx);
356/* Printing functions supplied by the mid-end */ 349/* Printing functions supplied by the mid-end */
357const char *midend_print_puzzle(midend *me, document *doc, int with_soln); 350const char *midend_print_puzzle(midend *me, document *doc, bool with_soln);
358int midend_tilesize(midend *me); 351int midend_tilesize(midend *me);
359 352
360/* 353/*
@@ -376,7 +369,7 @@ char *dupstr(const char *s);
376 */ 369 */
377void free_cfg(config_item *cfg); 370void free_cfg(config_item *cfg);
378void free_keys(key_label *keys, int nkeys); 371void free_keys(key_label *keys, int nkeys);
379void obfuscate_bitmap(unsigned char *bmp, int bits, int decode); 372void obfuscate_bitmap(unsigned char *bmp, int bits, bool decode);
380char *fgetline(FILE *fp); 373char *fgetline(FILE *fp);
381 374
382/* allocates output each time. len is always in bytes of binary data. 375/* allocates output each time. len is always in bytes of binary data.
@@ -403,7 +396,7 @@ void draw_rect_outline(drawing *dr, int x, int y, int w, int h,
403/* Draw a set of rectangle corners (e.g. for a cursor display). */ 396/* Draw a set of rectangle corners (e.g. for a cursor display). */
404void draw_rect_corners(drawing *dr, int cx, int cy, int r, int col); 397void draw_rect_corners(drawing *dr, int cx, int cy, int r, int col);
405 398
406void move_cursor(int button, int *x, int *y, int maxw, int maxh, int wrap); 399void move_cursor(int button, int *x, int *y, int maxw, int maxh, bool wrap);
407 400
408/* Used in netslide.c and sixteen.c for cursor movement around edge. */ 401/* Used in netslide.c and sixteen.c for cursor movement around edge. */
409int c2pos(int w, int h, int cx, int cy); 402int c2pos(int w, int h, int cx, int cy);
@@ -439,16 +432,16 @@ void print_dsf(int *dsf, int size);
439/* Return the canonical element of the equivalence class containing element 432/* Return the canonical element of the equivalence class containing element
440 * val. If 'inverse' is non-NULL, this function will put into it a flag 433 * val. If 'inverse' is non-NULL, this function will put into it a flag
441 * indicating whether the canonical element is inverse to val. */ 434 * indicating whether the canonical element is inverse to val. */
442int edsf_canonify(int *dsf, int val, int *inverse); 435int edsf_canonify(int *dsf, int val, bool *inverse);
443int dsf_canonify(int *dsf, int val); 436int dsf_canonify(int *dsf, int val);
444int dsf_size(int *dsf, int val); 437int dsf_size(int *dsf, int val);
445 438
446/* Allow the caller to specify that two elements should be in the same 439/* Allow the caller to specify that two elements should be in the same
447 * equivalence class. If 'inverse' is TRUE, the elements are actually opposite 440 * equivalence class. If 'inverse' is true, the elements are actually opposite
448 * to one another in some sense. This function will fail an assertion if the 441 * to one another in some sense. This function will fail an assertion if the
449 * caller gives it self-contradictory data, ie if two elements are claimed to 442 * caller gives it self-contradictory data, ie if two elements are claimed to
450 * be both opposite and non-opposite. */ 443 * be both opposite and non-opposite. */
451void edsf_merge(int *dsf, int v1, int v2, int inverse); 444void edsf_merge(int *dsf, int v1, int v2, bool inverse);
452void dsf_merge(int *dsf, int v1, int v2); 445void dsf_merge(int *dsf, int v1, int v2);
453void dsf_init(int *dsf, int len); 446void dsf_init(int *dsf, int len);
454 447
@@ -542,7 +535,7 @@ void document_print(document *doc, drawing *dr);
542/* 535/*
543 * ps.c 536 * ps.c
544 */ 537 */
545psdata *ps_init(FILE *outfile, int colour); 538psdata *ps_init(FILE *outfile, bool colour);
546void ps_free(psdata *ps); 539void ps_free(psdata *ps);
547drawing *ps_drawing_api(psdata *ps); 540drawing *ps_drawing_api(psdata *ps);
548 541
@@ -584,22 +577,22 @@ void findloop_free_state(struct findloopstate *);
584typedef int (*neighbour_fn_t)(int vertex, void *ctx); 577typedef int (*neighbour_fn_t)(int vertex, void *ctx);
585/* 578/*
586 * Actual function to find loops. 'ctx' will be passed unchanged to 579 * Actual function to find loops. 'ctx' will be passed unchanged to
587 * the 'neighbour' function to query graph edges. Returns FALSE if no 580 * the 'neighbour' function to query graph edges. Returns false if no
588 * loop was found, or TRUE if one was. 581 * loop was found, or true if one was.
589 */ 582 */
590int findloop_run(struct findloopstate *state, int nvertices, 583bool findloop_run(struct findloopstate *state, int nvertices,
591 neighbour_fn_t neighbour, void *ctx); 584 neighbour_fn_t neighbour, void *ctx);
592/* 585/*
593 * Query whether an edge is part of a loop, in the output of 586 * Query whether an edge is part of a loop, in the output of
594 * find_loops. 587 * find_loops.
595 * 588 *
596 * Due to the internal storage format, if you pass u,v which are not 589 * Due to the internal storage format, if you pass u,v which are not
597 * connected at all, the output will be TRUE. (The algorithm actually 590 * connected at all, the output will be true. (The algorithm actually
598 * stores an exhaustive list of *non*-loop edges, because there are 591 * stores an exhaustive list of *non*-loop edges, because there are
599 * fewer of those, so really it's querying whether the edge is on that 592 * fewer of those, so really it's querying whether the edge is on that
600 * list.) 593 * list.)
601 */ 594 */
602int findloop_is_loop_edge(struct findloopstate *state, int u, int v); 595bool findloop_is_loop_edge(struct findloopstate *state, int u, int v);
603 596
604/* 597/*
605 * Data structure containing the function calls and data specific 598 * Data structure containing the function calls and data specific
@@ -612,28 +605,28 @@ struct game {
612 const char *name; 605 const char *name;
613 const char *winhelp_topic, *htmlhelp_topic; 606 const char *winhelp_topic, *htmlhelp_topic;
614 game_params *(*default_params)(void); 607 game_params *(*default_params)(void);
615 int (*fetch_preset)(int i, char **name, game_params **params); 608 bool (*fetch_preset)(int i, char **name, game_params **params);
616 struct preset_menu *(*preset_menu)(void); 609 struct preset_menu *(*preset_menu)(void);
617 void (*decode_params)(game_params *, char const *string); 610 void (*decode_params)(game_params *, char const *string);
618 char *(*encode_params)(const game_params *, int full); 611 char *(*encode_params)(const game_params *, bool full);
619 void (*free_params)(game_params *params); 612 void (*free_params)(game_params *params);
620 game_params *(*dup_params)(const game_params *params); 613 game_params *(*dup_params)(const game_params *params);
621 int can_configure; 614 bool can_configure;
622 config_item *(*configure)(const game_params *params); 615 config_item *(*configure)(const game_params *params);
623 game_params *(*custom_params)(const config_item *cfg); 616 game_params *(*custom_params)(const config_item *cfg);
624 const char *(*validate_params)(const game_params *params, int full); 617 const char *(*validate_params)(const game_params *params, bool full);
625 char *(*new_desc)(const game_params *params, random_state *rs, 618 char *(*new_desc)(const game_params *params, random_state *rs,
626 char **aux, int interactive); 619 char **aux, bool interactive);
627 const char *(*validate_desc)(const game_params *params, const char *desc); 620 const char *(*validate_desc)(const game_params *params, const char *desc);
628 game_state *(*new_game)(midend *me, const game_params *params, 621 game_state *(*new_game)(midend *me, const game_params *params,
629 const char *desc); 622 const char *desc);
630 game_state *(*dup_game)(const game_state *state); 623 game_state *(*dup_game)(const game_state *state);
631 void (*free_game)(game_state *state); 624 void (*free_game)(game_state *state);
632 int can_solve; 625 bool can_solve;
633 char *(*solve)(const game_state *orig, const game_state *curr, 626 char *(*solve)(const game_state *orig, const game_state *curr,
634 const char *aux, const char **error); 627 const char *aux, const char **error);
635 int can_format_as_text_ever; 628 bool can_format_as_text_ever;
636 int (*can_format_as_text_now)(const game_params *params); 629 bool (*can_format_as_text_now)(const game_params *params);
637 char *(*text_format)(const game_state *state); 630 char *(*text_format)(const game_state *state);
638 game_ui *(*new_ui)(const game_state *state); 631 game_ui *(*new_ui)(const game_state *state);
639 void (*free_ui)(game_ui *ui); 632 void (*free_ui)(game_ui *ui);
@@ -661,12 +654,12 @@ struct game {
661 float (*flash_length)(const game_state *oldstate, 654 float (*flash_length)(const game_state *oldstate,
662 const game_state *newstate, int dir, game_ui *ui); 655 const game_state *newstate, int dir, game_ui *ui);
663 int (*status)(const game_state *state); 656 int (*status)(const game_state *state);
664 int can_print, can_print_in_colour; 657 bool can_print, can_print_in_colour;
665 void (*print_size)(const game_params *params, float *x, float *y); 658 void (*print_size)(const game_params *params, float *x, float *y);
666 void (*print)(drawing *dr, const game_state *state, int tilesize); 659 void (*print)(drawing *dr, const game_state *state, int tilesize);
667 int wants_statusbar; 660 bool wants_statusbar;
668 int is_timed; 661 bool is_timed;
669 int (*timing_state)(const game_state *state, game_ui *ui); 662 bool (*timing_state)(const game_state *state, game_ui *ui);
670 int flags; 663 int flags;
671}; 664};
672 665
@@ -703,7 +696,7 @@ struct drawing_api {
703 void (*end_page)(void *handle, int number); 696 void (*end_page)(void *handle, int number);
704 void (*end_doc)(void *handle); 697 void (*end_doc)(void *handle);
705 void (*line_width)(void *handle, float width); 698 void (*line_width)(void *handle, float width);
706 void (*line_dotted)(void *handle, int dotted); 699 void (*line_dotted)(void *handle, bool dotted);
707 char *(*text_fallback)(void *handle, const char *const *strings, 700 char *(*text_fallback)(void *handle, const char *const *strings,
708 int nstrings); 701 int nstrings);
709 void (*draw_thick_line)(void *handle, float thickness, 702 void (*draw_thick_line)(void *handle, float thickness,
diff --git a/apps/plugins/puzzles/src/range.c b/apps/plugins/puzzles/src/range.c
index 03bdf6d5fd..64bd17da56 100644
--- a/apps/plugins/puzzles/src/range.c
+++ b/apps/plugins/puzzles/src/range.c
@@ -94,8 +94,7 @@ struct game_params {
94 94
95struct game_state { 95struct game_state {
96 struct game_params params; 96 struct game_params params;
97 unsigned int has_cheated: 1; 97 bool has_cheated, was_solved;
98 unsigned int was_solved: 1;
99 puzzle_size *grid; 98 puzzle_size *grid;
100}; 99};
101 100
@@ -123,11 +122,11 @@ static game_params *dup_params(const game_params *params)
123 return ret; 122 return ret;
124} 123}
125 124
126static int game_fetch_preset(int i, char **name, game_params **params) 125static bool game_fetch_preset(int i, char **name, game_params **params)
127{ 126{
128 game_params *ret; 127 game_params *ret;
129 128
130 if (i < 0 || i >= lenof(range_presets)) return FALSE; 129 if (i < 0 || i >= lenof(range_presets)) return false;
131 130
132 ret = default_params(); 131 ret = default_params();
133 *ret = range_presets[i]; /* struct copy */ 132 *ret = range_presets[i]; /* struct copy */
@@ -135,7 +134,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
135 134
136 *name = nfmtstr(40, "%d x %d", range_presets[i].w, range_presets[i].h); 135 *name = nfmtstr(40, "%d x %d", range_presets[i].w, range_presets[i].h);
137 136
138 return TRUE; 137 return true;
139} 138}
140 139
141static void free_params(game_params *params) 140static void free_params(game_params *params)
@@ -155,7 +154,7 @@ static void decode_params(game_params *params, char const *string)
155 } 154 }
156} 155}
157 156
158static char *encode_params(const game_params *params, int full) 157static char *encode_params(const game_params *params, bool full)
159{ 158{
160 char str[80]; 159 char str[80];
161 sprintf(str, "%dx%d", params->w, params->h); 160 sprintf(str, "%dx%d", params->w, params->h);
@@ -388,7 +387,7 @@ static int runlength(puzzle_size r, puzzle_size c,
388{ 387{
389 int const w = state->params.w, h = state->params.h; 388 int const w = state->params.w, h = state->params.h;
390 int sz = 0; 389 int sz = 0;
391 while (TRUE) { 390 while (true) {
392 int cell = idx(r, c, w); 391 int cell = idx(r, c, w);
393 if (out_of_bounds(r, c, w, h)) break; 392 if (out_of_bounds(r, c, w, h)) break;
394 if (state->grid[cell] > 0) { 393 if (state->grid[cell] > 0) {
@@ -687,7 +686,7 @@ static int newdesc_strip_clues(game_state *state, int *shuffle_1toN);
687static char *newdesc_encode_game_description(int n, puzzle_size *grid); 686static char *newdesc_encode_game_description(int n, puzzle_size *grid);
688 687
689static char *new_game_desc(const game_params *params, random_state *rs, 688static char *new_game_desc(const game_params *params, random_state *rs,
690 char **aux, int interactive) 689 char **aux, bool interactive)
691{ 690{
692 int const w = params->w, h = params->h, n = w * h; 691 int const w = params->w, h = params->h, n = w * h;
693 692
@@ -702,11 +701,11 @@ static char *new_game_desc(const game_params *params, random_state *rs,
702 state.params = *params; 701 state.params = *params;
703 state.grid = grid; 702 state.grid = grid;
704 703
705 interactive = 0; /* I don't need it, I shouldn't use it*/ 704 interactive = false; /* I don't need it, I shouldn't use it*/
706 705
707 for (i = 0; i < n; ++i) shuffle_1toN[i] = i; 706 for (i = 0; i < n; ++i) shuffle_1toN[i] = i;
708 707
709 while (TRUE) { 708 while (true) {
710 shuffle(shuffle_1toN, n, sizeof (int), rs); 709 shuffle(shuffle_1toN, n, sizeof (int), rs);
711 newdesc_choose_black_squares(&state, shuffle_1toN); 710 newdesc_choose_black_squares(&state, shuffle_1toN);
712 711
@@ -907,7 +906,7 @@ static int dfs_count_white(game_state *state, int cell)
907 return k; 906 return k;
908} 907}
909 908
910static const char *validate_params(const game_params *params, int full) 909static const char *validate_params(const game_params *params, bool full)
911{ 910{
912 int const w = params->w, h = params->h; 911 int const w = params->w, h = params->h;
913 if (w < 1) return "Error: width is less than 1"; 912 if (w < 1) return "Error: width is less than 1";
@@ -1139,8 +1138,8 @@ static game_state *new_game(midend *me, const game_params *params,
1139 } 1138 }
1140 } 1139 }
1141 assert(i == n); 1140 assert(i == n);
1142 state->has_cheated = FALSE; 1141 state->has_cheated = false;
1143 state->was_solved = FALSE; 1142 state->was_solved = false;
1144 1143
1145 return state; 1144 return state;
1146} 1145}
@@ -1149,9 +1148,9 @@ static game_state *new_game(midend *me, const game_params *params,
1149 * User interface: ascii 1148 * User interface: ascii
1150 */ 1149 */
1151 1150
1152static int game_can_format_as_text_now(const game_params *params) 1151static bool game_can_format_as_text_now(const game_params *params)
1153{ 1152{
1154 return TRUE; 1153 return true;
1155} 1154}
1156 1155
1157static char *game_text_format(const game_state *state) 1156static char *game_text_format(const game_state *state)
@@ -1221,14 +1220,14 @@ static char *game_text_format(const game_state *state)
1221 1220
1222struct game_ui { 1221struct game_ui {
1223 puzzle_size r, c; /* cursor position */ 1222 puzzle_size r, c; /* cursor position */
1224 unsigned int cursor_show: 1; 1223 bool cursor_show;
1225}; 1224};
1226 1225
1227static game_ui *new_ui(const game_state *state) 1226static game_ui *new_ui(const game_state *state)
1228{ 1227{
1229 struct game_ui *ui = snew(game_ui); 1228 struct game_ui *ui = snew(game_ui);
1230 ui->r = ui->c = 0; 1229 ui->r = ui->c = 0;
1231 ui->cursor_show = FALSE; 1230 ui->cursor_show = false;
1232 return ui; 1231 return ui;
1233} 1232}
1234 1233
@@ -1248,15 +1247,13 @@ static void decode_ui(game_ui *ui, const char *encoding)
1248 1247
1249typedef struct drawcell { 1248typedef struct drawcell {
1250 puzzle_size value; 1249 puzzle_size value;
1251 unsigned int error: 1; 1250 bool error, cursor, flash;
1252 unsigned int cursor: 1;
1253 unsigned int flash: 1;
1254} drawcell; 1251} drawcell;
1255 1252
1256struct game_drawstate { 1253struct game_drawstate {
1257 int tilesize; 1254 int tilesize;
1258 drawcell *grid; 1255 drawcell *grid;
1259 unsigned int started: 1; 1256 bool started;
1260}; 1257};
1261 1258
1262#define TILESIZE (ds->tilesize) 1259#define TILESIZE (ds->tilesize)
@@ -1271,8 +1268,8 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1271 enum {none, forwards, backwards, hint}; 1268 enum {none, forwards, backwards, hint};
1272 int const w = state->params.w, h = state->params.h; 1269 int const w = state->params.w, h = state->params.h;
1273 int r = ui->r, c = ui->c, action = none, cell; 1270 int r = ui->r, c = ui->c, action = none, cell;
1274 int shift = button & MOD_SHFT; 1271 bool shift = button & MOD_SHFT;
1275 button &= ~shift; 1272 button &= ~MOD_SHFT;
1276 1273
1277 if (IS_CURSOR_SELECT(button) && !ui->cursor_show) return NULL; 1274 if (IS_CURSOR_SELECT(button) && !ui->cursor_show) return NULL;
1278 1275
@@ -1282,7 +1279,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1282 if (out_of_bounds(r, c, w, h)) return NULL; 1279 if (out_of_bounds(r, c, w, h)) return NULL;
1283 ui->r = r; 1280 ui->r = r;
1284 ui->c = c; 1281 ui->c = c;
1285 ui->cursor_show = FALSE; 1282 ui->cursor_show = false;
1286 } 1283 }
1287 1284
1288 if (button == LEFT_BUTTON || button == RIGHT_BUTTON) { 1285 if (button == LEFT_BUTTON || button == RIGHT_BUTTON) {
@@ -1331,7 +1328,8 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1331 for (i = 0; i < 4 && cursors[i] != button; ++i); 1328 for (i = 0; i < 4 && cursors[i] != button; ++i);
1332 assert (i < 4); 1329 assert (i < 4);
1333 if (shift) { 1330 if (shift) {
1334 int pre_r = r, pre_c = c, do_pre, do_post; 1331 int pre_r = r, pre_c = c;
1332 bool do_pre, do_post;
1335 cell = state->grid[idx(r, c, state->params.w)]; 1333 cell = state->grid[idx(r, c, state->params.w)];
1336 do_pre = (cell == EMPTY); 1334 do_pre = (cell == EMPTY);
1337 1335
@@ -1363,7 +1361,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1363 ui->r += dr[i]; 1361 ui->r += dr[i];
1364 ui->c += dc[i]; 1362 ui->c += dc[i];
1365 } 1363 }
1366 } else ui->cursor_show = TRUE; 1364 } else ui->cursor_show = true;
1367 return UI_UPDATE; 1365 return UI_UPDATE;
1368 } 1366 }
1369 1367
@@ -1407,7 +1405,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1407 return NULL; 1405 return NULL;
1408} 1406}
1409 1407
1410static int find_errors(const game_state *state, int *report) 1408static bool find_errors(const game_state *state, bool *report)
1411{ 1409{
1412 int const w = state->params.w, h = state->params.h, n = w * h; 1410 int const w = state->params.w, h = state->params.h, n = w * h;
1413 int *dsf; 1411 int *dsf;
@@ -1430,7 +1428,7 @@ static int find_errors(const game_state *state, int *report)
1430 if (out_of_bounds(rr, cc, w, h)) continue; 1428 if (out_of_bounds(rr, cc, w, h)) continue;
1431 if (state->grid[idx(rr, cc, w)] != BLACK) continue; 1429 if (state->grid[idx(rr, cc, w)] != BLACK) continue;
1432 if (!report) goto found_error; 1430 if (!report) goto found_error;
1433 report[i] = TRUE; 1431 report[i] = true;
1434 break; 1432 break;
1435 } 1433 }
1436 } 1434 }
@@ -1445,14 +1443,14 @@ static int find_errors(const game_state *state, int *report)
1445 } 1443 }
1446 if (!report) { 1444 if (!report) {
1447 if (runs != state->grid[i]) goto found_error; 1445 if (runs != state->grid[i]) goto found_error;
1448 } else if (runs < state->grid[i]) report[i] = TRUE; 1446 } else if (runs < state->grid[i]) report[i] = true;
1449 else { 1447 else {
1450 for (runs = 1, j = 0; j < 4; ++j) { 1448 for (runs = 1, j = 0; j < 4; ++j) {
1451 int const rr = r + dr[j], cc = c + dc[j]; 1449 int const rr = r + dr[j], cc = c + dc[j];
1452 runs += runlength(rr, cc, dr[j], dc[j], state, 1450 runs += runlength(rr, cc, dr[j], dc[j], state,
1453 ~(MASK(BLACK) | MASK(EMPTY))); 1451 ~(MASK(BLACK) | MASK(EMPTY)));
1454 } 1452 }
1455 if (runs > state->grid[i]) report[i] = TRUE; 1453 if (runs > state->grid[i]) report[i] = true;
1456 } 1454 }
1457 } 1455 }
1458 1456
@@ -1503,16 +1501,16 @@ static int find_errors(const game_state *state, int *report)
1503 1501
1504 for (i = 0; i < n; ++i) 1502 for (i = 0; i < n; ++i)
1505 if (state->grid[i] != BLACK && dsf_canonify(dsf, i) != canonical) 1503 if (state->grid[i] != BLACK && dsf_canonify(dsf, i) != canonical)
1506 report[i] = TRUE; 1504 report[i] = true;
1507 } 1505 }
1508 sfree(dsf); 1506 sfree(dsf);
1509 1507
1510 free_game(dup); 1508 free_game(dup);
1511 return FALSE; /* if report != NULL, this is ignored */ 1509 return false; /* if report != NULL, this is ignored */
1512 1510
1513found_error: 1511found_error:
1514 free_game(dup); 1512 free_game(dup);
1515 return TRUE; 1513 return true;
1516} 1514}
1517 1515
1518static game_state *execute_move(const game_state *state, const char *move) 1516static game_state *execute_move(const game_state *state, const char *move)
@@ -1527,7 +1525,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1527 1525
1528 if (*move == 'S') { 1526 if (*move == 'S') {
1529 ++move; 1527 ++move;
1530 ret->has_cheated = ret->was_solved = TRUE; 1528 ret->has_cheated = ret->was_solved = true;
1531 } 1529 }
1532 1530
1533 for (; *move; move += nchars) { 1531 for (; *move; move += nchars) {
@@ -1543,7 +1541,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1543 ret->grid[idx(r, c, ret->params.w)] = value; 1541 ret->grid[idx(r, c, ret->params.w)] = value;
1544 } 1542 }
1545 1543
1546 if (ret->was_solved == FALSE) 1544 if (!ret->was_solved)
1547 ret->was_solved = !find_errors(ret, NULL); 1545 ret->was_solved = !find_errors(ret, NULL);
1548 1546
1549 return ret; 1547 return ret;
@@ -1626,7 +1624,8 @@ static float *game_colours(frontend *fe, int *ncolours)
1626 return ret; 1624 return ret;
1627} 1625}
1628 1626
1629static drawcell makecell(puzzle_size value, int error, int cursor, int flash) 1627static drawcell makecell(puzzle_size value,
1628 bool error, bool cursor, bool flash)
1630{ 1629{
1631 drawcell ret; 1630 drawcell ret;
1632 setmember(ret, value); 1631 setmember(ret, value);
@@ -1643,11 +1642,11 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1643 int i; 1642 int i;
1644 1643
1645 ds->tilesize = 0; 1644 ds->tilesize = 0;
1646 ds->started = FALSE; 1645 ds->started = false;
1647 1646
1648 ds->grid = snewn(n, drawcell); 1647 ds->grid = snewn(n, drawcell);
1649 for (i = 0; i < n; ++i) 1648 for (i = 0; i < n; ++i)
1650 ds->grid[i] = makecell(w + h, FALSE, FALSE, FALSE); 1649 ds->grid[i] = makecell(w + h, false, false, false);
1651 1650
1652 return ds; 1651 return ds;
1653} 1652}
@@ -1660,7 +1659,7 @@ static void game_free_drawstate(drawing *dr, game_drawstate *ds)
1660 1659
1661#define cmpmember(a, b, field) ((a) . field == (b) . field) 1660#define cmpmember(a, b, field) ((a) . field == (b) . field)
1662 1661
1663static int cell_eq(drawcell a, drawcell b) 1662static bool cell_eq(drawcell a, drawcell b)
1664{ 1663{
1665 return 1664 return
1666 cmpmember(a, b, value) && 1665 cmpmember(a, b, value) &&
@@ -1683,23 +1682,23 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1683 1682
1684 int r, c, i; 1683 int r, c, i;
1685 1684
1686 int *errors = snewn(n, int); 1685 bool *errors = snewn(n, bool);
1687 memset(errors, FALSE, n * sizeof (int)); 1686 memset(errors, 0, n * sizeof (bool));
1688 find_errors(state, errors); 1687 find_errors(state, errors);
1689 1688
1690 assert (oldstate == NULL); /* only happens if animating moves */ 1689 assert (oldstate == NULL); /* only happens if animating moves */
1691 1690
1692 if (!ds->started) { 1691 if (!ds->started) {
1693 ds->started = TRUE; 1692 ds->started = true;
1694 draw_rect(dr, 0, 0, wpx, hpx, COL_BACKGROUND); 1693 draw_rect(dr, 0, 0, wpx, hpx, COL_BACKGROUND);
1695 draw_update(dr, 0, 0, wpx, hpx); 1694 draw_update(dr, 0, 0, wpx, hpx);
1696 } 1695 }
1697 1696
1698 for (i = r = 0; r < h; ++r) { 1697 for (i = r = 0; r < h; ++r) {
1699 for (c = 0; c < w; ++c, ++i) { 1698 for (c = 0; c < w; ++c, ++i) {
1700 drawcell cell = makecell(state->grid[i], errors[i], FALSE, flash); 1699 drawcell cell = makecell(state->grid[i], errors[i], false, flash);
1701 if (r == ui->r && c == ui->c && ui->cursor_show) 1700 if (r == ui->r && c == ui->c && ui->cursor_show)
1702 cell.cursor = TRUE; 1701 cell.cursor = true;
1703 if (!cell_eq(cell, ds->grid[i])) { 1702 if (!cell_eq(cell, ds->grid[i])) {
1704 draw_cell(dr, ds, r, c, cell); 1703 draw_cell(dr, ds, r, c, cell);
1705 ds->grid[i] = cell; 1704 ds->grid[i] = cell;
@@ -1745,10 +1744,10 @@ static void draw_cell(drawing *draw, game_drawstate *ds, int r, int c,
1745 draw_update(draw, x, y, ts + 1, ts + 1); 1744 draw_update(draw, x, y, ts + 1, ts + 1);
1746} 1745}
1747 1746
1748static int game_timing_state(const game_state *state, game_ui *ui) 1747static bool game_timing_state(const game_state *state, game_ui *ui)
1749{ 1748{
1750 puts("warning: game_timing_state was called (this shouldn't happen)"); 1749 puts("warning: game_timing_state was called (this shouldn't happen)");
1751 return FALSE; /* the (non-existing) timer should not be running */ 1750 return false; /* the (non-existing) timer should not be running */
1752} 1751}
1753 1752
1754/* ---------------------------------------------------------------------- 1753/* ----------------------------------------------------------------------
@@ -1780,7 +1779,7 @@ static void game_print(drawing *dr, const game_state *state, int tilesize)
1780 for (i = r = 0; r < h; ++r) 1779 for (i = r = 0; r < h; ++r)
1781 for (c = 0; c < w; ++c, ++i) 1780 for (c = 0; c < w; ++c, ++i)
1782 draw_cell(dr, ds, r, c, 1781 draw_cell(dr, ds, r, c,
1783 makecell(state->grid[i], FALSE, FALSE, FALSE)); 1782 makecell(state->grid[i], false, false, false));
1784 1783
1785 print_line_width(dr, 3 * tilesize / 40); 1784 print_line_width(dr, 3 * tilesize / 40);
1786 draw_rect_outline(dr, BORDER, BORDER, w*TILESIZE, h*TILESIZE, COL_GRID); 1785 draw_rect_outline(dr, BORDER, BORDER, w*TILESIZE, h*TILESIZE, COL_GRID);
@@ -1800,15 +1799,15 @@ struct game const thegame = {
1800 encode_params, 1799 encode_params,
1801 free_params, 1800 free_params,
1802 dup_params, 1801 dup_params,
1803 TRUE, game_configure, custom_params, 1802 true, game_configure, custom_params,
1804 validate_params, 1803 validate_params,
1805 new_game_desc, 1804 new_game_desc,
1806 validate_desc, 1805 validate_desc,
1807 new_game, 1806 new_game,
1808 dup_game, 1807 dup_game,
1809 free_game, 1808 free_game,
1810 TRUE, solve_game, 1809 true, solve_game,
1811 TRUE, game_can_format_as_text_now, game_text_format, 1810 true, game_can_format_as_text_now, game_text_format,
1812 new_ui, 1811 new_ui,
1813 free_ui, 1812 free_ui,
1814 encode_ui, 1813 encode_ui,
@@ -1825,8 +1824,8 @@ struct game const thegame = {
1825 game_anim_length, 1824 game_anim_length,
1826 game_flash_length, 1825 game_flash_length,
1827 game_status, 1826 game_status,
1828 TRUE, FALSE, game_print_size, game_print, 1827 true, false, game_print_size, game_print,
1829 FALSE, /* wants_statusbar */ 1828 false, /* wants_statusbar */
1830 FALSE, game_timing_state, 1829 false, game_timing_state,
1831 0, /* flags */ 1830 0, /* flags */
1832}; 1831};
diff --git a/apps/plugins/puzzles/src/rect.c b/apps/plugins/puzzles/src/rect.c
index 3d84f046b5..2cb01bfa5d 100644
--- a/apps/plugins/puzzles/src/rect.c
+++ b/apps/plugins/puzzles/src/rect.c
@@ -44,7 +44,7 @@ enum {
44struct game_params { 44struct game_params {
45 int w, h; 45 int w, h;
46 float expandfactor; 46 float expandfactor;
47 int unique; 47 bool unique;
48}; 48};
49 49
50#define INDEX(state, x, y) (((y) * (state)->w) + (x)) 50#define INDEX(state, x, y) (((y) * (state)->w) + (x))
@@ -80,7 +80,7 @@ struct game_state {
80 int *grid; /* contains the numbers */ 80 int *grid; /* contains the numbers */
81 unsigned char *vedge; /* (w+1) x h */ 81 unsigned char *vedge; /* (w+1) x h */
82 unsigned char *hedge; /* w x (h+1) */ 82 unsigned char *hedge; /* w x (h+1) */
83 int completed, cheated; 83 bool completed, cheated;
84 unsigned char *correct; 84 unsigned char *correct;
85}; 85};
86 86
@@ -90,12 +90,12 @@ static game_params *default_params(void)
90 90
91 ret->w = ret->h = 7; 91 ret->w = ret->h = 7;
92 ret->expandfactor = 0.0F; 92 ret->expandfactor = 0.0F;
93 ret->unique = TRUE; 93 ret->unique = true;
94 94
95 return ret; 95 return ret;
96} 96}
97 97
98static int game_fetch_preset(int i, char **name, game_params **params) 98static bool game_fetch_preset(int i, char **name, game_params **params)
99{ 99{
100 game_params *ret; 100 game_params *ret;
101 int w, h; 101 int w, h;
@@ -111,7 +111,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
111 case 5: w = 17, h = 17; break; 111 case 5: w = 17, h = 17; break;
112 case 6: w = 19, h = 19; break; 112 case 6: w = 19, h = 19; break;
113#endif 113#endif
114 default: return FALSE; 114 default: return false;
115 } 115 }
116 116
117 sprintf(buf, "%dx%d", w, h); 117 sprintf(buf, "%dx%d", w, h);
@@ -120,8 +120,8 @@ static int game_fetch_preset(int i, char **name, game_params **params)
120 ret->w = w; 120 ret->w = w;
121 ret->h = h; 121 ret->h = h;
122 ret->expandfactor = 0.0F; 122 ret->expandfactor = 0.0F;
123 ret->unique = TRUE; 123 ret->unique = true;
124 return TRUE; 124 return true;
125} 125}
126 126
127static void free_params(game_params *params) 127static void free_params(game_params *params)
@@ -153,11 +153,11 @@ static void decode_params(game_params *ret, char const *string)
153 } 153 }
154 if (*string == 'a') { 154 if (*string == 'a') {
155 string++; 155 string++;
156 ret->unique = FALSE; 156 ret->unique = false;
157 } 157 }
158} 158}
159 159
160static char *encode_params(const game_params *params, int full) 160static char *encode_params(const game_params *params, bool full)
161{ 161{
162 char data[256]; 162 char data[256];
163 163
@@ -217,7 +217,7 @@ static game_params *custom_params(const config_item *cfg)
217 return ret; 217 return ret;
218} 218}
219 219
220static const char *validate_params(const game_params *params, int full) 220static const char *validate_params(const game_params *params, bool full)
221{ 221{
222 if (params->w <= 0 || params->h <= 0) 222 if (params->w <= 0 || params->h <= 0)
223 return "Width and height must both be greater than zero"; 223 return "Width and height must both be greater than zero";
@@ -496,7 +496,7 @@ static int rect_solver(int w, int h, int nrects, struct numberdata *numbers,
496 * Now run the actual deduction loop. 496 * Now run the actual deduction loop.
497 */ 497 */
498 while (1) { 498 while (1) {
499 int done_something = FALSE; 499 bool done_something = false;
500 500
501#ifdef SOLVER_DIAGNOSTICS 501#ifdef SOLVER_DIAGNOSTICS
502 printf("starting deduction loop\n"); 502 printf("starting deduction loop\n");
@@ -609,7 +609,7 @@ static int rect_solver(int w, int h, int nrects, struct numberdata *numbers,
609 609
610 for (j = 0; j < rectpositions[i].n; j++) { 610 for (j = 0; j < rectpositions[i].n; j++) {
611 int xx, yy, k; 611 int xx, yy, k;
612 int del = FALSE; 612 bool del = false;
613 613
614 for (k = 0; k < nrects; k++) 614 for (k = 0; k < nrects; k++)
615 workspace[k] = 0; 615 workspace[k] = 0;
@@ -635,7 +635,7 @@ static int rect_solver(int w, int h, int nrects, struct numberdata *numbers,
635 rectpositions[i].rects[j].h, 635 rectpositions[i].rects[j].h,
636 x, y); 636 x, y);
637#endif 637#endif
638 del = TRUE; 638 del = true;
639 } 639 }
640 640
641 if (rectbyplace[y * w + x] != -1) { 641 if (rectbyplace[y * w + x] != -1) {
@@ -668,7 +668,7 @@ static int rect_solver(int w, int h, int nrects, struct numberdata *numbers,
668 rectpositions[i].rects[j].h, 668 rectpositions[i].rects[j].h,
669 k); 669 k);
670#endif 670#endif
671 del = TRUE; 671 del = true;
672 break; 672 break;
673 } 673 }
674 674
@@ -689,7 +689,7 @@ static int rect_solver(int w, int h, int nrects, struct numberdata *numbers,
689 rectpositions[i].rects[j].w, 689 rectpositions[i].rects[j].w,
690 rectpositions[i].rects[j].h); 690 rectpositions[i].rects[j].h);
691#endif 691#endif
692 del = TRUE; 692 del = true;
693 } 693 }
694 } 694 }
695 695
@@ -698,7 +698,7 @@ static int rect_solver(int w, int h, int nrects, struct numberdata *numbers,
698 698
699 j--; /* don't skip over next placement */ 699 j--; /* don't skip over next placement */
700 700
701 done_something = TRUE; 701 done_something = true;
702 } 702 }
703 } 703 }
704 } 704 }
@@ -742,7 +742,7 @@ static int rect_solver(int w, int h, int nrects, struct numberdata *numbers,
742 remove_rect_placement(w, h, rectpositions, overlaps, 742 remove_rect_placement(w, h, rectpositions, overlaps,
743 index, j); 743 index, j);
744 j--; /* don't skip over next placement */ 744 j--; /* don't skip over next placement */
745 done_something = TRUE; 745 done_something = true;
746 } 746 }
747 } 747 }
748 } 748 }
@@ -850,7 +850,7 @@ static int rect_solver(int w, int h, int nrects, struct numberdata *numbers,
850 remove_number_placement(w, h, &numbers[k], 850 remove_number_placement(w, h, &numbers[k],
851 m, rectbyplace); 851 m, rectbyplace);
852 m--; /* don't skip the next one */ 852 m--; /* don't skip the next one */
853 done_something = TRUE; 853 done_something = true;
854 } 854 }
855 } 855 }
856 } 856 }
@@ -1144,7 +1144,7 @@ static void display_grid(game_params *params, int *grid, int *numbers, int all)
1144#endif 1144#endif
1145 1145
1146static char *new_game_desc(const game_params *params_in, random_state *rs, 1146static char *new_game_desc(const game_params *params_in, random_state *rs,
1147 char **aux, int interactive) 1147 char **aux, bool interactive)
1148{ 1148{
1149 game_params params_copy = *params_in; /* structure copy */ 1149 game_params params_copy = *params_in; /* structure copy */
1150 game_params *params = &params_copy; 1150 game_params *params = &params_copy;
@@ -1270,7 +1270,7 @@ static char *new_game_desc(const game_params *params_in, random_state *rs,
1270 int dirs[4], ndirs; 1270 int dirs[4], ndirs;
1271 1271
1272#ifdef GENERATION_DIAGNOSTICS 1272#ifdef GENERATION_DIAGNOSTICS
1273 display_grid(params2, grid, NULL, FALSE); 1273 display_grid(params2, grid, NULL, false);
1274 printf("singleton at %d,%d\n", x, y); 1274 printf("singleton at %d,%d\n", x, y);
1275#endif 1275#endif
1276 1276
@@ -1448,7 +1448,7 @@ static char *new_game_desc(const game_params *params_in, random_state *rs,
1448 1448
1449#ifdef GENERATION_DIAGNOSTICS 1449#ifdef GENERATION_DIAGNOSTICS
1450 printf("before expansion:\n"); 1450 printf("before expansion:\n");
1451 display_grid(params2, grid, NULL, TRUE); 1451 display_grid(params2, grid, NULL, true);
1452#endif 1452#endif
1453 1453
1454 /* 1454 /*
@@ -1576,7 +1576,7 @@ static char *new_game_desc(const game_params *params_in, random_state *rs,
1576 1576
1577#ifdef GENERATION_DIAGNOSTICS 1577#ifdef GENERATION_DIAGNOSTICS
1578 printf("after expansion:\n"); 1578 printf("after expansion:\n");
1579 display_grid(params3, grid2, NULL, TRUE); 1579 display_grid(params3, grid2, NULL, true);
1580#endif 1580#endif
1581 /* 1581 /*
1582 * Transpose. 1582 * Transpose.
@@ -1607,7 +1607,7 @@ static char *new_game_desc(const game_params *params_in, random_state *rs,
1607 1607
1608#ifdef GENERATION_DIAGNOSTICS 1608#ifdef GENERATION_DIAGNOSTICS
1609 printf("after transposition:\n"); 1609 printf("after transposition:\n");
1610 display_grid(params2, grid, NULL, TRUE); 1610 display_grid(params2, grid, NULL, true);
1611#endif 1611#endif
1612 } 1612 }
1613 1613
@@ -1734,7 +1734,7 @@ static char *new_game_desc(const game_params *params_in, random_state *rs,
1734 } 1734 }
1735 1735
1736#ifdef GENERATION_DIAGNOSTICS 1736#ifdef GENERATION_DIAGNOSTICS
1737 display_grid(params, grid, numbers, FALSE); 1737 display_grid(params, grid, numbers, false);
1738#endif 1738#endif
1739 1739
1740 desc = snewn(11 * params->w * params->h, char); 1740 desc = snewn(11 * params->w * params->h, char);
@@ -1817,7 +1817,8 @@ static unsigned char *get_correct(game_state *state)
1817 if (index(state,ret,x,y) == 0xFF) { 1817 if (index(state,ret,x,y) == 0xFF) {
1818 int rw, rh; 1818 int rw, rh;
1819 int xx, yy; 1819 int xx, yy;
1820 int num, area, valid; 1820 int num, area;
1821 bool valid;
1821 1822
1822 /* 1823 /*
1823 * Find a rectangle starting at this point. 1824 * Find a rectangle starting at this point.
@@ -1834,14 +1835,14 @@ static unsigned char *get_correct(game_state *state)
1834 * should be if it's there at all. Find out if we 1835 * should be if it's there at all. Find out if we
1835 * really have a valid rectangle. 1836 * really have a valid rectangle.
1836 */ 1837 */
1837 valid = TRUE; 1838 valid = true;
1838 /* Check the horizontal edges. */ 1839 /* Check the horizontal edges. */
1839 for (xx = x; xx < x+rw; xx++) { 1840 for (xx = x; xx < x+rw; xx++) {
1840 for (yy = y; yy <= y+rh; yy++) { 1841 for (yy = y; yy <= y+rh; yy++) {
1841 int e = !HRANGE(state,xx,yy) || hedge(state,xx,yy); 1842 int e = !HRANGE(state,xx,yy) || hedge(state,xx,yy);
1842 int ec = (yy == y || yy == y+rh); 1843 int ec = (yy == y || yy == y+rh);
1843 if (e != ec) 1844 if (e != ec)
1844 valid = FALSE; 1845 valid = false;
1845 } 1846 }
1846 } 1847 }
1847 /* Check the vertical edges. */ 1848 /* Check the vertical edges. */
@@ -1850,7 +1851,7 @@ static unsigned char *get_correct(game_state *state)
1850 int e = !VRANGE(state,xx,yy) || vedge(state,xx,yy); 1851 int e = !VRANGE(state,xx,yy) || vedge(state,xx,yy);
1851 int ec = (xx == x || xx == x+rw); 1852 int ec = (xx == x || xx == x+rw);
1852 if (e != ec) 1853 if (e != ec)
1853 valid = FALSE; 1854 valid = false;
1854 } 1855 }
1855 } 1856 }
1856 1857
@@ -1875,13 +1876,13 @@ static unsigned char *get_correct(game_state *state)
1875 area++; 1876 area++;
1876 if (grid(state,xx,yy)) { 1877 if (grid(state,xx,yy)) {
1877 if (num > 0) 1878 if (num > 0)
1878 valid = FALSE; /* two numbers */ 1879 valid = false; /* two numbers */
1879 num = grid(state,xx,yy); 1880 num = grid(state,xx,yy);
1880 } 1881 }
1881 } 1882 }
1882 } 1883 }
1883 if (num != area) 1884 if (num != area)
1884 valid = FALSE; 1885 valid = false;
1885 1886
1886 /* 1887 /*
1887 * Now fill in the whole rectangle based on the 1888 * Now fill in the whole rectangle based on the
@@ -1911,7 +1912,8 @@ static game_state *new_game(midend *me, const game_params *params,
1911 state->grid = snewn(area, int); 1912 state->grid = snewn(area, int);
1912 state->vedge = snewn(area, unsigned char); 1913 state->vedge = snewn(area, unsigned char);
1913 state->hedge = snewn(area, unsigned char); 1914 state->hedge = snewn(area, unsigned char);
1914 state->completed = state->cheated = FALSE; 1915 state->completed = false;
1916 state->cheated = false;
1915 1917
1916 i = 0; 1918 i = 0;
1917 while (*desc) { 1919 while (*desc) {
@@ -2045,9 +2047,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
2045 return ret; 2047 return ret;
2046} 2048}
2047 2049
2048static int game_can_format_as_text_now(const game_params *params) 2050static bool game_can_format_as_text_now(const game_params *params)
2049{ 2051{
2050 return TRUE; 2052 return true;
2051} 2053}
2052 2054
2053static char *game_text_format(const game_state *state) 2055static char *game_text_format(const game_state *state)
@@ -2164,12 +2166,12 @@ struct game_ui {
2164 * the pointer _returns_ to its starting point the action is 2166 * the pointer _returns_ to its starting point the action is
2165 * treated as a small drag rather than a click. 2167 * treated as a small drag rather than a click.
2166 */ 2168 */
2167 int dragged; 2169 bool dragged;
2168 /* This flag is set if we're doing an erase operation (i.e. 2170 /* This flag is set if we're doing an erase operation (i.e.
2169 * removing edges in the centre of the rectangle without altering 2171 * removing edges in the centre of the rectangle without altering
2170 * the outlines). 2172 * the outlines).
2171 */ 2173 */
2172 int erasing; 2174 bool erasing;
2173 /* 2175 /*
2174 * These are the co-ordinates of the top-left and bottom-right squares 2176 * These are the co-ordinates of the top-left and bottom-right squares
2175 * in the drag box, respectively, or -1 otherwise. 2177 * in the drag box, respectively, or -1 otherwise.
@@ -2182,7 +2184,8 @@ struct game_ui {
2182 * These are the coordinates of a cursor, whether it's visible, and 2184 * These are the coordinates of a cursor, whether it's visible, and
2183 * whether it was used to start a drag. 2185 * whether it was used to start a drag.
2184 */ 2186 */
2185 int cur_x, cur_y, cur_visible, cur_dragging; 2187 int cur_x, cur_y;
2188 bool cur_visible, cur_dragging;
2186}; 2189};
2187 2190
2188static void reset_ui(game_ui *ui) 2191static void reset_ui(game_ui *ui)
@@ -2195,15 +2198,17 @@ static void reset_ui(game_ui *ui)
2195 ui->y1 = -1; 2198 ui->y1 = -1;
2196 ui->x2 = -1; 2199 ui->x2 = -1;
2197 ui->y2 = -1; 2200 ui->y2 = -1;
2198 ui->dragged = FALSE; 2201 ui->dragged = false;
2199} 2202}
2200 2203
2201static game_ui *new_ui(const game_state *state) 2204static game_ui *new_ui(const game_state *state)
2202{ 2205{
2203 game_ui *ui = snew(game_ui); 2206 game_ui *ui = snew(game_ui);
2204 reset_ui(ui); 2207 reset_ui(ui);
2205 ui->erasing = FALSE; 2208 ui->erasing = false;
2206 ui->cur_x = ui->cur_y = ui->cur_visible = ui->cur_dragging = 0; 2209 ui->cur_x = ui->cur_y = 0;
2210 ui->cur_visible = false;
2211 ui->cur_dragging = false;
2207 return ui; 2212 return ui;
2208} 2213}
2209 2214
@@ -2306,15 +2311,15 @@ static void coord_round(float x, float y, int *xr, int *yr)
2306} 2311}
2307 2312
2308/* 2313/*
2309 * Returns TRUE if it has made any change to the grid. 2314 * Returns true if it has made any change to the grid.
2310 */ 2315 */
2311static int grid_draw_rect(const game_state *state, 2316static bool grid_draw_rect(const game_state *state,
2312 unsigned char *hedge, unsigned char *vedge, 2317 unsigned char *hedge, unsigned char *vedge,
2313 int c, int really, int outline, 2318 int c, bool really, bool outline,
2314 int x1, int y1, int x2, int y2) 2319 int x1, int y1, int x2, int y2)
2315{ 2320{
2316 int x, y; 2321 int x, y;
2317 int changed = FALSE; 2322 bool changed = false;
2318 2323
2319 /* 2324 /*
2320 * Draw horizontal edges of rectangles. 2325 * Draw horizontal edges of rectangles.
@@ -2353,9 +2358,9 @@ static int grid_draw_rect(const game_state *state,
2353 return changed; 2358 return changed;
2354} 2359}
2355 2360
2356static int ui_draw_rect(const game_state *state, const game_ui *ui, 2361static bool ui_draw_rect(const game_state *state, const game_ui *ui,
2357 unsigned char *hedge, unsigned char *vedge, int c, 2362 unsigned char *hedge, unsigned char *vedge, int c,
2358 int really, int outline) 2363 bool really, bool outline)
2359{ 2364{
2360 return grid_draw_rect(state, hedge, vedge, c, really, outline, 2365 return grid_draw_rect(state, hedge, vedge, c, really, outline,
2361 ui->x1, ui->y1, ui->x2, ui->y2); 2366 ui->x1, ui->y1, ui->x2, ui->y2);
@@ -2367,7 +2372,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
2367} 2372}
2368 2373
2369struct game_drawstate { 2374struct game_drawstate {
2370 int started; 2375 bool started;
2371 int w, h, tilesize; 2376 int w, h, tilesize;
2372 unsigned long *visible; 2377 unsigned long *visible;
2373}; 2378};
@@ -2377,7 +2382,7 @@ static char *interpret_move(const game_state *from, game_ui *ui,
2377 int x, int y, int button) 2382 int x, int y, int button)
2378{ 2383{
2379 int xc, yc; 2384 int xc, yc;
2380 int startdrag = FALSE, enddrag = FALSE, active = FALSE, erasing = FALSE; 2385 bool startdrag = false, enddrag = false, active = false, erasing = false;
2381 char buf[80], *ret; 2386 char buf[80], *ret;
2382 2387
2383 button &= ~MOD_MASK; 2388 button &= ~MOD_MASK;
@@ -2387,23 +2392,23 @@ static char *interpret_move(const game_state *from, game_ui *ui,
2387 if (button == LEFT_BUTTON || button == RIGHT_BUTTON) { 2392 if (button == LEFT_BUTTON || button == RIGHT_BUTTON) {
2388 if (ui->drag_start_x >= 0 && ui->cur_dragging) 2393 if (ui->drag_start_x >= 0 && ui->cur_dragging)
2389 reset_ui(ui); /* cancel keyboard dragging */ 2394 reset_ui(ui); /* cancel keyboard dragging */
2390 startdrag = TRUE; 2395 startdrag = true;
2391 ui->cur_visible = ui->cur_dragging = FALSE; 2396 ui->cur_visible = ui->cur_dragging = false;
2392 active = TRUE; 2397 active = true;
2393 erasing = (button == RIGHT_BUTTON); 2398 erasing = (button == RIGHT_BUTTON);
2394 } else if (button == LEFT_RELEASE || button == RIGHT_RELEASE) { 2399 } else if (button == LEFT_RELEASE || button == RIGHT_RELEASE) {
2395 /* We assert we should have had a LEFT_BUTTON first. */ 2400 /* We assert we should have had a LEFT_BUTTON first. */
2396 if (ui->cur_visible) { 2401 if (ui->cur_visible) {
2397 ui->cur_visible = FALSE; 2402 ui->cur_visible = false;
2398 active = TRUE; 2403 active = true;
2399 } 2404 }
2400 assert(!ui->cur_dragging); 2405 assert(!ui->cur_dragging);
2401 enddrag = TRUE; 2406 enddrag = true;
2402 erasing = (button == RIGHT_RELEASE); 2407 erasing = (button == RIGHT_RELEASE);
2403 } else if (IS_CURSOR_MOVE(button)) { 2408 } else if (IS_CURSOR_MOVE(button)) {
2404 move_cursor(button, &ui->cur_x, &ui->cur_y, from->w, from->h, 0); 2409 move_cursor(button, &ui->cur_x, &ui->cur_y, from->w, from->h, false);
2405 ui->cur_visible = TRUE; 2410 ui->cur_visible = true;
2406 active = TRUE; 2411 active = true;
2407 if (!ui->cur_dragging) return UI_UPDATE; 2412 if (!ui->cur_dragging) return UI_UPDATE;
2408 coord_round((float)ui->cur_x + 0.5F, (float)ui->cur_y + 0.5F, &xc, &yc); 2413 coord_round((float)ui->cur_x + 0.5F, (float)ui->cur_y + 0.5F, &xc, &yc);
2409 } else if (IS_CURSOR_SELECT(button)) { 2414 } else if (IS_CURSOR_SELECT(button)) {
@@ -2416,27 +2421,27 @@ static char *interpret_move(const game_state *from, game_ui *ui,
2416 } 2421 }
2417 if (!ui->cur_visible) { 2422 if (!ui->cur_visible) {
2418 assert(!ui->cur_dragging); 2423 assert(!ui->cur_dragging);
2419 ui->cur_visible = TRUE; 2424 ui->cur_visible = true;
2420 return UI_UPDATE; 2425 return UI_UPDATE;
2421 } 2426 }
2422 coord_round((float)ui->cur_x + 0.5F, (float)ui->cur_y + 0.5F, &xc, &yc); 2427 coord_round((float)ui->cur_x + 0.5F, (float)ui->cur_y + 0.5F, &xc, &yc);
2423 erasing = (button == CURSOR_SELECT2); 2428 erasing = (button == CURSOR_SELECT2);
2424 if (ui->cur_dragging) { 2429 if (ui->cur_dragging) {
2425 ui->cur_dragging = FALSE; 2430 ui->cur_dragging = false;
2426 enddrag = TRUE; 2431 enddrag = true;
2427 active = TRUE; 2432 active = true;
2428 } else { 2433 } else {
2429 ui->cur_dragging = TRUE; 2434 ui->cur_dragging = true;
2430 startdrag = TRUE; 2435 startdrag = true;
2431 active = TRUE; 2436 active = true;
2432 } 2437 }
2433 } else if (button == '\b' || button == 27) { 2438 } else if (button == '\b' || button == 27) {
2434 if (!ui->cur_dragging) { 2439 if (!ui->cur_dragging) {
2435 ui->cur_visible = FALSE; 2440 ui->cur_visible = false;
2436 } else { 2441 } else {
2437 assert(ui->cur_visible); 2442 assert(ui->cur_visible);
2438 reset_ui(ui); /* cancel keyboard dragging */ 2443 reset_ui(ui); /* cancel keyboard dragging */
2439 ui->cur_dragging = FALSE; 2444 ui->cur_dragging = false;
2440 } 2445 }
2441 return UI_UPDATE; 2446 return UI_UPDATE;
2442 } else if (button != LEFT_DRAG && button != RIGHT_DRAG) { 2447 } else if (button != LEFT_DRAG && button != RIGHT_DRAG) {
@@ -2451,9 +2456,9 @@ static char *interpret_move(const game_state *from, game_ui *ui,
2451 ui->drag_start_y = yc; 2456 ui->drag_start_y = yc;
2452 ui->drag_end_x = -1; 2457 ui->drag_end_x = -1;
2453 ui->drag_end_y = -1; 2458 ui->drag_end_y = -1;
2454 ui->dragged = FALSE; 2459 ui->dragged = false;
2455 ui->erasing = erasing; 2460 ui->erasing = erasing;
2456 active = TRUE; 2461 active = true;
2457 } 2462 }
2458 2463
2459 if (ui->drag_start_x >= 0 && 2464 if (ui->drag_start_x >= 0 &&
@@ -2461,10 +2466,10 @@ static char *interpret_move(const game_state *from, game_ui *ui,
2461 int t; 2466 int t;
2462 2467
2463 if (ui->drag_end_x != -1 && ui->drag_end_y != -1) 2468 if (ui->drag_end_x != -1 && ui->drag_end_y != -1)
2464 ui->dragged = TRUE; 2469 ui->dragged = true;
2465 ui->drag_end_x = xc; 2470 ui->drag_end_x = xc;
2466 ui->drag_end_y = yc; 2471 ui->drag_end_y = yc;
2467 active = TRUE; 2472 active = true;
2468 2473
2469 if (xc >= 0 && xc <= 2*from->w && 2474 if (xc >= 0 && xc <= 2*from->w &&
2470 yc >= 0 && yc <= 2*from->h) { 2475 yc >= 0 && yc <= 2*from->h) {
@@ -2497,7 +2502,7 @@ static char *interpret_move(const game_state *from, game_ui *ui,
2497 2502
2498 if (ui->dragged) { 2503 if (ui->dragged) {
2499 if (ui_draw_rect(from, ui, from->hedge, 2504 if (ui_draw_rect(from, ui, from->hedge,
2500 from->vedge, 1, FALSE, !ui->erasing)) { 2505 from->vedge, 1, false, !ui->erasing)) {
2501 sprintf(buf, "%c%d,%d,%d,%d", 2506 sprintf(buf, "%c%d,%d,%d,%d",
2502 (int)(ui->erasing ? 'E' : 'R'), 2507 (int)(ui->erasing ? 'E' : 'R'),
2503 ui->x1, ui->y1, ui->x2 - ui->x1, ui->y2 - ui->y1); 2508 ui->x1, ui->y1, ui->x2 - ui->x1, ui->y2 - ui->y1);
@@ -2516,7 +2521,7 @@ static char *interpret_move(const game_state *from, game_ui *ui,
2516 } 2521 }
2517 2522
2518 reset_ui(ui); 2523 reset_ui(ui);
2519 active = TRUE; 2524 active = true;
2520 } 2525 }
2521 2526
2522 if (ret) 2527 if (ret)
@@ -2537,7 +2542,7 @@ static game_state *execute_move(const game_state *from, const char *move)
2537 int x, y; 2542 int x, y;
2538 2543
2539 ret = dup_game(from); 2544 ret = dup_game(from);
2540 ret->cheated = TRUE; 2545 ret->cheated = true;
2541 2546
2542 for (y = 0; y < ret->h; y++) 2547 for (y = 0; y < ret->h; y++)
2543 for (x = 1; x < ret->w; x++) { 2548 for (x = 1; x < ret->w; x++) {
@@ -2573,7 +2578,7 @@ static game_state *execute_move(const game_state *from, const char *move)
2573 ret = dup_game(from); 2578 ret = dup_game(from);
2574 2579
2575 if (mode == 'R' || mode == 'E') { 2580 if (mode == 'R' || mode == 'E') {
2576 grid_draw_rect(ret, ret->hedge, ret->vedge, 1, TRUE, 2581 grid_draw_rect(ret, ret->hedge, ret->vedge, 1, true,
2577 mode == 'R', x1, y1, x2, y2); 2582 mode == 'R', x1, y1, x2, y2);
2578 } else if (mode == 'H') { 2583 } else if (mode == 'H') {
2579 hedge(ret,x1,y1) = !hedge(ret,x1,y1); 2584 hedge(ret,x1,y1) = !hedge(ret,x1,y1);
@@ -2589,16 +2594,17 @@ static game_state *execute_move(const game_state *from, const char *move)
2589 * if the game has been completed. 2594 * if the game has been completed.
2590 */ 2595 */
2591 if (!ret->completed) { 2596 if (!ret->completed) {
2592 int x, y, ok; 2597 int x, y;
2598 bool ok;
2593 2599
2594 ok = TRUE; 2600 ok = true;
2595 for (x = 0; x < ret->w; x++) 2601 for (x = 0; x < ret->w; x++)
2596 for (y = 0; y < ret->h; y++) 2602 for (y = 0; y < ret->h; y++)
2597 if (!index(ret, ret->correct, x, y)) 2603 if (!index(ret, ret->correct, x, y))
2598 ok = FALSE; 2604 ok = false;
2599 2605
2600 if (ok) 2606 if (ok)
2601 ret->completed = TRUE; 2607 ret->completed = true;
2602 } 2608 }
2603 2609
2604 return ret; 2610 return ret;
@@ -2674,7 +2680,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
2674 struct game_drawstate *ds = snew(struct game_drawstate); 2680 struct game_drawstate *ds = snew(struct game_drawstate);
2675 int i; 2681 int i;
2676 2682
2677 ds->started = FALSE; 2683 ds->started = false;
2678 ds->w = state->w; 2684 ds->w = state->w;
2679 ds->h = state->h; 2685 ds->h = state->h;
2680 ds->visible = snewn(ds->w * ds->h, unsigned long); 2686 ds->visible = snewn(ds->w * ds->h, unsigned long);
@@ -2761,7 +2767,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2761 vedge = snewn(state->w*state->h, unsigned char); 2767 vedge = snewn(state->w*state->h, unsigned char);
2762 memcpy(hedge, state->hedge, state->w*state->h); 2768 memcpy(hedge, state->hedge, state->w*state->h);
2763 memcpy(vedge, state->vedge, state->w*state->h); 2769 memcpy(vedge, state->vedge, state->w*state->h);
2764 ui_draw_rect(state, ui, hedge, vedge, ui->erasing ? 3 : 2, TRUE, TRUE); 2770 ui_draw_rect(state, ui, hedge, vedge, ui->erasing ? 3 : 2, true, true);
2765 } else { 2771 } else {
2766 hedge = state->hedge; 2772 hedge = state->hedge;
2767 vedge = state->vedge; 2773 vedge = state->vedge;
@@ -2795,7 +2801,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2795 state->h * TILE_SIZE + 2*BORDER + 1, COL_BACKGROUND); 2801 state->h * TILE_SIZE + 2*BORDER + 1, COL_BACKGROUND);
2796 draw_rect(dr, COORD(0)-1, COORD(0)-1, 2802 draw_rect(dr, COORD(0)-1, COORD(0)-1,
2797 ds->w*TILE_SIZE+3, ds->h*TILE_SIZE+3, COL_LINE); 2803 ds->w*TILE_SIZE+3, ds->h*TILE_SIZE+3, COL_LINE);
2798 ds->started = TRUE; 2804 ds->started = true;
2799 draw_update(dr, 0, 0, 2805 draw_update(dr, 0, 0,
2800 state->w * TILE_SIZE + 2*BORDER + 1, 2806 state->w * TILE_SIZE + 2*BORDER + 1,
2801 state->h * TILE_SIZE + 2*BORDER + 1); 2807 state->h * TILE_SIZE + 2*BORDER + 1);
@@ -2882,9 +2888,9 @@ static int game_status(const game_state *state)
2882 return state->completed ? +1 : 0; 2888 return state->completed ? +1 : 0;
2883} 2889}
2884 2890
2885static int game_timing_state(const game_state *state, game_ui *ui) 2891static bool game_timing_state(const game_state *state, game_ui *ui)
2886{ 2892{
2887 return TRUE; 2893 return true;
2888} 2894}
2889 2895
2890static void game_print_size(const game_params *params, float *x, float *y) 2896static void game_print_size(const game_params *params, float *x, float *y)
@@ -2964,15 +2970,15 @@ const struct game thegame = {
2964 encode_params, 2970 encode_params,
2965 free_params, 2971 free_params,
2966 dup_params, 2972 dup_params,
2967 TRUE, game_configure, custom_params, 2973 true, game_configure, custom_params,
2968 validate_params, 2974 validate_params,
2969 new_game_desc, 2975 new_game_desc,
2970 validate_desc, 2976 validate_desc,
2971 new_game, 2977 new_game,
2972 dup_game, 2978 dup_game,
2973 free_game, 2979 free_game,
2974 TRUE, solve_game, 2980 true, solve_game,
2975 TRUE, game_can_format_as_text_now, game_text_format, 2981 true, game_can_format_as_text_now, game_text_format,
2976 new_ui, 2982 new_ui,
2977 free_ui, 2983 free_ui,
2978 encode_ui, 2984 encode_ui,
@@ -2989,9 +2995,9 @@ const struct game thegame = {
2989 game_anim_length, 2995 game_anim_length,
2990 game_flash_length, 2996 game_flash_length,
2991 game_status, 2997 game_status,
2992 TRUE, FALSE, game_print_size, game_print, 2998 true, false, game_print_size, game_print,
2993 TRUE, /* wants_statusbar */ 2999 true, /* wants_statusbar */
2994 FALSE, game_timing_state, 3000 false, game_timing_state,
2995 0, /* flags */ 3001 0, /* flags */
2996}; 3002};
2997 3003
diff --git a/apps/plugins/puzzles/src/samegame.c b/apps/plugins/puzzles/src/samegame.c
index 4dfc302000..272c7b457d 100644
--- a/apps/plugins/puzzles/src/samegame.c
+++ b/apps/plugins/puzzles/src/samegame.c
@@ -97,7 +97,7 @@ enum {
97/* scoresub is 1 or 2 (for (n-1)^2 or (n-2)^2) */ 97/* scoresub is 1 or 2 (for (n-1)^2 or (n-2)^2) */
98struct game_params { 98struct game_params {
99 int w, h, ncols, scoresub; 99 int w, h, ncols, scoresub;
100 int soluble; /* choose generation algorithm */ 100 bool soluble; /* choose generation algorithm */
101}; 101};
102 102
103/* These flags must be unique across all uses; in the game_state, 103/* These flags must be unique across all uses; in the game_state,
@@ -132,7 +132,7 @@ struct game_state {
132 int n; 132 int n;
133 int *tiles; /* colour only */ 133 int *tiles; /* colour only */
134 int score; 134 int score;
135 int complete, impossible; 135 bool complete, impossible;
136}; 136};
137 137
138static game_params *default_params(void) 138static game_params *default_params(void)
@@ -142,29 +142,29 @@ static game_params *default_params(void)
142 ret->h = 5; 142 ret->h = 5;
143 ret->ncols = 3; 143 ret->ncols = 3;
144 ret->scoresub = 2; 144 ret->scoresub = 2;
145 ret->soluble = TRUE; 145 ret->soluble = true;
146 return ret; 146 return ret;
147} 147}
148 148
149static const struct game_params samegame_presets[] = { 149static const struct game_params samegame_presets[] = {
150 { 5, 5, 3, 2, TRUE }, 150 { 5, 5, 3, 2, true },
151 { 10, 5, 3, 2, TRUE }, 151 { 10, 5, 3, 2, true },
152#ifdef SLOW_SYSTEM 152#ifdef SLOW_SYSTEM
153 { 10, 10, 3, 2, TRUE }, 153 { 10, 10, 3, 2, true },
154#else 154#else
155 { 15, 10, 3, 2, TRUE }, 155 { 15, 10, 3, 2, true },
156#endif 156#endif
157 { 15, 10, 4, 2, TRUE }, 157 { 15, 10, 4, 2, true },
158 { 20, 15, 4, 2, TRUE } 158 { 20, 15, 4, 2, true }
159}; 159};
160 160
161static int game_fetch_preset(int i, char **name, game_params **params) 161static bool game_fetch_preset(int i, char **name, game_params **params)
162{ 162{
163 game_params *ret; 163 game_params *ret;
164 char str[80]; 164 char str[80];
165 165
166 if (i < 0 || i >= lenof(samegame_presets)) 166 if (i < 0 || i >= lenof(samegame_presets))
167 return FALSE; 167 return false;
168 168
169 ret = snew(game_params); 169 ret = snew(game_params);
170 *ret = samegame_presets[i]; 170 *ret = samegame_presets[i];
@@ -173,7 +173,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
173 173
174 *name = dupstr(str); 174 *name = dupstr(str);
175 *params = ret; 175 *params = ret;
176 return TRUE; 176 return true;
177} 177}
178 178
179static void free_params(game_params *params) 179static void free_params(game_params *params)
@@ -217,11 +217,11 @@ static void decode_params(game_params *params, char const *string)
217 } 217 }
218 if (*p == 'r') { 218 if (*p == 'r') {
219 p++; 219 p++;
220 params->soluble = FALSE; 220 params->soluble = false;
221 } 221 }
222} 222}
223 223
224static char *encode_params(const game_params *params, int full) 224static char *encode_params(const game_params *params, bool full)
225{ 225{
226 char ret[80]; 226 char ret[80];
227 227
@@ -281,7 +281,7 @@ static game_params *custom_params(const config_item *cfg)
281 return ret; 281 return ret;
282} 282}
283 283
284static const char *validate_params(const game_params *params, int full) 284static const char *validate_params(const game_params *params, bool full)
285{ 285{
286 if (params->w < 1 || params->h < 1) 286 if (params->w < 1 || params->h < 1)
287 return "Width and height must both be positive"; 287 return "Width and height must both be positive";
@@ -317,7 +317,8 @@ static void gen_grid(int w, int h, int nc, int *grid, random_state *rs)
317 int wh = w*h, tc = nc+1; 317 int wh = w*h, tc = nc+1;
318 int i, j, k, c, x, y, pos, n; 318 int i, j, k, c, x, y, pos, n;
319 int *list, *grid2; 319 int *list, *grid2;
320 int ok, failures = 0; 320 bool ok;
321 int failures = 0;
321 322
322 /* 323 /*
323 * We'll use `list' to track the possible places to put our 324 * We'll use `list' to track the possible places to put our
@@ -662,7 +663,7 @@ static void gen_grid(int w, int h, int nc, int *grid, random_state *rs)
662 */ 663 */
663 { 664 {
664 int x1, x2, y1, y2; 665 int x1, x2, y1, y2;
665 int ok = TRUE; 666 bool ok = true;
666 int fillstart = -1, ntc = 0; 667 int fillstart = -1, ntc = 0;
667 668
668#ifdef GENERATION_DIAGNOSTICS 669#ifdef GENERATION_DIAGNOSTICS
@@ -691,7 +692,7 @@ static void gen_grid(int w, int h, int nc, int *grid, random_state *rs)
691#endif 692#endif
692 693
693 for (x1 = x2 = 0; x2 < w; x2++) { 694 for (x1 = x2 = 0; x2 < w; x2++) {
694 int usedcol = FALSE; 695 bool usedcol = false;
695 696
696 for (y1 = y2 = h-1; y2 >= 0; y2--) { 697 for (y1 = y2 = h-1; y2 >= 0; y2--) {
697 if (grid2[y2*w+x2] == tc) { 698 if (grid2[y2*w+x2] == tc) {
@@ -706,19 +707,19 @@ static void gen_grid(int w, int h, int nc, int *grid, random_state *rs)
706 printf("adjacency failure at %d,%d\n", 707 printf("adjacency failure at %d,%d\n",
707 x2, y2); 708 x2, y2);
708#endif 709#endif
709 ok = FALSE; 710 ok = false;
710 } 711 }
711 continue; 712 continue;
712 } 713 }
713 if (grid2[y2*w+x2] == 0) 714 if (grid2[y2*w+x2] == 0)
714 break; 715 break;
715 usedcol = TRUE; 716 usedcol = true;
716 if (grid2[y2*w+x2] != grid[y1*w+x1]) { 717 if (grid2[y2*w+x2] != grid[y1*w+x1]) {
717#ifdef GENERATION_DIAGNOSTICS 718#ifdef GENERATION_DIAGNOSTICS
718 printf("matching failure at %d,%d vs %d,%d\n", 719 printf("matching failure at %d,%d vs %d,%d\n",
719 x2, y2, x1, y1); 720 x2, y2, x1, y1);
720#endif 721#endif
721 ok = FALSE; 722 ok = false;
722 } 723 }
723 y1--; 724 y1--;
724 } 725 }
@@ -735,7 +736,7 @@ static void gen_grid(int w, int h, int nc, int *grid, random_state *rs)
735 printf("junk at column top (%d,%d)\n", 736 printf("junk at column top (%d,%d)\n",
736 x1, y1); 737 x1, y1);
737#endif 738#endif
738 ok = FALSE; 739 ok = false;
739 } 740 }
740 y1--; 741 y1--;
741 } 742 }
@@ -830,10 +831,10 @@ static void gen_grid(int w, int h, int nc, int *grid, random_state *rs)
830 break; 831 break;
831 } 832 }
832 833
833 ok = TRUE; 834 ok = true;
834 for (i = 0; i < wh; i++) 835 for (i = 0; i < wh; i++)
835 if (grid[i] == 0) { 836 if (grid[i] == 0) {
836 ok = FALSE; 837 ok = false;
837 failures++; 838 failures++;
838#if defined GENERATION_DIAGNOSTICS || defined SHOW_INCOMPLETE 839#if defined GENERATION_DIAGNOSTICS || defined SHOW_INCOMPLETE
839 { 840 {
@@ -912,7 +913,7 @@ static void gen_grid_random(int w, int h, int nc, int *grid, random_state *rs)
912} 913}
913 914
914static char *new_game_desc(const game_params *params, random_state *rs, 915static char *new_game_desc(const game_params *params, random_state *rs,
915 char **aux, int interactive) 916 char **aux, bool interactive)
916{ 917{
917 char *ret; 918 char *ret;
918 int n, i, retlen, *tiles; 919 int n, i, retlen, *tiles;
@@ -987,7 +988,8 @@ static game_state *new_game(midend *me, const game_params *params,
987 p++; 988 p++;
988 if (*p) p++; /* eat comma */ 989 if (*p) p++; /* eat comma */
989 } 990 }
990 state->complete = state->impossible = 0; 991 state->complete = false;
992 state->impossible = false;
991 state->score = 0; 993 state->score = 0;
992 994
993 return state; 995 return state;
@@ -1017,9 +1019,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1017 return NULL; 1019 return NULL;
1018} 1020}
1019 1021
1020static int game_can_format_as_text_now(const game_params *params) 1022static bool game_can_format_as_text_now(const game_params *params)
1021{ 1023{
1022 return TRUE; 1024 return true;
1023} 1025}
1024 1026
1025static char *game_text_format(const game_state *state) 1027static char *game_text_format(const game_state *state)
@@ -1049,7 +1051,8 @@ struct game_ui {
1049 struct game_params params; 1051 struct game_params params;
1050 int *tiles; /* selected-ness only */ 1052 int *tiles; /* selected-ness only */
1051 int nselected; 1053 int nselected;
1052 int xsel, ysel, displaysel; 1054 int xsel, ysel;
1055 bool displaysel;
1053}; 1056};
1054 1057
1055static game_ui *new_ui(const game_state *state) 1058static game_ui *new_ui(const game_state *state)
@@ -1061,7 +1064,8 @@ static game_ui *new_ui(const game_state *state)
1061 memset(ui->tiles, 0, state->n*sizeof(int)); 1064 memset(ui->tiles, 0, state->n*sizeof(int));
1062 ui->nselected = 0; 1065 ui->nselected = 0;
1063 1066
1064 ui->xsel = ui->ysel = ui->displaysel = 0; 1067 ui->xsel = ui->ysel = 0;
1068 ui->displaysel = false;
1065 1069
1066 return ui; 1070 return ui;
1067} 1071}
@@ -1102,7 +1106,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1102 * control cursor. 1106 * control cursor.
1103 */ 1107 */
1104 if (newstate->complete || newstate->impossible) 1108 if (newstate->complete || newstate->impossible)
1105 ui->displaysel = 0; 1109 ui->displaysel = false;
1106} 1110}
1107 1111
1108static char *sel_movedesc(game_ui *ui, const game_state *state) 1112static char *sel_movedesc(game_ui *ui, const game_state *state)
@@ -1192,13 +1196,13 @@ static void sel_expand(game_ui *ui, const game_state *state, int tx, int ty)
1192 } 1196 }
1193} 1197}
1194 1198
1195static int sg_emptycol(game_state *ret, int x) 1199static bool sg_emptycol(game_state *ret, int x)
1196{ 1200{
1197 int y; 1201 int y;
1198 for (y = 0; y < ret->params.h; y++) { 1202 for (y = 0; y < ret->params.h; y++) {
1199 if (COL(ret,x,y)) return 0; 1203 if (COL(ret,x,y)) return false;
1200 } 1204 }
1201 return 1; 1205 return true;
1202} 1206}
1203 1207
1204 1208
@@ -1236,20 +1240,21 @@ static void sg_snuggle(game_state *ret)
1236 1240
1237static void sg_check(game_state *ret) 1241static void sg_check(game_state *ret)
1238{ 1242{
1239 int x,y, complete = 1, impossible = 1; 1243 int x,y;
1244 bool complete = true, impossible = true;
1240 1245
1241 for (x = 0; x < ret->params.w; x++) { 1246 for (x = 0; x < ret->params.w; x++) {
1242 for (y = 0; y < ret->params.h; y++) { 1247 for (y = 0; y < ret->params.h; y++) {
1243 if (COL(ret,x,y) == 0) 1248 if (COL(ret,x,y) == 0)
1244 continue; 1249 continue;
1245 complete = 0; 1250 complete = false;
1246 if (x+1 < ret->params.w) { 1251 if (x+1 < ret->params.w) {
1247 if (COL(ret,x,y) == COL(ret,x+1,y)) 1252 if (COL(ret,x,y) == COL(ret,x+1,y))
1248 impossible = 0; 1253 impossible = false;
1249 } 1254 }
1250 if (y+1 < ret->params.h) { 1255 if (y+1 < ret->params.h) {
1251 if (COL(ret,x,y) == COL(ret,x,y+1)) 1256 if (COL(ret,x,y) == COL(ret,x,y+1))
1252 impossible = 0; 1257 impossible = false;
1253 } 1258 }
1254 } 1259 }
1255 } 1260 }
@@ -1258,7 +1263,8 @@ static void sg_check(game_state *ret)
1258} 1263}
1259 1264
1260struct game_drawstate { 1265struct game_drawstate {
1261 int started, bgcolour; 1266 bool started;
1267 int bgcolour;
1262 int tileinner, tilegap; 1268 int tileinner, tilegap;
1263 int *tiles; /* contains colour and SELECTED. */ 1269 int *tiles; /* contains colour and SELECTED. */
1264}; 1270};
@@ -1270,20 +1276,20 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1270 int tx, ty; 1276 int tx, ty;
1271 char *ret = UI_UPDATE; 1277 char *ret = UI_UPDATE;
1272 1278
1273 ui->displaysel = 0; 1279 ui->displaysel = false;
1274 1280
1275 if (button == RIGHT_BUTTON || button == LEFT_BUTTON) { 1281 if (button == RIGHT_BUTTON || button == LEFT_BUTTON) {
1276 tx = FROMCOORD(x); ty= FROMCOORD(y); 1282 tx = FROMCOORD(x); ty= FROMCOORD(y);
1277 } else if (IS_CURSOR_MOVE(button)) { 1283 } else if (IS_CURSOR_MOVE(button)) {
1278 int dx = 0, dy = 0; 1284 int dx = 0, dy = 0;
1279 ui->displaysel = 1; 1285 ui->displaysel = true;
1280 dx = (button == CURSOR_LEFT) ? -1 : ((button == CURSOR_RIGHT) ? +1 : 0); 1286 dx = (button == CURSOR_LEFT) ? -1 : ((button == CURSOR_RIGHT) ? +1 : 0);
1281 dy = (button == CURSOR_DOWN) ? +1 : ((button == CURSOR_UP) ? -1 : 0); 1287 dy = (button == CURSOR_DOWN) ? +1 : ((button == CURSOR_UP) ? -1 : 0);
1282 ui->xsel = (ui->xsel + state->params.w + dx) % state->params.w; 1288 ui->xsel = (ui->xsel + state->params.w + dx) % state->params.w;
1283 ui->ysel = (ui->ysel + state->params.h + dy) % state->params.h; 1289 ui->ysel = (ui->ysel + state->params.h + dy) % state->params.h;
1284 return ret; 1290 return ret;
1285 } else if (IS_CURSOR_SELECT(button)) { 1291 } else if (IS_CURSOR_SELECT(button)) {
1286 ui->displaysel = 1; 1292 ui->displaysel = true;
1287 tx = ui->xsel; 1293 tx = ui->xsel;
1288 ty = ui->ysel; 1294 ty = ui->ysel;
1289 } else 1295 } else
@@ -1429,7 +1435,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1429 struct game_drawstate *ds = snew(struct game_drawstate); 1435 struct game_drawstate *ds = snew(struct game_drawstate);
1430 int i; 1436 int i;
1431 1437
1432 ds->started = 0; 1438 ds->started = false;
1433 ds->tileinner = ds->tilegap = 0; /* not decided yet */ 1439 ds->tileinner = ds->tilegap = 0; /* not decided yet */
1434 ds->tiles = snewn(state->n, int); 1440 ds->tiles = snewn(state->n, int);
1435 ds->bgcolour = -1; 1441 ds->bgcolour = -1;
@@ -1452,7 +1458,7 @@ static void game_free_drawstate(drawing *dr, game_drawstate *ds)
1452 */ 1458 */
1453 1459
1454static void tile_redraw(drawing *dr, game_drawstate *ds, 1460static void tile_redraw(drawing *dr, game_drawstate *ds,
1455 int x, int y, int dright, int dbelow, 1461 int x, int y, bool dright, bool dbelow,
1456 int tile, int bgcolour) 1462 int tile, int bgcolour)
1457{ 1463{
1458 int outer = bgcolour, inner = outer, col = tile & TILE_COLMASK; 1464 int outer = bgcolour, inner = outer, col = tile & TILE_COLMASK;
@@ -1532,7 +1538,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1532 coords[0] = COORD(0) - HIGHLIGHT_WIDTH; 1538 coords[0] = COORD(0) - HIGHLIGHT_WIDTH;
1533 draw_polygon(dr, coords, 5, COL_LOWLIGHT, COL_LOWLIGHT); 1539 draw_polygon(dr, coords, 5, COL_LOWLIGHT, COL_LOWLIGHT);
1534 1540
1535 ds->started = 1; 1541 ds->started = true;
1536 } 1542 }
1537 1543
1538 if (flashtime > 0.0) { 1544 if (flashtime > 0.0) {
@@ -1545,8 +1551,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1545 for (y = 0; y < state->params.h; y++) { 1551 for (y = 0; y < state->params.h; y++) {
1546 int i = (state->params.w * y) + x; 1552 int i = (state->params.w * y) + x;
1547 int col = COL(state,x,y), tile = col; 1553 int col = COL(state,x,y), tile = col;
1548 int dright = (x+1 < state->params.w); 1554 bool dright = (x+1 < state->params.w);
1549 int dbelow = (y+1 < state->params.h); 1555 bool dbelow = (y+1 < state->params.h);
1550 1556
1551 tile |= ISSEL(ui,x,y); 1557 tile |= ISSEL(ui,x,y);
1552 if (state->impossible) 1558 if (state->impossible)
@@ -1618,9 +1624,9 @@ static int game_status(const game_state *state)
1618 return state->complete ? +1 : 0; 1624 return state->complete ? +1 : 0;
1619} 1625}
1620 1626
1621static int game_timing_state(const game_state *state, game_ui *ui) 1627static bool game_timing_state(const game_state *state, game_ui *ui)
1622{ 1628{
1623 return TRUE; 1629 return true;
1624} 1630}
1625 1631
1626static void game_print_size(const game_params *params, float *x, float *y) 1632static void game_print_size(const game_params *params, float *x, float *y)
@@ -1643,15 +1649,15 @@ const struct game thegame = {
1643 encode_params, 1649 encode_params,
1644 free_params, 1650 free_params,
1645 dup_params, 1651 dup_params,
1646 TRUE, game_configure, custom_params, 1652 true, game_configure, custom_params,
1647 validate_params, 1653 validate_params,
1648 new_game_desc, 1654 new_game_desc,
1649 validate_desc, 1655 validate_desc,
1650 new_game, 1656 new_game,
1651 dup_game, 1657 dup_game,
1652 free_game, 1658 free_game,
1653 FALSE, solve_game, 1659 false, solve_game,
1654 TRUE, game_can_format_as_text_now, game_text_format, 1660 true, game_can_format_as_text_now, game_text_format,
1655 new_ui, 1661 new_ui,
1656 free_ui, 1662 free_ui,
1657 encode_ui, 1663 encode_ui,
@@ -1668,8 +1674,8 @@ const struct game thegame = {
1668 game_anim_length, 1674 game_anim_length,
1669 game_flash_length, 1675 game_flash_length,
1670 game_status, 1676 game_status,
1671 FALSE, FALSE, game_print_size, game_print, 1677 false, false, game_print_size, game_print,
1672 TRUE, /* wants_statusbar */ 1678 true, /* wants_statusbar */
1673 FALSE, game_timing_state, 1679 false, game_timing_state,
1674 0, /* flags */ 1680 0, /* flags */
1675}; 1681};
diff --git a/apps/plugins/puzzles/src/signpost.c b/apps/plugins/puzzles/src/signpost.c
index 04a315206f..abf4c6a79c 100644
--- a/apps/plugins/puzzles/src/signpost.c
+++ b/apps/plugins/puzzles/src/signpost.c
@@ -39,7 +39,7 @@ enum {
39 39
40struct game_params { 40struct game_params {
41 int w, h; 41 int w, h;
42 int force_corner_start; 42 bool force_corner_start;
43}; 43};
44 44
45enum { DIR_N = 0, DIR_NE, DIR_E, DIR_SE, DIR_S, DIR_SW, DIR_W, DIR_NW, DIR_MAX }; 45enum { DIR_N = 0, DIR_NE, DIR_E, DIR_SE, DIR_S, DIR_SW, DIR_W, DIR_NW, DIR_MAX };
@@ -52,7 +52,7 @@ static const int dys[DIR_MAX] = { -1, -1, 0, 1, 1, 1, 0, -1 };
52 52
53struct game_state { 53struct game_state {
54 int w, h, n; 54 int w, h, n;
55 int completed, used_solve, impossible; 55 bool completed, used_solve, impossible;
56 int *dirs; /* direction enums, size n */ 56 int *dirs; /* direction enums, size n */
57 int *nums; /* numbers, size n */ 57 int *nums; /* numbers, size n */
58 unsigned int *flags; /* flags, size n */ 58 unsigned int *flags; /* flags, size n */
@@ -92,35 +92,36 @@ static int whichdiri(game_state *state, int fromi, int toi)
92 return whichdir(fromi%w, fromi/w, toi%w, toi/w); 92 return whichdir(fromi%w, fromi/w, toi%w, toi/w);
93} 93}
94 94
95static int ispointing(const game_state *state, int fromx, int fromy, 95static bool ispointing(const game_state *state, int fromx, int fromy,
96 int tox, int toy) 96 int tox, int toy)
97{ 97{
98 int w = state->w, dir = state->dirs[fromy*w+fromx]; 98 int w = state->w, dir = state->dirs[fromy*w+fromx];
99 99
100 /* (by convention) squares do not point to themselves. */ 100 /* (by convention) squares do not point to themselves. */
101 if (fromx == tox && fromy == toy) return 0; 101 if (fromx == tox && fromy == toy) return false;
102 102
103 /* the final number points to nothing. */ 103 /* the final number points to nothing. */
104 if (state->nums[fromy*w + fromx] == state->n) return 0; 104 if (state->nums[fromy*w + fromx] == state->n) return false;
105 105
106 while (1) { 106 while (1) {
107 if (!INGRID(state, fromx, fromy)) return 0; 107 if (!INGRID(state, fromx, fromy)) return false;
108 if (fromx == tox && fromy == toy) return 1; 108 if (fromx == tox && fromy == toy) return true;
109 fromx += dxs[dir]; fromy += dys[dir]; 109 fromx += dxs[dir]; fromy += dys[dir];
110 } 110 }
111 return 0; /* not reached */ 111 return false; /* not reached */
112} 112}
113 113
114static int ispointingi(game_state *state, int fromi, int toi) 114static bool ispointingi(game_state *state, int fromi, int toi)
115{ 115{
116 int w = state->w; 116 int w = state->w;
117 return ispointing(state, fromi%w, fromi/w, toi%w, toi/w); 117 return ispointing(state, fromi%w, fromi/w, toi%w, toi/w);
118} 118}
119 119
120/* Taking the number 'num', work out the gap between it and the next 120/* Taking the number 'num', work out the gap between it and the next
121 * available number up or down (depending on d). Return 1 if the region 121 * available number up or down (depending on d). Return true if the
122 * at (x,y) will fit in that gap, or 0 otherwise. */ 122 * region at (x,y) will fit in that gap. */
123static int move_couldfit(const game_state *state, int num, int d, int x, int y) 123static bool move_couldfit(
124 const game_state *state, int num, int d, int x, int y)
124{ 125{
125 int n, gap, i = y*state->w+x, sz; 126 int n, gap, i = y*state->w+x, sz;
126 127
@@ -136,54 +137,54 @@ static int move_couldfit(const game_state *state, int num, int d, int x, int y)
136 /* no gap, so the only allowable move is that that directly 137 /* no gap, so the only allowable move is that that directly
137 * links the two numbers. */ 138 * links the two numbers. */
138 n = state->nums[i]; 139 n = state->nums[i];
139 return (n == num+d) ? 0 : 1; 140 return n != num+d;
140 } 141 }
141 if (state->prev[i] == -1 && state->next[i] == -1) 142 if (state->prev[i] == -1 && state->next[i] == -1)
142 return 1; /* single unconnected square, always OK */ 143 return true; /* single unconnected square, always OK */
143 144
144 sz = dsf_size(state->dsf, i); 145 sz = dsf_size(state->dsf, i);
145 return (sz > gap) ? 0 : 1; 146 return sz <= gap;
146} 147}
147 148
148static int isvalidmove(const game_state *state, int clever, 149static bool isvalidmove(const game_state *state, bool clever,
149 int fromx, int fromy, int tox, int toy) 150 int fromx, int fromy, int tox, int toy)
150{ 151{
151 int w = state->w, from = fromy*w+fromx, to = toy*w+tox; 152 int w = state->w, from = fromy*w+fromx, to = toy*w+tox;
152 int nfrom, nto; 153 int nfrom, nto;
153 154
154 if (!INGRID(state, fromx, fromy) || !INGRID(state, tox, toy)) 155 if (!INGRID(state, fromx, fromy) || !INGRID(state, tox, toy))
155 return 0; 156 return false;
156 157
157 /* can only move where we point */ 158 /* can only move where we point */
158 if (!ispointing(state, fromx, fromy, tox, toy)) 159 if (!ispointing(state, fromx, fromy, tox, toy))
159 return 0; 160 return false;
160 161
161 nfrom = state->nums[from]; nto = state->nums[to]; 162 nfrom = state->nums[from]; nto = state->nums[to];
162 163
163 /* can't move _from_ the preset final number, or _to_ the preset 1. */ 164 /* can't move _from_ the preset final number, or _to_ the preset 1. */
164 if (((nfrom == state->n) && (state->flags[from] & FLAG_IMMUTABLE)) || 165 if (((nfrom == state->n) && (state->flags[from] & FLAG_IMMUTABLE)) ||
165 ((nto == 1) && (state->flags[to] & FLAG_IMMUTABLE))) 166 ((nto == 1) && (state->flags[to] & FLAG_IMMUTABLE)))
166 return 0; 167 return false;
167 168
168 /* can't create a new connection between cells in the same region 169 /* can't create a new connection between cells in the same region
169 * as that would create a loop. */ 170 * as that would create a loop. */
170 if (dsf_canonify(state->dsf, from) == dsf_canonify(state->dsf, to)) 171 if (dsf_canonify(state->dsf, from) == dsf_canonify(state->dsf, to))
171 return 0; 172 return false;
172 173
173 /* if both cells are actual numbers, can't drag if we're not 174 /* if both cells are actual numbers, can't drag if we're not
174 * one digit apart. */ 175 * one digit apart. */
175 if (ISREALNUM(state, nfrom) && ISREALNUM(state, nto)) { 176 if (ISREALNUM(state, nfrom) && ISREALNUM(state, nto)) {
176 if (nfrom != nto-1) 177 if (nfrom != nto-1)
177 return 0; 178 return false;
178 } else if (clever && ISREALNUM(state, nfrom)) { 179 } else if (clever && ISREALNUM(state, nfrom)) {
179 if (!move_couldfit(state, nfrom, +1, tox, toy)) 180 if (!move_couldfit(state, nfrom, +1, tox, toy))
180 return 0; 181 return false;
181 } else if (clever && ISREALNUM(state, nto)) { 182 } else if (clever && ISREALNUM(state, nto)) {
182 if (!move_couldfit(state, nto, -1, fromx, fromy)) 183 if (!move_couldfit(state, nto, -1, fromx, fromy))
183 return 0; 184 return false;
184 } 185 }
185 186
186 return 1; 187 return true;
187} 188}
188 189
189static void makelink(game_state *state, int from, int to) 190static void makelink(game_state *state, int from, int to)
@@ -197,10 +198,10 @@ static void makelink(game_state *state, int from, int to)
197 state->prev[to] = from; 198 state->prev[to] = from;
198} 199}
199 200
200static int game_can_format_as_text_now(const game_params *params) 201static bool game_can_format_as_text_now(const game_params *params)
201{ 202{
202 if (params->w * params->h >= 100) return 0; 203 if (params->w * params->h >= 100) return false;
203 return 1; 204 return true;
204} 205}
205 206
206static char *game_text_format(const game_state *state) 207static char *game_text_format(const game_state *state)
@@ -279,9 +280,10 @@ static void strip_nums(game_state *state) {
279 dsf_init(state->dsf, state->n); 280 dsf_init(state->dsf, state->n);
280} 281}
281 282
282static int check_nums(game_state *orig, game_state *copy, int only_immutable) 283static bool check_nums(game_state *orig, game_state *copy, bool only_immutable)
283{ 284{
284 int i, ret = 1; 285 int i;
286 bool ret = true;
285 assert(copy->n == orig->n); 287 assert(copy->n == orig->n);
286 for (i = 0; i < copy->n; i++) { 288 for (i = 0; i < copy->n; i++) {
287 if (only_immutable && !(copy->flags[i] & FLAG_IMMUTABLE)) continue; 289 if (only_immutable && !(copy->flags[i] & FLAG_IMMUTABLE)) continue;
@@ -290,7 +292,7 @@ static int check_nums(game_state *orig, game_state *copy, int only_immutable)
290 if (copy->nums[i] != orig->nums[i]) { 292 if (copy->nums[i] != orig->nums[i]) {
291 debug(("check_nums: (%d,%d) copy=%d, orig=%d.", 293 debug(("check_nums: (%d,%d) copy=%d, orig=%d.",
292 i%orig->w, i/orig->w, copy->nums[i], orig->nums[i])); 294 i%orig->w, i/orig->w, copy->nums[i], orig->nums[i]));
293 ret = 0; 295 ret = false;
294 } 296 }
295 } 297 }
296 return ret; 298 return ret;
@@ -302,7 +304,7 @@ static game_params *default_params(void)
302{ 304{
303 game_params *ret = snew(game_params); 305 game_params *ret = snew(game_params);
304 ret->w = ret->h = 4; 306 ret->w = ret->h = 4;
305 ret->force_corner_start = 1; 307 ret->force_corner_start = true;
306 308
307 return ret; 309 return ret;
308} 310}
@@ -316,13 +318,13 @@ static const struct game_params signpost_presets[] = {
316 { 7, 7, 1 } 318 { 7, 7, 1 }
317}; 319};
318 320
319static int game_fetch_preset(int i, char **name, game_params **params) 321static bool game_fetch_preset(int i, char **name, game_params **params)
320{ 322{
321 game_params *ret; 323 game_params *ret;
322 char buf[80]; 324 char buf[80];
323 325
324 if (i < 0 || i >= lenof(signpost_presets)) 326 if (i < 0 || i >= lenof(signpost_presets))
325 return FALSE; 327 return false;
326 328
327 ret = default_params(); 329 ret = default_params();
328 *ret = signpost_presets[i]; 330 *ret = signpost_presets[i];
@@ -332,7 +334,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
332 ret->force_corner_start ? "" : ", free ends"); 334 ret->force_corner_start ? "" : ", free ends");
333 *name = dupstr(buf); 335 *name = dupstr(buf);
334 336
335 return TRUE; 337 return true;
336} 338}
337 339
338static void free_params(game_params *params) 340static void free_params(game_params *params)
@@ -356,15 +358,15 @@ static void decode_params(game_params *ret, char const *string)
356 ret->h = atoi(string); 358 ret->h = atoi(string);
357 while (*string && isdigit((unsigned char)*string)) string++; 359 while (*string && isdigit((unsigned char)*string)) string++;
358 } 360 }
359 ret->force_corner_start = 0; 361 ret->force_corner_start = false;
360 if (*string == 'c') { 362 if (*string == 'c') {
361 string++; 363 string++;
362 ret->force_corner_start = 1; 364 ret->force_corner_start = true;
363 } 365 }
364 366
365} 367}
366 368
367static char *encode_params(const game_params *params, int full) 369static char *encode_params(const game_params *params, bool full)
368{ 370{
369 char data[256]; 371 char data[256];
370 372
@@ -415,7 +417,7 @@ static game_params *custom_params(const config_item *cfg)
415 return ret; 417 return ret;
416} 418}
417 419
418static const char *validate_params(const game_params *params, int full) 420static const char *validate_params(const game_params *params, bool full)
419{ 421{
420 if (params->w < 1) return "Width must be at least one"; 422 if (params->w < 1) return "Width must be at least one";
421 if (params->h < 1) return "Height must be at least one"; 423 if (params->h < 1) return "Height must be at least one";
@@ -549,7 +551,7 @@ done:
549 } 551 }
550} 552}
551 553
552static char *generate_desc(game_state *state, int issolve) 554static char *generate_desc(game_state *state, bool issolve)
553{ 555{
554 char *ret, buf[80]; 556 char *ret, buf[80];
555 int retlen, i, k; 557 int retlen, i, k;
@@ -602,10 +604,11 @@ static int cell_adj(game_state *state, int i, int *ai, int *ad)
602 return n; 604 return n;
603} 605}
604 606
605static int new_game_fill(game_state *state, random_state *rs, 607static bool new_game_fill(game_state *state, random_state *rs,
606 int headi, int taili) 608 int headi, int taili)
607{ 609{
608 int nfilled, an, ret = 0, j; 610 int nfilled, an, j;
611 bool ret = false;
609 int *aidx, *adir; 612 int *aidx, *adir;
610 613
611 aidx = snewn(state->n, int); 614 aidx = snewn(state->n, int);
@@ -658,7 +661,7 @@ static int new_game_fill(game_state *state, random_state *rs,
658 661
659 /* it could happen that our last two weren't in line; if that's the 662 /* it could happen that our last two weren't in line; if that's the
660 * case, we have to start again. */ 663 * case, we have to start again. */
661 if (state->dirs[headi] != -1) ret = 1; 664 if (state->dirs[headi] != -1) ret = true;
662 665
663done: 666done:
664 sfree(aidx); 667 sfree(aidx);
@@ -713,11 +716,12 @@ static void debug_desc(const char *what, game_state *state)
713 716
714/* Expects a fully-numbered game_state on input, and makes sure 717/* Expects a fully-numbered game_state on input, and makes sure
715 * FLAG_IMMUTABLE is only set on those numbers we need to solve 718 * FLAG_IMMUTABLE is only set on those numbers we need to solve
716 * (as for a real new-game); returns 1 if it managed 719 * (as for a real new-game); returns true if it managed
717 * this (such that it could solve it), or 0 if not. */ 720 * this (such that it could solve it), or false if not. */
718static int new_game_strip(game_state *state, random_state *rs) 721static bool new_game_strip(game_state *state, random_state *rs)
719{ 722{
720 int *scratch, i, j, ret = 1; 723 int *scratch, i, j;
724 bool ret = true;
721 game_state *copy = dup_game(state); 725 game_state *copy = dup_game(state);
722 726
723 debug(("new_game_strip.")); 727 debug(("new_game_strip."));
@@ -728,7 +732,7 @@ static int new_game_strip(game_state *state, random_state *rs)
728 if (solve_state(copy) > 0) { 732 if (solve_state(copy) > 0) {
729 debug(("new_game_strip: soluble immediately after strip.")); 733 debug(("new_game_strip: soluble immediately after strip."));
730 free_game(copy); 734 free_game(copy);
731 return 1; 735 return true;
732 } 736 }
733 737
734 scratch = snewn(state->n, int); 738 scratch = snewn(state->n, int);
@@ -755,9 +759,9 @@ static int new_game_strip(game_state *state, random_state *rs)
755 debug_state("Copy of state: ", copy); 759 debug_state("Copy of state: ", copy);
756 strip_nums(copy); 760 strip_nums(copy);
757 if (solve_state(copy) > 0) goto solved; 761 if (solve_state(copy) > 0) goto solved;
758 assert(check_nums(state, copy, 1)); 762 assert(check_nums(state, copy, true));
759 } 763 }
760 ret = 0; 764 ret = false;
761 goto done; 765 goto done;
762 766
763solved: 767solved:
@@ -776,7 +780,7 @@ solved:
776 dup_game_to(copy, state); 780 dup_game_to(copy, state);
777 strip_nums(copy); 781 strip_nums(copy);
778 if (solve_state(copy) > 0) { 782 if (solve_state(copy) > 0) {
779 assert(check_nums(state, copy, 0)); 783 assert(check_nums(state, copy, false));
780 debug(("new_game_strip: OK, removing number")); 784 debug(("new_game_strip: OK, removing number"));
781 } else { 785 } else {
782 assert(state->nums[j] <= state->n); 786 assert(state->nums[j] <= state->n);
@@ -795,7 +799,7 @@ done:
795} 799}
796 800
797static char *new_game_desc(const game_params *params, random_state *rs, 801static char *new_game_desc(const game_params *params, random_state *rs,
798 char **aux, int interactive) 802 char **aux, bool interactive)
799{ 803{
800 game_state *state = blank_game(params->w, params->h); 804 game_state *state = blank_game(params->w, params->h);
801 char *ret; 805 char *ret;
@@ -839,7 +843,7 @@ generate:
839 assert(solve_state(tosolve) > 0); 843 assert(solve_state(tosolve) > 0);
840 free_game(tosolve); 844 free_game(tosolve);
841 } 845 }
842 ret = generate_desc(state, 0); 846 ret = generate_desc(state, false);
843 free_game(state); 847 free_game(state);
844 return ret; 848 return ret;
845} 849}
@@ -909,7 +913,7 @@ static void head_number(game_state *state, int i, struct head_meta *head)
909 head->why = "contains cell with immutable number"; 913 head->why = "contains cell with immutable number";
910 } else if (head->start != ss) { 914 } else if (head->start != ss) {
911 debug(("head_number: chain with non-sequential numbers!")); 915 debug(("head_number: chain with non-sequential numbers!"));
912 state->impossible = 1; 916 state->impossible = true;
913 } 917 }
914 } 918 }
915 off++; 919 off++;
@@ -1015,7 +1019,7 @@ static void connect_numbers(game_state *state)
1015 dni = dsf_canonify(state->dsf, state->next[i]); 1019 dni = dsf_canonify(state->dsf, state->next[i]);
1016 if (di == dni) { 1020 if (di == dni) {
1017 debug(("connect_numbers: chain forms a loop.")); 1021 debug(("connect_numbers: chain forms a loop."));
1018 state->impossible = 1; 1022 state->impossible = true;
1019 } 1023 }
1020 dsf_merge(state->dsf, di, dni); 1024 dsf_merge(state->dsf, di, dni);
1021 } 1025 }
@@ -1142,9 +1146,10 @@ static void update_numbers(game_state *state)
1142 sfree(heads); 1146 sfree(heads);
1143} 1147}
1144 1148
1145static int check_completion(game_state *state, int mark_errors) 1149static bool check_completion(game_state *state, bool mark_errors)
1146{ 1150{
1147 int n, j, k, error = 0, complete; 1151 int n, j, k;
1152 bool error = false, complete;
1148 1153
1149 /* NB This only marks errors that are possible to perpetrate with 1154 /* NB This only marks errors that are possible to perpetrate with
1150 * the current UI in interpret_move. Things like forming loops in 1155 * the current UI in interpret_move. Things like forming loops in
@@ -1165,7 +1170,7 @@ static int check_completion(game_state *state, int mark_errors)
1165 state->flags[j] |= FLAG_ERROR; 1170 state->flags[j] |= FLAG_ERROR;
1166 state->flags[k] |= FLAG_ERROR; 1171 state->flags[k] |= FLAG_ERROR;
1167 } 1172 }
1168 error = 1; 1173 error = true;
1169 } 1174 }
1170 } 1175 }
1171 } 1176 }
@@ -1173,16 +1178,16 @@ static int check_completion(game_state *state, int mark_errors)
1173 1178
1174 /* Search and mark numbers n not pointing to n+1; if any numbers 1179 /* Search and mark numbers n not pointing to n+1; if any numbers
1175 * are missing we know we've not completed. */ 1180 * are missing we know we've not completed. */
1176 complete = 1; 1181 complete = true;
1177 for (n = 1; n < state->n; n++) { 1182 for (n = 1; n < state->n; n++) {
1178 if (state->numsi[n] == -1 || state->numsi[n+1] == -1) 1183 if (state->numsi[n] == -1 || state->numsi[n+1] == -1)
1179 complete = 0; 1184 complete = false;
1180 else if (!ispointingi(state, state->numsi[n], state->numsi[n+1])) { 1185 else if (!ispointingi(state, state->numsi[n], state->numsi[n+1])) {
1181 if (mark_errors) { 1186 if (mark_errors) {
1182 state->flags[state->numsi[n]] |= FLAG_ERROR; 1187 state->flags[state->numsi[n]] |= FLAG_ERROR;
1183 state->flags[state->numsi[n+1]] |= FLAG_ERROR; 1188 state->flags[state->numsi[n+1]] |= FLAG_ERROR;
1184 } 1189 }
1185 error = 1; 1190 error = true;
1186 } else { 1191 } else {
1187 /* make sure the link is explicitly made here; for instance, this 1192 /* make sure the link is explicitly made here; for instance, this
1188 * is nice if the user drags from 2 out (making 3) and a 4 is also 1193 * is nice if the user drags from 2 out (making 3) and a 4 is also
@@ -1197,13 +1202,13 @@ static int check_completion(game_state *state, int mark_errors)
1197 if ((state->nums[n] < 0) || 1202 if ((state->nums[n] < 0) ||
1198 (state->nums[n] == 0 && 1203 (state->nums[n] == 0 &&
1199 (state->next[n] != -1 || state->prev[n] != -1))) { 1204 (state->next[n] != -1 || state->prev[n] != -1))) {
1200 error = 1; 1205 error = true;
1201 if (mark_errors) 1206 if (mark_errors)
1202 state->flags[n] |= FLAG_ERROR; 1207 state->flags[n] |= FLAG_ERROR;
1203 } 1208 }
1204 } 1209 }
1205 1210
1206 if (error) return 0; 1211 if (error) return false;
1207 return complete; 1212 return complete;
1208} 1213}
1209static game_state *new_game(midend *me, const game_params *params, 1214static game_state *new_game(midend *me, const game_params *params,
@@ -1215,7 +1220,7 @@ static game_state *new_game(midend *me, const game_params *params,
1215 if (!state) assert(!"new_game failed to unpick"); 1220 if (!state) assert(!"new_game failed to unpick");
1216 1221
1217 update_numbers(state); 1222 update_numbers(state);
1218 check_completion(state, 1); /* update any auto-links */ 1223 check_completion(state, true); /* update any auto-links */
1219 1224
1220 return state; 1225 return state;
1221} 1226}
@@ -1247,7 +1252,7 @@ static int solve_single(game_state *state, game_state *copy, int *from)
1247 while (1) { 1252 while (1) {
1248 x += dxs[d]; y += dys[d]; 1253 x += dxs[d]; y += dys[d];
1249 if (!INGRID(state, x, y)) break; 1254 if (!INGRID(state, x, y)) break;
1250 if (!isvalidmove(state, 1, sx, sy, x, y)) continue; 1255 if (!isvalidmove(state, true, sx, sy, x, y)) continue;
1251 1256
1252 /* can't link to somewhere with a back-link we would have to 1257 /* can't link to somewhere with a back-link we would have to
1253 * break (the solver just doesn't work like this). */ 1258 * break (the solver just doesn't work like this). */
@@ -1276,7 +1281,7 @@ static int solve_single(game_state *state, game_state *copy, int *from)
1276 ; 1281 ;
1277 } else if (poss == -1) { 1282 } else if (poss == -1) {
1278 debug(("Solver: nowhere possible for (%d,%d) to link to.", sx, sy)); 1283 debug(("Solver: nowhere possible for (%d,%d) to link to.", sx, sy));
1279 copy->impossible = 1; 1284 copy->impossible = true;
1280 return -1; 1285 return -1;
1281 } else { 1286 } else {
1282 debug(("Solver: linking (%d,%d) to only possible next (%d,%d).", 1287 debug(("Solver: linking (%d,%d) to only possible next (%d,%d).",
@@ -1293,7 +1298,7 @@ static int solve_single(game_state *state, game_state *copy, int *from)
1293 x = i%w; y = i/w; 1298 x = i%w; y = i/w;
1294 if (from[i] == -1) { 1299 if (from[i] == -1) {
1295 debug(("Solver: nowhere possible to link to (%d,%d)", x, y)); 1300 debug(("Solver: nowhere possible to link to (%d,%d)", x, y));
1296 copy->impossible = 1; 1301 copy->impossible = true;
1297 return -1; 1302 return -1;
1298 } else if (from[i] == -2) { 1303 } else if (from[i] == -2) {
1299 /*debug(("Solver: (%d,%d) has multiple possible prev squares.", x, y));*/ 1304 /*debug(("Solver: (%d,%d) has multiple possible prev squares.", x, y));*/
@@ -1330,7 +1335,7 @@ static int solve_state(game_state *state)
1330 sfree(scratch); 1335 sfree(scratch);
1331 1336
1332 update_numbers(state); 1337 update_numbers(state);
1333 ret = state->impossible ? -1 : check_completion(state, 0); 1338 ret = state->impossible ? -1 : check_completion(state, false);
1334 debug(("Solver finished: %s", 1339 debug(("Solver finished: %s",
1335 ret < 0 ? "impossible" : ret > 0 ? "solved" : "not solved")); 1340 ret < 0 ? "impossible" : ret > 0 ? "solved" : "not solved"));
1336 debug_state("After solver: ", state); 1341 debug_state("After solver: ", state);
@@ -1347,7 +1352,7 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1347 tosolve = dup_game(currstate); 1352 tosolve = dup_game(currstate);
1348 result = solve_state(tosolve); 1353 result = solve_state(tosolve);
1349 if (result > 0) 1354 if (result > 0)
1350 ret = generate_desc(tosolve, 1); 1355 ret = generate_desc(tosolve, true);
1351 free_game(tosolve); 1356 free_game(tosolve);
1352 if (ret) return ret; 1357 if (ret) return ret;
1353 1358
@@ -1358,7 +1363,7 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1358 else if (result == 0) 1363 else if (result == 0)
1359 *error = "Unable to solve puzzle."; 1364 *error = "Unable to solve puzzle.";
1360 else 1365 else
1361 ret = generate_desc(tosolve, 1); 1366 ret = generate_desc(tosolve, true);
1362 1367
1363 free_game(tosolve); 1368 free_game(tosolve);
1364 1369
@@ -1369,9 +1374,10 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1369 1374
1370 1375
1371struct game_ui { 1376struct game_ui {
1372 int cx, cy, cshow; 1377 int cx, cy;
1378 bool cshow;
1373 1379
1374 int dragging, drag_is_from; 1380 bool dragging, drag_is_from;
1375 int sx, sy; /* grid coords of start cell */ 1381 int sx, sy; /* grid coords of start cell */
1376 int dx, dy; /* pixel coords of drag posn */ 1382 int dx, dy; /* pixel coords of drag posn */
1377}; 1383};
@@ -1383,9 +1389,10 @@ static game_ui *new_ui(const game_state *state)
1383 /* NB: if this is ever changed to as to require more than a structure 1389 /* NB: if this is ever changed to as to require more than a structure
1384 * copy to clone, there's code that needs fixing in game_redraw too. */ 1390 * copy to clone, there's code that needs fixing in game_redraw too. */
1385 1391
1386 ui->cx = ui->cy = ui->cshow = 0; 1392 ui->cx = ui->cy = 0;
1393 ui->cshow = false;
1387 1394
1388 ui->dragging = 0; 1395 ui->dragging = false;
1389 ui->sx = ui->sy = ui->dx = ui->dy = 0; 1396 ui->sx = ui->sy = ui->dx = ui->dy = 0;
1390 1397
1391 return ui; 1398 return ui;
@@ -1408,18 +1415,22 @@ static void decode_ui(game_ui *ui, const char *encoding)
1408static void game_changed_state(game_ui *ui, const game_state *oldstate, 1415static void game_changed_state(game_ui *ui, const game_state *oldstate,
1409 const game_state *newstate) 1416 const game_state *newstate)
1410{ 1417{
1411 if (!oldstate->completed && newstate->completed) 1418 if (!oldstate->completed && newstate->completed) {
1412 ui->cshow = ui->dragging = 0; 1419 ui->cshow = false;
1420 ui->dragging = false;
1421 }
1413} 1422}
1414 1423
1415struct game_drawstate { 1424struct game_drawstate {
1416 int tilesize, started, solved; 1425 int tilesize;
1426 bool started, solved;
1417 int w, h, n; 1427 int w, h, n;
1418 int *nums, *dirp; 1428 int *nums, *dirp;
1419 unsigned int *f; 1429 unsigned int *f;
1420 double angle_offset; 1430 double angle_offset;
1421 1431
1422 int dragging, dx, dy; 1432 bool dragging;
1433 int dx, dy;
1423 blitter *dragb; 1434 blitter *dragb;
1424}; 1435};
1425 1436
@@ -1431,8 +1442,8 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1431 char buf[80]; 1442 char buf[80];
1432 1443
1433 if (IS_CURSOR_MOVE(button)) { 1444 if (IS_CURSOR_MOVE(button)) {
1434 move_cursor(button, &ui->cx, &ui->cy, state->w, state->h, 0); 1445 move_cursor(button, &ui->cx, &ui->cy, state->w, state->h, false);
1435 ui->cshow = 1; 1446 ui->cshow = true;
1436 if (ui->dragging) { 1447 if (ui->dragging) {
1437 ui->dx = COORD(ui->cx) + TILE_SIZE/2; 1448 ui->dx = COORD(ui->cx) + TILE_SIZE/2;
1438 ui->dy = COORD(ui->cy) + TILE_SIZE/2; 1449 ui->dy = COORD(ui->cy) + TILE_SIZE/2;
@@ -1440,33 +1451,34 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1440 return UI_UPDATE; 1451 return UI_UPDATE;
1441 } else if (IS_CURSOR_SELECT(button)) { 1452 } else if (IS_CURSOR_SELECT(button)) {
1442 if (!ui->cshow) 1453 if (!ui->cshow)
1443 ui->cshow = 1; 1454 ui->cshow = true;
1444 else if (ui->dragging) { 1455 else if (ui->dragging) {
1445 ui->dragging = FALSE; 1456 ui->dragging = false;
1446 if (ui->sx == ui->cx && ui->sy == ui->cy) return UI_UPDATE; 1457 if (ui->sx == ui->cx && ui->sy == ui->cy) return UI_UPDATE;
1447 if (ui->drag_is_from) { 1458 if (ui->drag_is_from) {
1448 if (!isvalidmove(state, 0, ui->sx, ui->sy, ui->cx, ui->cy)) 1459 if (!isvalidmove(state, false, ui->sx, ui->sy, ui->cx, ui->cy))
1449 return UI_UPDATE; 1460 return UI_UPDATE;
1450 sprintf(buf, "L%d,%d-%d,%d", ui->sx, ui->sy, ui->cx, ui->cy); 1461 sprintf(buf, "L%d,%d-%d,%d", ui->sx, ui->sy, ui->cx, ui->cy);
1451 } else { 1462 } else {
1452 if (!isvalidmove(state, 0, ui->cx, ui->cy, ui->sx, ui->sy)) 1463 if (!isvalidmove(state, false, ui->cx, ui->cy, ui->sx, ui->sy))
1453 return UI_UPDATE; 1464 return UI_UPDATE;
1454 sprintf(buf, "L%d,%d-%d,%d", ui->cx, ui->cy, ui->sx, ui->sy); 1465 sprintf(buf, "L%d,%d-%d,%d", ui->cx, ui->cy, ui->sx, ui->sy);
1455 } 1466 }
1456 return dupstr(buf); 1467 return dupstr(buf);
1457 } else { 1468 } else {
1458 ui->dragging = TRUE; 1469 ui->dragging = true;
1459 ui->sx = ui->cx; 1470 ui->sx = ui->cx;
1460 ui->sy = ui->cy; 1471 ui->sy = ui->cy;
1461 ui->dx = COORD(ui->cx) + TILE_SIZE/2; 1472 ui->dx = COORD(ui->cx) + TILE_SIZE/2;
1462 ui->dy = COORD(ui->cy) + TILE_SIZE/2; 1473 ui->dy = COORD(ui->cy) + TILE_SIZE/2;
1463 ui->drag_is_from = (button == CURSOR_SELECT) ? 1 : 0; 1474 ui->drag_is_from = (button == CURSOR_SELECT);
1464 } 1475 }
1465 return UI_UPDATE; 1476 return UI_UPDATE;
1466 } 1477 }
1467 if (IS_MOUSE_DOWN(button)) { 1478 if (IS_MOUSE_DOWN(button)) {
1468 if (ui->cshow) { 1479 if (ui->cshow) {
1469 ui->cshow = ui->dragging = 0; 1480 ui->cshow = false;
1481 ui->dragging = false;
1470 } 1482 }
1471 assert(!ui->dragging); 1483 assert(!ui->dragging);
1472 if (!INGRID(state, x, y)) return NULL; 1484 if (!INGRID(state, x, y)) return NULL;
@@ -1483,20 +1495,20 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1483 return NULL; 1495 return NULL;
1484 } 1496 }
1485 1497
1486 ui->dragging = TRUE; 1498 ui->dragging = true;
1487 ui->drag_is_from = (button == LEFT_BUTTON) ? 1 : 0; 1499 ui->drag_is_from = (button == LEFT_BUTTON);
1488 ui->sx = x; 1500 ui->sx = x;
1489 ui->sy = y; 1501 ui->sy = y;
1490 ui->dx = mx; 1502 ui->dx = mx;
1491 ui->dy = my; 1503 ui->dy = my;
1492 ui->cshow = 0; 1504 ui->cshow = false;
1493 return UI_UPDATE; 1505 return UI_UPDATE;
1494 } else if (IS_MOUSE_DRAG(button) && ui->dragging) { 1506 } else if (IS_MOUSE_DRAG(button) && ui->dragging) {
1495 ui->dx = mx; 1507 ui->dx = mx;
1496 ui->dy = my; 1508 ui->dy = my;
1497 return UI_UPDATE; 1509 return UI_UPDATE;
1498 } else if (IS_MOUSE_RELEASE(button) && ui->dragging) { 1510 } else if (IS_MOUSE_RELEASE(button) && ui->dragging) {
1499 ui->dragging = FALSE; 1511 ui->dragging = false;
1500 if (ui->sx == x && ui->sy == y) return UI_UPDATE; /* single click */ 1512 if (ui->sx == x && ui->sy == y) return UI_UPDATE; /* single click */
1501 1513
1502 if (!INGRID(state, x, y)) { 1514 if (!INGRID(state, x, y)) {
@@ -1509,11 +1521,11 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1509 } 1521 }
1510 1522
1511 if (ui->drag_is_from) { 1523 if (ui->drag_is_from) {
1512 if (!isvalidmove(state, 0, ui->sx, ui->sy, x, y)) 1524 if (!isvalidmove(state, false, ui->sx, ui->sy, x, y))
1513 return UI_UPDATE; 1525 return UI_UPDATE;
1514 sprintf(buf, "L%d,%d-%d,%d", ui->sx, ui->sy, x, y); 1526 sprintf(buf, "L%d,%d-%d,%d", ui->sx, ui->sy, x, y);
1515 } else { 1527 } else {
1516 if (!isvalidmove(state, 0, x, y, ui->sx, ui->sy)) 1528 if (!isvalidmove(state, false, x, y, ui->sx, ui->sy))
1517 return UI_UPDATE; 1529 return UI_UPDATE;
1518 sprintf(buf, "L%d,%d-%d,%d", x, y, ui->sx, ui->sy); 1530 sprintf(buf, "L%d,%d-%d,%d", x, y, ui->sx, ui->sy);
1519 } 1531 }
@@ -1576,9 +1588,9 @@ static game_state *execute_move(const game_state *state, const char *move)
1576 ret->next[i] = tmp->next[i]; 1588 ret->next[i] = tmp->next[i];
1577 } 1589 }
1578 free_game(tmp); 1590 free_game(tmp);
1579 ret->used_solve = 1; 1591 ret->used_solve = true;
1580 } else if (sscanf(move, "L%d,%d-%d,%d", &sx, &sy, &ex, &ey) == 4) { 1592 } else if (sscanf(move, "L%d,%d-%d,%d", &sx, &sy, &ex, &ey) == 4) {
1581 if (!isvalidmove(state, 0, sx, sy, ex, ey)) return NULL; 1593 if (!isvalidmove(state, false, sx, sy, ex, ey)) return NULL;
1582 1594
1583 ret = dup_game(state); 1595 ret = dup_game(state);
1584 1596
@@ -1618,7 +1630,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1618 } 1630 }
1619 if (ret) { 1631 if (ret) {
1620 update_numbers(ret); 1632 update_numbers(ret);
1621 if (check_completion(ret, 1)) ret->completed = 1; 1633 if (check_completion(ret, true)) ret->completed = true;
1622 } 1634 }
1623 1635
1624 return ret; 1636 return ret;
@@ -1724,7 +1736,9 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1724 struct game_drawstate *ds = snew(struct game_drawstate); 1736 struct game_drawstate *ds = snew(struct game_drawstate);
1725 int i; 1737 int i;
1726 1738
1727 ds->tilesize = ds->started = ds->solved = 0; 1739 ds->tilesize = 0;
1740 ds->started = false;
1741 ds->solved = false;
1728 ds->w = state->w; 1742 ds->w = state->w;
1729 ds->h = state->h; 1743 ds->h = state->h;
1730 ds->n = state->n; 1744 ds->n = state->n;
@@ -1740,7 +1754,8 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1740 1754
1741 ds->angle_offset = 0.0F; 1755 ds->angle_offset = 0.0F;
1742 1756
1743 ds->dragging = ds->dx = ds->dy = 0; 1757 ds->dragging = false;
1758 ds->dx = ds->dy = 0;
1744 ds->dragb = NULL; 1759 ds->dragb = NULL;
1745 1760
1746 return ds; 1761 return ds;
@@ -1847,10 +1862,11 @@ static void tile_redraw(drawing *dr, game_drawstate *ds, int tx, int ty,
1847 int cb = TILE_SIZE / 16, textsz; 1862 int cb = TILE_SIZE / 16, textsz;
1848 char buf[20]; 1863 char buf[20];
1849 int arrowcol, sarrowcol, setcol, textcol; 1864 int arrowcol, sarrowcol, setcol, textcol;
1850 int acx, acy, asz, empty = 0; 1865 int acx, acy, asz;
1866 bool empty = false;
1851 1867
1852 if (num == 0 && !(f & F_ARROW_POINT) && !(f & F_ARROW_INPOINT)) { 1868 if (num == 0 && !(f & F_ARROW_POINT) && !(f & F_ARROW_INPOINT)) {
1853 empty = 1; 1869 empty = true;
1854 /* 1870 /*
1855 * We don't display text in empty cells: typically these are 1871 * We don't display text in empty cells: typically these are
1856 * signified by num=0. However, in some cases a cell could 1872 * signified by num=0. However, in some cases a cell could
@@ -1978,7 +1994,7 @@ static void tile_redraw(drawing *dr, game_drawstate *ds, int tx, int ty,
1978 1994
1979static void draw_drag_indicator(drawing *dr, game_drawstate *ds, 1995static void draw_drag_indicator(drawing *dr, game_drawstate *ds,
1980 const game_state *state, const game_ui *ui, 1996 const game_state *state, const game_ui *ui,
1981 int validdrag) 1997 bool validdrag)
1982{ 1998{
1983 int dir, w = ds->w, acol = COL_ARROW; 1999 int dir, w = ds->w, acol = COL_ARROW;
1984 int fx = FROMCOORD(ui->dx), fy = FROMCOORD(ui->dy); 2000 int fx = FROMCOORD(ui->dx), fy = FROMCOORD(ui->dy);
@@ -2027,7 +2043,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2027 int dir, const game_ui *ui, 2043 int dir, const game_ui *ui,
2028 float animtime, float flashtime) 2044 float animtime, float flashtime)
2029{ 2045{
2030 int x, y, i, w = ds->w, dirp, force = 0; 2046 int x, y, i, w = ds->w, dirp;
2047 bool force = false;
2031 unsigned int f; 2048 unsigned int f;
2032 double angle_offset = 0.0; 2049 double angle_offset = 0.0;
2033 game_state *postdrop = NULL; 2050 game_state *postdrop = NULL;
@@ -2036,14 +2053,14 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2036 angle_offset = 2.0 * PI * (flashtime / FLASH_SPIN); 2053 angle_offset = 2.0 * PI * (flashtime / FLASH_SPIN);
2037 if (angle_offset != ds->angle_offset) { 2054 if (angle_offset != ds->angle_offset) {
2038 ds->angle_offset = angle_offset; 2055 ds->angle_offset = angle_offset;
2039 force = 1; 2056 force = true;
2040 } 2057 }
2041 2058
2042 if (ds->dragging) { 2059 if (ds->dragging) {
2043 assert(ds->dragb); 2060 assert(ds->dragb);
2044 blitter_load(dr, ds->dragb, ds->dx, ds->dy); 2061 blitter_load(dr, ds->dragb, ds->dx, ds->dy);
2045 draw_update(dr, ds->dx, ds->dy, BLITTER_SIZE, BLITTER_SIZE); 2062 draw_update(dr, ds->dx, ds->dy, BLITTER_SIZE, BLITTER_SIZE);
2046 ds->dragging = FALSE; 2063 ds->dragging = false;
2047 } 2064 }
2048 2065
2049 /* If an in-progress drag would make a valid move if finished, we 2066 /* If an in-progress drag would make a valid move if finished, we
@@ -2144,15 +2161,15 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2144 } 2161 }
2145 } 2162 }
2146 if (ui->dragging) { 2163 if (ui->dragging) {
2147 ds->dragging = TRUE; 2164 ds->dragging = true;
2148 ds->dx = ui->dx - BLITTER_SIZE/2; 2165 ds->dx = ui->dx - BLITTER_SIZE/2;
2149 ds->dy = ui->dy - BLITTER_SIZE/2; 2166 ds->dy = ui->dy - BLITTER_SIZE/2;
2150 blitter_save(dr, ds->dragb, ds->dx, ds->dy); 2167 blitter_save(dr, ds->dragb, ds->dx, ds->dy);
2151 2168
2152 draw_drag_indicator(dr, ds, state, ui, postdrop ? 1 : 0); 2169 draw_drag_indicator(dr, ds, state, ui, postdrop != NULL);
2153 } 2170 }
2154 if (postdrop) free_game(postdrop); 2171 if (postdrop) free_game(postdrop);
2155 if (!ds->started) ds->started = TRUE; 2172 if (!ds->started) ds->started = true;
2156} 2173}
2157 2174
2158static float game_anim_length(const game_state *oldstate, 2175static float game_anim_length(const game_state *oldstate,
@@ -2176,9 +2193,9 @@ static int game_status(const game_state *state)
2176 return state->completed ? +1 : 0; 2193 return state->completed ? +1 : 0;
2177} 2194}
2178 2195
2179static int game_timing_state(const game_state *state, game_ui *ui) 2196static bool game_timing_state(const game_state *state, game_ui *ui)
2180{ 2197{
2181 return TRUE; 2198 return true;
2182} 2199}
2183 2200
2184static void game_print_size(const game_params *params, float *x, float *y) 2201static void game_print_size(const game_params *params, float *x, float *y)
@@ -2234,15 +2251,15 @@ const struct game thegame = {
2234 encode_params, 2251 encode_params,
2235 free_params, 2252 free_params,
2236 dup_params, 2253 dup_params,
2237 TRUE, game_configure, custom_params, 2254 true, game_configure, custom_params,
2238 validate_params, 2255 validate_params,
2239 new_game_desc, 2256 new_game_desc,
2240 validate_desc, 2257 validate_desc,
2241 new_game, 2258 new_game,
2242 dup_game, 2259 dup_game,
2243 free_game, 2260 free_game,
2244 TRUE, solve_game, 2261 true, solve_game,
2245 TRUE, game_can_format_as_text_now, game_text_format, 2262 true, game_can_format_as_text_now, game_text_format,
2246 new_ui, 2263 new_ui,
2247 free_ui, 2264 free_ui,
2248 encode_ui, 2265 encode_ui,
@@ -2259,9 +2276,9 @@ const struct game thegame = {
2259 game_anim_length, 2276 game_anim_length,
2260 game_flash_length, 2277 game_flash_length,
2261 game_status, 2278 game_status,
2262 TRUE, FALSE, game_print_size, game_print, 2279 true, false, game_print_size, game_print,
2263 FALSE, /* wants_statusbar */ 2280 false, /* wants_statusbar */
2264 FALSE, game_timing_state, 2281 false, game_timing_state,
2265 REQUIRE_RBUTTON, /* flags */ 2282 REQUIRE_RBUTTON, /* flags */
2266}; 2283};
2267 2284
@@ -2378,7 +2395,8 @@ int main(int argc, const char *argv[])
2378{ 2395{
2379 char *id = NULL, *desc, *aux = NULL; 2396 char *id = NULL, *desc, *aux = NULL;
2380 const char *err; 2397 const char *err;
2381 int soak = 0, verbose = 0, stdin_desc = 0, n = 1, i; 2398 bool soak = false, verbose = false, stdin_desc = false;
2399 int n = 1, i;
2382 char *seedstr = NULL, newseed[16]; 2400 char *seedstr = NULL, newseed[16];
2383 2401
2384 setvbuf(stdout, NULL, _IONBF, 0); 2402 setvbuf(stdout, NULL, _IONBF, 0);
@@ -2387,9 +2405,9 @@ int main(int argc, const char *argv[])
2387 while (--argc > 0) { 2405 while (--argc > 0) {
2388 char *p = (char*)(*++argv); 2406 char *p = (char*)(*++argv);
2389 if (!strcmp(p, "-v") || !strcmp(p, "--verbose")) 2407 if (!strcmp(p, "-v") || !strcmp(p, "--verbose"))
2390 verbose = 1; 2408 verbose = true;
2391 else if (!strcmp(p, "--stdin")) 2409 else if (!strcmp(p, "--stdin"))
2392 stdin_desc = 1; 2410 stdin_desc = true;
2393 else if (!strcmp(p, "-e") || !strcmp(p, "--seed")) { 2411 else if (!strcmp(p, "-e") || !strcmp(p, "--seed")) {
2394 seedstr = dupstr(*++argv); 2412 seedstr = dupstr(*++argv);
2395 argc--; 2413 argc--;
@@ -2397,7 +2415,7 @@ int main(int argc, const char *argv[])
2397 n = atoi(*++argv); 2415 n = atoi(*++argv);
2398 argc--; 2416 argc--;
2399 } else if (!strcmp(p, "-s") || !strcmp(p, "--soak")) { 2417 } else if (!strcmp(p, "-s") || !strcmp(p, "--soak")) {
2400 soak = 1; 2418 soak = true;
2401 } else if (*p == '-') { 2419 } else if (*p == '-') {
2402 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p); 2420 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p);
2403 usage(stderr); 2421 usage(stderr);
diff --git a/apps/plugins/puzzles/src/singles.c b/apps/plugins/puzzles/src/singles.c
index 35c5fcee59..3dde8c2b87 100644
--- a/apps/plugins/puzzles/src/singles.c
+++ b/apps/plugins/puzzles/src/singles.c
@@ -64,7 +64,7 @@
64#include "latin.h" 64#include "latin.h"
65 65
66#ifdef STANDALONE_SOLVER 66#ifdef STANDALONE_SOLVER
67int verbose = 0; 67bool verbose = false;
68#endif 68#endif
69 69
70#define PREFERRED_TILE_SIZE 32 70#define PREFERRED_TILE_SIZE 32
@@ -99,7 +99,7 @@ struct game_params {
99 99
100struct game_state { 100struct game_state {
101 int w, h, n, o; /* n = w*h; o = max(w, h) */ 101 int w, h, n, o; /* n = w*h; o = max(w, h) */
102 int completed, used_solve, impossible; 102 bool completed, used_solve, impossible;
103 int *nums; /* size w*h */ 103 int *nums; /* size w*h */
104 unsigned int *flags; /* size w*h */ 104 unsigned int *flags; /* size w*h */
105}; 105};
@@ -147,13 +147,13 @@ static const struct game_params singles_presets[] = {
147 { 12, 12, DIFF_TRICKY } 147 { 12, 12, DIFF_TRICKY }
148}; 148};
149 149
150static int game_fetch_preset(int i, char **name, game_params **params) 150static bool game_fetch_preset(int i, char **name, game_params **params)
151{ 151{
152 game_params *ret; 152 game_params *ret;
153 char buf[80]; 153 char buf[80];
154 154
155 if (i < 0 || i >= lenof(singles_presets)) 155 if (i < 0 || i >= lenof(singles_presets))
156 return FALSE; 156 return false;
157 157
158 ret = default_params(); 158 ret = default_params();
159 *ret = singles_presets[i]; 159 *ret = singles_presets[i];
@@ -162,7 +162,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
162 sprintf(buf, "%dx%d %s", ret->w, ret->h, singles_diffnames[ret->diff]); 162 sprintf(buf, "%dx%d %s", ret->w, ret->h, singles_diffnames[ret->diff]);
163 *name = dupstr(buf); 163 *name = dupstr(buf);
164 164
165 return TRUE; 165 return true;
166} 166}
167 167
168static void free_params(game_params *params) 168static void free_params(game_params *params)
@@ -200,7 +200,7 @@ static void decode_params(game_params *ret, char const *string)
200 } 200 }
201} 201}
202 202
203static char *encode_params(const game_params *params, int full) 203static char *encode_params(const game_params *params, bool full)
204{ 204{
205 char data[256]; 205 char data[256];
206 206
@@ -251,7 +251,7 @@ static game_params *custom_params(const config_item *cfg)
251 return ret; 251 return ret;
252} 252}
253 253
254static const char *validate_params(const game_params *params, int full) 254static const char *validate_params(const game_params *params, bool full)
255{ 255{
256 if (params->w < 2 || params->h < 2) 256 if (params->w < 2 || params->h < 2)
257 return "Width and neight must be at least two"; 257 return "Width and neight must be at least two";
@@ -277,7 +277,9 @@ static game_state *blank_game(int w, int h)
277 state->n = w*h; 277 state->n = w*h;
278 state->o = max(w,h); 278 state->o = max(w,h);
279 279
280 state->completed = state->used_solve = state->impossible = 0; 280 state->completed = false;
281 state->used_solve = false;
282 state->impossible = false;
281 283
282 state->nums = snewn(state->n, int); 284 state->nums = snewn(state->n, int);
283 state->flags = snewn(state->n, unsigned int); 285 state->flags = snewn(state->n, unsigned int);
@@ -359,7 +361,7 @@ done:
359 } 361 }
360} 362}
361 363
362static char *generate_desc(game_state *state, int issolve) 364static char *generate_desc(game_state *state, bool issolve)
363{ 365{
364 char *ret = snewn(state->n+1+(issolve?1:0), char); 366 char *ret = snewn(state->n+1+(issolve?1:0), char);
365 int i, p=0; 367 int i, p=0;
@@ -374,9 +376,9 @@ static char *generate_desc(game_state *state, int issolve)
374 376
375/* --- Useful game functions (completion, etc.) --- */ 377/* --- Useful game functions (completion, etc.) --- */
376 378
377static int game_can_format_as_text_now(const game_params *params) 379static bool game_can_format_as_text_now(const game_params *params)
378{ 380{
379 return TRUE; 381 return true;
380} 382}
381 383
382static char *game_text_format(const game_state *state) 384static char *game_text_format(const game_state *state)
@@ -490,7 +492,7 @@ static int check_rowcol(game_state *state, int starti, int di, int sz, unsigned
490 return nerr; 492 return nerr;
491} 493}
492 494
493static int check_complete(game_state *state, unsigned flags) 495static bool check_complete(game_state *state, unsigned flags)
494{ 496{
495 int *dsf = snewn(state->n, int); 497 int *dsf = snewn(state->n, int);
496 int x, y, i, error = 0, nwhite, w = state->w, h = state->h; 498 int x, y, i, error = 0, nwhite, w = state->w, h = state->h;
@@ -557,11 +559,11 @@ static int check_complete(game_state *state, unsigned flags)
557 } 559 }
558 560
559 sfree(dsf); 561 sfree(dsf);
560 return (error > 0) ? 0 : 1; 562 return !(error > 0);
561} 563}
562 564
563static char *game_state_diff(const game_state *src, const game_state *dst, 565static char *game_state_diff(const game_state *src, const game_state *dst,
564 int issolve) 566 bool issolve)
565{ 567{
566 char *ret = NULL, buf[80], c; 568 char *ret = NULL, buf[80], c;
567 int retlen = 0, x, y, i, k; 569 int retlen = 0, x, y, i, k;
@@ -651,7 +653,7 @@ static void solver_op_circle(game_state *state, struct solver_state *ss,
651 if (!INGRID(state, x, y)) return; 653 if (!INGRID(state, x, y)) return;
652 if (state->flags[i] & F_BLACK) { 654 if (state->flags[i] & F_BLACK) {
653 debug(("... solver wants to add auto-circle on black (%d,%d)\n", x, y)); 655 debug(("... solver wants to add auto-circle on black (%d,%d)\n", x, y));
654 state->impossible = 1; 656 state->impossible = true;
655 return; 657 return;
656 } 658 }
657 /* Only add circle op if it's not already circled. */ 659 /* Only add circle op if it's not already circled. */
@@ -669,7 +671,7 @@ static void solver_op_blacken(game_state *state, struct solver_state *ss,
669 if (state->nums[i] != num) return; 671 if (state->nums[i] != num) return;
670 if (state->flags[i] & F_CIRCLE) { 672 if (state->flags[i] & F_CIRCLE) {
671 debug(("... solver wants to add auto-black on circled(%d,%d)\n", x, y)); 673 debug(("... solver wants to add auto-black on circled(%d,%d)\n", x, y));
672 state->impossible = 1; 674 state->impossible = true;
673 return; 675 return;
674 } 676 }
675 /* Only add black op if it's not already black. */ 677 /* Only add black op if it's not already black. */
@@ -693,7 +695,7 @@ static int solver_ops_do(game_state *state, struct solver_state *ss)
693 if (op.op == BLACK) { 695 if (op.op == BLACK) {
694 if (state->flags[i] & F_CIRCLE) { 696 if (state->flags[i] & F_CIRCLE) {
695 debug(("Solver wants to blacken circled square (%d,%d)!\n", op.x, op.y)); 697 debug(("Solver wants to blacken circled square (%d,%d)!\n", op.x, op.y));
696 state->impossible = 1; 698 state->impossible = true;
697 return n_ops; 699 return n_ops;
698 } 700 }
699 if (!(state->flags[i] & F_BLACK)) { 701 if (!(state->flags[i] & F_BLACK)) {
@@ -713,7 +715,7 @@ static int solver_ops_do(game_state *state, struct solver_state *ss)
713 } else { 715 } else {
714 if (state->flags[i] & F_BLACK) { 716 if (state->flags[i] & F_BLACK) {
715 debug(("Solver wants to circle blackened square (%d,%d)!\n", op.x, op.y)); 717 debug(("Solver wants to circle blackened square (%d,%d)!\n", op.x, op.y));
716 state->impossible = 1; 718 state->impossible = true;
717 return n_ops; 719 return n_ops;
718 } 720 }
719 if (!(state->flags[i] & F_CIRCLE)) { 721 if (!(state->flags[i] & F_CIRCLE)) {
@@ -845,7 +847,7 @@ static int solve_allblackbutone(game_state *state, struct solver_state *ss)
845 "CC/CE/QM: white cell with single non-black around it"); 847 "CC/CE/QM: white cell with single non-black around it");
846 else { 848 else {
847 debug(("White cell with no escape at (%d,%d)\n", x, y)); 849 debug(("White cell with no escape at (%d,%d)\n", x, y));
848 state->impossible = 1; 850 state->impossible = true;
849 return 0; 851 return 0;
850 } 852 }
851skip: ; 853skip: ;
@@ -994,7 +996,8 @@ static int solve_offsetpair(game_state *state, struct solver_state *ss)
994 return ss->n_ops - n_ops; 996 return ss->n_ops - n_ops;
995} 997}
996 998
997static int solve_hassinglewhiteregion(game_state *state, struct solver_state *ss) 999static bool solve_hassinglewhiteregion(
1000 game_state *state, struct solver_state *ss)
998{ 1001{
999 int i, j, nwhite = 0, lwhite = -1, szwhite, start, end, next, a, d, x, y; 1002 int i, j, nwhite = 0, lwhite = -1, szwhite, start, end, next, a, d, x, y;
1000 1003
@@ -1007,8 +1010,8 @@ static int solve_hassinglewhiteregion(game_state *state, struct solver_state *ss
1007 } 1010 }
1008 if (lwhite == -1) { 1011 if (lwhite == -1) {
1009 debug(("solve_hassinglewhite: no white squares found!\n")); 1012 debug(("solve_hassinglewhite: no white squares found!\n"));
1010 state->impossible = 1; 1013 state->impossible = true;
1011 return 0; 1014 return false;
1012 } 1015 }
1013 /* We don't use connect_dsf here; it's too slow, and there's a quicker 1016 /* We don't use connect_dsf here; it's too slow, and there's a quicker
1014 * algorithm if all we want is the size of one region. */ 1017 * algorithm if all we want is the size of one region. */
@@ -1034,13 +1037,14 @@ static int solve_hassinglewhiteregion(game_state *state, struct solver_state *ss
1034 start = end; end = next; 1037 start = end; end = next;
1035 } 1038 }
1036 szwhite = next; 1039 szwhite = next;
1037 return (szwhite == nwhite) ? 1 : 0; 1040 return (szwhite == nwhite);
1038} 1041}
1039 1042
1040static void solve_removesplits_check(game_state *state, struct solver_state *ss, 1043static void solve_removesplits_check(game_state *state, struct solver_state *ss,
1041 int x, int y) 1044 int x, int y)
1042{ 1045{
1043 int i = y*state->w + x, issingle; 1046 int i = y*state->w + x;
1047 bool issingle;
1044 1048
1045 if (!INGRID(state, x, y)) return; 1049 if (!INGRID(state, x, y)) return;
1046 if ((state->flags[i] & F_CIRCLE) || (state->flags[i] & F_BLACK)) 1050 if ((state->flags[i] & F_CIRCLE) || (state->flags[i] & F_BLACK))
@@ -1066,7 +1070,7 @@ static int solve_removesplits(game_state *state, struct solver_state *ss)
1066 1070
1067 if (!solve_hassinglewhiteregion(state, ss)) { 1071 if (!solve_hassinglewhiteregion(state, ss)) {
1068 debug(("solve_removesplits: white region is not contiguous at start!\n")); 1072 debug(("solve_removesplits: white region is not contiguous at start!\n"));
1069 state->impossible = 1; 1073 state->impossible = true;
1070 return 0; 1074 return 0;
1071 } 1075 }
1072 1076
@@ -1144,7 +1148,7 @@ static int solve_sneaky(game_state *state, struct solver_state *ss)
1144 return nunique; 1148 return nunique;
1145} 1149}
1146 1150
1147static int solve_specific(game_state *state, int diff, int sneaky) 1151static int solve_specific(game_state *state, int diff, bool sneaky)
1148{ 1152{
1149 struct solver_state *ss = solver_state_new(state); 1153 struct solver_state *ss = solver_state_new(state);
1150 1154
@@ -1186,18 +1190,18 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1186 game_state *solved = dup_game(currstate); 1190 game_state *solved = dup_game(currstate);
1187 char *move = NULL; 1191 char *move = NULL;
1188 1192
1189 if (solve_specific(solved, DIFF_ANY, 0) > 0) goto solved; 1193 if (solve_specific(solved, DIFF_ANY, false) > 0) goto solved;
1190 free_game(solved); 1194 free_game(solved);
1191 1195
1192 solved = dup_game(state); 1196 solved = dup_game(state);
1193 if (solve_specific(solved, DIFF_ANY, 0) > 0) goto solved; 1197 if (solve_specific(solved, DIFF_ANY, false) > 0) goto solved;
1194 free_game(solved); 1198 free_game(solved);
1195 1199
1196 *error = "Unable to solve puzzle."; 1200 *error = "Unable to solve puzzle.";
1197 return NULL; 1201 return NULL;
1198 1202
1199solved: 1203solved:
1200 move = game_state_diff(currstate, solved, 1); 1204 move = game_state_diff(currstate, solved, true);
1201 free_game(solved); 1205 free_game(solved);
1202 return move; 1206 return move;
1203} 1207}
@@ -1216,14 +1220,15 @@ solved:
1216 the solver gets a headstart working out where they are. 1220 the solver gets a headstart working out where they are.
1217 */ 1221 */
1218 1222
1219static int new_game_is_good(const game_params *params, 1223static bool new_game_is_good(const game_params *params,
1220 game_state *state, game_state *tosolve) 1224 game_state *state, game_state *tosolve)
1221{ 1225{
1222 int sret, sret_easy = 0; 1226 int sret, sret_easy = 0;
1223 1227
1224 memcpy(tosolve->nums, state->nums, state->n * sizeof(int)); 1228 memcpy(tosolve->nums, state->nums, state->n * sizeof(int));
1225 memset(tosolve->flags, 0, state->n * sizeof(unsigned int)); 1229 memset(tosolve->flags, 0, state->n * sizeof(unsigned int));
1226 tosolve->completed = tosolve->impossible = 0; 1230 tosolve->completed = false;
1231 tosolve->impossible = false;
1227 1232
1228 /* 1233 /*
1229 * We try and solve it twice, once at our requested difficulty level 1234 * We try and solve it twice, once at our requested difficulty level
@@ -1241,22 +1246,23 @@ static int new_game_is_good(const game_params *params,
1241 */ 1246 */
1242 1247
1243 assert(params->diff < DIFF_MAX); 1248 assert(params->diff < DIFF_MAX);
1244 sret = solve_specific(tosolve, params->diff, 0); 1249 sret = solve_specific(tosolve, params->diff, false);
1245 if (params->diff > DIFF_EASY) { 1250 if (params->diff > DIFF_EASY) {
1246 memset(tosolve->flags, 0, state->n * sizeof(unsigned int)); 1251 memset(tosolve->flags, 0, state->n * sizeof(unsigned int));
1247 tosolve->completed = tosolve->impossible = 0; 1252 tosolve->completed = false;
1253 tosolve->impossible = false;
1248 1254
1249 /* this is the only time the 'sneaky' flag is set to 1. */ 1255 /* this is the only time the 'sneaky' flag is set. */
1250 sret_easy = solve_specific(tosolve, params->diff-1, 1); 1256 sret_easy = solve_specific(tosolve, params->diff-1, true);
1251 } 1257 }
1252 1258
1253 if (sret <= 0 || sret_easy > 0) { 1259 if (sret <= 0 || sret_easy > 0) {
1254 debug(("Generated puzzle %s at chosen difficulty %s\n", 1260 debug(("Generated puzzle %s at chosen difficulty %s\n",
1255 sret <= 0 ? "insoluble" : "too easy", 1261 sret <= 0 ? "insoluble" : "too easy",
1256 singles_diffnames[params->diff])); 1262 singles_diffnames[params->diff]));
1257 return 0; 1263 return false;
1258 } 1264 }
1259 return 1; 1265 return true;
1260} 1266}
1261 1267
1262#define MAXTRIES 20 1268#define MAXTRIES 20
@@ -1299,7 +1305,7 @@ found:
1299} 1305}
1300 1306
1301static char *new_game_desc(const game_params *params, random_state *rs, 1307static char *new_game_desc(const game_params *params, random_state *rs,
1302 char **aux, int interactive) 1308 char **aux, bool interactive)
1303{ 1309{
1304 game_state *state = blank_game(params->w, params->h); 1310 game_state *state = blank_game(params->w, params->h);
1305 game_state *tosolve = blank_game(params->w, params->h); 1311 game_state *tosolve = blank_game(params->w, params->h);
@@ -1398,7 +1404,7 @@ randomise:
1398 goto randomise; 1404 goto randomise;
1399 } 1405 }
1400 1406
1401 ret = generate_desc(state, 0); 1407 ret = generate_desc(state, false);
1402 1408
1403 free_game(tosolve); 1409 free_game(tosolve);
1404 free_game(state); 1410 free_game(state);
@@ -1431,16 +1437,17 @@ static game_state *new_game(midend *me, const game_params *params,
1431/* --- Game UI and move routines --- */ 1437/* --- Game UI and move routines --- */
1432 1438
1433struct game_ui { 1439struct game_ui {
1434 int cx, cy, cshow; 1440 int cx, cy;
1435 int show_black_nums; 1441 bool cshow, show_black_nums;
1436}; 1442};
1437 1443
1438static game_ui *new_ui(const game_state *state) 1444static game_ui *new_ui(const game_state *state)
1439{ 1445{
1440 game_ui *ui = snew(game_ui); 1446 game_ui *ui = snew(game_ui);
1441 1447
1442 ui->cx = ui->cy = ui->cshow = 0; 1448 ui->cx = ui->cy = 0;
1443 ui->show_black_nums = 0; 1449 ui->cshow = false;
1450 ui->show_black_nums = false;
1444 1451
1445 return ui; 1452 return ui;
1446} 1453}
@@ -1463,7 +1470,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1463 const game_state *newstate) 1470 const game_state *newstate)
1464{ 1471{
1465 if (!oldstate->completed && newstate->completed) 1472 if (!oldstate->completed && newstate->completed)
1466 ui->cshow = 0; 1473 ui->cshow = false;
1467} 1474}
1468 1475
1469#define DS_BLACK 0x1 1476#define DS_BLACK 0x1
@@ -1475,7 +1482,8 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1475#define DS_IMPOSSIBLE 0x40 1482#define DS_IMPOSSIBLE 0x40
1476 1483
1477struct game_drawstate { 1484struct game_drawstate {
1478 int tilesize, started, solved; 1485 int tilesize;
1486 bool started, solved;
1479 int w, h, n; 1487 int w, h, n;
1480 1488
1481 unsigned int *flags; 1489 unsigned int *flags;
@@ -1490,14 +1498,14 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1490 enum { NONE, TOGGLE_BLACK, TOGGLE_CIRCLE, UI } action = NONE; 1498 enum { NONE, TOGGLE_BLACK, TOGGLE_CIRCLE, UI } action = NONE;
1491 1499
1492 if (IS_CURSOR_MOVE(button)) { 1500 if (IS_CURSOR_MOVE(button)) {
1493 move_cursor(button, &ui->cx, &ui->cy, state->w, state->h, 1); 1501 move_cursor(button, &ui->cx, &ui->cy, state->w, state->h, true);
1494 ui->cshow = 1; 1502 ui->cshow = true;
1495 action = UI; 1503 action = UI;
1496 } else if (IS_CURSOR_SELECT(button)) { 1504 } else if (IS_CURSOR_SELECT(button)) {
1497 x = ui->cx; y = ui->cy; 1505 x = ui->cx; y = ui->cy;
1498 if (!ui->cshow) { 1506 if (!ui->cshow) {
1499 action = UI; 1507 action = UI;
1500 ui->cshow = 1; 1508 ui->cshow = true;
1501 } 1509 }
1502 if (button == CURSOR_SELECT) { 1510 if (button == CURSOR_SELECT) {
1503 action = TOGGLE_BLACK; 1511 action = TOGGLE_BLACK;
@@ -1506,11 +1514,11 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1506 } 1514 }
1507 } else if (IS_MOUSE_DOWN(button)) { 1515 } else if (IS_MOUSE_DOWN(button)) {
1508 if (ui->cshow) { 1516 if (ui->cshow) {
1509 ui->cshow = 0; 1517 ui->cshow = false;
1510 action = UI; 1518 action = UI;
1511 } 1519 }
1512 if (!INGRID(state, x, y)) { 1520 if (!INGRID(state, x, y)) {
1513 ui->show_black_nums = 1 - ui->show_black_nums; 1521 ui->show_black_nums = !ui->show_black_nums;
1514 action = UI; /* this wants to be a per-game option. */ 1522 action = UI; /* this wants to be a per-game option. */
1515 } else if (button == LEFT_BUTTON) { 1523 } else if (button == LEFT_BUTTON) {
1516 action = TOGGLE_BLACK; 1524 action = TOGGLE_BLACK;
@@ -1557,7 +1565,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1557 move += n; 1565 move += n;
1558 } else if (c == 'S') { 1566 } else if (c == 'S') {
1559 move++; 1567 move++;
1560 ret->used_solve = 1; 1568 ret->used_solve = true;
1561 } else 1569 } else
1562 goto badmove; 1570 goto badmove;
1563 1571
@@ -1566,7 +1574,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1566 else if (*move) 1574 else if (*move)
1567 goto badmove; 1575 goto badmove;
1568 } 1576 }
1569 if (check_complete(ret, CC_MARK_ERRORS)) ret->completed = 1; 1577 if (check_complete(ret, CC_MARK_ERRORS)) ret->completed = true;
1570 return ret; 1578 return ret;
1571 1579
1572badmove: 1580badmove:
@@ -1623,7 +1631,9 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1623{ 1631{
1624 struct game_drawstate *ds = snew(struct game_drawstate); 1632 struct game_drawstate *ds = snew(struct game_drawstate);
1625 1633
1626 ds->tilesize = ds->started = ds->solved = 0; 1634 ds->tilesize = 0;
1635 ds->started = false;
1636 ds->solved = false;
1627 ds->w = state->w; 1637 ds->w = state->w;
1628 ds->h = state->h; 1638 ds->h = state->h;
1629 ds->n = state->n; 1639 ds->n = state->n;
@@ -1644,17 +1654,18 @@ static void game_free_drawstate(drawing *dr, game_drawstate *ds)
1644static void tile_redraw(drawing *dr, game_drawstate *ds, int x, int y, 1654static void tile_redraw(drawing *dr, game_drawstate *ds, int x, int y,
1645 int num, unsigned int f) 1655 int num, unsigned int f)
1646{ 1656{
1647 int tcol, bg, dnum, cx, cy, tsz; 1657 int tcol, bg, cx, cy, tsz;
1658 bool dnum;
1648 char buf[32]; 1659 char buf[32];
1649 1660
1650 if (f & DS_BLACK) { 1661 if (f & DS_BLACK) {
1651 bg = (f & DS_ERROR) ? COL_ERROR : COL_BLACK; 1662 bg = (f & DS_ERROR) ? COL_ERROR : COL_BLACK;
1652 tcol = COL_BLACKNUM; 1663 tcol = COL_BLACKNUM;
1653 dnum = (f & DS_BLACK_NUM) ? 1 : 0; 1664 dnum = (f & DS_BLACK_NUM);
1654 } else { 1665 } else {
1655 bg = (f & DS_FLASH) ? COL_LOWLIGHT : COL_BACKGROUND; 1666 bg = (f & DS_FLASH) ? COL_LOWLIGHT : COL_BACKGROUND;
1656 tcol = (f & DS_ERROR) ? COL_ERROR : COL_BLACK; 1667 tcol = (f & DS_ERROR) ? COL_ERROR : COL_BLACK;
1657 dnum = 1; 1668 dnum = true;
1658 } 1669 }
1659 1670
1660 cx = x + TILE_SIZE/2; cy = y + TILE_SIZE/2; 1671 cx = x + TILE_SIZE/2; cy = y + TILE_SIZE/2;
@@ -1729,7 +1740,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1729 } 1740 }
1730 } 1741 }
1731 } 1742 }
1732 ds->started = 1; 1743 ds->started = true;
1733} 1744}
1734 1745
1735static float game_anim_length(const game_state *oldstate, 1746static float game_anim_length(const game_state *oldstate,
@@ -1752,9 +1763,9 @@ static int game_status(const game_state *state)
1752 return state->completed ? +1 : 0; 1763 return state->completed ? +1 : 0;
1753} 1764}
1754 1765
1755static int game_timing_state(const game_state *state, game_ui *ui) 1766static bool game_timing_state(const game_state *state, game_ui *ui)
1756{ 1767{
1757 return TRUE; 1768 return true;
1758} 1769}
1759 1770
1760static void game_print_size(const game_params *params, float *x, float *y) 1771static void game_print_size(const game_params *params, float *x, float *y)
@@ -1815,15 +1826,15 @@ const struct game thegame = {
1815 encode_params, 1826 encode_params,
1816 free_params, 1827 free_params,
1817 dup_params, 1828 dup_params,
1818 TRUE, game_configure, custom_params, 1829 true, game_configure, custom_params,
1819 validate_params, 1830 validate_params,
1820 new_game_desc, 1831 new_game_desc,
1821 validate_desc, 1832 validate_desc,
1822 new_game, 1833 new_game,
1823 dup_game, 1834 dup_game,
1824 free_game, 1835 free_game,
1825 TRUE, solve_game, 1836 true, solve_game,
1826 TRUE, game_can_format_as_text_now, game_text_format, 1837 true, game_can_format_as_text_now, game_text_format,
1827 new_ui, 1838 new_ui,
1828 free_ui, 1839 free_ui,
1829 encode_ui, 1840 encode_ui,
@@ -1840,9 +1851,9 @@ const struct game thegame = {
1840 game_anim_length, 1851 game_anim_length,
1841 game_flash_length, 1852 game_flash_length,
1842 game_status, 1853 game_status,
1843 TRUE, FALSE, game_print_size, game_print, 1854 true, false, game_print_size, game_print,
1844 FALSE, /* wants_statusbar */ 1855 false, /* wants_statusbar */
1845 FALSE, game_timing_state, 1856 false, game_timing_state,
1846 REQUIRE_RBUTTON, /* flags */ 1857 REQUIRE_RBUTTON, /* flags */
1847}; 1858};
1848 1859
@@ -1867,14 +1878,15 @@ static void start_soak(game_params *p, random_state *rs)
1867 1878
1868 while (1) { 1879 while (1) {
1869 n++; 1880 n++;
1870 desc = new_game_desc(p, rs, &aux, 0); 1881 desc = new_game_desc(p, rs, &aux, false);
1871 s = new_game(NULL, p, desc); 1882 s = new_game(NULL, p, desc);
1872 nsneaky += solve_sneaky(s, NULL); 1883 nsneaky += solve_sneaky(s, NULL);
1873 1884
1874 for (diff = 0; diff < DIFF_MAX; diff++) { 1885 for (diff = 0; diff < DIFF_MAX; diff++) {
1875 memset(s->flags, 0, s->n * sizeof(unsigned int)); 1886 memset(s->flags, 0, s->n * sizeof(unsigned int));
1876 s->completed = s->impossible = 0; 1887 s->completed = false;
1877 sret = solve_specific(s, diff, 0); 1888 s->impossible = false;
1889 sret = solve_specific(s, diff, false);
1878 if (sret > 0) { 1890 if (sret > 0) {
1879 ndiff[diff]++; 1891 ndiff[diff]++;
1880 break; 1892 break;
@@ -1911,7 +1923,8 @@ int main(int argc, char **argv)
1911 const char *err; 1923 const char *err;
1912 game_state *s = NULL; 1924 game_state *s = NULL;
1913 game_params *p = NULL; 1925 game_params *p = NULL;
1914 int soln, soak = 0, ret = 1; 1926 int soln, ret = 1;
1927 bool soak = false;
1915 time_t seed = time(NULL); 1928 time_t seed = time(NULL);
1916 random_state *rs = NULL; 1929 random_state *rs = NULL;
1917 1930
@@ -1920,9 +1933,9 @@ int main(int argc, char **argv)
1920 while (--argc > 0) { 1933 while (--argc > 0) {
1921 char *p = *++argv; 1934 char *p = *++argv;
1922 if (!strcmp(p, "-v")) { 1935 if (!strcmp(p, "-v")) {
1923 verbose = 1; 1936 verbose = true;
1924 } else if (!strcmp(p, "--soak")) { 1937 } else if (!strcmp(p, "--soak")) {
1925 soak = 1; 1938 soak = true;
1926 } else if (!strcmp(p, "--seed")) { 1939 } else if (!strcmp(p, "--seed")) {
1927 if (argc == 0) { 1940 if (argc == 0) {
1928 fprintf(stderr, "%s: --seed needs an argument", argv[0]); 1941 fprintf(stderr, "%s: --seed needs an argument", argv[0]);
@@ -1949,7 +1962,7 @@ int main(int argc, char **argv)
1949 1962
1950 p = default_params(); 1963 p = default_params();
1951 decode_params(p, id); 1964 decode_params(p, id);
1952 err = validate_params(p, 1); 1965 err = validate_params(p, true);
1953 if (err) { 1966 if (err) {
1954 fprintf(stderr, "%s: %s", argv[0], err); 1967 fprintf(stderr, "%s: %s", argv[0], err);
1955 goto done; 1968 goto done;
@@ -1962,7 +1975,7 @@ int main(int argc, char **argv)
1962 } 1975 }
1963 start_soak(p, rs); 1976 start_soak(p, rs);
1964 } else { 1977 } else {
1965 if (!desc) desc = desc_gen = new_game_desc(p, rs, &aux, 0); 1978 if (!desc) desc = desc_gen = new_game_desc(p, rs, &aux, false);
1966 1979
1967 err = validate_desc(p, desc); 1980 err = validate_desc(p, desc);
1968 if (err) { 1981 if (err) {
@@ -1978,7 +1991,7 @@ int main(int argc, char **argv)
1978 sfree(tgame); 1991 sfree(tgame);
1979 } 1992 }
1980 1993
1981 soln = solve_specific(s, DIFF_ANY, 0); 1994 soln = solve_specific(s, DIFF_ANY, false);
1982 tgame = game_text_format(s); 1995 tgame = game_text_format(s);
1983 fputs(tgame, stdout); 1996 fputs(tgame, stdout);
1984 sfree(tgame); 1997 sfree(tgame);
diff --git a/apps/plugins/puzzles/src/sixteen.c b/apps/plugins/puzzles/src/sixteen.c
index 6bba4c83b6..e47147a8a5 100644
--- a/apps/plugins/puzzles/src/sixteen.c
+++ b/apps/plugins/puzzles/src/sixteen.c
@@ -47,7 +47,7 @@ struct game_state {
47 int w, h, n; 47 int w, h, n;
48 int *tiles; 48 int *tiles;
49 int completed; 49 int completed;
50 int used_solve; /* used to suppress completion flash */ 50 bool used_solve; /* used to suppress completion flash */
51 int movecount, movetarget; 51 int movecount, movetarget;
52 int last_movement_sense; 52 int last_movement_sense;
53}; 53};
@@ -62,7 +62,7 @@ static game_params *default_params(void)
62 return ret; 62 return ret;
63} 63}
64 64
65static int game_fetch_preset(int i, char **name, game_params **params) 65static bool game_fetch_preset(int i, char **name, game_params **params)
66{ 66{
67 game_params *ret; 67 game_params *ret;
68 int w, h; 68 int w, h;
@@ -74,7 +74,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
74 case 2: w = 4, h = 4; break; 74 case 2: w = 4, h = 4; break;
75 case 3: w = 5, h = 4; break; 75 case 3: w = 5, h = 4; break;
76 case 4: w = 5, h = 5; break; 76 case 4: w = 5, h = 5; break;
77 default: return FALSE; 77 default: return false;
78 } 78 }
79 79
80 sprintf(buf, "%dx%d", w, h); 80 sprintf(buf, "%dx%d", w, h);
@@ -83,7 +83,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
83 ret->w = w; 83 ret->w = w;
84 ret->h = h; 84 ret->h = h;
85 ret->movetarget = 0; 85 ret->movetarget = 0;
86 return TRUE; 86 return true;
87} 87}
88 88
89static void free_params(game_params *params) 89static void free_params(game_params *params)
@@ -117,7 +117,7 @@ static void decode_params(game_params *ret, char const *string)
117 } 117 }
118} 118}
119 119
120static char *encode_params(const game_params *params, int full) 120static char *encode_params(const game_params *params, bool full)
121{ 121{
122 char data[256]; 122 char data[256];
123 123
@@ -169,7 +169,7 @@ static game_params *custom_params(const config_item *cfg)
169 return ret; 169 return ret;
170} 170}
171 171
172static const char *validate_params(const game_params *params, int full) 172static const char *validate_params(const game_params *params, bool full)
173{ 173{
174 if (params->w < 2 || params->h < 2) 174 if (params->w < 2 || params->h < 2)
175 return "Width and height must both be at least two"; 175 return "Width and height must both be at least two";
@@ -193,11 +193,12 @@ static int perm_parity(int *perm, int n)
193} 193}
194 194
195static char *new_game_desc(const game_params *params, random_state *rs, 195static char *new_game_desc(const game_params *params, random_state *rs,
196 char **aux, int interactive) 196 char **aux, bool interactive)
197{ 197{
198 int stop, n, i, x; 198 int stop, n, i, x;
199 int x1, x2, p1, p2; 199 int x1, x2, p1, p2;
200 int *tiles, *used; 200 int *tiles;
201 bool *used;
201 char *ret; 202 char *ret;
202 int retlen; 203 int retlen;
203 204
@@ -297,11 +298,11 @@ static char *new_game_desc(const game_params *params, random_state *rs,
297 298
298 } else { 299 } else {
299 300
300 used = snewn(n, int); 301 used = snewn(n, bool);
301 302
302 for (i = 0; i < n; i++) { 303 for (i = 0; i < n; i++) {
303 tiles[i] = -1; 304 tiles[i] = -1;
304 used[i] = FALSE; 305 used[i] = false;
305 } 306 }
306 307
307 /* 308 /*
@@ -325,7 +326,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
325 break; 326 break;
326 327
327 assert(j < n && !used[j]); 328 assert(j < n && !used[j]);
328 used[j] = TRUE; 329 used[j] = true;
329 330
330 while (tiles[x] >= 0) 331 while (tiles[x] >= 0)
331 x++; 332 x++;
@@ -401,15 +402,15 @@ static const char *validate_desc(const game_params *params, const char *desc)
401{ 402{
402 const char *p, *err; 403 const char *p, *err;
403 int i, area; 404 int i, area;
404 int *used; 405 bool *used;
405 406
406 area = params->w * params->h; 407 area = params->w * params->h;
407 p = desc; 408 p = desc;
408 err = NULL; 409 err = NULL;
409 410
410 used = snewn(area, int); 411 used = snewn(area, bool);
411 for (i = 0; i < area; i++) 412 for (i = 0; i < area; i++)
412 used[i] = FALSE; 413 used[i] = false;
413 414
414 for (i = 0; i < area; i++) { 415 for (i = 0; i < area; i++) {
415 const char *q = p; 416 const char *q = p;
@@ -438,7 +439,7 @@ static const char *validate_desc(const game_params *params, const char *desc)
438 err = "Number used twice"; 439 err = "Number used twice";
439 goto leave; 440 goto leave;
440 } 441 }
441 used[n-1] = TRUE; 442 used[n-1] = true;
442 443
443 if (*p) p++; /* eat comma */ 444 if (*p) p++; /* eat comma */
444 } 445 }
@@ -473,7 +474,7 @@ static game_state *new_game(midend *me, const game_params *params,
473 474
474 state->completed = state->movecount = 0; 475 state->completed = state->movecount = 0;
475 state->movetarget = params->movetarget; 476 state->movetarget = params->movetarget;
476 state->used_solve = FALSE; 477 state->used_solve = false;
477 state->last_movement_sense = 0; 478 state->last_movement_sense = 0;
478 479
479 return state; 480 return state;
@@ -509,9 +510,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
509 return dupstr("S"); 510 return dupstr("S");
510} 511}
511 512
512static int game_can_format_as_text_now(const game_params *params) 513static bool game_can_format_as_text_now(const game_params *params)
513{ 514{
514 return TRUE; 515 return true;
515} 516}
516 517
517static char *game_text_format(const game_state *state) 518static char *game_text_format(const game_state *state)
@@ -557,7 +558,7 @@ enum cursor_mode { unlocked, lock_tile, lock_position };
557 558
558struct game_ui { 559struct game_ui {
559 int cur_x, cur_y; 560 int cur_x, cur_y;
560 int cur_visible; 561 bool cur_visible;
561 enum cursor_mode cur_mode; 562 enum cursor_mode cur_mode;
562}; 563};
563 564
@@ -566,7 +567,7 @@ static game_ui *new_ui(const game_state *state)
566 game_ui *ui = snew(game_ui); 567 game_ui *ui = snew(game_ui);
567 ui->cur_x = 0; 568 ui->cur_x = 0;
568 ui->cur_y = 0; 569 ui->cur_y = 0;
569 ui->cur_visible = FALSE; 570 ui->cur_visible = false;
570 ui->cur_mode = unlocked; 571 ui->cur_mode = unlocked;
571 572
572 return ui; 573 return ui;
@@ -592,7 +593,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
592} 593}
593 594
594struct game_drawstate { 595struct game_drawstate {
595 int started; 596 bool started;
596 int w, h, bgcolour; 597 int w, h, bgcolour;
597 int *tiles; 598 int *tiles;
598 int tilesize; 599 int tilesize;
@@ -605,14 +606,14 @@ static char *interpret_move(const game_state *state, game_ui *ui,
605{ 606{
606 int cx = -1, cy = -1, dx, dy; 607 int cx = -1, cy = -1, dx, dy;
607 char buf[80]; 608 char buf[80];
608 int shift = button & MOD_SHFT, control = button & MOD_CTRL, 609 bool shift = button & MOD_SHFT, control = button & MOD_CTRL;
609 pad = button & MOD_NUM_KEYPAD; 610 int pad = button & MOD_NUM_KEYPAD;
610 611
611 button &= ~MOD_MASK; 612 button &= ~MOD_MASK;
612 613
613 if (IS_CURSOR_MOVE(button) || pad) { 614 if (IS_CURSOR_MOVE(button) || pad) {
614 if (!ui->cur_visible) { 615 if (!ui->cur_visible) {
615 ui->cur_visible = 1; 616 ui->cur_visible = true;
616 return UI_UPDATE; 617 return UI_UPDATE;
617 } 618 }
618 619
@@ -621,9 +622,9 @@ static char *interpret_move(const game_state *state, game_ui *ui,
621 if (x < 0 || x >= state->w || y < 0 || y >= state->h) 622 if (x < 0 || x >= state->w || y < 0 || y >= state->h)
622 return NULL; 623 return NULL;
623 move_cursor(button | pad, &x, &y, 624 move_cursor(button | pad, &x, &y,
624 state->w, state->h, FALSE); 625 state->w, state->h, false);
625 move_cursor(button | pad, &xwrap, &ywrap, 626 move_cursor(button | pad, &xwrap, &ywrap,
626 state->w, state->h, TRUE); 627 state->w, state->h, true);
627 628
628 if (x != xwrap) { 629 if (x != xwrap) {
629 sprintf(buf, "R%d,%c1", y, x ? '+' : '-'); 630 sprintf(buf, "R%d,%c1", y, x ? '+' : '-');
@@ -644,7 +645,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
644 int x = ui->cur_x + 1, y = ui->cur_y + 1; 645 int x = ui->cur_x + 1, y = ui->cur_y + 1;
645 646
646 move_cursor(button | pad, &x, &y, 647 move_cursor(button | pad, &x, &y,
647 state->w + 2, state->h + 2, FALSE); 648 state->w + 2, state->h + 2, false);
648 649
649 if (x == 0 && y == 0) { 650 if (x == 0 && y == 0) {
650 int t = ui->cur_x; 651 int t = ui->cur_x;
@@ -667,7 +668,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
667 ui->cur_y = y - 1; 668 ui->cur_y = y - 1;
668 } 669 }
669 670
670 ui->cur_visible = 1; 671 ui->cur_visible = true;
671 return UI_UPDATE; 672 return UI_UPDATE;
672 } 673 }
673 } 674 }
@@ -675,7 +676,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
675 if (button == LEFT_BUTTON || button == RIGHT_BUTTON) { 676 if (button == LEFT_BUTTON || button == RIGHT_BUTTON) {
676 cx = FROMCOORD(x); 677 cx = FROMCOORD(x);
677 cy = FROMCOORD(y); 678 cy = FROMCOORD(y);
678 ui->cur_visible = 0; 679 ui->cur_visible = false;
679 } else if (IS_CURSOR_SELECT(button)) { 680 } else if (IS_CURSOR_SELECT(button)) {
680 if (ui->cur_visible) { 681 if (ui->cur_visible) {
681 if (ui->cur_x == -1 || ui->cur_x == state->w || 682 if (ui->cur_x == -1 || ui->cur_x == state->w ||
@@ -689,7 +690,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
689 return UI_UPDATE; 690 return UI_UPDATE;
690 } 691 }
691 } else { 692 } else {
692 ui->cur_visible = 1; 693 ui->cur_visible = true;
693 return UI_UPDATE; 694 return UI_UPDATE;
694 } 695 }
695 } else { 696 } else {
@@ -740,7 +741,7 @@ static game_state *execute_move(const game_state *from, const char *move)
740 */ 741 */
741 for (i = 0; i < ret->n; i++) 742 for (i = 0; i < ret->n; i++)
742 ret->tiles[i] = i+1; 743 ret->tiles[i] = i+1;
743 ret->used_solve = TRUE; 744 ret->used_solve = true;
744 ret->completed = ret->movecount = 1; 745 ret->completed = ret->movecount = 1;
745 746
746 return ret; 747 return ret;
@@ -778,7 +779,7 @@ static game_state *execute_move(const game_state *from, const char *move)
778 ret->completed = ret->movecount; 779 ret->completed = ret->movecount;
779 for (n = 0; n < ret->n; n++) 780 for (n = 0; n < ret->n; n++)
780 if (ret->tiles[n] != n+1) 781 if (ret->tiles[n] != n+1)
781 ret->completed = FALSE; 782 ret->completed = 0;
782 } 783 }
783 784
784 return ret; 785 return ret;
@@ -824,7 +825,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
824 struct game_drawstate *ds = snew(struct game_drawstate); 825 struct game_drawstate *ds = snew(struct game_drawstate);
825 int i; 826 int i;
826 827
827 ds->started = FALSE; 828 ds->started = false;
828 ds->w = state->w; 829 ds->w = state->w;
829 ds->h = state->h; 830 ds->h = state->h;
830 ds->bgcolour = COL_BACKGROUND; 831 ds->bgcolour = COL_BACKGROUND;
@@ -879,7 +880,7 @@ static void draw_tile(drawing *dr, game_drawstate *ds,
879} 880}
880 881
881static void draw_arrow(drawing *dr, game_drawstate *ds, 882static void draw_arrow(drawing *dr, game_drawstate *ds,
882 int x, int y, int xdx, int xdy, int cur) 883 int x, int y, int xdx, int xdy, bool cur)
883{ 884{
884 int coords[14]; 885 int coords[14];
885 int ydy = -xdx, ydx = xdy; 886 int ydy = -xdx, ydx = xdy;
@@ -900,7 +901,7 @@ static void draw_arrow(drawing *dr, game_drawstate *ds,
900} 901}
901 902
902static void draw_arrow_for_cursor(drawing *dr, game_drawstate *ds, 903static void draw_arrow_for_cursor(drawing *dr, game_drawstate *ds,
903 int cur_x, int cur_y, int cur) 904 int cur_x, int cur_y, bool cur)
904{ 905{
905 if (cur_x == -1 && cur_y == -1) 906 if (cur_x == -1 && cur_y == -1)
906 return; /* 'no cursur here */ 907 return; /* 'no cursur here */
@@ -966,15 +967,15 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
966 * Arrows for making moves. 967 * Arrows for making moves.
967 */ 968 */
968 for (i = 0; i < state->w; i++) { 969 for (i = 0; i < state->w; i++) {
969 draw_arrow(dr, ds, COORD(i), COORD(0), +1, 0, 0); 970 draw_arrow(dr, ds, COORD(i), COORD(0), +1, 0, false);
970 draw_arrow(dr, ds, COORD(i+1), COORD(state->h), -1, 0, 0); 971 draw_arrow(dr, ds, COORD(i+1), COORD(state->h), -1, 0, false);
971 } 972 }
972 for (i = 0; i < state->h; i++) { 973 for (i = 0; i < state->h; i++) {
973 draw_arrow(dr, ds, COORD(state->w), COORD(i), 0, +1, 0); 974 draw_arrow(dr, ds, COORD(state->w), COORD(i), 0, +1, false);
974 draw_arrow(dr, ds, COORD(0), COORD(i+1), 0, -1, 0); 975 draw_arrow(dr, ds, COORD(0), COORD(i+1), 0, -1, false);
975 } 976 }
976 977
977 ds->started = TRUE; 978 ds->started = true;
978 } 979 }
979 /* 980 /*
980 * Cursor (highlighted arrow around edge) 981 * Cursor (highlighted arrow around edge)
@@ -985,8 +986,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
985 986
986 if (cur_x != ds->cur_x || cur_y != ds->cur_y) { 987 if (cur_x != ds->cur_x || cur_y != ds->cur_y) {
987 /* Cursor has changed; redraw two (prev and curr) arrows. */ 988 /* Cursor has changed; redraw two (prev and curr) arrows. */
988 draw_arrow_for_cursor(dr, ds, cur_x, cur_y, 1); 989 draw_arrow_for_cursor(dr, ds, cur_x, cur_y, true);
989 draw_arrow_for_cursor(dr, ds, ds->cur_x, ds->cur_y, 0); 990 draw_arrow_for_cursor(dr, ds, ds->cur_x, ds->cur_y, false);
990 } 991 }
991 992
992 /* 993 /*
@@ -1151,9 +1152,9 @@ static int game_status(const game_state *state)
1151 return state->completed ? +1 : 0; 1152 return state->completed ? +1 : 0;
1152} 1153}
1153 1154
1154static int game_timing_state(const game_state *state, game_ui *ui) 1155static bool game_timing_state(const game_state *state, game_ui *ui)
1155{ 1156{
1156 return TRUE; 1157 return true;
1157} 1158}
1158 1159
1159static void game_print_size(const game_params *params, float *x, float *y) 1160static void game_print_size(const game_params *params, float *x, float *y)
@@ -1176,15 +1177,15 @@ const struct game thegame = {
1176 encode_params, 1177 encode_params,
1177 free_params, 1178 free_params,
1178 dup_params, 1179 dup_params,
1179 TRUE, game_configure, custom_params, 1180 true, game_configure, custom_params,
1180 validate_params, 1181 validate_params,
1181 new_game_desc, 1182 new_game_desc,
1182 validate_desc, 1183 validate_desc,
1183 new_game, 1184 new_game,
1184 dup_game, 1185 dup_game,
1185 free_game, 1186 free_game,
1186 TRUE, solve_game, 1187 true, solve_game,
1187 TRUE, game_can_format_as_text_now, game_text_format, 1188 true, game_can_format_as_text_now, game_text_format,
1188 new_ui, 1189 new_ui,
1189 free_ui, 1190 free_ui,
1190 encode_ui, 1191 encode_ui,
@@ -1201,9 +1202,9 @@ const struct game thegame = {
1201 game_anim_length, 1202 game_anim_length,
1202 game_flash_length, 1203 game_flash_length,
1203 game_status, 1204 game_status,
1204 FALSE, FALSE, game_print_size, game_print, 1205 false, false, game_print_size, game_print,
1205 TRUE, /* wants_statusbar */ 1206 true, /* wants_statusbar */
1206 FALSE, game_timing_state, 1207 false, game_timing_state,
1207 0, /* flags */ 1208 0, /* flags */
1208}; 1209};
1209 1210
diff --git a/apps/plugins/puzzles/src/slant.c b/apps/plugins/puzzles/src/slant.c
index 5eeb66841c..70b2585b81 100644
--- a/apps/plugins/puzzles/src/slant.c
+++ b/apps/plugins/puzzles/src/slant.c
@@ -51,9 +51,9 @@ enum {
51 */ 51 */
52#if defined STANDALONE_SOLVER 52#if defined STANDALONE_SOLVER
53#define SOLVER_DIAGNOSTICS 53#define SOLVER_DIAGNOSTICS
54int verbose = FALSE; 54bool verbose = false;
55#elif defined SOLVER_DIAGNOSTICS 55#elif defined SOLVER_DIAGNOSTICS
56#define verbose TRUE 56#define verbose true
57#endif 57#endif
58 58
59/* 59/*
@@ -91,8 +91,8 @@ struct game_state {
91 game_clues *clues; 91 game_clues *clues;
92 signed char *soln; 92 signed char *soln;
93 unsigned char *errors; 93 unsigned char *errors;
94 int completed; 94 bool completed;
95 int used_solve; /* used to suppress completion flash */ 95 bool used_solve; /* used to suppress completion flash */
96}; 96};
97 97
98static game_params *default_params(void) 98static game_params *default_params(void)
@@ -114,13 +114,13 @@ static const struct game_params slant_presets[] = {
114 {12, 10, DIFF_HARD}, 114 {12, 10, DIFF_HARD},
115}; 115};
116 116
117static int game_fetch_preset(int i, char **name, game_params **params) 117static bool game_fetch_preset(int i, char **name, game_params **params)
118{ 118{
119 game_params *ret; 119 game_params *ret;
120 char str[80]; 120 char str[80];
121 121
122 if (i < 0 || i >= lenof(slant_presets)) 122 if (i < 0 || i >= lenof(slant_presets))
123 return FALSE; 123 return false;
124 124
125 ret = snew(game_params); 125 ret = snew(game_params);
126 *ret = slant_presets[i]; 126 *ret = slant_presets[i];
@@ -129,7 +129,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
129 129
130 *name = dupstr(str); 130 *name = dupstr(str);
131 *params = ret; 131 *params = ret;
132 return TRUE; 132 return true;
133} 133}
134 134
135static void free_params(game_params *params) 135static void free_params(game_params *params)
@@ -163,7 +163,7 @@ static void decode_params(game_params *ret, char const *string)
163 } 163 }
164} 164}
165 165
166static char *encode_params(const game_params *params, int full) 166static char *encode_params(const game_params *params, bool full)
167{ 167{
168 char data[256]; 168 char data[256];
169 169
@@ -213,7 +213,7 @@ static game_params *custom_params(const config_item *cfg)
213 return ret; 213 return ret;
214} 214}
215 215
216static const char *validate_params(const game_params *params, int full) 216static const char *validate_params(const game_params *params, bool full)
217{ 217{
218 /* 218 /*
219 * (At least at the time of writing this comment) The grid 219 * (At least at the time of writing this comment) The grid
@@ -253,7 +253,7 @@ struct solver_scratch {
253 * Tracks whether each connected set of points includes a 253 * Tracks whether each connected set of points includes a
254 * border point. 254 * border point.
255 */ 255 */
256 unsigned char *border; 256 bool *border;
257 257
258 /* 258 /*
259 * Another disjoint set forest. This one tracks _squares_ which 259 * Another disjoint set forest. This one tracks _squares_ which
@@ -308,7 +308,7 @@ static struct solver_scratch *new_scratch(int w, int h)
308 struct solver_scratch *ret = snew(struct solver_scratch); 308 struct solver_scratch *ret = snew(struct solver_scratch);
309 ret->connected = snewn(W*H, int); 309 ret->connected = snewn(W*H, int);
310 ret->exits = snewn(W*H, int); 310 ret->exits = snewn(W*H, int);
311 ret->border = snewn(W*H, unsigned char); 311 ret->border = snewn(W*H, bool);
312 ret->equiv = snewn(w*h, int); 312 ret->equiv = snewn(w*h, int);
313 ret->slashval = snewn(w*h, signed char); 313 ret->slashval = snewn(w*h, signed char);
314 ret->vbitmap = snewn(w*h, unsigned char); 314 ret->vbitmap = snewn(w*h, unsigned char);
@@ -333,7 +333,8 @@ static void free_scratch(struct solver_scratch *sc)
333static void merge_vertices(int *connected, 333static void merge_vertices(int *connected,
334 struct solver_scratch *sc, int i, int j) 334 struct solver_scratch *sc, int i, int j)
335{ 335{
336 int exits = -1, border = FALSE; /* initialise to placate optimiser */ 336 int exits = -1;
337 bool border = false; /* initialise to placate optimiser */
337 338
338 if (sc) { 339 if (sc) {
339 i = dsf_canonify(connected, i); 340 i = dsf_canonify(connected, i);
@@ -412,15 +413,15 @@ static void fill_square(int w, int h, int x, int y, int v,
412 } 413 }
413} 414}
414 415
415static int vbitmap_clear(int w, int h, struct solver_scratch *sc, 416static bool vbitmap_clear(int w, int h, struct solver_scratch *sc,
416 int x, int y, int vbits, const char *reason, ...) 417 int x, int y, int vbits, const char *reason, ...)
417{ 418{
418 int done_something = FALSE; 419 bool done_something = false;
419 int vbit; 420 int vbit;
420 421
421 for (vbit = 1; vbit <= 8; vbit <<= 1) 422 for (vbit = 1; vbit <= 8; vbit <<= 1)
422 if (vbits & sc->vbitmap[y*w+x] & vbit) { 423 if (vbits & sc->vbitmap[y*w+x] & vbit) {
423 done_something = TRUE; 424 done_something = true;
424#ifdef SOLVER_DIAGNOSTICS 425#ifdef SOLVER_DIAGNOSTICS
425 if (verbose) { 426 if (verbose) {
426 va_list ap; 427 va_list ap;
@@ -452,7 +453,7 @@ static int slant_solve(int w, int h, const signed char *clues,
452{ 453{
453 int W = w+1, H = h+1; 454 int W = w+1, H = h+1;
454 int x, y, i, j; 455 int x, y, i, j;
455 int done_something; 456 bool done_something;
456 457
457 /* 458 /*
458 * Clear the output. 459 * Clear the output.
@@ -500,9 +501,9 @@ static int slant_solve(int w, int h, const signed char *clues,
500 for (y = 0; y < H; y++) 501 for (y = 0; y < H; y++)
501 for (x = 0; x < W; x++) { 502 for (x = 0; x < W; x++) {
502 if (y == 0 || y == H-1 || x == 0 || x == W-1) 503 if (y == 0 || y == H-1 || x == 0 || x == W-1)
503 sc->border[y*W+x] = TRUE; 504 sc->border[y*W+x] = true;
504 else 505 else
505 sc->border[y*W+x] = FALSE; 506 sc->border[y*W+x] = false;
506 507
507 if (clues[y*W+x] < 0) 508 if (clues[y*W+x] < 0)
508 sc->exits[y*W+x] = 4; 509 sc->exits[y*W+x] = 4;
@@ -514,7 +515,7 @@ static int slant_solve(int w, int h, const signed char *clues,
514 * Repeatedly try to deduce something until we can't. 515 * Repeatedly try to deduce something until we can't.
515 */ 516 */
516 do { 517 do {
517 done_something = FALSE; 518 done_something = false;
518 519
519 /* 520 /*
520 * Any clue point with the number of remaining lines equal 521 * Any clue point with the number of remaining lines equal
@@ -645,7 +646,7 @@ static int slant_solve(int w, int h, const signed char *clues,
645 sc->connected, sc); 646 sc->connected, sc);
646 } 647 }
647 648
648 done_something = TRUE; 649 done_something = true;
649 } else if (nu == 2 && nl == 1 && difficulty > DIFF_EASY) { 650 } else if (nu == 2 && nl == 1 && difficulty > DIFF_EASY) {
650 /* 651 /*
651 * If we have precisely two undecided squares 652 * If we have precisely two undecided squares
@@ -731,8 +732,8 @@ static int slant_solve(int w, int h, const signed char *clues,
731 */ 732 */
732 for (y = 0; y < h; y++) 733 for (y = 0; y < h; y++)
733 for (x = 0; x < w; x++) { 734 for (x = 0; x < w; x++) {
734 int fs, bs, v; 735 bool fs, bs;
735 int c1, c2; 736 int v, c1, c2;
736#ifdef SOLVER_DIAGNOSTICS 737#ifdef SOLVER_DIAGNOSTICS
737 const char *reason = "<internal error>"; 738 const char *reason = "<internal error>";
738#endif 739#endif
@@ -740,8 +741,8 @@ static int slant_solve(int w, int h, const signed char *clues,
740 if (soln[y*w+x]) 741 if (soln[y*w+x])
741 continue; /* got this one already */ 742 continue; /* got this one already */
742 743
743 fs = FALSE; 744 fs = false;
744 bs = FALSE; 745 bs = false;
745 746
746 if (difficulty > DIFF_EASY) 747 if (difficulty > DIFF_EASY)
747 v = sc->slashval[dsf_canonify(sc->equiv, y*w+x)]; 748 v = sc->slashval[dsf_canonify(sc->equiv, y*w+x)];
@@ -756,7 +757,7 @@ static int slant_solve(int w, int h, const signed char *clues,
756 c1 = dsf_canonify(sc->connected, y*W+x); 757 c1 = dsf_canonify(sc->connected, y*W+x);
757 c2 = dsf_canonify(sc->connected, (y+1)*W+(x+1)); 758 c2 = dsf_canonify(sc->connected, (y+1)*W+(x+1));
758 if (c1 == c2) { 759 if (c1 == c2) {
759 fs = TRUE; 760 fs = true;
760#ifdef SOLVER_DIAGNOSTICS 761#ifdef SOLVER_DIAGNOSTICS
761 reason = "simple loop avoidance"; 762 reason = "simple loop avoidance";
762#endif 763#endif
@@ -764,13 +765,13 @@ static int slant_solve(int w, int h, const signed char *clues,
764 if (difficulty > DIFF_EASY && 765 if (difficulty > DIFF_EASY &&
765 !sc->border[c1] && !sc->border[c2] && 766 !sc->border[c1] && !sc->border[c2] &&
766 sc->exits[c1] <= 1 && sc->exits[c2] <= 1) { 767 sc->exits[c1] <= 1 && sc->exits[c2] <= 1) {
767 fs = TRUE; 768 fs = true;
768#ifdef SOLVER_DIAGNOSTICS 769#ifdef SOLVER_DIAGNOSTICS
769 reason = "dead end avoidance"; 770 reason = "dead end avoidance";
770#endif 771#endif
771 } 772 }
772 if (v == +1) { 773 if (v == +1) {
773 fs = TRUE; 774 fs = true;
774#ifdef SOLVER_DIAGNOSTICS 775#ifdef SOLVER_DIAGNOSTICS
775 reason = "equivalence to an already filled square"; 776 reason = "equivalence to an already filled square";
776#endif 777#endif
@@ -783,7 +784,7 @@ static int slant_solve(int w, int h, const signed char *clues,
783 c1 = dsf_canonify(sc->connected, y*W+(x+1)); 784 c1 = dsf_canonify(sc->connected, y*W+(x+1));
784 c2 = dsf_canonify(sc->connected, (y+1)*W+x); 785 c2 = dsf_canonify(sc->connected, (y+1)*W+x);
785 if (c1 == c2) { 786 if (c1 == c2) {
786 bs = TRUE; 787 bs = true;
787#ifdef SOLVER_DIAGNOSTICS 788#ifdef SOLVER_DIAGNOSTICS
788 reason = "simple loop avoidance"; 789 reason = "simple loop avoidance";
789#endif 790#endif
@@ -791,13 +792,13 @@ static int slant_solve(int w, int h, const signed char *clues,
791 if (difficulty > DIFF_EASY && 792 if (difficulty > DIFF_EASY &&
792 !sc->border[c1] && !sc->border[c2] && 793 !sc->border[c1] && !sc->border[c2] &&
793 sc->exits[c1] <= 1 && sc->exits[c2] <= 1) { 794 sc->exits[c1] <= 1 && sc->exits[c2] <= 1) {
794 bs = TRUE; 795 bs = true;
795#ifdef SOLVER_DIAGNOSTICS 796#ifdef SOLVER_DIAGNOSTICS
796 reason = "dead end avoidance"; 797 reason = "dead end avoidance";
797#endif 798#endif
798 } 799 }
799 if (v == -1) { 800 if (v == -1) {
800 bs = TRUE; 801 bs = true;
801#ifdef SOLVER_DIAGNOSTICS 802#ifdef SOLVER_DIAGNOSTICS
802 reason = "equivalence to an already filled square"; 803 reason = "equivalence to an already filled square";
803#endif 804#endif
@@ -820,14 +821,14 @@ static int slant_solve(int w, int h, const signed char *clues,
820 printf("employing %s\n", reason); 821 printf("employing %s\n", reason);
821#endif 822#endif
822 fill_square(w, h, x, y, +1, soln, sc->connected, sc); 823 fill_square(w, h, x, y, +1, soln, sc->connected, sc);
823 done_something = TRUE; 824 done_something = true;
824 } else if (bs) { 825 } else if (bs) {
825#ifdef SOLVER_DIAGNOSTICS 826#ifdef SOLVER_DIAGNOSTICS
826 if (verbose) 827 if (verbose)
827 printf("employing %s\n", reason); 828 printf("employing %s\n", reason);
828#endif 829#endif
829 fill_square(w, h, x, y, -1, soln, sc->connected, sc); 830 fill_square(w, h, x, y, -1, soln, sc->connected, sc);
830 done_something = TRUE; 831 done_something = true;
831 } 832 }
832 } 833 }
833 834
@@ -877,7 +878,7 @@ static int slant_solve(int w, int h, const signed char *clues,
877 if (dsf_canonify(sc->equiv, n1) != 878 if (dsf_canonify(sc->equiv, n1) !=
878 dsf_canonify(sc->equiv, n2)) { 879 dsf_canonify(sc->equiv, n2)) {
879 dsf_merge(sc->equiv, n1, n2); 880 dsf_merge(sc->equiv, n1, n2);
880 done_something = TRUE; 881 done_something = true;
881#ifdef SOLVER_DIAGNOSTICS 882#ifdef SOLVER_DIAGNOSTICS
882 if (verbose) 883 if (verbose)
883 printf("(%d,%d) and (%d,%d) must be equivalent" 884 printf("(%d,%d) and (%d,%d) must be equivalent"
@@ -891,7 +892,7 @@ static int slant_solve(int w, int h, const signed char *clues,
891 if (dsf_canonify(sc->equiv, n1) != 892 if (dsf_canonify(sc->equiv, n1) !=
892 dsf_canonify(sc->equiv, n2)) { 893 dsf_canonify(sc->equiv, n2)) {
893 dsf_merge(sc->equiv, n1, n2); 894 dsf_merge(sc->equiv, n1, n2);
894 done_something = TRUE; 895 done_something = true;
895#ifdef SOLVER_DIAGNOSTICS 896#ifdef SOLVER_DIAGNOSTICS
896 if (verbose) 897 if (verbose)
897 printf("(%d,%d) and (%d,%d) must be equivalent" 898 printf("(%d,%d) and (%d,%d) must be equivalent"
@@ -1016,7 +1017,8 @@ static void slant_generate(int w, int h, signed char *soln, random_state *rs)
1016 * Fill in each one in turn. 1017 * Fill in each one in turn.
1017 */ 1018 */
1018 for (i = 0; i < w*h; i++) { 1019 for (i = 0; i < w*h; i++) {
1019 int fs, bs, v; 1020 bool fs, bs;
1021 int v;
1020 1022
1021 y = indices[i] / w; 1023 y = indices[i] / w;
1022 x = indices[i] % w; 1024 x = indices[i] % w;
@@ -1060,7 +1062,7 @@ static void slant_generate(int w, int h, signed char *soln, random_state *rs)
1060} 1062}
1061 1063
1062static char *new_game_desc(const game_params *params, random_state *rs, 1064static char *new_game_desc(const game_params *params, random_state *rs,
1063 char **aux, int interactive) 1065 char **aux, bool interactive)
1064{ 1066{
1065 int w = params->w, h = params->h, W = w+1, H = h+1; 1067 int w = params->w, h = params->h, W = w+1, H = h+1;
1066 signed char *soln, *tmpsoln, *clues; 1068 signed char *soln, *tmpsoln, *clues;
@@ -1119,7 +1121,8 @@ static char *new_game_desc(const game_params *params, random_state *rs,
1119 shuffle(clueindices, W*H, sizeof(*clueindices), rs); 1121 shuffle(clueindices, W*H, sizeof(*clueindices), rs);
1120 for (j = 0; j < 2; j++) { 1122 for (j = 0; j < 2; j++) {
1121 for (i = 0; i < W*H; i++) { 1123 for (i = 0; i < W*H; i++) {
1122 int pass, yb, xb; 1124 int pass;
1125 bool yb, xb;
1123 1126
1124 y = clueindices[i] / W; 1127 y = clueindices[i] / W;
1125 x = clueindices[i] % W; 1128 x = clueindices[i] % W;
@@ -1248,7 +1251,7 @@ static game_state *new_game(midend *me, const game_params *params,
1248 state->p = *params; 1251 state->p = *params;
1249 state->soln = snewn(w*h, signed char); 1252 state->soln = snewn(w*h, signed char);
1250 memset(state->soln, 0, w*h); 1253 memset(state->soln, 0, w*h);
1251 state->completed = state->used_solve = FALSE; 1254 state->completed = state->used_solve = false;
1252 state->errors = snewn(W*H, unsigned char); 1255 state->errors = snewn(W*H, unsigned char);
1253 memset(state->errors, 0, W*H); 1256 memset(state->errors, 0, W*H);
1254 1257
@@ -1319,7 +1322,7 @@ static void free_game(game_state *state)
1319 * squares that contributed to it. 1322 * squares that contributed to it.
1320 */ 1323 */
1321static int vertex_degree(int w, int h, signed char *soln, int x, int y, 1324static int vertex_degree(int w, int h, signed char *soln, int x, int y,
1322 int anti, int *sx, int *sy) 1325 bool anti, int *sx, int *sy)
1323{ 1326{
1324 int ret = 0; 1327 int ret = 0;
1325 1328
@@ -1376,10 +1379,11 @@ static int slant_neighbour(int vertex, void *vctx)
1376 return -1; 1379 return -1;
1377} 1380}
1378 1381
1379static int check_completion(game_state *state) 1382static bool check_completion(game_state *state)
1380{ 1383{
1381 int w = state->p.w, h = state->p.h, W = w+1, H = h+1; 1384 int w = state->p.w, h = state->p.h, W = w+1, H = h+1;
1382 int x, y, err = FALSE; 1385 int x, y;
1386 bool err = false;
1383 1387
1384 memset(state->errors, 0, W*H); 1388 memset(state->errors, 0, W*H);
1385 1389
@@ -1392,7 +1396,7 @@ static int check_completion(game_state *state)
1392 ctx.state = state; 1396 ctx.state = state;
1393 1397
1394 if (findloop_run(fls, W*H, slant_neighbour, &ctx)) 1398 if (findloop_run(fls, W*H, slant_neighbour, &ctx))
1395 err = TRUE; 1399 err = true;
1396 for (y = 0; y < h; y++) { 1400 for (y = 0; y < h; y++) {
1397 for (x = 0; x < w; x++) { 1401 for (x = 0; x < w; x++) {
1398 int u, v; 1402 int u, v;
@@ -1430,11 +1434,11 @@ static int check_completion(game_state *state)
1430 * grounds for marking the vertex as erroneous. 1434 * grounds for marking the vertex as erroneous.
1431 */ 1435 */
1432 if (vertex_degree(w, h, state->soln, x, y, 1436 if (vertex_degree(w, h, state->soln, x, y,
1433 FALSE, NULL, NULL) > c || 1437 false, NULL, NULL) > c ||
1434 vertex_degree(w, h, state->soln, x, y, 1438 vertex_degree(w, h, state->soln, x, y,
1435 TRUE, NULL, NULL) > 4-c) { 1439 true, NULL, NULL) > 4-c) {
1436 state->errors[y*W+x] |= ERR_VERTEX; 1440 state->errors[y*W+x] |= ERR_VERTEX;
1437 err = TRUE; 1441 err = true;
1438 } 1442 }
1439 } 1443 }
1440 1444
@@ -1445,14 +1449,14 @@ static int check_completion(game_state *state)
1445 */ 1449 */
1446 1450
1447 if (err) 1451 if (err)
1448 return FALSE; 1452 return false;
1449 1453
1450 for (y = 0; y < h; y++) 1454 for (y = 0; y < h; y++)
1451 for (x = 0; x < w; x++) 1455 for (x = 0; x < w; x++)
1452 if (state->soln[y*w+x] == 0) 1456 if (state->soln[y*w+x] == 0)
1453 return FALSE; 1457 return false;
1454 1458
1455 return TRUE; 1459 return true;
1456} 1460}
1457 1461
1458static char *solve_game(const game_state *state, const game_state *currstate, 1462static char *solve_game(const game_state *state, const game_state *currstate,
@@ -1461,7 +1465,7 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1461 int w = state->p.w, h = state->p.h; 1465 int w = state->p.w, h = state->p.h;
1462 signed char *soln; 1466 signed char *soln;
1463 int bs, ret; 1467 int bs, ret;
1464 int free_soln = FALSE; 1468 bool free_soln = false;
1465 char *move, buf[80]; 1469 char *move, buf[80];
1466 int movelen, movesize; 1470 int movelen, movesize;
1467 int x, y; 1471 int x, y;
@@ -1473,7 +1477,7 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1473 */ 1477 */
1474 soln = (signed char *)aux; 1478 soln = (signed char *)aux;
1475 bs = (signed char)'\\'; 1479 bs = (signed char)'\\';
1476 free_soln = FALSE; 1480 free_soln = false;
1477 } else { 1481 } else {
1478 struct solver_scratch *sc = new_scratch(w, h); 1482 struct solver_scratch *sc = new_scratch(w, h);
1479 soln = snewn(w*h, signed char); 1483 soln = snewn(w*h, signed char);
@@ -1488,7 +1492,7 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1488 *error = "Unable to find a unique solution for this puzzle"; 1492 *error = "Unable to find a unique solution for this puzzle";
1489 return NULL; 1493 return NULL;
1490 } 1494 }
1491 free_soln = TRUE; 1495 free_soln = true;
1492 } 1496 }
1493 1497
1494 /* 1498 /*
@@ -1520,9 +1524,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1520 return move; 1524 return move;
1521} 1525}
1522 1526
1523static int game_can_format_as_text_now(const game_params *params) 1527static bool game_can_format_as_text_now(const game_params *params)
1524{ 1528{
1525 return TRUE; 1529 return true;
1526} 1530}
1527 1531
1528static char *game_text_format(const game_state *state) 1532static char *game_text_format(const game_state *state)
@@ -1568,13 +1572,15 @@ static char *game_text_format(const game_state *state)
1568} 1572}
1569 1573
1570struct game_ui { 1574struct game_ui {
1571 int cur_x, cur_y, cur_visible; 1575 int cur_x, cur_y;
1576 bool cur_visible;
1572}; 1577};
1573 1578
1574static game_ui *new_ui(const game_state *state) 1579static game_ui *new_ui(const game_state *state)
1575{ 1580{
1576 game_ui *ui = snew(game_ui); 1581 game_ui *ui = snew(game_ui);
1577 ui->cur_x = ui->cur_y = ui->cur_visible = 0; 1582 ui->cur_x = ui->cur_y = 0;
1583 ui->cur_visible = false;
1578 return ui; 1584 return ui;
1579} 1585}
1580 1586
@@ -1632,7 +1638,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1632 1638
1633struct game_drawstate { 1639struct game_drawstate {
1634 int tilesize; 1640 int tilesize;
1635 int started; 1641 bool started;
1636 long *grid; 1642 long *grid;
1637 long *todraw; 1643 long *todraw;
1638}; 1644};
@@ -1675,10 +1681,10 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1675 y = FROMCOORD(y); 1681 y = FROMCOORD(y);
1676 if (x < 0 || y < 0 || x >= w || y >= h) 1682 if (x < 0 || y < 0 || x >= w || y >= h)
1677 return NULL; 1683 return NULL;
1678 ui->cur_visible = 0; 1684 ui->cur_visible = false;
1679 } else if (IS_CURSOR_SELECT(button)) { 1685 } else if (IS_CURSOR_SELECT(button)) {
1680 if (!ui->cur_visible) { 1686 if (!ui->cur_visible) {
1681 ui->cur_visible = 1; 1687 ui->cur_visible = true;
1682 return UI_UPDATE; 1688 return UI_UPDATE;
1683 } 1689 }
1684 x = ui->cur_x; 1690 x = ui->cur_x;
@@ -1686,8 +1692,8 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1686 1692
1687 action = (button == CURSOR_SELECT2) ? ANTICLOCKWISE : CLOCKWISE; 1693 action = (button == CURSOR_SELECT2) ? ANTICLOCKWISE : CLOCKWISE;
1688 } else if (IS_CURSOR_MOVE(button)) { 1694 } else if (IS_CURSOR_MOVE(button)) {
1689 move_cursor(button, &ui->cur_x, &ui->cur_y, w, h, 0); 1695 move_cursor(button, &ui->cur_x, &ui->cur_y, w, h, false);
1690 ui->cur_visible = 1; 1696 ui->cur_visible = true;
1691 return UI_UPDATE; 1697 return UI_UPDATE;
1692 } else if (button == '\\' || button == '\b' || button == '/') { 1698 } else if (button == '\\' || button == '\b' || button == '/') {
1693 int x = ui->cur_x, y = ui->cur_y; 1699 int x = ui->cur_x, y = ui->cur_y;
@@ -1730,7 +1736,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1730 while (*move) { 1736 while (*move) {
1731 c = *move; 1737 c = *move;
1732 if (c == 'S') { 1738 if (c == 'S') {
1733 ret->used_solve = TRUE; 1739 ret->used_solve = true;
1734 move++; 1740 move++;
1735 } else if (c == '\\' || c == '/' || c == 'C') { 1741 } else if (c == '\\' || c == '/' || c == 'C') {
1736 move++; 1742 move++;
@@ -1826,7 +1832,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1826 struct game_drawstate *ds = snew(struct game_drawstate); 1832 struct game_drawstate *ds = snew(struct game_drawstate);
1827 1833
1828 ds->tilesize = 0; 1834 ds->tilesize = 0;
1829 ds->started = FALSE; 1835 ds->started = false;
1830 ds->grid = snewn((w+2)*(h+2), long); 1836 ds->grid = snewn((w+2)*(h+2), long);
1831 ds->todraw = snewn((w+2)*(h+2), long); 1837 ds->todraw = snewn((w+2)*(h+2), long);
1832 for (i = 0; i < (w+2)*(h+2); i++) 1838 for (i = 0; i < (w+2)*(h+2); i++)
@@ -1843,7 +1849,7 @@ static void game_free_drawstate(drawing *dr, game_drawstate *ds)
1843} 1849}
1844 1850
1845static void draw_clue(drawing *dr, game_drawstate *ds, 1851static void draw_clue(drawing *dr, game_drawstate *ds,
1846 int x, int y, long v, long err, int bg, int colour) 1852 int x, int y, long v, bool err, int bg, int colour)
1847{ 1853{
1848 char p[2]; 1854 char p[2];
1849 int ccol = colour >= 0 ? colour : ((x ^ y) & 1) ? COL_SLANT1 : COL_SLANT2; 1855 int ccol = colour >= 0 ? colour : ((x ^ y) & 1) ? COL_SLANT1 : COL_SLANT2;
@@ -1959,19 +1965,19 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1959{ 1965{
1960 int w = state->p.w, h = state->p.h, W = w+1, H = h+1; 1966 int w = state->p.w, h = state->p.h, W = w+1, H = h+1;
1961 int x, y; 1967 int x, y;
1962 int flashing; 1968 bool flashing;
1963 1969
1964 if (flashtime > 0) 1970 if (flashtime > 0)
1965 flashing = (int)(flashtime * 3 / FLASH_TIME) != 1; 1971 flashing = (int)(flashtime * 3 / FLASH_TIME) != 1;
1966 else 1972 else
1967 flashing = FALSE; 1973 flashing = false;
1968 1974
1969 if (!ds->started) { 1975 if (!ds->started) {
1970 int ww, wh; 1976 int ww, wh;
1971 game_compute_size(&state->p, TILESIZE, &ww, &wh); 1977 game_compute_size(&state->p, TILESIZE, &ww, &wh);
1972 draw_rect(dr, 0, 0, ww, wh, COL_BACKGROUND); 1978 draw_rect(dr, 0, 0, ww, wh, COL_BACKGROUND);
1973 draw_update(dr, 0, 0, ww, wh); 1979 draw_update(dr, 0, 0, ww, wh);
1974 ds->started = TRUE; 1980 ds->started = true;
1975 } 1981 }
1976 1982
1977 /* 1983 /*
@@ -1989,7 +1995,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1989 1995
1990 for (y = 0; y < h; y++) { 1996 for (y = 0; y < h; y++) {
1991 for (x = 0; x < w; x++) { 1997 for (x = 0; x < w; x++) {
1992 int err = state->errors[y*W+x] & ERR_SQUARE; 1998 bool err = state->errors[y*W+x] & ERR_SQUARE;
1993 1999
1994 if (state->soln[y*w+x] < 0) { 2000 if (state->soln[y*w+x] < 0) {
1995 ds->todraw[(y+1)*(w+2)+(x+1)] |= BACKSLASH; 2001 ds->todraw[(y+1)*(w+2)+(x+1)] |= BACKSLASH;
@@ -2063,9 +2069,9 @@ static int game_status(const game_state *state)
2063 return state->completed ? +1 : 0; 2069 return state->completed ? +1 : 0;
2064} 2070}
2065 2071
2066static int game_timing_state(const game_state *state, game_ui *ui) 2072static bool game_timing_state(const game_state *state, game_ui *ui)
2067{ 2073{
2068 return TRUE; 2074 return true;
2069} 2075}
2070 2076
2071static void game_print_size(const game_params *params, float *x, float *y) 2077static void game_print_size(const game_params *params, float *x, float *y)
@@ -2136,7 +2142,7 @@ static void game_print(drawing *dr, const game_state *state, int tilesize)
2136 for (y = 0; y <= h; y++) 2142 for (y = 0; y <= h; y++)
2137 for (x = 0; x <= w; x++) 2143 for (x = 0; x <= w; x++)
2138 draw_clue(dr, ds, x, y, state->clues->clues[y*W+x], 2144 draw_clue(dr, ds, x, y, state->clues->clues[y*W+x],
2139 FALSE, paper, ink); 2145 false, paper, ink);
2140} 2146}
2141 2147
2142#ifdef COMBINED 2148#ifdef COMBINED
@@ -2151,15 +2157,15 @@ const struct game thegame = {
2151 encode_params, 2157 encode_params,
2152 free_params, 2158 free_params,
2153 dup_params, 2159 dup_params,
2154 TRUE, game_configure, custom_params, 2160 true, game_configure, custom_params,
2155 validate_params, 2161 validate_params,
2156 new_game_desc, 2162 new_game_desc,
2157 validate_desc, 2163 validate_desc,
2158 new_game, 2164 new_game,
2159 dup_game, 2165 dup_game,
2160 free_game, 2166 free_game,
2161 TRUE, solve_game, 2167 true, solve_game,
2162 TRUE, game_can_format_as_text_now, game_text_format, 2168 true, game_can_format_as_text_now, game_text_format,
2163 new_ui, 2169 new_ui,
2164 free_ui, 2170 free_ui,
2165 encode_ui, 2171 encode_ui,
@@ -2176,9 +2182,9 @@ const struct game thegame = {
2176 game_anim_length, 2182 game_anim_length,
2177 game_flash_length, 2183 game_flash_length,
2178 game_status, 2184 game_status,
2179 TRUE, FALSE, game_print_size, game_print, 2185 true, false, game_print_size, game_print,
2180 FALSE, /* wants_statusbar */ 2186 false, /* wants_statusbar */
2181 FALSE, game_timing_state, 2187 false, game_timing_state,
2182 0, /* flags */ 2188 0, /* flags */
2183}; 2189};
2184 2190
@@ -2192,16 +2198,17 @@ int main(int argc, char **argv)
2192 game_state *s; 2198 game_state *s;
2193 char *id = NULL, *desc; 2199 char *id = NULL, *desc;
2194 const char *err; 2200 const char *err;
2195 int grade = FALSE; 2201 bool grade = false;
2196 int ret, diff, really_verbose = FALSE; 2202 int ret, diff;
2203 bool really_verbose = false;
2197 struct solver_scratch *sc; 2204 struct solver_scratch *sc;
2198 2205
2199 while (--argc > 0) { 2206 while (--argc > 0) {
2200 char *p = *++argv; 2207 char *p = *++argv;
2201 if (!strcmp(p, "-v")) { 2208 if (!strcmp(p, "-v")) {
2202 really_verbose = TRUE; 2209 really_verbose = true;
2203 } else if (!strcmp(p, "-g")) { 2210 } else if (!strcmp(p, "-g")) {
2204 grade = TRUE; 2211 grade = true;
2205 } else if (*p == '-') { 2212 } else if (*p == '-') {
2206 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p); 2213 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p);
2207 return 1; 2214 return 1;
diff --git a/apps/plugins/puzzles/src/solo.c b/apps/plugins/puzzles/src/solo.c
index 69fd85b90b..cfe38c5bd9 100644
--- a/apps/plugins/puzzles/src/solo.c
+++ b/apps/plugins/puzzles/src/solo.c
@@ -146,9 +146,9 @@ enum {
146#define MAX_2SUMS 5 146#define MAX_2SUMS 5
147#define MAX_3SUMS 8 147#define MAX_3SUMS 8
148#define MAX_4SUMS 12 148#define MAX_4SUMS 12
149unsigned long sum_bits2[18][MAX_2SUMS]; 149static unsigned long sum_bits2[18][MAX_2SUMS];
150unsigned long sum_bits3[25][MAX_3SUMS]; 150static unsigned long sum_bits3[25][MAX_3SUMS];
151unsigned long sum_bits4[31][MAX_4SUMS]; 151static unsigned long sum_bits4[31][MAX_4SUMS];
152 152
153static int find_sum_bits(unsigned long *array, int idx, int value_left, 153static int find_sum_bits(unsigned long *array, int idx, int value_left,
154 int addends_left, int min_addend, 154 int addends_left, int min_addend,
@@ -210,8 +210,8 @@ struct game_params {
210 * compositeness - a 7x7 jigsaw sudoku makes perfect sense). 210 * compositeness - a 7x7 jigsaw sudoku makes perfect sense).
211 */ 211 */
212 int c, r, symm, diff, kdiff; 212 int c, r, symm, diff, kdiff;
213 int xtype; /* require all digits in X-diagonals */ 213 bool xtype; /* require all digits in X-diagonals */
214 int killer; 214 bool killer;
215}; 215};
216 216
217struct block_structure { 217struct block_structure {
@@ -263,11 +263,11 @@ struct game_state {
263 int cr; 263 int cr;
264 struct block_structure *blocks; 264 struct block_structure *blocks;
265 struct block_structure *kblocks; /* Blocks for killer puzzles. */ 265 struct block_structure *kblocks; /* Blocks for killer puzzles. */
266 int xtype, killer; 266 bool xtype, killer;
267 digit *grid, *kgrid; 267 digit *grid, *kgrid;
268 unsigned char *pencil; /* c*r*c*r elements */ 268 bool *pencil; /* c*r*c*r elements */
269 unsigned char *immutable; /* marks which digits are clues */ 269 bool *immutable; /* marks which digits are clues */
270 int completed, cheated; 270 bool completed, cheated;
271}; 271};
272 272
273static game_params *default_params(void) 273static game_params *default_params(void)
@@ -275,8 +275,8 @@ static game_params *default_params(void)
275 game_params *ret = snew(game_params); 275 game_params *ret = snew(game_params);
276 276
277 ret->c = ret->r = 3; 277 ret->c = ret->r = 3;
278 ret->xtype = FALSE; 278 ret->xtype = false;
279 ret->killer = FALSE; 279 ret->killer = false;
280 ret->symm = SYMM_ROT2; /* a plausible default */ 280 ret->symm = SYMM_ROT2; /* a plausible default */
281 ret->diff = DIFF_BLOCK; /* so is this */ 281 ret->diff = DIFF_BLOCK; /* so is this */
282 ret->kdiff = DIFF_KINTERSECT; /* so is this */ 282 ret->kdiff = DIFF_KINTERSECT; /* so is this */
@@ -296,53 +296,53 @@ static game_params *dup_params(const game_params *params)
296 return ret; 296 return ret;
297} 297}
298 298
299static int game_fetch_preset(int i, char **name, game_params **params) 299static bool game_fetch_preset(int i, char **name, game_params **params)
300{ 300{
301 static struct { 301 static struct {
302 const char *title; 302 const char *title;
303 game_params params; 303 game_params params;
304 } const presets[] = { 304 } const presets[] = {
305 { "2x2 Trivial", { 2, 2, SYMM_ROT2, DIFF_BLOCK, DIFF_KMINMAX, FALSE, FALSE } }, 305 { "2x2 Trivial", { 2, 2, SYMM_ROT2, DIFF_BLOCK, DIFF_KMINMAX, false, false } },
306 { "2x3 Basic", { 2, 3, SYMM_ROT2, DIFF_SIMPLE, DIFF_KMINMAX, FALSE, FALSE } }, 306 { "2x3 Basic", { 2, 3, SYMM_ROT2, DIFF_SIMPLE, DIFF_KMINMAX, false, false } },
307 { "3x3 Trivial", { 3, 3, SYMM_ROT2, DIFF_BLOCK, DIFF_KMINMAX, FALSE, FALSE } }, 307 { "3x3 Trivial", { 3, 3, SYMM_ROT2, DIFF_BLOCK, DIFF_KMINMAX, false, false } },
308 { "3x3 Basic", { 3, 3, SYMM_ROT2, DIFF_SIMPLE, DIFF_KMINMAX, FALSE, FALSE } }, 308 { "3x3 Basic", { 3, 3, SYMM_ROT2, DIFF_SIMPLE, DIFF_KMINMAX, false, false } },
309 { "3x3 Basic X", { 3, 3, SYMM_ROT2, DIFF_SIMPLE, DIFF_KMINMAX, TRUE } }, 309 { "3x3 Basic X", { 3, 3, SYMM_ROT2, DIFF_SIMPLE, DIFF_KMINMAX, true } },
310 { "3x3 Intermediate", { 3, 3, SYMM_ROT2, DIFF_INTERSECT, DIFF_KMINMAX, FALSE, FALSE } }, 310 { "3x3 Intermediate", { 3, 3, SYMM_ROT2, DIFF_INTERSECT, DIFF_KMINMAX, false, false } },
311 { "3x3 Advanced", { 3, 3, SYMM_ROT2, DIFF_SET, DIFF_KMINMAX, FALSE, FALSE } }, 311 { "3x3 Advanced", { 3, 3, SYMM_ROT2, DIFF_SET, DIFF_KMINMAX, false, false } },
312 { "3x3 Advanced X", { 3, 3, SYMM_ROT2, DIFF_SET, DIFF_KMINMAX, TRUE } }, 312 { "3x3 Advanced X", { 3, 3, SYMM_ROT2, DIFF_SET, DIFF_KMINMAX, true } },
313 { "3x3 Extreme", { 3, 3, SYMM_ROT2, DIFF_EXTREME, DIFF_KMINMAX, FALSE, FALSE } }, 313 { "3x3 Extreme", { 3, 3, SYMM_ROT2, DIFF_EXTREME, DIFF_KMINMAX, false, false } },
314 { "3x3 Unreasonable", { 3, 3, SYMM_ROT2, DIFF_RECURSIVE, DIFF_KMINMAX, FALSE, FALSE } }, 314 { "3x3 Unreasonable", { 3, 3, SYMM_ROT2, DIFF_RECURSIVE, DIFF_KMINMAX, false, false } },
315 { "3x3 Killer", { 3, 3, SYMM_NONE, DIFF_BLOCK, DIFF_KINTERSECT, FALSE, TRUE } }, 315 { "3x3 Killer", { 3, 3, SYMM_NONE, DIFF_BLOCK, DIFF_KINTERSECT, false, true } },
316 { "9 Jigsaw Basic", { 9, 1, SYMM_ROT2, DIFF_SIMPLE, DIFF_KMINMAX, FALSE, FALSE } }, 316 { "9 Jigsaw Basic", { 9, 1, SYMM_ROT2, DIFF_SIMPLE, DIFF_KMINMAX, false, false } },
317 { "9 Jigsaw Basic X", { 9, 1, SYMM_ROT2, DIFF_SIMPLE, DIFF_KMINMAX, TRUE } }, 317 { "9 Jigsaw Basic X", { 9, 1, SYMM_ROT2, DIFF_SIMPLE, DIFF_KMINMAX, true } },
318 { "9 Jigsaw Advanced", { 9, 1, SYMM_ROT2, DIFF_SET, DIFF_KMINMAX, FALSE, FALSE } }, 318 { "9 Jigsaw Advanced", { 9, 1, SYMM_ROT2, DIFF_SET, DIFF_KMINMAX, false, false } },
319#ifndef SLOW_SYSTEM 319#ifndef SLOW_SYSTEM
320 { "3x4 Basic", { 3, 4, SYMM_ROT2, DIFF_SIMPLE, DIFF_KMINMAX, FALSE, FALSE } }, 320 { "3x4 Basic", { 3, 4, SYMM_ROT2, DIFF_SIMPLE, DIFF_KMINMAX, false, false } },
321 { "4x4 Basic", { 4, 4, SYMM_ROT2, DIFF_SIMPLE, DIFF_KMINMAX, FALSE, FALSE } }, 321 { "4x4 Basic", { 4, 4, SYMM_ROT2, DIFF_SIMPLE, DIFF_KMINMAX, false, false } },
322#endif 322#endif
323 }; 323 };
324 324
325 if (i < 0 || i >= lenof(presets)) 325 if (i < 0 || i >= lenof(presets))
326 return FALSE; 326 return false;
327 327
328 *name = dupstr(presets[i].title); 328 *name = dupstr(presets[i].title);
329 *params = dup_params(&presets[i].params); 329 *params = dup_params(&presets[i].params);
330 330
331 return TRUE; 331 return true;
332} 332}
333 333
334static void decode_params(game_params *ret, char const *string) 334static void decode_params(game_params *ret, char const *string)
335{ 335{
336 int seen_r = FALSE; 336 bool seen_r = false;
337 337
338 ret->c = ret->r = atoi(string); 338 ret->c = ret->r = atoi(string);
339 ret->xtype = FALSE; 339 ret->xtype = false;
340 ret->killer = FALSE; 340 ret->killer = false;
341 while (*string && isdigit((unsigned char)*string)) string++; 341 while (*string && isdigit((unsigned char)*string)) string++;
342 if (*string == 'x') { 342 if (*string == 'x') {
343 string++; 343 string++;
344 ret->r = atoi(string); 344 ret->r = atoi(string);
345 seen_r = TRUE; 345 seen_r = true;
346 while (*string && isdigit((unsigned char)*string)) string++; 346 while (*string && isdigit((unsigned char)*string)) string++;
347 } 347 }
348 while (*string) { 348 while (*string) {
@@ -353,18 +353,19 @@ static void decode_params(game_params *ret, char const *string)
353 ret->r = 1; 353 ret->r = 1;
354 } else if (*string == 'x') { 354 } else if (*string == 'x') {
355 string++; 355 string++;
356 ret->xtype = TRUE; 356 ret->xtype = true;
357 } else if (*string == 'k') { 357 } else if (*string == 'k') {
358 string++; 358 string++;
359 ret->killer = TRUE; 359 ret->killer = true;
360 } else if (*string == 'r' || *string == 'm' || *string == 'a') { 360 } else if (*string == 'r' || *string == 'm' || *string == 'a') {
361 int sn, sc, sd; 361 int sn, sc;
362 bool sd;
362 sc = *string++; 363 sc = *string++;
363 if (sc == 'm' && *string == 'd') { 364 if (sc == 'm' && *string == 'd') {
364 sd = TRUE; 365 sd = true;
365 string++; 366 string++;
366 } else { 367 } else {
367 sd = FALSE; 368 sd = false;
368 } 369 }
369 sn = atoi(string); 370 sn = atoi(string);
370 while (*string && isdigit((unsigned char)*string)) string++; 371 while (*string && isdigit((unsigned char)*string)) string++;
@@ -399,7 +400,7 @@ static void decode_params(game_params *ret, char const *string)
399 } 400 }
400} 401}
401 402
402static char *encode_params(const game_params *params, int full) 403static char *encode_params(const game_params *params, bool full)
403{ 404{
404 char str[80]; 405 char str[80];
405 406
@@ -501,7 +502,7 @@ static game_params *custom_params(const config_item *cfg)
501 return ret; 502 return ret;
502} 503}
503 504
504static const char *validate_params(const game_params *params, int full) 505static const char *validate_params(const game_params *params, bool full)
505{ 506{
506 if (params->c < 2) 507 if (params->c < 2)
507 return "Both dimensions must be at least 2"; 508 return "Both dimensions must be at least 2";
@@ -708,13 +709,13 @@ struct solver_usage {
708 struct block_structure *blocks, *kblocks, *extra_cages; 709 struct block_structure *blocks, *kblocks, *extra_cages;
709 /* 710 /*
710 * We set up a cubic array, indexed by x, y and digit; each 711 * We set up a cubic array, indexed by x, y and digit; each
711 * element of this array is TRUE or FALSE according to whether 712 * element of this array is true or false according to whether
712 * or not that digit _could_ in principle go in that position. 713 * or not that digit _could_ in principle go in that position.
713 * 714 *
714 * The way to index this array is cube[(y*cr+x)*cr+n-1]; there 715 * The way to index this array is cube[(y*cr+x)*cr+n-1]; there
715 * are macros below to help with this. 716 * are macros below to help with this.
716 */ 717 */
717 unsigned char *cube; 718 bool *cube;
718 /* 719 /*
719 * This is the grid in which we write down our final 720 * This is the grid in which we write down our final
720 * deductions. y-coordinates in here are _not_ transformed. 721 * deductions. y-coordinates in here are _not_ transformed.
@@ -730,14 +731,14 @@ struct solver_usage {
730 * have yet to work out, to prevent doing the same deduction 731 * have yet to work out, to prevent doing the same deduction
731 * many times. 732 * many times.
732 */ 733 */
733 /* row[y*cr+n-1] TRUE if digit n has been placed in row y */ 734 /* row[y*cr+n-1] true if digit n has been placed in row y */
734 unsigned char *row; 735 bool *row;
735 /* col[x*cr+n-1] TRUE if digit n has been placed in row x */ 736 /* col[x*cr+n-1] true if digit n has been placed in row x */
736 unsigned char *col; 737 bool *col;
737 /* blk[i*cr+n-1] TRUE if digit n has been placed in block i */ 738 /* blk[i*cr+n-1] true if digit n has been placed in block i */
738 unsigned char *blk; 739 bool *blk;
739 /* diag[i*cr+n-1] TRUE if digit n has been placed in diagonal i */ 740 /* diag[i*cr+n-1] true if digit n has been placed in diagonal i */
740 unsigned char *diag; /* diag 0 is \, 1 is / */ 741 bool *diag; /* diag 0 is \, 1 is / */
741 742
742 int *regions; 743 int *regions;
743 int nr_regions; 744 int nr_regions;
@@ -771,21 +772,21 @@ static void solver_place(struct solver_usage *usage, int x, int y, int n)
771 */ 772 */
772 for (i = 1; i <= cr; i++) 773 for (i = 1; i <= cr; i++)
773 if (i != n) 774 if (i != n)
774 cube(x,y,i) = FALSE; 775 cube(x,y,i) = false;
775 776
776 /* 777 /*
777 * Rule out this number in all other positions in the row. 778 * Rule out this number in all other positions in the row.
778 */ 779 */
779 for (i = 0; i < cr; i++) 780 for (i = 0; i < cr; i++)
780 if (i != y) 781 if (i != y)
781 cube(x,i,n) = FALSE; 782 cube(x,i,n) = false;
782 783
783 /* 784 /*
784 * Rule out this number in all other positions in the column. 785 * Rule out this number in all other positions in the column.
785 */ 786 */
786 for (i = 0; i < cr; i++) 787 for (i = 0; i < cr; i++)
787 if (i != x) 788 if (i != x)
788 cube(i,y,n) = FALSE; 789 cube(i,y,n) = false;
789 790
790 /* 791 /*
791 * Rule out this number in all other positions in the block. 792 * Rule out this number in all other positions in the block.
@@ -794,7 +795,7 @@ static void solver_place(struct solver_usage *usage, int x, int y, int n)
794 for (i = 0; i < cr; i++) { 795 for (i = 0; i < cr; i++) {
795 int bp = usage->blocks->blocks[bi][i]; 796 int bp = usage->blocks->blocks[bi][i];
796 if (bp != sqindex) 797 if (bp != sqindex)
797 cube2(bp,n) = FALSE; 798 cube2(bp,n) = false;
798 } 799 }
799 800
800 /* 801 /*
@@ -807,20 +808,20 @@ static void solver_place(struct solver_usage *usage, int x, int y, int n)
807 * in its row, its column and its block. 808 * in its row, its column and its block.
808 */ 809 */
809 usage->row[y*cr+n-1] = usage->col[x*cr+n-1] = 810 usage->row[y*cr+n-1] = usage->col[x*cr+n-1] =
810 usage->blk[bi*cr+n-1] = TRUE; 811 usage->blk[bi*cr+n-1] = true;
811 812
812 if (usage->diag) { 813 if (usage->diag) {
813 if (ondiag0(sqindex)) { 814 if (ondiag0(sqindex)) {
814 for (i = 0; i < cr; i++) 815 for (i = 0; i < cr; i++)
815 if (diag0(i) != sqindex) 816 if (diag0(i) != sqindex)
816 cube2(diag0(i),n) = FALSE; 817 cube2(diag0(i),n) = false;
817 usage->diag[n-1] = TRUE; 818 usage->diag[n-1] = true;
818 } 819 }
819 if (ondiag1(sqindex)) { 820 if (ondiag1(sqindex)) {
820 for (i = 0; i < cr; i++) 821 for (i = 0; i < cr; i++)
821 if (diag1(i) != sqindex) 822 if (diag1(i) != sqindex)
822 cube2(diag1(i),n) = FALSE; 823 cube2(diag1(i),n) = false;
823 usage->diag[cr+n-1] = TRUE; 824 usage->diag[cr+n-1] = true;
824 } 825 }
825 } 826 }
826} 827}
@@ -968,7 +969,7 @@ static int solver_intersect(struct solver_usage *usage,
968 } 969 }
969#endif 970#endif
970 ret = +1; /* we did something */ 971 ret = +1; /* we did something */
971 usage->cube[p] = 0; 972 usage->cube[p] = false;
972 } 973 }
973 } 974 }
974 975
@@ -1005,8 +1006,8 @@ static int solver_set(struct solver_usage *usage,
1005 * any row with a solitary 1 - and discarding that row and the 1006 * any row with a solitary 1 - and discarding that row and the
1006 * column containing the 1. 1007 * column containing the 1.
1007 */ 1008 */
1008 memset(rowidx, TRUE, cr); 1009 memset(rowidx, 1, cr);
1009 memset(colidx, TRUE, cr); 1010 memset(colidx, 1, cr);
1010 for (i = 0; i < cr; i++) { 1011 for (i = 0; i < cr; i++) {
1011 int count = 0, first = -1; 1012 int count = 0, first = -1;
1012 for (j = 0; j < cr; j++) 1013 for (j = 0; j < cr; j++)
@@ -1033,7 +1034,7 @@ static int solver_set(struct solver_usage *usage,
1033 return -1; 1034 return -1;
1034 } 1035 }
1035 if (count == 1) 1036 if (count == 1)
1036 rowidx[i] = colidx[first] = FALSE; 1037 rowidx[i] = colidx[first] = 0;
1037 } 1038 }
1038 1039
1039 /* 1040 /*
@@ -1079,10 +1080,10 @@ static int solver_set(struct solver_usage *usage,
1079 */ 1080 */
1080 int rows = 0; 1081 int rows = 0;
1081 for (i = 0; i < n; i++) { 1082 for (i = 0; i < n; i++) {
1082 int ok = TRUE; 1083 bool ok = true;
1083 for (j = 0; j < n; j++) 1084 for (j = 0; j < n; j++)
1084 if (set[j] && grid[i*cr+j]) { 1085 if (set[j] && grid[i*cr+j]) {
1085 ok = FALSE; 1086 ok = false;
1086 break; 1087 break;
1087 } 1088 }
1088 if (ok) 1089 if (ok)
@@ -1114,7 +1115,7 @@ static int solver_set(struct solver_usage *usage,
1114 } 1115 }
1115 1116
1116 if (rows >= n - count) { 1117 if (rows >= n - count) {
1117 int progress = FALSE; 1118 bool progress = false;
1118 1119
1119 /* 1120 /*
1120 * We've got one! Now, for each row which _doesn't_ 1121 * We've got one! Now, for each row which _doesn't_
@@ -1128,10 +1129,10 @@ static int solver_set(struct solver_usage *usage,
1128 * positions in the cube to meddle with. 1129 * positions in the cube to meddle with.
1129 */ 1130 */
1130 for (i = 0; i < n; i++) { 1131 for (i = 0; i < n; i++) {
1131 int ok = TRUE; 1132 bool ok = true;
1132 for (j = 0; j < n; j++) 1133 for (j = 0; j < n; j++)
1133 if (set[j] && grid[i*cr+j]) { 1134 if (set[j] && grid[i*cr+j]) {
1134 ok = FALSE; 1135 ok = false;
1135 break; 1136 break;
1136 } 1137 }
1137 if (!ok) { 1138 if (!ok) {
@@ -1162,8 +1163,8 @@ static int solver_set(struct solver_usage *usage,
1162 pn, 1+px, 1+py); 1163 pn, 1+px, 1+py);
1163 } 1164 }
1164#endif 1165#endif
1165 progress = TRUE; 1166 progress = true;
1166 usage->cube[fpos] = FALSE; 1167 usage->cube[fpos] = false;
1167 } 1168 }
1168 } 1169 }
1169 } 1170 }
@@ -1386,7 +1387,7 @@ static int solver_forcing(struct solver_usage *usage,
1386 orign, 1+xt, 1+yt); 1387 orign, 1+xt, 1+yt);
1387 } 1388 }
1388#endif 1389#endif
1389 cube(xt, yt, orign) = FALSE; 1390 cube(xt, yt, orign) = false;
1390 return 1; 1391 return 1;
1391 } 1392 }
1392 } 1393 }
@@ -1437,7 +1438,7 @@ static int solver_killer_minmax(struct solver_usage *usage,
1437 } 1438 }
1438 } 1439 }
1439 if (maxval + n < clues[b]) { 1440 if (maxval + n < clues[b]) {
1440 cube2(x, n) = FALSE; 1441 cube2(x, n) = false;
1441 ret = 1; 1442 ret = 1;
1442#ifdef STANDALONE_SOLVER 1443#ifdef STANDALONE_SOLVER
1443 if (solver_show_working) 1444 if (solver_show_working)
@@ -1447,7 +1448,7 @@ static int solver_killer_minmax(struct solver_usage *usage,
1447#endif 1448#endif
1448 } 1449 }
1449 if (minval + n > clues[b]) { 1450 if (minval + n > clues[b]) {
1450 cube2(x, n) = FALSE; 1451 cube2(x, n) = false;
1451 ret = 1; 1452 ret = 1;
1452#ifdef STANDALONE_SOLVER 1453#ifdef STANDALONE_SOLVER
1453 if (solver_show_working) 1454 if (solver_show_working)
@@ -1463,7 +1464,7 @@ static int solver_killer_minmax(struct solver_usage *usage,
1463 1464
1464static int solver_killer_sums(struct solver_usage *usage, int b, 1465static int solver_killer_sums(struct solver_usage *usage, int b,
1465 struct block_structure *cages, int clue, 1466 struct block_structure *cages, int clue,
1466 int cage_is_region 1467 bool cage_is_region
1467#ifdef STANDALONE_SOLVER 1468#ifdef STANDALONE_SOLVER
1468 , const char *cage_type 1469 , const char *cage_type
1469#endif 1470#endif
@@ -1580,7 +1581,7 @@ static int solver_killer_sums(struct solver_usage *usage, int b,
1580 if (!cube2(x, n)) 1581 if (!cube2(x, n))
1581 continue; 1582 continue;
1582 if ((possible_addends & (1 << n)) == 0) { 1583 if ((possible_addends & (1 << n)) == 0) {
1583 cube2(x, n) = FALSE; 1584 cube2(x, n) = false;
1584 ret = 1; 1585 ret = 1;
1585#ifdef STANDALONE_SOLVER 1586#ifdef STANDALONE_SOLVER
1586 if (solver_show_working) { 1587 if (solver_show_working) {
@@ -1700,7 +1701,7 @@ struct difficulty {
1700}; 1701};
1701 1702
1702static void solver(int cr, struct block_structure *blocks, 1703static void solver(int cr, struct block_structure *blocks,
1703 struct block_structure *kblocks, int xtype, 1704 struct block_structure *kblocks, bool xtype,
1704 digit *grid, digit *kgrid, struct difficulty *dlev) 1705 digit *grid, digit *kgrid, struct difficulty *dlev)
1705{ 1706{
1706 struct solver_usage *usage; 1707 struct solver_usage *usage;
@@ -1725,7 +1726,7 @@ static void solver(int cr, struct block_structure *blocks,
1725 usage->kblocks = usage->extra_cages = NULL; 1726 usage->kblocks = usage->extra_cages = NULL;
1726 usage->extra_clues = NULL; 1727 usage->extra_clues = NULL;
1727 } 1728 }
1728 usage->cube = snewn(cr*cr*cr, unsigned char); 1729 usage->cube = snewn(cr*cr*cr, bool);
1729 usage->grid = grid; /* write straight back to the input */ 1730 usage->grid = grid; /* write straight back to the input */
1730 if (kgrid) { 1731 if (kgrid) {
1731 int nclues; 1732 int nclues;
@@ -1748,18 +1749,19 @@ static void solver(int cr, struct block_structure *blocks,
1748 usage->kclues = NULL; 1749 usage->kclues = NULL;
1749 } 1750 }
1750 1751
1751 memset(usage->cube, TRUE, cr*cr*cr); 1752 for (i = 0; i < cr*cr*cr; i++)
1753 usage->cube[i] = true;
1752 1754
1753 usage->row = snewn(cr * cr, unsigned char); 1755 usage->row = snewn(cr * cr, bool);
1754 usage->col = snewn(cr * cr, unsigned char); 1756 usage->col = snewn(cr * cr, bool);
1755 usage->blk = snewn(cr * cr, unsigned char); 1757 usage->blk = snewn(cr * cr, bool);
1756 memset(usage->row, FALSE, cr * cr); 1758 memset(usage->row, 0, cr * cr * sizeof(bool));
1757 memset(usage->col, FALSE, cr * cr); 1759 memset(usage->col, 0, cr * cr * sizeof(bool));
1758 memset(usage->blk, FALSE, cr * cr); 1760 memset(usage->blk, 0, cr * cr * sizeof(bool));
1759 1761
1760 if (xtype) { 1762 if (xtype) {
1761 usage->diag = snewn(cr * 2, unsigned char); 1763 usage->diag = snewn(cr * 2, bool);
1762 memset(usage->diag, FALSE, cr * 2); 1764 memset(usage->diag, 0, cr * 2 * sizeof(bool));
1763 } else 1765 } else
1764 usage->diag = NULL; 1766 usage->diag = NULL;
1765 1767
@@ -1840,7 +1842,7 @@ static void solver(int cr, struct block_structure *blocks,
1840 } 1842 }
1841 1843
1842 if (usage->kclues != NULL) { 1844 if (usage->kclues != NULL) {
1843 int changed = FALSE; 1845 bool changed = false;
1844 1846
1845 /* 1847 /*
1846 * First, bring the kblocks into a more useful form: remove 1848 * First, bring the kblocks into a more useful form: remove
@@ -1866,7 +1868,7 @@ static void solver(int cr, struct block_structure *blocks,
1866 * about the other squares in the cage. 1868 * about the other squares in the cage.
1867 */ 1869 */
1868 for (n = 0; n < usage->kblocks->nr_squares[b]; n++) { 1870 for (n = 0; n < usage->kblocks->nr_squares[b]; n++) {
1869 cube2(usage->kblocks->blocks[b][n], t) = FALSE; 1871 cube2(usage->kblocks->blocks[b][n], t) = false;
1870 } 1872 }
1871 } 1873 }
1872 1874
@@ -1897,7 +1899,7 @@ static void solver(int cr, struct block_structure *blocks,
1897 v, 1 + x%cr, 1 + x/cr); 1899 v, 1 + x%cr, 1 + x/cr);
1898 } 1900 }
1899#endif 1901#endif
1900 changed = TRUE; 1902 changed = true;
1901 } 1903 }
1902 } 1904 }
1903 1905
@@ -1907,7 +1909,7 @@ static void solver(int cr, struct block_structure *blocks,
1907 } 1909 }
1908 } 1910 }
1909 if (dlev->maxkdiff >= DIFF_KINTERSECT && usage->kclues != NULL) { 1911 if (dlev->maxkdiff >= DIFF_KINTERSECT && usage->kclues != NULL) {
1910 int changed = FALSE; 1912 bool changed = false;
1911 /* 1913 /*
1912 * Now, create the extra_cages information. Every full region 1914 * Now, create the extra_cages information. Every full region
1913 * (row, column, or block) has the same sum total (45 for 3x3 1915 * (row, column, or block) has the same sum total (45 for 3x3
@@ -1952,7 +1954,7 @@ static void solver(int cr, struct block_structure *blocks,
1952 goto got_result; 1954 goto got_result;
1953 } 1955 }
1954 solver_place(usage, x, y, sum); 1956 solver_place(usage, x, y, sum);
1955 changed = TRUE; 1957 changed = true;
1956#ifdef STANDALONE_SOLVER 1958#ifdef STANDALONE_SOLVER
1957 if (solver_show_working) { 1959 if (solver_show_working) {
1958 printf("%*s placing %d at (%d,%d)\n", 1960 printf("%*s placing %d at (%d,%d)\n",
@@ -1996,7 +1998,7 @@ static void solver(int cr, struct block_structure *blocks,
1996 * implement it for a higher difficulty level. 1998 * implement it for a higher difficulty level.
1997 */ 1999 */
1998 if (dlev->maxkdiff >= DIFF_KMINMAX && usage->kclues != NULL) { 2000 if (dlev->maxkdiff >= DIFF_KMINMAX && usage->kclues != NULL) {
1999 int changed = FALSE; 2001 bool changed = false;
2000 for (b = 0; b < usage->kblocks->nr_blocks; b++) { 2002 for (b = 0; b < usage->kblocks->nr_blocks; b++) {
2001 int ret = solver_killer_minmax(usage, usage->kblocks, 2003 int ret = solver_killer_minmax(usage, usage->kblocks,
2002 usage->kclues, b 2004 usage->kclues, b
@@ -2008,7 +2010,7 @@ static void solver(int cr, struct block_structure *blocks,
2008 diff = DIFF_IMPOSSIBLE; 2010 diff = DIFF_IMPOSSIBLE;
2009 goto got_result; 2011 goto got_result;
2010 } else if (ret > 0) 2012 } else if (ret > 0)
2011 changed = TRUE; 2013 changed = true;
2012 } 2014 }
2013 for (b = 0; b < usage->extra_cages->nr_blocks; b++) { 2015 for (b = 0; b < usage->extra_cages->nr_blocks; b++) {
2014 int ret = solver_killer_minmax(usage, usage->extra_cages, 2016 int ret = solver_killer_minmax(usage, usage->extra_cages,
@@ -2021,7 +2023,7 @@ static void solver(int cr, struct block_structure *blocks,
2021 diff = DIFF_IMPOSSIBLE; 2023 diff = DIFF_IMPOSSIBLE;
2022 goto got_result; 2024 goto got_result;
2023 } else if (ret > 0) 2025 } else if (ret > 0)
2024 changed = TRUE; 2026 changed = true;
2025 } 2027 }
2026 if (changed) { 2028 if (changed) {
2027 kdiff = max(kdiff, DIFF_KMINMAX); 2029 kdiff = max(kdiff, DIFF_KMINMAX);
@@ -2035,17 +2037,17 @@ static void solver(int cr, struct block_structure *blocks,
2035 * This can only be used if a cage lies entirely within a region. 2037 * This can only be used if a cage lies entirely within a region.
2036 */ 2038 */
2037 if (dlev->maxkdiff >= DIFF_KSUMS && usage->kclues != NULL) { 2039 if (dlev->maxkdiff >= DIFF_KSUMS && usage->kclues != NULL) {
2038 int changed = FALSE; 2040 bool changed = false;
2039 2041
2040 for (b = 0; b < usage->kblocks->nr_blocks; b++) { 2042 for (b = 0; b < usage->kblocks->nr_blocks; b++) {
2041 int ret = solver_killer_sums(usage, b, usage->kblocks, 2043 int ret = solver_killer_sums(usage, b, usage->kblocks,
2042 usage->kclues[b], TRUE 2044 usage->kclues[b], true
2043#ifdef STANDALONE_SOLVER 2045#ifdef STANDALONE_SOLVER
2044 , "regular clues" 2046 , "regular clues"
2045#endif 2047#endif
2046 ); 2048 );
2047 if (ret > 0) { 2049 if (ret > 0) {
2048 changed = TRUE; 2050 changed = true;
2049 kdiff = max(kdiff, DIFF_KSUMS); 2051 kdiff = max(kdiff, DIFF_KSUMS);
2050 } else if (ret < 0) { 2052 } else if (ret < 0) {
2051 diff = DIFF_IMPOSSIBLE; 2053 diff = DIFF_IMPOSSIBLE;
@@ -2055,13 +2057,13 @@ static void solver(int cr, struct block_structure *blocks,
2055 2057
2056 for (b = 0; b < usage->extra_cages->nr_blocks; b++) { 2058 for (b = 0; b < usage->extra_cages->nr_blocks; b++) {
2057 int ret = solver_killer_sums(usage, b, usage->extra_cages, 2059 int ret = solver_killer_sums(usage, b, usage->extra_cages,
2058 usage->extra_clues[b], FALSE 2060 usage->extra_clues[b], false
2059#ifdef STANDALONE_SOLVER 2061#ifdef STANDALONE_SOLVER
2060 , "deduced clues" 2062 , "deduced clues"
2061#endif 2063#endif
2062 ); 2064 );
2063 if (ret > 0) { 2065 if (ret > 0) {
2064 changed = TRUE; 2066 changed = true;
2065 kdiff = max(kdiff, DIFF_KSUMS); 2067 kdiff = max(kdiff, DIFF_KSUMS);
2066 } else if (ret < 0) { 2068 } else if (ret < 0) {
2067 diff = DIFF_IMPOSSIBLE; 2069 diff = DIFF_IMPOSSIBLE;
@@ -2754,10 +2756,11 @@ static void gridgen_remove(struct gridgen_usage *usage, int x, int y, digit n)
2754 * Return values: 1 means solution found, 0 means no solution 2756 * Return values: 1 means solution found, 0 means no solution
2755 * found on this branch. 2757 * found on this branch.
2756 */ 2758 */
2757static int gridgen_real(struct gridgen_usage *usage, digit *grid, int *steps) 2759static bool gridgen_real(struct gridgen_usage *usage, digit *grid, int *steps)
2758{ 2760{
2759 int cr = usage->cr; 2761 int cr = usage->cr;
2760 int i, j, n, sx, sy, bestm, bestr, ret; 2762 int i, j, n, sx, sy, bestm, bestr;
2763 bool ret;
2761 int *digits; 2764 int *digits;
2762 unsigned int used; 2765 unsigned int used;
2763 2766
@@ -2766,13 +2769,13 @@ static int gridgen_real(struct gridgen_usage *usage, digit *grid, int *steps)
2766 * in the grid, we have a solution. 2769 * in the grid, we have a solution.
2767 */ 2770 */
2768 if (usage->nspaces == 0) 2771 if (usage->nspaces == 0)
2769 return TRUE; 2772 return true;
2770 2773
2771 /* 2774 /*
2772 * Next, abandon generation if we went over our steps limit. 2775 * Next, abandon generation if we went over our steps limit.
2773 */ 2776 */
2774 if (*steps <= 0) 2777 if (*steps <= 0)
2775 return FALSE; 2778 return false;
2776 (*steps)--; 2779 (*steps)--;
2777 2780
2778 /* 2781 /*
@@ -2850,7 +2853,7 @@ static int gridgen_real(struct gridgen_usage *usage, digit *grid, int *steps)
2850 shuffle(digits, j, sizeof(*digits), usage->rs); 2853 shuffle(digits, j, sizeof(*digits), usage->rs);
2851 2854
2852 /* And finally, go through the digit list and actually recurse. */ 2855 /* And finally, go through the digit list and actually recurse. */
2853 ret = FALSE; 2856 ret = false;
2854 for (i = 0; i < j; i++) { 2857 for (i = 0; i < j; i++) {
2855 n = digits[i]; 2858 n = digits[i];
2856 2859
@@ -2860,7 +2863,7 @@ static int gridgen_real(struct gridgen_usage *usage, digit *grid, int *steps)
2860 2863
2861 /* Call the solver recursively. Stop when we find a solution. */ 2864 /* Call the solver recursively. Stop when we find a solution. */
2862 if (gridgen_real(usage, grid, steps)) { 2865 if (gridgen_real(usage, grid, steps)) {
2863 ret = TRUE; 2866 ret = true;
2864 break; 2867 break;
2865 } 2868 }
2866 2869
@@ -2877,12 +2880,13 @@ static int gridgen_real(struct gridgen_usage *usage, digit *grid, int *steps)
2877 * Entry point to generator. You give it parameters and a starting 2880 * Entry point to generator. You give it parameters and a starting
2878 * grid, which is simply an array of cr*cr digits. 2881 * grid, which is simply an array of cr*cr digits.
2879 */ 2882 */
2880static int gridgen(int cr, struct block_structure *blocks, 2883static bool gridgen(int cr, struct block_structure *blocks,
2881 struct block_structure *kblocks, int xtype, 2884 struct block_structure *kblocks, bool xtype,
2882 digit *grid, random_state *rs, int maxsteps) 2885 digit *grid, random_state *rs, int maxsteps)
2883{ 2886{
2884 struct gridgen_usage *usage; 2887 struct gridgen_usage *usage;
2885 int x, y, ret; 2888 int x, y;
2889 bool ret;
2886 2890
2887 /* 2891 /*
2888 * Clear the grid to start with. 2892 * Clear the grid to start with.
@@ -2905,7 +2909,7 @@ static int gridgen(int cr, struct block_structure *blocks,
2905 if (kblocks != NULL) { 2909 if (kblocks != NULL) {
2906 usage->kblocks = kblocks; 2910 usage->kblocks = kblocks;
2907 usage->cge = snewn(usage->kblocks->nr_blocks, unsigned int); 2911 usage->cge = snewn(usage->kblocks->nr_blocks, unsigned int);
2908 memset(usage->cge, FALSE, kblocks->nr_blocks * sizeof *usage->cge); 2912 memset(usage->cge, 0, kblocks->nr_blocks * sizeof *usage->cge);
2909 } else { 2913 } else {
2910 usage->cge = NULL; 2914 usage->cge = NULL;
2911 } 2915 }
@@ -3011,27 +3015,27 @@ static int check_killer_cage_sum(struct block_structure *kblocks,
3011/* 3015/*
3012 * Check whether a grid contains a valid complete puzzle. 3016 * Check whether a grid contains a valid complete puzzle.
3013 */ 3017 */
3014static int check_valid(int cr, struct block_structure *blocks, 3018static bool check_valid(int cr, struct block_structure *blocks,
3015 struct block_structure *kblocks, 3019 struct block_structure *kblocks,
3016 digit *kgrid, int xtype, digit *grid) 3020 digit *kgrid, bool xtype, digit *grid)
3017{ 3021{
3018 unsigned char *used; 3022 bool *used;
3019 int x, y, i, j, n; 3023 int x, y, i, j, n;
3020 3024
3021 used = snewn(cr, unsigned char); 3025 used = snewn(cr, bool);
3022 3026
3023 /* 3027 /*
3024 * Check that each row contains precisely one of everything. 3028 * Check that each row contains precisely one of everything.
3025 */ 3029 */
3026 for (y = 0; y < cr; y++) { 3030 for (y = 0; y < cr; y++) {
3027 memset(used, FALSE, cr); 3031 memset(used, 0, cr * sizeof(bool));
3028 for (x = 0; x < cr; x++) 3032 for (x = 0; x < cr; x++)
3029 if (grid[y*cr+x] > 0 && grid[y*cr+x] <= cr) 3033 if (grid[y*cr+x] > 0 && grid[y*cr+x] <= cr)
3030 used[grid[y*cr+x]-1] = TRUE; 3034 used[grid[y*cr+x]-1] = true;
3031 for (n = 0; n < cr; n++) 3035 for (n = 0; n < cr; n++)
3032 if (!used[n]) { 3036 if (!used[n]) {
3033 sfree(used); 3037 sfree(used);
3034 return FALSE; 3038 return false;
3035 } 3039 }
3036 } 3040 }
3037 3041
@@ -3039,14 +3043,14 @@ static int check_valid(int cr, struct block_structure *blocks,
3039 * Check that each column contains precisely one of everything. 3043 * Check that each column contains precisely one of everything.
3040 */ 3044 */
3041 for (x = 0; x < cr; x++) { 3045 for (x = 0; x < cr; x++) {
3042 memset(used, FALSE, cr); 3046 memset(used, 0, cr * sizeof(bool));
3043 for (y = 0; y < cr; y++) 3047 for (y = 0; y < cr; y++)
3044 if (grid[y*cr+x] > 0 && grid[y*cr+x] <= cr) 3048 if (grid[y*cr+x] > 0 && grid[y*cr+x] <= cr)
3045 used[grid[y*cr+x]-1] = TRUE; 3049 used[grid[y*cr+x]-1] = true;
3046 for (n = 0; n < cr; n++) 3050 for (n = 0; n < cr; n++)
3047 if (!used[n]) { 3051 if (!used[n]) {
3048 sfree(used); 3052 sfree(used);
3049 return FALSE; 3053 return false;
3050 } 3054 }
3051 } 3055 }
3052 3056
@@ -3054,15 +3058,15 @@ static int check_valid(int cr, struct block_structure *blocks,
3054 * Check that each block contains precisely one of everything. 3058 * Check that each block contains precisely one of everything.
3055 */ 3059 */
3056 for (i = 0; i < cr; i++) { 3060 for (i = 0; i < cr; i++) {
3057 memset(used, FALSE, cr); 3061 memset(used, 0, cr * sizeof(bool));
3058 for (j = 0; j < cr; j++) 3062 for (j = 0; j < cr; j++)
3059 if (grid[blocks->blocks[i][j]] > 0 && 3063 if (grid[blocks->blocks[i][j]] > 0 &&
3060 grid[blocks->blocks[i][j]] <= cr) 3064 grid[blocks->blocks[i][j]] <= cr)
3061 used[grid[blocks->blocks[i][j]]-1] = TRUE; 3065 used[grid[blocks->blocks[i][j]]-1] = true;
3062 for (n = 0; n < cr; n++) 3066 for (n = 0; n < cr; n++)
3063 if (!used[n]) { 3067 if (!used[n]) {
3064 sfree(used); 3068 sfree(used);
3065 return FALSE; 3069 return false;
3066 } 3070 }
3067 } 3071 }
3068 3072
@@ -3074,20 +3078,20 @@ static int check_valid(int cr, struct block_structure *blocks,
3074 */ 3078 */
3075 if (kblocks) { 3079 if (kblocks) {
3076 for (i = 0; i < kblocks->nr_blocks; i++) { 3080 for (i = 0; i < kblocks->nr_blocks; i++) {
3077 memset(used, FALSE, cr); 3081 memset(used, 0, cr * sizeof(bool));
3078 for (j = 0; j < kblocks->nr_squares[i]; j++) 3082 for (j = 0; j < kblocks->nr_squares[i]; j++)
3079 if (grid[kblocks->blocks[i][j]] > 0 && 3083 if (grid[kblocks->blocks[i][j]] > 0 &&
3080 grid[kblocks->blocks[i][j]] <= cr) { 3084 grid[kblocks->blocks[i][j]] <= cr) {
3081 if (used[grid[kblocks->blocks[i][j]]-1]) { 3085 if (used[grid[kblocks->blocks[i][j]]-1]) {
3082 sfree(used); 3086 sfree(used);
3083 return FALSE; 3087 return false;
3084 } 3088 }
3085 used[grid[kblocks->blocks[i][j]]-1] = TRUE; 3089 used[grid[kblocks->blocks[i][j]]-1] = true;
3086 } 3090 }
3087 3091
3088 if (kgrid && check_killer_cage_sum(kblocks, kgrid, grid, i) != 1) { 3092 if (kgrid && check_killer_cage_sum(kblocks, kgrid, grid, i) != 1) {
3089 sfree(used); 3093 sfree(used);
3090 return FALSE; 3094 return false;
3091 } 3095 }
3092 } 3096 }
3093 } 3097 }
@@ -3096,29 +3100,29 @@ static int check_valid(int cr, struct block_structure *blocks,
3096 * Check that each diagonal contains precisely one of everything. 3100 * Check that each diagonal contains precisely one of everything.
3097 */ 3101 */
3098 if (xtype) { 3102 if (xtype) {
3099 memset(used, FALSE, cr); 3103 memset(used, 0, cr * sizeof(bool));
3100 for (i = 0; i < cr; i++) 3104 for (i = 0; i < cr; i++)
3101 if (grid[diag0(i)] > 0 && grid[diag0(i)] <= cr) 3105 if (grid[diag0(i)] > 0 && grid[diag0(i)] <= cr)
3102 used[grid[diag0(i)]-1] = TRUE; 3106 used[grid[diag0(i)]-1] = true;
3103 for (n = 0; n < cr; n++) 3107 for (n = 0; n < cr; n++)
3104 if (!used[n]) { 3108 if (!used[n]) {
3105 sfree(used); 3109 sfree(used);
3106 return FALSE; 3110 return false;
3107 } 3111 }
3108 3112
3109 memset(used, FALSE, cr); 3113 memset(used, 0, cr * sizeof(bool));
3110 for (i = 0; i < cr; i++) 3114 for (i = 0; i < cr; i++)
3111 if (grid[diag1(i)] > 0 && grid[diag1(i)] <= cr) 3115 if (grid[diag1(i)] > 0 && grid[diag1(i)] <= cr)
3112 used[grid[diag1(i)]-1] = TRUE; 3116 used[grid[diag1(i)]-1] = true;
3113 for (n = 0; n < cr; n++) 3117 for (n = 0; n < cr; n++)
3114 if (!used[n]) { 3118 if (!used[n]) {
3115 sfree(used); 3119 sfree(used);
3116 return FALSE; 3120 return false;
3117 } 3121 }
3118 } 3122 }
3119 3123
3120 sfree(used); 3124 sfree(used);
3121 return TRUE; 3125 return true;
3122} 3126}
3123 3127
3124static int symmetries(const game_params *params, int x, int y, 3128static int symmetries(const game_params *params, int x, int y,
@@ -3273,10 +3277,11 @@ static char *encode_block_structure_desc(char *p, struct block_structure *blocks
3273 * etc). 3277 * etc).
3274 */ 3278 */
3275 for (i = 0; i <= 2*cr*(cr-1); i++) { 3279 for (i = 0; i <= 2*cr*(cr-1); i++) {
3276 int x, y, p0, p1, edge; 3280 int x, y, p0, p1;
3281 bool edge;
3277 3282
3278 if (i == 2*cr*(cr-1)) { 3283 if (i == 2*cr*(cr-1)) {
3279 edge = TRUE; /* terminating virtual edge */ 3284 edge = true; /* terminating virtual edge */
3280 } else { 3285 } else {
3281 if (i < cr*(cr-1)) { 3286 if (i < cr*(cr-1)) {
3282 y = i/(cr-1); 3287 y = i/(cr-1);
@@ -3430,7 +3435,7 @@ static void merge_blocks(struct block_structure *b, int n1, int n2)
3430 b->nr_blocks = n1; 3435 b->nr_blocks = n1;
3431} 3436}
3432 3437
3433static int merge_some_cages(struct block_structure *b, int cr, int area, 3438static bool merge_some_cages(struct block_structure *b, int cr, int area,
3434 digit *grid, random_state *rs) 3439 digit *grid, random_state *rs)
3435{ 3440{
3436 /* 3441 /*
@@ -3510,11 +3515,11 @@ static int merge_some_cages(struct block_structure *b, int cr, int area,
3510 */ 3515 */
3511 merge_blocks(b, n1, n2); 3516 merge_blocks(b, n1, n2);
3512 sfree(pairs); 3517 sfree(pairs);
3513 return TRUE; 3518 return true;
3514 } 3519 }
3515 3520
3516 sfree(pairs); 3521 sfree(pairs);
3517 return FALSE; 3522 return false;
3518} 3523}
3519 3524
3520static void compute_kclues(struct block_structure *cages, digit *kclues, 3525static void compute_kclues(struct block_structure *cages, digit *kclues,
@@ -3536,7 +3541,7 @@ static void compute_kclues(struct block_structure *cages, digit *kclues,
3536} 3541}
3537 3542
3538static struct block_structure *gen_killer_cages(int cr, random_state *rs, 3543static struct block_structure *gen_killer_cages(int cr, random_state *rs,
3539 int remove_singletons) 3544 bool remove_singletons)
3540{ 3545{
3541 int nr; 3546 int nr;
3542 int x, y, area = cr * cr; 3547 int x, y, area = cr * cr;
@@ -3629,7 +3634,7 @@ static key_label *game_request_keys(const game_params *params, int *nkeys)
3629} 3634}
3630 3635
3631static char *new_game_desc(const game_params *params, random_state *rs, 3636static char *new_game_desc(const game_params *params, random_state *rs,
3632 char **aux, int interactive) 3637 char **aux, bool interactive)
3633{ 3638{
3634 int c = params->c, r = params->r, cr = c*r; 3639 int c = params->c, r = params->r, cr = c*r;
3635 int area = cr*cr; 3640 int area = cr*cr;
@@ -3908,7 +3913,8 @@ static const char *spec_to_dsf(const char **pdesc, int **pdsf,
3908 *pdsf = dsf = snew_dsf(area); 3913 *pdsf = dsf = snew_dsf(area);
3909 3914
3910 while (*desc && *desc != ',') { 3915 while (*desc && *desc != ',') {
3911 int c, adv; 3916 int c;
3917 bool adv;
3912 3918
3913 if (*desc == '_') 3919 if (*desc == '_')
3914 c = 0; 3920 c = 0;
@@ -4132,10 +4138,10 @@ static game_state *new_game(midend *me, const game_params *params,
4132 state->killer = params->killer; 4138 state->killer = params->killer;
4133 4139
4134 state->grid = snewn(area, digit); 4140 state->grid = snewn(area, digit);
4135 state->pencil = snewn(area * cr, unsigned char); 4141 state->pencil = snewn(area * cr, bool);
4136 memset(state->pencil, 0, area * cr); 4142 memset(state->pencil, 0, area * cr * sizeof(bool));
4137 state->immutable = snewn(area, unsigned char); 4143 state->immutable = snewn(area, bool);
4138 memset(state->immutable, FALSE, area); 4144 memset(state->immutable, 0, area * sizeof(bool));
4139 4145
4140 state->blocks = alloc_block_structure (c, r, area, cr, cr); 4146 state->blocks = alloc_block_structure (c, r, area, cr, cr);
4141 4147
@@ -4146,12 +4152,12 @@ static game_state *new_game(midend *me, const game_params *params,
4146 state->kblocks = NULL; 4152 state->kblocks = NULL;
4147 state->kgrid = NULL; 4153 state->kgrid = NULL;
4148 } 4154 }
4149 state->completed = state->cheated = FALSE; 4155 state->completed = state->cheated = false;
4150 4156
4151 desc = spec_to_grid(desc, state->grid, area); 4157 desc = spec_to_grid(desc, state->grid, area);
4152 for (i = 0; i < area; i++) 4158 for (i = 0; i < area; i++)
4153 if (state->grid[i] != 0) 4159 if (state->grid[i] != 0)
4154 state->immutable[i] = TRUE; 4160 state->immutable[i] = true;
4155 4161
4156 if (r == 1) { 4162 if (r == 1) {
4157 const char *err; 4163 const char *err;
@@ -4246,11 +4252,11 @@ static game_state *dup_game(const game_state *state)
4246 } else 4252 } else
4247 ret->kgrid = NULL; 4253 ret->kgrid = NULL;
4248 4254
4249 ret->pencil = snewn(area * cr, unsigned char); 4255 ret->pencil = snewn(area * cr, bool);
4250 memcpy(ret->pencil, state->pencil, area * cr); 4256 memcpy(ret->pencil, state->pencil, area * cr * sizeof(bool));
4251 4257
4252 ret->immutable = snewn(area, unsigned char); 4258 ret->immutable = snewn(area, bool);
4253 memcpy(ret->immutable, state->immutable, area); 4259 memcpy(ret->immutable, state->immutable, area * sizeof(bool));
4254 4260
4255 ret->completed = state->completed; 4261 ret->completed = state->completed;
4256 ret->cheated = state->cheated; 4262 ret->cheated = state->cheated;
@@ -4313,7 +4319,7 @@ static char *solve_game(const game_state *state, const game_state *currstate,
4313} 4319}
4314 4320
4315static char *grid_text_format(int cr, struct block_structure *blocks, 4321static char *grid_text_format(int cr, struct block_structure *blocks,
4316 int xtype, digit *grid) 4322 bool xtype, digit *grid)
4317{ 4323{
4318 int vmod, hmod; 4324 int vmod, hmod;
4319 int x, y; 4325 int x, y;
@@ -4499,7 +4505,7 @@ static char *grid_text_format(int cr, struct block_structure *blocks,
4499 return ret; 4505 return ret;
4500} 4506}
4501 4507
4502static int game_can_format_as_text_now(const game_params *params) 4508static bool game_can_format_as_text_now(const game_params *params)
4503{ 4509{
4504 /* 4510 /*
4505 * Formatting Killer puzzles as text is currently unsupported. I 4511 * Formatting Killer puzzles as text is currently unsupported. I
@@ -4508,8 +4514,8 @@ static int game_can_format_as_text_now(const game_params *params)
4508 * it unusable. 4514 * it unusable.
4509 */ 4515 */
4510 if (params->killer) 4516 if (params->killer)
4511 return FALSE; 4517 return false;
4512 return TRUE; 4518 return true;
4513} 4519}
4514 4520
4515static char *game_text_format(const game_state *state) 4521static char *game_text_format(const game_state *state)
@@ -4529,21 +4535,21 @@ struct game_ui {
4529 * This indicates whether the current highlight is a 4535 * This indicates whether the current highlight is a
4530 * pencil-mark one or a real one. 4536 * pencil-mark one or a real one.
4531 */ 4537 */
4532 int hpencil; 4538 bool hpencil;
4533 /* 4539 /*
4534 * This indicates whether or not we're showing the highlight 4540 * This indicates whether or not we're showing the highlight
4535 * (used to be hx = hy = -1); important so that when we're 4541 * (used to be hx = hy = -1); important so that when we're
4536 * using the cursor keys it doesn't keep coming back at a 4542 * using the cursor keys it doesn't keep coming back at a
4537 * fixed position. When hshow = 1, pressing a valid number 4543 * fixed position. When hshow is true, pressing a valid number
4538 * or letter key or Space will enter that number or letter in the grid. 4544 * or letter key or Space will enter that number or letter in the grid.
4539 */ 4545 */
4540 int hshow; 4546 bool hshow;
4541 /* 4547 /*
4542 * This indicates whether we're using the highlight as a cursor; 4548 * This indicates whether we're using the highlight as a cursor;
4543 * it means that it doesn't vanish on a keypress, and that it is 4549 * it means that it doesn't vanish on a keypress, and that it is
4544 * allowed on immutable squares. 4550 * allowed on immutable squares.
4545 */ 4551 */
4546 int hcursor; 4552 bool hcursor;
4547}; 4553};
4548 4554
4549static game_ui *new_ui(const game_state *state) 4555static game_ui *new_ui(const game_state *state)
@@ -4551,7 +4557,9 @@ static game_ui *new_ui(const game_state *state)
4551 game_ui *ui = snew(game_ui); 4557 game_ui *ui = snew(game_ui);
4552 4558
4553 ui->hx = ui->hy = 0; 4559 ui->hx = ui->hy = 0;
4554 ui->hpencil = ui->hshow = ui->hcursor = 0; 4560 ui->hpencil = false;
4561 ui->hshow = false;
4562 ui->hcursor = false;
4555 4563
4556 return ui; 4564 return ui;
4557} 4565}
@@ -4582,13 +4590,13 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
4582 */ 4590 */
4583 if (ui->hshow && ui->hpencil && !ui->hcursor && 4591 if (ui->hshow && ui->hpencil && !ui->hcursor &&
4584 newstate->grid[ui->hy * cr + ui->hx] != 0) { 4592 newstate->grid[ui->hy * cr + ui->hx] != 0) {
4585 ui->hshow = 0; 4593 ui->hshow = false;
4586 } 4594 }
4587} 4595}
4588 4596
4589struct game_drawstate { 4597struct game_drawstate {
4590 int started; 4598 bool started, xtype;
4591 int cr, xtype; 4599 int cr;
4592 int tilesize; 4600 int tilesize;
4593 digit *grid; 4601 digit *grid;
4594 unsigned char *pencil; 4602 unsigned char *pencil;
@@ -4613,17 +4621,17 @@ static char *interpret_move(const game_state *state, game_ui *ui,
4613 if (tx >= 0 && tx < cr && ty >= 0 && ty < cr) { 4621 if (tx >= 0 && tx < cr && ty >= 0 && ty < cr) {
4614 if (button == LEFT_BUTTON) { 4622 if (button == LEFT_BUTTON) {
4615 if (state->immutable[ty*cr+tx]) { 4623 if (state->immutable[ty*cr+tx]) {
4616 ui->hshow = 0; 4624 ui->hshow = false;
4617 } else if (tx == ui->hx && ty == ui->hy && 4625 } else if (tx == ui->hx && ty == ui->hy &&
4618 ui->hshow && ui->hpencil == 0) { 4626 ui->hshow && !ui->hpencil) {
4619 ui->hshow = 0; 4627 ui->hshow = false;
4620 } else { 4628 } else {
4621 ui->hx = tx; 4629 ui->hx = tx;
4622 ui->hy = ty; 4630 ui->hy = ty;
4623 ui->hshow = 1; 4631 ui->hshow = true;
4624 ui->hpencil = 0; 4632 ui->hpencil = false;
4625 } 4633 }
4626 ui->hcursor = 0; 4634 ui->hcursor = false;
4627 return UI_UPDATE; 4635 return UI_UPDATE;
4628 } 4636 }
4629 if (button == RIGHT_BUTTON) { 4637 if (button == RIGHT_BUTTON) {
@@ -4633,29 +4641,30 @@ static char *interpret_move(const game_state *state, game_ui *ui,
4633 if (state->grid[ty*cr+tx] == 0) { 4641 if (state->grid[ty*cr+tx] == 0) {
4634 if (tx == ui->hx && ty == ui->hy && 4642 if (tx == ui->hx && ty == ui->hy &&
4635 ui->hshow && ui->hpencil) { 4643 ui->hshow && ui->hpencil) {
4636 ui->hshow = 0; 4644 ui->hshow = false;
4637 } else { 4645 } else {
4638 ui->hpencil = 1; 4646 ui->hpencil = true;
4639 ui->hx = tx; 4647 ui->hx = tx;
4640 ui->hy = ty; 4648 ui->hy = ty;
4641 ui->hshow = 1; 4649 ui->hshow = true;
4642 } 4650 }
4643 } else { 4651 } else {
4644 ui->hshow = 0; 4652 ui->hshow = false;
4645 } 4653 }
4646 ui->hcursor = 0; 4654 ui->hcursor = false;
4647 return UI_UPDATE; 4655 return UI_UPDATE;
4648 } 4656 }
4649 } 4657 }
4650 if (IS_CURSOR_MOVE(button)) { 4658 if (IS_CURSOR_MOVE(button)) {
4651 move_cursor(button, &ui->hx, &ui->hy, cr, cr, 0); 4659 move_cursor(button, &ui->hx, &ui->hy, cr, cr, false);
4652 ui->hshow = ui->hcursor = 1; 4660 ui->hshow = true;
4661 ui->hcursor = true;
4653 return UI_UPDATE; 4662 return UI_UPDATE;
4654 } 4663 }
4655 if (ui->hshow && 4664 if (ui->hshow &&
4656 (button == CURSOR_SELECT)) { 4665 (button == CURSOR_SELECT)) {
4657 ui->hpencil = 1 - ui->hpencil; 4666 ui->hpencil = !ui->hpencil;
4658 ui->hcursor = 1; 4667 ui->hcursor = true;
4659 return UI_UPDATE; 4668 return UI_UPDATE;
4660 } 4669 }
4661 4670
@@ -4689,7 +4698,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
4689 sprintf(buf, "%c%d,%d,%d", 4698 sprintf(buf, "%c%d,%d,%d",
4690 (char)(ui->hpencil && n > 0 ? 'P' : 'R'), ui->hx, ui->hy, n); 4699 (char)(ui->hpencil && n > 0 ? 'P' : 'R'), ui->hx, ui->hy, n);
4691 4700
4692 if (!ui->hcursor) ui->hshow = 0; 4701 if (!ui->hcursor) ui->hshow = false;
4693 4702
4694 return dupstr(buf); 4703 return dupstr(buf);
4695 } 4704 }
@@ -4710,7 +4719,7 @@ static game_state *execute_move(const game_state *from, const char *move)
4710 const char *p; 4719 const char *p;
4711 4720
4712 ret = dup_game(from); 4721 ret = dup_game(from);
4713 ret->completed = ret->cheated = TRUE; 4722 ret->completed = ret->cheated = true;
4714 4723
4715 p = move+1; 4724 p = move+1;
4716 for (n = 0; n < cr*cr; n++) { 4725 for (n = 0; n < cr*cr; n++) {
@@ -4745,7 +4754,7 @@ static game_state *execute_move(const game_state *from, const char *move)
4745 if (!ret->completed && check_valid( 4754 if (!ret->completed && check_valid(
4746 cr, ret->blocks, ret->kblocks, ret->kgrid, 4755 cr, ret->blocks, ret->kblocks, ret->kgrid,
4747 ret->xtype, ret->grid)) { 4756 ret->xtype, ret->grid)) {
4748 ret->completed = TRUE; 4757 ret->completed = true;
4749 } 4758 }
4750 } 4759 }
4751 return ret; 4760 return ret;
@@ -4759,7 +4768,9 @@ static game_state *execute_move(const game_state *from, const char *move)
4759 for (y = 0; y < cr; y++) { 4768 for (y = 0; y < cr; y++) {
4760 for (x = 0; x < cr; x++) { 4769 for (x = 0; x < cr; x++) {
4761 if (!ret->grid[y*cr+x]) { 4770 if (!ret->grid[y*cr+x]) {
4762 memset(ret->pencil + (y*cr+x)*cr, 1, cr); 4771 int i;
4772 for (i = 0; i < cr; i++)
4773 ret->pencil[(y*cr+x)*cr + i] = true;
4763 } 4774 }
4764 } 4775 }
4765 } 4776 }
@@ -4839,7 +4850,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
4839 struct game_drawstate *ds = snew(struct game_drawstate); 4850 struct game_drawstate *ds = snew(struct game_drawstate);
4840 int cr = state->cr; 4851 int cr = state->cr;
4841 4852
4842 ds->started = FALSE; 4853 ds->started = false;
4843 ds->cr = cr; 4854 ds->cr = cr;
4844 ds->xtype = state->xtype; 4855 ds->xtype = state->xtype;
4845 ds->grid = snewn(cr*cr, digit); 4856 ds->grid = snewn(cr*cr, digit);
@@ -4938,7 +4949,8 @@ static void draw_number(drawing *dr, game_drawstate *ds,
4938 int t = GRIDEXTRA * 3; 4949 int t = GRIDEXTRA * 3;
4939 int kcx, kcy, kcw, kch; 4950 int kcx, kcy, kcw, kch;
4940 int kl, kt, kr, kb; 4951 int kl, kt, kr, kb;
4941 int has_left = 0, has_right = 0, has_top = 0, has_bottom = 0; 4952 bool has_left = false, has_right = false;
4953 bool has_top = false, has_bottom = false;
4942 4954
4943 /* 4955 /*
4944 * In non-jigsaw mode, the Killer cages are placed at a 4956 * In non-jigsaw mode, the Killer cages are placed at a
@@ -4971,13 +4983,13 @@ static void draw_number(drawing *dr, game_drawstate *ds,
4971 * different areas. 4983 * different areas.
4972 */ 4984 */
4973 if (x == 0 || state->kblocks->whichblock[y*cr+x] != state->kblocks->whichblock[y*cr+x-1]) 4985 if (x == 0 || state->kblocks->whichblock[y*cr+x] != state->kblocks->whichblock[y*cr+x-1])
4974 has_left = 1, kl += t; 4986 has_left = true, kl += t;
4975 if (x+1 >= cr || state->kblocks->whichblock[y*cr+x] != state->kblocks->whichblock[y*cr+x+1]) 4987 if (x+1 >= cr || state->kblocks->whichblock[y*cr+x] != state->kblocks->whichblock[y*cr+x+1])
4976 has_right = 1, kr -= t; 4988 has_right = true, kr -= t;
4977 if (y == 0 || state->kblocks->whichblock[y*cr+x] != state->kblocks->whichblock[(y-1)*cr+x]) 4989 if (y == 0 || state->kblocks->whichblock[y*cr+x] != state->kblocks->whichblock[(y-1)*cr+x])
4978 has_top = 1, kt += t; 4990 has_top = true, kt += t;
4979 if (y+1 >= cr || state->kblocks->whichblock[y*cr+x] != state->kblocks->whichblock[(y+1)*cr+x]) 4991 if (y+1 >= cr || state->kblocks->whichblock[y*cr+x] != state->kblocks->whichblock[(y+1)*cr+x])
4980 has_bottom = 1, kb -= t; 4992 has_bottom = true, kb -= t;
4981 if (has_top) 4993 if (has_top)
4982 draw_line(dr, kl, kt, kr, kt, col_killer); 4994 draw_line(dr, kl, kt, kr, kt, col_killer);
4983 if (has_bottom) 4995 if (has_bottom)
@@ -5266,7 +5278,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
5266 */ 5278 */
5267 if (!ds->started) { 5279 if (!ds->started) {
5268 draw_update(dr, 0, 0, SIZE(cr), SIZE(cr)); 5280 draw_update(dr, 0, 0, SIZE(cr), SIZE(cr));
5269 ds->started = TRUE; 5281 ds->started = true;
5270 } 5282 }
5271} 5283}
5272 5284
@@ -5290,11 +5302,11 @@ static int game_status(const game_state *state)
5290 return state->completed ? +1 : 0; 5302 return state->completed ? +1 : 0;
5291} 5303}
5292 5304
5293static int game_timing_state(const game_state *state, game_ui *ui) 5305static bool game_timing_state(const game_state *state, game_ui *ui)
5294{ 5306{
5295 if (state->completed) 5307 if (state->completed)
5296 return FALSE; 5308 return false;
5297 return TRUE; 5309 return true;
5298} 5310}
5299 5311
5300static void game_print_size(const game_params *params, float *x, float *y) 5312static void game_print_size(const game_params *params, float *x, float *y)
@@ -5538,10 +5550,10 @@ static void game_print(drawing *dr, const game_state *state, int tilesize)
5538 */ 5550 */
5539 if (state->kblocks) { 5551 if (state->kblocks) {
5540 print_line_width(dr, TILE_SIZE / 40); 5552 print_line_width(dr, TILE_SIZE / 40);
5541 print_line_dotted(dr, TRUE); 5553 print_line_dotted(dr, true);
5542 outline_block_structure(dr, ds, state, state->kblocks, ink, 5554 outline_block_structure(dr, ds, state, state->kblocks, ink,
5543 5 * TILE_SIZE / 40); 5555 5 * TILE_SIZE / 40);
5544 print_line_dotted(dr, FALSE); 5556 print_line_dotted(dr, false);
5545 for (y = 0; y < cr; y++) 5557 for (y = 0; y < cr; y++)
5546 for (x = 0; x < cr; x++) 5558 for (x = 0; x < cr; x++)
5547 if (state->kgrid[y*cr+x]) { 5559 if (state->kgrid[y*cr+x]) {
@@ -5586,15 +5598,15 @@ const struct game thegame = {
5586 encode_params, 5598 encode_params,
5587 free_params, 5599 free_params,
5588 dup_params, 5600 dup_params,
5589 TRUE, game_configure, custom_params, 5601 true, game_configure, custom_params,
5590 validate_params, 5602 validate_params,
5591 new_game_desc, 5603 new_game_desc,
5592 validate_desc, 5604 validate_desc,
5593 new_game, 5605 new_game,
5594 dup_game, 5606 dup_game,
5595 free_game, 5607 free_game,
5596 TRUE, solve_game, 5608 true, solve_game,
5597 TRUE, game_can_format_as_text_now, game_text_format, 5609 true, game_can_format_as_text_now, game_text_format,
5598 new_ui, 5610 new_ui,
5599 free_ui, 5611 free_ui,
5600 encode_ui, 5612 encode_ui,
@@ -5611,9 +5623,9 @@ const struct game thegame = {
5611 game_anim_length, 5623 game_anim_length,
5612 game_flash_length, 5624 game_flash_length,
5613 game_status, 5625 game_status,
5614 TRUE, FALSE, game_print_size, game_print, 5626 true, false, game_print_size, game_print,
5615 FALSE, /* wants_statusbar */ 5627 false, /* wants_statusbar */
5616 FALSE, game_timing_state, 5628 false, game_timing_state,
5617 REQUIRE_RBUTTON | REQUIRE_NUMPAD, /* flags */ 5629 REQUIRE_RBUTTON | REQUIRE_NUMPAD, /* flags */
5618}; 5630};
5619 5631
@@ -5625,15 +5637,15 @@ int main(int argc, char **argv)
5625 game_state *s; 5637 game_state *s;
5626 char *id = NULL, *desc; 5638 char *id = NULL, *desc;
5627 const char *err; 5639 const char *err;
5628 int grade = FALSE; 5640 bool grade = false;
5629 struct difficulty dlev; 5641 struct difficulty dlev;
5630 5642
5631 while (--argc > 0) { 5643 while (--argc > 0) {
5632 char *p = *++argv; 5644 char *p = *++argv;
5633 if (!strcmp(p, "-v")) { 5645 if (!strcmp(p, "-v")) {
5634 solver_show_working = TRUE; 5646 solver_show_working = true;
5635 } else if (!strcmp(p, "-g")) { 5647 } else if (!strcmp(p, "-g")) {
5636 grade = TRUE; 5648 grade = true;
5637 } else if (*p == '-') { 5649 } else if (*p == '-') {
5638 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p); 5650 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p);
5639 return 1; 5651 return 1;
diff --git a/apps/plugins/puzzles/src/tdq.c b/apps/plugins/puzzles/src/tdq.c
index d66f9f4a83..cf2535c744 100644
--- a/apps/plugins/puzzles/src/tdq.c
+++ b/apps/plugins/puzzles/src/tdq.c
@@ -30,7 +30,7 @@ struct tdq {
30 int n; 30 int n;
31 int *queue; 31 int *queue;
32 int ip, op; /* in pointer, out pointer */ 32 int ip, op; /* in pointer, out pointer */
33 char *flags; 33 bool *flags;
34}; 34};
35 35
36tdq *tdq_new(int n) 36tdq *tdq_new(int n)
@@ -38,10 +38,10 @@ tdq *tdq_new(int n)
38 int i; 38 int i;
39 tdq *tdq = snew(struct tdq); 39 tdq *tdq = snew(struct tdq);
40 tdq->queue = snewn(n, int); 40 tdq->queue = snewn(n, int);
41 tdq->flags = snewn(n, char); 41 tdq->flags = snewn(n, bool);
42 for (i = 0; i < n; i++) { 42 for (i = 0; i < n; i++) {
43 tdq->queue[i] = 0; 43 tdq->queue[i] = 0;
44 tdq->flags[i] = 0; 44 tdq->flags[i] = false;
45 } 45 }
46 tdq->n = n; 46 tdq->n = n;
47 tdq->ip = tdq->op = 0; 47 tdq->ip = tdq->op = 0;
@@ -60,7 +60,7 @@ void tdq_add(tdq *tdq, int k)
60 assert((unsigned)k < (unsigned)tdq->n); 60 assert((unsigned)k < (unsigned)tdq->n);
61 if (!tdq->flags[k]) { 61 if (!tdq->flags[k]) {
62 tdq->queue[tdq->ip] = k; 62 tdq->queue[tdq->ip] = k;
63 tdq->flags[k] = 1; 63 tdq->flags[k] = true;
64 if (++tdq->ip == tdq->n) 64 if (++tdq->ip == tdq->n)
65 tdq->ip = 0; 65 tdq->ip = 0;
66 } 66 }
@@ -73,7 +73,7 @@ int tdq_remove(tdq *tdq)
73 if (!tdq->flags[ret]) 73 if (!tdq->flags[ret])
74 return -1; 74 return -1;
75 75
76 tdq->flags[ret] = 0; 76 tdq->flags[ret] = false;
77 if (++tdq->op == tdq->n) 77 if (++tdq->op == tdq->n)
78 tdq->op = 0; 78 tdq->op = 0;
79 79
diff --git a/apps/plugins/puzzles/src/tents.c b/apps/plugins/puzzles/src/tents.c
index 2f0977efbe..1e601f5836 100644
--- a/apps/plugins/puzzles/src/tents.c
+++ b/apps/plugins/puzzles/src/tents.c
@@ -229,9 +229,9 @@
229 */ 229 */
230#if defined STANDALONE_SOLVER 230#if defined STANDALONE_SOLVER
231#define SOLVER_DIAGNOSTICS 231#define SOLVER_DIAGNOSTICS
232int verbose = FALSE; 232bool verbose = false;
233#elif defined SOLVER_DIAGNOSTICS 233#elif defined SOLVER_DIAGNOSTICS
234#define verbose TRUE 234#define verbose true
235#endif 235#endif
236 236
237/* 237/*
@@ -279,7 +279,7 @@ struct game_state {
279 game_params p; 279 game_params p;
280 char *grid; 280 char *grid;
281 struct numbers *numbers; 281 struct numbers *numbers;
282 int completed, used_solve; 282 bool completed, used_solve;
283}; 283};
284 284
285static game_params *default_params(void) 285static game_params *default_params(void)
@@ -301,13 +301,13 @@ static const struct game_params tents_presets[] = {
301 {15, 15, DIFF_TRICKY}, 301 {15, 15, DIFF_TRICKY},
302}; 302};
303 303
304static int game_fetch_preset(int i, char **name, game_params **params) 304static bool game_fetch_preset(int i, char **name, game_params **params)
305{ 305{
306 game_params *ret; 306 game_params *ret;
307 char str[80]; 307 char str[80];
308 308
309 if (i < 0 || i >= lenof(tents_presets)) 309 if (i < 0 || i >= lenof(tents_presets))
310 return FALSE; 310 return false;
311 311
312 ret = snew(game_params); 312 ret = snew(game_params);
313 *ret = tents_presets[i]; 313 *ret = tents_presets[i];
@@ -316,7 +316,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
316 316
317 *name = dupstr(str); 317 *name = dupstr(str);
318 *params = ret; 318 *params = ret;
319 return TRUE; 319 return true;
320} 320}
321 321
322static void free_params(game_params *params) 322static void free_params(game_params *params)
@@ -350,7 +350,7 @@ static void decode_params(game_params *params, char const *string)
350 } 350 }
351} 351}
352 352
353static char *encode_params(const game_params *params, int full) 353static char *encode_params(const game_params *params, bool full)
354{ 354{
355 char buf[120]; 355 char buf[120];
356 356
@@ -400,7 +400,7 @@ static game_params *custom_params(const config_item *cfg)
400 return ret; 400 return ret;
401} 401}
402 402
403static const char *validate_params(const game_params *params, int full) 403static const char *validate_params(const game_params *params, bool full)
404{ 404{
405 /* 405 /*
406 * Generating anything under 4x4 runs into trouble of one kind 406 * Generating anything under 4x4 runs into trouble of one kind
@@ -471,7 +471,7 @@ static int tents_solve(int w, int h, const char *grid, int *numbers,
471 * Main solver loop. 471 * Main solver loop.
472 */ 472 */
473 while (1) { 473 while (1) {
474 int done_something = FALSE; 474 bool done_something = false;
475 475
476 /* 476 /*
477 * Any tent which has only one unattached tree adjacent to 477 * Any tent which has only one unattached tree adjacent to
@@ -512,7 +512,7 @@ static int tents_solve(int w, int h, const char *grid, int *numbers,
512 512
513 sc->links[y*w+x] = linkd; 513 sc->links[y*w+x] = linkd;
514 sc->links[y2*w+x2] = F(linkd); 514 sc->links[y2*w+x2] = F(linkd);
515 done_something = TRUE; 515 done_something = true;
516 } 516 }
517 } 517 }
518 518
@@ -528,14 +528,14 @@ static int tents_solve(int w, int h, const char *grid, int *numbers,
528 for (y = 0; y < h; y++) 528 for (y = 0; y < h; y++)
529 for (x = 0; x < w; x++) 529 for (x = 0; x < w; x++)
530 if (soln[y*w+x] == BLANK) { 530 if (soln[y*w+x] == BLANK) {
531 int can_be_tent = FALSE; 531 bool can_be_tent = false;
532 532
533 for (d = 1; d < MAXDIR; d++) { 533 for (d = 1; d < MAXDIR; d++) {
534 int x2 = x + dx(d), y2 = y + dy(d); 534 int x2 = x + dx(d), y2 = y + dy(d);
535 if (x2 >= 0 && x2 < w && y2 >= 0 && y2 < h && 535 if (x2 >= 0 && x2 < w && y2 >= 0 && y2 < h &&
536 soln[y2*w+x2] == TREE && 536 soln[y2*w+x2] == TREE &&
537 !sc->links[y2*w+x2]) 537 !sc->links[y2*w+x2])
538 can_be_tent = TRUE; 538 can_be_tent = true;
539 } 539 }
540 540
541 if (!can_be_tent) { 541 if (!can_be_tent) {
@@ -545,7 +545,7 @@ static int tents_solve(int w, int h, const char *grid, int *numbers,
545 " unmatched tree)\n", x, y); 545 " unmatched tree)\n", x, y);
546#endif 546#endif
547 soln[y*w+x] = NONTENT; 547 soln[y*w+x] = NONTENT;
548 done_something = TRUE; 548 done_something = true;
549 } 549 }
550 } 550 }
551 551
@@ -559,7 +559,8 @@ static int tents_solve(int w, int h, const char *grid, int *numbers,
559 for (y = 0; y < h; y++) 559 for (y = 0; y < h; y++)
560 for (x = 0; x < w; x++) 560 for (x = 0; x < w; x++)
561 if (soln[y*w+x] == BLANK) { 561 if (soln[y*w+x] == BLANK) {
562 int dx, dy, imposs = FALSE; 562 int dx, dy;
563 bool imposs = false;
563 564
564 for (dy = -1; dy <= +1; dy++) 565 for (dy = -1; dy <= +1; dy++)
565 for (dx = -1; dx <= +1; dx++) 566 for (dx = -1; dx <= +1; dx++)
@@ -567,7 +568,7 @@ static int tents_solve(int w, int h, const char *grid, int *numbers,
567 int x2 = x + dx, y2 = y + dy; 568 int x2 = x + dx, y2 = y + dy;
568 if (x2 >= 0 && x2 < w && y2 >= 0 && y2 < h && 569 if (x2 >= 0 && x2 < w && y2 >= 0 && y2 < h &&
569 soln[y2*w+x2] == TENT) 570 soln[y2*w+x2] == TENT)
570 imposs = TRUE; 571 imposs = true;
571 } 572 }
572 573
573 if (imposs) { 574 if (imposs) {
@@ -577,7 +578,7 @@ static int tents_solve(int w, int h, const char *grid, int *numbers,
577 x, y); 578 x, y);
578#endif 579#endif
579 soln[y*w+x] = NONTENT; 580 soln[y*w+x] = NONTENT;
580 done_something = TRUE; 581 done_something = true;
581 } 582 }
582 } 583 }
583 584
@@ -625,7 +626,7 @@ static int tents_solve(int w, int h, const char *grid, int *numbers,
625 soln[y2*w+x2] = TENT; 626 soln[y2*w+x2] = TENT;
626 sc->links[y*w+x] = linkd; 627 sc->links[y*w+x] = linkd;
627 sc->links[y2*w+x2] = F(linkd); 628 sc->links[y2*w+x2] = F(linkd);
628 done_something = TRUE; 629 done_something = true;
629 } else if (nd == 2 && (!dx(linkd) != !dx(linkd2)) && 630 } else if (nd == 2 && (!dx(linkd) != !dx(linkd2)) &&
630 diff >= DIFF_TRICKY) { 631 diff >= DIFF_TRICKY) {
631 /* 632 /*
@@ -648,7 +649,7 @@ static int tents_solve(int w, int h, const char *grid, int *numbers,
648 x, y, x2, y2); 649 x, y, x2, y2);
649#endif 650#endif
650 soln[y2*w+x2] = NONTENT; 651 soln[y2*w+x2] = NONTENT;
651 done_something = TRUE; 652 done_something = true;
652 } 653 }
653 } 654 }
654 } 655 }
@@ -751,7 +752,8 @@ static int tents_solve(int w, int h, const char *grid, int *numbers,
751 * And iterate over all possibilities. 752 * And iterate over all possibilities.
752 */ 753 */
753 while (1) { 754 while (1) {
754 int p, valid; 755 int p;
756 bool valid;
755 757
756 /* 758 /*
757 * See if this possibility is valid. The only way 759 * See if this possibility is valid. The only way
@@ -761,12 +763,12 @@ static int tents_solve(int w, int h, const char *grid, int *numbers,
761 * placed, will have been dealt with already by 763 * placed, will have been dealt with already by
762 * other parts of the solver.) 764 * other parts of the solver.)
763 */ 765 */
764 valid = TRUE; 766 valid = true;
765 for (j = 0; j+1 < n; j++) 767 for (j = 0; j+1 < n; j++)
766 if (sc->place[j] == TENT && 768 if (sc->place[j] == TENT &&
767 sc->place[j+1] == TENT && 769 sc->place[j+1] == TENT &&
768 sc->locs[j+1] == sc->locs[j]+1) { 770 sc->locs[j+1] == sc->locs[j]+1) {
769 valid = FALSE; 771 valid = false;
770 break; 772 break;
771 } 773 }
772 774
@@ -868,7 +870,7 @@ static int tents_solve(int w, int h, const char *grid, int *numbers,
868 pos % w, pos / w); 870 pos % w, pos / w);
869#endif 871#endif
870 soln[pos] = mthis[j]; 872 soln[pos] = mthis[j];
871 done_something = TRUE; 873 done_something = true;
872 } 874 }
873 } 875 }
874 } 876 }
@@ -897,7 +899,7 @@ static int tents_solve(int w, int h, const char *grid, int *numbers,
897} 899}
898 900
899static char *new_game_desc(const game_params *params_in, random_state *rs, 901static char *new_game_desc(const game_params *params_in, random_state *rs,
900 char **aux, int interactive) 902 char **aux, bool interactive)
901{ 903{
902 game_params params_copy = *params_in; /* structure copy */ 904 game_params params_copy = *params_in; /* structure copy */
903 game_params *params = &params_copy; 905 game_params *params = &params_copy;
@@ -993,7 +995,8 @@ static char *new_game_desc(const game_params *params_in, random_state *rs,
993 * is too few to fit the remaining tents into. */ 995 * is too few to fit the remaining tents into. */
994 for (i = 0; j > 0 && i+j <= w*h; i++) { 996 for (i = 0; j > 0 && i+j <= w*h; i++) {
995 int which, x, y, d, tmp; 997 int which, x, y, d, tmp;
996 int dy, dx, ok = TRUE; 998 int dy, dx;
999 bool ok = true;
997 1000
998 which = i + random_upto(rs, j); 1001 which = i + random_upto(rs, j);
999 tmp = order[which]; 1002 tmp = order[which];
@@ -1008,7 +1011,7 @@ static char *new_game_desc(const game_params *params_in, random_state *rs,
1008 if (x+dx >= 0 && x+dx < w && 1011 if (x+dx >= 0 && x+dx < w &&
1009 y+dy >= 0 && y+dy < h && 1012 y+dy >= 0 && y+dy < h &&
1010 grid[(y+dy)*w+(x+dx)] == TENT) 1013 grid[(y+dy)*w+(x+dx)] == TENT)
1011 ok = FALSE; 1014 ok = false;
1012 1015
1013 if (ok) { 1016 if (ok) {
1014 grid[order[i]] = TENT; 1017 grid[order[i]] = TENT;
@@ -1141,7 +1144,7 @@ static char *new_game_desc(const game_params *params_in, random_state *rs,
1141 p = ret; 1144 p = ret;
1142 j = 0; 1145 j = 0;
1143 for (i = 0; i <= w*h; i++) { 1146 for (i = 0; i <= w*h; i++) {
1144 int c = (i < w*h ? grid[i] == TREE : 1); 1147 bool c = (i < w*h ? grid[i] == TREE : true);
1145 if (c) { 1148 if (c) {
1146 *p++ = (j == 0 ? '_' : j-1 + 'a'); 1149 *p++ = (j == 0 ? '_' : j-1 + 'a');
1147 j = 0; 1150 j = 0;
@@ -1236,7 +1239,7 @@ static game_state *new_game(midend *me, const game_params *params,
1236 state->numbers = snew(struct numbers); 1239 state->numbers = snew(struct numbers);
1237 state->numbers->refcount = 1; 1240 state->numbers->refcount = 1;
1238 state->numbers->numbers = snewn(w+h, int); 1241 state->numbers->numbers = snewn(w+h, int);
1239 state->completed = state->used_solve = FALSE; 1242 state->completed = state->used_solve = false;
1240 1243
1241 i = 0; 1244 i = 0;
1242 memset(state->grid, BLANK, w*h); 1245 memset(state->grid, BLANK, w*h);
@@ -1360,7 +1363,7 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1360 } 1363 }
1361} 1364}
1362 1365
1363static int game_can_format_as_text_now(const game_params *params) 1366static bool game_can_format_as_text_now(const game_params *params)
1364{ 1367{
1365 return params->w <= 1998 && params->h <= 1998; /* 999 tents */ 1368 return params->w <= 1998 && params->h <= 1998; /* 999 tents */
1366} 1369}
@@ -1419,9 +1422,10 @@ struct game_ui {
1419 int dsx, dsy; /* coords of drag start */ 1422 int dsx, dsy; /* coords of drag start */
1420 int dex, dey; /* coords of drag end */ 1423 int dex, dey; /* coords of drag end */
1421 int drag_button; /* -1 for none, or a button code */ 1424 int drag_button; /* -1 for none, or a button code */
1422 int drag_ok; /* dragged off the window, to cancel */ 1425 bool drag_ok; /* dragged off the window, to cancel */
1423 1426
1424 int cx, cy, cdisp; /* cursor position, and ?display. */ 1427 int cx, cy; /* cursor position. */
1428 bool cdisp; /* is cursor displayed? */
1425}; 1429};
1426 1430
1427static game_ui *new_ui(const game_state *state) 1431static game_ui *new_ui(const game_state *state)
@@ -1430,8 +1434,9 @@ static game_ui *new_ui(const game_state *state)
1430 ui->dsx = ui->dsy = -1; 1434 ui->dsx = ui->dsy = -1;
1431 ui->dex = ui->dey = -1; 1435 ui->dex = ui->dey = -1;
1432 ui->drag_button = -1; 1436 ui->drag_button = -1;
1433 ui->drag_ok = FALSE; 1437 ui->drag_ok = false;
1434 ui->cx = ui->cy = ui->cdisp = 0; 1438 ui->cx = ui->cy = 0;
1439 ui->cdisp = false;
1435 return ui; 1440 return ui;
1436} 1441}
1437 1442
@@ -1456,7 +1461,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1456 1461
1457struct game_drawstate { 1462struct game_drawstate {
1458 int tilesize; 1463 int tilesize;
1459 int started; 1464 bool started;
1460 game_params p; 1465 game_params p;
1461 int *drawn, *numbersdrawn; 1466 int *drawn, *numbersdrawn;
1462 int cx, cy; /* last-drawn cursor pos, or (-1,-1) if absent. */ 1467 int cx, cy; /* last-drawn cursor pos, or (-1,-1) if absent. */
@@ -1539,7 +1544,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1539{ 1544{
1540 int w = state->p.w, h = state->p.h; 1545 int w = state->p.w, h = state->p.h;
1541 char tmpbuf[80]; 1546 char tmpbuf[80];
1542 int shift = button & MOD_SHFT, control = button & MOD_CTRL; 1547 bool shift = button & MOD_SHFT, control = button & MOD_CTRL;
1543 1548
1544 button &= ~MOD_MASK; 1549 button &= ~MOD_MASK;
1545 1550
@@ -1552,8 +1557,8 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1552 ui->drag_button = button; 1557 ui->drag_button = button;
1553 ui->dsx = ui->dex = x; 1558 ui->dsx = ui->dex = x;
1554 ui->dsy = ui->dey = y; 1559 ui->dsy = ui->dey = y;
1555 ui->drag_ok = TRUE; 1560 ui->drag_ok = true;
1556 ui->cdisp = 0; 1561 ui->cdisp = false;
1557 return UI_UPDATE; 1562 return UI_UPDATE;
1558 } 1563 }
1559 1564
@@ -1567,7 +1572,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1567 x = FROMCOORD(x); 1572 x = FROMCOORD(x);
1568 y = FROMCOORD(y); 1573 y = FROMCOORD(y);
1569 if (x < 0 || y < 0 || x >= w || y >= h) { 1574 if (x < 0 || y < 0 || x >= w || y >= h) {
1570 ui->drag_ok = FALSE; 1575 ui->drag_ok = false;
1571 } else { 1576 } else {
1572 /* 1577 /*
1573 * Drags are limited to one row or column. Hence, we 1578 * Drags are limited to one row or column. Hence, we
@@ -1582,7 +1587,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1582 ui->dex = x; 1587 ui->dex = x;
1583 ui->dey = y; 1588 ui->dey = y;
1584 1589
1585 ui->drag_ok = TRUE; 1590 ui->drag_ok = true;
1586 } 1591 }
1587 1592
1588 if (IS_MOUSE_DRAG(button)) 1593 if (IS_MOUSE_DRAG(button))
@@ -1639,11 +1644,11 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1639 } 1644 }
1640 1645
1641 if (IS_CURSOR_MOVE(button)) { 1646 if (IS_CURSOR_MOVE(button)) {
1642 ui->cdisp = 1; 1647 ui->cdisp = true;
1643 if (shift || control) { 1648 if (shift || control) {
1644 int len = 0, i, indices[2]; 1649 int len = 0, i, indices[2];
1645 indices[0] = ui->cx + w * ui->cy; 1650 indices[0] = ui->cx + w * ui->cy;
1646 move_cursor(button, &ui->cx, &ui->cy, w, h, 0); 1651 move_cursor(button, &ui->cx, &ui->cy, w, h, false);
1647 indices[1] = ui->cx + w * ui->cy; 1652 indices[1] = ui->cx + w * ui->cy;
1648 1653
1649 /* NONTENTify all unique traversed eligible squares */ 1654 /* NONTENTify all unique traversed eligible squares */
@@ -1658,7 +1663,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1658 tmpbuf[len] = '\0'; 1663 tmpbuf[len] = '\0';
1659 if (len) return dupstr(tmpbuf); 1664 if (len) return dupstr(tmpbuf);
1660 } else 1665 } else
1661 move_cursor(button, &ui->cx, &ui->cy, w, h, 0); 1666 move_cursor(button, &ui->cx, &ui->cy, w, h, false);
1662 return UI_UPDATE; 1667 return UI_UPDATE;
1663 } 1668 }
1664 if (ui->cdisp) { 1669 if (ui->cdisp) {
@@ -1685,7 +1690,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1685 return dupstr(tmpbuf); 1690 return dupstr(tmpbuf);
1686 } 1691 }
1687 } else if (IS_CURSOR_SELECT(button)) { 1692 } else if (IS_CURSOR_SELECT(button)) {
1688 ui->cdisp = 1; 1693 ui->cdisp = true;
1689 return UI_UPDATE; 1694 return UI_UPDATE;
1690 } 1695 }
1691 1696
@@ -1703,7 +1708,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1703 c = *move; 1708 c = *move;
1704 if (c == 'S') { 1709 if (c == 'S') {
1705 int i; 1710 int i;
1706 ret->used_solve = TRUE; 1711 ret->used_solve = true;
1707 /* 1712 /*
1708 * Set all non-tree squares to NONTENT. The rest of the 1713 * Set all non-tree squares to NONTENT. The rest of the
1709 * solve move will fill the tents in over the top. 1714 * solve move will fill the tents in over the top.
@@ -1858,7 +1863,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1858 /* 1863 /*
1859 * We haven't managed to fault the grid on any count. Score! 1864 * We haven't managed to fault the grid on any count. Score!
1860 */ 1865 */
1861 ret->completed = TRUE; 1866 ret->completed = true;
1862 } 1867 }
1863 completion_check_done: 1868 completion_check_done:
1864 1869
@@ -1935,7 +1940,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1935 int i; 1940 int i;
1936 1941
1937 ds->tilesize = 0; 1942 ds->tilesize = 0;
1938 ds->started = FALSE; 1943 ds->started = false;
1939 ds->p = state->p; /* structure copy */ 1944 ds->p = state->p; /* structure copy */
1940 ds->drawn = snewn(w*h, int); 1945 ds->drawn = snewn(w*h, int);
1941 for (i = 0; i < w*h; i++) 1946 for (i = 0; i < w*h; i++)
@@ -2302,7 +2307,7 @@ static void draw_err_adj(drawing *dr, game_drawstate *ds, int x, int y)
2302} 2307}
2303 2308
2304static void draw_tile(drawing *dr, game_drawstate *ds, 2309static void draw_tile(drawing *dr, game_drawstate *ds,
2305 int x, int y, int v, int cur, int printing) 2310 int x, int y, int v, bool cur, bool printing)
2306{ 2311{
2307 int err; 2312 int err;
2308 int tx = COORD(x), ty = COORD(y); 2313 int tx = COORD(x), ty = COORD(y);
@@ -2390,18 +2395,19 @@ static void draw_tile(drawing *dr, game_drawstate *ds,
2390static void int_redraw(drawing *dr, game_drawstate *ds, 2395static void int_redraw(drawing *dr, game_drawstate *ds,
2391 const game_state *oldstate, const game_state *state, 2396 const game_state *oldstate, const game_state *state,
2392 int dir, const game_ui *ui, 2397 int dir, const game_ui *ui,
2393 float animtime, float flashtime, int printing) 2398 float animtime, float flashtime, bool printing)
2394{ 2399{
2395 int w = state->p.w, h = state->p.h; 2400 int w = state->p.w, h = state->p.h;
2396 int x, y, flashing; 2401 int x, y;
2402 bool flashing;
2397 int cx = -1, cy = -1; 2403 int cx = -1, cy = -1;
2398 int cmoved = 0; 2404 bool cmoved = false;
2399 char *tmpgrid; 2405 char *tmpgrid;
2400 int *errors; 2406 int *errors;
2401 2407
2402 if (ui) { 2408 if (ui) {
2403 if (ui->cdisp) { cx = ui->cx; cy = ui->cy; } 2409 if (ui->cdisp) { cx = ui->cx; cy = ui->cy; }
2404 if (cx != ds->cx || cy != ds->cy) cmoved = 1; 2410 if (cx != ds->cx || cy != ds->cy) cmoved = true;
2405 } 2411 }
2406 2412
2407 if (printing || !ds->started) { 2413 if (printing || !ds->started) {
@@ -2410,7 +2416,7 @@ static void int_redraw(drawing *dr, game_drawstate *ds,
2410 game_compute_size(&state->p, TILESIZE, &ww, &wh); 2416 game_compute_size(&state->p, TILESIZE, &ww, &wh);
2411 draw_rect(dr, 0, 0, ww, wh, COL_BACKGROUND); 2417 draw_rect(dr, 0, 0, ww, wh, COL_BACKGROUND);
2412 draw_update(dr, 0, 0, ww, wh); 2418 draw_update(dr, 0, 0, ww, wh);
2413 ds->started = TRUE; 2419 ds->started = true;
2414 } 2420 }
2415 2421
2416 if (printing) 2422 if (printing)
@@ -2428,7 +2434,7 @@ static void int_redraw(drawing *dr, game_drawstate *ds,
2428 if (flashtime > 0) 2434 if (flashtime > 0)
2429 flashing = (int)(flashtime * 3 / FLASH_TIME) != 1; 2435 flashing = (int)(flashtime * 3 / FLASH_TIME) != 1;
2430 else 2436 else
2431 flashing = FALSE; 2437 flashing = false;
2432 2438
2433 /* 2439 /*
2434 * Find errors. For this we use _part_ of the information from a 2440 * Find errors. For this we use _part_ of the information from a
@@ -2454,7 +2460,7 @@ static void int_redraw(drawing *dr, game_drawstate *ds,
2454 for (y = 0; y < h; y++) { 2460 for (y = 0; y < h; y++) {
2455 for (x = 0; x < w; x++) { 2461 for (x = 0; x < w; x++) {
2456 int v = state->grid[y*w+x]; 2462 int v = state->grid[y*w+x];
2457 int credraw = 0; 2463 bool credraw = false;
2458 2464
2459 /* 2465 /*
2460 * We deliberately do not take drag_ok into account 2466 * We deliberately do not take drag_ok into account
@@ -2470,7 +2476,7 @@ static void int_redraw(drawing *dr, game_drawstate *ds,
2470 2476
2471 if (cmoved) { 2477 if (cmoved) {
2472 if ((x == cx && y == cy) || 2478 if ((x == cx && y == cy) ||
2473 (x == ds->cx && y == ds->cy)) credraw = 1; 2479 (x == ds->cx && y == ds->cy)) credraw = true;
2474 } 2480 }
2475 2481
2476 v |= errors[y*w+x]; 2482 v |= errors[y*w+x];
@@ -2529,7 +2535,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2529 int dir, const game_ui *ui, 2535 int dir, const game_ui *ui,
2530 float animtime, float flashtime) 2536 float animtime, float flashtime)
2531{ 2537{
2532 int_redraw(dr, ds, oldstate, state, dir, ui, animtime, flashtime, FALSE); 2538 int_redraw(dr, ds, oldstate, state, dir, ui, animtime, flashtime, false);
2533} 2539}
2534 2540
2535static float game_anim_length(const game_state *oldstate, 2541static float game_anim_length(const game_state *oldstate,
@@ -2553,9 +2559,9 @@ static int game_status(const game_state *state)
2553 return state->completed ? +1 : 0; 2559 return state->completed ? +1 : 0;
2554} 2560}
2555 2561
2556static int game_timing_state(const game_state *state, game_ui *ui) 2562static bool game_timing_state(const game_state *state, game_ui *ui)
2557{ 2563{
2558 return TRUE; 2564 return true;
2559} 2565}
2560 2566
2561static void game_print_size(const game_params *params, float *x, float *y) 2567static void game_print_size(const game_params *params, float *x, float *y)
@@ -2585,7 +2591,7 @@ static void game_print(drawing *dr, const game_state *state, int tilesize)
2585 c = print_mono_colour(dr, 0); assert(c == COL_TREELEAF); 2591 c = print_mono_colour(dr, 0); assert(c == COL_TREELEAF);
2586 c = print_mono_colour(dr, 0); assert(c == COL_TENT); 2592 c = print_mono_colour(dr, 0); assert(c == COL_TENT);
2587 2593
2588 int_redraw(dr, ds, NULL, state, +1, NULL, 0.0F, 0.0F, TRUE); 2594 int_redraw(dr, ds, NULL, state, +1, NULL, 0.0F, 0.0F, true);
2589} 2595}
2590 2596
2591#ifdef COMBINED 2597#ifdef COMBINED
@@ -2600,15 +2606,15 @@ const struct game thegame = {
2600 encode_params, 2606 encode_params,
2601 free_params, 2607 free_params,
2602 dup_params, 2608 dup_params,
2603 TRUE, game_configure, custom_params, 2609 true, game_configure, custom_params,
2604 validate_params, 2610 validate_params,
2605 new_game_desc, 2611 new_game_desc,
2606 validate_desc, 2612 validate_desc,
2607 new_game, 2613 new_game,
2608 dup_game, 2614 dup_game,
2609 free_game, 2615 free_game,
2610 TRUE, solve_game, 2616 true, solve_game,
2611 TRUE, game_can_format_as_text_now, game_text_format, 2617 true, game_can_format_as_text_now, game_text_format,
2612 new_ui, 2618 new_ui,
2613 free_ui, 2619 free_ui,
2614 encode_ui, 2620 encode_ui,
@@ -2625,9 +2631,9 @@ const struct game thegame = {
2625 game_anim_length, 2631 game_anim_length,
2626 game_flash_length, 2632 game_flash_length,
2627 game_status, 2633 game_status,
2628 TRUE, FALSE, game_print_size, game_print, 2634 true, false, game_print_size, game_print,
2629 FALSE, /* wants_statusbar */ 2635 false, /* wants_statusbar */
2630 FALSE, game_timing_state, 2636 false, game_timing_state,
2631 REQUIRE_RBUTTON, /* flags */ 2637 REQUIRE_RBUTTON, /* flags */
2632}; 2638};
2633 2639
@@ -2641,16 +2647,17 @@ int main(int argc, char **argv)
2641 game_state *s, *s2; 2647 game_state *s, *s2;
2642 char *id = NULL, *desc; 2648 char *id = NULL, *desc;
2643 const char *err; 2649 const char *err;
2644 int grade = FALSE; 2650 bool grade = false;
2645 int ret, diff, really_verbose = FALSE; 2651 int ret, diff;
2652 bool really_verbose = false;
2646 struct solver_scratch *sc; 2653 struct solver_scratch *sc;
2647 2654
2648 while (--argc > 0) { 2655 while (--argc > 0) {
2649 char *p = *++argv; 2656 char *p = *++argv;
2650 if (!strcmp(p, "-v")) { 2657 if (!strcmp(p, "-v")) {
2651 really_verbose = TRUE; 2658 really_verbose = true;
2652 } else if (!strcmp(p, "-g")) { 2659 } else if (!strcmp(p, "-g")) {
2653 grade = TRUE; 2660 grade = true;
2654 } else if (*p == '-') { 2661 } else if (*p == '-') {
2655 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p); 2662 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p);
2656 return 1; 2663 return 1;
diff --git a/apps/plugins/puzzles/src/towers.c b/apps/plugins/puzzles/src/towers.c
index 62d4de7b8b..a72cae680d 100644
--- a/apps/plugins/puzzles/src/towers.c
+++ b/apps/plugins/puzzles/src/towers.c
@@ -114,10 +114,10 @@ static const char *const cluepos[] = {
114struct game_state { 114struct game_state {
115 game_params par; 115 game_params par;
116 struct clues *clues; 116 struct clues *clues;
117 unsigned char *clues_done; 117 bool *clues_done;
118 digit *grid; 118 digit *grid;
119 int *pencil; /* bitmaps using bits 1<<1..1<<n */ 119 int *pencil; /* bitmaps using bits 1<<1..1<<n */
120 int completed, cheated; 120 bool completed, cheated;
121}; 121};
122 122
123static game_params *default_params(void) 123static game_params *default_params(void)
@@ -140,13 +140,13 @@ static const struct game_params towers_presets[] = {
140 { 6, DIFF_UNREASONABLE }, 140 { 6, DIFF_UNREASONABLE },
141}; 141};
142 142
143static int game_fetch_preset(int i, char **name, game_params **params) 143static bool game_fetch_preset(int i, char **name, game_params **params)
144{ 144{
145 game_params *ret; 145 game_params *ret;
146 char buf[80]; 146 char buf[80];
147 147
148 if (i < 0 || i >= lenof(towers_presets)) 148 if (i < 0 || i >= lenof(towers_presets))
149 return FALSE; 149 return false;
150 150
151 ret = snew(game_params); 151 ret = snew(game_params);
152 *ret = towers_presets[i]; /* structure copy */ 152 *ret = towers_presets[i]; /* structure copy */
@@ -155,7 +155,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
155 155
156 *name = dupstr(buf); 156 *name = dupstr(buf);
157 *params = ret; 157 *params = ret;
158 return TRUE; 158 return true;
159} 159}
160 160
161static void free_params(game_params *params) 161static void free_params(game_params *params)
@@ -191,7 +191,7 @@ static void decode_params(game_params *params, char const *string)
191 } 191 }
192} 192}
193 193
194static char *encode_params(const game_params *params, int full) 194static char *encode_params(const game_params *params, bool full)
195{ 195{
196 char ret[80]; 196 char ret[80];
197 197
@@ -235,7 +235,7 @@ static game_params *custom_params(const config_item *cfg)
235 return ret; 235 return ret;
236} 236}
237 237
238static const char *validate_params(const game_params *params, int full) 238static const char *validate_params(const game_params *params, bool full)
239{ 239{
240 if (params->w < 3 || params->w > 9) 240 if (params->w < 3 || params->w > 9)
241 return "Grid size must be between 3 and 9"; 241 return "Grid size must be between 3 and 9";
@@ -250,7 +250,7 @@ static const char *validate_params(const game_params *params, int full)
250 250
251struct solver_ctx { 251struct solver_ctx {
252 int w, diff; 252 int w, diff;
253 int started; 253 bool started;
254 int *clues; 254 int *clues;
255 long *iscratch; 255 long *iscratch;
256 int *dscratch; 256 int *dscratch;
@@ -268,7 +268,7 @@ static int solver_easy(struct latin_solver *solver, void *vctx)
268#endif 268#endif
269 269
270 if (!ctx->started) { 270 if (!ctx->started) {
271 ctx->started = TRUE; 271 ctx->started = true;
272 /* 272 /*
273 * One-off loop to help get started: when a pair of facing 273 * One-off loop to help get started: when a pair of facing
274 * clues sum to w+1, it must mean that the row consists of 274 * clues sum to w+1, it must mean that the row consists of
@@ -582,7 +582,7 @@ static int solver(int w, int *clues, digit *soln, int maxdiff)
582 ctx.w = w; 582 ctx.w = w;
583 ctx.diff = maxdiff; 583 ctx.diff = maxdiff;
584 ctx.clues = clues; 584 ctx.clues = clues;
585 ctx.started = FALSE; 585 ctx.started = false;
586 ctx.iscratch = snewn(w, long); 586 ctx.iscratch = snewn(w, long);
587 ctx.dscratch = snewn(w+1, int); 587 ctx.dscratch = snewn(w+1, int);
588 588
@@ -602,7 +602,7 @@ static int solver(int w, int *clues, digit *soln, int maxdiff)
602 */ 602 */
603 603
604static char *new_game_desc(const game_params *params, random_state *rs, 604static char *new_game_desc(const game_params *params, random_state *rs,
605 char **aux, int interactive) 605 char **aux, bool interactive)
606{ 606{
607 int w = params->w, a = w*w; 607 int w = params->w, a = w*w;
608 digit *grid, *soln, *soln2; 608 digit *grid, *soln, *soln2;
@@ -898,7 +898,7 @@ static game_state *new_game(midend *me, const game_params *params,
898 state->clues->clues = snewn(4*w, int); 898 state->clues->clues = snewn(4*w, int);
899 state->clues->immutable = snewn(a, digit); 899 state->clues->immutable = snewn(a, digit);
900 state->grid = snewn(a, digit); 900 state->grid = snewn(a, digit);
901 state->clues_done = snewn(4*w, unsigned char); 901 state->clues_done = snewn(4*w, bool);
902 state->pencil = snewn(a, int); 902 state->pencil = snewn(a, int);
903 903
904 for (i = 0; i < a; i++) { 904 for (i = 0; i < a; i++) {
@@ -907,7 +907,7 @@ static game_state *new_game(midend *me, const game_params *params,
907 } 907 }
908 908
909 memset(state->clues->immutable, 0, a); 909 memset(state->clues->immutable, 0, a);
910 memset(state->clues_done, 0, 4*w*sizeof(unsigned char)); 910 memset(state->clues_done, 0, 4*w*sizeof(bool));
911 911
912 for (i = 0; i < 4*w; i++) { 912 for (i = 0; i < 4*w; i++) {
913 if (i > 0) { 913 if (i > 0) {
@@ -944,7 +944,8 @@ static game_state *new_game(midend *me, const game_params *params,
944 } 944 }
945 assert(!*p); 945 assert(!*p);
946 946
947 state->completed = state->cheated = FALSE; 947 state->completed = false;
948 state->cheated = false;
948 949
949 return state; 950 return state;
950} 951}
@@ -961,10 +962,10 @@ static game_state *dup_game(const game_state *state)
961 962
962 ret->grid = snewn(a, digit); 963 ret->grid = snewn(a, digit);
963 ret->pencil = snewn(a, int); 964 ret->pencil = snewn(a, int);
964 ret->clues_done = snewn(4*w, unsigned char); 965 ret->clues_done = snewn(4*w, bool);
965 memcpy(ret->grid, state->grid, a*sizeof(digit)); 966 memcpy(ret->grid, state->grid, a*sizeof(digit));
966 memcpy(ret->pencil, state->pencil, a*sizeof(int)); 967 memcpy(ret->pencil, state->pencil, a*sizeof(int));
967 memcpy(ret->clues_done, state->clues_done, 4*w*sizeof(unsigned char)); 968 memcpy(ret->clues_done, state->clues_done, 4*w*sizeof(bool));
968 969
969 ret->completed = state->completed; 970 ret->completed = state->completed;
970 ret->cheated = state->cheated; 971 ret->cheated = state->cheated;
@@ -1019,9 +1020,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1019 return out; 1020 return out;
1020} 1021}
1021 1022
1022static int game_can_format_as_text_now(const game_params *params) 1023static bool game_can_format_as_text_now(const game_params *params)
1023{ 1024{
1024 return TRUE; 1025 return true;
1025} 1026}
1026 1027
1027static char *game_text_format(const game_state *state) 1028static char *game_text_format(const game_state *state)
@@ -1106,7 +1107,7 @@ struct game_ui {
1106 * This indicates whether the current highlight is a 1107 * This indicates whether the current highlight is a
1107 * pencil-mark one or a real one. 1108 * pencil-mark one or a real one.
1108 */ 1109 */
1109 int hpencil; 1110 bool hpencil;
1110 /* 1111 /*
1111 * This indicates whether or not we're showing the highlight 1112 * This indicates whether or not we're showing the highlight
1112 * (used to be hx = hy = -1); important so that when we're 1113 * (used to be hx = hy = -1); important so that when we're
@@ -1114,13 +1115,13 @@ struct game_ui {
1114 * fixed position. When hshow = 1, pressing a valid number 1115 * fixed position. When hshow = 1, pressing a valid number
1115 * or letter key or Space will enter that number or letter in the grid. 1116 * or letter key or Space will enter that number or letter in the grid.
1116 */ 1117 */
1117 int hshow; 1118 bool hshow;
1118 /* 1119 /*
1119 * This indicates whether we're using the highlight as a cursor; 1120 * This indicates whether we're using the highlight as a cursor;
1120 * it means that it doesn't vanish on a keypress, and that it is 1121 * it means that it doesn't vanish on a keypress, and that it is
1121 * allowed on immutable squares. 1122 * allowed on immutable squares.
1122 */ 1123 */
1123 int hcursor; 1124 bool hcursor;
1124}; 1125};
1125 1126
1126static game_ui *new_ui(const game_state *state) 1127static game_ui *new_ui(const game_state *state)
@@ -1128,7 +1129,9 @@ static game_ui *new_ui(const game_state *state)
1128 game_ui *ui = snew(game_ui); 1129 game_ui *ui = snew(game_ui);
1129 1130
1130 ui->hx = ui->hy = 0; 1131 ui->hx = ui->hy = 0;
1131 ui->hpencil = ui->hshow = ui->hcursor = 0; 1132 ui->hpencil = false;
1133 ui->hshow = false;
1134 ui->hcursor = false;
1132 1135
1133 return ui; 1136 return ui;
1134} 1137}
@@ -1159,7 +1162,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1159 */ 1162 */
1160 if (ui->hshow && ui->hpencil && !ui->hcursor && 1163 if (ui->hshow && ui->hpencil && !ui->hcursor &&
1161 newstate->grid[ui->hy * w + ui->hx] != 0) { 1164 newstate->grid[ui->hy * w + ui->hx] != 0) {
1162 ui->hshow = 0; 1165 ui->hshow = false;
1163 } 1166 }
1164} 1167}
1165 1168
@@ -1186,27 +1189,28 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1186 1189
1187struct game_drawstate { 1190struct game_drawstate {
1188 int tilesize; 1191 int tilesize;
1189 int three_d; /* default 3D graphics are user-disableable */ 1192 bool three_d; /* default 3D graphics are user-disableable */
1190 int started; 1193 bool started;
1191 long *tiles; /* (w+2)*(w+2) temp space */ 1194 long *tiles; /* (w+2)*(w+2) temp space */
1192 long *drawn; /* (w+2)*(w+2)*4: current drawn data */ 1195 long *drawn; /* (w+2)*(w+2)*4: current drawn data */
1193 int *errtmp; 1196 bool *errtmp;
1194}; 1197};
1195 1198
1196static int check_errors(const game_state *state, int *errors) 1199static bool check_errors(const game_state *state, bool *errors)
1197{ 1200{
1198 int w = state->par.w /*, a = w*w */; 1201 int w = state->par.w /*, a = w*w */;
1199 int W = w+2, A = W*W; /* the errors array is (w+2) square */ 1202 int W = w+2, A = W*W; /* the errors array is (w+2) square */
1200 int *clues = state->clues->clues; 1203 int *clues = state->clues->clues;
1201 digit *grid = state->grid; 1204 digit *grid = state->grid;
1202 int i, x, y, errs = FALSE; 1205 int i, x, y;
1206 bool errs = false;
1203 int tmp[32]; 1207 int tmp[32];
1204 1208
1205 assert(w < lenof(tmp)); 1209 assert(w < lenof(tmp));
1206 1210
1207 if (errors) 1211 if (errors)
1208 for (i = 0; i < A; i++) 1212 for (i = 0; i < A; i++)
1209 errors[i] = 0; 1213 errors[i] = false;
1210 1214
1211 for (y = 0; y < w; y++) { 1215 for (y = 0; y < w; y++) {
1212 unsigned long mask = 0, errmask = 0; 1216 unsigned long mask = 0, errmask = 0;
@@ -1217,12 +1221,12 @@ static int check_errors(const game_state *state, int *errors)
1217 } 1221 }
1218 1222
1219 if (mask != (1L << (w+1)) - (1L << 1)) { 1223 if (mask != (1L << (w+1)) - (1L << 1)) {
1220 errs = TRUE; 1224 errs = true;
1221 errmask &= ~1UL; 1225 errmask &= ~1UL;
1222 if (errors) { 1226 if (errors) {
1223 for (x = 0; x < w; x++) 1227 for (x = 0; x < w; x++)
1224 if (errmask & (1UL << grid[y*w+x])) 1228 if (errmask & (1UL << grid[y*w+x]))
1225 errors[(y+1)*W+(x+1)] = TRUE; 1229 errors[(y+1)*W+(x+1)] = true;
1226 } 1230 }
1227 } 1231 }
1228 } 1232 }
@@ -1236,12 +1240,12 @@ static int check_errors(const game_state *state, int *errors)
1236 } 1240 }
1237 1241
1238 if (mask != (1 << (w+1)) - (1 << 1)) { 1242 if (mask != (1 << (w+1)) - (1 << 1)) {
1239 errs = TRUE; 1243 errs = true;
1240 errmask &= ~1UL; 1244 errmask &= ~1UL;
1241 if (errors) { 1245 if (errors) {
1242 for (y = 0; y < w; y++) 1246 for (y = 0; y < w; y++)
1243 if (errmask & (1UL << grid[y*w+x])) 1247 if (errmask & (1UL << grid[y*w+x]))
1244 errors[(y+1)*W+(x+1)] = TRUE; 1248 errors[(y+1)*W+(x+1)] = true;
1245 } 1249 }
1246 } 1250 }
1247 } 1251 }
@@ -1269,9 +1273,9 @@ static int check_errors(const game_state *state, int *errors)
1269 if (errors) { 1273 if (errors) {
1270 int x, y; 1274 int x, y;
1271 CLUEPOS(x, y, i, w); 1275 CLUEPOS(x, y, i, w);
1272 errors[(y+1)*W+(x+1)] = TRUE; 1276 errors[(y+1)*W+(x+1)] = true;
1273 } 1277 }
1274 errs = TRUE; 1278 errs = true;
1275 } 1279 }
1276 } 1280 }
1277 1281
@@ -1290,7 +1294,7 @@ static int clue_index(const game_state *state, int x, int y)
1290 return -1; 1294 return -1;
1291} 1295}
1292 1296
1293static int is_clue(const game_state *state, int x, int y) 1297static bool is_clue(const game_state *state, int x, int y)
1294{ 1298{
1295 int w = state->par.w; 1299 int w = state->par.w;
1296 1300
@@ -1298,10 +1302,10 @@ static int is_clue(const game_state *state, int x, int y)
1298 ((y == -1 || y == w) && x >= 0 && x < w)) 1302 ((y == -1 || y == w) && x >= 0 && x < w))
1299 { 1303 {
1300 if (state->clues->clues[clue_index(state, x, y)] & DF_DIGIT_MASK) 1304 if (state->clues->clues[clue_index(state, x, y)] & DF_DIGIT_MASK)
1301 return TRUE; 1305 return true;
1302 } 1306 }
1303 1307
1304 return FALSE; 1308 return false;
1305} 1309}
1306 1310
1307static char *interpret_move(const game_state *state, game_ui *ui, 1311static char *interpret_move(const game_state *state, game_ui *ui,
@@ -1309,7 +1313,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1309 int x, int y, int button) 1313 int x, int y, int button)
1310{ 1314{
1311 int w = state->par.w; 1315 int w = state->par.w;
1312 int shift_or_control = button & (MOD_SHFT | MOD_CTRL); 1316 bool shift_or_control = button & (MOD_SHFT | MOD_CTRL);
1313 int tx, ty; 1317 int tx, ty;
1314 char buf[80]; 1318 char buf[80];
1315 1319
@@ -1356,15 +1360,15 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1356 if (tx >= 0 && tx < w && ty >= 0 && ty < w) { 1360 if (tx >= 0 && tx < w && ty >= 0 && ty < w) {
1357 if (button == LEFT_BUTTON) { 1361 if (button == LEFT_BUTTON) {
1358 if (tx == ui->hx && ty == ui->hy && 1362 if (tx == ui->hx && ty == ui->hy &&
1359 ui->hshow && ui->hpencil == 0) { 1363 ui->hshow && !ui->hpencil) {
1360 ui->hshow = 0; 1364 ui->hshow = false;
1361 } else { 1365 } else {
1362 ui->hx = tx; 1366 ui->hx = tx;
1363 ui->hy = ty; 1367 ui->hy = ty;
1364 ui->hshow = !state->clues->immutable[ty*w+tx]; 1368 ui->hshow = !state->clues->immutable[ty*w+tx];
1365 ui->hpencil = 0; 1369 ui->hpencil = false;
1366 } 1370 }
1367 ui->hcursor = 0; 1371 ui->hcursor = false;
1368 return UI_UPDATE; 1372 return UI_UPDATE;
1369 } 1373 }
1370 if (button == RIGHT_BUTTON) { 1374 if (button == RIGHT_BUTTON) {
@@ -1374,17 +1378,17 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1374 if (state->grid[ty*w+tx] == 0) { 1378 if (state->grid[ty*w+tx] == 0) {
1375 if (tx == ui->hx && ty == ui->hy && 1379 if (tx == ui->hx && ty == ui->hy &&
1376 ui->hshow && ui->hpencil) { 1380 ui->hshow && ui->hpencil) {
1377 ui->hshow = 0; 1381 ui->hshow = false;
1378 } else { 1382 } else {
1379 ui->hpencil = 1; 1383 ui->hpencil = true;
1380 ui->hx = tx; 1384 ui->hx = tx;
1381 ui->hy = ty; 1385 ui->hy = ty;
1382 ui->hshow = 1; 1386 ui->hshow = true;
1383 } 1387 }
1384 } else { 1388 } else {
1385 ui->hshow = 0; 1389 ui->hshow = false;
1386 } 1390 }
1387 ui->hcursor = 0; 1391 ui->hcursor = false;
1388 return UI_UPDATE; 1392 return UI_UPDATE;
1389 } 1393 }
1390 } else if (button == LEFT_BUTTON) { 1394 } else if (button == LEFT_BUTTON) {
@@ -1408,14 +1412,15 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1408 } 1412 }
1409 return NULL; 1413 return NULL;
1410 } 1414 }
1411 move_cursor(button, &ui->hx, &ui->hy, w, w, 0); 1415 move_cursor(button, &ui->hx, &ui->hy, w, w, false);
1412 ui->hshow = ui->hcursor = 1; 1416 ui->hshow = true;
1417 ui->hcursor = true;
1413 return UI_UPDATE; 1418 return UI_UPDATE;
1414 } 1419 }
1415 if (ui->hshow && 1420 if (ui->hshow &&
1416 (button == CURSOR_SELECT)) { 1421 (button == CURSOR_SELECT)) {
1417 ui->hpencil = 1 - ui->hpencil; 1422 ui->hpencil = !ui->hpencil;
1418 ui->hcursor = 1; 1423 ui->hcursor = true;
1419 return UI_UPDATE; 1424 return UI_UPDATE;
1420 } 1425 }
1421 1426
@@ -1442,7 +1447,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1442 sprintf(buf, "%c%d,%d,%d", 1447 sprintf(buf, "%c%d,%d,%d",
1443 (char)(ui->hpencil && n > 0 ? 'P' : 'R'), ui->hx, ui->hy, n); 1448 (char)(ui->hpencil && n > 0 ? 'P' : 'R'), ui->hx, ui->hy, n);
1444 1449
1445 if (!ui->hcursor) ui->hshow = 0; 1450 if (!ui->hcursor) ui->hshow = false;
1446 1451
1447 return dupstr(buf); 1452 return dupstr(buf);
1448 } 1453 }
@@ -1460,7 +1465,7 @@ static game_state *execute_move(const game_state *from, const char *move)
1460 int x, y, i, n; 1465 int x, y, i, n;
1461 1466
1462 if (move[0] == 'S') { 1467 if (move[0] == 'S') {
1463 ret->completed = ret->cheated = TRUE; 1468 ret->completed = ret->cheated = true;
1464 1469
1465 for (i = 0; i < a; i++) { 1470 for (i = 0; i < a; i++) {
1466 if (move[i+1] < '1' || move[i+1] > '0'+w) 1471 if (move[i+1] < '1' || move[i+1] > '0'+w)
@@ -1486,7 +1491,7 @@ static game_state *execute_move(const game_state *from, const char *move)
1486 ret->pencil[y*w+x] = 0; 1491 ret->pencil[y*w+x] = 0;
1487 1492
1488 if (!ret->completed && !check_errors(ret, NULL)) 1493 if (!ret->completed && !check_errors(ret, NULL))
1489 ret->completed = TRUE; 1494 ret->completed = true;
1490 } 1495 }
1491 return ret; 1496 return ret;
1492 } else if (move[0] == 'M') { 1497 } else if (move[0] == 'M') {
@@ -1578,12 +1583,12 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1578 1583
1579 ds->tilesize = 0; 1584 ds->tilesize = 0;
1580 ds->three_d = !getenv("TOWERS_2D"); 1585 ds->three_d = !getenv("TOWERS_2D");
1581 ds->started = FALSE; 1586 ds->started = false;
1582 ds->tiles = snewn((w+2)*(w+2), long); 1587 ds->tiles = snewn((w+2)*(w+2), long);
1583 ds->drawn = snewn((w+2)*(w+2)*4, long); 1588 ds->drawn = snewn((w+2)*(w+2)*4, long);
1584 for (i = 0; i < (w+2)*(w+2)*4; i++) 1589 for (i = 0; i < (w+2)*(w+2)*4; i++)
1585 ds->drawn[i] = -1; 1590 ds->drawn[i] = -1;
1586 ds->errtmp = snewn((w+2)*(w+2), int); 1591 ds->errtmp = snewn((w+2)*(w+2), bool);
1587 1592
1588 return ds; 1593 return ds;
1589} 1594}
@@ -1795,7 +1800,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1795 1800
1796 draw_update(dr, 0, 0, SIZE(w), SIZE(w)); 1801 draw_update(dr, 0, 0, SIZE(w), SIZE(w));
1797 1802
1798 ds->started = TRUE; 1803 ds->started = true;
1799 } 1804 }
1800 1805
1801 check_errors(state, ds->errtmp); 1806 check_errors(state, ds->errtmp);
@@ -1903,11 +1908,11 @@ static int game_status(const game_state *state)
1903 return state->completed ? +1 : 0; 1908 return state->completed ? +1 : 0;
1904} 1909}
1905 1910
1906static int game_timing_state(const game_state *state, game_ui *ui) 1911static bool game_timing_state(const game_state *state, game_ui *ui)
1907{ 1912{
1908 if (state->completed) 1913 if (state->completed)
1909 return FALSE; 1914 return false;
1910 return TRUE; 1915 return true;
1911} 1916}
1912 1917
1913static void game_print_size(const game_params *params, float *x, float *y) 1918static void game_print_size(const game_params *params, float *x, float *y)
@@ -1999,15 +2004,15 @@ const struct game thegame = {
1999 encode_params, 2004 encode_params,
2000 free_params, 2005 free_params,
2001 dup_params, 2006 dup_params,
2002 TRUE, game_configure, custom_params, 2007 true, game_configure, custom_params,
2003 validate_params, 2008 validate_params,
2004 new_game_desc, 2009 new_game_desc,
2005 validate_desc, 2010 validate_desc,
2006 new_game, 2011 new_game,
2007 dup_game, 2012 dup_game,
2008 free_game, 2013 free_game,
2009 TRUE, solve_game, 2014 true, solve_game,
2010 TRUE, game_can_format_as_text_now, game_text_format, 2015 true, game_can_format_as_text_now, game_text_format,
2011 new_ui, 2016 new_ui,
2012 free_ui, 2017 free_ui,
2013 encode_ui, 2018 encode_ui,
@@ -2024,9 +2029,9 @@ const struct game thegame = {
2024 game_anim_length, 2029 game_anim_length,
2025 game_flash_length, 2030 game_flash_length,
2026 game_status, 2031 game_status,
2027 TRUE, FALSE, game_print_size, game_print, 2032 true, false, game_print_size, game_print,
2028 FALSE, /* wants_statusbar */ 2033 false, /* wants_statusbar */
2029 FALSE, game_timing_state, 2034 false, game_timing_state,
2030 REQUIRE_RBUTTON | REQUIRE_NUMPAD, /* flags */ 2035 REQUIRE_RBUTTON | REQUIRE_NUMPAD, /* flags */
2031}; 2036};
2032 2037
@@ -2040,15 +2045,16 @@ int main(int argc, char **argv)
2040 game_state *s; 2045 game_state *s;
2041 char *id = NULL, *desc; 2046 char *id = NULL, *desc;
2042 const char *err; 2047 const char *err;
2043 int grade = FALSE; 2048 bool grade = false;
2044 int ret, diff, really_show_working = FALSE; 2049 int ret, diff;
2050 bool really_show_working = false;
2045 2051
2046 while (--argc > 0) { 2052 while (--argc > 0) {
2047 char *p = *++argv; 2053 char *p = *++argv;
2048 if (!strcmp(p, "-v")) { 2054 if (!strcmp(p, "-v")) {
2049 really_show_working = TRUE; 2055 really_show_working = true;
2050 } else if (!strcmp(p, "-g")) { 2056 } else if (!strcmp(p, "-g")) {
2051 grade = TRUE; 2057 grade = true;
2052 } else if (*p == '-') { 2058 } else if (*p == '-') {
2053 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p); 2059 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p);
2054 return 1; 2060 return 1;
@@ -2084,7 +2090,7 @@ int main(int argc, char **argv)
2084 * the puzzle internally before doing anything else. 2090 * the puzzle internally before doing anything else.
2085 */ 2091 */
2086 ret = -1; /* placate optimiser */ 2092 ret = -1; /* placate optimiser */
2087 solver_show_working = FALSE; 2093 solver_show_working = 0;
2088 for (diff = 0; diff < DIFFCOUNT; diff++) { 2094 for (diff = 0; diff < DIFFCOUNT; diff++) {
2089 memcpy(s->grid, s->clues->immutable, p->w * p->w); 2095 memcpy(s->grid, s->clues->immutable, p->w * p->w);
2090 ret = solver(p->w, s->clues->clues, s->grid, diff); 2096 ret = solver(p->w, s->clues->clues, s->grid, diff);
diff --git a/apps/plugins/puzzles/src/tracks.c b/apps/plugins/puzzles/src/tracks.c
index 5122f899f7..8f29faa0fd 100644
--- a/apps/plugins/puzzles/src/tracks.c
+++ b/apps/plugins/puzzles/src/tracks.c
@@ -43,7 +43,8 @@ static char const tracks_diffchars[] = DIFFLIST(ENCODE);
43#define DIFFCONFIG DIFFLIST(CONFIG) 43#define DIFFCONFIG DIFFLIST(CONFIG)
44 44
45struct game_params { 45struct game_params {
46 int w, h, diff, single_ones; 46 int w, h, diff;
47 bool single_ones;
47}; 48};
48 49
49static game_params *default_params(void) 50static game_params *default_params(void)
@@ -52,7 +53,7 @@ static game_params *default_params(void)
52 53
53 ret->w = ret->h = 8; 54 ret->w = ret->h = 8;
54 ret->diff = DIFF_TRICKY; 55 ret->diff = DIFF_TRICKY;
55 ret->single_ones = TRUE; 56 ret->single_ones = true;
56 57
57 return ret; 58 return ret;
58} 59}
@@ -70,13 +71,13 @@ static const struct game_params tracks_presets[] = {
70 {15, 15, DIFF_TRICKY, 1}, 71 {15, 15, DIFF_TRICKY, 1},
71}; 72};
72 73
73static int game_fetch_preset(int i, char **name, game_params **params) 74static bool game_fetch_preset(int i, char **name, game_params **params)
74{ 75{
75 game_params *ret; 76 game_params *ret;
76 char str[80]; 77 char str[80];
77 78
78 if (i < 0 || i >= lenof(tracks_presets)) 79 if (i < 0 || i >= lenof(tracks_presets))
79 return FALSE; 80 return false;
80 81
81 ret = snew(game_params); 82 ret = snew(game_params);
82 *ret = tracks_presets[i]; 83 *ret = tracks_presets[i];
@@ -85,7 +86,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
85 86
86 *name = dupstr(str); 87 *name = dupstr(str);
87 *params = ret; 88 *params = ret;
88 return TRUE; 89 return true;
89} 90}
90 91
91static void free_params(game_params *params) 92static void free_params(game_params *params)
@@ -118,15 +119,15 @@ static void decode_params(game_params *params, char const *string)
118 params->diff = i; 119 params->diff = i;
119 if (*string) string++; 120 if (*string) string++;
120 } 121 }
121 params->single_ones = TRUE; 122 params->single_ones = true;
122 if (*string == 'o') { 123 if (*string == 'o') {
123 params->single_ones = FALSE; 124 params->single_ones = false;
124 string++; 125 string++;
125 } 126 }
126 127
127} 128}
128 129
129static char *encode_params(const game_params *params, int full) 130static char *encode_params(const game_params *params, bool full)
130{ 131{
131 char buf[120]; 132 char buf[120];
132 133
@@ -182,7 +183,7 @@ static game_params *custom_params(const config_item *cfg)
182 return ret; 183 return ret;
183} 184}
184 185
185static const char *validate_params(const game_params *params, int full) 186static const char *validate_params(const game_params *params, bool full)
186{ 187{
187 /* 188 /*
188 * Generating anything under 4x4 runs into trouble of one kind 189 * Generating anything under 4x4 runs into trouble of one kind
@@ -227,7 +228,7 @@ static const char *validate_params(const game_params *params, int full)
227#define BLANK 0 228#define BLANK 0
228#define UNKNOWN 15 229#define UNKNOWN 15
229 230
230int nbits[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 }; 231static const int nbits[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 };
231 232
232/* square grid flags */ 233/* square grid flags */
233#define S_TRACK 1 /* a track passes through this square (--> 2 edges) */ 234#define S_TRACK 1 /* a track passes through this square (--> 2 edges) */
@@ -258,39 +259,43 @@ struct game_state {
258 unsigned int *sflags; /* size w*h */ 259 unsigned int *sflags; /* size w*h */
259 struct numbers *numbers; 260 struct numbers *numbers;
260 int *num_errors; /* size w+h */ 261 int *num_errors; /* size w+h */
261 int completed, used_solve, impossible; 262 bool completed, used_solve, impossible;
262}; 263};
263 264
264/* Return the four directions in which a particular edge flag is set, around a square. */ 265/* Return the four directions in which a particular edge flag is set, around a square. */
265int S_E_DIRS(const game_state *state, int sx, int sy, unsigned int eflag) { 266static int S_E_DIRS(const game_state *state, int sx, int sy,
267 unsigned int eflag) {
266 return (state->sflags[sy*state->p.w+sx] >> 268 return (state->sflags[sy*state->p.w+sx] >>
267 ((eflag == E_TRACK) ? S_TRACK_SHIFT : S_NOTRACK_SHIFT)) & ALLDIR; 269 ((eflag == E_TRACK) ? S_TRACK_SHIFT : S_NOTRACK_SHIFT)) & ALLDIR;
268} 270}
269 271
270/* Count the number of a particular edge flag around a grid square. */ 272/* Count the number of a particular edge flag around a grid square. */
271int S_E_COUNT(const game_state *state, int sx, int sy, unsigned int eflag) { 273static int S_E_COUNT(const game_state *state, int sx, int sy,
274 unsigned int eflag) {
272 return nbits[S_E_DIRS(state, sx, sy, eflag)]; 275 return nbits[S_E_DIRS(state, sx, sy, eflag)];
273} 276}
274 277
275/* Return the two flags (E_TRACK and/or E_NOTRACK) set on a specific 278/* Return the two flags (E_TRACK and/or E_NOTRACK) set on a specific
276 * edge of a square. */ 279 * edge of a square. */
277unsigned S_E_FLAGS(const game_state *state, int sx, int sy, int d) { 280static unsigned S_E_FLAGS(const game_state *state, int sx, int sy, int d) {
278 unsigned f = state->sflags[sy*state->p.w+sx]; 281 unsigned f = state->sflags[sy*state->p.w+sx];
279 int t = (f & (d << S_TRACK_SHIFT)), nt = (f & (d << S_NOTRACK_SHIFT)); 282 int t = (f & (d << S_TRACK_SHIFT)), nt = (f & (d << S_NOTRACK_SHIFT));
280 return (t ? E_TRACK : 0) | (nt ? E_NOTRACK : 0); 283 return (t ? E_TRACK : 0) | (nt ? E_NOTRACK : 0);
281} 284}
282 285
283int S_E_ADJ(const game_state *state, int sx, int sy, int d, int *ax, int *ay, unsigned int *ad) { 286static bool S_E_ADJ(const game_state *state, int sx, int sy, int d, int *ax,
284 if (d == L && sx > 0) { *ax = sx-1; *ay = sy; *ad = R; return 1; } 287 int *ay, unsigned int *ad) {
285 if (d == R && sx < state->p.w-1) { *ax = sx+1; *ay = sy; *ad = L; return 1; } 288 if (d == L && sx > 0) { *ax = sx-1; *ay = sy; *ad = R; return true; }
286 if (d == U && sy > 0) { *ax = sx; *ay = sy-1; *ad = D; return 1; } 289 if (d == R && sx < state->p.w-1) { *ax = sx+1; *ay = sy; *ad = L; return true; }
287 if (d == D && sy < state->p.h-1) { *ax = sx; *ay = sy+1; *ad = U; return 1; } 290 if (d == U && sy > 0) { *ax = sx; *ay = sy-1; *ad = D; return true; }
291 if (d == D && sy < state->p.h-1) { *ax = sx; *ay = sy+1; *ad = U; return true; }
288 292
289 return 0; 293 return false;
290} 294}
291 295
292/* Sets flag (E_TRACK or E_NOTRACK) on a given edge of a square. */ 296/* Sets flag (E_TRACK or E_NOTRACK) on a given edge of a square. */
293void S_E_SET(game_state *state, int sx, int sy, int d, unsigned int eflag) { 297static void S_E_SET(game_state *state, int sx, int sy, int d,
298 unsigned int eflag) {
294 unsigned shift = (eflag == E_TRACK) ? S_TRACK_SHIFT : S_NOTRACK_SHIFT, ad; 299 unsigned shift = (eflag == E_TRACK) ? S_TRACK_SHIFT : S_NOTRACK_SHIFT, ad;
295 int ax, ay; 300 int ax, ay;
296 301
@@ -302,7 +307,8 @@ void S_E_SET(game_state *state, int sx, int sy, int d, unsigned int eflag) {
302} 307}
303 308
304/* Clears flag (E_TRACK or E_NOTRACK) on a given edge of a square. */ 309/* Clears flag (E_TRACK or E_NOTRACK) on a given edge of a square. */
305void S_E_CLEAR(game_state *state, int sx, int sy, int d, unsigned int eflag) { 310static void S_E_CLEAR(game_state *state, int sx, int sy, int d,
311 unsigned int eflag) {
306 unsigned shift = (eflag == E_TRACK) ? S_TRACK_SHIFT : S_NOTRACK_SHIFT, ad; 312 unsigned shift = (eflag == E_TRACK) ? S_TRACK_SHIFT : S_NOTRACK_SHIFT, ad;
307 int ax, ay; 313 int ax, ay;
308 314
@@ -324,7 +330,7 @@ static void clear_game(game_state *state)
324 330
325 memset(state->num_errors, 0, (w+h) * sizeof(int)); 331 memset(state->num_errors, 0, (w+h) * sizeof(int));
326 332
327 state->completed = state->used_solve = state->impossible = FALSE; 333 state->completed = state->used_solve = state->impossible = false;
328} 334}
329 335
330static game_state *blank_game(const game_params *params) 336static game_state *blank_game(const game_params *params)
@@ -388,7 +394,7 @@ static void free_game(game_state *state)
388} 394}
389 395
390#define NDIRS 4 396#define NDIRS 4
391const unsigned int dirs_const[] = { U, D, L, R }; 397static const unsigned int dirs_const[] = { U, D, L, R };
392 398
393static unsigned int find_direction(game_state *state, random_state *rs, 399static unsigned int find_direction(game_state *state, random_state *rs,
394 int x, int y) 400 int x, int y)
@@ -416,7 +422,7 @@ static unsigned int find_direction(game_state *state, random_state *rs,
416 return 0; /* no possible directions left. */ 422 return 0; /* no possible directions left. */
417} 423}
418 424
419static int check_completion(game_state *state, int mark); 425static bool check_completion(game_state *state, bool mark);
420 426
421static void lay_path(game_state *state, random_state *rs) 427static void lay_path(game_state *state, random_state *rs)
422{ 428{
@@ -544,7 +550,7 @@ static int solve_progress(const game_state *state) {
544 return progress; 550 return progress;
545} 551}
546 552
547static int check_phantom_moves(const game_state *state) { 553static bool check_phantom_moves(const game_state *state) {
548 int x, y, i; 554 int x, y, i;
549 555
550 /* Check that this state won't show 'phantom moves' at the start of the 556 /* Check that this state won't show 'phantom moves' at the start of the
@@ -557,10 +563,10 @@ static int check_phantom_moves(const game_state *state) {
557 if (state->sflags[i] & S_CLUE) 563 if (state->sflags[i] & S_CLUE)
558 continue; 564 continue;
559 if (S_E_COUNT(state, x, y, E_TRACK) > 1) 565 if (S_E_COUNT(state, x, y, E_TRACK) > 1)
560 return 1; /* found one! */ 566 return true; /* found one! */
561 } 567 }
562 } 568 }
563 return 0; 569 return false;
564} 570}
565 571
566static int add_clues(game_state *state, random_state *rs, int diff) 572static int add_clues(game_state *state, random_state *rs, int diff)
@@ -685,7 +691,7 @@ done:
685} 691}
686 692
687static char *new_game_desc(const game_params *params, random_state *rs, 693static char *new_game_desc(const game_params *params, random_state *rs,
688 char **aux, int interactive) 694 char **aux, bool interactive)
689{ 695{
690 int i, j, w = params->w, h = params->h, x, y, ret; 696 int i, j, w = params->w, h = params->h, x, y, ret;
691 game_state *state; 697 game_state *state;
@@ -734,7 +740,7 @@ newpath:
734 } 740 }
735 741
736 if (params->single_ones) { 742 if (params->single_ones) {
737 int last_was_one = 1, is_one; /* (disallow 1 clue at entry point) */ 743 bool last_was_one = true, is_one; /* disallow 1 clue at entry point */
738 for (i = 0; i < w+h; i++) { 744 for (i = 0; i < w+h; i++) {
739 is_one = (state->numbers->numbers[i] == 1); 745 is_one = (state->numbers->numbers[i] == 1);
740 if (is_one && last_was_one) 746 if (is_one && last_was_one)
@@ -887,7 +893,7 @@ static int solve_set_sflag(game_state *state, int x, int y,
887 x, y, (f == S_TRACK ? "TRACK" : "NOTRACK"), why)); 893 x, y, (f == S_TRACK ? "TRACK" : "NOTRACK"), why));
888 if (state->sflags[i] & (f == S_TRACK ? S_NOTRACK : S_TRACK)) { 894 if (state->sflags[i] & (f == S_TRACK ? S_NOTRACK : S_TRACK)) {
889 debug(("solve: opposite flag already set there, marking IMPOSSIBLE")); 895 debug(("solve: opposite flag already set there, marking IMPOSSIBLE"));
890 state->impossible = TRUE; 896 state->impossible = true;
891 } 897 }
892 state->sflags[i] |= f; 898 state->sflags[i] |= f;
893 return 1; 899 return 1;
@@ -905,7 +911,7 @@ static int solve_set_eflag(game_state *state, int x, int y, int d,
905 (f == S_TRACK ? "TRACK" : "NOTRACK"), why)); 911 (f == S_TRACK ? "TRACK" : "NOTRACK"), why));
906 if (sf & (f == E_TRACK ? E_NOTRACK : E_TRACK)) { 912 if (sf & (f == E_TRACK ? E_NOTRACK : E_TRACK)) {
907 debug(("solve: opposite flag already set there, marking IMPOSSIBLE")); 913 debug(("solve: opposite flag already set there, marking IMPOSSIBLE"));
908 state->impossible = TRUE; 914 state->impossible = true;
909 } 915 }
910 S_E_SET(state, x, y, d, f); 916 S_E_SET(state, x, y, d, f);
911 return 1; 917 return 1;
@@ -1116,7 +1122,7 @@ static int solve_check_loose_sub(game_state *state, int si, int id, int n,
1116 if (nloose > (target - e2count)) { 1122 if (nloose > (target - e2count)) {
1117 debug(("check %s from (%d,%d): more loose (%d) than empty (%d), IMPOSSIBLE", 1123 debug(("check %s from (%d,%d): more loose (%d) than empty (%d), IMPOSSIBLE",
1118 what, si%w, si/w, nloose, target-e2count)); 1124 what, si%w, si/w, nloose, target-e2count));
1119 state->impossible = TRUE; 1125 state->impossible = true;
1120 } 1126 }
1121 if (nloose > 0 && nloose == (target - e2count)) { 1127 if (nloose > 0 && nloose == (target - e2count)) {
1122 debug(("check %s from (%d,%d): nloose = empty (%d), forcing loners out.", 1128 debug(("check %s from (%d,%d): nloose = empty (%d), forcing loners out.",
@@ -1173,7 +1179,8 @@ static int solve_check_loose_ends(game_state *state)
1173static int solve_check_loop_sub(game_state *state, int x, int y, int dir, 1179static int solve_check_loop_sub(game_state *state, int x, int y, int dir,
1174 int *dsf, int startc, int endc) 1180 int *dsf, int startc, int endc)
1175{ 1181{
1176 int w = state->p.w, h = state->p.h, i = y*w+x, j, k, satisfied = 1; 1182 int w = state->p.w, h = state->p.h, i = y*w+x, j, k;
1183 bool satisfied = true;
1177 1184
1178 j = (y+DY(dir))*w + (x+DX(dir)); 1185 j = (y+DY(dir))*w + (x+DX(dir));
1179 1186
@@ -1203,12 +1210,12 @@ static int solve_check_loop_sub(game_state *state, int x, int y, int dir,
1203 for (k = 0; k < w; k++) { 1210 for (k = 0; k < w; k++) {
1204 int target = state->numbers->numbers[k]; 1211 int target = state->numbers->numbers[k];
1205 int ntracks = solve_count_col(state, k, S_TRACK); 1212 int ntracks = solve_count_col(state, k, S_TRACK);
1206 if (ntracks < target) satisfied = 0; 1213 if (ntracks < target) satisfied = false;
1207 } 1214 }
1208 for (k = 0; k < h; k++) { 1215 for (k = 0; k < h; k++) {
1209 int target = state->numbers->numbers[w+k]; 1216 int target = state->numbers->numbers[w+k];
1210 int ntracks = solve_count_row(state, k, S_TRACK); 1217 int ntracks = solve_count_row(state, k, S_TRACK);
1211 if (ntracks < target) satisfied = 0; 1218 if (ntracks < target) satisfied = false;
1212 } 1219 }
1213 if (!satisfied) { 1220 if (!satisfied) {
1214 return solve_set_eflag(state, x, y, dir, E_NOTRACK, 1221 return solve_set_eflag(state, x, y, dir, E_NOTRACK,
@@ -1282,10 +1289,11 @@ static void solve_discount_edge(game_state *state, int x, int y, int d)
1282 1289
1283static int tracks_solve(game_state *state, int diff) 1290static int tracks_solve(game_state *state, int diff)
1284{ 1291{
1285 int didsth, x, y, w = state->p.w, h = state->p.h; 1292 int x, y, w = state->p.w, h = state->p.h;
1293 bool didsth;
1286 1294
1287 debug(("solve...")); 1295 debug(("solve..."));
1288 state->impossible = FALSE; 1296 state->impossible = false;
1289 1297
1290 /* Set all the outer border edges as no-track. */ 1298 /* Set all the outer border edges as no-track. */
1291 for (x = 0; x < w; x++) { 1299 for (x = 0; x < w; x++) {
@@ -1298,24 +1306,24 @@ static int tracks_solve(game_state *state, int diff)
1298 } 1306 }
1299 1307
1300 while (1) { 1308 while (1) {
1301 didsth = 0; 1309 didsth = false;
1302 1310
1303 didsth += solve_update_flags(state); 1311 didsth |= solve_update_flags(state);
1304 didsth += solve_count_clues(state); 1312 didsth |= solve_count_clues(state);
1305 didsth += solve_check_loop(state); 1313 didsth |= solve_check_loop(state);
1306 1314
1307 if (diff >= DIFF_TRICKY) { 1315 if (diff >= DIFF_TRICKY) {
1308 didsth += solve_check_single(state); 1316 didsth |= solve_check_single(state);
1309 didsth += solve_check_loose_ends(state); 1317 didsth |= solve_check_loose_ends(state);
1310 } 1318 }
1311 1319
1312 if (!didsth || state->impossible) break; 1320 if (!didsth || state->impossible) break;
1313 } 1321 }
1314 1322
1315 return state->impossible ? -1 : check_completion(state, FALSE) ? 1 : 0; 1323 return state->impossible ? -1 : check_completion(state, false) ? 1 : 0;
1316} 1324}
1317 1325
1318static char *move_string_diff(const game_state *before, const game_state *after, int issolve) 1326static char *move_string_diff(const game_state *before, const game_state *after, bool issolve)
1319{ 1327{
1320 int w = after->p.w, h = after->p.h, i, j; 1328 int w = after->p.w, h = after->p.h, i, j;
1321 char *move = snewn(w*h*40, char), *p = move; 1329 char *move = snewn(w*h*40, char), *p = move;
@@ -1382,16 +1390,16 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1382 *error = "Unable to find solution"; 1390 *error = "Unable to find solution";
1383 move = NULL; 1391 move = NULL;
1384 } else { 1392 } else {
1385 move = move_string_diff(currstate, solved, TRUE); 1393 move = move_string_diff(currstate, solved, true);
1386 } 1394 }
1387 1395
1388 free_game(solved); 1396 free_game(solved);
1389 return move; 1397 return move;
1390} 1398}
1391 1399
1392static int game_can_format_as_text_now(const game_params *params) 1400static bool game_can_format_as_text_now(const game_params *params)
1393{ 1401{
1394 return TRUE; 1402 return true;
1395} 1403}
1396 1404
1397static char *game_text_format(const game_state *state) 1405static char *game_text_format(const game_state *state)
@@ -1532,9 +1540,10 @@ static int tracks_neighbour(int vertex, void *vctx)
1532 return -1; 1540 return -1;
1533} 1541}
1534 1542
1535static int check_completion(game_state *state, int mark) 1543static bool check_completion(game_state *state, bool mark)
1536{ 1544{
1537 int w = state->p.w, h = state->p.h, x, y, i, target, ret = TRUE; 1545 int w = state->p.w, h = state->p.h, x, y, i, target;
1546 bool ret = true;
1538 int ntrack, nnotrack, ntrackcomplete; 1547 int ntrack, nnotrack, ntrackcomplete;
1539 int *dsf, pathclass; 1548 int *dsf, pathclass;
1540 struct findloopstate *fls; 1549 struct findloopstate *fls;
@@ -1548,7 +1557,7 @@ static int check_completion(game_state *state, int mark)
1548 state->sflags[i] &= ~S_ERROR; 1557 state->sflags[i] &= ~S_ERROR;
1549 if (S_E_COUNT(state, i%w, i/w, E_TRACK) > 0) { 1558 if (S_E_COUNT(state, i%w, i/w, E_TRACK) > 0) {
1550 if (S_E_COUNT(state, i%w, i/w, E_TRACK) > 2) { 1559 if (S_E_COUNT(state, i%w, i/w, E_TRACK) > 2) {
1551 ret = FALSE; 1560 ret = false;
1552 state->sflags[i] |= S_ERROR; 1561 state->sflags[i] |= S_ERROR;
1553 } 1562 }
1554 } 1563 }
@@ -1577,11 +1586,11 @@ static int check_completion(game_state *state, int mark)
1577 debug(("col %d error: target %d, track %d, notrack %d", 1586 debug(("col %d error: target %d, track %d, notrack %d",
1578 x, target, ntrack, nnotrack)); 1587 x, target, ntrack, nnotrack));
1579 state->num_errors[x] = 1; 1588 state->num_errors[x] = 1;
1580 ret = FALSE; 1589 ret = false;
1581 } 1590 }
1582 } 1591 }
1583 if (ntrackcomplete != target) 1592 if (ntrackcomplete != target)
1584 ret = FALSE; 1593 ret = false;
1585 } 1594 }
1586 for (y = 0; y < h; y++) { 1595 for (y = 0; y < h; y++) {
1587 target = state->numbers->numbers[w+y]; 1596 target = state->numbers->numbers[w+y];
@@ -1600,11 +1609,11 @@ static int check_completion(game_state *state, int mark)
1600 debug(("row %d error: target %d, track %d, notrack %d", 1609 debug(("row %d error: target %d, track %d, notrack %d",
1601 y, target, ntrack, nnotrack)); 1610 y, target, ntrack, nnotrack));
1602 state->num_errors[w+y] = 1; 1611 state->num_errors[w+y] = 1;
1603 ret = FALSE; 1612 ret = false;
1604 } 1613 }
1605 } 1614 }
1606 if (ntrackcomplete != target) 1615 if (ntrackcomplete != target)
1607 ret = FALSE; 1616 ret = false;
1608 } 1617 }
1609 1618
1610 dsf = snewn(w*h, int); 1619 dsf = snewn(w*h, int);
@@ -1621,7 +1630,7 @@ static int check_completion(game_state *state, int mark)
1621 ctx.state = state; 1630 ctx.state = state;
1622 if (findloop_run(fls, w*h, tracks_neighbour, &ctx)) { 1631 if (findloop_run(fls, w*h, tracks_neighbour, &ctx)) {
1623 debug(("loop detected, not complete")); 1632 debug(("loop detected, not complete"));
1624 ret = FALSE; /* no loop allowed */ 1633 ret = false; /* no loop allowed */
1625 if (mark) { 1634 if (mark) {
1626 for (x = 0; x < w; x++) { 1635 for (x = 0; x < w; x++) {
1627 for (y = 0; y < h; y++) { 1636 for (y = 0; y < h; y++) {
@@ -1647,7 +1656,7 @@ static int check_completion(game_state *state, int mark)
1647 if ((dsf_canonify(dsf, i) != pathclass) && 1656 if ((dsf_canonify(dsf, i) != pathclass) &&
1648 ((state->sflags[i] & S_TRACK) || 1657 ((state->sflags[i] & S_TRACK) ||
1649 (S_E_COUNT(state, i%w, i/w, E_TRACK) > 0))) { 1658 (S_E_COUNT(state, i%w, i/w, E_TRACK) > 0))) {
1650 ret = FALSE; 1659 ret = false;
1651 state->sflags[i] |= S_ERROR; 1660 state->sflags[i] |= S_ERROR;
1652 } 1661 }
1653 } 1662 }
@@ -1656,7 +1665,7 @@ static int check_completion(game_state *state, int mark)
1656 * can't be in a winning state. So even if we're not 1665 * can't be in a winning state. So even if we're not
1657 * highlighting any _errors_, we certainly shouldn't 1666 * highlighting any _errors_, we certainly shouldn't
1658 * return true. */ 1667 * return true. */
1659 ret = FALSE; 1668 ret = false;
1660 } 1669 }
1661 } 1670 }
1662 1671
@@ -1669,21 +1678,23 @@ static int check_completion(game_state *state, int mark)
1669/* Code borrowed from Pearl. */ 1678/* Code borrowed from Pearl. */
1670 1679
1671struct game_ui { 1680struct game_ui {
1672 int dragging, clearing, notrack; 1681 bool dragging, clearing, notrack;
1673 int drag_sx, drag_sy, drag_ex, drag_ey; /* drag start and end grid coords */ 1682 int drag_sx, drag_sy, drag_ex, drag_ey; /* drag start and end grid coords */
1674 int clickx, clicky; /* pixel position of initial click */ 1683 int clickx, clicky; /* pixel position of initial click */
1675 1684
1676 int curx, cury; /* grid position of keyboard cursor; uses half-size grid */ 1685 int curx, cury; /* grid position of keyboard cursor; uses half-size grid */
1677 int cursor_active; /* TRUE iff cursor is shown */ 1686 bool cursor_active; /* true iff cursor is shown */
1678}; 1687};
1679 1688
1680static game_ui *new_ui(const game_state *state) 1689static game_ui *new_ui(const game_state *state)
1681{ 1690{
1682 game_ui *ui = snew(game_ui); 1691 game_ui *ui = snew(game_ui);
1683 1692
1684 ui->clearing = ui->notrack = ui->dragging = 0; 1693 ui->clearing = false;
1694 ui->notrack = false;
1695 ui->dragging = false;
1685 ui->drag_sx = ui->drag_sy = ui->drag_ex = ui->drag_ey = -1; 1696 ui->drag_sx = ui->drag_sy = ui->drag_ex = ui->drag_ey = -1;
1686 ui->cursor_active = FALSE; 1697 ui->cursor_active = false;
1687 ui->curx = ui->cury = 1; 1698 ui->curx = ui->cury = 1;
1688 1699
1689 return ui; 1700 return ui;
@@ -1738,7 +1749,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1738 1749
1739struct game_drawstate { 1750struct game_drawstate {
1740 int sz6, grid_line_all, grid_line_tl, grid_line_br; 1751 int sz6, grid_line_all, grid_line_tl, grid_line_br;
1741 int started; 1752 bool started;
1742 1753
1743 int w, h, sz; 1754 int w, h, sz;
1744 unsigned int *flags, *flags_drag; 1755 unsigned int *flags, *flags_drag;
@@ -1753,20 +1764,20 @@ static void update_ui_drag(const game_state *state, game_ui *ui, int gx, int gy)
1753 if (dy == 0) { 1764 if (dy == 0) {
1754 ui->drag_ex = gx < 0 ? 0 : gx >= w ? w-1 : gx; 1765 ui->drag_ex = gx < 0 ? 0 : gx >= w ? w-1 : gx;
1755 ui->drag_ey = ui->drag_sy; 1766 ui->drag_ey = ui->drag_sy;
1756 ui->dragging = TRUE; 1767 ui->dragging = true;
1757 } else if (dx == 0) { 1768 } else if (dx == 0) {
1758 ui->drag_ex = ui->drag_sx; 1769 ui->drag_ex = ui->drag_sx;
1759 ui->drag_ey = gy < 0 ? 0 : gy >= h ? h-1 : gy; 1770 ui->drag_ey = gy < 0 ? 0 : gy >= h ? h-1 : gy;
1760 ui->dragging = TRUE; 1771 ui->dragging = true;
1761 } else { 1772 } else {
1762 ui->drag_ex = ui->drag_sx; 1773 ui->drag_ex = ui->drag_sx;
1763 ui->drag_ey = ui->drag_sy; 1774 ui->drag_ey = ui->drag_sy;
1764 ui->dragging = FALSE; 1775 ui->dragging = false;
1765 } 1776 }
1766} 1777}
1767 1778
1768static int ui_can_flip_edge(const game_state *state, int x, int y, int dir, 1779static bool ui_can_flip_edge(const game_state *state, int x, int y, int dir,
1769 int notrack) 1780 bool notrack)
1770{ 1781{
1771 int w = state->p.w /*, h = state->shared->h, sz = state->shared->sz */; 1782 int w = state->p.w /*, h = state->shared->h, sz = state->shared->sz */;
1772 int x2 = x + DX(dir); 1783 int x2 = x + DX(dir);
@@ -1774,12 +1785,12 @@ static int ui_can_flip_edge(const game_state *state, int x, int y, int dir,
1774 unsigned int sf1, sf2, ef; 1785 unsigned int sf1, sf2, ef;
1775 1786
1776 if (!INGRID(state, x, y) || !INGRID(state, x2, y2)) 1787 if (!INGRID(state, x, y) || !INGRID(state, x2, y2))
1777 return FALSE; 1788 return false;
1778 1789
1779 sf1 = state->sflags[y*w + x]; 1790 sf1 = state->sflags[y*w + x];
1780 sf2 = state->sflags[y2*w + x2]; 1791 sf2 = state->sflags[y2*w + x2];
1781 if ( !notrack && ((sf1 & S_CLUE) || (sf2 & S_CLUE)) ) 1792 if ( !notrack && ((sf1 & S_CLUE) || (sf2 & S_CLUE)) )
1782 return FALSE; 1793 return false;
1783 1794
1784 ef = S_E_FLAGS(state, x, y, dir); 1795 ef = S_E_FLAGS(state, x, y, dir);
1785 if (notrack) { 1796 if (notrack) {
@@ -1788,48 +1799,48 @@ static int ui_can_flip_edge(const game_state *state, int x, int y, int dir,
1788 could be set to TRACK, because we don't know which edges the general 1799 could be set to TRACK, because we don't know which edges the general
1789 square setting refers to. */ 1800 square setting refers to. */
1790 if (!(ef & E_NOTRACK) && (ef & E_TRACK)) 1801 if (!(ef & E_NOTRACK) && (ef & E_TRACK))
1791 return FALSE; 1802 return false;
1792 } else { 1803 } else {
1793 if (!(ef & E_TRACK)) { 1804 if (!(ef & E_TRACK)) {
1794 /* if we're going to _set_ TRACK, make sure neither adjacent square nor 1805 /* if we're going to _set_ TRACK, make sure neither adjacent square nor
1795 the edge itself is already set to NOTRACK. */ 1806 the edge itself is already set to NOTRACK. */
1796 if ((sf1 & S_NOTRACK) || (sf2 & S_NOTRACK) || (ef & E_NOTRACK)) 1807 if ((sf1 & S_NOTRACK) || (sf2 & S_NOTRACK) || (ef & E_NOTRACK))
1797 return FALSE; 1808 return false;
1798 /* if we're going to _set_ TRACK, make sure neither adjacent square has 1809 /* if we're going to _set_ TRACK, make sure neither adjacent square has
1799 2 track flags already. */ 1810 2 track flags already. */
1800 if ((S_E_COUNT(state, x, y, E_TRACK) >= 2) || 1811 if ((S_E_COUNT(state, x, y, E_TRACK) >= 2) ||
1801 (S_E_COUNT(state, x2, y2, E_TRACK) >= 2)) 1812 (S_E_COUNT(state, x2, y2, E_TRACK) >= 2))
1802 return FALSE; 1813 return false;
1803 } 1814 }
1804 } 1815 }
1805 return TRUE; 1816 return true;
1806} 1817}
1807 1818
1808static int ui_can_flip_square(const game_state *state, int x, int y, int notrack) 1819static bool ui_can_flip_square(const game_state *state, int x, int y, bool notrack)
1809{ 1820{
1810 int w = state->p.w, trackc; 1821 int w = state->p.w, trackc;
1811 unsigned sf; 1822 unsigned sf;
1812 1823
1813 if (!INGRID(state, x, y)) return FALSE; 1824 if (!INGRID(state, x, y)) return false;
1814 sf = state->sflags[y*w+x]; 1825 sf = state->sflags[y*w+x];
1815 trackc = S_E_COUNT(state, x, y, E_TRACK); 1826 trackc = S_E_COUNT(state, x, y, E_TRACK);
1816 1827
1817 if (sf & S_CLUE) return FALSE; 1828 if (sf & S_CLUE) return false;
1818 1829
1819 if (notrack) { 1830 if (notrack) {
1820 /* If we're setting S_NOTRACK, we cannot have either S_TRACK or any E_TRACK. */ 1831 /* If we're setting S_NOTRACK, we cannot have either S_TRACK or any E_TRACK. */
1821 if (!(sf & S_NOTRACK) && ((sf & S_TRACK) || (trackc > 0))) 1832 if (!(sf & S_NOTRACK) && ((sf & S_TRACK) || (trackc > 0)))
1822 return FALSE; 1833 return false;
1823 } else { 1834 } else {
1824 /* If we're setting S_TRACK, we cannot have any S_NOTRACK (we could have 1835 /* If we're setting S_TRACK, we cannot have any S_NOTRACK (we could have
1825 E_NOTRACK, though, because one or two wouldn't rule out a track) */ 1836 E_NOTRACK, though, because one or two wouldn't rule out a track) */
1826 if (!(sf & S_TRACK) && (sf & S_NOTRACK)) 1837 if (!(sf & S_TRACK) && (sf & S_NOTRACK))
1827 return FALSE; 1838 return false;
1828 } 1839 }
1829 return TRUE; 1840 return true;
1830} 1841}
1831 1842
1832static char *edge_flip_str(const game_state *state, int x, int y, int dir, int notrack, char *buf) { 1843static char *edge_flip_str(const game_state *state, int x, int y, int dir, bool notrack, char *buf) {
1833 unsigned ef = S_E_FLAGS(state, x, y, dir); 1844 unsigned ef = S_E_FLAGS(state, x, y, dir);
1834 char c; 1845 char c;
1835 1846
@@ -1842,7 +1853,7 @@ static char *edge_flip_str(const game_state *state, int x, int y, int dir, int n
1842 return dupstr(buf); 1853 return dupstr(buf);
1843} 1854}
1844 1855
1845static char *square_flip_str(const game_state *state, int x, int y, int notrack, char *buf) { 1856static char *square_flip_str(const game_state *state, int x, int y, bool notrack, char *buf) {
1846 unsigned f = state->sflags[y*state->p.w+x]; 1857 unsigned f = state->sflags[y*state->p.w+x];
1847 char c; 1858 char c;
1848 1859
@@ -1897,8 +1908,8 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1897 /* --- mouse operations --- */ 1908 /* --- mouse operations --- */
1898 1909
1899 if (IS_MOUSE_DOWN(button)) { 1910 if (IS_MOUSE_DOWN(button)) {
1900 ui->cursor_active = FALSE; 1911 ui->cursor_active = false;
1901 ui->dragging = FALSE; 1912 ui->dragging = false;
1902 1913
1903 if (!INGRID(state, gx, gy)) { 1914 if (!INGRID(state, gx, gy)) {
1904 /* can't drag from off grid */ 1915 /* can't drag from off grid */
@@ -1906,10 +1917,10 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1906 } 1917 }
1907 1918
1908 if (button == RIGHT_BUTTON) { 1919 if (button == RIGHT_BUTTON) {
1909 ui->notrack = TRUE; 1920 ui->notrack = true;
1910 ui->clearing = state->sflags[gy*w+gx] & S_NOTRACK; 1921 ui->clearing = state->sflags[gy*w+gx] & S_NOTRACK;
1911 } else { 1922 } else {
1912 ui->notrack = FALSE; 1923 ui->notrack = false;
1913 ui->clearing = state->sflags[gy*w+gx] & S_TRACK; 1924 ui->clearing = state->sflags[gy*w+gx] & S_TRACK;
1914 } 1925 }
1915 1926
@@ -1922,19 +1933,19 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1922 } 1933 }
1923 1934
1924 if (IS_MOUSE_DRAG(button)) { 1935 if (IS_MOUSE_DRAG(button)) {
1925 ui->cursor_active = FALSE; 1936 ui->cursor_active = false;
1926 update_ui_drag(state, ui, gx, gy); 1937 update_ui_drag(state, ui, gx, gy);
1927 return UI_UPDATE; 1938 return UI_UPDATE;
1928 } 1939 }
1929 1940
1930 if (IS_MOUSE_RELEASE(button)) { 1941 if (IS_MOUSE_RELEASE(button)) {
1931 ui->cursor_active = FALSE; 1942 ui->cursor_active = false;
1932 if (ui->dragging && 1943 if (ui->dragging &&
1933 (ui->drag_sx != ui->drag_ex || ui->drag_sy != ui->drag_ey)) { 1944 (ui->drag_sx != ui->drag_ex || ui->drag_sy != ui->drag_ey)) {
1934 game_state *dragged = copy_and_apply_drag(state, ui); 1945 game_state *dragged = copy_and_apply_drag(state, ui);
1935 char *ret = move_string_diff(state, dragged, FALSE); 1946 char *ret = move_string_diff(state, dragged, false);
1936 1947
1937 ui->dragging = 0; 1948 ui->dragging = false;
1938 free_game(dragged); 1949 free_game(dragged);
1939 1950
1940 return ret; 1951 return ret;
@@ -1944,7 +1955,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1944 /* We might still have been dragging (and just done a one- 1955 /* We might still have been dragging (and just done a one-
1945 * square drag): cancel drag, so undo doesn't make it like 1956 * square drag): cancel drag, so undo doesn't make it like
1946 * a drag-in-progress. */ 1957 * a drag-in-progress. */
1947 ui->dragging = 0; 1958 ui->dragging = false;
1948 1959
1949 /* Click (or tiny drag). Work out which edge we were 1960 /* Click (or tiny drag). Work out which edge we were
1950 * closest to. */ 1961 * closest to. */
@@ -1992,7 +2003,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1992 int dy = (button == CURSOR_DOWN) ? +1 : ((button == CURSOR_UP) ? -1 : 0); 2003 int dy = (button == CURSOR_DOWN) ? +1 : ((button == CURSOR_UP) ? -1 : 0);
1993 2004
1994 if (!ui->cursor_active) { 2005 if (!ui->cursor_active) {
1995 ui->cursor_active = TRUE; 2006 ui->cursor_active = true;
1996 return UI_UPDATE; 2007 return UI_UPDATE;
1997 } 2008 }
1998 2009
@@ -2009,7 +2020,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
2009 2020
2010 if (IS_CURSOR_SELECT(button)) { 2021 if (IS_CURSOR_SELECT(button)) {
2011 if (!ui->cursor_active) { 2022 if (!ui->cursor_active) {
2012 ui->cursor_active = TRUE; 2023 ui->cursor_active = true;
2013 return UI_UPDATE; 2024 return UI_UPDATE;
2014 } 2025 }
2015 /* click on square corner does nothing (shouldn't get here) */ 2026 /* click on square corner does nothing (shouldn't get here) */
@@ -2052,7 +2063,7 @@ static game_state *execute_move(const game_state *state, const char *move)
2052 while (*move) { 2063 while (*move) {
2053 c = *move; 2064 c = *move;
2054 if (c == 'S') { 2065 if (c == 'S') {
2055 ret->used_solve = TRUE; 2066 ret->used_solve = true;
2056 move++; 2067 move++;
2057 } else if (c == 'T' || c == 't' || c == 'N' || c == 'n') { 2068 } else if (c == 'T' || c == 't' || c == 'N' || c == 'n') {
2058 /* set track, clear track; set notrack, clear notrack */ 2069 /* set track, clear track; set notrack, clear notrack */
@@ -2094,7 +2105,7 @@ static game_state *execute_move(const game_state *state, const char *move)
2094 goto badmove; 2105 goto badmove;
2095 } 2106 }
2096 2107
2097 check_completion(ret, TRUE); 2108 check_completion(ret, true);
2098 2109
2099 return ret; 2110 return ret;
2100 2111
@@ -2186,7 +2197,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
2186 int i; 2197 int i;
2187 2198
2188 ds->sz6 = 0; 2199 ds->sz6 = 0;
2189 ds->started = FALSE; 2200 ds->started = false;
2190 2201
2191 ds->w = state->p.w; 2202 ds->w = state->p.w;
2192 ds->h = state->p.h; 2203 ds->h = state->p.h;
@@ -2427,9 +2438,9 @@ static void draw_clue(drawing *dr, game_drawstate *ds, int w, int clue, int i, i
2427 cy = CENTERED_COORD(i-w); 2438 cy = CENTERED_COORD(i-w);
2428 } 2439 }
2429 2440
2430 draw_rect(dr, cx - tsz + GRID_LINE_TL, cy - tsz + GRID_LINE_TL, 2441 if (bg >= 0)
2431 TILE_SIZE - GRID_LINE_ALL, TILE_SIZE - GRID_LINE_ALL, 2442 draw_rect(dr, cx - tsz + GRID_LINE_TL, cy - tsz + GRID_LINE_TL,
2432 bg); 2443 TILE_SIZE - GRID_LINE_ALL, TILE_SIZE - GRID_LINE_ALL, bg);
2433 sprintf(buf, "%d", clue); 2444 sprintf(buf, "%d", clue);
2434 draw_text(dr, cx, cy, FONT_VARIABLE, tsz, ALIGN_VCENTRE|ALIGN_HCENTRE, 2445 draw_text(dr, cx, cy, FONT_VARIABLE, tsz, ALIGN_VCENTRE|ALIGN_HCENTRE,
2435 col, buf); 2446 col, buf);
@@ -2486,7 +2497,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds, const game_state *oldst
2486 const game_state *state, int dir, const game_ui *ui, 2497 const game_state *state, int dir, const game_ui *ui,
2487 float animtime, float flashtime) 2498 float animtime, float flashtime)
2488{ 2499{
2489 int i, x, y, force = 0, flashing = 0, w = ds->w, h = ds->h; 2500 int i, x, y, flashing = 0, w = ds->w, h = ds->h;
2501 bool force = false;
2490 game_state *drag_state = NULL; 2502 game_state *drag_state = NULL;
2491 2503
2492 if (!ds->started) { 2504 if (!ds->started) {
@@ -2507,8 +2519,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds, const game_state *oldst
2507 2519
2508 draw_update(dr, 0, 0, (w+2)*TILE_SIZE + 2*BORDER, (h+2)*TILE_SIZE + 2*BORDER); 2520 draw_update(dr, 0, 0, (w+2)*TILE_SIZE + 2*BORDER, (h+2)*TILE_SIZE + 2*BORDER);
2509 2521
2510 ds->started = TRUE; 2522 ds->started = true;
2511 force = 1; 2523 force = true;
2512 } 2524 }
2513 2525
2514 for (i = 0; i < w+h; i++) { 2526 for (i = 0; i < w+h; i++) {
@@ -2567,9 +2579,9 @@ static int game_status(const game_state *state)
2567 return state->completed ? +1 : 0; 2579 return state->completed ? +1 : 0;
2568} 2580}
2569 2581
2570static int game_timing_state(const game_state *state, game_ui *ui) 2582static bool game_timing_state(const game_state *state, game_ui *ui)
2571{ 2583{
2572 return TRUE; 2584 return true;
2573} 2585}
2574 2586
2575static void game_print_size(const game_params *params, float *x, float *y) 2587static void game_print_size(const game_params *params, float *x, float *y)
@@ -2606,8 +2618,7 @@ static void game_print(drawing *dr, const game_state *state, int tilesize)
2606 2618
2607 /* clue numbers, and loop ends */ 2619 /* clue numbers, and loop ends */
2608 for (i = 0; i < w+h; i++) 2620 for (i = 0; i < w+h; i++)
2609 draw_clue(dr, ds, w, state->numbers->numbers[i], i, 2621 draw_clue(dr, ds, w, state->numbers->numbers[i], i, black, -1);
2610 black, COL_BACKGROUND);
2611 draw_loop_ends(dr, ds, state, black); 2622 draw_loop_ends(dr, ds, state, black);
2612 2623
2613 /* clue tracks / solution */ 2624 /* clue tracks / solution */
@@ -2633,15 +2644,15 @@ const struct game thegame = {
2633 encode_params, 2644 encode_params,
2634 free_params, 2645 free_params,
2635 dup_params, 2646 dup_params,
2636 TRUE, game_configure, custom_params, 2647 true, game_configure, custom_params,
2637 validate_params, 2648 validate_params,
2638 new_game_desc, 2649 new_game_desc,
2639 validate_desc, 2650 validate_desc,
2640 new_game, 2651 new_game,
2641 dup_game, 2652 dup_game,
2642 free_game, 2653 free_game,
2643 TRUE, solve_game, 2654 true, solve_game,
2644 TRUE, game_can_format_as_text_now, game_text_format, 2655 true, game_can_format_as_text_now, game_text_format,
2645 new_ui, 2656 new_ui,
2646 free_ui, 2657 free_ui,
2647 encode_ui, 2658 encode_ui,
@@ -2658,9 +2669,9 @@ const struct game thegame = {
2658 game_anim_length, 2669 game_anim_length,
2659 game_flash_length, 2670 game_flash_length,
2660 game_status, 2671 game_status,
2661 TRUE, FALSE, game_print_size, game_print, 2672 true, false, game_print_size, game_print,
2662 FALSE, /* wants_statusbar */ 2673 false, /* wants_statusbar */
2663 FALSE, game_timing_state, 2674 false, game_timing_state,
2664 0, /* flags */ 2675 0, /* flags */
2665}; 2676};
2666 2677
diff --git a/apps/plugins/puzzles/src/tree234.c b/apps/plugins/puzzles/src/tree234.c
index 4b3151ee2f..ad8eb047cd 100644
--- a/apps/plugins/puzzles/src/tree234.c
+++ b/apps/plugins/puzzles/src/tree234.c
@@ -1337,7 +1337,7 @@ static node234 *split234_internal(tree234 *t, int index) {
1337 * over to it until it is greater than minimum 1337 * over to it until it is greater than minimum
1338 * size. 1338 * size.
1339 */ 1339 */
1340 int undersized = (!sub->elems[0]); 1340 bool undersized = (!sub->elems[0]);
1341 LOG((" child %d is %ssize\n", ki, 1341 LOG((" child %d is %ssize\n", ki,
1342 undersized ? "under" : "minimum-")); 1342 undersized ? "under" : "minimum-"));
1343 LOG((" neighbour is %s\n", 1343 LOG((" neighbour is %s\n",
@@ -1376,7 +1376,7 @@ static node234 *split234_internal(tree234 *t, int index) {
1376 t->root = halves[1]; 1376 t->root = halves[1];
1377 return halves[0]; 1377 return halves[0];
1378} 1378}
1379tree234 *splitpos234(tree234 *t, int index, int before) { 1379tree234 *splitpos234(tree234 *t, int index, bool before) {
1380 tree234 *ret; 1380 tree234 *ret;
1381 node234 *n; 1381 node234 *n;
1382 int count; 1382 int count;
@@ -1400,16 +1400,16 @@ tree234 *splitpos234(tree234 *t, int index, int before) {
1400 return ret; 1400 return ret;
1401} 1401}
1402tree234 *split234(tree234 *t, void *e, cmpfn234 cmp, int rel) { 1402tree234 *split234(tree234 *t, void *e, cmpfn234 cmp, int rel) {
1403 int before; 1403 bool before;
1404 int index; 1404 int index;
1405 1405
1406 assert(rel != REL234_EQ); 1406 assert(rel != REL234_EQ);
1407 1407
1408 if (rel == REL234_GT || rel == REL234_GE) { 1408 if (rel == REL234_GT || rel == REL234_GE) {
1409 before = 1; 1409 before = true;
1410 rel = (rel == REL234_GT ? REL234_LE : REL234_LT); 1410 rel = (rel == REL234_GT ? REL234_LE : REL234_LT);
1411 } else { 1411 } else {
1412 before = 0; 1412 before = false;
1413 } 1413 }
1414 if (!findrelpos234(t, e, cmp, rel, &index)) 1414 if (!findrelpos234(t, e, cmp, rel, &index))
1415 index = 0; 1415 index = 0;
@@ -2012,7 +2012,7 @@ void splittest(tree234 *tree, void **array, int arraylen) {
2012 tree234 *tree3, *tree4; 2012 tree234 *tree3, *tree4;
2013 for (i = 0; i <= arraylen; i++) { 2013 for (i = 0; i <= arraylen; i++) {
2014 tree3 = copytree234(tree, NULL, NULL); 2014 tree3 = copytree234(tree, NULL, NULL);
2015 tree4 = splitpos234(tree3, i, 0); 2015 tree4 = splitpos234(tree3, i, false);
2016 verifytree(tree3, array, i); 2016 verifytree(tree3, array, i);
2017 verifytree(tree4, array+i, arraylen-i); 2017 verifytree(tree4, array+i, arraylen-i);
2018 join234(tree3, tree4); 2018 join234(tree3, tree4);
diff --git a/apps/plugins/puzzles/src/tree234.h b/apps/plugins/puzzles/src/tree234.h
index f75c8f7fb3..ccd943d69d 100644
--- a/apps/plugins/puzzles/src/tree234.h
+++ b/apps/plugins/puzzles/src/tree234.h
@@ -28,6 +28,8 @@
28#ifndef TREE234_H 28#ifndef TREE234_H
29#define TREE234_H 29#define TREE234_H
30 30
31#include <stdbool.h>
32
31/* 33/*
32 * This typedef is opaque outside tree234.c itself. 34 * This typedef is opaque outside tree234.c itself.
33 */ 35 */
@@ -162,9 +164,9 @@ int count234(tree234 *t);
162/* 164/*
163 * Split a tree234 into two valid tree234s. 165 * Split a tree234 into two valid tree234s.
164 * 166 *
165 * splitpos234 splits at a given index. If `before' is TRUE, the 167 * splitpos234 splits at a given index. If `before' is true, the
166 * items at and after that index are left in t and the ones before 168 * items at and after that index are left in t and the ones before
167 * are returned; if `before' is FALSE, the items before that index 169 * are returned; if `before' is false, the items before that index
168 * are left in t and the rest are returned. 170 * are left in t and the rest are returned.
169 * 171 *
170 * split234 splits at a given key. You can pass any of the 172 * split234 splits at a given key. You can pass any of the
@@ -172,7 +174,7 @@ int count234(tree234 *t);
172 * in the tree that satisfy the relation are returned; the 174 * in the tree that satisfy the relation are returned; the
173 * remainder are left. 175 * remainder are left.
174 */ 176 */
175tree234 *splitpos234(tree234 *t, int index, int before); 177tree234 *splitpos234(tree234 *t, int index, bool before);
176tree234 *split234(tree234 *t, void *e, cmpfn234 cmp, int rel); 178tree234 *split234(tree234 *t, void *e, cmpfn234 cmp, int rel);
177 179
178/* 180/*
diff --git a/apps/plugins/puzzles/src/twiddle.c b/apps/plugins/puzzles/src/twiddle.c
index 600f445145..1d91559e37 100644
--- a/apps/plugins/puzzles/src/twiddle.c
+++ b/apps/plugins/puzzles/src/twiddle.c
@@ -37,17 +37,17 @@ enum {
37 37
38struct game_params { 38struct game_params {
39 int w, h, n; 39 int w, h, n;
40 int rowsonly; 40 bool rowsonly;
41 int orientable; 41 bool orientable;
42 int movetarget; 42 int movetarget;
43}; 43};
44 44
45struct game_state { 45struct game_state {
46 int w, h, n; 46 int w, h, n;
47 int orientable; 47 bool orientable;
48 int *grid; 48 int *grid;
49 int completed; 49 int completed;
50 int used_solve; /* used to suppress completion flash */ 50 bool used_solve; /* used to suppress completion flash */
51 int movecount, movetarget; 51 int movecount, movetarget;
52 int lastx, lasty, lastr; /* coordinates of last rotation */ 52 int lastx, lasty, lastr; /* coordinates of last rotation */
53}; 53};
@@ -58,7 +58,7 @@ static game_params *default_params(void)
58 58
59 ret->w = ret->h = 3; 59 ret->w = ret->h = 3;
60 ret->n = 2; 60 ret->n = 2;
61 ret->rowsonly = ret->orientable = FALSE; 61 ret->rowsonly = ret->orientable = false;
62 ret->movetarget = 0; 62 ret->movetarget = 0;
63 63
64 return ret; 64 return ret;
@@ -77,36 +77,37 @@ static game_params *dup_params(const game_params *params)
77 return ret; 77 return ret;
78} 78}
79 79
80static int game_fetch_preset(int i, char **name, game_params **params) 80static bool game_fetch_preset(int i, char **name, game_params **params)
81{ 81{
82 static struct { 82 static struct {
83 const char *title; 83 const char *title;
84 game_params params; 84 game_params params;
85 } const presets[] = { 85 } const presets[] = {
86 { "3x3 rows only", { 3, 3, 2, TRUE, FALSE } }, 86 { "3x3 rows only", { 3, 3, 2, true, false } },
87 { "3x3 normal", { 3, 3, 2, FALSE, FALSE } }, 87 { "3x3 normal", { 3, 3, 2, false, false } },
88 { "3x3 orientable", { 3, 3, 2, FALSE, TRUE } }, 88 { "3x3 orientable", { 3, 3, 2, false, true } },
89 { "4x4 normal", { 4, 4, 2, FALSE } }, 89 { "4x4 normal", { 4, 4, 2, false } },
90 { "4x4 orientable", { 4, 4, 2, FALSE, TRUE } }, 90 { "4x4 orientable", { 4, 4, 2, false, true } },
91 { "4x4, rotating 3x3 blocks", { 4, 4, 3, FALSE } }, 91 { "4x4, rotating 3x3 blocks", { 4, 4, 3, false } },
92 { "5x5, rotating 3x3 blocks", { 5, 5, 3, FALSE } }, 92 { "5x5, rotating 3x3 blocks", { 5, 5, 3, false } },
93 { "6x6, rotating 4x4 blocks", { 6, 6, 4, FALSE } }, 93 { "6x6, rotating 4x4 blocks", { 6, 6, 4, false } },
94 }; 94 };
95 95
96 if (i < 0 || i >= lenof(presets)) 96 if (i < 0 || i >= lenof(presets))
97 return FALSE; 97 return false;
98 98
99 *name = dupstr(presets[i].title); 99 *name = dupstr(presets[i].title);
100 *params = dup_params(&presets[i].params); 100 *params = dup_params(&presets[i].params);
101 101
102 return TRUE; 102 return true;
103} 103}
104 104
105static void decode_params(game_params *ret, char const *string) 105static void decode_params(game_params *ret, char const *string)
106{ 106{
107 ret->w = ret->h = atoi(string); 107 ret->w = ret->h = atoi(string);
108 ret->n = 2; 108 ret->n = 2;
109 ret->rowsonly = ret->orientable = FALSE; 109 ret->rowsonly = false;
110 ret->orientable = false;
110 ret->movetarget = 0; 111 ret->movetarget = 0;
111 while (*string && isdigit((unsigned char)*string)) string++; 112 while (*string && isdigit((unsigned char)*string)) string++;
112 if (*string == 'x') { 113 if (*string == 'x') {
@@ -121,9 +122,9 @@ static void decode_params(game_params *ret, char const *string)
121 } 122 }
122 while (*string) { 123 while (*string) {
123 if (*string == 'r') { 124 if (*string == 'r') {
124 ret->rowsonly = TRUE; 125 ret->rowsonly = true;
125 } else if (*string == 'o') { 126 } else if (*string == 'o') {
126 ret->orientable = TRUE; 127 ret->orientable = true;
127 } else if (*string == 'm') { 128 } else if (*string == 'm') {
128 string++; 129 string++;
129 ret->movetarget = atoi(string); 130 ret->movetarget = atoi(string);
@@ -133,7 +134,7 @@ static void decode_params(game_params *ret, char const *string)
133 } 134 }
134} 135}
135 136
136static char *encode_params(const game_params *params, int full) 137static char *encode_params(const game_params *params, bool full)
137{ 138{
138 char buf[256]; 139 char buf[256];
139 sprintf(buf, "%dx%dn%d%s%s", params->w, params->h, params->n, 140 sprintf(buf, "%dx%dn%d%s%s", params->w, params->h, params->n,
@@ -201,7 +202,7 @@ static game_params *custom_params(const config_item *cfg)
201 return ret; 202 return ret;
202} 203}
203 204
204static const char *validate_params(const game_params *params, int full) 205static const char *validate_params(const game_params *params, bool full)
205{ 206{
206 if (params->n < 2) 207 if (params->n < 2)
207 return "Rotating block size must be at least two"; 208 return "Rotating block size must be at least two";
@@ -222,7 +223,7 @@ static const char *validate_params(const game_params *params, int full)
222 * the centre is good for a user interface, but too inconvenient to 223 * the centre is good for a user interface, but too inconvenient to
223 * use internally.) 224 * use internally.)
224 */ 225 */
225static void do_rotate(int *grid, int w, int h, int n, int orientable, 226static void do_rotate(int *grid, int w, int h, int n, bool orientable,
226 int x, int y, int dir) 227 int x, int y, int dir)
227{ 228{
228 int i, j; 229 int i, j;
@@ -285,23 +286,23 @@ static void do_rotate(int *grid, int w, int h, int n, int orientable,
285 } 286 }
286} 287}
287 288
288static int grid_complete(int *grid, int wh, int orientable) 289static bool grid_complete(int *grid, int wh, bool orientable)
289{ 290{
290 int ok = TRUE; 291 bool ok = true;
291 int i; 292 int i;
292 for (i = 1; i < wh; i++) 293 for (i = 1; i < wh; i++)
293 if (grid[i] < grid[i-1]) 294 if (grid[i] < grid[i-1])
294 ok = FALSE; 295 ok = false;
295 if (orientable) { 296 if (orientable) {
296 for (i = 0; i < wh; i++) 297 for (i = 0; i < wh; i++)
297 if (grid[i] & 3) 298 if (grid[i] & 3)
298 ok = FALSE; 299 ok = false;
299 } 300 }
300 return ok; 301 return ok;
301} 302}
302 303
303static char *new_game_desc(const game_params *params, random_state *rs, 304static char *new_game_desc(const game_params *params, random_state *rs,
304 char **aux, int interactive) 305 char **aux, bool interactive)
305{ 306{
306 int *grid; 307 int *grid;
307 int w = params->w, h = params->h, n = params->n, wh = w*h; 308 int w = params->w, h = params->h, n = params->n, wh = w*h;
@@ -466,7 +467,7 @@ static game_state *new_game(midend *me, const game_params *params,
466 state->n = n; 467 state->n = n;
467 state->orientable = params->orientable; 468 state->orientable = params->orientable;
468 state->completed = 0; 469 state->completed = 0;
469 state->used_solve = FALSE; 470 state->used_solve = false;
470 state->movecount = 0; 471 state->movecount = 0;
471 state->movetarget = params->movetarget; 472 state->movetarget = params->movetarget;
472 state->lastx = state->lasty = state->lastr = -1; 473 state->lastx = state->lasty = state->lastr = -1;
@@ -540,15 +541,16 @@ static char *solve_game(const game_state *state, const game_state *currstate,
540 return dupstr("S"); 541 return dupstr("S");
541} 542}
542 543
543static int game_can_format_as_text_now(const game_params *params) 544static bool game_can_format_as_text_now(const game_params *params)
544{ 545{
545 return TRUE; 546 return true;
546} 547}
547 548
548static char *game_text_format(const game_state *state) 549static char *game_text_format(const game_state *state)
549{ 550{
550 char *ret, *p, buf[80]; 551 char *ret, *p, buf[80];
551 int i, x, y, col, o, maxlen; 552 int i, x, y, col, maxlen;
553 bool o = state->orientable;
552 554
553 /* 555 /*
554 * First work out how many characters we need to display each 556 * First work out how many characters we need to display each
@@ -560,7 +562,6 @@ static char *game_text_format(const game_state *state)
560 x = sprintf(buf, "%d", state->grid[i] / 4); 562 x = sprintf(buf, "%d", state->grid[i] / 4);
561 if (col < x) col = x; 563 if (col < x) col = x;
562 } 564 }
563 o = (state->orientable ? 1 : 0);
564 565
565 /* 566 /*
566 * Now we know the exact total size of the grid we're going to 567 * Now we know the exact total size of the grid we're going to
@@ -594,7 +595,7 @@ static char *game_text_format(const game_state *state)
594 595
595struct game_ui { 596struct game_ui {
596 int cur_x, cur_y; 597 int cur_x, cur_y;
597 int cur_visible; 598 bool cur_visible;
598}; 599};
599 600
600static game_ui *new_ui(const game_state *state) 601static game_ui *new_ui(const game_state *state)
@@ -603,7 +604,7 @@ static game_ui *new_ui(const game_state *state)
603 604
604 ui->cur_x = 0; 605 ui->cur_x = 0;
605 ui->cur_y = 0; 606 ui->cur_y = 0;
606 ui->cur_visible = FALSE; 607 ui->cur_visible = false;
607 608
608 return ui; 609 return ui;
609} 610}
@@ -628,7 +629,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
628} 629}
629 630
630struct game_drawstate { 631struct game_drawstate {
631 int started; 632 bool started;
632 int w, h, bgcolour; 633 int w, h, bgcolour;
633 int *grid; 634 int *grid;
634 int tilesize; 635 int tilesize;
@@ -654,7 +655,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
654 ui->cur_y--; 655 ui->cur_y--;
655 if (button == CURSOR_DOWN && (ui->cur_y+n) < (h)) 656 if (button == CURSOR_DOWN && (ui->cur_y+n) < (h))
656 ui->cur_y++; 657 ui->cur_y++;
657 ui->cur_visible = 1; 658 ui->cur_visible = true;
658 return UI_UPDATE; 659 return UI_UPDATE;
659 } 660 }
660 661
@@ -671,14 +672,14 @@ static char *interpret_move(const game_state *state, game_ui *ui,
671 dir = (button == LEFT_BUTTON ? 1 : -1); 672 dir = (button == LEFT_BUTTON ? 1 : -1);
672 if (x < 0 || x > w-n || y < 0 || y > h-n) 673 if (x < 0 || x > w-n || y < 0 || y > h-n)
673 return NULL; 674 return NULL;
674 ui->cur_visible = 0; 675 ui->cur_visible = false;
675 } else if (IS_CURSOR_SELECT(button)) { 676 } else if (IS_CURSOR_SELECT(button)) {
676 if (ui->cur_visible) { 677 if (ui->cur_visible) {
677 x = ui->cur_x; 678 x = ui->cur_x;
678 y = ui->cur_y; 679 y = ui->cur_y;
679 dir = (button == CURSOR_SELECT2) ? -1 : +1; 680 dir = (button == CURSOR_SELECT2) ? -1 : +1;
680 } else { 681 } else {
681 ui->cur_visible = 1; 682 ui->cur_visible = true;
682 return UI_UPDATE; 683 return UI_UPDATE;
683 } 684 }
684 } else if (button == 'a' || button == 'A' || button==MOD_NUM_KEYPAD+'7') { 685 } else if (button == 'a' || button == 'A' || button==MOD_NUM_KEYPAD+'7') {
@@ -747,7 +748,7 @@ static game_state *execute_move(const game_state *from, const char *move)
747 qsort(ret->grid, ret->w*ret->h, sizeof(int), compare_int); 748 qsort(ret->grid, ret->w*ret->h, sizeof(int), compare_int);
748 for (i = 0; i < ret->w*ret->h; i++) 749 for (i = 0; i < ret->w*ret->h; i++)
749 ret->grid[i] &= ~3; 750 ret->grid[i] &= ~3;
750 ret->used_solve = TRUE; 751 ret->used_solve = true;
751 ret->completed = ret->movecount = 1; 752 ret->completed = ret->movecount = 1;
752 753
753 return ret; 754 return ret;
@@ -823,7 +824,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
823 struct game_drawstate *ds = snew(struct game_drawstate); 824 struct game_drawstate *ds = snew(struct game_drawstate);
824 int i; 825 int i;
825 826
826 ds->started = FALSE; 827 ds->started = false;
827 ds->w = state->w; 828 ds->w = state->w;
828 ds->h = state->h; 829 ds->h = state->h;
829 ds->bgcolour = COL_BACKGROUND; 830 ds->bgcolour = COL_BACKGROUND;
@@ -1093,12 +1094,13 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1093 int i, bgcolour; 1094 int i, bgcolour;
1094 struct rotation srot, *rot; 1095 struct rotation srot, *rot;
1095 int lastx = -1, lasty = -1, lastr = -1; 1096 int lastx = -1, lasty = -1, lastr = -1;
1096 int cx, cy, cmoved = 0, n = state->n; 1097 int cx, cy, n = state->n;
1098 bool cmoved = false;
1097 1099
1098 cx = ui->cur_visible ? ui->cur_x : -state->n; 1100 cx = ui->cur_visible ? ui->cur_x : -state->n;
1099 cy = ui->cur_visible ? ui->cur_y : -state->n; 1101 cy = ui->cur_visible ? ui->cur_y : -state->n;
1100 if (cx != ds->cur_x || cy != ds->cur_y) 1102 if (cx != ds->cur_x || cy != ds->cur_y)
1101 cmoved = 1; 1103 cmoved = true;
1102 1104
1103 if (flashtime > 0) { 1105 if (flashtime > 0) {
1104 int frame = (int)(flashtime / FLASH_FRAME); 1106 int frame = (int)(flashtime / FLASH_FRAME);
@@ -1135,7 +1137,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1135 coords[0] = COORD(0) - HIGHLIGHT_WIDTH; 1137 coords[0] = COORD(0) - HIGHLIGHT_WIDTH;
1136 draw_polygon(dr, coords, 5, COL_LOWLIGHT, COL_LOWLIGHT); 1138 draw_polygon(dr, coords, 5, COL_LOWLIGHT, COL_LOWLIGHT);
1137 1139
1138 ds->started = TRUE; 1140 ds->started = true;
1139 } 1141 }
1140 1142
1141 /* 1143 /*
@@ -1183,7 +1185,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1183 * Now draw each tile. 1185 * Now draw each tile.
1184 */ 1186 */
1185 for (i = 0; i < state->w * state->h; i++) { 1187 for (i = 0; i < state->w * state->h; i++) {
1186 int t, cc = 0; 1188 int t;
1189 bool cc = false;
1187 int tx = i % state->w, ty = i / state->w; 1190 int tx = i % state->w, ty = i / state->w;
1188 1191
1189 /* 1192 /*
@@ -1203,10 +1206,10 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1203 if (cmoved) { 1206 if (cmoved) {
1204 /* cursor has moved (or changed visibility)... */ 1207 /* cursor has moved (or changed visibility)... */
1205 if (tx == cx || tx == cx+n-1 || ty == cy || ty == cy+n-1) 1208 if (tx == cx || tx == cx+n-1 || ty == cy || ty == cy+n-1)
1206 cc = 1; /* ...we're on new cursor, redraw */ 1209 cc = true; /* ...we're on new cursor, redraw */
1207 if (tx == ds->cur_x || tx == ds->cur_x+n-1 || 1210 if (tx == ds->cur_x || tx == ds->cur_x+n-1 ||
1208 ty == ds->cur_y || ty == ds->cur_y+n-1) 1211 ty == ds->cur_y || ty == ds->cur_y+n-1)
1209 cc = 1; /* ...we were on old cursor, redraw */ 1212 cc = true; /* ...we were on old cursor, redraw */
1210 } 1213 }
1211 1214
1212 if (ds->bgcolour != bgcolour || /* always redraw when flashing */ 1215 if (ds->bgcolour != bgcolour || /* always redraw when flashing */
@@ -1255,9 +1258,9 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1255 } 1258 }
1256} 1259}
1257 1260
1258static int game_timing_state(const game_state *state, game_ui *ui) 1261static bool game_timing_state(const game_state *state, game_ui *ui)
1259{ 1262{
1260 return TRUE; 1263 return true;
1261} 1264}
1262 1265
1263static void game_print_size(const game_params *params, float *x, float *y) 1266static void game_print_size(const game_params *params, float *x, float *y)
@@ -1280,15 +1283,15 @@ const struct game thegame = {
1280 encode_params, 1283 encode_params,
1281 free_params, 1284 free_params,
1282 dup_params, 1285 dup_params,
1283 TRUE, game_configure, custom_params, 1286 true, game_configure, custom_params,
1284 validate_params, 1287 validate_params,
1285 new_game_desc, 1288 new_game_desc,
1286 validate_desc, 1289 validate_desc,
1287 new_game, 1290 new_game,
1288 dup_game, 1291 dup_game,
1289 free_game, 1292 free_game,
1290 TRUE, solve_game, 1293 true, solve_game,
1291 TRUE, game_can_format_as_text_now, game_text_format, 1294 true, game_can_format_as_text_now, game_text_format,
1292 new_ui, 1295 new_ui,
1293 free_ui, 1296 free_ui,
1294 encode_ui, 1297 encode_ui,
@@ -1305,9 +1308,9 @@ const struct game thegame = {
1305 game_anim_length, 1308 game_anim_length,
1306 game_flash_length, 1309 game_flash_length,
1307 game_status, 1310 game_status,
1308 FALSE, FALSE, game_print_size, game_print, 1311 false, false, game_print_size, game_print,
1309 TRUE, /* wants_statusbar */ 1312 true, /* wants_statusbar */
1310 FALSE, game_timing_state, 1313 false, game_timing_state,
1311 0, /* flags */ 1314 0, /* flags */
1312}; 1315};
1313 1316
diff --git a/apps/plugins/puzzles/src/undead.c b/apps/plugins/puzzles/src/undead.c
index 03b014f5a1..781c15d791 100644
--- a/apps/plugins/puzzles/src/undead.c
+++ b/apps/plugins/puzzles/src/undead.c
@@ -92,11 +92,11 @@ static game_params *default_params(void) {
92 return ret; 92 return ret;
93} 93}
94 94
95static int game_fetch_preset(int i, char **name, game_params **params) { 95static bool game_fetch_preset(int i, char **name, game_params **params) {
96 game_params *ret; 96 game_params *ret;
97 char buf[64]; 97 char buf[64];
98 98
99 if (i < 0 || i >= lenof(undead_presets)) return FALSE; 99 if (i < 0 || i >= lenof(undead_presets)) return false;
100 100
101 ret = default_params(); 101 ret = default_params();
102 *ret = undead_presets[i]; /* struct copy */ 102 *ret = undead_presets[i]; /* struct copy */
@@ -107,7 +107,7 @@ static int game_fetch_preset(int i, char **name, game_params **params) {
107 undead_diffnames[undead_presets[i].diff]); 107 undead_diffnames[undead_presets[i].diff]);
108 *name = dupstr(buf); 108 *name = dupstr(buf);
109 109
110 return TRUE; 110 return true;
111} 111}
112 112
113static void free_params(game_params *params) { 113static void free_params(game_params *params) {
@@ -144,7 +144,7 @@ static void decode_params(game_params *params, char const *string) {
144 return; 144 return;
145} 145}
146 146
147static char *encode_params(const game_params *params, int full) 147static char *encode_params(const game_params *params, bool full)
148{ 148{
149 char buf[256]; 149 char buf[256];
150 sprintf(buf, "%dx%d", params->w, params->h); 150 sprintf(buf, "%dx%d", params->w, params->h);
@@ -191,7 +191,7 @@ static game_params *custom_params(const config_item *cfg)
191 return ret; 191 return ret;
192} 192}
193 193
194static const char *validate_params(const game_params *params, int full) 194static const char *validate_params(const game_params *params, bool full)
195{ 195{
196 if ((params->w * params->h ) > 54) return "Grid is too big"; 196 if ((params->w * params->h ) > 54) return "Grid is too big";
197 if (params->w < 3) return "Width must be at least 3"; 197 if (params->w < 3) return "Width must be at least 3";
@@ -224,20 +224,19 @@ struct game_common {
224 struct path *paths; 224 struct path *paths;
225 int *grid; 225 int *grid;
226 int *xinfo; 226 int *xinfo;
227 int *fixed; 227 bool *fixed;
228 int solved;
229}; 228};
230 229
231struct game_state { 230struct game_state {
232 struct game_common *common; 231 struct game_common *common;
233 int *guess; 232 int *guess;
234 unsigned char *pencils; 233 unsigned char *pencils;
235 unsigned char *cell_errors; 234 bool *cell_errors;
236 unsigned char *hint_errors; 235 bool *hint_errors;
237 unsigned char *hints_done; 236 bool *hints_done;
238 unsigned char count_errors[3]; 237 bool count_errors[3];
239 int solved; 238 bool solved;
240 int cheated; 239 bool cheated;
241}; 240};
242 241
243static game_state *new_state(const game_params *params) { 242static game_state *new_state(const game_params *params) {
@@ -260,7 +259,6 @@ static game_state *new_state(const game_params *params) {
260 state->common->grid = snewn(state->common->wh, int); 259 state->common->grid = snewn(state->common->wh, int);
261 state->common->xinfo = snewn(state->common->wh, int); 260 state->common->xinfo = snewn(state->common->wh, int);
262 state->common->fixed = NULL; 261 state->common->fixed = NULL;
263 state->common->solved = FALSE;
264 262
265 state->common->num_paths = 263 state->common->num_paths =
266 state->common->params.w + state->common->params.h; 264 state->common->params.w + state->common->params.h;
@@ -281,20 +279,20 @@ static game_state *new_state(const game_params *params) {
281 state->guess = NULL; 279 state->guess = NULL;
282 state->pencils = NULL; 280 state->pencils = NULL;
283 281
284 state->cell_errors = snewn(state->common->wh, unsigned char); 282 state->cell_errors = snewn(state->common->wh, bool);
285 for (i=0;i<state->common->wh;i++) 283 for (i=0;i<state->common->wh;i++)
286 state->cell_errors[i] = FALSE; 284 state->cell_errors[i] = false;
287 state->hint_errors = snewn(2*state->common->num_paths, unsigned char); 285 state->hint_errors = snewn(2*state->common->num_paths, bool);
288 for (i=0;i<2*state->common->num_paths;i++) 286 for (i=0;i<2*state->common->num_paths;i++)
289 state->hint_errors[i] = FALSE; 287 state->hint_errors[i] = false;
290 state->hints_done = snewn(2 * state->common->num_paths, unsigned char); 288 state->hints_done = snewn(2 * state->common->num_paths, bool);
291 memset(state->hints_done, 0, 289 memset(state->hints_done, 0,
292 2 * state->common->num_paths * sizeof(unsigned char)); 290 2 * state->common->num_paths * sizeof(bool));
293 for (i=0;i<3;i++) 291 for (i=0;i<3;i++)
294 state->count_errors[i] = FALSE; 292 state->count_errors[i] = false;
295 293
296 state->solved = FALSE; 294 state->solved = false;
297 state->cheated = FALSE; 295 state->cheated = false;
298 296
299 return state; 297 return state;
300} 298}
@@ -320,23 +318,23 @@ static game_state *dup_game(const game_state *state)
320 else ret->pencils = NULL; 318 else ret->pencils = NULL;
321 319
322 if (state->cell_errors != NULL) { 320 if (state->cell_errors != NULL) {
323 ret->cell_errors = snewn(ret->common->wh,unsigned char); 321 ret->cell_errors = snewn(ret->common->wh,bool);
324 memcpy(ret->cell_errors, state->cell_errors, 322 memcpy(ret->cell_errors, state->cell_errors,
325 ret->common->wh*sizeof(unsigned char)); 323 ret->common->wh*sizeof(bool));
326 } 324 }
327 else ret->cell_errors = NULL; 325 else ret->cell_errors = NULL;
328 326
329 if (state->hint_errors != NULL) { 327 if (state->hint_errors != NULL) {
330 ret->hint_errors = snewn(2*ret->common->num_paths,unsigned char); 328 ret->hint_errors = snewn(2*ret->common->num_paths,bool);
331 memcpy(ret->hint_errors, state->hint_errors, 329 memcpy(ret->hint_errors, state->hint_errors,
332 2*ret->common->num_paths*sizeof(unsigned char)); 330 2*ret->common->num_paths*sizeof(bool));
333 } 331 }
334 else ret->hint_errors = NULL; 332 else ret->hint_errors = NULL;
335 333
336 if (state->hints_done != NULL) { 334 if (state->hints_done != NULL) {
337 ret->hints_done = snewn(2 * state->common->num_paths, unsigned char); 335 ret->hints_done = snewn(2 * state->common->num_paths, bool);
338 memcpy(ret->hints_done, state->hints_done, 336 memcpy(ret->hints_done, state->hints_done,
339 2 * state->common->num_paths * sizeof(unsigned char)); 337 2 * state->common->num_paths * sizeof(bool));
340 } 338 }
341 else ret->hints_done = NULL; 339 else ret->hints_done = NULL;
342 340
@@ -399,7 +397,7 @@ enum {
399 DIRECTION_DOWN 397 DIRECTION_DOWN
400}; 398};
401 399
402int range2grid(int rangeno, int width, int height, int *x, int *y) { 400static int range2grid(int rangeno, int width, int height, int *x, int *y) {
403 401
404 if (rangeno < 0) { 402 if (rangeno < 0) {
405 *x = 0; *y = 0; return DIRECTION_NONE; 403 *x = 0; *y = 0; return DIRECTION_NONE;
@@ -423,7 +421,7 @@ int range2grid(int rangeno, int width, int height, int *x, int *y) {
423 return DIRECTION_NONE; 421 return DIRECTION_NONE;
424} 422}
425 423
426int grid2range(int x, int y, int w, int h) { 424static int grid2range(int x, int y, int w, int h) {
427 if (x>0 && x<w+1 && y>0 && y<h+1) return -1; 425 if (x>0 && x<w+1 && y>0 && y<h+1) return -1;
428 if (x<0 || x>w+1 || y<0 || y>h+1) return -1; 426 if (x<0 || x>w+1 || y<0 || y>h+1) return -1;
429 if ((x == 0 || x==w+1) && (y==0 || y==h+1)) return -1; 427 if ((x == 0 || x==w+1) && (y==0 || y==h+1)) return -1;
@@ -433,20 +431,20 @@ int grid2range(int x, int y, int w, int h) {
433 return 2*(w+h) - y; 431 return 2*(w+h) - y;
434} 432}
435 433
436void make_paths(game_state *state) { 434static void make_paths(game_state *state) {
437 int i; 435 int i;
438 int count = 0; 436 int count = 0;
439 437
440 for (i=0;i<2*(state->common->params.w + state->common->params.h);i++) { 438 for (i=0;i<2*(state->common->params.w + state->common->params.h);i++) {
441 int x,y,dir; 439 int x,y,dir;
442 int j,k,num_monsters; 440 int j,k,num_monsters;
443 int found; 441 bool found;
444 int c,p; 442 int c,p;
445 found = FALSE; 443 found = false;
446 /* Check whether inverse path is already in list */ 444 /* Check whether inverse path is already in list */
447 for (j=0;j<count;j++) { 445 for (j=0;j<count;j++) {
448 if (i == state->common->paths[j].grid_end) { 446 if (i == state->common->paths[j].grid_end) {
449 found = TRUE; 447 found = true;
450 break; 448 break;
451 } 449 }
452 } 450 }
@@ -458,7 +456,7 @@ void make_paths(game_state *state) {
458 state->common->params.h,&x,&y); 456 state->common->params.h,&x,&y);
459 state->common->paths[count].sightings_start = 457 state->common->paths[count].sightings_start =
460 state->common->grid[x+y*(state->common->params.w +2)]; 458 state->common->grid[x+y*(state->common->params.w +2)];
461 while (TRUE) { 459 while (true) {
462 int c,r; 460 int c,r;
463 461
464 if (dir == DIRECTION_DOWN) y++; 462 if (dir == DIRECTION_DOWN) y++;
@@ -515,9 +513,9 @@ void make_paths(game_state *state) {
515 int m; 513 int m;
516 m = state->common->paths[count].p[p]; 514 m = state->common->paths[count].p[p];
517 if (m == -1) continue; 515 if (m == -1) continue;
518 found = FALSE; 516 found = false;
519 for (j=0; j<c; j++) 517 for (j=0; j<c; j++)
520 if (state->common->paths[count].mapping[j] == m) found = TRUE; 518 if (state->common->paths[count].mapping[j] == m) found = true;
521 if (!found) state->common->paths[count].mapping[c++] = m; 519 if (!found) state->common->paths[count].mapping[c++] = m;
522 } 520 }
523 count++; 521 count++;
@@ -531,23 +529,23 @@ struct guess {
531 int *possible; 529 int *possible;
532}; 530};
533 531
534int next_list(struct guess *g, int pos) { 532static bool next_list(struct guess *g, int pos) {
535 533
536 if (pos == 0) { 534 if (pos == 0) {
537 if ((g->guess[pos] == 1 && g->possible[pos] == 1) || 535 if ((g->guess[pos] == 1 && g->possible[pos] == 1) ||
538 (g->guess[pos] == 2 && (g->possible[pos] == 3 || 536 (g->guess[pos] == 2 && (g->possible[pos] == 3 ||
539 g->possible[pos] == 2)) || 537 g->possible[pos] == 2)) ||
540 g->guess[pos] == 4) 538 g->guess[pos] == 4)
541 return FALSE; 539 return false;
542 if (g->guess[pos] == 1 && (g->possible[pos] == 3 || 540 if (g->guess[pos] == 1 && (g->possible[pos] == 3 ||
543 g->possible[pos] == 7)) { 541 g->possible[pos] == 7)) {
544 g->guess[pos] = 2; return TRUE; 542 g->guess[pos] = 2; return true;
545 } 543 }
546 if (g->guess[pos] == 1 && g->possible[pos] == 5) { 544 if (g->guess[pos] == 1 && g->possible[pos] == 5) {
547 g->guess[pos] = 4; return TRUE; 545 g->guess[pos] = 4; return true;
548 } 546 }
549 if (g->guess[pos] == 2 && (g->possible[pos] == 6 || g->possible[pos] == 7)) { 547 if (g->guess[pos] == 2 && (g->possible[pos] == 6 || g->possible[pos] == 7)) {
550 g->guess[pos] = 4; return TRUE; 548 g->guess[pos] = 4; return true;
551 } 549 }
552 } 550 }
553 551
@@ -556,10 +554,10 @@ int next_list(struct guess *g, int pos) {
556 return next_list(g,pos-1); 554 return next_list(g,pos-1);
557 } 555 }
558 if (g->possible[pos] == 3 || g->possible[pos] == 7) { 556 if (g->possible[pos] == 3 || g->possible[pos] == 7) {
559 g->guess[pos] = 2; return TRUE; 557 g->guess[pos] = 2; return true;
560 } 558 }
561 if (g->possible[pos] == 5) { 559 if (g->possible[pos] == 5) {
562 g->guess[pos] = 4; return TRUE; 560 g->guess[pos] = 4; return true;
563 } 561 }
564 } 562 }
565 563
@@ -571,7 +569,7 @@ int next_list(struct guess *g, int pos) {
571 g->guess[pos] = 1; return next_list(g,pos-1); 569 g->guess[pos] = 1; return next_list(g,pos-1);
572 } 570 }
573 if (g->possible[pos] == 6 || g->possible[pos] == 7) { 571 if (g->possible[pos] == 6 || g->possible[pos] == 7) {
574 g->guess[pos] = 4; return TRUE; 572 g->guess[pos] = 4; return true;
575 } 573 }
576 } 574 }
577 575
@@ -586,10 +584,10 @@ int next_list(struct guess *g, int pos) {
586 return next_list(g,pos-1); 584 return next_list(g,pos-1);
587 } 585 }
588 } 586 }
589 return FALSE; 587 return false;
590} 588}
591 589
592void get_unique(game_state *state, int counter, random_state *rs) { 590static void get_unique(game_state *state, int counter, random_state *rs) {
593 591
594 int p,i,c,pathlimit,count_uniques; 592 int p,i,c,pathlimit,count_uniques;
595 struct guess path_guess; 593 struct guess path_guess;
@@ -638,19 +636,20 @@ void get_unique(game_state *state, int counter, random_state *rs) {
638 view_count[i] = 0; 636 view_count[i] = 0;
639 637
640 do { 638 do {
641 int mirror, start_view, end_view; 639 bool mirror;
640 int start_view, end_view;
642 641
643 mirror = FALSE; 642 mirror = false;
644 start_view = 0; 643 start_view = 0;
645 for (p=0;p<state->common->paths[counter].length;p++) { 644 for (p=0;p<state->common->paths[counter].length;p++) {
646 if (state->common->paths[counter].p[p] == -1) mirror = TRUE; 645 if (state->common->paths[counter].p[p] == -1) mirror = true;
647 else { 646 else {
648 for (i=0;i<path_guess.length;i++) { 647 for (i=0;i<path_guess.length;i++) {
649 if (state->common->paths[counter].p[p] == 648 if (state->common->paths[counter].p[p] ==
650 state->common->paths[counter].mapping[i]) { 649 state->common->paths[counter].mapping[i]) {
651 if (path_guess.guess[i] == 1 && mirror == TRUE) 650 if (path_guess.guess[i] == 1 && mirror)
652 start_view++; 651 start_view++;
653 if (path_guess.guess[i] == 2 && mirror == FALSE) 652 if (path_guess.guess[i] == 2 && !mirror)
654 start_view++; 653 start_view++;
655 if (path_guess.guess[i] == 4) 654 if (path_guess.guess[i] == 4)
656 start_view++; 655 start_view++;
@@ -659,17 +658,17 @@ void get_unique(game_state *state, int counter, random_state *rs) {
659 } 658 }
660 } 659 }
661 } 660 }
662 mirror = FALSE; 661 mirror = false;
663 end_view = 0; 662 end_view = 0;
664 for (p=state->common->paths[counter].length-1;p>=0;p--) { 663 for (p=state->common->paths[counter].length-1;p>=0;p--) {
665 if (state->common->paths[counter].p[p] == -1) mirror = TRUE; 664 if (state->common->paths[counter].p[p] == -1) mirror = true;
666 else { 665 else {
667 for (i=0;i<path_guess.length;i++) { 666 for (i=0;i<path_guess.length;i++) {
668 if (state->common->paths[counter].p[p] == 667 if (state->common->paths[counter].p[p] ==
669 state->common->paths[counter].mapping[i]) { 668 state->common->paths[counter].mapping[i]) {
670 if (path_guess.guess[i] == 1 && mirror == TRUE) 669 if (path_guess.guess[i] == 1 && mirror)
671 end_view++; 670 end_view++;
672 if (path_guess.guess[i] == 2 && mirror == FALSE) 671 if (path_guess.guess[i] == 2 && !mirror)
673 end_view++; 672 end_view++;
674 if (path_guess.guess[i] == 4) 673 if (path_guess.guess[i] == 4)
675 end_view++; 674 end_view++;
@@ -766,8 +765,8 @@ void get_unique(game_state *state, int counter, random_state *rs) {
766 return; 765 return;
767} 766}
768 767
769int count_monsters(game_state *state, 768static int count_monsters(game_state *state,
770 int *cGhost, int *cVampire, int *cZombie) { 769 int *cGhost, int *cVampire, int *cZombie) {
771 int cNone; 770 int cNone;
772 int i; 771 int i;
773 772
@@ -783,8 +782,8 @@ int count_monsters(game_state *state,
783 return cNone; 782 return cNone;
784} 783}
785 784
786int check_numbers(game_state *state, int *guess) { 785static bool check_numbers(game_state *state, int *guess) {
787 int valid; 786 bool valid;
788 int i; 787 int i;
789 int count_ghosts, count_vampires, count_zombies; 788 int count_ghosts, count_vampires, count_zombies;
790 789
@@ -795,49 +794,49 @@ int check_numbers(game_state *state, int *guess) {
795 if (guess[i] == 4) count_zombies++; 794 if (guess[i] == 4) count_zombies++;
796 } 795 }
797 796
798 valid = TRUE; 797 valid = true;
799 798
800 if (count_ghosts > state->common->num_ghosts) valid = FALSE; 799 if (count_ghosts > state->common->num_ghosts) valid = false;
801 if (count_vampires > state->common->num_vampires) valid = FALSE; 800 if (count_vampires > state->common->num_vampires) valid = false;
802 if (count_zombies > state->common->num_zombies) valid = FALSE; 801 if (count_zombies > state->common->num_zombies) valid = false;
803 802
804 return valid; 803 return valid;
805} 804}
806 805
807int check_solution(int *g, struct path path) { 806static bool check_solution(int *g, struct path path) {
808 int i; 807 int i;
809 int mirror; 808 bool mirror;
810 int count; 809 int count;
811 810
812 count = 0; 811 count = 0;
813 mirror = FALSE; 812 mirror = false;
814 for (i=0;i<path.length;i++) { 813 for (i=0;i<path.length;i++) {
815 if (path.p[i] == -1) mirror = TRUE; 814 if (path.p[i] == -1) mirror = true;
816 else { 815 else {
817 if (g[path.p[i]] == 1 && mirror) count++; 816 if (g[path.p[i]] == 1 && mirror) count++;
818 else if (g[path.p[i]] == 2 && !mirror) count++; 817 else if (g[path.p[i]] == 2 && !mirror) count++;
819 else if (g[path.p[i]] == 4) count++; 818 else if (g[path.p[i]] == 4) count++;
820 } 819 }
821 } 820 }
822 if (count != path.sightings_start) return FALSE; 821 if (count != path.sightings_start) return false;
823 822
824 count = 0; 823 count = 0;
825 mirror = FALSE; 824 mirror = false;
826 for (i=path.length-1;i>=0;i--) { 825 for (i=path.length-1;i>=0;i--) {
827 if (path.p[i] == -1) mirror = TRUE; 826 if (path.p[i] == -1) mirror = true;
828 else { 827 else {
829 if (g[path.p[i]] == 1 && mirror) count++; 828 if (g[path.p[i]] == 1 && mirror) count++;
830 else if (g[path.p[i]] == 2 && !mirror) count++; 829 else if (g[path.p[i]] == 2 && !mirror) count++;
831 else if (g[path.p[i]] == 4) count++; 830 else if (g[path.p[i]] == 4) count++;
832 } 831 }
833 } 832 }
834 if (count != path.sightings_end) return FALSE; 833 if (count != path.sightings_end) return false;
835 834
836 return TRUE; 835 return true;
837} 836}
838 837
839int solve_iterative(game_state *state, struct path *paths) { 838static bool solve_iterative(game_state *state, struct path *paths) {
840 int solved; 839 bool solved;
841 int p,i,j,count; 840 int p,i,j,count;
842 841
843 int *guess; 842 int *guess;
@@ -845,7 +844,7 @@ int solve_iterative(game_state *state, struct path *paths) {
845 844
846 struct guess loop; 845 struct guess loop;
847 846
848 solved = TRUE; 847 solved = true;
849 loop.length = state->common->num_total; 848 loop.length = state->common->num_total;
850 guess = snewn(state->common->num_total,int); 849 guess = snewn(state->common->num_total,int);
851 possible = snewn(state->common->num_total,int); 850 possible = snewn(state->common->num_total,int);
@@ -875,7 +874,7 @@ int solve_iterative(game_state *state, struct path *paths) {
875 possible[paths[p].mapping[i]] = 0; 874 possible[paths[p].mapping[i]] = 0;
876 } 875 }
877 876
878 while(TRUE) { 877 while(true) {
879 for (i=0;i<state->common->num_total;i++) { 878 for (i=0;i<state->common->num_total;i++) {
880 guess[i] = state->guess[i]; 879 guess[i] = state->guess[i];
881 } 880 }
@@ -899,7 +898,7 @@ int solve_iterative(game_state *state, struct path *paths) {
899 for (i=0;i<state->common->num_total;i++) { 898 for (i=0;i<state->common->num_total;i++) {
900 if (state->guess[i] == 3 || state->guess[i] == 5 || 899 if (state->guess[i] == 3 || state->guess[i] == 5 ||
901 state->guess[i] == 6 || state->guess[i] == 7) { 900 state->guess[i] == 6 || state->guess[i] == 7) {
902 solved = FALSE; break; 901 solved = false; break;
903 } 902 }
904 } 903 }
905 904
@@ -909,8 +908,8 @@ int solve_iterative(game_state *state, struct path *paths) {
909 return solved; 908 return solved;
910} 909}
911 910
912int solve_bruteforce(game_state *state, struct path *paths) { 911static bool solve_bruteforce(game_state *state, struct path *paths) {
913 int solved, correct; 912 bool solved, correct;
914 int number_solutions; 913 int number_solutions;
915 int p,i; 914 int p,i;
916 915
@@ -932,23 +931,23 @@ int solve_bruteforce(game_state *state, struct path *paths) {
932 } 931 }
933 } 932 }
934 933
935 solved = FALSE; 934 solved = false;
936 number_solutions = 0; 935 number_solutions = 0;
937 936
938 while (TRUE) { 937 while (true) {
939 938
940 correct = TRUE; 939 correct = true;
941 if (!check_numbers(state,loop.guess)) correct = FALSE; 940 if (!check_numbers(state,loop.guess)) correct = false;
942 else 941 else
943 for (p=0;p<state->common->num_paths;p++) 942 for (p=0;p<state->common->num_paths;p++)
944 if (!check_solution(loop.guess,paths[p])) { 943 if (!check_solution(loop.guess,paths[p])) {
945 correct = FALSE; break; 944 correct = false; break;
946 } 945 }
947 if (correct) { 946 if (correct) {
948 number_solutions++; 947 number_solutions++;
949 solved = TRUE; 948 solved = true;
950 if(number_solutions > 1) { 949 if(number_solutions > 1) {
951 solved = FALSE; 950 solved = false;
952 break; 951 break;
953 } 952 }
954 for (i=0;i<state->common->num_total;i++) 953 for (i=0;i<state->common->num_total;i++)
@@ -965,14 +964,14 @@ int solve_bruteforce(game_state *state, struct path *paths) {
965 return solved; 964 return solved;
966} 965}
967 966
968int path_cmp(const void *a, const void *b) { 967static int path_cmp(const void *a, const void *b) {
969 const struct path *pa = (const struct path *)a; 968 const struct path *pa = (const struct path *)a;
970 const struct path *pb = (const struct path *)b; 969 const struct path *pb = (const struct path *)b;
971 return pa->num_monsters - pb->num_monsters; 970 return pa->num_monsters - pb->num_monsters;
972} 971}
973 972
974static char *new_game_desc(const game_params *params, random_state *rs, 973static char *new_game_desc(const game_params *params, random_state *rs,
975 char **aux, int interactive) { 974 char **aux, bool interactive) {
976 int i,count,c,w,h,r,p,g; 975 int i,count,c,w,h,r,p,g;
977 game_state *new; 976 game_state *new;
978 977
@@ -980,12 +979,12 @@ static char *new_game_desc(const game_params *params, random_state *rs,
980 int filling; 979 int filling;
981 int max_length; 980 int max_length;
982 int count_ghosts, count_vampires, count_zombies; 981 int count_ghosts, count_vampires, count_zombies;
983 int abort; 982 bool abort;
984 float ratio; 983 float ratio;
985 984
986 /* Variables for solver algorithm */ 985 /* Variables for solver algorithm */
987 int solved_iterative, solved_bruteforce, contains_inconsistency, 986 bool solved_iterative, solved_bruteforce, contains_inconsistency;
988 count_ambiguous; 987 int count_ambiguous;
989 int iterative_depth; 988 int iterative_depth;
990 int *old_guess; 989 int *old_guess;
991 990
@@ -995,9 +994,9 @@ static char *new_game_desc(const game_params *params, random_state *rs,
995 char *desc; 994 char *desc;
996 995
997 i = 0; 996 i = 0;
998 while (TRUE) { 997 while (true) {
999 new = new_state(params); 998 new = new_state(params);
1000 abort = FALSE; 999 abort = false;
1001 1000
1002 /* Fill grid with random mirrors and (later to be populated) 1001 /* Fill grid with random mirrors and (later to be populated)
1003 * empty monster cells */ 1002 * empty monster cells */
@@ -1062,9 +1061,9 @@ static char *new_game_desc(const game_params *params, random_state *rs,
1062 1061
1063 /* Initialize fixed flag from common. Not needed for the 1062 /* Initialize fixed flag from common. Not needed for the
1064 * puzzle generator; initialize it for having clean code */ 1063 * puzzle generator; initialize it for having clean code */
1065 new->common->fixed = snewn(new->common->num_total,int); 1064 new->common->fixed = snewn(new->common->num_total, bool);
1066 for (g=0;g<new->common->num_total;g++) 1065 for (g=0;g<new->common->num_total;g++)
1067 new->common->fixed[g] = FALSE; 1066 new->common->fixed[g] = false;
1068 1067
1069 /* paths generation */ 1068 /* paths generation */
1070 make_paths(new); 1069 make_paths(new);
@@ -1080,7 +1079,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
1080 1079
1081 for (p=0;p<new->common->num_paths;p++) { 1080 for (p=0;p<new->common->num_paths;p++) {
1082 if (new->common->paths[p].num_monsters > max_length) { 1081 if (new->common->paths[p].num_monsters > max_length) {
1083 abort = TRUE; 1082 abort = true;
1084 } 1083 }
1085 } 1084 }
1086 if (abort) { 1085 if (abort) {
@@ -1158,28 +1157,29 @@ static char *new_game_desc(const game_params *params, random_state *rs,
1158 1157
1159 /* Prepare path information needed by the solver (containing all hints) */ 1158 /* Prepare path information needed by the solver (containing all hints) */
1160 for (p=0;p<new->common->num_paths;p++) { 1159 for (p=0;p<new->common->num_paths;p++) {
1161 int mirror,x,y; 1160 bool mirror;
1161 int x,y;
1162 1162
1163 new->common->paths[p].sightings_start = 0; 1163 new->common->paths[p].sightings_start = 0;
1164 new->common->paths[p].sightings_end = 0; 1164 new->common->paths[p].sightings_end = 0;
1165 1165
1166 mirror = FALSE; 1166 mirror = false;
1167 for (g=0;g<new->common->paths[p].length;g++) { 1167 for (g=0;g<new->common->paths[p].length;g++) {
1168 1168
1169 if (new->common->paths[p].p[g] == -1) mirror = TRUE; 1169 if (new->common->paths[p].p[g] == -1) mirror = true;
1170 else { 1170 else {
1171 if (new->guess[new->common->paths[p].p[g]] == 1 && mirror == TRUE) (new->common->paths[p].sightings_start)++; 1171 if (new->guess[new->common->paths[p].p[g]] == 1 && mirror) (new->common->paths[p].sightings_start)++;
1172 else if (new->guess[new->common->paths[p].p[g]] == 2 && mirror == FALSE) (new->common->paths[p].sightings_start)++; 1172 else if (new->guess[new->common->paths[p].p[g]] == 2 && !mirror) (new->common->paths[p].sightings_start)++;
1173 else if (new->guess[new->common->paths[p].p[g]] == 4) (new->common->paths[p].sightings_start)++; 1173 else if (new->guess[new->common->paths[p].p[g]] == 4) (new->common->paths[p].sightings_start)++;
1174 } 1174 }
1175 } 1175 }
1176 1176
1177 mirror = FALSE; 1177 mirror = false;
1178 for (g=new->common->paths[p].length-1;g>=0;g--) { 1178 for (g=new->common->paths[p].length-1;g>=0;g--) {
1179 if (new->common->paths[p].p[g] == -1) mirror = TRUE; 1179 if (new->common->paths[p].p[g] == -1) mirror = true;
1180 else { 1180 else {
1181 if (new->guess[new->common->paths[p].p[g]] == 1 && mirror == TRUE) (new->common->paths[p].sightings_end)++; 1181 if (new->guess[new->common->paths[p].p[g]] == 1 && mirror) (new->common->paths[p].sightings_end)++;
1182 else if (new->guess[new->common->paths[p].p[g]] == 2 && mirror == FALSE) (new->common->paths[p].sightings_end)++; 1182 else if (new->guess[new->common->paths[p].p[g]] == 2 && !mirror) (new->common->paths[p].sightings_end)++;
1183 else if (new->guess[new->common->paths[p].p[g]] == 4) (new->common->paths[p].sightings_end)++; 1183 else if (new->guess[new->common->paths[p].p[g]] == 4) (new->common->paths[p].sightings_end)++;
1184 } 1184 }
1185 } 1185 }
@@ -1201,25 +1201,24 @@ static char *new_game_desc(const game_params *params, random_state *rs,
1201 old_guess[p] = 7; 1201 old_guess[p] = 7;
1202 } 1202 }
1203 iterative_depth = 0; 1203 iterative_depth = 0;
1204 solved_iterative = FALSE; 1204 solved_iterative = false;
1205 contains_inconsistency = FALSE; 1205 contains_inconsistency = false;
1206 count_ambiguous = 0; 1206 count_ambiguous = 0;
1207 1207
1208 while (TRUE) { 1208 while (true) {
1209 int no_change; 1209 bool no_change = true;
1210 no_change = TRUE;
1211 solved_iterative = solve_iterative(new,new->common->paths); 1210 solved_iterative = solve_iterative(new,new->common->paths);
1212 iterative_depth++; 1211 iterative_depth++;
1213 for (p=0;p<new->common->num_total;p++) { 1212 for (p=0;p<new->common->num_total;p++) {
1214 if (new->guess[p] != old_guess[p]) no_change = FALSE; 1213 if (new->guess[p] != old_guess[p]) no_change = false;
1215 old_guess[p] = new->guess[p]; 1214 old_guess[p] = new->guess[p];
1216 if (new->guess[p] == 0) contains_inconsistency = TRUE; 1215 if (new->guess[p] == 0) contains_inconsistency = true;
1217 } 1216 }
1218 if (solved_iterative || no_change) break; 1217 if (solved_iterative || no_change) break;
1219 } 1218 }
1220 1219
1221 /* If necessary, try to solve the puzzle with the brute-force solver */ 1220 /* If necessary, try to solve the puzzle with the brute-force solver */
1222 solved_bruteforce = FALSE; 1221 solved_bruteforce = false;
1223 if (new->common->params.diff != DIFF_EASY && 1222 if (new->common->params.diff != DIFF_EASY &&
1224 !solved_iterative && !contains_inconsistency) { 1223 !solved_iterative && !contains_inconsistency) {
1225 for (p=0;p<new->common->num_total;p++) 1224 for (p=0;p<new->common->num_total;p++)
@@ -1308,7 +1307,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
1308 return desc; 1307 return desc;
1309} 1308}
1310 1309
1311void num2grid(int num, int width, int height, int *x, int *y) { 1310static void num2grid(int num, int width, int height, int *x, int *y) {
1312 *x = 1+(num%width); 1311 *x = 1+(num%width);
1313 *y = 1+(num/width); 1312 *y = 1+(num/width);
1314 return; 1313 return;
@@ -1357,18 +1356,18 @@ static game_state *new_game(midend *me, const game_params *params,
1357 1356
1358 state->guess = snewn(state->common->num_total,int); 1357 state->guess = snewn(state->common->num_total,int);
1359 state->pencils = snewn(state->common->num_total,unsigned char); 1358 state->pencils = snewn(state->common->num_total,unsigned char);
1360 state->common->fixed = snewn(state->common->num_total,int); 1359 state->common->fixed = snewn(state->common->num_total, bool);
1361 for (i=0;i<state->common->num_total;i++) { 1360 for (i=0;i<state->common->num_total;i++) {
1362 state->guess[i] = 7; 1361 state->guess[i] = 7;
1363 state->pencils[i] = 0; 1362 state->pencils[i] = 0;
1364 state->common->fixed[i] = FALSE; 1363 state->common->fixed[i] = false;
1365 } 1364 }
1366 for (i=0;i<state->common->wh;i++) 1365 for (i=0;i<state->common->wh;i++)
1367 state->cell_errors[i] = FALSE; 1366 state->cell_errors[i] = false;
1368 for (i=0;i<2*state->common->num_paths;i++) 1367 for (i=0;i<2*state->common->num_paths;i++)
1369 state->hint_errors[i] = FALSE; 1368 state->hint_errors[i] = false;
1370 for (i=0;i<3;i++) 1369 for (i=0;i<3;i++)
1371 state->count_errors[i] = FALSE; 1370 state->count_errors[i] = false;
1372 1371
1373 count = 0; 1372 count = 0;
1374 n = 0; 1373 n = 0;
@@ -1393,7 +1392,7 @@ static game_state *new_game(midend *me, const game_params *params,
1393 state->common->grid[x+y*(state->common->params.w +2)] = CELL_GHOST; 1392 state->common->grid[x+y*(state->common->params.w +2)] = CELL_GHOST;
1394 state->common->xinfo[x+y*(state->common->params.w+2)] = count; 1393 state->common->xinfo[x+y*(state->common->params.w+2)] = count;
1395 state->guess[count] = 1; 1394 state->guess[count] = 1;
1396 state->common->fixed[count++] = TRUE; 1395 state->common->fixed[count++] = true;
1397 n++; 1396 n++;
1398 } 1397 }
1399 else if (*desc == 'V') { 1398 else if (*desc == 'V') {
@@ -1401,7 +1400,7 @@ static game_state *new_game(midend *me, const game_params *params,
1401 state->common->grid[x+y*(state->common->params.w +2)] = CELL_VAMPIRE; 1400 state->common->grid[x+y*(state->common->params.w +2)] = CELL_VAMPIRE;
1402 state->common->xinfo[x+y*(state->common->params.w+2)] = count; 1401 state->common->xinfo[x+y*(state->common->params.w+2)] = count;
1403 state->guess[count] = 2; 1402 state->guess[count] = 2;
1404 state->common->fixed[count++] = TRUE; 1403 state->common->fixed[count++] = true;
1405 n++; 1404 n++;
1406 } 1405 }
1407 else if (*desc == 'Z') { 1406 else if (*desc == 'Z') {
@@ -1409,7 +1408,7 @@ static game_state *new_game(midend *me, const game_params *params,
1409 state->common->grid[x+y*(state->common->params.w +2)] = CELL_ZOMBIE; 1408 state->common->grid[x+y*(state->common->params.w +2)] = CELL_ZOMBIE;
1410 state->common->xinfo[x+y*(state->common->params.w+2)] = count; 1409 state->common->xinfo[x+y*(state->common->params.w+2)] = count;
1411 state->guess[count] = 4; 1410 state->guess[count] = 4;
1412 state->common->fixed[count++] = TRUE; 1411 state->common->fixed[count++] = true;
1413 n++; 1412 n++;
1414 } 1413 }
1415 else { 1414 else {
@@ -1419,7 +1418,7 @@ static game_state *new_game(midend *me, const game_params *params,
1419 state->common->grid[x+y*(state->common->params.w +2)] = CELL_EMPTY; 1418 state->common->grid[x+y*(state->common->params.w +2)] = CELL_EMPTY;
1420 state->common->xinfo[x+y*(state->common->params.w+2)] = count; 1419 state->common->xinfo[x+y*(state->common->params.w+2)] = count;
1421 state->guess[count] = 7; 1420 state->guess[count] = 7;
1422 state->common->fixed[count++] = FALSE; 1421 state->common->fixed[count++] = false;
1423 n++; 1422 n++;
1424 } 1423 }
1425 } 1424 }
@@ -1514,8 +1513,8 @@ static char *solve_game(const game_state *state_start, const game_state *currsta
1514 int p; 1513 int p;
1515 int *old_guess; 1514 int *old_guess;
1516 int iterative_depth; 1515 int iterative_depth;
1517 int solved_iterative, solved_bruteforce, contains_inconsistency, 1516 bool solved_iterative, solved_bruteforce, contains_inconsistency;
1518 count_ambiguous; 1517 int count_ambiguous;
1519 1518
1520 int i; 1519 int i;
1521 char *move, *c; 1520 char *move, *c;
@@ -1532,21 +1531,20 @@ static char *solve_game(const game_state *state_start, const game_state *currsta
1532 } 1531 }
1533 } 1532 }
1534 iterative_depth = 0; 1533 iterative_depth = 0;
1535 solved_iterative = FALSE; 1534 solved_iterative = false;
1536 contains_inconsistency = FALSE; 1535 contains_inconsistency = false;
1537 count_ambiguous = 0; 1536 count_ambiguous = 0;
1538 1537
1539 /* Try to solve the puzzle with the iterative solver */ 1538 /* Try to solve the puzzle with the iterative solver */
1540 while (TRUE) { 1539 while (true) {
1541 int no_change; 1540 bool no_change = true;
1542 no_change = TRUE;
1543 solved_iterative = 1541 solved_iterative =
1544 solve_iterative(solve_state,solve_state->common->paths); 1542 solve_iterative(solve_state,solve_state->common->paths);
1545 iterative_depth++; 1543 iterative_depth++;
1546 for (p=0;p<solve_state->common->num_total;p++) { 1544 for (p=0;p<solve_state->common->num_total;p++) {
1547 if (solve_state->guess[p] != old_guess[p]) no_change = FALSE; 1545 if (solve_state->guess[p] != old_guess[p]) no_change = false;
1548 old_guess[p] = solve_state->guess[p]; 1546 old_guess[p] = solve_state->guess[p];
1549 if (solve_state->guess[p] == 0) contains_inconsistency = TRUE; 1547 if (solve_state->guess[p] == 0) contains_inconsistency = true;
1550 } 1548 }
1551 if (solved_iterative || no_change || contains_inconsistency) break; 1549 if (solved_iterative || no_change || contains_inconsistency) break;
1552 } 1550 }
@@ -1559,7 +1557,7 @@ static char *solve_game(const game_state *state_start, const game_state *currsta
1559 } 1557 }
1560 1558
1561 /* If necessary, try to solve the puzzle with the brute-force solver */ 1559 /* If necessary, try to solve the puzzle with the brute-force solver */
1562 solved_bruteforce = FALSE; 1560 solved_bruteforce = false;
1563 if (!solved_iterative) { 1561 if (!solved_iterative) {
1564 for (p=0;p<solve_state->common->num_total;p++) 1562 for (p=0;p<solve_state->common->num_total;p++)
1565 if (solve_state->guess[p] != 1 && solve_state->guess[p] != 2 && 1563 if (solve_state->guess[p] != 1 && solve_state->guess[p] != 2 &&
@@ -1593,9 +1591,9 @@ static char *solve_game(const game_state *state_start, const game_state *currsta
1593 return move; 1591 return move;
1594} 1592}
1595 1593
1596static int game_can_format_as_text_now(const game_params *params) 1594static bool game_can_format_as_text_now(const game_params *params)
1597{ 1595{
1598 return TRUE; 1596 return true;
1599} 1597}
1600 1598
1601static char *game_text_format(const game_state *state) 1599static char *game_text_format(const game_state *state)
@@ -1640,16 +1638,18 @@ static char *game_text_format(const game_state *state)
1640 1638
1641struct game_ui { 1639struct game_ui {
1642 int hx, hy; /* as for solo.c, highlight pos */ 1640 int hx, hy; /* as for solo.c, highlight pos */
1643 int hshow, hpencil, hcursor; /* show state, type, and ?cursor. */ 1641 bool hshow, hpencil, hcursor; /* show state, type, and ?cursor. */
1644 int ascii; 1642 bool ascii;
1645}; 1643};
1646 1644
1647static game_ui *new_ui(const game_state *state) 1645static game_ui *new_ui(const game_state *state)
1648{ 1646{
1649 game_ui *ui = snew(game_ui); 1647 game_ui *ui = snew(game_ui);
1650 ui->hx = ui->hy = 0; 1648 ui->hx = ui->hy = 0;
1651 ui->hpencil = ui->hshow = ui->hcursor = 0; 1649 ui->hpencil = false;
1652 ui->ascii = FALSE; 1650 ui->hshow = false;
1651 ui->hcursor = false;
1652 ui->ascii = false;
1653 return ui; 1653 return ui;
1654} 1654}
1655 1655
@@ -1677,36 +1677,38 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1677 if (ui->hshow && ui->hpencil && !ui->hcursor) { 1677 if (ui->hshow && ui->hpencil && !ui->hcursor) {
1678 int g = newstate->guess[newstate->common->xinfo[ui->hx + ui->hy*(newstate->common->params.w+2)]]; 1678 int g = newstate->guess[newstate->common->xinfo[ui->hx + ui->hy*(newstate->common->params.w+2)]];
1679 if (g == 1 || g == 2 || g == 4) 1679 if (g == 1 || g == 2 || g == 4)
1680 ui->hshow = 0; 1680 ui->hshow = false;
1681 } 1681 }
1682} 1682}
1683 1683
1684struct game_drawstate { 1684struct game_drawstate {
1685 int tilesize, started, solved; 1685 int tilesize;
1686 bool started, solved;
1686 int w, h; 1687 int w, h;
1687 1688
1688 int *monsters; 1689 int *monsters;
1689 unsigned char *pencils; 1690 unsigned char *pencils;
1690 1691
1691 unsigned char count_errors[3]; 1692 bool count_errors[3];
1692 unsigned char *cell_errors; 1693 bool *cell_errors;
1693 unsigned char *hint_errors; 1694 bool *hint_errors;
1694 unsigned char *hints_done; 1695 bool *hints_done;
1695 1696
1696 int hx, hy, hshow, hpencil; /* as for game_ui. */ 1697 int hx, hy;
1697 int hflash; 1698 bool hshow, hpencil; /* as for game_ui. */
1698 int ascii; 1699 bool hflash;
1700 bool ascii;
1699}; 1701};
1700 1702
1701static int is_clue(const game_state *state, int x, int y) 1703static bool is_clue(const game_state *state, int x, int y)
1702{ 1704{
1703 int h = state->common->params.h, w = state->common->params.w; 1705 int h = state->common->params.h, w = state->common->params.w;
1704 1706
1705 if (((x == 0 || x == w + 1) && y > 0 && y <= h) || 1707 if (((x == 0 || x == w + 1) && y > 0 && y <= h) ||
1706 ((y == 0 || y == h + 1) && x > 0 && x <= w)) 1708 ((y == 0 || y == h + 1) && x > 0 && x <= w))
1707 return TRUE; 1709 return true;
1708 1710
1709 return FALSE; 1711 return false;
1710} 1712}
1711 1713
1712static int clue_index(const game_state *state, int x, int y) 1714static int clue_index(const game_state *state, int x, int y)
@@ -1748,27 +1750,27 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1748 return dupstr("M"); 1750 return dupstr("M");
1749 } 1751 }
1750 1752
1751 if (ui->hshow == 1 && ui->hpencil == 0) { 1753 if (ui->hshow && !ui->hpencil) {
1752 xi = state->common->xinfo[ui->hx + ui->hy*(state->common->params.w+2)]; 1754 xi = state->common->xinfo[ui->hx + ui->hy*(state->common->params.w+2)];
1753 if (xi >= 0 && !state->common->fixed[xi]) { 1755 if (xi >= 0 && !state->common->fixed[xi]) {
1754 if (button == 'g' || button == 'G' || button == '1') { 1756 if (button == 'g' || button == 'G' || button == '1') {
1755 if (!ui->hcursor) ui->hshow = 0; 1757 if (!ui->hcursor) ui->hshow = false;
1756 sprintf(buf,"G%d",xi); 1758 sprintf(buf,"G%d",xi);
1757 return dupstr(buf); 1759 return dupstr(buf);
1758 } 1760 }
1759 if (button == 'v' || button == 'V' || button == '2') { 1761 if (button == 'v' || button == 'V' || button == '2') {
1760 if (!ui->hcursor) ui->hshow = 0; 1762 if (!ui->hcursor) ui->hshow = false;
1761 sprintf(buf,"V%d",xi); 1763 sprintf(buf,"V%d",xi);
1762 return dupstr(buf); 1764 return dupstr(buf);
1763 } 1765 }
1764 if (button == 'z' || button == 'Z' || button == '3') { 1766 if (button == 'z' || button == 'Z' || button == '3') {
1765 if (!ui->hcursor) ui->hshow = 0; 1767 if (!ui->hcursor) ui->hshow = false;
1766 sprintf(buf,"Z%d",xi); 1768 sprintf(buf,"Z%d",xi);
1767 return dupstr(buf); 1769 return dupstr(buf);
1768 } 1770 }
1769 if (button == 'e' || button == 'E' || button == CURSOR_SELECT2 || 1771 if (button == 'e' || button == 'E' || button == CURSOR_SELECT2 ||
1770 button == '0' || button == '\b' ) { 1772 button == '0' || button == '\b' ) {
1771 if (!ui->hcursor) ui->hshow = 0; 1773 if (!ui->hcursor) ui->hshow = false;
1772 sprintf(buf,"E%d",xi); 1774 sprintf(buf,"E%d",xi);
1773 return dupstr(buf); 1775 return dupstr(buf);
1774 } 1776 }
@@ -1786,37 +1788,50 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1786 case CURSOR_RIGHT: ui->hx += (ui->hx < ds->w) ? 1 : 0; break; 1788 case CURSOR_RIGHT: ui->hx += (ui->hx < ds->w) ? 1 : 0; break;
1787 case CURSOR_LEFT: ui->hx -= (ui->hx > 1) ? 1 : 0; break; 1789 case CURSOR_LEFT: ui->hx -= (ui->hx > 1) ? 1 : 0; break;
1788 } 1790 }
1789 ui->hshow = ui->hcursor = 1; 1791 ui->hshow = true;
1792 ui->hcursor = true;
1790 return UI_UPDATE; 1793 return UI_UPDATE;
1791 } 1794 }
1792 if (ui->hshow && button == CURSOR_SELECT) { 1795 if (ui->hshow && button == CURSOR_SELECT) {
1793 ui->hpencil = 1 - ui->hpencil; 1796 ui->hpencil = !ui->hpencil;
1794 ui->hcursor = 1; 1797 ui->hcursor = true;
1795 return UI_UPDATE; 1798 return UI_UPDATE;
1796 } 1799 }
1797 1800
1798 if (ui->hshow == 1 && ui->hpencil == 1) { 1801 if (ui->hshow && ui->hpencil) {
1799 xi = state->common->xinfo[ui->hx + ui->hy*(state->common->params.w+2)]; 1802 xi = state->common->xinfo[ui->hx + ui->hy*(state->common->params.w+2)];
1800 if (xi >= 0 && !state->common->fixed[xi]) { 1803 if (xi >= 0 && !state->common->fixed[xi]) {
1801 if (button == 'g' || button == 'G' || button == '1') { 1804 if (button == 'g' || button == 'G' || button == '1') {
1802 sprintf(buf,"g%d",xi); 1805 sprintf(buf,"g%d",xi);
1803 if (!ui->hcursor) ui->hpencil = ui->hshow = 0; 1806 if (!ui->hcursor) {
1807 ui->hpencil = false;
1808 ui->hshow = false;
1809 }
1804 return dupstr(buf); 1810 return dupstr(buf);
1805 } 1811 }
1806 if (button == 'v' || button == 'V' || button == '2') { 1812 if (button == 'v' || button == 'V' || button == '2') {
1807 sprintf(buf,"v%d",xi); 1813 sprintf(buf,"v%d",xi);
1808 if (!ui->hcursor) ui->hpencil = ui->hshow = 0; 1814 if (!ui->hcursor) {
1815 ui->hpencil = false;
1816 ui->hshow = false;
1817 }
1809 return dupstr(buf); 1818 return dupstr(buf);
1810 } 1819 }
1811 if (button == 'z' || button == 'Z' || button == '3') { 1820 if (button == 'z' || button == 'Z' || button == '3') {
1812 sprintf(buf,"z%d",xi); 1821 sprintf(buf,"z%d",xi);
1813 if (!ui->hcursor) ui->hpencil = ui->hshow = 0; 1822 if (!ui->hcursor) {
1823 ui->hpencil = false;
1824 ui->hshow = false;
1825 }
1814 return dupstr(buf); 1826 return dupstr(buf);
1815 } 1827 }
1816 if (button == 'e' || button == 'E' || button == CURSOR_SELECT2 || 1828 if (button == 'e' || button == 'E' || button == CURSOR_SELECT2 ||
1817 button == '0' || button == '\b') { 1829 button == '0' || button == '\b') {
1818 sprintf(buf,"E%d",xi); 1830 sprintf(buf,"E%d",xi);
1819 if (!ui->hcursor) ui->hpencil = ui->hshow = 0; 1831 if (!ui->hcursor) {
1832 ui->hpencil = false;
1833 ui->hshow = false;
1834 }
1820 return dupstr(buf); 1835 return dupstr(buf);
1821 } 1836 }
1822 } 1837 }
@@ -1826,52 +1841,68 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1826 xi = state->common->xinfo[gx+gy*(state->common->params.w+2)]; 1841 xi = state->common->xinfo[gx+gy*(state->common->params.w+2)];
1827 if (xi >= 0 && !state->common->fixed[xi]) { 1842 if (xi >= 0 && !state->common->fixed[xi]) {
1828 g = state->guess[xi]; 1843 g = state->guess[xi];
1829 if (ui->hshow == 0) { 1844 if (!ui->hshow) {
1830 if (button == LEFT_BUTTON) { 1845 if (button == LEFT_BUTTON) {
1831 ui->hshow = 1; ui->hpencil = 0; ui->hcursor = 0; 1846 ui->hshow = true;
1847 ui->hpencil = false;
1848 ui->hcursor = false;
1832 ui->hx = gx; ui->hy = gy; 1849 ui->hx = gx; ui->hy = gy;
1833 return UI_UPDATE; 1850 return UI_UPDATE;
1834 } 1851 }
1835 else if (button == RIGHT_BUTTON && g == 7) { 1852 else if (button == RIGHT_BUTTON && g == 7) {
1836 ui->hshow = 1; ui->hpencil = 1; ui->hcursor = 0; 1853 ui->hshow = true;
1854 ui->hpencil = true;
1855 ui->hcursor = false;
1837 ui->hx = gx; ui->hy = gy; 1856 ui->hx = gx; ui->hy = gy;
1838 return UI_UPDATE; 1857 return UI_UPDATE;
1839 } 1858 }
1840 } 1859 }
1841 else if (ui->hshow == 1) { 1860 else if (ui->hshow) {
1842 if (button == LEFT_BUTTON) { 1861 if (button == LEFT_BUTTON) {
1843 if (ui->hpencil == 0) { 1862 if (!ui->hpencil) {
1844 if (gx == ui->hx && gy == ui->hy) { 1863 if (gx == ui->hx && gy == ui->hy) {
1845 ui->hshow = 0; ui->hpencil = 0; ui->hcursor = 0; 1864 ui->hshow = false;
1865 ui->hpencil = false;
1866 ui->hcursor = false;
1846 ui->hx = 0; ui->hy = 0; 1867 ui->hx = 0; ui->hy = 0;
1847 return UI_UPDATE; 1868 return UI_UPDATE;
1848 } 1869 }
1849 else { 1870 else {
1850 ui->hshow = 1; ui->hpencil = 0; ui->hcursor = 0; 1871 ui->hshow = true;
1872 ui->hpencil = false;
1873 ui->hcursor = false;
1851 ui->hx = gx; ui->hy = gy; 1874 ui->hx = gx; ui->hy = gy;
1852 return UI_UPDATE; 1875 return UI_UPDATE;
1853 } 1876 }
1854 } 1877 }
1855 else { 1878 else {
1856 ui->hshow = 1; ui->hpencil = 0; ui->hcursor = 0; 1879 ui->hshow = true;
1880 ui->hpencil = false;
1881 ui->hcursor = false;
1857 ui->hx = gx; ui->hy = gy; 1882 ui->hx = gx; ui->hy = gy;
1858 return UI_UPDATE; 1883 return UI_UPDATE;
1859 } 1884 }
1860 } 1885 }
1861 else if (button == RIGHT_BUTTON) { 1886 else if (button == RIGHT_BUTTON) {
1862 if (ui->hpencil == 0 && g == 7) { 1887 if (!ui->hpencil && g == 7) {
1863 ui->hshow = 1; ui->hpencil = 1; ui->hcursor = 0; 1888 ui->hshow = true;
1889 ui->hpencil = true;
1890 ui->hcursor = false;
1864 ui->hx = gx; ui->hy = gy; 1891 ui->hx = gx; ui->hy = gy;
1865 return UI_UPDATE; 1892 return UI_UPDATE;
1866 } 1893 }
1867 else { 1894 else {
1868 if (gx == ui->hx && gy == ui->hy) { 1895 if (gx == ui->hx && gy == ui->hy) {
1869 ui->hshow = 0; ui->hpencil = 0; ui->hcursor = 0; 1896 ui->hshow = false;
1897 ui->hpencil = false;
1898 ui->hcursor = false;
1870 ui->hx = 0; ui->hy = 0; 1899 ui->hx = 0; ui->hy = 0;
1871 return UI_UPDATE; 1900 return UI_UPDATE;
1872 } 1901 }
1873 else if (g == 7) { 1902 else if (g == 7) {
1874 ui->hshow = 1; ui->hpencil = 1; ui->hcursor = 0; 1903 ui->hshow = true;
1904 ui->hpencil = true;
1905 ui->hcursor = false;
1875 ui->hx = gx; ui->hy = gy; 1906 ui->hx = gx; ui->hy = gy;
1876 return UI_UPDATE; 1907 return UI_UPDATE;
1877 } 1908 }
@@ -1889,8 +1920,8 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1889 return NULL; 1920 return NULL;
1890} 1921}
1891 1922
1892int check_numbers_draw(game_state *state, int *guess) { 1923static bool check_numbers_draw(game_state *state, int *guess) {
1893 int valid, filled; 1924 bool valid, filled;
1894 int i,x,y,xy; 1925 int i,x,y,xy;
1895 int count_ghosts, count_vampires, count_zombies; 1926 int count_ghosts, count_vampires, count_zombies;
1896 1927
@@ -1901,64 +1932,64 @@ int check_numbers_draw(game_state *state, int *guess) {
1901 if (guess[i] == 4) count_zombies++; 1932 if (guess[i] == 4) count_zombies++;
1902 } 1933 }
1903 1934
1904 valid = TRUE; 1935 valid = true;
1905 filled = (count_ghosts + count_vampires + count_zombies >= 1936 filled = (count_ghosts + count_vampires + count_zombies >=
1906 state->common->num_total); 1937 state->common->num_total);
1907 1938
1908 if (count_ghosts > state->common->num_ghosts || 1939 if (count_ghosts > state->common->num_ghosts ||
1909 (filled && count_ghosts != state->common->num_ghosts) ) { 1940 (filled && count_ghosts != state->common->num_ghosts) ) {
1910 valid = FALSE; 1941 valid = false;
1911 state->count_errors[0] = TRUE; 1942 state->count_errors[0] = true;
1912 for (x=1;x<state->common->params.w+1;x++) 1943 for (x=1;x<state->common->params.w+1;x++)
1913 for (y=1;y<state->common->params.h+1;y++) { 1944 for (y=1;y<state->common->params.h+1;y++) {
1914 xy = x+y*(state->common->params.w+2); 1945 xy = x+y*(state->common->params.w+2);
1915 if (state->common->xinfo[xy] >= 0 && 1946 if (state->common->xinfo[xy] >= 0 &&
1916 guess[state->common->xinfo[xy]] == 1) 1947 guess[state->common->xinfo[xy]] == 1)
1917 state->cell_errors[xy] = TRUE; 1948 state->cell_errors[xy] = true;
1918 } 1949 }
1919 } 1950 }
1920 if (count_vampires > state->common->num_vampires || 1951 if (count_vampires > state->common->num_vampires ||
1921 (filled && count_vampires != state->common->num_vampires) ) { 1952 (filled && count_vampires != state->common->num_vampires) ) {
1922 valid = FALSE; 1953 valid = false;
1923 state->count_errors[1] = TRUE; 1954 state->count_errors[1] = true;
1924 for (x=1;x<state->common->params.w+1;x++) 1955 for (x=1;x<state->common->params.w+1;x++)
1925 for (y=1;y<state->common->params.h+1;y++) { 1956 for (y=1;y<state->common->params.h+1;y++) {
1926 xy = x+y*(state->common->params.w+2); 1957 xy = x+y*(state->common->params.w+2);
1927 if (state->common->xinfo[xy] >= 0 && 1958 if (state->common->xinfo[xy] >= 0 &&
1928 guess[state->common->xinfo[xy]] == 2) 1959 guess[state->common->xinfo[xy]] == 2)
1929 state->cell_errors[xy] = TRUE; 1960 state->cell_errors[xy] = true;
1930 } 1961 }
1931 } 1962 }
1932 if (count_zombies > state->common->num_zombies || 1963 if (count_zombies > state->common->num_zombies ||
1933 (filled && count_zombies != state->common->num_zombies) ) { 1964 (filled && count_zombies != state->common->num_zombies) ) {
1934 valid = FALSE; 1965 valid = false;
1935 state->count_errors[2] = TRUE; 1966 state->count_errors[2] = true;
1936 for (x=1;x<state->common->params.w+1;x++) 1967 for (x=1;x<state->common->params.w+1;x++)
1937 for (y=1;y<state->common->params.h+1;y++) { 1968 for (y=1;y<state->common->params.h+1;y++) {
1938 xy = x+y*(state->common->params.w+2); 1969 xy = x+y*(state->common->params.w+2);
1939 if (state->common->xinfo[xy] >= 0 && 1970 if (state->common->xinfo[xy] >= 0 &&
1940 guess[state->common->xinfo[xy]] == 4) 1971 guess[state->common->xinfo[xy]] == 4)
1941 state->cell_errors[xy] = TRUE; 1972 state->cell_errors[xy] = true;
1942 } 1973 }
1943 } 1974 }
1944 1975
1945 return valid; 1976 return valid;
1946} 1977}
1947 1978
1948int check_path_solution(game_state *state, int p) { 1979static bool check_path_solution(game_state *state, int p) {
1949 int i; 1980 int i;
1950 int mirror; 1981 bool mirror;
1951 int count; 1982 int count;
1952 int correct; 1983 bool correct;
1953 int unfilled; 1984 int unfilled;
1954 1985
1955 count = 0; 1986 count = 0;
1956 mirror = FALSE; 1987 mirror = false;
1957 correct = TRUE; 1988 correct = true;
1958 1989
1959 unfilled = 0; 1990 unfilled = 0;
1960 for (i=0;i<state->common->paths[p].length;i++) { 1991 for (i=0;i<state->common->paths[p].length;i++) {
1961 if (state->common->paths[p].p[i] == -1) mirror = TRUE; 1992 if (state->common->paths[p].p[i] == -1) mirror = true;
1962 else { 1993 else {
1963 if (state->guess[state->common->paths[p].p[i]] == 1 && mirror) 1994 if (state->guess[state->common->paths[p].p[i]] == 1 && mirror)
1964 count++; 1995 count++;
@@ -1974,15 +2005,15 @@ int check_path_solution(game_state *state, int p) {
1974 if (count > state->common->paths[p].sightings_start || 2005 if (count > state->common->paths[p].sightings_start ||
1975 count + unfilled < state->common->paths[p].sightings_start) 2006 count + unfilled < state->common->paths[p].sightings_start)
1976 { 2007 {
1977 correct = FALSE; 2008 correct = false;
1978 state->hint_errors[state->common->paths[p].grid_start] = TRUE; 2009 state->hint_errors[state->common->paths[p].grid_start] = true;
1979 } 2010 }
1980 2011
1981 count = 0; 2012 count = 0;
1982 mirror = FALSE; 2013 mirror = false;
1983 unfilled = 0; 2014 unfilled = 0;
1984 for (i=state->common->paths[p].length-1;i>=0;i--) { 2015 for (i=state->common->paths[p].length-1;i>=0;i--) {
1985 if (state->common->paths[p].p[i] == -1) mirror = TRUE; 2016 if (state->common->paths[p].p[i] == -1) mirror = true;
1986 else { 2017 else {
1987 if (state->guess[state->common->paths[p].p[i]] == 1 && mirror) 2018 if (state->guess[state->common->paths[p].p[i]] == 1 && mirror)
1988 count++; 2019 count++;
@@ -1998,13 +2029,13 @@ int check_path_solution(game_state *state, int p) {
1998 if (count > state->common->paths[p].sightings_end || 2029 if (count > state->common->paths[p].sightings_end ||
1999 count + unfilled < state->common->paths[p].sightings_end) 2030 count + unfilled < state->common->paths[p].sightings_end)
2000 { 2031 {
2001 correct = FALSE; 2032 correct = false;
2002 state->hint_errors[state->common->paths[p].grid_end] = TRUE; 2033 state->hint_errors[state->common->paths[p].grid_end] = true;
2003 } 2034 }
2004 2035
2005 if (!correct) { 2036 if (!correct) {
2006 for (i=0;i<state->common->paths[p].length;i++) 2037 for (i=0;i<state->common->paths[p].length;i++)
2007 state->cell_errors[state->common->paths[p].xy[i]] = TRUE; 2038 state->cell_errors[state->common->paths[p].xy[i]] = true;
2008 } 2039 }
2009 2040
2010 return correct; 2041 return correct;
@@ -2014,17 +2045,17 @@ static game_state *execute_move(const game_state *state, const char *move)
2014{ 2045{
2015 int x,y,n,p,i; 2046 int x,y,n,p,i;
2016 char c; 2047 char c;
2017 int correct; 2048 bool correct;
2018 int solver; 2049 bool solver;
2019 2050
2020 game_state *ret = dup_game(state); 2051 game_state *ret = dup_game(state);
2021 solver = FALSE; 2052 solver = false;
2022 2053
2023 while (*move) { 2054 while (*move) {
2024 c = *move; 2055 c = *move;
2025 if (c == 'S') { 2056 if (c == 'S') {
2026 move++; 2057 move++;
2027 solver = TRUE; 2058 solver = true;
2028 } 2059 }
2029 if (c == 'G' || c == 'V' || c == 'Z' || c == 'E' || 2060 if (c == 'G' || c == 'V' || c == 'Z' || c == 'E' ||
2030 c == 'g' || c == 'v' || c == 'z') { 2061 c == 'g' || c == 'v' || c == 'z') {
@@ -2059,23 +2090,23 @@ static game_state *execute_move(const game_state *state, const char *move)
2059 if (*move == ';') move++; 2090 if (*move == ';') move++;
2060 } 2091 }
2061 2092
2062 correct = TRUE; 2093 correct = true;
2063 2094
2064 for (i=0;i<ret->common->wh;i++) ret->cell_errors[i] = FALSE; 2095 for (i=0;i<ret->common->wh;i++) ret->cell_errors[i] = false;
2065 for (i=0;i<2*ret->common->num_paths;i++) ret->hint_errors[i] = FALSE; 2096 for (i=0;i<2*ret->common->num_paths;i++) ret->hint_errors[i] = false;
2066 for (i=0;i<3;i++) ret->count_errors[i] = FALSE; 2097 for (i=0;i<3;i++) ret->count_errors[i] = false;
2067 2098
2068 if (!check_numbers_draw(ret,ret->guess)) correct = FALSE; 2099 if (!check_numbers_draw(ret,ret->guess)) correct = false;
2069 2100
2070 for (p=0;p<state->common->num_paths;p++) 2101 for (p=0;p<state->common->num_paths;p++)
2071 if (!check_path_solution(ret,p)) correct = FALSE; 2102 if (!check_path_solution(ret,p)) correct = false;
2072 2103
2073 for (i=0;i<state->common->num_total;i++) 2104 for (i=0;i<state->common->num_total;i++)
2074 if (!(ret->guess[i] == 1 || ret->guess[i] == 2 || 2105 if (!(ret->guess[i] == 1 || ret->guess[i] == 2 ||
2075 ret->guess[i] == 4)) correct = FALSE; 2106 ret->guess[i] == 4)) correct = false;
2076 2107
2077 if (correct && !solver) ret->solved = TRUE; 2108 if (correct && !solver) ret->solved = true;
2078 if (solver) ret->cheated = TRUE; 2109 if (solver) ret->cheated = true;
2079 2110
2080 return ret; 2111 return ret;
2081} 2112}
@@ -2159,14 +2190,14 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
2159 struct game_drawstate *ds = snew(struct game_drawstate); 2190 struct game_drawstate *ds = snew(struct game_drawstate);
2160 2191
2161 ds->tilesize = 0; 2192 ds->tilesize = 0;
2162 ds->started = ds->solved = FALSE; 2193 ds->started = ds->solved = false;
2163 ds->w = state->common->params.w; 2194 ds->w = state->common->params.w;
2164 ds->h = state->common->params.h; 2195 ds->h = state->common->params.h;
2165 ds->ascii = FALSE; 2196 ds->ascii = false;
2166 2197
2167 ds->count_errors[0] = FALSE; 2198 ds->count_errors[0] = false;
2168 ds->count_errors[1] = FALSE; 2199 ds->count_errors[1] = false;
2169 ds->count_errors[2] = FALSE; 2200 ds->count_errors[2] = false;
2170 2201
2171 ds->monsters = snewn(state->common->num_total,int); 2202 ds->monsters = snewn(state->common->num_total,int);
2172 for (i=0;i<(state->common->num_total);i++) 2203 for (i=0;i<(state->common->num_total);i++)
@@ -2175,17 +2206,19 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
2175 for (i=0;i<state->common->num_total;i++) 2206 for (i=0;i<state->common->num_total;i++)
2176 ds->pencils[i] = 0; 2207 ds->pencils[i] = 0;
2177 2208
2178 ds->cell_errors = snewn(state->common->wh,unsigned char); 2209 ds->cell_errors = snewn(state->common->wh,bool);
2179 for (i=0;i<state->common->wh;i++) 2210 for (i=0;i<state->common->wh;i++)
2180 ds->cell_errors[i] = FALSE; 2211 ds->cell_errors[i] = false;
2181 ds->hint_errors = snewn(2*state->common->num_paths,unsigned char); 2212 ds->hint_errors = snewn(2*state->common->num_paths,bool);
2182 for (i=0;i<2*state->common->num_paths;i++) 2213 for (i=0;i<2*state->common->num_paths;i++)
2183 ds->hint_errors[i] = FALSE; 2214 ds->hint_errors[i] = false;
2184 ds->hints_done = snewn(2 * state->common->num_paths, unsigned char); 2215 ds->hints_done = snewn(2 * state->common->num_paths, bool);
2185 memset(ds->hints_done, 0, 2216 memset(ds->hints_done, 0,
2186 2 * state->common->num_paths * sizeof(unsigned char)); 2217 2 * state->common->num_paths * sizeof(bool));
2187 2218
2188 ds->hshow = ds->hpencil = ds->hflash = 0; 2219 ds->hshow = false;
2220 ds->hpencil = false;
2221 ds->hflash = false;
2189 ds->hx = ds->hy = 0; 2222 ds->hx = ds->hy = 0;
2190 return ds; 2223 return ds;
2191} 2224}
@@ -2204,7 +2237,7 @@ static void draw_cell_background(drawing *dr, game_drawstate *ds,
2204 const game_state *state, const game_ui *ui, 2237 const game_state *state, const game_ui *ui,
2205 int x, int y) { 2238 int x, int y) {
2206 2239
2207 int hon; 2240 bool hon;
2208 int dx,dy; 2241 int dx,dy;
2209 dx = BORDER+(x* ds->tilesize)+(TILESIZE/2); 2242 dx = BORDER+(x* ds->tilesize)+(TILESIZE/2);
2210 dy = BORDER+(y* ds->tilesize)+(TILESIZE/2)+TILESIZE; 2243 dy = BORDER+(y* ds->tilesize)+(TILESIZE/2)+TILESIZE;
@@ -2238,7 +2271,7 @@ static void draw_circle_or_point(drawing *dr, int cx, int cy, int radius,
2238} 2271}
2239 2272
2240static void draw_monster(drawing *dr, game_drawstate *ds, int x, int y, 2273static void draw_monster(drawing *dr, game_drawstate *ds, int x, int y,
2241 int tilesize, int hflash, int monster) 2274 int tilesize, bool hflash, int monster)
2242{ 2275{
2243 int black = (hflash ? COL_FLASH : COL_TEXT); 2276 int black = (hflash ? COL_FLASH : COL_TEXT);
2244 2277
@@ -2367,7 +2400,7 @@ static void draw_monster(drawing *dr, game_drawstate *ds, int x, int y,
2367} 2400}
2368 2401
2369static void draw_monster_count(drawing *dr, game_drawstate *ds, 2402static void draw_monster_count(drawing *dr, game_drawstate *ds,
2370 const game_state *state, int c, int hflash) { 2403 const game_state *state, int c, bool hflash) {
2371 int dx,dy; 2404 int dx,dy;
2372 char buf[8]; 2405 char buf[8];
2373 char bufm[8]; 2406 char bufm[8];
@@ -2412,7 +2445,7 @@ static void draw_monster_count(drawing *dr, game_drawstate *ds,
2412 2445
2413static void draw_path_hint(drawing *dr, game_drawstate *ds, 2446static void draw_path_hint(drawing *dr, game_drawstate *ds,
2414 const struct game_params *params, 2447 const struct game_params *params,
2415 int hint_index, int hflash, int hint) { 2448 int hint_index, bool hflash, int hint) {
2416 int x, y, color, dx, dy, text_dx, text_dy, text_size; 2449 int x, y, color, dx, dy, text_dx, text_dy, text_size;
2417 char buf[4]; 2450 char buf[4];
2418 2451
@@ -2448,7 +2481,7 @@ static void draw_path_hint(drawing *dr, game_drawstate *ds,
2448 2481
2449static void draw_mirror(drawing *dr, game_drawstate *ds, 2482static void draw_mirror(drawing *dr, game_drawstate *ds,
2450 const game_state *state, int x, int y, 2483 const game_state *state, int x, int y,
2451 int hflash, int mirror) { 2484 bool hflash, int mirror) {
2452 int dx,dy,mx1,my1,mx2,my2; 2485 int dx,dy,mx1,my1,mx2,my2;
2453 dx = BORDER+(x* ds->tilesize)+(TILESIZE/2); 2486 dx = BORDER+(x* ds->tilesize)+(TILESIZE/2);
2454 dy = BORDER+(y* ds->tilesize)+(TILESIZE/2)+TILESIZE; 2487 dy = BORDER+(y* ds->tilesize)+(TILESIZE/2)+TILESIZE;
@@ -2474,7 +2507,7 @@ static void draw_mirror(drawing *dr, game_drawstate *ds,
2474 2507
2475static void draw_big_monster(drawing *dr, game_drawstate *ds, 2508static void draw_big_monster(drawing *dr, game_drawstate *ds,
2476 const game_state *state, int x, int y, 2509 const game_state *state, int x, int y,
2477 int hflash, int monster) 2510 bool hflash, int monster)
2478{ 2511{
2479 int dx,dy; 2512 int dx,dy;
2480 char buf[10]; 2513 char buf[10];
@@ -2518,7 +2551,7 @@ static void draw_pencils(drawing *dr, game_drawstate *ds,
2518 if (!ds->ascii) { 2551 if (!ds->ascii) {
2519 draw_monster(dr, ds, 2552 draw_monster(dr, ds,
2520 dx + TILESIZE/2 * px, dy + TILESIZE/2 * py, 2553 dx + TILESIZE/2 * px, dy + TILESIZE/2 * py,
2521 TILESIZE/2, 0, monsters[py*2+px]); 2554 TILESIZE/2, false, monsters[py*2+px]);
2522 } 2555 }
2523 else { 2556 else {
2524 switch (monsters[py*2+px]) { 2557 switch (monsters[py*2+px]) {
@@ -2539,21 +2572,21 @@ static void draw_pencils(drawing *dr, game_drawstate *ds,
2539 2572
2540#define FLASH_TIME 0.7F 2573#define FLASH_TIME 0.7F
2541 2574
2542static int is_hint_stale(const game_drawstate *ds, int hflash, 2575static bool is_hint_stale(const game_drawstate *ds, bool hflash,
2543 const game_state *state, int index) 2576 const game_state *state, int index)
2544{ 2577{
2545 int ret = FALSE; 2578 bool ret = false;
2546 if (!ds->started) ret = TRUE; 2579 if (!ds->started) ret = true;
2547 if (ds->hflash != hflash) ret = TRUE; 2580 if (ds->hflash != hflash) ret = true;
2548 2581
2549 if (ds->hint_errors[index] != state->hint_errors[index]) { 2582 if (ds->hint_errors[index] != state->hint_errors[index]) {
2550 ds->hint_errors[index] = state->hint_errors[index]; 2583 ds->hint_errors[index] = state->hint_errors[index];
2551 ret = TRUE; 2584 ret = true;
2552 } 2585 }
2553 2586
2554 if (ds->hints_done[index] != state->hints_done[index]) { 2587 if (ds->hints_done[index] != state->hints_done[index]) {
2555 ds->hints_done[index] = state->hints_done[index]; 2588 ds->hints_done[index] = state->hints_done[index];
2556 ret = TRUE; 2589 ret = true;
2557 } 2590 }
2558 2591
2559 return ret; 2592 return ret;
@@ -2565,7 +2598,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2565 float animtime, float flashtime) 2598 float animtime, float flashtime)
2566{ 2599{
2567 int i,j,x,y,xy; 2600 int i,j,x,y,xy;
2568 int stale, xi, c, hflash, hchanged, changed_ascii; 2601 int xi, c;
2602 bool stale, hflash, hchanged, changed_ascii;
2569 2603
2570 hflash = (int)(flashtime * 5 / FLASH_TIME) % 2; 2604 hflash = (int)(flashtime * 5 / FLASH_TIME) % 2;
2571 2605
@@ -2584,26 +2618,26 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2584 2*BORDER+(ds->h+3)*TILESIZE); 2618 2*BORDER+(ds->h+3)*TILESIZE);
2585 } 2619 }
2586 2620
2587 hchanged = FALSE; 2621 hchanged = false;
2588 if (ds->hx != ui->hx || ds->hy != ui->hy || 2622 if (ds->hx != ui->hx || ds->hy != ui->hy ||
2589 ds->hshow != ui->hshow || ds->hpencil != ui->hpencil) 2623 ds->hshow != ui->hshow || ds->hpencil != ui->hpencil)
2590 hchanged = TRUE; 2624 hchanged = true;
2591 2625
2592 if (ds->ascii != ui->ascii) { 2626 if (ds->ascii != ui->ascii) {
2593 ds->ascii = ui->ascii; 2627 ds->ascii = ui->ascii;
2594 changed_ascii = TRUE; 2628 changed_ascii = true;
2595 } else 2629 } else
2596 changed_ascii = FALSE; 2630 changed_ascii = false;
2597 2631
2598 /* Draw monster count hints */ 2632 /* Draw monster count hints */
2599 2633
2600 for (i=0;i<3;i++) { 2634 for (i=0;i<3;i++) {
2601 stale = FALSE; 2635 stale = false;
2602 if (!ds->started) stale = TRUE; 2636 if (!ds->started) stale = true;
2603 if (ds->hflash != hflash) stale = TRUE; 2637 if (ds->hflash != hflash) stale = true;
2604 if (changed_ascii) stale = TRUE; 2638 if (changed_ascii) stale = true;
2605 if (ds->count_errors[i] != state->count_errors[i]) { 2639 if (ds->count_errors[i] != state->count_errors[i]) {
2606 stale = TRUE; 2640 stale = true;
2607 ds->count_errors[i] = state->count_errors[i]; 2641 ds->count_errors[i] = state->count_errors[i];
2608 } 2642 }
2609 2643
@@ -2630,33 +2664,33 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2630 /* Draw puzzle grid contents */ 2664 /* Draw puzzle grid contents */
2631 for (x = 1; x < ds->w+1; x++) 2665 for (x = 1; x < ds->w+1; x++)
2632 for (y = 1; y < ds->h+1; y++) { 2666 for (y = 1; y < ds->h+1; y++) {
2633 stale = FALSE; 2667 stale = false;
2634 xy = x+y*(state->common->params.w+2); 2668 xy = x+y*(state->common->params.w+2);
2635 xi = state->common->xinfo[xy]; 2669 xi = state->common->xinfo[xy];
2636 c = state->common->grid[xy]; 2670 c = state->common->grid[xy];
2637 2671
2638 if (!ds->started) stale = TRUE; 2672 if (!ds->started) stale = true;
2639 if (ds->hflash != hflash) stale = TRUE; 2673 if (ds->hflash != hflash) stale = true;
2640 if (changed_ascii) stale = TRUE; 2674 if (changed_ascii) stale = true;
2641 2675
2642 if (hchanged) { 2676 if (hchanged) {
2643 if ((x == ui->hx && y == ui->hy) || 2677 if ((x == ui->hx && y == ui->hy) ||
2644 (x == ds->hx && y == ds->hy)) 2678 (x == ds->hx && y == ds->hy))
2645 stale = TRUE; 2679 stale = true;
2646 } 2680 }
2647 2681
2648 if (xi >= 0 && (state->guess[xi] != ds->monsters[xi]) ) { 2682 if (xi >= 0 && (state->guess[xi] != ds->monsters[xi]) ) {
2649 stale = TRUE; 2683 stale = true;
2650 ds->monsters[xi] = state->guess[xi]; 2684 ds->monsters[xi] = state->guess[xi];
2651 } 2685 }
2652 2686
2653 if (xi >= 0 && (state->pencils[xi] != ds->pencils[xi]) ) { 2687 if (xi >= 0 && (state->pencils[xi] != ds->pencils[xi]) ) {
2654 stale = TRUE; 2688 stale = true;
2655 ds->pencils[xi] = state->pencils[xi]; 2689 ds->pencils[xi] = state->pencils[xi];
2656 } 2690 }
2657 2691
2658 if (state->cell_errors[xy] != ds->cell_errors[xy]) { 2692 if (state->cell_errors[xy] != ds->cell_errors[xy]) {
2659 stale = TRUE; 2693 stale = true;
2660 ds->cell_errors[xy] = state->cell_errors[xy]; 2694 ds->cell_errors[xy] = state->cell_errors[xy];
2661 } 2695 }
2662 2696
@@ -2676,7 +2710,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2676 ds->hshow = ui->hshow; 2710 ds->hshow = ui->hshow;
2677 ds->hpencil = ui->hpencil; 2711 ds->hpencil = ui->hpencil;
2678 ds->hflash = hflash; 2712 ds->hflash = hflash;
2679 ds->started = TRUE; 2713 ds->started = true;
2680 return; 2714 return;
2681} 2715}
2682 2716
@@ -2698,9 +2732,9 @@ static int game_status(const game_state *state)
2698 return state->solved; 2732 return state->solved;
2699} 2733}
2700 2734
2701static int game_timing_state(const game_state *state, game_ui *ui) 2735static bool game_timing_state(const game_state *state, game_ui *ui)
2702{ 2736{
2703 return TRUE; 2737 return true;
2704} 2738}
2705 2739
2706static void game_print_size(const game_params *params, float *x, float *y) 2740static void game_print_size(const game_params *params, float *x, float *y)
@@ -2723,15 +2757,15 @@ const struct game thegame = {
2723 encode_params, 2757 encode_params,
2724 free_params, 2758 free_params,
2725 dup_params, 2759 dup_params,
2726 TRUE, game_configure, custom_params, 2760 true, game_configure, custom_params,
2727 validate_params, 2761 validate_params,
2728 new_game_desc, 2762 new_game_desc,
2729 validate_desc, 2763 validate_desc,
2730 new_game, 2764 new_game,
2731 dup_game, 2765 dup_game,
2732 free_game, 2766 free_game,
2733 TRUE, solve_game, 2767 true, solve_game,
2734 TRUE, game_can_format_as_text_now, game_text_format, 2768 true, game_can_format_as_text_now, game_text_format,
2735 new_ui, 2769 new_ui,
2736 free_ui, 2770 free_ui,
2737 encode_ui, 2771 encode_ui,
@@ -2748,8 +2782,8 @@ const struct game thegame = {
2748 game_anim_length, 2782 game_anim_length,
2749 game_flash_length, 2783 game_flash_length,
2750 game_status, 2784 game_status,
2751 FALSE, FALSE, game_print_size, game_print, 2785 false, false, game_print_size, game_print,
2752 FALSE, /* wants_statusbar */ 2786 false, /* wants_statusbar */
2753 FALSE, game_timing_state, 2787 false, game_timing_state,
2754 0, /* flags */ 2788 0, /* flags */
2755}; 2789};
diff --git a/apps/plugins/puzzles/src/unequal.c b/apps/plugins/puzzles/src/unequal.c
index addcffaf68..951e9ac80f 100644
--- a/apps/plugins/puzzles/src/unequal.c
+++ b/apps/plugins/puzzles/src/unequal.c
@@ -55,11 +55,15 @@ enum {
55 NCOLOURS 55 NCOLOURS
56}; 56};
57 57
58typedef enum {
59 MODE_UNEQUAL, /* Puzzle indicators are 'greater-than'. */
60 MODE_ADJACENT /* Puzzle indicators are 'adjacent number'. */
61} Mode;
62
58struct game_params { 63struct game_params {
59 int order; /* Size of latin square */ 64 int order; /* Size of latin square */
60 int diff; /* Difficulty */ 65 int diff; /* Difficulty */
61 int adjacent; /* Puzzle indicators are 'adjacent number' 66 Mode mode;
62 not 'greater-than'. */
63}; 67};
64 68
65#define F_IMMUTABLE 1 /* passed in as game description */ 69#define F_IMMUTABLE 1 /* passed in as game description */
@@ -82,7 +86,9 @@ struct game_params {
82#define F_ERROR_MASK (F_ERROR|F_ERROR_UP|F_ERROR_RIGHT|F_ERROR_DOWN|F_ERROR_LEFT) 86#define F_ERROR_MASK (F_ERROR|F_ERROR_UP|F_ERROR_RIGHT|F_ERROR_DOWN|F_ERROR_LEFT)
83 87
84struct game_state { 88struct game_state {
85 int order, completed, cheated, adjacent; 89 int order;
90 bool completed, cheated;
91 Mode mode;
86 digit *nums; /* actual numbers (size order^2) */ 92 digit *nums; /* actual numbers (size order^2) */
87 unsigned char *hints; /* remaining possiblities (size order^3) */ 93 unsigned char *hints; /* remaining possiblities (size order^3) */
88 unsigned int *flags; /* flags (size order^2) */ 94 unsigned int *flags; /* flags (size order^2) */
@@ -126,25 +132,25 @@ static const struct game_params unequal_presets[] = {
126 { 7, DIFF_EXTREME, 0 } 132 { 7, DIFF_EXTREME, 0 }
127}; 133};
128 134
129static int game_fetch_preset(int i, char **name, game_params **params) 135static bool game_fetch_preset(int i, char **name, game_params **params)
130{ 136{
131 game_params *ret; 137 game_params *ret;
132 char buf[80]; 138 char buf[80];
133 139
134 if (i < 0 || i >= lenof(unequal_presets)) 140 if (i < 0 || i >= lenof(unequal_presets))
135 return FALSE; 141 return false;
136 142
137 ret = snew(game_params); 143 ret = snew(game_params);
138 *ret = unequal_presets[i]; /* structure copy */ 144 *ret = unequal_presets[i]; /* structure copy */
139 145
140 sprintf(buf, "%s: %dx%d %s", 146 sprintf(buf, "%s: %dx%d %s",
141 ret->adjacent ? "Adjacent" : "Unequal", 147 ret->mode == MODE_ADJACENT ? "Adjacent" : "Unequal",
142 ret->order, ret->order, 148 ret->order, ret->order,
143 unequal_diffnames[ret->diff]); 149 unequal_diffnames[ret->diff]);
144 150
145 *name = dupstr(buf); 151 *name = dupstr(buf);
146 *params = ret; 152 *params = ret;
147 return TRUE; 153 return true;
148} 154}
149 155
150static game_params *default_params(void) 156static game_params *default_params(void)
@@ -178,9 +184,9 @@ static void decode_params(game_params *ret, char const *string)
178 184
179 if (*p == 'a') { 185 if (*p == 'a') {
180 p++; 186 p++;
181 ret->adjacent = 1; 187 ret->mode = MODE_ADJACENT;
182 } else 188 } else
183 ret->adjacent = 0; 189 ret->mode = MODE_UNEQUAL;
184 190
185 if (*p == 'd') { 191 if (*p == 'd') {
186 int i; 192 int i;
@@ -196,12 +202,12 @@ static void decode_params(game_params *ret, char const *string)
196 } 202 }
197} 203}
198 204
199static char *encode_params(const game_params *params, int full) 205static char *encode_params(const game_params *params, bool full)
200{ 206{
201 char ret[80]; 207 char ret[80];
202 208
203 sprintf(ret, "%d", params->order); 209 sprintf(ret, "%d", params->order);
204 if (params->adjacent) 210 if (params->mode == MODE_ADJACENT)
205 sprintf(ret + strlen(ret), "a"); 211 sprintf(ret + strlen(ret), "a");
206 if (full) 212 if (full)
207 sprintf(ret + strlen(ret), "d%c", unequal_diffchars[params->diff]); 213 sprintf(ret + strlen(ret), "d%c", unequal_diffchars[params->diff]);
@@ -219,7 +225,7 @@ static config_item *game_configure(const game_params *params)
219 ret[0].name = "Mode"; 225 ret[0].name = "Mode";
220 ret[0].type = C_CHOICES; 226 ret[0].type = C_CHOICES;
221 ret[0].u.choices.choicenames = ":Unequal:Adjacent"; 227 ret[0].u.choices.choicenames = ":Unequal:Adjacent";
222 ret[0].u.choices.selected = params->adjacent; 228 ret[0].u.choices.selected = params->mode;
223 229
224 ret[1].name = "Size (s*s)"; 230 ret[1].name = "Size (s*s)";
225 ret[1].type = C_STRING; 231 ret[1].type = C_STRING;
@@ -241,20 +247,20 @@ static game_params *custom_params(const config_item *cfg)
241{ 247{
242 game_params *ret = snew(game_params); 248 game_params *ret = snew(game_params);
243 249
244 ret->adjacent = cfg[0].u.choices.selected; 250 ret->mode = cfg[0].u.choices.selected;
245 ret->order = atoi(cfg[1].u.string.sval); 251 ret->order = atoi(cfg[1].u.string.sval);
246 ret->diff = cfg[2].u.choices.selected; 252 ret->diff = cfg[2].u.choices.selected;
247 253
248 return ret; 254 return ret;
249} 255}
250 256
251static const char *validate_params(const game_params *params, int full) 257static const char *validate_params(const game_params *params, bool full)
252{ 258{
253 if (params->order < 3 || params->order > 32) 259 if (params->order < 3 || params->order > 32)
254 return "Order must be between 3 and 32"; 260 return "Order must be between 3 and 32";
255 if (params->diff >= DIFFCOUNT) 261 if (params->diff >= DIFFCOUNT)
256 return "Unknown difficulty rating"; 262 return "Unknown difficulty rating";
257 if (params->order < 5 && params->adjacent && 263 if (params->order < 5 && params->mode == MODE_ADJACENT &&
258 params->diff >= DIFF_SET) 264 params->diff >= DIFF_SET)
259 return "Order must be at least 5 for Adjacent puzzles of this difficulty."; 265 return "Order must be at least 5 for Adjacent puzzles of this difficulty.";
260 return NULL; 266 return NULL;
@@ -271,14 +277,15 @@ static const struct { unsigned int f, fo, fe; int dx, dy; char c, ac; } adjthan[
271 { F_ADJ_LEFT, F_ADJ_RIGHT, F_ERROR_LEFT, -1, 0, '<', '|' } 277 { F_ADJ_LEFT, F_ADJ_RIGHT, F_ERROR_LEFT, -1, 0, '<', '|' }
272}; 278};
273 279
274static game_state *blank_game(int order, int adjacent) 280static game_state *blank_game(int order, Mode mode)
275{ 281{
276 game_state *state = snew(game_state); 282 game_state *state = snew(game_state);
277 int o2 = order*order, o3 = o2*order; 283 int o2 = order*order, o3 = o2*order;
278 284
279 state->order = order; 285 state->order = order;
280 state->adjacent = adjacent; 286 state->mode = mode;
281 state->completed = state->cheated = 0; 287 state->completed = false;
288 state->cheated = false;
282 289
283 state->nums = snewn(o2, digit); 290 state->nums = snewn(o2, digit);
284 state->hints = snewn(o3, unsigned char); 291 state->hints = snewn(o3, unsigned char);
@@ -293,7 +300,7 @@ static game_state *blank_game(int order, int adjacent)
293 300
294static game_state *dup_game(const game_state *state) 301static game_state *dup_game(const game_state *state)
295{ 302{
296 game_state *ret = blank_game(state->order, state->adjacent); 303 game_state *ret = blank_game(state->order, state->mode);
297 int o2 = state->order*state->order, o3 = o2*state->order; 304 int o2 = state->order*state->order, o3 = o2*state->order;
298 305
299 memcpy(ret->nums, state->nums, o2 * sizeof(digit)); 306 memcpy(ret->nums, state->nums, o2 * sizeof(digit));
@@ -313,12 +320,13 @@ static void free_game(game_state *state)
313 320
314#define CHECKG(x,y) grid[(y)*o+(x)] 321#define CHECKG(x,y) grid[(y)*o+(x)]
315 322
316/* Returns 0 if it finds an error, 1 otherwise. */ 323/* Returns false if it finds an error, true if ok. */
317static int check_num_adj(digit *grid, game_state *state, 324static bool check_num_adj(digit *grid, game_state *state,
318 int x, int y, int me) 325 int x, int y, bool me)
319{ 326{
320 unsigned int f = GRID(state, flags, x, y); 327 unsigned int f = GRID(state, flags, x, y);
321 int ret = 1, i, o = state->order; 328 bool ret = true;
329 int i, o = state->order;
322 330
323 for (i = 0; i < 4; i++) { 331 for (i = 0; i < 4; i++) {
324 int dx = adjthan[i].dx, dy = adjthan[i].dy, n, dn; 332 int dx = adjthan[i].dx, dy = adjthan[i].dy, n, dn;
@@ -332,20 +340,20 @@ static int check_num_adj(digit *grid, game_state *state,
332 assert (n != 0); 340 assert (n != 0);
333 if (dn == 0) continue; 341 if (dn == 0) continue;
334 342
335 if (state->adjacent) { 343 if (state->mode == MODE_ADJACENT) {
336 int gd = abs(n-dn); 344 int gd = abs(n-dn);
337 345
338 if ((f & adjthan[i].f) && (gd != 1)) { 346 if ((f & adjthan[i].f) && (gd != 1)) {
339 debug(("check_adj error (%d,%d):%d should be | (%d,%d):%d", 347 debug(("check_adj error (%d,%d):%d should be | (%d,%d):%d",
340 x, y, n, x+dx, y+dy, dn)); 348 x, y, n, x+dx, y+dy, dn));
341 if (me) GRID(state, flags, x, y) |= adjthan[i].fe; 349 if (me) GRID(state, flags, x, y) |= adjthan[i].fe;
342 ret = 0; 350 ret = false;
343 } 351 }
344 if (!(f & adjthan[i].f) && (gd == 1)) { 352 if (!(f & adjthan[i].f) && (gd == 1)) {
345 debug(("check_adj error (%d,%d):%d should not be | (%d,%d):%d", 353 debug(("check_adj error (%d,%d):%d should not be | (%d,%d):%d",
346 x, y, n, x+dx, y+dy, dn)); 354 x, y, n, x+dx, y+dy, dn));
347 if (me) GRID(state, flags, x, y) |= adjthan[i].fe; 355 if (me) GRID(state, flags, x, y) |= adjthan[i].fe;
348 ret = 0; 356 ret = false;
349 } 357 }
350 358
351 } else { 359 } else {
@@ -353,32 +361,33 @@ static int check_num_adj(digit *grid, game_state *state,
353 debug(("check_adj error (%d,%d):%d not > (%d,%d):%d", 361 debug(("check_adj error (%d,%d):%d not > (%d,%d):%d",
354 x, y, n, x+dx, y+dy, dn)); 362 x, y, n, x+dx, y+dy, dn));
355 if (me) GRID(state, flags, x, y) |= adjthan[i].fe; 363 if (me) GRID(state, flags, x, y) |= adjthan[i].fe;
356 ret = 0; 364 ret = false;
357 } 365 }
358 } 366 }
359 } 367 }
360 return ret; 368 return ret;
361} 369}
362 370
363/* Returns 0 if it finds an error, 1 otherwise. */ 371/* Returns false if it finds an error, true if ok. */
364static int check_num_error(digit *grid, game_state *state, 372static bool check_num_error(digit *grid, game_state *state,
365 int x, int y, int mark_errors) 373 int x, int y, bool mark_errors)
366{ 374{
367 int o = state->order; 375 int o = state->order;
368 int xx, yy, val = CHECKG(x,y), ret = 1; 376 int xx, yy, val = CHECKG(x,y);
377 bool ret = true;
369 378
370 assert(val != 0); 379 assert(val != 0);
371 380
372 /* check for dups in same column. */ 381 /* check for dups in same column. */
373 for (yy = 0; yy < state->order; yy++) { 382 for (yy = 0; yy < state->order; yy++) {
374 if (yy == y) continue; 383 if (yy == y) continue;
375 if (CHECKG(x,yy) == val) ret = 0; 384 if (CHECKG(x,yy) == val) ret = false;
376 } 385 }
377 386
378 /* check for dups in same row. */ 387 /* check for dups in same row. */
379 for (xx = 0; xx < state->order; xx++) { 388 for (xx = 0; xx < state->order; xx++) {
380 if (xx == x) continue; 389 if (xx == x) continue;
381 if (CHECKG(xx,y) == val) ret = 0; 390 if (CHECKG(xx,y) == val) ret = false;
382 } 391 }
383 392
384 if (!ret) { 393 if (!ret) {
@@ -392,7 +401,7 @@ static int check_num_error(digit *grid, game_state *state,
392 * 0 for 'incomplete' 401 * 0 for 'incomplete'
393 * 1 for 'complete and correct' 402 * 1 for 'complete and correct'
394 */ 403 */
395static int check_complete(digit *grid, game_state *state, int mark_errors) 404static int check_complete(digit *grid, game_state *state, bool mark_errors)
396{ 405{
397 int x, y, ret = 1, o = state->order; 406 int x, y, ret = 1, o = state->order;
398 407
@@ -449,9 +458,9 @@ static int c2n(int c, int order) {
449 return -1; 458 return -1;
450} 459}
451 460
452static int game_can_format_as_text_now(const game_params *params) 461static bool game_can_format_as_text_now(const game_params *params)
453{ 462{
454 return TRUE; 463 return true;
455} 464}
456 465
457static char *game_text_format(const game_state *state) 466static char *game_text_format(const game_state *state)
@@ -469,7 +478,7 @@ static char *game_text_format(const game_state *state)
469 *p++ = n > 0 ? n2c(n, state->order) : '.'; 478 *p++ = n > 0 ? n2c(n, state->order) : '.';
470 479
471 if (x < (state->order-1)) { 480 if (x < (state->order-1)) {
472 if (state->adjacent) { 481 if (state->mode == MODE_ADJACENT) {
473 *p++ = (GRID(state, flags, x, y) & F_ADJ_RIGHT) ? '|' : ' '; 482 *p++ = (GRID(state, flags, x, y) & F_ADJ_RIGHT) ? '|' : ' ';
474 } else { 483 } else {
475 if (GRID(state, flags, x, y) & F_ADJ_RIGHT) 484 if (GRID(state, flags, x, y) & F_ADJ_RIGHT)
@@ -485,7 +494,7 @@ static char *game_text_format(const game_state *state)
485 494
486 if (y < (state->order-1)) { 495 if (y < (state->order-1)) {
487 for (x = 0; x < state->order; x++) { 496 for (x = 0; x < state->order; x++) {
488 if (state->adjacent) { 497 if (state->mode == MODE_ADJACENT) {
489 *p++ = (GRID(state, flags, x, y) & F_ADJ_DOWN) ? '-' : ' '; 498 *p++ = (GRID(state, flags, x, y) & F_ADJ_DOWN) ? '-' : ' ';
490 } else { 499 } else {
491 if (GRID(state, flags, x, y) & F_ADJ_DOWN) 500 if (GRID(state, flags, x, y) & F_ADJ_DOWN)
@@ -561,7 +570,8 @@ static struct solver_ctx *new_ctx(game_state *state)
561 ctx->links = NULL; 570 ctx->links = NULL;
562 ctx->state = state; 571 ctx->state = state;
563 572
564 if (state->adjacent) return ctx; /* adjacent mode doesn't use links. */ 573 if (state->mode == MODE_ADJACENT)
574 return ctx; /* adjacent mode doesn't use links. */
565 575
566 for (x = 0; x < o; x++) { 576 for (x = 0; x < o; x++) {
567 for (y = 0; y < o; y++) { 577 for (y = 0; y < o; y++) {
@@ -642,7 +652,7 @@ static int solver_links(struct latin_solver *solver, void *vctx)
642 j+1, link->gx+1, link->gy+1); 652 j+1, link->gx+1, link->gy+1);
643 } 653 }
644#endif 654#endif
645 cube(link->gx, link->gy, j+1) = FALSE; 655 cube(link->gx, link->gy, j+1) = false;
646 nchanged++; 656 nchanged++;
647 } 657 }
648 } 658 }
@@ -660,7 +670,7 @@ static int solver_links(struct latin_solver *solver, void *vctx)
660 j+1, link->lx+1, link->ly+1); 670 j+1, link->lx+1, link->ly+1);
661 } 671 }
662#endif 672#endif
663 cube(link->lx, link->ly, j+1) = FALSE; 673 cube(link->lx, link->ly, j+1) = false;
664 nchanged++; 674 nchanged++;
665 } 675 }
666 } 676 }
@@ -684,7 +694,8 @@ static int solver_adjacent(struct latin_solver *solver, void *vctx)
684 * adjacent possibles reflect the adjacent/non-adjacent clue. */ 694 * adjacent possibles reflect the adjacent/non-adjacent clue. */
685 695
686 for (i = 0; i < 4; i++) { 696 for (i = 0; i < 4; i++) {
687 int isadjacent = (GRID(ctx->state, flags, x, y) & adjthan[i].f); 697 bool isadjacent =
698 (GRID(ctx->state, flags, x, y) & adjthan[i].f);
688 699
689 nx = x + adjthan[i].dx, ny = y + adjthan[i].dy; 700 nx = x + adjthan[i].dx, ny = y + adjthan[i].dy;
690 if (nx < 0 || ny < 0 || nx >= o || ny >= o) 701 if (nx < 0 || ny < 0 || nx >= o || ny >= o)
@@ -697,7 +708,7 @@ static int solver_adjacent(struct latin_solver *solver, void *vctx)
697 if (isadjacent && (gd == 1)) continue; 708 if (isadjacent && (gd == 1)) continue;
698 if (!isadjacent && (gd != 1)) continue; 709 if (!isadjacent && (gd != 1)) continue;
699 710
700 if (cube(nx, ny, n+1) == FALSE) 711 if (!cube(nx, ny, n+1))
701 continue; /* already discounted this possibility. */ 712 continue; /* already discounted this possibility. */
702 713
703#ifdef STANDALONE_SOLVER 714#ifdef STANDALONE_SOLVER
@@ -709,7 +720,7 @@ static int solver_adjacent(struct latin_solver *solver, void *vctx)
709 solver_recurse_depth*4, "", n+1, nx+1, ny+1); 720 solver_recurse_depth*4, "", n+1, nx+1, ny+1);
710 } 721 }
711#endif 722#endif
712 cube(nx, ny, n+1) = FALSE; 723 cube(nx, ny, n+1) = false;
713 nchanged++; 724 nchanged++;
714 } 725 }
715 } 726 }
@@ -731,7 +742,8 @@ static int solver_adjacent_set(struct latin_solver *solver, void *vctx)
731 for (x = 0; x < o; x++) { 742 for (x = 0; x < o; x++) {
732 for (y = 0; y < o; y++) { 743 for (y = 0; y < o; y++) {
733 for (i = 0; i < 4; i++) { 744 for (i = 0; i < 4; i++) {
734 int isadjacent = (GRID(ctx->state, flags, x, y) & adjthan[i].f); 745 bool isadjacent =
746 (GRID(ctx->state, flags, x, y) & adjthan[i].f);
735 747
736 nx = x + adjthan[i].dx, ny = y + adjthan[i].dy; 748 nx = x + adjthan[i].dx, ny = y + adjthan[i].dy;
737 if (nx < 0 || ny < 0 || nx >= o || ny >= o) 749 if (nx < 0 || ny < 0 || nx >= o || ny >= o)
@@ -745,7 +757,7 @@ static int solver_adjacent_set(struct latin_solver *solver, void *vctx)
745 memset(scratch, 0, o*sizeof(int)); 757 memset(scratch, 0, o*sizeof(int));
746 758
747 for (n = 0; n < o; n++) { 759 for (n = 0; n < o; n++) {
748 if (cube(x, y, n+1) == FALSE) continue; 760 if (!cube(x, y, n+1)) continue;
749 761
750 for (nn = 0; nn < o; nn++) { 762 for (nn = 0; nn < o; nn++) {
751 if (n == nn) continue; 763 if (n == nn) continue;
@@ -762,7 +774,7 @@ static int solver_adjacent_set(struct latin_solver *solver, void *vctx)
762 * currently set but are not indicated in scratch. */ 774 * currently set but are not indicated in scratch. */
763 for (n = 0; n < o; n++) { 775 for (n = 0; n < o; n++) {
764 if (scratch[n] == 1) continue; 776 if (scratch[n] == 1) continue;
765 if (cube(nx, ny, n+1) == FALSE) continue; 777 if (!cube(nx, ny, n+1)) continue;
766 778
767#ifdef STANDALONE_SOLVER 779#ifdef STANDALONE_SOLVER
768 if (solver_show_working) { 780 if (solver_show_working) {
@@ -773,7 +785,7 @@ static int solver_adjacent_set(struct latin_solver *solver, void *vctx)
773 solver_recurse_depth*4, "", n+1, nx+1, ny+1); 785 solver_recurse_depth*4, "", n+1, nx+1, ny+1);
774 } 786 }
775#endif 787#endif
776 cube(nx, ny, n+1) = FALSE; 788 cube(nx, ny, n+1) = false;
777 nchanged++; 789 nchanged++;
778 } 790 }
779 } 791 }
@@ -786,7 +798,7 @@ static int solver_adjacent_set(struct latin_solver *solver, void *vctx)
786static int solver_easy(struct latin_solver *solver, void *vctx) 798static int solver_easy(struct latin_solver *solver, void *vctx)
787{ 799{
788 struct solver_ctx *ctx = (struct solver_ctx *)vctx; 800 struct solver_ctx *ctx = (struct solver_ctx *)vctx;
789 if (ctx->state->adjacent) 801 if (ctx->state->mode == MODE_ADJACENT)
790 return solver_adjacent(solver, vctx); 802 return solver_adjacent(solver, vctx);
791 else 803 else
792 return solver_links(solver, vctx); 804 return solver_links(solver, vctx);
@@ -795,7 +807,7 @@ static int solver_easy(struct latin_solver *solver, void *vctx)
795static int solver_set(struct latin_solver *solver, void *vctx) 807static int solver_set(struct latin_solver *solver, void *vctx)
796{ 808{
797 struct solver_ctx *ctx = (struct solver_ctx *)vctx; 809 struct solver_ctx *ctx = (struct solver_ctx *)vctx;
798 if (ctx->state->adjacent) 810 if (ctx->state->mode == MODE_ADJACENT)
799 return solver_adjacent_set(solver, vctx); 811 return solver_adjacent_set(solver, vctx);
800 else 812 else
801 return 0; 813 return 0;
@@ -866,8 +878,8 @@ static char *latin_desc(digit *sq, size_t order)
866 return soln; 878 return soln;
867} 879}
868 880
869/* returns non-zero if it placed (or could have placed) clue. */ 881/* returns true if it placed (or could have placed) clue. */
870static int gg_place_clue(game_state *state, int ccode, digit *latin, int checkonly) 882static bool gg_place_clue(game_state *state, int ccode, digit *latin, bool checkonly)
871{ 883{
872 int loc = ccode / 5, which = ccode % 5; 884 int loc = ccode / 5, which = ccode % 5;
873 int x = loc % state->order, y = loc / state->order; 885 int x = loc % state->order, y = loc / state->order;
@@ -883,7 +895,7 @@ static int gg_place_clue(game_state *state, int ccode, digit *latin, int checkon
883 } 895 }
884#endif 896#endif
885 assert(state->nums[loc] == latin[loc]); 897 assert(state->nums[loc] == latin[loc]);
886 return 0; 898 return false;
887 } 899 }
888 if (!checkonly) { 900 if (!checkonly) {
889 state->nums[loc] = latin[loc]; 901 state->nums[loc] = latin[loc];
@@ -891,31 +903,31 @@ static int gg_place_clue(game_state *state, int ccode, digit *latin, int checkon
891 } else { /* add flag */ 903 } else { /* add flag */
892 int lx, ly, lloc; 904 int lx, ly, lloc;
893 905
894 if (state->adjacent) 906 if (state->mode == MODE_ADJACENT)
895 return 0; /* never add flag clues in adjacent mode (they're always 907 return false; /* never add flag clues in adjacent mode
896 all present) */ 908 (they're always all present) */
897 909
898 if (state->flags[loc] & adjthan[which].f) 910 if (state->flags[loc] & adjthan[which].f)
899 return 0; /* already has flag. */ 911 return false; /* already has flag. */
900 912
901 lx = x + adjthan[which].dx; 913 lx = x + adjthan[which].dx;
902 ly = y + adjthan[which].dy; 914 ly = y + adjthan[which].dy;
903 if (lx < 0 || ly < 0 || lx >= state->order || ly >= state->order) 915 if (lx < 0 || ly < 0 || lx >= state->order || ly >= state->order)
904 return 0; /* flag compares to off grid */ 916 return false; /* flag compares to off grid */
905 917
906 lloc = loc + adjthan[which].dx + adjthan[which].dy*state->order; 918 lloc = loc + adjthan[which].dx + adjthan[which].dy*state->order;
907 if (latin[loc] <= latin[lloc]) 919 if (latin[loc] <= latin[lloc])
908 return 0; /* flag would be incorrect */ 920 return false; /* flag would be incorrect */
909 921
910 if (!checkonly) { 922 if (!checkonly) {
911 state->flags[loc] |= adjthan[which].f; 923 state->flags[loc] |= adjthan[which].f;
912 } 924 }
913 } 925 }
914 return 1; 926 return true;
915} 927}
916 928
917/* returns non-zero if it removed (or could have removed) the clue. */ 929/* returns true if it removed (or could have removed) the clue. */
918static int gg_remove_clue(game_state *state, int ccode, int checkonly) 930static bool gg_remove_clue(game_state *state, int ccode, bool checkonly)
919{ 931{
920 int loc = ccode / 5, which = ccode % 5; 932 int loc = ccode / 5, which = ccode % 5;
921#ifdef STANDALONE_SOLVER 933#ifdef STANDALONE_SOLVER
@@ -925,7 +937,7 @@ static int gg_remove_clue(game_state *state, int ccode, int checkonly)
925 assert(loc < state->order*state->order); 937 assert(loc < state->order*state->order);
926 938
927 if (which == 4) { /* remove number. */ 939 if (which == 4) { /* remove number. */
928 if (state->nums[loc] == 0) return 0; 940 if (state->nums[loc] == 0) return false;
929 if (!checkonly) { 941 if (!checkonly) {
930#ifdef STANDALONE_SOLVER 942#ifdef STANDALONE_SOLVER
931 if (solver_show_working) 943 if (solver_show_working)
@@ -935,10 +947,10 @@ static int gg_remove_clue(game_state *state, int ccode, int checkonly)
935 state->nums[loc] = 0; 947 state->nums[loc] = 0;
936 } 948 }
937 } else { /* remove flag */ 949 } else { /* remove flag */
938 if (state->adjacent) 950 if (state->mode == MODE_ADJACENT)
939 return 0; /* never remove clues in adjacent mode. */ 951 return false; /* never remove clues in adjacent mode. */
940 952
941 if (!(state->flags[loc] & adjthan[which].f)) return 0; 953 if (!(state->flags[loc] & adjthan[which].f)) return false;
942 if (!checkonly) { 954 if (!checkonly) {
943#ifdef STANDALONE_SOLVER 955#ifdef STANDALONE_SOLVER
944 if (solver_show_working) 956 if (solver_show_working)
@@ -948,7 +960,7 @@ static int gg_remove_clue(game_state *state, int ccode, int checkonly)
948 state->flags[loc] &= ~adjthan[which].f; 960 state->flags[loc] &= ~adjthan[which].f;
949 } 961 }
950 } 962 }
951 return 1; 963 return true;
952} 964}
953 965
954static int gg_best_clue(game_state *state, int *scratch, digit *latin) 966static int gg_best_clue(game_state *state, int *scratch, digit *latin)
@@ -965,7 +977,7 @@ static int gg_best_clue(game_state *state, int *scratch, digit *latin)
965#endif 977#endif
966 978
967 for (i = ls; i-- > 0 ;) { 979 for (i = ls; i-- > 0 ;) {
968 if (!gg_place_clue(state, scratch[i], latin, 1)) continue; 980 if (!gg_place_clue(state, scratch[i], latin, true)) continue;
969 981
970 loc = scratch[i] / 5; 982 loc = scratch[i] / 5;
971 for (j = nposs = 0; j < state->order; j++) { 983 for (j = nposs = 0; j < state->order; j++) {
@@ -997,7 +1009,7 @@ int maxtries;
997#else 1009#else
998#define MAXTRIES 50 1010#define MAXTRIES 50
999#endif 1011#endif
1000int gg_solved; 1012static int gg_solved;
1001 1013
1002static int game_assemble(game_state *new, int *scratch, digit *latin, 1014static int game_assemble(game_state *new, int *scratch, digit *latin,
1003 int difficulty) 1015 int difficulty)
@@ -1026,8 +1038,8 @@ static int game_assemble(game_state *new, int *scratch, digit *latin,
1026 if (solver_state(copy, difficulty) == 1) break; 1038 if (solver_state(copy, difficulty) == 1) break;
1027 1039
1028 best = gg_best_clue(copy, scratch, latin); 1040 best = gg_best_clue(copy, scratch, latin);
1029 gg_place_clue(new, scratch[best], latin, 0); 1041 gg_place_clue(new, scratch[best], latin, false);
1030 gg_place_clue(copy, scratch[best], latin, 0); 1042 gg_place_clue(copy, scratch[best], latin, false);
1031 } 1043 }
1032 free_game(copy); 1044 free_game(copy);
1033#ifdef STANDALONE_SOLVER 1045#ifdef STANDALONE_SOLVER
@@ -1044,20 +1056,20 @@ static void game_strip(game_state *new, int *scratch, digit *latin,
1044 int difficulty) 1056 int difficulty)
1045{ 1057{
1046 int o = new->order, o2 = o*o, lscratch = o2*5, i; 1058 int o = new->order, o2 = o*o, lscratch = o2*5, i;
1047 game_state *copy = blank_game(new->order, new->adjacent); 1059 game_state *copy = blank_game(new->order, new->mode);
1048 1060
1049 /* For each symbol (if it exists in new), try and remove it and 1061 /* For each symbol (if it exists in new), try and remove it and
1050 * solve again; if we couldn't solve without it put it back. */ 1062 * solve again; if we couldn't solve without it put it back. */
1051 for (i = 0; i < lscratch; i++) { 1063 for (i = 0; i < lscratch; i++) {
1052 if (!gg_remove_clue(new, scratch[i], 0)) continue; 1064 if (!gg_remove_clue(new, scratch[i], false)) continue;
1053 1065
1054 memcpy(copy->nums, new->nums, o2 * sizeof(digit)); 1066 memcpy(copy->nums, new->nums, o2 * sizeof(digit));
1055 memcpy(copy->flags, new->flags, o2 * sizeof(unsigned int)); 1067 memcpy(copy->flags, new->flags, o2 * sizeof(unsigned int));
1056 gg_solved++; 1068 gg_solved++;
1057 if (solver_state(copy, difficulty) != 1) { 1069 if (solver_state(copy, difficulty) != 1) {
1058 /* put clue back, we can't solve without it. */ 1070 /* put clue back, we can't solve without it. */
1059 int ret = gg_place_clue(new, scratch[i], latin, 0); 1071 bool ret = gg_place_clue(new, scratch[i], latin, false);
1060 assert(ret == 1); 1072 assert(ret);
1061 } else { 1073 } else {
1062#ifdef STANDALONE_SOLVER 1074#ifdef STANDALONE_SOLVER
1063 if (solver_show_working) 1075 if (solver_show_working)
@@ -1099,7 +1111,7 @@ static void add_adjacent_flags(game_state *state, digit *latin)
1099} 1111}
1100 1112
1101static char *new_game_desc(const game_params *params_in, random_state *rs, 1113static char *new_game_desc(const game_params *params_in, random_state *rs,
1102 char **aux, int interactive) 1114 char **aux, bool interactive)
1103{ 1115{
1104 game_params params_copy = *params_in; /* structure copy */ 1116 game_params params_copy = *params_in; /* structure copy */
1105 game_params *params = &params_copy; 1117 game_params *params = &params_copy;
@@ -1108,7 +1120,7 @@ static char *new_game_desc(const game_params *params_in, random_state *rs,
1108 int o2 = params->order * params->order, ntries = 1; 1120 int o2 = params->order * params->order, ntries = 1;
1109 int *scratch, lscratch = o2*5; 1121 int *scratch, lscratch = o2*5;
1110 char *ret, buf[80]; 1122 char *ret, buf[80];
1111 game_state *state = blank_game(params->order, params->adjacent); 1123 game_state *state = blank_game(params->order, params->mode);
1112 1124
1113 /* Generate a list of 'things to strip' (randomised later) */ 1125 /* Generate a list of 'things to strip' (randomised later) */
1114 scratch = snewn(lscratch, int); 1126 scratch = snewn(lscratch, int);
@@ -1131,7 +1143,7 @@ generate:
1131 memset(state->nums, 0, o2 * sizeof(digit)); 1143 memset(state->nums, 0, o2 * sizeof(digit));
1132 memset(state->flags, 0, o2 * sizeof(unsigned int)); 1144 memset(state->flags, 0, o2 * sizeof(unsigned int));
1133 1145
1134 if (state->adjacent) { 1146 if (state->mode == MODE_ADJACENT) {
1135 /* All adjacency flags are always present. */ 1147 /* All adjacency flags are always present. */
1136 add_adjacent_flags(state, sq); 1148 add_adjacent_flags(state, sq);
1137 } 1149 }
@@ -1197,7 +1209,7 @@ generate:
1197static game_state *load_game(const game_params *params, const char *desc, 1209static game_state *load_game(const game_params *params, const char *desc,
1198 const char **why_r) 1210 const char **why_r)
1199{ 1211{
1200 game_state *state = blank_game(params->order, params->adjacent); 1212 game_state *state = blank_game(params->order, params->mode);
1201 const char *p = desc; 1213 const char *p = desc;
1202 int i = 0, n, o = params->order, x, y; 1214 int i = 0, n, o = params->order, x, y;
1203 const char *why = NULL; 1215 const char *why = NULL;
@@ -1254,7 +1266,7 @@ static game_state *load_game(const game_params *params, const char *desc,
1254 if (nx < 0 || ny < 0 || nx >= o || ny >= o) { 1266 if (nx < 0 || ny < 0 || nx >= o || ny >= o) {
1255 why = "Flags go off grid"; goto fail; 1267 why = "Flags go off grid"; goto fail;
1256 } 1268 }
1257 if (params->adjacent) { 1269 if (params->mode == MODE_ADJACENT) {
1258 /* if one cell is adjacent to another, the other must 1270 /* if one cell is adjacent to another, the other must
1259 * also be adjacent to the first. */ 1271 * also be adjacent to the first. */
1260 if (!(GRID(state, flags, nx, ny) & adjthan[n].fo)) { 1272 if (!(GRID(state, flags, nx, ny) & adjthan[n].fo)) {
@@ -1348,7 +1360,7 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1348 1360
1349struct game_ui { 1361struct game_ui {
1350 int hx, hy; /* as for solo.c, highlight pos */ 1362 int hx, hy; /* as for solo.c, highlight pos */
1351 int hshow, hpencil, hcursor; /* show state, type, and ?cursor. */ 1363 bool hshow, hpencil, hcursor; /* show state, type, and ?cursor. */
1352}; 1364};
1353 1365
1354static game_ui *new_ui(const game_state *state) 1366static game_ui *new_ui(const game_state *state)
@@ -1356,7 +1368,9 @@ static game_ui *new_ui(const game_state *state)
1356 game_ui *ui = snew(game_ui); 1368 game_ui *ui = snew(game_ui);
1357 1369
1358 ui->hx = ui->hy = 0; 1370 ui->hx = ui->hy = 0;
1359 ui->hpencil = ui->hshow = ui->hcursor = 0; 1371 ui->hpencil = false;
1372 ui->hshow = false;
1373 ui->hcursor = false;
1360 1374
1361 return ui; 1375 return ui;
1362} 1376}
@@ -1383,18 +1397,21 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1383 * pencil mode. */ 1397 * pencil mode. */
1384 if (ui->hshow && ui->hpencil && !ui->hcursor && 1398 if (ui->hshow && ui->hpencil && !ui->hcursor &&
1385 GRID(newstate, nums, ui->hx, ui->hy) != 0) { 1399 GRID(newstate, nums, ui->hx, ui->hy) != 0) {
1386 ui->hshow = 0; 1400 ui->hshow = false;
1387 } 1401 }
1388} 1402}
1389 1403
1390struct game_drawstate { 1404struct game_drawstate {
1391 int tilesize, order, started, adjacent; 1405 int tilesize, order;
1406 bool started;
1407 Mode mode;
1392 digit *nums; /* copy of nums, o^2 */ 1408 digit *nums; /* copy of nums, o^2 */
1393 unsigned char *hints; /* copy of hints, o^3 */ 1409 unsigned char *hints; /* copy of hints, o^3 */
1394 unsigned int *flags; /* o^2 */ 1410 unsigned int *flags; /* o^2 */
1395 1411
1396 int hx, hy, hshow, hpencil; /* as for game_ui. */ 1412 int hx, hy;
1397 int hflash; 1413 bool hshow, hpencil; /* as for game_ui. */
1414 bool hflash;
1398}; 1415};
1399 1416
1400static char *interpret_move(const game_state *state, game_ui *ui, 1417static char *interpret_move(const game_state *state, game_ui *ui,
@@ -1403,7 +1420,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1403{ 1420{
1404 int x = FROMCOORD(ox), y = FROMCOORD(oy), n; 1421 int x = FROMCOORD(ox), y = FROMCOORD(oy), n;
1405 char buf[80]; 1422 char buf[80];
1406 int shift_or_control = button & (MOD_SHFT | MOD_CTRL); 1423 bool shift_or_control = button & (MOD_SHFT | MOD_CTRL);
1407 1424
1408 button &= ~MOD_MASK; 1425 button &= ~MOD_MASK;
1409 1426
@@ -1432,38 +1449,40 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1432 if (button == LEFT_BUTTON) { 1449 if (button == LEFT_BUTTON) {
1433 /* normal highlighting for non-immutable squares */ 1450 /* normal highlighting for non-immutable squares */
1434 if (GRID(state, flags, x, y) & F_IMMUTABLE) 1451 if (GRID(state, flags, x, y) & F_IMMUTABLE)
1435 ui->hshow = 0; 1452 ui->hshow = false;
1436 else if (x == ui->hx && y == ui->hy && 1453 else if (x == ui->hx && y == ui->hy &&
1437 ui->hshow && ui->hpencil == 0) 1454 ui->hshow && !ui->hpencil)
1438 ui->hshow = 0; 1455 ui->hshow = false;
1439 else { 1456 else {
1440 ui->hx = x; ui->hy = y; ui->hpencil = 0; 1457 ui->hx = x; ui->hy = y; ui->hpencil = false;
1441 ui->hshow = 1; 1458 ui->hshow = true;
1442 } 1459 }
1443 ui->hcursor = 0; 1460 ui->hcursor = false;
1444 return UI_UPDATE; 1461 return UI_UPDATE;
1445 } 1462 }
1446 if (button == RIGHT_BUTTON) { 1463 if (button == RIGHT_BUTTON) {
1447 /* pencil highlighting for non-filled squares */ 1464 /* pencil highlighting for non-filled squares */
1448 if (GRID(state, nums, x, y) != 0) 1465 if (GRID(state, nums, x, y) != 0)
1449 ui->hshow = 0; 1466 ui->hshow = false;
1450 else if (x == ui->hx && y == ui->hy && 1467 else if (x == ui->hx && y == ui->hy &&
1451 ui->hshow && ui->hpencil) 1468 ui->hshow && ui->hpencil)
1452 ui->hshow = 0; 1469 ui->hshow = false;
1453 else { 1470 else {
1454 ui->hx = x; ui->hy = y; ui->hpencil = 1; 1471 ui->hx = x; ui->hy = y; ui->hpencil = true;
1455 ui->hshow = 1; 1472 ui->hshow = true;
1456 } 1473 }
1457 ui->hcursor = 0; 1474 ui->hcursor = false;
1458 return UI_UPDATE; 1475 return UI_UPDATE;
1459 } 1476 }
1460 } 1477 }
1461 1478
1462 if (IS_CURSOR_MOVE(button)) { 1479 if (IS_CURSOR_MOVE(button)) {
1463 if (shift_or_control) { 1480 if (shift_or_control) {
1464 int nx = ui->hx, ny = ui->hy, i, self; 1481 int nx = ui->hx, ny = ui->hy, i;
1465 move_cursor(button, &nx, &ny, ds->order, ds->order, FALSE); 1482 bool self;
1466 ui->hshow = ui->hcursor = 1; 1483 move_cursor(button, &nx, &ny, ds->order, ds->order, false);
1484 ui->hshow = true;
1485 ui->hcursor = true;
1467 1486
1468 for (i = 0; i < 4 && (nx != ui->hx + adjthan[i].dx || 1487 for (i = 0; i < 4 && (nx != ui->hx + adjthan[i].dx ||
1469 ny != ui->hy + adjthan[i].dy); ++i); 1488 ny != ui->hy + adjthan[i].dy); ++i);
@@ -1476,7 +1495,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1476 GRID(state, flags, nx, ny ) & adjthan[i].fo)) 1495 GRID(state, flags, nx, ny ) & adjthan[i].fo))
1477 return UI_UPDATE; /* no clue to toggle */ 1496 return UI_UPDATE; /* no clue to toggle */
1478 1497
1479 if (state->adjacent) 1498 if (state->mode == MODE_ADJACENT)
1480 self = (adjthan[i].dx >= 0 && adjthan[i].dy >= 0); 1499 self = (adjthan[i].dx >= 0 && adjthan[i].dy >= 0);
1481 else 1500 else
1482 self = (GRID(state, flags, ui->hx, ui->hy) & adjthan[i].f); 1501 self = (GRID(state, flags, ui->hx, ui->hy) & adjthan[i].f);
@@ -1490,14 +1509,15 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1490 1509
1491 return dupstr(buf); 1510 return dupstr(buf);
1492 } else { 1511 } else {
1493 move_cursor(button, &ui->hx, &ui->hy, ds->order, ds->order, FALSE); 1512 move_cursor(button, &ui->hx, &ui->hy, ds->order, ds->order, false);
1494 ui->hshow = ui->hcursor = 1; 1513 ui->hshow = true;
1514 ui->hcursor = true;
1495 return UI_UPDATE; 1515 return UI_UPDATE;
1496 } 1516 }
1497 } 1517 }
1498 if (ui->hshow && IS_CURSOR_SELECT(button)) { 1518 if (ui->hshow && IS_CURSOR_SELECT(button)) {
1499 ui->hpencil = 1 - ui->hpencil; 1519 ui->hpencil = !ui->hpencil;
1500 ui->hcursor = 1; 1520 ui->hcursor = true;
1501 return UI_UPDATE; 1521 return UI_UPDATE;
1502 } 1522 }
1503 1523
@@ -1519,7 +1539,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1519 sprintf(buf, "%c%d,%d,%d", 1539 sprintf(buf, "%c%d,%d,%d",
1520 (char)(ui->hpencil && n > 0 ? 'P' : 'R'), ui->hx, ui->hy, n); 1540 (char)(ui->hpencil && n > 0 ? 'P' : 'R'), ui->hx, ui->hy, n);
1521 1541
1522 if (!ui->hcursor) ui->hshow = 0; 1542 if (!ui->hcursor) ui->hshow = false;
1523 1543
1524 return dupstr(buf); 1544 return dupstr(buf);
1525 } 1545 }
@@ -1552,15 +1572,15 @@ static game_state *execute_move(const game_state *state, const char *move)
1552 HINT(ret, x, y, i) = 0; 1572 HINT(ret, x, y, i) = 0;
1553 1573
1554 /* real change to grid; check for completion */ 1574 /* real change to grid; check for completion */
1555 if (!ret->completed && check_complete(ret->nums, ret, 1) > 0) 1575 if (!ret->completed && check_complete(ret->nums, ret, true) > 0)
1556 ret->completed = TRUE; 1576 ret->completed = true;
1557 } 1577 }
1558 return ret; 1578 return ret;
1559 } else if (move[0] == 'S') { 1579 } else if (move[0] == 'S') {
1560 const char *p; 1580 const char *p;
1561 1581
1562 ret = dup_game(state); 1582 ret = dup_game(state);
1563 ret->completed = ret->cheated = TRUE; 1583 ret->completed = ret->cheated = true;
1564 1584
1565 p = move+1; 1585 p = move+1;
1566 for (i = 0; i < state->order*state->order; i++) { 1586 for (i = 0; i < state->order*state->order; i++) {
@@ -1571,7 +1591,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1571 p++; 1591 p++;
1572 } 1592 }
1573 if (*p) goto badmove; 1593 if (*p) goto badmove;
1574 rc = check_complete(ret->nums, ret, 1); 1594 rc = check_complete(ret->nums, ret, true);
1575 assert(rc > 0); 1595 assert(rc > 0);
1576 return ret; 1596 return ret;
1577 } else if (move[0] == 'M') { 1597 } else if (move[0] == 'M') {
@@ -1586,7 +1606,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1586 return ret; 1606 return ret;
1587 } else if (move[0] == 'H') { 1607 } else if (move[0] == 'H') {
1588 ret = solver_hint(state, NULL, DIFF_EASY, DIFF_EASY); 1608 ret = solver_hint(state, NULL, DIFF_EASY, DIFF_EASY);
1589 check_complete(ret->nums, ret, 1); 1609 check_complete(ret->nums, ret, true);
1590 return ret; 1610 return ret;
1591 } else if (move[0] == 'F' && sscanf(move+1, "%d,%d,%d", &x, &y, &n) == 3 && 1611 } else if (move[0] == 'F' && sscanf(move+1, "%d,%d,%d", &x, &y, &n) == 3 &&
1592 x >= 0 && x < state->order && y >= 0 && y < state->order) { 1612 x >= 0 && x < state->order && y >= 0 && y < state->order) {
@@ -1659,7 +1679,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1659 1679
1660 ds->tilesize = 0; 1680 ds->tilesize = 0;
1661 ds->order = state->order; 1681 ds->order = state->order;
1662 ds->adjacent = state->adjacent; 1682 ds->mode = state->mode;
1663 1683
1664 ds->nums = snewn(o2, digit); 1684 ds->nums = snewn(o2, digit);
1665 ds->hints = snewn(o3, unsigned char); 1685 ds->hints = snewn(o3, unsigned char);
@@ -1669,7 +1689,10 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1669 memset(ds->flags, 0, o2*sizeof(unsigned int)); 1689 memset(ds->flags, 0, o2*sizeof(unsigned int));
1670 1690
1671 ds->hx = ds->hy = 0; 1691 ds->hx = ds->hy = 0;
1672 ds->started = ds->hshow = ds->hpencil = ds->hflash = 0; 1692 ds->started = false;
1693 ds->hshow = false;
1694 ds->hpencil = false;
1695 ds->hflash = false;
1673 1696
1674 return ds; 1697 return ds;
1675} 1698}
@@ -1771,9 +1794,10 @@ static void draw_adjs(drawing *dr, game_drawstate *ds, int ox, int oy,
1771 1794
1772static void draw_furniture(drawing *dr, game_drawstate *ds, 1795static void draw_furniture(drawing *dr, game_drawstate *ds,
1773 const game_state *state, const game_ui *ui, 1796 const game_state *state, const game_ui *ui,
1774 int x, int y, int hflash) 1797 int x, int y, bool hflash)
1775{ 1798{
1776 int ox = COORD(x), oy = COORD(y), bg, hon; 1799 int ox = COORD(x), oy = COORD(y), bg;
1800 bool hon;
1777 unsigned int f = GRID(state, flags, x, y); 1801 unsigned int f = GRID(state, flags, x, y);
1778 1802
1779 bg = hflash ? COL_HIGHLIGHT : COL_BACKGROUND; 1803 bg = hflash ? COL_HIGHLIGHT : COL_BACKGROUND;
@@ -1802,7 +1826,7 @@ static void draw_furniture(drawing *dr, game_drawstate *ds,
1802 draw_update(dr, ox, oy, TILE_SIZE, TILE_SIZE); 1826 draw_update(dr, ox, oy, TILE_SIZE, TILE_SIZE);
1803 1827
1804 /* Draw the adjacent clue signs. */ 1828 /* Draw the adjacent clue signs. */
1805 if (ds->adjacent) 1829 if (ds->mode == MODE_ADJACENT)
1806 draw_adjs(dr, ds, ox, oy, f, COL_BACKGROUND, COL_GRID); 1830 draw_adjs(dr, ds, ox, oy, f, COL_BACKGROUND, COL_GRID);
1807 else 1831 else
1808 draw_gts(dr, ds, ox, oy, f, COL_BACKGROUND, COL_TEXT); 1832 draw_gts(dr, ds, ox, oy, f, COL_BACKGROUND, COL_TEXT);
@@ -1866,13 +1890,14 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1866 int dir, const game_ui *ui, 1890 int dir, const game_ui *ui,
1867 float animtime, float flashtime) 1891 float animtime, float flashtime)
1868{ 1892{
1869 int x, y, i, hchanged = 0, stale, hflash = 0; 1893 int x, y, i;
1894 bool hchanged = false, stale, hflash = false;
1870 1895
1871 debug(("highlight old (%d,%d), new (%d,%d)", ds->hx, ds->hy, ui->hx, ui->hy)); 1896 debug(("highlight old (%d,%d), new (%d,%d)", ds->hx, ds->hy, ui->hx, ui->hy));
1872 1897
1873 if (flashtime > 0 && 1898 if (flashtime > 0 &&
1874 (flashtime <= FLASH_TIME/3 || flashtime >= FLASH_TIME*2/3)) 1899 (flashtime <= FLASH_TIME/3 || flashtime >= FLASH_TIME*2/3))
1875 hflash = 1; 1900 hflash = true;
1876 1901
1877 if (!ds->started) { 1902 if (!ds->started) {
1878 draw_rect(dr, 0, 0, DRAW_SIZE, DRAW_SIZE, COL_BACKGROUND); 1903 draw_rect(dr, 0, 0, DRAW_SIZE, DRAW_SIZE, COL_BACKGROUND);
@@ -1880,30 +1905,30 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1880 } 1905 }
1881 if (ds->hx != ui->hx || ds->hy != ui->hy || 1906 if (ds->hx != ui->hx || ds->hy != ui->hy ||
1882 ds->hshow != ui->hshow || ds->hpencil != ui->hpencil) 1907 ds->hshow != ui->hshow || ds->hpencil != ui->hpencil)
1883 hchanged = 1; 1908 hchanged = true;
1884 1909
1885 for (x = 0; x < ds->order; x++) { 1910 for (x = 0; x < ds->order; x++) {
1886 for (y = 0; y < ds->order; y++) { 1911 for (y = 0; y < ds->order; y++) {
1887 if (!ds->started) 1912 if (!ds->started)
1888 stale = 1; 1913 stale = true;
1889 else if (hflash != ds->hflash) 1914 else if (hflash != ds->hflash)
1890 stale = 1; 1915 stale = true;
1891 else 1916 else
1892 stale = 0; 1917 stale = false;
1893 1918
1894 if (hchanged) { 1919 if (hchanged) {
1895 if ((x == ui->hx && y == ui->hy) || 1920 if ((x == ui->hx && y == ui->hy) ||
1896 (x == ds->hx && y == ds->hy)) 1921 (x == ds->hx && y == ds->hy))
1897 stale = 1; 1922 stale = true;
1898 } 1923 }
1899 1924
1900 if (GRID(state, nums, x, y) != GRID(ds, nums, x, y)) { 1925 if (GRID(state, nums, x, y) != GRID(ds, nums, x, y)) {
1901 GRID(ds, nums, x, y) = GRID(state, nums, x, y); 1926 GRID(ds, nums, x, y) = GRID(state, nums, x, y);
1902 stale = 1; 1927 stale = true;
1903 } 1928 }
1904 if (GRID(state, flags, x, y) != GRID(ds, flags, x, y)) { 1929 if (GRID(state, flags, x, y) != GRID(ds, flags, x, y)) {
1905 GRID(ds, flags, x, y) = GRID(state, flags, x, y); 1930 GRID(ds, flags, x, y) = GRID(state, flags, x, y);
1906 stale = 1; 1931 stale = true;
1907 } 1932 }
1908 if (GRID(ds, nums, x, y) == 0) { 1933 if (GRID(ds, nums, x, y) == 0) {
1909 /* We're not a number square (therefore we might 1934 /* We're not a number square (therefore we might
@@ -1911,7 +1936,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1911 for (i = 0; i < ds->order; i++) { 1936 for (i = 0; i < ds->order; i++) {
1912 if (HINT(state, x, y, i) != HINT(ds, x, y, i)) { 1937 if (HINT(state, x, y, i) != HINT(ds, x, y, i)) {
1913 HINT(ds, x, y, i) = HINT(state, x, y, i); 1938 HINT(ds, x, y, i) = HINT(state, x, y, i);
1914 stale = 1; 1939 stale = true;
1915 } 1940 }
1916 } 1941 }
1917 } 1942 }
@@ -1928,7 +1953,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1928 ds->hshow = ui->hshow; 1953 ds->hshow = ui->hshow;
1929 ds->hpencil = ui->hpencil; 1954 ds->hpencil = ui->hpencil;
1930 1955
1931 ds->started = 1; 1956 ds->started = true;
1932 ds->hflash = hflash; 1957 ds->hflash = hflash;
1933} 1958}
1934 1959
@@ -1952,9 +1977,9 @@ static int game_status(const game_state *state)
1952 return state->completed ? +1 : 0; 1977 return state->completed ? +1 : 0;
1953} 1978}
1954 1979
1955static int game_timing_state(const game_state *state, game_ui *ui) 1980static bool game_timing_state(const game_state *state, game_ui *ui)
1956{ 1981{
1957 return TRUE; 1982 return true;
1958} 1983}
1959 1984
1960static void game_print_size(const game_params *params, float *x, float *y) 1985static void game_print_size(const game_params *params, float *x, float *y)
@@ -1993,7 +2018,7 @@ static void game_print(drawing *dr, const game_state *state, int tilesize)
1993 FONT_VARIABLE, TILE_SIZE/2, ALIGN_VCENTRE | ALIGN_HCENTRE, 2018 FONT_VARIABLE, TILE_SIZE/2, ALIGN_VCENTRE | ALIGN_HCENTRE,
1994 ink, str); 2019 ink, str);
1995 2020
1996 if (state->adjacent) 2021 if (state->mode == MODE_ADJACENT)
1997 draw_adjs(dr, ds, ox, oy, GRID(state, flags, x, y), -1, ink); 2022 draw_adjs(dr, ds, ox, oy, GRID(state, flags, x, y), -1, ink);
1998 else 2023 else
1999 draw_gts(dr, ds, ox, oy, GRID(state, flags, x, y), -1, ink); 2024 draw_gts(dr, ds, ox, oy, GRID(state, flags, x, y), -1, ink);
@@ -2017,15 +2042,15 @@ const struct game thegame = {
2017 encode_params, 2042 encode_params,
2018 free_params, 2043 free_params,
2019 dup_params, 2044 dup_params,
2020 TRUE, game_configure, custom_params, 2045 true, game_configure, custom_params,
2021 validate_params, 2046 validate_params,
2022 new_game_desc, 2047 new_game_desc,
2023 validate_desc, 2048 validate_desc,
2024 new_game, 2049 new_game,
2025 dup_game, 2050 dup_game,
2026 free_game, 2051 free_game,
2027 TRUE, solve_game, 2052 true, solve_game,
2028 TRUE, game_can_format_as_text_now, game_text_format, 2053 true, game_can_format_as_text_now, game_text_format,
2029 new_ui, 2054 new_ui,
2030 free_ui, 2055 free_ui,
2031 encode_ui, 2056 encode_ui,
@@ -2042,9 +2067,9 @@ const struct game thegame = {
2042 game_anim_length, 2067 game_anim_length,
2043 game_flash_length, 2068 game_flash_length,
2044 game_status, 2069 game_status,
2045 TRUE, FALSE, game_print_size, game_print, 2070 true, false, game_print_size, game_print,
2046 FALSE, /* wants_statusbar */ 2071 false, /* wants_statusbar */
2047 FALSE, game_timing_state, 2072 false, game_timing_state,
2048 REQUIRE_RBUTTON | REQUIRE_NUMPAD, /* flags */ 2073 REQUIRE_RBUTTON | REQUIRE_NUMPAD, /* flags */
2049}; 2074};
2050 2075
@@ -2145,7 +2170,7 @@ static int solve(game_params *p, char *desc, int debug)
2145 2170
2146static void check(game_params *p) 2171static void check(game_params *p)
2147{ 2172{
2148 const char *msg = validate_params(p, 1); 2173 const char *msg = validate_params(p, true);
2149 if (msg) { 2174 if (msg) {
2150 fprintf(stderr, "%s: %s", quis, msg); 2175 fprintf(stderr, "%s: %s", quis, msg);
2151 exit(1); 2176 exit(1);
@@ -2160,7 +2185,7 @@ static int gen(game_params *p, random_state *rs, int debug)
2160 check(p); 2185 check(p);
2161 2186
2162 solver_show_working = debug; 2187 solver_show_working = debug;
2163 desc = new_game_desc(p, rs, &aux, 0); 2188 desc = new_game_desc(p, rs, &aux, false);
2164 diff = solve(p, desc, debug); 2189 diff = solve(p, desc, debug);
2165 sfree(aux); 2190 sfree(aux);
2166 sfree(desc); 2191 sfree(desc);
@@ -2183,12 +2208,12 @@ static void soak(game_params *p, random_state *rs)
2183 tt_start = tt_now = time(NULL); 2208 tt_start = tt_now = time(NULL);
2184 2209
2185 printf("Soak-generating an %s %dx%d grid, difficulty %s.\n", 2210 printf("Soak-generating an %s %dx%d grid, difficulty %s.\n",
2186 p->adjacent ? "adjacent" : "unequal", 2211 p->mode == MODE_ADJACENT ? "adjacent" : "unequal",
2187 p->order, p->order, unequal_diffnames[p->diff]); 2212 p->order, p->order, unequal_diffnames[p->diff]);
2188 2213
2189 while (1) { 2214 while (1) {
2190 p->diff = realdiff; 2215 p->diff = realdiff;
2191 desc = new_game_desc(p, rs, &aux, 0); 2216 desc = new_game_desc(p, rs, &aux, false);
2192 st = new_game(NULL, p, desc); 2217 st = new_game(NULL, p, desc);
2193 solver_state(st, DIFF_RECURSIVE); 2218 solver_state(st, DIFF_RECURSIVE);
2194 free_game(st); 2219 free_game(st);
diff --git a/apps/plugins/puzzles/src/unfinished/group.c b/apps/plugins/puzzles/src/unfinished/group.c
index 72293dd4ea..ef7ffba349 100644
--- a/apps/plugins/puzzles/src/unfinished/group.c
+++ b/apps/plugins/puzzles/src/unfinished/group.c
@@ -78,15 +78,21 @@ enum {
78#define TOCHAR(c,id) (E_FROM_FRONT(c,id) + ('a'-1)) 78#define TOCHAR(c,id) (E_FROM_FRONT(c,id) + ('a'-1))
79 79
80struct game_params { 80struct game_params {
81 int w, diff, id; 81 int w, diff;
82 bool id;
82}; 83};
83 84
85typedef struct group_common {
86 int refcount;
87 bool *immutable;
88} group_common;
89
84struct game_state { 90struct game_state {
85 game_params par; 91 game_params par;
86 digit *grid; 92 digit *grid;
87 unsigned char *immutable;
88 int *pencil; /* bitmaps using bits 1<<1..1<<n */ 93 int *pencil; /* bitmaps using bits 1<<1..1<<n */
89 int completed, cheated; 94 group_common *common;
95 bool completed, cheated;
90 digit *sequence; /* sequence of group elements shown */ 96 digit *sequence; /* sequence of group elements shown */
91 97
92 /* 98 /*
@@ -112,28 +118,28 @@ static game_params *default_params(void)
112 118
113 ret->w = 6; 119 ret->w = 6;
114 ret->diff = DIFF_NORMAL; 120 ret->diff = DIFF_NORMAL;
115 ret->id = TRUE; 121 ret->id = true;
116 122
117 return ret; 123 return ret;
118} 124}
119 125
120const static struct game_params group_presets[] = { 126const static struct game_params group_presets[] = {
121 { 6, DIFF_NORMAL, TRUE }, 127 { 6, DIFF_NORMAL, true },
122 { 6, DIFF_NORMAL, FALSE }, 128 { 6, DIFF_NORMAL, false },
123 { 8, DIFF_NORMAL, TRUE }, 129 { 8, DIFF_NORMAL, true },
124 { 8, DIFF_NORMAL, FALSE }, 130 { 8, DIFF_NORMAL, false },
125 { 8, DIFF_HARD, TRUE }, 131 { 8, DIFF_HARD, true },
126 { 8, DIFF_HARD, FALSE }, 132 { 8, DIFF_HARD, false },
127 { 12, DIFF_NORMAL, TRUE }, 133 { 12, DIFF_NORMAL, true },
128}; 134};
129 135
130static int game_fetch_preset(int i, char **name, game_params **params) 136static bool game_fetch_preset(int i, char **name, game_params **params)
131{ 137{
132 game_params *ret; 138 game_params *ret;
133 char buf[80]; 139 char buf[80];
134 140
135 if (i < 0 || i >= lenof(group_presets)) 141 if (i < 0 || i >= lenof(group_presets))
136 return FALSE; 142 return false;
137 143
138 ret = snew(game_params); 144 ret = snew(game_params);
139 *ret = group_presets[i]; /* structure copy */ 145 *ret = group_presets[i]; /* structure copy */
@@ -143,7 +149,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
143 149
144 *name = dupstr(buf); 150 *name = dupstr(buf);
145 *params = ret; 151 *params = ret;
146 return TRUE; 152 return true;
147} 153}
148 154
149static void free_params(game_params *params) 155static void free_params(game_params *params)
@@ -165,7 +171,7 @@ static void decode_params(game_params *params, char const *string)
165 params->w = atoi(p); 171 params->w = atoi(p);
166 while (*p && isdigit((unsigned char)*p)) p++; 172 while (*p && isdigit((unsigned char)*p)) p++;
167 params->diff = DIFF_NORMAL; 173 params->diff = DIFF_NORMAL;
168 params->id = TRUE; 174 params->id = true;
169 175
170 while (*p) { 176 while (*p) {
171 if (*p == 'd') { 177 if (*p == 'd') {
@@ -180,7 +186,7 @@ static void decode_params(game_params *params, char const *string)
180 p++; 186 p++;
181 } 187 }
182 } else if (*p == 'i') { 188 } else if (*p == 'i') {
183 params->id = FALSE; 189 params->id = false;
184 p++; 190 p++;
185 } else { 191 } else {
186 /* unrecognised character */ 192 /* unrecognised character */
@@ -189,7 +195,7 @@ static void decode_params(game_params *params, char const *string)
189 } 195 }
190} 196}
191 197
192static char *encode_params(const game_params *params, int full) 198static char *encode_params(const game_params *params, bool full)
193{ 199{
194 char ret[80]; 200 char ret[80];
195 201
@@ -240,7 +246,7 @@ static game_params *custom_params(const config_item *cfg)
240 return ret; 246 return ret;
241} 247}
242 248
243static const char *validate_params(const game_params *params, int full) 249static const char *validate_params(const game_params *params, bool full)
244{ 250{
245 if (params->w < 3 || params->w > 26) 251 if (params->w < 3 || params->w > 26)
246 return "Grid size must be between 3 and 26"; 252 return "Grid size must be between 3 and 26";
@@ -593,7 +599,7 @@ static const struct groups groups[] = {
593/* ----- data generated by group.gap ends ----- */ 599/* ----- data generated by group.gap ends ----- */
594 600
595static char *new_game_desc(const game_params *params, random_state *rs, 601static char *new_game_desc(const game_params *params, random_state *rs,
596 char **aux, int interactive) 602 char **aux, bool interactive)
597{ 603{
598 int w = params->w, a = w*w; 604 int w = params->w, a = w*w;
599 digit *grid, *soln, *soln2; 605 digit *grid, *soln, *soln2;
@@ -849,11 +855,13 @@ static game_state *new_game(midend *me, const game_params *params,
849 855
850 state->par = *params; /* structure copy */ 856 state->par = *params; /* structure copy */
851 state->grid = snewn(a, digit); 857 state->grid = snewn(a, digit);
852 state->immutable = snewn(a, unsigned char); 858 state->common = snew(group_common);
859 state->common->refcount = 1;
860 state->common->immutable = snewn(a, bool);
853 state->pencil = snewn(a, int); 861 state->pencil = snewn(a, int);
854 for (i = 0; i < a; i++) { 862 for (i = 0; i < a; i++) {
855 state->grid[i] = 0; 863 state->grid[i] = 0;
856 state->immutable[i] = 0; 864 state->common->immutable[i] = false;
857 state->pencil[i] = 0; 865 state->pencil[i] = 0;
858 } 866 }
859 state->sequence = snewn(w, digit); 867 state->sequence = snewn(w, digit);
@@ -866,9 +874,10 @@ static game_state *new_game(midend *me, const game_params *params,
866 desc = spec_to_grid(desc, state->grid, a); 874 desc = spec_to_grid(desc, state->grid, a);
867 for (i = 0; i < a; i++) 875 for (i = 0; i < a; i++)
868 if (state->grid[i] != 0) 876 if (state->grid[i] != 0)
869 state->immutable[i] = TRUE; 877 state->common->immutable[i] = true;
870 878
871 state->completed = state->cheated = FALSE; 879 state->completed = false;
880 state->cheated = false;
872 881
873 return state; 882 return state;
874} 883}
@@ -881,12 +890,12 @@ static game_state *dup_game(const game_state *state)
881 ret->par = state->par; /* structure copy */ 890 ret->par = state->par; /* structure copy */
882 891
883 ret->grid = snewn(a, digit); 892 ret->grid = snewn(a, digit);
884 ret->immutable = snewn(a, unsigned char); 893 ret->common = state->common;
894 ret->common->refcount++;
885 ret->pencil = snewn(a, int); 895 ret->pencil = snewn(a, int);
886 ret->sequence = snewn(w, digit); 896 ret->sequence = snewn(w, digit);
887 ret->dividers = snewn(w, int); 897 ret->dividers = snewn(w, int);
888 memcpy(ret->grid, state->grid, a*sizeof(digit)); 898 memcpy(ret->grid, state->grid, a*sizeof(digit));
889 memcpy(ret->immutable, state->immutable, a*sizeof(unsigned char));
890 memcpy(ret->pencil, state->pencil, a*sizeof(int)); 899 memcpy(ret->pencil, state->pencil, a*sizeof(int));
891 memcpy(ret->sequence, state->sequence, w*sizeof(digit)); 900 memcpy(ret->sequence, state->sequence, w*sizeof(digit));
892 memcpy(ret->dividers, state->dividers, w*sizeof(int)); 901 memcpy(ret->dividers, state->dividers, w*sizeof(int));
@@ -900,7 +909,10 @@ static game_state *dup_game(const game_state *state)
900static void free_game(game_state *state) 909static void free_game(game_state *state)
901{ 910{
902 sfree(state->grid); 911 sfree(state->grid);
903 sfree(state->immutable); 912 if (--state->common->refcount == 0) {
913 sfree(state->common->immutable);
914 sfree(state->common);
915 }
904 sfree(state->pencil); 916 sfree(state->pencil);
905 sfree(state->sequence); 917 sfree(state->sequence);
906 sfree(state); 918 sfree(state);
@@ -940,9 +952,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
940 return out; 952 return out;
941} 953}
942 954
943static int game_can_format_as_text_now(const game_params *params) 955static bool game_can_format_as_text_now(const game_params *params)
944{ 956{
945 return TRUE; 957 return true;
946} 958}
947 959
948static char *game_text_format(const game_state *state) 960static char *game_text_format(const game_state *state)
@@ -1001,7 +1013,7 @@ struct game_ui {
1001 * This indicates whether the current highlight is a 1013 * This indicates whether the current highlight is a
1002 * pencil-mark one or a real one. 1014 * pencil-mark one or a real one.
1003 */ 1015 */
1004 int hpencil; 1016 bool hpencil;
1005 /* 1017 /*
1006 * This indicates whether or not we're showing the highlight 1018 * This indicates whether or not we're showing the highlight
1007 * (used to be hx = hy = -1); important so that when we're 1019 * (used to be hx = hy = -1); important so that when we're
@@ -1009,13 +1021,13 @@ struct game_ui {
1009 * fixed position. When hshow = 1, pressing a valid number 1021 * fixed position. When hshow = 1, pressing a valid number
1010 * or letter key or Space will enter that number or letter in the grid. 1022 * or letter key or Space will enter that number or letter in the grid.
1011 */ 1023 */
1012 int hshow; 1024 bool hshow;
1013 /* 1025 /*
1014 * This indicates whether we're using the highlight as a cursor; 1026 * This indicates whether we're using the highlight as a cursor;
1015 * it means that it doesn't vanish on a keypress, and that it is 1027 * it means that it doesn't vanish on a keypress, and that it is
1016 * allowed on immutable squares. 1028 * allowed on immutable squares.
1017 */ 1029 */
1018 int hcursor; 1030 bool hcursor;
1019 /* 1031 /*
1020 * This indicates whether we're dragging a table header to 1032 * This indicates whether we're dragging a table header to
1021 * reposition an entire row or column. 1033 * reposition an entire row or column.
@@ -1031,7 +1043,9 @@ static game_ui *new_ui(const game_state *state)
1031 game_ui *ui = snew(game_ui); 1043 game_ui *ui = snew(game_ui);
1032 1044
1033 ui->hx = ui->hy = 0; 1045 ui->hx = ui->hy = 0;
1034 ui->hpencil = ui->hshow = ui->hcursor = 0; 1046 ui->hpencil = false;
1047 ui->hshow = false;
1048 ui->hcursor = false;
1035 ui->drag = 0; 1049 ui->drag = 0;
1036 1050
1037 return ui; 1051 return ui;
@@ -1063,7 +1077,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1063 */ 1077 */
1064 if (ui->hshow && ui->hpencil && !ui->hcursor && 1078 if (ui->hshow && ui->hpencil && !ui->hcursor &&
1065 newstate->grid[ui->hy * w + ui->hx] != 0) { 1079 newstate->grid[ui->hy * w + ui->hx] != 0) {
1066 ui->hshow = 0; 1080 ui->hshow = false;
1067 } 1081 }
1068 if (ui->hshow && ui->odn > 1) { 1082 if (ui->hshow && ui->odn > 1) {
1069 /* 1083 /*
@@ -1075,12 +1089,12 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1075 for (i = 0; i < ui->odn; i++) { 1089 for (i = 0; i < ui->odn; i++) {
1076 if (oldstate->sequence[ui->ohx + i*ui->odx] != 1090 if (oldstate->sequence[ui->ohx + i*ui->odx] !=
1077 newstate->sequence[ui->ohx + i*ui->odx]) { 1091 newstate->sequence[ui->ohx + i*ui->odx]) {
1078 ui->hshow = 0; 1092 ui->hshow = false;
1079 break; 1093 break;
1080 } 1094 }
1081 if (oldstate->sequence[ui->ohy + i*ui->ody] != 1095 if (oldstate->sequence[ui->ohy + i*ui->ody] !=
1082 newstate->sequence[ui->ohy + i*ui->ody]) { 1096 newstate->sequence[ui->ohy + i*ui->ody]) {
1083 ui->hshow = 0; 1097 ui->hshow = false;
1084 break; 1098 break;
1085 } 1099 }
1086 } 1100 }
@@ -1132,17 +1146,18 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1132struct game_drawstate { 1146struct game_drawstate {
1133 game_params par; 1147 game_params par;
1134 int w, tilesize; 1148 int w, tilesize;
1135 int started; 1149 bool started;
1136 long *tiles, *legend, *pencil, *errors; 1150 long *tiles, *legend, *pencil, *errors;
1137 long *errtmp; 1151 long *errtmp;
1138 digit *sequence; 1152 digit *sequence;
1139}; 1153};
1140 1154
1141static int check_errors(const game_state *state, long *errors) 1155static bool check_errors(const game_state *state, long *errors)
1142{ 1156{
1143 int w = state->par.w, a = w*w; 1157 int w = state->par.w, a = w*w;
1144 digit *grid = state->grid; 1158 digit *grid = state->grid;
1145 int i, j, k, x, y, errs = FALSE; 1159 int i, j, k, x, y;
1160 bool errs = false;
1146 1161
1147 /* 1162 /*
1148 * To verify that we have a valid group table, it suffices to 1163 * To verify that we have a valid group table, it suffices to
@@ -1185,7 +1200,7 @@ static int check_errors(const game_state *state, long *errors)
1185 } 1200 }
1186 1201
1187 if (mask != (1 << (w+1)) - (1 << 1)) { 1202 if (mask != (1 << (w+1)) - (1 << 1)) {
1188 errs = TRUE; 1203 errs = true;
1189 errmask &= ~1UL; 1204 errmask &= ~1UL;
1190 if (errors) { 1205 if (errors) {
1191 for (x = 0; x < w; x++) 1206 for (x = 0; x < w; x++)
@@ -1204,7 +1219,7 @@ static int check_errors(const game_state *state, long *errors)
1204 } 1219 }
1205 1220
1206 if (mask != (1 << (w+1)) - (1 << 1)) { 1221 if (mask != (1 << (w+1)) - (1 << 1)) {
1207 errs = TRUE; 1222 errs = true;
1208 errmask &= ~1UL; 1223 errmask &= ~1UL;
1209 if (errors) { 1224 if (errors) {
1210 for (y = 0; y < w; y++) 1225 for (y = 0; y < w; y++)
@@ -1240,7 +1255,7 @@ static int check_errors(const game_state *state, long *errors)
1240 errors[right] |= err << EF_RIGHT_SHIFT; 1255 errors[right] |= err << EF_RIGHT_SHIFT;
1241 } 1256 }
1242 } 1257 }
1243 errs = TRUE; 1258 errs = true;
1244 } 1259 }
1245 1260
1246 return errs; 1261 return errs;
@@ -1304,8 +1319,8 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1304 ty = state->sequence[ty]; 1319 ty = state->sequence[ty];
1305 if (button == LEFT_BUTTON) { 1320 if (button == LEFT_BUTTON) {
1306 if (tx == ui->hx && ty == ui->hy && 1321 if (tx == ui->hx && ty == ui->hy &&
1307 ui->hshow && ui->hpencil == 0) { 1322 ui->hshow && !ui->hpencil) {
1308 ui->hshow = 0; 1323 ui->hshow = false;
1309 } else { 1324 } else {
1310 ui->hx = tx; 1325 ui->hx = tx;
1311 ui->hy = ty; 1326 ui->hy = ty;
@@ -1313,10 +1328,10 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1313 ui->ohy = oty; 1328 ui->ohy = oty;
1314 ui->odx = ui->ody = 0; 1329 ui->odx = ui->ody = 0;
1315 ui->odn = 1; 1330 ui->odn = 1;
1316 ui->hshow = !state->immutable[ty*w+tx]; 1331 ui->hshow = !state->common->immutable[ty*w+tx];
1317 ui->hpencil = 0; 1332 ui->hpencil = false;
1318 } 1333 }
1319 ui->hcursor = 0; 1334 ui->hcursor = false;
1320 return UI_UPDATE; 1335 return UI_UPDATE;
1321 } 1336 }
1322 if (button == RIGHT_BUTTON) { 1337 if (button == RIGHT_BUTTON) {
@@ -1326,21 +1341,21 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1326 if (state->grid[ty*w+tx] == 0) { 1341 if (state->grid[ty*w+tx] == 0) {
1327 if (tx == ui->hx && ty == ui->hy && 1342 if (tx == ui->hx && ty == ui->hy &&
1328 ui->hshow && ui->hpencil) { 1343 ui->hshow && ui->hpencil) {
1329 ui->hshow = 0; 1344 ui->hshow = false;
1330 } else { 1345 } else {
1331 ui->hpencil = 1; 1346 ui->hpencil = true;
1332 ui->hx = tx; 1347 ui->hx = tx;
1333 ui->hy = ty; 1348 ui->hy = ty;
1334 ui->ohx = otx; 1349 ui->ohx = otx;
1335 ui->ohy = oty; 1350 ui->ohy = oty;
1336 ui->odx = ui->ody = 0; 1351 ui->odx = ui->ody = 0;
1337 ui->odn = 1; 1352 ui->odn = 1;
1338 ui->hshow = 1; 1353 ui->hshow = true;
1339 } 1354 }
1340 } else { 1355 } else {
1341 ui->hshow = 0; 1356 ui->hshow = false;
1342 } 1357 }
1343 ui->hcursor = 0; 1358 ui->hcursor = false;
1344 return UI_UPDATE; 1359 return UI_UPDATE;
1345 } 1360 }
1346 } else if (tx >= 0 && tx < w && ty == -1) { 1361 } else if (tx >= 0 && tx < w && ty == -1) {
@@ -1373,16 +1388,17 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1373 if (IS_CURSOR_MOVE(button)) { 1388 if (IS_CURSOR_MOVE(button)) {
1374 int cx = find_in_sequence(state->sequence, w, ui->hx); 1389 int cx = find_in_sequence(state->sequence, w, ui->hx);
1375 int cy = find_in_sequence(state->sequence, w, ui->hy); 1390 int cy = find_in_sequence(state->sequence, w, ui->hy);
1376 move_cursor(button, &cx, &cy, w, w, 0); 1391 move_cursor(button, &cx, &cy, w, w, false);
1377 ui->hx = state->sequence[cx]; 1392 ui->hx = state->sequence[cx];
1378 ui->hy = state->sequence[cy]; 1393 ui->hy = state->sequence[cy];
1379 ui->hshow = ui->hcursor = 1; 1394 ui->hshow = true;
1395 ui->hcursor = true;
1380 return UI_UPDATE; 1396 return UI_UPDATE;
1381 } 1397 }
1382 if (ui->hshow && 1398 if (ui->hshow &&
1383 (button == CURSOR_SELECT)) { 1399 (button == CURSOR_SELECT)) {
1384 ui->hpencil = 1 - ui->hpencil; 1400 ui->hpencil = !ui->hpencil;
1385 ui->hcursor = 1; 1401 ui->hcursor = true;
1386 return UI_UPDATE; 1402 return UI_UPDATE;
1387 } 1403 }
1388 1404
@@ -1417,7 +1433,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1417 */ 1433 */
1418 if (!ui->hpencil && state->grid[index] == n) 1434 if (!ui->hpencil && state->grid[index] == n)
1419 /* OK even if it is immutable */; 1435 /* OK even if it is immutable */;
1420 else if (state->immutable[index]) 1436 else if (state->common->immutable[index])
1421 return NULL; 1437 return NULL;
1422 } 1438 }
1423 1439
@@ -1433,7 +1449,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1433 } 1449 }
1434 movebuf = sresize(movebuf, buflen+1, char); 1450 movebuf = sresize(movebuf, buflen+1, char);
1435 1451
1436 if (!ui->hcursor) ui->hshow = 0; 1452 if (!ui->hcursor) ui->hshow = false;
1437 1453
1438 return movebuf; 1454 return movebuf;
1439 } 1455 }
@@ -1452,7 +1468,7 @@ static game_state *execute_move(const game_state *from, const char *move)
1452 1468
1453 if (move[0] == 'S') { 1469 if (move[0] == 'S') {
1454 ret = dup_game(from); 1470 ret = dup_game(from);
1455 ret->completed = ret->cheated = TRUE; 1471 ret->completed = ret->cheated = true;
1456 1472
1457 for (i = 0; i < a; i++) { 1473 for (i = 0; i < a; i++) {
1458 if (!ISCHAR(move[i+1]) || FROMCHAR(move[i+1], from->par.id) > w) { 1474 if (!ISCHAR(move[i+1]) || FROMCHAR(move[i+1], from->par.id) > w) {
@@ -1473,7 +1489,7 @@ static game_state *execute_move(const game_state *from, const char *move)
1473 sscanf(move+1, "%d,%d,%d%n", &x, &y, &n, &pos) == 3 && 1489 sscanf(move+1, "%d,%d,%d%n", &x, &y, &n, &pos) == 3 &&
1474 n >= 0 && n <= w) { 1490 n >= 0 && n <= w) {
1475 const char *mp = move + 1 + pos; 1491 const char *mp = move + 1 + pos;
1476 int pencil = (move[0] == 'P'); 1492 bool pencil = (move[0] == 'P');
1477 ret = dup_game(from); 1493 ret = dup_game(from);
1478 1494
1479 while (1) { 1495 while (1) {
@@ -1481,7 +1497,8 @@ static game_state *execute_move(const game_state *from, const char *move)
1481 free_game(ret); 1497 free_game(ret);
1482 return NULL; 1498 return NULL;
1483 } 1499 }
1484 if (from->immutable[y*w+x] && !(!pencil && from->grid[y*w+x] == n)) 1500 if (from->common->immutable[y*w+x] &&
1501 !(!pencil && from->grid[y*w+x] == n))
1485 return NULL; 1502 return NULL;
1486 1503
1487 if (move[0] == 'P' && n > 0) { 1504 if (move[0] == 'P' && n > 0) {
@@ -1502,7 +1519,7 @@ static game_state *execute_move(const game_state *from, const char *move)
1502 } 1519 }
1503 1520
1504 if (!ret->completed && !check_errors(ret, NULL)) 1521 if (!ret->completed && !check_errors(ret, NULL))
1505 ret->completed = TRUE; 1522 ret->completed = true;
1506 1523
1507 return ret; 1524 return ret;
1508 } else if (move[0] == 'M') { 1525 } else if (move[0] == 'M') {
@@ -1621,7 +1638,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1621 ds->w = w; 1638 ds->w = w;
1622 ds->par = state->par; /* structure copy */ 1639 ds->par = state->par; /* structure copy */
1623 ds->tilesize = 0; 1640 ds->tilesize = 0;
1624 ds->started = FALSE; 1641 ds->started = false;
1625 ds->tiles = snewn(a, long); 1642 ds->tiles = snewn(a, long);
1626 ds->legend = snewn(w, long); 1643 ds->legend = snewn(w, long);
1627 ds->pencil = snewn(a, long); 1644 ds->pencil = snewn(a, long);
@@ -1845,7 +1862,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1845 1862
1846 draw_update(dr, 0, 0, SIZE(w), SIZE(w)); 1863 draw_update(dr, 0, 0, SIZE(w), SIZE(w));
1847 1864
1848 ds->started = TRUE; 1865 ds->started = true;
1849 } 1866 }
1850 1867
1851 check_errors(state, ds->errtmp); 1868 check_errors(state, ds->errtmp);
@@ -1894,7 +1911,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1894 else 1911 else
1895 pencil = (long)state->pencil[sy*w+sx]; 1912 pencil = (long)state->pencil[sy*w+sx];
1896 1913
1897 if (state->immutable[sy*w+sx]) 1914 if (state->common->immutable[sy*w+sx])
1898 tile |= DF_IMMUTABLE; 1915 tile |= DF_IMMUTABLE;
1899 1916
1900 if ((ui->drag == 5 && ui->dragnum == sy) || 1917 if ((ui->drag == 5 && ui->dragnum == sy) ||
@@ -1902,7 +1919,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1902 tile |= DF_HIGHLIGHT; 1919 tile |= DF_HIGHLIGHT;
1903 } else if (ui->hshow) { 1920 } else if (ui->hshow) {
1904 int i = abs(x - ui->ohx); 1921 int i = abs(x - ui->ohx);
1905 int highlight = 0; 1922 bool highlight = false;
1906 if (ui->odn > 1) { 1923 if (ui->odn > 1) {
1907 /* 1924 /*
1908 * When a diagonal multifill selection is shown, 1925 * When a diagonal multifill selection is shown,
@@ -1913,7 +1930,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1913 if (i >= 0 && i < ui->odn && 1930 if (i >= 0 && i < ui->odn &&
1914 x == ui->ohx + i*ui->odx && 1931 x == ui->ohx + i*ui->odx &&
1915 y == ui->ohy + i*ui->ody) 1932 y == ui->ohy + i*ui->ody)
1916 highlight = 1; 1933 highlight = true;
1917 } else { 1934 } else {
1918 /* 1935 /*
1919 * For a single square, we move its highlight 1936 * For a single square, we move its highlight
@@ -1973,11 +1990,11 @@ static int game_status(const game_state *state)
1973 return state->completed ? +1 : 0; 1990 return state->completed ? +1 : 0;
1974} 1991}
1975 1992
1976static int game_timing_state(const game_state *state, game_ui *ui) 1993static bool game_timing_state(const game_state *state, game_ui *ui)
1977{ 1994{
1978 if (state->completed) 1995 if (state->completed)
1979 return FALSE; 1996 return false;
1980 return TRUE; 1997 return true;
1981} 1998}
1982 1999
1983static void game_print_size(const game_params *params, float *x, float *y) 2000static void game_print_size(const game_params *params, float *x, float *y)
@@ -2068,15 +2085,15 @@ const struct game thegame = {
2068 encode_params, 2085 encode_params,
2069 free_params, 2086 free_params,
2070 dup_params, 2087 dup_params,
2071 TRUE, game_configure, custom_params, 2088 true, game_configure, custom_params,
2072 validate_params, 2089 validate_params,
2073 new_game_desc, 2090 new_game_desc,
2074 validate_desc, 2091 validate_desc,
2075 new_game, 2092 new_game,
2076 dup_game, 2093 dup_game,
2077 free_game, 2094 free_game,
2078 TRUE, solve_game, 2095 true, solve_game,
2079 TRUE, game_can_format_as_text_now, game_text_format, 2096 true, game_can_format_as_text_now, game_text_format,
2080 new_ui, 2097 new_ui,
2081 free_ui, 2098 free_ui,
2082 encode_ui, 2099 encode_ui,
@@ -2093,9 +2110,9 @@ const struct game thegame = {
2093 game_anim_length, 2110 game_anim_length,
2094 game_flash_length, 2111 game_flash_length,
2095 game_status, 2112 game_status,
2096 TRUE, FALSE, game_print_size, game_print, 2113 true, false, game_print_size, game_print,
2097 FALSE, /* wants_statusbar */ 2114 false, /* wants_statusbar */
2098 FALSE, game_timing_state, 2115 false, game_timing_state,
2099 REQUIRE_RBUTTON | REQUIRE_NUMPAD, /* flags */ 2116 REQUIRE_RBUTTON | REQUIRE_NUMPAD, /* flags */
2100}; 2117};
2101 2118
@@ -2110,15 +2127,16 @@ int main(int argc, char **argv)
2110 char *id = NULL, *desc; 2127 char *id = NULL, *desc;
2111 const char *err; 2128 const char *err;
2112 digit *grid; 2129 digit *grid;
2113 int grade = FALSE; 2130 bool grade = false;
2114 int ret, diff, really_show_working = FALSE; 2131 int ret, diff;
2132 bool really_show_working = false;
2115 2133
2116 while (--argc > 0) { 2134 while (--argc > 0) {
2117 char *p = *++argv; 2135 char *p = *++argv;
2118 if (!strcmp(p, "-v")) { 2136 if (!strcmp(p, "-v")) {
2119 really_show_working = TRUE; 2137 really_show_working = true;
2120 } else if (!strcmp(p, "-g")) { 2138 } else if (!strcmp(p, "-g")) {
2121 grade = TRUE; 2139 grade = true;
2122 } else if (*p == '-') { 2140 } else if (*p == '-') {
2123 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p); 2141 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p);
2124 return 1; 2142 return 1;
@@ -2156,7 +2174,7 @@ int main(int argc, char **argv)
2156 * the puzzle internally before doing anything else. 2174 * the puzzle internally before doing anything else.
2157 */ 2175 */
2158 ret = -1; /* placate optimiser */ 2176 ret = -1; /* placate optimiser */
2159 solver_show_working = FALSE; 2177 solver_show_working = 0;
2160 for (diff = 0; diff < DIFFCOUNT; diff++) { 2178 for (diff = 0; diff < DIFFCOUNT; diff++) {
2161 memcpy(grid, s->grid, p->w * p->w); 2179 memcpy(grid, s->grid, p->w * p->w);
2162 ret = solver(&s->par, grid, diff); 2180 ret = solver(&s->par, grid, diff);
diff --git a/apps/plugins/puzzles/src/unfinished/numgame.c b/apps/plugins/puzzles/src/unfinished/numgame.c
index aed5c17347..d444b2257b 100644
--- a/apps/plugins/puzzles/src/unfinished/numgame.c
+++ b/apps/plugins/puzzles/src/unfinished/numgame.c
@@ -182,8 +182,8 @@ struct operation {
182 int commutes; 182 int commutes;
183 183
184 /* 184 /*
185 * Function which implements the operator. Returns TRUE on 185 * Function which implements the operator. Returns true on
186 * success, FALSE on failure. Takes two rationals and writes 186 * success, false on failure. Takes two rationals and writes
187 * out a third. 187 * out a third.
188 */ 188 */
189 int (*perform)(int *a, int *b, int *output); 189 int (*perform)(int *a, int *b, int *output);
@@ -196,21 +196,21 @@ struct rules {
196 196
197#define MUL(r, a, b) do { \ 197#define MUL(r, a, b) do { \
198 (r) = (a) * (b); \ 198 (r) = (a) * (b); \
199 if ((b) && (a) && (r) / (b) != (a)) return FALSE; \ 199 if ((b) && (a) && (r) / (b) != (a)) return false; \
200} while (0) 200} while (0)
201 201
202#define ADD(r, a, b) do { \ 202#define ADD(r, a, b) do { \
203 (r) = (a) + (b); \ 203 (r) = (a) + (b); \
204 if ((a) > 0 && (b) > 0 && (r) < 0) return FALSE; \ 204 if ((a) > 0 && (b) > 0 && (r) < 0) return false; \
205 if ((a) < 0 && (b) < 0 && (r) > 0) return FALSE; \ 205 if ((a) < 0 && (b) < 0 && (r) > 0) return false; \
206} while (0) 206} while (0)
207 207
208#define OUT(output, n, d) do { \ 208#define OUT(output, n, d) do { \
209 int g = gcd((n),(d)); \ 209 int g = gcd((n),(d)); \
210 if (g < 0) g = -g; \ 210 if (g < 0) g = -g; \
211 if ((d) < 0) g = -g; \ 211 if ((d) < 0) g = -g; \
212 if (g == -1 && (n) < -INT_MAX) return FALSE; \ 212 if (g == -1 && (n) < -INT_MAX) return false; \
213 if (g == -1 && (d) < -INT_MAX) return FALSE; \ 213 if (g == -1 && (d) < -INT_MAX) return false; \
214 (output)[0] = (n)/g; \ 214 (output)[0] = (n)/g; \
215 (output)[1] = (d)/g; \ 215 (output)[1] = (d)/g; \
216 assert((output)[1] > 0); \ 216 assert((output)[1] > 0); \
@@ -238,7 +238,7 @@ static int perform_add(int *a, int *b, int *output)
238 ADD(tn, at, bt); 238 ADD(tn, at, bt);
239 MUL(bn, a[1], b[1]); 239 MUL(bn, a[1], b[1]);
240 OUT(output, tn, bn); 240 OUT(output, tn, bn);
241 return TRUE; 241 return true;
242} 242}
243 243
244static int perform_sub(int *a, int *b, int *output) 244static int perform_sub(int *a, int *b, int *output)
@@ -252,7 +252,7 @@ static int perform_sub(int *a, int *b, int *output)
252 ADD(tn, at, -bt); 252 ADD(tn, at, -bt);
253 MUL(bn, a[1], b[1]); 253 MUL(bn, a[1], b[1]);
254 OUT(output, tn, bn); 254 OUT(output, tn, bn);
255 return TRUE; 255 return true;
256} 256}
257 257
258static int perform_mul(int *a, int *b, int *output) 258static int perform_mul(int *a, int *b, int *output)
@@ -264,7 +264,7 @@ static int perform_mul(int *a, int *b, int *output)
264 MUL(tn, a[0], b[0]); 264 MUL(tn, a[0], b[0]);
265 MUL(bn, a[1], b[1]); 265 MUL(bn, a[1], b[1]);
266 OUT(output, tn, bn); 266 OUT(output, tn, bn);
267 return TRUE; 267 return true;
268} 268}
269 269
270static int perform_div(int *a, int *b, int *output) 270static int perform_div(int *a, int *b, int *output)
@@ -275,7 +275,7 @@ static int perform_div(int *a, int *b, int *output)
275 * Division by zero is outlawed. 275 * Division by zero is outlawed.
276 */ 276 */
277 if (b[0] == 0) 277 if (b[0] == 0)
278 return FALSE; 278 return false;
279 279
280 /* 280 /*
281 * a0/a1 / b0/b1 = (a0*b1) / (a1*b0) 281 * a0/a1 / b0/b1 = (a0*b1) / (a1*b0)
@@ -283,7 +283,7 @@ static int perform_div(int *a, int *b, int *output)
283 MUL(tn, a[0], b[1]); 283 MUL(tn, a[0], b[1]);
284 MUL(bn, a[1], b[0]); 284 MUL(bn, a[1], b[0]);
285 OUT(output, tn, bn); 285 OUT(output, tn, bn);
286 return TRUE; 286 return true;
287} 287}
288 288
289static int perform_exact_div(int *a, int *b, int *output) 289static int perform_exact_div(int *a, int *b, int *output)
@@ -294,7 +294,7 @@ static int perform_exact_div(int *a, int *b, int *output)
294 * Division by zero is outlawed. 294 * Division by zero is outlawed.
295 */ 295 */
296 if (b[0] == 0) 296 if (b[0] == 0)
297 return FALSE; 297 return false;
298 298
299 /* 299 /*
300 * a0/a1 / b0/b1 = (a0*b1) / (a1*b0) 300 * a0/a1 / b0/b1 = (a0*b1) / (a1*b0)
@@ -324,9 +324,9 @@ static int max_p10(int n, int *p10_r)
324 while (p10 <= (INT_MAX/10) && p10 <= n) 324 while (p10 <= (INT_MAX/10) && p10 <= n)
325 p10 *= 10; 325 p10 *= 10;
326 if (p10 > INT_MAX/10) 326 if (p10 > INT_MAX/10)
327 return FALSE; /* integer overflow */ 327 return false; /* integer overflow */
328 *p10_r = p10; 328 *p10_r = p10;
329 return TRUE; 329 return true;
330} 330}
331 331
332static int perform_concat(int *a, int *b, int *output) 332static int perform_concat(int *a, int *b, int *output)
@@ -338,7 +338,7 @@ static int perform_concat(int *a, int *b, int *output)
338 * integer. 338 * integer.
339 */ 339 */
340 if (a[1] != 1 || b[1] != 1 || a[0] < 0 || b[0] < 0) 340 if (a[1] != 1 || b[1] != 1 || a[0] < 0 || b[0] < 0)
341 return FALSE; 341 return false;
342 342
343 /* 343 /*
344 * For concatenation, we can safely assume leading zeroes 344 * For concatenation, we can safely assume leading zeroes
@@ -357,14 +357,14 @@ static int perform_concat(int *a, int *b, int *output)
357 * _end_ of the 1 first. 357 * _end_ of the 1 first.
358 */ 358 */
359 if (a[0] == 0) 359 if (a[0] == 0)
360 return FALSE; 360 return false;
361 361
362 if (!max_p10(b[0], &p10)) return FALSE; 362 if (!max_p10(b[0], &p10)) return false;
363 363
364 MUL(t1, p10, a[0]); 364 MUL(t1, p10, a[0]);
365 ADD(t2, t1, b[0]); 365 ADD(t2, t1, b[0]);
366 OUT(output, t2, 1); 366 OUT(output, t2, 1);
367 return TRUE; 367 return true;
368} 368}
369 369
370#define IPOW(ret, x, y) do { \ 370#define IPOW(ret, x, y) do { \
@@ -400,7 +400,7 @@ static int perform_exp(int *a, int *b, int *output)
400 IPOW(xn, an, b[1]); 400 IPOW(xn, an, b[1]);
401 IPOW(xd, ad, b[1]); 401 IPOW(xd, ad, b[1]);
402 if (xn != a[0] || xd != a[1]) 402 if (xn != a[0] || xd != a[1])
403 return FALSE; 403 return false;
404 } else { 404 } else {
405 an = a[0]; 405 an = a[0];
406 ad = a[1]; 406 ad = a[1];
@@ -413,10 +413,10 @@ static int perform_exp(int *a, int *b, int *output)
413 IPOW(xn, ad, -b[0]); 413 IPOW(xn, ad, -b[0]);
414 } 414 }
415 if (xd == 0) 415 if (xd == 0)
416 return FALSE; 416 return false;
417 417
418 OUT(output, xn, xd); 418 OUT(output, xn, xd);
419 return TRUE; 419 return true;
420} 420}
421 421
422static int perform_factorial(int *a, int *b, int *output) 422static int perform_factorial(int *a, int *b, int *output)
@@ -427,14 +427,14 @@ static int perform_factorial(int *a, int *b, int *output)
427 * Factorials of non-negative integers are permitted. 427 * Factorials of non-negative integers are permitted.
428 */ 428 */
429 if (a[1] != 1 || a[0] < 0) 429 if (a[1] != 1 || a[0] < 0)
430 return FALSE; 430 return false;
431 431
432 /* 432 /*
433 * However, a special case: we don't take a factorial of 433 * However, a special case: we don't take a factorial of
434 * anything which would thereby remain the same. 434 * anything which would thereby remain the same.
435 */ 435 */
436 if (a[0] == 1 || a[0] == 2) 436 if (a[0] == 1 || a[0] == 2)
437 return FALSE; 437 return false;
438 438
439 ret = 1; 439 ret = 1;
440 for (i = 1; i <= a[0]; i++) { 440 for (i = 1; i <= a[0]; i++) {
@@ -443,7 +443,7 @@ static int perform_factorial(int *a, int *b, int *output)
443 } 443 }
444 444
445 OUT(output, ret, 1); 445 OUT(output, ret, 1);
446 return TRUE; 446 return true;
447} 447}
448 448
449static int perform_decimal(int *a, int *b, int *output) 449static int perform_decimal(int *a, int *b, int *output)
@@ -458,12 +458,12 @@ static int perform_decimal(int *a, int *b, int *output)
458 * x --> x / (smallest power of 10 > than x) 458 * x --> x / (smallest power of 10 > than x)
459 * 459 *
460 */ 460 */
461 if (a[1] != 1) return FALSE; 461 if (a[1] != 1) return false;
462 462
463 if (!max_p10(a[0], &p10)) return FALSE; 463 if (!max_p10(a[0], &p10)) return false;
464 464
465 OUT(output, a[0], p10); 465 OUT(output, a[0], p10);
466 return TRUE; 466 return true;
467} 467}
468 468
469static int perform_recur(int *a, int *b, int *output) 469static int perform_recur(int *a, int *b, int *output)
@@ -478,20 +478,20 @@ static int perform_recur(int *a, int *b, int *output)
478 * returning if no such power of 10 exists. Then multiply the numerator 478 * returning if no such power of 10 exists. Then multiply the numerator
479 * up accordingly, and the new denominator becomes that power of 10 - 1. 479 * up accordingly, and the new denominator becomes that power of 10 - 1.
480 */ 480 */
481 if (abs(a[0]) >= abs(a[1])) return FALSE; /* -1 < a < 1 */ 481 if (abs(a[0]) >= abs(a[1])) return false; /* -1 < a < 1 */
482 482
483 p10 = 10; 483 p10 = 10;
484 while (p10 <= (INT_MAX/10)) { 484 while (p10 <= (INT_MAX/10)) {
485 if ((a[1] <= p10) && (p10 % a[1]) == 0) goto found; 485 if ((a[1] <= p10) && (p10 % a[1]) == 0) goto found;
486 p10 *= 10; 486 p10 *= 10;
487 } 487 }
488 return FALSE; 488 return false;
489found: 489found:
490 tn = a[0] * (p10 / a[1]); 490 tn = a[0] * (p10 / a[1]);
491 bn = p10 - 1; 491 bn = p10 - 1;
492 492
493 OUT(output, tn, bn); 493 OUT(output, tn, bn);
494 return TRUE; 494 return true;
495} 495}
496 496
497static int perform_root(int *a, int *b, int *output) 497static int perform_root(int *a, int *b, int *output)
@@ -504,7 +504,7 @@ static int perform_root(int *a, int *b, int *output)
504 504
505 if (a[0] == 0) { 505 if (a[0] == 0) {
506 OUT(output, 1, 1); 506 OUT(output, 1, 1);
507 return TRUE; 507 return true;
508 } 508 }
509 509
510 OUT(ainv, a[1], a[0]); 510 OUT(ainv, a[1], a[0]);
@@ -514,11 +514,11 @@ static int perform_root(int *a, int *b, int *output)
514 514
515static int perform_perc(int *a, int *b, int *output) 515static int perform_perc(int *a, int *b, int *output)
516{ 516{
517 if (a[0] == 0) return FALSE; /* 0% = 0, uninteresting. */ 517 if (a[0] == 0) return false; /* 0% = 0, uninteresting. */
518 if (a[1] > (INT_MAX/100)) return FALSE; 518 if (a[1] > (INT_MAX/100)) return false;
519 519
520 OUT(output, a[0], a[1]*100); 520 OUT(output, a[0], a[1]*100);
521 return TRUE; 521 return true;
522} 522}
523 523
524static int perform_gamma(int *a, int *b, int *output) 524static int perform_gamma(int *a, int *b, int *output)
@@ -531,7 +531,7 @@ static int perform_gamma(int *a, int *b, int *output)
531 * special case not caught by perform_fact: gamma(1) is 1 so 531 * special case not caught by perform_fact: gamma(1) is 1 so
532 * don't bother. 532 * don't bother.
533 */ 533 */
534 if (a[0] == 1 && a[1] == 1) return FALSE; 534 if (a[0] == 1 && a[1] == 1) return false;
535 535
536 OUT(asub1, a[0]-a[1], a[1]); 536 OUT(asub1, a[0]-a[1], a[1]);
537 return perform_factorial(asub1, b, output); 537 return perform_factorial(asub1, b, output);
@@ -544,53 +544,53 @@ static int perform_sqrt(int *a, int *b, int *output)
544 /* 544 /*
545 * sqrt(0) == 0, sqrt(1) == 1: don't perform unary noops. 545 * sqrt(0) == 0, sqrt(1) == 1: don't perform unary noops.
546 */ 546 */
547 if (a[0] == 0 || (a[0] == 1 && a[1] == 1)) return FALSE; 547 if (a[0] == 0 || (a[0] == 1 && a[1] == 1)) return false;
548 548
549 return perform_exp(a, half, output); 549 return perform_exp(a, half, output);
550} 550}
551 551
552const static struct operation op_add = { 552const static struct operation op_add = {
553 TRUE, "+", "+", 0, 10, 0, TRUE, perform_add 553 true, "+", "+", 0, 10, 0, true, perform_add
554}; 554};
555const static struct operation op_sub = { 555const static struct operation op_sub = {
556 TRUE, "-", "-", 0, 10, 2, FALSE, perform_sub 556 true, "-", "-", 0, 10, 2, false, perform_sub
557}; 557};
558const static struct operation op_mul = { 558const static struct operation op_mul = {
559 TRUE, "*", "*", 0, 20, 0, TRUE, perform_mul 559 true, "*", "*", 0, 20, 0, true, perform_mul
560}; 560};
561const static struct operation op_div = { 561const static struct operation op_div = {
562 TRUE, "/", "/", 0, 20, 2, FALSE, perform_div 562 true, "/", "/", 0, 20, 2, false, perform_div
563}; 563};
564const static struct operation op_xdiv = { 564const static struct operation op_xdiv = {
565 TRUE, "/", "/", 0, 20, 2, FALSE, perform_exact_div 565 true, "/", "/", 0, 20, 2, false, perform_exact_div
566}; 566};
567const static struct operation op_concat = { 567const static struct operation op_concat = {
568 FALSE, "", "concat", OPFLAG_NEEDS_CONCAT | OPFLAG_KEEPS_CONCAT, 568 false, "", "concat", OPFLAG_NEEDS_CONCAT | OPFLAG_KEEPS_CONCAT,
569 1000, 0, FALSE, perform_concat 569 1000, 0, false, perform_concat
570}; 570};
571const static struct operation op_exp = { 571const static struct operation op_exp = {
572 TRUE, "^", "^", 0, 30, 1, FALSE, perform_exp 572 true, "^", "^", 0, 30, 1, false, perform_exp
573}; 573};
574const static struct operation op_factorial = { 574const static struct operation op_factorial = {
575 TRUE, "!", "!", OPFLAG_UNARY, 40, 0, FALSE, perform_factorial 575 true, "!", "!", OPFLAG_UNARY, 40, 0, false, perform_factorial
576}; 576};
577const static struct operation op_decimal = { 577const static struct operation op_decimal = {
578 TRUE, ".", ".", OPFLAG_UNARY | OPFLAG_UNARYPREFIX | OPFLAG_NEEDS_CONCAT | OPFLAG_KEEPS_CONCAT, 50, 0, FALSE, perform_decimal 578 true, ".", ".", OPFLAG_UNARY | OPFLAG_UNARYPREFIX | OPFLAG_NEEDS_CONCAT | OPFLAG_KEEPS_CONCAT, 50, 0, false, perform_decimal
579}; 579};
580const static struct operation op_recur = { 580const static struct operation op_recur = {
581 TRUE, "...", "recur", OPFLAG_UNARY | OPFLAG_NEEDS_CONCAT, 45, 2, FALSE, perform_recur 581 true, "...", "recur", OPFLAG_UNARY | OPFLAG_NEEDS_CONCAT, 45, 2, false, perform_recur
582}; 582};
583const static struct operation op_root = { 583const static struct operation op_root = {
584 TRUE, "v~", "root", 0, 30, 1, FALSE, perform_root 584 true, "v~", "root", 0, 30, 1, false, perform_root
585}; 585};
586const static struct operation op_perc = { 586const static struct operation op_perc = {
587 TRUE, "%", "%", OPFLAG_UNARY | OPFLAG_NEEDS_CONCAT, 45, 1, FALSE, perform_perc 587 true, "%", "%", OPFLAG_UNARY | OPFLAG_NEEDS_CONCAT, 45, 1, false, perform_perc
588}; 588};
589const static struct operation op_gamma = { 589const static struct operation op_gamma = {
590 TRUE, "gamma", "gamma", OPFLAG_UNARY | OPFLAG_UNARYPREFIX | OPFLAG_FN, 1, 3, FALSE, perform_gamma 590 true, "gamma", "gamma", OPFLAG_UNARY | OPFLAG_UNARYPREFIX | OPFLAG_FN, 1, 3, false, perform_gamma
591}; 591};
592const static struct operation op_sqrt = { 592const static struct operation op_sqrt = {
593 TRUE, "v~", "sqrt", OPFLAG_UNARY | OPFLAG_UNARYPREFIX, 30, 1, FALSE, perform_sqrt 593 true, "v~", "sqrt", OPFLAG_UNARY | OPFLAG_UNARYPREFIX, 30, 1, false, perform_sqrt
594}; 594};
595 595
596/* 596/*
@@ -601,7 +601,7 @@ const static struct operation *const ops_countdown[] = {
601 &op_add, &op_mul, &op_sub, &op_xdiv, NULL 601 &op_add, &op_mul, &op_sub, &op_xdiv, NULL
602}; 602};
603const static struct rules rules_countdown = { 603const static struct rules rules_countdown = {
604 ops_countdown, FALSE 604 ops_countdown, false
605}; 605};
606 606
607/* 607/*
@@ -613,7 +613,7 @@ const static struct operation *const ops_3388[] = {
613 &op_add, &op_mul, &op_sub, &op_div, NULL 613 &op_add, &op_mul, &op_sub, &op_div, NULL
614}; 614};
615const static struct rules rules_3388 = { 615const static struct rules rules_3388 = {
616 ops_3388, TRUE 616 ops_3388, true
617}; 617};
618 618
619/* 619/*
@@ -624,7 +624,7 @@ const static struct operation *const ops_four4s[] = {
624 &op_add, &op_mul, &op_sub, &op_div, &op_concat, NULL 624 &op_add, &op_mul, &op_sub, &op_div, &op_concat, NULL
625}; 625};
626const static struct rules rules_four4s = { 626const static struct rules rules_four4s = {
627 ops_four4s, TRUE 627 ops_four4s, true
628}; 628};
629 629
630/* 630/*
@@ -636,7 +636,7 @@ const static struct operation *const ops_anythinggoes[] = {
636 &op_decimal, &op_recur, &op_root, &op_perc, &op_gamma, &op_sqrt, NULL 636 &op_decimal, &op_recur, &op_root, &op_perc, &op_gamma, &op_sqrt, NULL
637}; 637};
638const static struct rules rules_anythinggoes = { 638const static struct rules rules_anythinggoes = {
639 ops_anythinggoes, TRUE 639 ops_anythinggoes, true
640}; 640};
641 641
642#define ratcmp(a,op,b) ( (long long)(a)[0] * (b)[1] op \ 642#define ratcmp(a,op,b) ( (long long)(a)[0] * (b)[1] op \
@@ -805,7 +805,7 @@ static int addoutput(struct sets *s, struct set *ss, int index, int *n)
805 * Target numbers are always integers. 805 * Target numbers are always integers.
806 */ 806 */
807 if (ss->numbers[2*index+1] != 1) 807 if (ss->numbers[2*index+1] != 1)
808 return FALSE; 808 return false;
809 809
810 ensure(s->outputlists, s->outputlistsize, s->noutputs/OUTPUTLISTLEN+1, 810 ensure(s->outputlists, s->outputlistsize, s->noutputs/OUTPUTLISTLEN+1,
811 struct output *); 811 struct output *);
@@ -826,7 +826,7 @@ static int addoutput(struct sets *s, struct set *ss, int index, int *n)
826 s->noutputs++; 826 s->noutputs++;
827 } 827 }
828 *n = o->number; 828 *n = o->number;
829 return TRUE; 829 return true;
830} 830}
831 831
832static struct sets *do_search(int ninputs, int *inputs, 832static struct sets *do_search(int ninputs, int *inputs,
@@ -1095,16 +1095,16 @@ void print(int pathindex, struct sets *s, struct output *o)
1095 */ 1095 */
1096int main(int argc, char **argv) 1096int main(int argc, char **argv)
1097{ 1097{
1098 int doing_opts = TRUE; 1098 int doing_opts = true;
1099 const struct rules *rules = NULL; 1099 const struct rules *rules = NULL;
1100 char *pname = argv[0]; 1100 char *pname = argv[0];
1101 int got_target = FALSE, target = 0; 1101 int got_target = false, target = 0;
1102 int numbers[10], nnumbers = 0; 1102 int numbers[10], nnumbers = 0;
1103 int verbose = FALSE; 1103 int verbose = false;
1104 int pathcounts = FALSE; 1104 int pathcounts = false;
1105 int multiple = FALSE; 1105 int multiple = false;
1106 int debug_bfs = FALSE; 1106 int debug_bfs = false;
1107 int got_range = FALSE, rangemin = 0, rangemax = 0; 1107 int got_range = false, rangemin = 0, rangemax = 0;
1108 1108
1109 struct output *o; 1109 struct output *o;
1110 struct sets *s; 1110 struct sets *s;
@@ -1118,12 +1118,12 @@ int main(int argc, char **argv)
1118 p++; 1118 p++;
1119 1119
1120 if (!strcmp(p, "-")) { 1120 if (!strcmp(p, "-")) {
1121 doing_opts = FALSE; 1121 doing_opts = false;
1122 continue; 1122 continue;
1123 } else if (*p == '-') { 1123 } else if (*p == '-') {
1124 p++; 1124 p++;
1125 if (!strcmp(p, "debug-bfs")) { 1125 if (!strcmp(p, "debug-bfs")) {
1126 debug_bfs = TRUE; 1126 debug_bfs = true;
1127 } else { 1127 } else {
1128 fprintf(stderr, "%s: option '--%s' not recognised\n", 1128 fprintf(stderr, "%s: option '--%s' not recognised\n",
1129 pname, p); 1129 pname, p);
@@ -1142,13 +1142,13 @@ int main(int argc, char **argv)
1142 rules = &rules_anythinggoes; 1142 rules = &rules_anythinggoes;
1143 break; 1143 break;
1144 case 'v': 1144 case 'v':
1145 verbose = TRUE; 1145 verbose = true;
1146 break; 1146 break;
1147 case 'p': 1147 case 'p':
1148 pathcounts = TRUE; 1148 pathcounts = true;
1149 break; 1149 break;
1150 case 'm': 1150 case 'm':
1151 multiple = TRUE; 1151 multiple = true;
1152 break; 1152 break;
1153 case 't': 1153 case 't':
1154 case 'r': 1154 case 'r':
@@ -1166,13 +1166,13 @@ int main(int argc, char **argv)
1166 } 1166 }
1167 switch (c) { 1167 switch (c) {
1168 case 't': 1168 case 't':
1169 got_target = TRUE; 1169 got_target = true;
1170 target = atoi(v); 1170 target = atoi(v);
1171 break; 1171 break;
1172 case 'r': 1172 case 'r':
1173 { 1173 {
1174 char *sep = strchr(v, '-'); 1174 char *sep = strchr(v, '-');
1175 got_range = TRUE; 1175 got_range = true;
1176 if (sep) { 1176 if (sep) {
1177 rangemin = atoi(v); 1177 rangemin = atoi(v);
1178 rangemax = atoi(sep+1); 1178 rangemax = atoi(sep+1);
diff --git a/apps/plugins/puzzles/src/unfinished/path.c b/apps/plugins/puzzles/src/unfinished/path.c
index d4ec5d87cc..829fbc6c75 100644
--- a/apps/plugins/puzzles/src/unfinished/path.c
+++ b/apps/plugins/puzzles/src/unfinished/path.c
@@ -201,17 +201,17 @@ static int is_endpoint(struct genctx *ctx, int x, int y)
201 201
202 c = ctx->grid[y*w+x]; 202 c = ctx->grid[y*w+x];
203 if (c < 0) 203 if (c < 0)
204 return FALSE; /* empty square is not an endpoint! */ 204 return false; /* empty square is not an endpoint! */
205 assert(c >= 0 && c < ctx->npaths); 205 assert(c >= 0 && c < ctx->npaths);
206 if (ctx->pathends[c*2] == y*w+x || ctx->pathends[c*2+1] == y*w+x) 206 if (ctx->pathends[c*2] == y*w+x || ctx->pathends[c*2+1] == y*w+x)
207 return TRUE; 207 return true;
208 return FALSE; 208 return false;
209} 209}
210 210
211/* 211/*
212 * Tries to extend a path by one square in the given direction, 212 * Tries to extend a path by one square in the given direction,
213 * pushing other paths around if necessary. Returns TRUE on success 213 * pushing other paths around if necessary. Returns true on success
214 * or FALSE on failure. 214 * or false on failure.
215 */ 215 */
216static int extend_path(struct genctx *ctx, int path, int end, int direction) 216static int extend_path(struct genctx *ctx, int path, int end, int direction)
217{ 217{
@@ -233,7 +233,7 @@ static int extend_path(struct genctx *ctx, int path, int end, int direction)
233 xe = x + DX(direction); 233 xe = x + DX(direction);
234 ye = y + DY(direction); 234 ye = y + DY(direction);
235 if (xe < 0 || xe >= w || ye < 0 || ye >= h) 235 if (xe < 0 || xe >= w || ye < 0 || ye >= h)
236 return FALSE; /* could not extend in this direction */ 236 return false; /* could not extend in this direction */
237 237
238 /* 238 /*
239 * We don't extend paths _directly_ into endpoints of other 239 * We don't extend paths _directly_ into endpoints of other
@@ -242,13 +242,13 @@ static int extend_path(struct genctx *ctx, int path, int end, int direction)
242 * path's endpoint. 242 * path's endpoint.
243 */ 243 */
244 if (is_endpoint(ctx, xe, ye)) 244 if (is_endpoint(ctx, xe, ye))
245 return FALSE; 245 return false;
246 246
247 /* 247 /*
248 * We can't extend a path back the way it came. 248 * We can't extend a path back the way it came.
249 */ 249 */
250 if (ctx->grid[ye*w+xe] == path) 250 if (ctx->grid[ye*w+xe] == path)
251 return FALSE; 251 return false;
252 252
253 /* 253 /*
254 * Paths may not double back on themselves. Check if the new 254 * Paths may not double back on themselves. Check if the new
@@ -262,7 +262,7 @@ static int extend_path(struct genctx *ctx, int path, int end, int direction)
262 262
263 if (xf >= 0 && xf < w && yf >= 0 && yf < h && 263 if (xf >= 0 && xf < w && yf >= 0 && yf < h &&
264 (xf != x || yf != y) && ctx->grid[yf*w+xf] == path) 264 (xf != x || yf != y) && ctx->grid[yf*w+xf] == path)
265 return FALSE; 265 return false;
266 } 266 }
267 267
268 /* 268 /*
@@ -331,7 +331,7 @@ static int extend_path(struct genctx *ctx, int path, int end, int direction)
331 ctx->dist, ctx->list); 331 ctx->dist, ctx->list);
332 first = last = -1; 332 first = last = -1;
333if (ctx->sparegrid3[ctx->pathends[i*2]] != i || 333if (ctx->sparegrid3[ctx->pathends[i*2]] != i ||
334 ctx->sparegrid3[ctx->pathends[i*2+1]] != i) return FALSE;/* FIXME */ 334 ctx->sparegrid3[ctx->pathends[i*2+1]] != i) return false;/* FIXME */
335 for (j = 0; j < n; j++) { 335 for (j = 0; j < n; j++) {
336 jp = ctx->list[j]; 336 jp = ctx->list[j];
337 assert(ctx->dist[jp] == j); 337 assert(ctx->dist[jp] == j);
@@ -375,7 +375,7 @@ if (ctx->sparegrid3[ctx->pathends[i*2]] != i ||
375 } 375 }
376 376
377 if (first < 0 || last < 0) 377 if (first < 0 || last < 0)
378 return FALSE; /* path is completely wiped out! */ 378 return false; /* path is completely wiped out! */
379 379
380 /* 380 /*
381 * Now we've covered sparegrid3 in possible squares for 381 * Now we've covered sparegrid3 in possible squares for
@@ -393,7 +393,7 @@ if (ctx->sparegrid3[ctx->pathends[i*2]] != i ||
393 * any more. This means the entire push operation 393 * any more. This means the entire push operation
394 * has failed. 394 * has failed.
395 */ 395 */
396 return FALSE; 396 return false;
397 } 397 }
398 398
399 /* 399 /*
@@ -407,7 +407,7 @@ if (ctx->sparegrid3[ctx->pathends[i*2]] != i ||
407 407
408 if (ctx->sparegrid[jp] >= 0) { 408 if (ctx->sparegrid[jp] >= 0) {
409 if (ctx->pathspare[ctx->sparegrid[jp]] == 2) 409 if (ctx->pathspare[ctx->sparegrid[jp]] == 2)
410 return FALSE; /* somehow we've hit a fixed path */ 410 return false; /* somehow we've hit a fixed path */
411 ctx->pathspare[ctx->sparegrid[jp]] = 1; /* broken */ 411 ctx->pathspare[ctx->sparegrid[jp]] = 1; /* broken */
412 } 412 }
413 ctx->sparegrid[jp] = i; 413 ctx->sparegrid[jp] = i;
@@ -443,7 +443,7 @@ if (ctx->sparegrid3[ctx->pathends[i*2]] != i ||
443 */ 443 */
444 memcpy(ctx->grid, ctx->sparegrid, w*h*sizeof(int)); 444 memcpy(ctx->grid, ctx->sparegrid, w*h*sizeof(int));
445 memcpy(ctx->pathends, ctx->sparepathends, ctx->npaths*2*sizeof(int)); 445 memcpy(ctx->pathends, ctx->sparepathends, ctx->npaths*2*sizeof(int));
446 return TRUE; 446 return true;
447} 447}
448 448
449/* 449/*
@@ -556,10 +556,10 @@ static int add_path(struct genctx *ctx, random_state *rs)
556 ctx->grid[j] = c; 556 ctx->grid[j] = c;
557 } 557 }
558 558
559 return TRUE; 559 return true;
560 } 560 }
561 561
562 return FALSE; 562 return false;
563} 563}
564 564
565/* 565/*
diff --git a/apps/plugins/puzzles/src/unfinished/separate.c b/apps/plugins/puzzles/src/unfinished/separate.c
index fc64d7fe37..88dc8ed060 100644
--- a/apps/plugins/puzzles/src/unfinished/separate.c
+++ b/apps/plugins/puzzles/src/unfinished/separate.c
@@ -120,9 +120,9 @@ static game_params *default_params(void)
120 return ret; 120 return ret;
121} 121}
122 122
123static int game_fetch_preset(int i, char **name, game_params **params) 123static bool game_fetch_preset(int i, char **name, game_params **params)
124{ 124{
125 return FALSE; 125 return false;
126} 126}
127 127
128static void free_params(game_params *params) 128static void free_params(game_params *params)
@@ -153,7 +153,7 @@ static void decode_params(game_params *params, char const *string)
153 } 153 }
154} 154}
155 155
156static char *encode_params(const game_params *params, int full) 156static char *encode_params(const game_params *params, bool full)
157{ 157{
158 char buf[256]; 158 char buf[256];
159 sprintf(buf, "%dx%dn%d", params->w, params->h, params->k); 159 sprintf(buf, "%dx%dn%d", params->w, params->h, params->k);
@@ -170,7 +170,7 @@ static game_params *custom_params(const config_item *cfg)
170 return NULL; 170 return NULL;
171} 171}
172 172
173static const char *validate_params(const game_params *params, int full) 173static const char *validate_params(const game_params *params, bool full)
174{ 174{
175 return NULL; 175 return NULL;
176} 176}
@@ -207,7 +207,7 @@ struct solver_scratch {
207 * tracks whether or not the connected components containing 207 * tracks whether or not the connected components containing
208 * yx1 and yx2 are known to be distinct. 208 * yx1 and yx2 are known to be distinct.
209 */ 209 */
210 unsigned char *disconnect; 210 bool *disconnect;
211 211
212 /* 212 /*
213 * Temporary space used only inside particular solver loops. 213 * Temporary space used only inside particular solver loops.
@@ -227,7 +227,7 @@ struct solver_scratch *solver_scratch_new(int w, int h, int k)
227 sc->dsf = snew_dsf(wh); 227 sc->dsf = snew_dsf(wh);
228 sc->size = snewn(wh, int); 228 sc->size = snewn(wh, int);
229 sc->contents = snewn(wh * k, int); 229 sc->contents = snewn(wh * k, int);
230 sc->disconnect = snewn(wh*wh, unsigned char); 230 sc->disconnect = snewn(wh*wh, bool);
231 sc->tmp = snewn(wh, int); 231 sc->tmp = snewn(wh, int);
232 232
233 return sc; 233 return sc;
@@ -312,7 +312,8 @@ void solver_disconnect(struct solver_scratch *sc, int yx1, int yx2)
312 * Mark the components as disconnected from each other in the 312 * Mark the components as disconnected from each other in the
313 * disconnect matrix. 313 * disconnect matrix.
314 */ 314 */
315 sc->disconnect[yx1*wh+yx2] = sc->disconnect[yx2*wh+yx1] = 1; 315 sc->disconnect[yx1*wh+yx2] = true;
316 sc->disconnect[yx2*wh+yx1] = true;
316} 317}
317 318
318void solver_init(struct solver_scratch *sc) 319void solver_init(struct solver_scratch *sc)
@@ -328,16 +329,16 @@ void solver_init(struct solver_scratch *sc)
328 */ 329 */
329 dsf_init(sc->dsf, wh); 330 dsf_init(sc->dsf, wh);
330 for (i = 0; i < wh; i++) sc->size[i] = 1; 331 for (i = 0; i < wh; i++) sc->size[i] = 1;
331 memset(sc->disconnect, 0, wh*wh); 332 memset(sc->disconnect, 0, wh*wh * sizeof(bool));
332} 333}
333 334
334int solver_attempt(struct solver_scratch *sc, const unsigned char *grid, 335int solver_attempt(struct solver_scratch *sc, const unsigned char *grid,
335 unsigned char *gen_lock) 336 bool *gen_lock)
336{ 337{
337 int w = sc->w, h = sc->h, k = sc->k; 338 int w = sc->w, h = sc->h, k = sc->k;
338 int wh = w*h; 339 int wh = w*h;
339 int i, x, y; 340 int i, x, y;
340 int done_something_overall = FALSE; 341 bool done_something_overall = false;
341 342
342 /* 343 /*
343 * Set up the contents array from the grid. 344 * Set up the contents array from the grid.
@@ -348,7 +349,7 @@ int solver_attempt(struct solver_scratch *sc, const unsigned char *grid,
348 sc->contents[dsf_canonify(sc->dsf, i)*k+grid[i]] = i; 349 sc->contents[dsf_canonify(sc->dsf, i)*k+grid[i]] = i;
349 350
350 while (1) { 351 while (1) {
351 int done_something = FALSE; 352 bool done_something = false;
352 353
353 /* 354 /*
354 * Go over the grid looking for reasons to add to the 355 * Go over the grid looking for reasons to add to the
@@ -393,7 +394,7 @@ int solver_attempt(struct solver_scratch *sc, const unsigned char *grid,
393 printf("Disconnecting %d and %d (%c)\n", yx, yx2, 'A'+i); 394 printf("Disconnecting %d and %d (%c)\n", yx, yx2, 'A'+i);
394#endif 395#endif
395 solver_disconnect(sc, yx, yx2); 396 solver_disconnect(sc, yx, yx2);
396 done_something = done_something_overall = TRUE; 397 done_something = done_something_overall = true;
397 398
398 /* 399 /*
399 * We have just made a deduction which hinges 400 * We have just made a deduction which hinges
@@ -406,8 +407,8 @@ int solver_attempt(struct solver_scratch *sc, const unsigned char *grid,
406 * based deductions. 407 * based deductions.
407 */ 408 */
408 if (gen_lock) { 409 if (gen_lock) {
409 gen_lock[sc->contents[yx*k+i]] = 1; 410 gen_lock[sc->contents[yx*k+i]] = true;
410 gen_lock[sc->contents[yx2*k+i]] = 1; 411 gen_lock[sc->contents[yx2*k+i]] = true;
411 } 412 }
412 } 413 }
413 } 414 }
@@ -467,7 +468,7 @@ int solver_attempt(struct solver_scratch *sc, const unsigned char *grid,
467 printf("Connecting %d and %d\n", i, sc->tmp[i]); 468 printf("Connecting %d and %d\n", i, sc->tmp[i]);
468#endif 469#endif
469 solver_connect(sc, i, sc->tmp[i]); 470 solver_connect(sc, i, sc->tmp[i]);
470 done_something = done_something_overall = TRUE; 471 done_something = done_something_overall = true;
471 break; 472 break;
472 } 473 }
473 } 474 }
@@ -500,14 +501,14 @@ unsigned char *generate(int w, int h, int k, random_state *rs)
500 unsigned char *shuffled; 501 unsigned char *shuffled;
501 int i, j, m, retries; 502 int i, j, m, retries;
502 int *permutation; 503 int *permutation;
503 unsigned char *gen_lock; 504 bool *gen_lock;
504 extern int *divvy_rectangle(int w, int h, int k, random_state *rs); 505 extern int *divvy_rectangle(int w, int h, int k, random_state *rs);
505 506
506 sc = solver_scratch_new(w, h, k); 507 sc = solver_scratch_new(w, h, k);
507 grid = snewn(wh, unsigned char); 508 grid = snewn(wh, unsigned char);
508 shuffled = snewn(k, unsigned char); 509 shuffled = snewn(k, unsigned char);
509 permutation = snewn(wh, int); 510 permutation = snewn(wh, int);
510 gen_lock = snewn(wh, unsigned char); 511 gen_lock = snewn(wh, bool);
511 512
512 do { 513 do {
513 int *dsf = divvy_rectangle(w, h, k, rs); 514 int *dsf = divvy_rectangle(w, h, k, rs);
@@ -547,7 +548,7 @@ unsigned char *generate(int w, int h, int k, random_state *rs)
547 * on for deductions. This is gradually updated by 548 * on for deductions. This is gradually updated by
548 * solver_attempt(). 549 * solver_attempt().
549 */ 550 */
550 memset(gen_lock, 0, wh); 551 memset(gen_lock, 0, wh * sizeof(bool));
551 552
552 /* 553 /*
553 * Now repeatedly fill the grid with letters, and attempt 554 * Now repeatedly fill the grid with letters, and attempt
@@ -627,7 +628,7 @@ unsigned char *generate(int w, int h, int k, random_state *rs)
627 */ 628 */
628 629
629static char *new_game_desc(const game_params *params, random_state *rs, 630static char *new_game_desc(const game_params *params, random_state *rs,
630 char **aux, int interactive) 631 char **aux, bool interactive)
631{ 632{
632 int w = params->w, h = params->h, wh = w*h, k = params->k; 633 int w = params->w, h = params->h, wh = w*h, k = params->k;
633 unsigned char *grid; 634 unsigned char *grid;
@@ -681,9 +682,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
681 return NULL; 682 return NULL;
682} 683}
683 684
684static int game_can_format_as_text_now(const game_params *params) 685static bool game_can_format_as_text_now(const game_params *params)
685{ 686{
686 return TRUE; 687 return true;
687} 688}
688 689
689static char *game_text_format(const game_state *state) 690static char *game_text_format(const game_state *state)
@@ -803,9 +804,9 @@ static int game_status(const game_state *state)
803 return 0; 804 return 0;
804} 805}
805 806
806static int game_timing_state(const game_state *state, game_ui *ui) 807static bool game_timing_state(const game_state *state, game_ui *ui)
807{ 808{
808 return TRUE; 809 return true;
809} 810}
810 811
811static void game_print_size(const game_params *params, float *x, float *y) 812static void game_print_size(const game_params *params, float *x, float *y)
@@ -828,15 +829,15 @@ const struct game thegame = {
828 encode_params, 829 encode_params,
829 free_params, 830 free_params,
830 dup_params, 831 dup_params,
831 FALSE, game_configure, custom_params, 832 false, game_configure, custom_params,
832 validate_params, 833 validate_params,
833 new_game_desc, 834 new_game_desc,
834 validate_desc, 835 validate_desc,
835 new_game, 836 new_game,
836 dup_game, 837 dup_game,
837 free_game, 838 free_game,
838 FALSE, solve_game, 839 false, solve_game,
839 FALSE, game_can_format_as_text_now, game_text_format, 840 false, game_can_format_as_text_now, game_text_format,
840 new_ui, 841 new_ui,
841 free_ui, 842 free_ui,
842 encode_ui, 843 encode_ui,
@@ -853,8 +854,8 @@ const struct game thegame = {
853 game_anim_length, 854 game_anim_length,
854 game_flash_length, 855 game_flash_length,
855 game_status, 856 game_status,
856 FALSE, FALSE, game_print_size, game_print, 857 false, false, game_print_size, game_print,
857 FALSE, /* wants_statusbar */ 858 false, /* wants_statusbar */
858 FALSE, game_timing_state, 859 false, game_timing_state,
859 0, /* flags */ 860 0, /* flags */
860}; 861};
diff --git a/apps/plugins/puzzles/src/unfinished/slide.c b/apps/plugins/puzzles/src/unfinished/slide.c
index 504c4e95e5..5ad1237d58 100644
--- a/apps/plugins/puzzles/src/unfinished/slide.c
+++ b/apps/plugins/puzzles/src/unfinished/slide.c
@@ -128,7 +128,7 @@ struct game_params {
128 128
129struct game_immutable_state { 129struct game_immutable_state {
130 int refcount; 130 int refcount;
131 unsigned char *forcefield; 131 bool *forcefield;
132}; 132};
133 133
134struct game_solution { 134struct game_solution {
@@ -145,7 +145,7 @@ struct game_state {
145 int lastmoved, lastmoved_pos; /* for move counting */ 145 int lastmoved, lastmoved_pos; /* for move counting */
146 int movecount; 146 int movecount;
147 int completed; 147 int completed;
148 int cheated; 148 bool cheated;
149 struct game_immutable_state *imm; 149 struct game_immutable_state *imm;
150 struct game_solution *soln; 150 struct game_solution *soln;
151 int soln_index; 151 int soln_index;
@@ -168,13 +168,13 @@ static const struct game_params slide_presets[] = {
168 {8, 6, -1}, 168 {8, 6, -1},
169}; 169};
170 170
171static int game_fetch_preset(int i, char **name, game_params **params) 171static bool game_fetch_preset(int i, char **name, game_params **params)
172{ 172{
173 game_params *ret; 173 game_params *ret;
174 char str[80]; 174 char str[80];
175 175
176 if (i < 0 || i >= lenof(slide_presets)) 176 if (i < 0 || i >= lenof(slide_presets))
177 return FALSE; 177 return false;
178 178
179 ret = snew(game_params); 179 ret = snew(game_params);
180 *ret = slide_presets[i]; 180 *ret = slide_presets[i];
@@ -187,7 +187,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
187 187
188 *name = dupstr(str); 188 *name = dupstr(str);
189 *params = ret; 189 *params = ret;
190 return TRUE; 190 return true;
191} 191}
192 192
193static void free_params(game_params *params) 193static void free_params(game_params *params)
@@ -221,7 +221,7 @@ static void decode_params(game_params *params, char const *string)
221 } 221 }
222} 222}
223 223
224static char *encode_params(const game_params *params, int full) 224static char *encode_params(const game_params *params, bool full)
225{ 225{
226 char data[256]; 226 char data[256];
227 227
@@ -273,7 +273,7 @@ static game_params *custom_params(const config_item *cfg)
273 return ret; 273 return ret;
274} 274}
275 275
276static const char *validate_params(const game_params *params, int full) 276static const char *validate_params(const game_params *params, bool full)
277{ 277{
278 if (params->w > MAXWID) 278 if (params->w > MAXWID)
279 return "Width must be at most " STR(MAXWID); 279 return "Width must be at most " STR(MAXWID);
@@ -287,7 +287,7 @@ static const char *validate_params(const game_params *params, int full)
287} 287}
288 288
289static char *board_text_format(int w, int h, unsigned char *data, 289static char *board_text_format(int w, int h, unsigned char *data,
290 unsigned char *forcefield) 290 bool *forcefield)
291{ 291{
292 int wh = w*h; 292 int wh = w*h;
293 int *dsf = snew_dsf(wh); 293 int *dsf = snew_dsf(wh);
@@ -406,13 +406,14 @@ static struct board *newboard(int w, int h, unsigned char *data)
406 * which is a pointer to a dynamically allocated array. 406 * which is a pointer to a dynamically allocated array.
407 */ 407 */
408static int solve_board(int w, int h, unsigned char *board, 408static int solve_board(int w, int h, unsigned char *board,
409 unsigned char *forcefield, int tx, int ty, 409 bool *forcefield, int tx, int ty,
410 int movelimit, int **moveout) 410 int movelimit, int **moveout)
411{ 411{
412 int wh = w*h; 412 int wh = w*h;
413 struct board *b, *b2, *b3; 413 struct board *b, *b2, *b3;
414 int *next, *anchors, *which; 414 int *next, *which;
415 int *movereached, *movequeue, mqhead, mqtail; 415 bool *anchors, *movereached;
416 int *movequeue, mqhead, mqtail;
416 tree234 *sorted, *queue; 417 tree234 *sorted, *queue;
417 int i, j, dir; 418 int i, j, dir;
418 int qlen, lastdist; 419 int qlen, lastdist;
@@ -453,9 +454,9 @@ static int solve_board(int w, int h, unsigned char *board,
453 qlen = 1; 454 qlen = 1;
454 455
455 next = snewn(wh, int); 456 next = snewn(wh, int);
456 anchors = snewn(wh, int); 457 anchors = snewn(wh, bool);
457 which = snewn(wh, int); 458 which = snewn(wh, int);
458 movereached = snewn(wh, int); 459 movereached = snewn(wh, bool);
459 movequeue = snewn(wh, int); 460 movequeue = snewn(wh, int);
460 lastdist = -1; 461 lastdist = -1;
461 462
@@ -481,10 +482,10 @@ static int solve_board(int w, int h, unsigned char *board,
481 */ 482 */
482 for (i = 0; i < wh; i++) { 483 for (i = 0; i < wh; i++) {
483 next[i] = -1; 484 next[i] = -1;
484 anchors[i] = FALSE; 485 anchors[i] = false;
485 which[i] = -1; 486 which[i] = -1;
486 if (ISANCHOR(b->data[i])) { 487 if (ISANCHOR(b->data[i])) {
487 anchors[i] = TRUE; 488 anchors[i] = true;
488 which[i] = i; 489 which[i] = i;
489 } else if (ISDIST(b->data[i])) { 490 } else if (ISDIST(b->data[i])) {
490 j = i - b->data[i]; 491 j = i - b->data[i];
@@ -503,7 +504,7 @@ static int solve_board(int w, int h, unsigned char *board,
503 504
504 mqhead = mqtail = 0; 505 mqhead = mqtail = 0;
505 for (j = 0; j < wh; j++) 506 for (j = 0; j < wh; j++)
506 movereached[j] = FALSE; 507 movereached[j] = false;
507 movequeue[mqtail++] = i; 508 movequeue[mqtail++] = i;
508 while (mqhead < mqtail) { 509 while (mqhead < mqtail) {
509 int pos = movequeue[mqhead++]; 510 int pos = movequeue[mqhead++];
@@ -542,7 +543,7 @@ static int solve_board(int w, int h, unsigned char *board,
542 */ 543 */
543 if (movereached[newpos]) 544 if (movereached[newpos])
544 continue; 545 continue;
545 movereached[newpos] = TRUE; 546 movereached[newpos] = true;
546 movequeue[mqtail++] = newpos; 547 movequeue[mqtail++] = newpos;
547 548
548 /* 549 /*
@@ -637,11 +638,12 @@ static int solve_board(int w, int h, unsigned char *board,
637 638
638static void generate_board(int w, int h, int *rtx, int *rty, int *minmoves, 639static void generate_board(int w, int h, int *rtx, int *rty, int *minmoves,
639 random_state *rs, unsigned char **rboard, 640 random_state *rs, unsigned char **rboard,
640 unsigned char **rforcefield, int movelimit) 641 bool **rforcefield, int movelimit)
641{ 642{
642 int wh = w*h; 643 int wh = w*h;
643 unsigned char *board, *board2, *forcefield; 644 unsigned char *board, *board2;
644 unsigned char *tried_merge; 645 bool *forcefield;
646 bool *tried_merge;
645 int *dsf; 647 int *dsf;
646 int *list, nlist, pos; 648 int *list, nlist, pos;
647 int tx, ty; 649 int tx, ty;
@@ -653,17 +655,17 @@ static void generate_board(int w, int h, int *rtx, int *rty, int *minmoves,
653 * border of walls. 655 * border of walls.
654 */ 656 */
655 board = snewn(wh, unsigned char); 657 board = snewn(wh, unsigned char);
656 forcefield = snewn(wh, unsigned char); 658 forcefield = snewn(wh, bool);
657 board2 = snewn(wh, unsigned char); 659 board2 = snewn(wh, unsigned char);
658 memset(board, ANCHOR, wh); 660 memset(board, ANCHOR, wh);
659 memset(forcefield, FALSE, wh); 661 memset(forcefield, 0, wh * sizeof(bool));
660 for (i = 0; i < w; i++) 662 for (i = 0; i < w; i++)
661 board[i] = board[i+w*(h-1)] = WALL; 663 board[i] = board[i+w*(h-1)] = WALL;
662 for (i = 0; i < h; i++) 664 for (i = 0; i < h; i++)
663 board[i*w] = board[i*w+(w-1)] = WALL; 665 board[i*w] = board[i*w+(w-1)] = WALL;
664 666
665 tried_merge = snewn(wh * wh, unsigned char); 667 tried_merge = snewn(wh * wh, bool);
666 memset(tried_merge, 0, wh*wh); 668 memset(tried_merge, 0, wh*wh * sizeof(bool));
667 dsf = snew_dsf(wh); 669 dsf = snew_dsf(wh);
668 670
669 /* 671 /*
@@ -680,7 +682,8 @@ static void generate_board(int w, int h, int *rtx, int *rty, int *minmoves,
680 */ 682 */
681 tx = w-2; 683 tx = w-2;
682 ty = h-3; 684 ty = h-3;
683 forcefield[ty*w+tx+1] = forcefield[(ty+1)*w+tx+1] = TRUE; 685 forcefield[ty*w+tx+1] = true;
686 forcefield[(ty+1)*w+tx+1] = true;
684 board[ty*w+tx+1] = board[(ty+1)*w+tx+1] = EMPTY; 687 board[ty*w+tx+1] = board[(ty+1)*w+tx+1] = EMPTY;
685 688
686 /* 689 /*
@@ -799,7 +802,8 @@ static void generate_board(int w, int h, int *rtx, int *rty, int *minmoves,
799 * Didn't work. Revert the merge. 802 * Didn't work. Revert the merge.
800 */ 803 */
801 memcpy(board, board2, wh); 804 memcpy(board, board2, wh);
802 tried_merge[c1 * wh + c2] = tried_merge[c2 * wh + c1] = TRUE; 805 tried_merge[c1 * wh + c2] = true;
806 tried_merge[c2 * wh + c1] = true;
803 } else { 807 } else {
804 int c; 808 int c;
805 809
@@ -808,10 +812,10 @@ static void generate_board(int w, int h, int *rtx, int *rty, int *minmoves,
808 dsf_merge(dsf, c1, c2); 812 dsf_merge(dsf, c1, c2);
809 c = dsf_canonify(dsf, c1); 813 c = dsf_canonify(dsf, c1);
810 for (i = 0; i < wh; i++) 814 for (i = 0; i < wh; i++)
811 tried_merge[c*wh+i] = (tried_merge[c1*wh+i] | 815 tried_merge[c*wh+i] = (tried_merge[c1*wh+i] ||
812 tried_merge[c2*wh+i]); 816 tried_merge[c2*wh+i]);
813 for (i = 0; i < wh; i++) 817 for (i = 0; i < wh; i++)
814 tried_merge[i*wh+c] = (tried_merge[i*wh+c1] | 818 tried_merge[i*wh+c] = (tried_merge[i*wh+c1] ||
815 tried_merge[i*wh+c2]); 819 tried_merge[i*wh+c2]);
816 } 820 }
817 } 821 }
@@ -833,11 +837,12 @@ static void generate_board(int w, int h, int *rtx, int *rty, int *minmoves,
833 */ 837 */
834 838
835static char *new_game_desc(const game_params *params, random_state *rs, 839static char *new_game_desc(const game_params *params, random_state *rs,
836 char **aux, int interactive) 840 char **aux, bool interactive)
837{ 841{
838 int w = params->w, h = params->h, wh = w*h; 842 int w = params->w, h = params->h, wh = w*h;
839 int tx, ty, minmoves; 843 int tx, ty, minmoves;
840 unsigned char *board, *forcefield; 844 unsigned char *board;
845 bool *forcefield;
841 char *ret, *p; 846 char *ret, *p;
842 int i; 847 int i;
843 848
@@ -863,7 +868,8 @@ static char *new_game_desc(const game_params *params, random_state *rs,
863 i++; 868 i++;
864 } else { 869 } else {
865 int count = 1; 870 int count = 1;
866 int b = board[i], f = forcefield[i]; 871 int b = board[i];
872 bool f = forcefield[i];
867 int c = (b == ANCHOR ? 'a' : 873 int c = (b == ANCHOR ? 'a' :
868 b == MAINANCHOR ? 'm' : 874 b == MAINANCHOR ? 'm' :
869 b == EMPTY ? 'e' : 875 b == EMPTY ? 'e' :
@@ -889,12 +895,13 @@ static char *new_game_desc(const game_params *params, random_state *rs,
889static const char *validate_desc(const game_params *params, const char *desc) 895static const char *validate_desc(const game_params *params, const char *desc)
890{ 896{
891 int w = params->w, h = params->h, wh = w*h; 897 int w = params->w, h = params->h, wh = w*h;
892 int *active, *link; 898 bool *active;
899 int *link;
893 int mains = 0; 900 int mains = 0;
894 int i, tx, ty, minmoves; 901 int i, tx, ty, minmoves;
895 char *ret; 902 char *ret;
896 903
897 active = snewn(wh, int); 904 active = snewn(wh, bool);
898 link = snewn(wh, int); 905 link = snewn(wh, int);
899 i = 0; 906 i = 0;
900 907
@@ -904,7 +911,7 @@ static const char *validate_desc(const game_params *params, const char *desc)
904 goto done; 911 goto done;
905 } 912 }
906 link[i] = -1; 913 link[i] = -1;
907 active[i] = FALSE; 914 active[i] = false;
908 if (*desc == 'f' || *desc == 'F') { 915 if (*desc == 'f' || *desc == 'F') {
909 desc++; 916 desc++;
910 if (!*desc) { 917 if (!*desc) {
@@ -937,8 +944,8 @@ static const char *validate_desc(const game_params *params, const char *desc)
937 944
938 link[i] = i - dist; 945 link[i] = i - dist;
939 946
940 active[i] = TRUE; 947 active[i] = true;
941 active[link[i]] = FALSE; 948 active[link[i]] = false;
942 i++; 949 i++;
943 } else { 950 } else {
944 int c = *desc++; 951 int c = *desc++;
@@ -1011,17 +1018,17 @@ static game_state *new_game(midend *me, const game_params *params,
1011 state->movecount = 0; 1018 state->movecount = 0;
1012 state->imm = snew(struct game_immutable_state); 1019 state->imm = snew(struct game_immutable_state);
1013 state->imm->refcount = 1; 1020 state->imm->refcount = 1;
1014 state->imm->forcefield = snewn(wh, unsigned char); 1021 state->imm->forcefield = snewn(wh, bool);
1015 1022
1016 i = 0; 1023 i = 0;
1017 1024
1018 while (*desc && *desc != ',') { 1025 while (*desc && *desc != ',') {
1019 int f = FALSE; 1026 bool f = false;
1020 1027
1021 assert(i < wh); 1028 assert(i < wh);
1022 1029
1023 if (*desc == 'f') { 1030 if (*desc == 'f') {
1024 f = TRUE; 1031 f = true;
1025 desc++; 1032 desc++;
1026 assert(*desc); 1033 assert(*desc);
1027 } 1034 }
@@ -1072,7 +1079,7 @@ static game_state *new_game(midend *me, const game_params *params,
1072 else 1079 else
1073 state->completed = -1; 1080 state->completed = -1;
1074 1081
1075 state->cheated = FALSE; 1082 state->cheated = false;
1076 state->soln = NULL; 1083 state->soln = NULL;
1077 state->soln_index = -1; 1084 state->soln_index = -1;
1078 1085
@@ -1164,9 +1171,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1164 return ret; 1171 return ret;
1165} 1172}
1166 1173
1167static int game_can_format_as_text_now(const game_params *params) 1174static bool game_can_format_as_text_now(const game_params *params)
1168{ 1175{
1169 return TRUE; 1176 return true;
1170} 1177}
1171 1178
1172static char *game_text_format(const game_state *state) 1179static char *game_text_format(const game_state *state)
@@ -1176,11 +1183,11 @@ static char *game_text_format(const game_state *state)
1176} 1183}
1177 1184
1178struct game_ui { 1185struct game_ui {
1179 int dragging; 1186 bool dragging;
1180 int drag_anchor; 1187 int drag_anchor;
1181 int drag_offset_x, drag_offset_y; 1188 int drag_offset_x, drag_offset_y;
1182 int drag_currpos; 1189 int drag_currpos;
1183 unsigned char *reachable; 1190 bool *reachable;
1184 int *bfs_queue; /* used as scratch in interpret_move */ 1191 int *bfs_queue; /* used as scratch in interpret_move */
1185}; 1192};
1186 1193
@@ -1189,11 +1196,11 @@ static game_ui *new_ui(const game_state *state)
1189 int w = state->w, h = state->h, wh = w*h; 1196 int w = state->w, h = state->h, wh = w*h;
1190 game_ui *ui = snew(game_ui); 1197 game_ui *ui = snew(game_ui);
1191 1198
1192 ui->dragging = FALSE; 1199 ui->dragging = false;
1193 ui->drag_anchor = ui->drag_currpos = -1; 1200 ui->drag_anchor = ui->drag_currpos = -1;
1194 ui->drag_offset_x = ui->drag_offset_y = -1; 1201 ui->drag_offset_x = ui->drag_offset_y = -1;
1195 ui->reachable = snewn(wh, unsigned char); 1202 ui->reachable = snewn(wh, bool);
1196 memset(ui->reachable, 0, wh); 1203 memset(ui->reachable, 0, wh * sizeof(bool));
1197 ui->bfs_queue = snewn(wh, int); 1204 ui->bfs_queue = snewn(wh, int);
1198 1205
1199 return ui; 1206 return ui;
@@ -1235,7 +1242,7 @@ struct game_drawstate {
1235 int tilesize; 1242 int tilesize;
1236 int w, h; 1243 int w, h;
1237 unsigned long *grid; /* what's currently displayed */ 1244 unsigned long *grid; /* what's currently displayed */
1238 int started; 1245 bool started;
1239}; 1246};
1240 1247
1241static char *interpret_move(const game_state *state, game_ui *ui, 1248static char *interpret_move(const game_state *state, game_ui *ui,
@@ -1263,7 +1270,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1263 i -= state->board[i]; 1270 i -= state->board[i];
1264 assert(i >= 0 && i < wh); 1271 assert(i >= 0 && i < wh);
1265 1272
1266 ui->dragging = TRUE; 1273 ui->dragging = true;
1267 ui->drag_anchor = i; 1274 ui->drag_anchor = i;
1268 ui->drag_offset_x = tx - (i % w); 1275 ui->drag_offset_x = tx - (i % w);
1269 ui->drag_offset_y = ty - (i / w); 1276 ui->drag_offset_y = ty - (i / w);
@@ -1274,9 +1281,9 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1274 * the anchor, to find all the places to which this block 1281 * the anchor, to find all the places to which this block
1275 * can be dragged. 1282 * can be dragged.
1276 */ 1283 */
1277 memset(ui->reachable, FALSE, wh); 1284 memset(ui->reachable, 0, wh * sizeof(bool));
1278 qhead = qtail = 0; 1285 qhead = qtail = 0;
1279 ui->reachable[i] = TRUE; 1286 ui->reachable[i] = true;
1280 ui->bfs_queue[qtail++] = i; 1287 ui->bfs_queue[qtail++] = i;
1281 for (j = i; j < wh; j++) 1288 for (j = i; j < wh; j++)
1282 if (state->board[j] == DIST(j - i)) 1289 if (state->board[j] == DIST(j - i))
@@ -1334,7 +1341,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1334 * disqualifying this position, mark it as 1341 * disqualifying this position, mark it as
1335 * reachable for this drag. 1342 * reachable for this drag.
1336 */ 1343 */
1337 ui->reachable[newpos] = TRUE; 1344 ui->reachable[newpos] = true;
1338 ui->bfs_queue[qtail++] = newpos; 1345 ui->bfs_queue[qtail++] = newpos;
1339 } 1346 }
1340 } 1347 }
@@ -1390,10 +1397,10 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1390 } else 1397 } else
1391 str = ""; /* null move; just update the UI */ 1398 str = ""; /* null move; just update the UI */
1392 1399
1393 ui->dragging = FALSE; 1400 ui->dragging = false;
1394 ui->drag_anchor = ui->drag_currpos = -1; 1401 ui->drag_anchor = ui->drag_currpos = -1;
1395 ui->drag_offset_x = ui->drag_offset_y = -1; 1402 ui->drag_offset_x = ui->drag_offset_y = -1;
1396 memset(ui->reachable, 0, wh); 1403 memset(ui->reachable, 0, wh * sizeof(bool));
1397 1404
1398 return str; 1405 return str;
1399 } else if (button == ' ' && state->soln) { 1406 } else if (button == ' ' && state->soln) {
@@ -1415,14 +1422,14 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1415 return NULL; 1422 return NULL;
1416} 1423}
1417 1424
1418static int move_piece(int w, int h, const unsigned char *src, 1425static bool move_piece(int w, int h, const unsigned char *src,
1419 unsigned char *dst, unsigned char *ff, int from, int to) 1426 unsigned char *dst, bool *ff, int from, int to)
1420{ 1427{
1421 int wh = w*h; 1428 int wh = w*h;
1422 int i, j; 1429 int i, j;
1423 1430
1424 if (!ISANCHOR(dst[from])) 1431 if (!ISANCHOR(dst[from]))
1425 return FALSE; 1432 return false;
1426 1433
1427 /* 1434 /*
1428 * Scan to the far end of the piece's linked list. 1435 * Scan to the far end of the piece's linked list.
@@ -1444,15 +1451,15 @@ static int move_piece(int w, int h, const unsigned char *src,
1444 for (j = i; j >= 0; j = (ISDIST(src[j]) ? j - src[j] : -1)) { 1451 for (j = i; j >= 0; j = (ISDIST(src[j]) ? j - src[j] : -1)) {
1445 int jn = j + to - from; 1452 int jn = j + to - from;
1446 if (jn < 0 || jn >= wh) 1453 if (jn < 0 || jn >= wh)
1447 return FALSE; 1454 return false;
1448 if (dst[jn] == EMPTY && (!ff[jn] || src[from] == MAINANCHOR)) { 1455 if (dst[jn] == EMPTY && (!ff[jn] || src[from] == MAINANCHOR)) {
1449 dst[jn] = src[j]; 1456 dst[jn] = src[j];
1450 } else { 1457 } else {
1451 return FALSE; 1458 return false;
1452 } 1459 }
1453 } 1460 }
1454 1461
1455 return TRUE; 1462 return true;
1456} 1463}
1457 1464
1458static game_state *execute_move(const game_state *state, const char *move) 1465static game_state *execute_move(const game_state *state, const char *move)
@@ -1478,7 +1485,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1478 ret->soln->moves = NULL; 1485 ret->soln->moves = NULL;
1479 ret->soln->refcount = 1; 1486 ret->soln->refcount = 1;
1480 ret->soln_index = 0; 1487 ret->soln_index = 0;
1481 ret->cheated = TRUE; 1488 ret->cheated = true;
1482 1489
1483 movesize = 0; 1490 movesize = 0;
1484 move++; 1491 move++;
@@ -1673,7 +1680,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1673 ds->tilesize = 0; 1680 ds->tilesize = 0;
1674 ds->w = w; 1681 ds->w = w;
1675 ds->h = h; 1682 ds->h = h;
1676 ds->started = FALSE; 1683 ds->started = false;
1677 ds->grid = snewn(wh, unsigned long); 1684 ds->grid = snewn(wh, unsigned long);
1678 for (i = 0; i < wh; i++) 1685 for (i = 0; i < wh; i++)
1679 ds->grid[i] = ~(unsigned long)0; 1686 ds->grid[i] = ~(unsigned long)0;
@@ -2130,7 +2137,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2130 * background-colour rectangle covering the whole window. 2137 * background-colour rectangle covering the whole window.
2131 */ 2138 */
2132 draw_rect(dr, 0, 0, 10*ds->tilesize, 10*ds->tilesize, COL_BACKGROUND); 2139 draw_rect(dr, 0, 0, 10*ds->tilesize, 10*ds->tilesize, COL_BACKGROUND);
2133 ds->started = TRUE; 2140 ds->started = true;
2134 } 2141 }
2135 2142
2136 /* 2143 /*
@@ -2141,9 +2148,9 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
2141 board = snewn(wh, unsigned char); 2148 board = snewn(wh, unsigned char);
2142 memcpy(board, state->board, wh); 2149 memcpy(board, state->board, wh);
2143 if (ui->dragging) { 2150 if (ui->dragging) {
2144 int mpret = move_piece(w, h, state->board, board, 2151 bool mpret = move_piece(w, h, state->board, board,
2145 state->imm->forcefield, 2152 state->imm->forcefield,
2146 ui->drag_anchor, ui->drag_currpos); 2153 ui->drag_anchor, ui->drag_currpos);
2147 assert(mpret); 2154 assert(mpret);
2148 } 2155 }
2149 2156
@@ -2295,9 +2302,9 @@ static int game_status(const game_state *state)
2295 return state->completed ? +1 : 0; 2302 return state->completed ? +1 : 0;
2296} 2303}
2297 2304
2298static int game_timing_state(const game_state *state, game_ui *ui) 2305static bool game_timing_state(const game_state *state, game_ui *ui)
2299{ 2306{
2300 return TRUE; 2307 return true;
2301} 2308}
2302 2309
2303static void game_print_size(const game_params *params, float *x, float *y) 2310static void game_print_size(const game_params *params, float *x, float *y)
@@ -2320,15 +2327,15 @@ const struct game thegame = {
2320 encode_params, 2327 encode_params,
2321 free_params, 2328 free_params,
2322 dup_params, 2329 dup_params,
2323 TRUE, game_configure, custom_params, 2330 true, game_configure, custom_params,
2324 validate_params, 2331 validate_params,
2325 new_game_desc, 2332 new_game_desc,
2326 validate_desc, 2333 validate_desc,
2327 new_game, 2334 new_game,
2328 dup_game, 2335 dup_game,
2329 free_game, 2336 free_game,
2330 TRUE, solve_game, 2337 true, solve_game,
2331 TRUE, game_can_format_as_text_now, game_text_format, 2338 true, game_can_format_as_text_now, game_text_format,
2332 new_ui, 2339 new_ui,
2333 free_ui, 2340 free_ui,
2334 encode_ui, 2341 encode_ui,
@@ -2345,9 +2352,9 @@ const struct game thegame = {
2345 game_anim_length, 2352 game_anim_length,
2346 game_flash_length, 2353 game_flash_length,
2347 game_status, 2354 game_status,
2348 FALSE, FALSE, game_print_size, game_print, 2355 false, false, game_print_size, game_print,
2349 TRUE, /* wants_statusbar */ 2356 true, /* wants_statusbar */
2350 FALSE, game_timing_state, 2357 false, game_timing_state,
2351 0, /* flags */ 2358 0, /* flags */
2352}; 2359};
2353 2360
@@ -2359,8 +2366,9 @@ int main(int argc, char **argv)
2359{ 2366{
2360 game_params *p; 2367 game_params *p;
2361 game_state *s; 2368 game_state *s;
2362 char *id = NULL, *desc, *err; 2369 char *id = NULL, *desc;
2363 int count = FALSE; 2370 const char *err;
2371 bool count = false;
2364 int ret; 2372 int ret;
2365 int *moves; 2373 int *moves;
2366 2374
@@ -2368,11 +2376,11 @@ int main(int argc, char **argv)
2368 char *p = *++argv; 2376 char *p = *++argv;
2369 /* 2377 /*
2370 if (!strcmp(p, "-v")) { 2378 if (!strcmp(p, "-v")) {
2371 verbose = TRUE; 2379 verbose = true;
2372 } else 2380 } else
2373 */ 2381 */
2374 if (!strcmp(p, "-c")) { 2382 if (!strcmp(p, "-c")) {
2375 count = TRUE; 2383 count = true;
2376 } else if (*p == '-') { 2384 } else if (*p == '-') {
2377 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p); 2385 fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p);
2378 return 1; 2386 return 1;
@@ -2413,7 +2421,7 @@ int main(int argc, char **argv)
2413 return 0; 2421 return 0;
2414 } 2422 }
2415 while (1) { 2423 while (1) {
2416 int moveret; 2424 bool moveret;
2417 char *text = board_text_format(s->w, s->h, s->board, 2425 char *text = board_text_format(s->w, s->h, s->board,
2418 s->imm->forcefield); 2426 s->imm->forcefield);
2419 game_state *s2; 2427 game_state *s2;
diff --git a/apps/plugins/puzzles/src/unfinished/sokoban.c b/apps/plugins/puzzles/src/unfinished/sokoban.c
index a06ba7a662..7d42a12c5d 100644
--- a/apps/plugins/puzzles/src/unfinished/sokoban.c
+++ b/apps/plugins/puzzles/src/unfinished/sokoban.c
@@ -131,7 +131,7 @@ struct game_state {
131 game_params p; 131 game_params p;
132 unsigned char *grid; 132 unsigned char *grid;
133 int px, py; 133 int px, py;
134 int completed; 134 bool completed;
135}; 135};
136 136
137static game_params *default_params(void) 137static game_params *default_params(void)
@@ -162,14 +162,14 @@ static const struct game_params sokoban_presets[] = {
162 { 20, 16 }, 162 { 20, 16 },
163}; 163};
164 164
165static int game_fetch_preset(int i, char **name, game_params **params) 165static bool game_fetch_preset(int i, char **name, game_params **params)
166{ 166{
167 game_params p, *ret; 167 game_params p, *ret;
168 char *retname; 168 char *retname;
169 char namebuf[80]; 169 char namebuf[80];
170 170
171 if (i < 0 || i >= lenof(sokoban_presets)) 171 if (i < 0 || i >= lenof(sokoban_presets))
172 return FALSE; 172 return false;
173 173
174 p = sokoban_presets[i]; 174 p = sokoban_presets[i];
175 ret = dup_params(&p); 175 ret = dup_params(&p);
@@ -178,7 +178,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
178 178
179 *params = ret; 179 *params = ret;
180 *name = retname; 180 *name = retname;
181 return TRUE; 181 return true;
182} 182}
183 183
184static void decode_params(game_params *params, char const *string) 184static void decode_params(game_params *params, char const *string)
@@ -191,7 +191,7 @@ static void decode_params(game_params *params, char const *string)
191 } 191 }
192} 192}
193 193
194static char *encode_params(const game_params *params, int full) 194static char *encode_params(const game_params *params, bool full)
195{ 195{
196 char data[256]; 196 char data[256];
197 197
@@ -233,7 +233,7 @@ static game_params *custom_params(const config_item *cfg)
233 return ret; 233 return ret;
234} 234}
235 235
236static const char *validate_params(const game_params *params, int full) 236static const char *validate_params(const game_params *params, bool full)
237{ 237{
238 if (params->w < 4 || params->h < 4) 238 if (params->w < 4 || params->h < 4)
239 return "Width and height must both be at least 4"; 239 return "Width and height must both be at least 4";
@@ -300,7 +300,7 @@ static const char *validate_params(const game_params *params, int full)
300 */ 300 */
301 301
302static void sokoban_generate(int w, int h, unsigned char *grid, int moves, 302static void sokoban_generate(int w, int h, unsigned char *grid, int moves,
303 int nethack, random_state *rs) 303 bool nethack, random_state *rs)
304{ 304{
305 struct pull { 305 struct pull {
306 int ox, oy, nx, ny, score; 306 int ox, oy, nx, ny, score;
@@ -728,7 +728,7 @@ static void sokoban_generate(int w, int h, unsigned char *grid, int moves,
728} 728}
729 729
730static char *new_game_desc(const game_params *params, random_state *rs, 730static char *new_game_desc(const game_params *params, random_state *rs,
731 char **aux, int interactive) 731 char **aux, bool interactive)
732{ 732{
733 int w = params->w, h = params->h; 733 int w = params->w, h = params->h;
734 char *desc; 734 char *desc;
@@ -741,7 +741,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
741 * many moves to try? 741 * many moves to try?
742 */ 742 */
743 grid = snewn(w*h, unsigned char); 743 grid = snewn(w*h, unsigned char);
744 sokoban_generate(w, h, grid, w*h, FALSE, rs); 744 sokoban_generate(w, h, grid, w*h, false, rs);
745 745
746 desclen = descpos = descsize = 0; 746 desclen = descpos = descsize = 0;
747 desc = NULL; 747 desc = NULL;
@@ -849,7 +849,7 @@ static game_state *new_game(midend *me, const game_params *params,
849 state->p = *params; /* structure copy */ 849 state->p = *params; /* structure copy */
850 state->grid = snewn(w*h, unsigned char); 850 state->grid = snewn(w*h, unsigned char);
851 state->px = state->py = -1; 851 state->px = state->py = -1;
852 state->completed = FALSE; 852 state->completed = false;
853 853
854 i = 0; 854 i = 0;
855 855
@@ -904,9 +904,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
904 return NULL; 904 return NULL;
905} 905}
906 906
907static int game_can_format_as_text_now(const game_params *params) 907static bool game_can_format_as_text_now(const game_params *params)
908{ 908{
909 return TRUE; 909 return true;
910} 910}
911 911
912static char *game_text_format(const game_state *state) 912static char *game_text_format(const game_state *state)
@@ -940,7 +940,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
940struct game_drawstate { 940struct game_drawstate {
941 game_params p; 941 game_params p;
942 int tilesize; 942 int tilesize;
943 int started; 943 bool started;
944 unsigned short *grid; 944 unsigned short *grid;
945}; 945};
946 946
@@ -957,7 +957,7 @@ struct game_drawstate {
957 * subfunction. move_type() returns -1 for an illegal move, 0 for a 957 * subfunction. move_type() returns -1 for an illegal move, 0 for a
958 * movement, and 1 for a push. 958 * movement, and 1 for a push.
959 */ 959 */
960int move_type(game_state *state, int dx, int dy) 960int move_type(const game_state *state, int dx, int dy)
961{ 961{
962 int w = state->p.w, h = state->p.h; 962 int w = state->p.w, h = state->p.h;
963 int px = state->px, py = state->py; 963 int px = state->px, py = state->py;
@@ -1099,7 +1099,8 @@ static game_state *execute_move(const game_state *state, const char *move)
1099{ 1099{
1100 int w = state->p.w, h = state->p.h; 1100 int w = state->p.w, h = state->p.h;
1101 int px = state->px, py = state->py; 1101 int px = state->px, py = state->py;
1102 int dx, dy, nx, ny, nbx, nby, type, m, i, freebarrels, freetargets; 1102 int dx, dy, nx, ny, nbx, nby, type, m, i;
1103 bool freebarrels, freetargets;
1103 game_state *ret; 1104 game_state *ret;
1104 1105
1105 if (*move < '1' || *move == '5' || *move > '9' || move[1]) 1106 if (*move < '1' || *move == '5' || *move > '9' || move[1])
@@ -1158,20 +1159,20 @@ static game_state *execute_move(const game_state *state, const char *move)
1158 * no free target squares, and no deep pits at all. 1159 * no free target squares, and no deep pits at all.
1159 */ 1160 */
1160 if (!ret->completed) { 1161 if (!ret->completed) {
1161 freebarrels = FALSE; 1162 freebarrels = false;
1162 freetargets = FALSE; 1163 freetargets = false;
1163 for (i = 0; i < w*h; i++) { 1164 for (i = 0; i < w*h; i++) {
1164 int v = ret->grid[i]; 1165 int v = ret->grid[i];
1165 1166
1166 if (IS_BARREL(v) && !IS_ON_TARGET(v)) 1167 if (IS_BARREL(v) && !IS_ON_TARGET(v))
1167 freebarrels = TRUE; 1168 freebarrels = true;
1168 if (v == DEEP_PIT || v == PIT || 1169 if (v == DEEP_PIT || v == PIT ||
1169 (!IS_BARREL(v) && IS_ON_TARGET(v))) 1170 (!IS_BARREL(v) && IS_ON_TARGET(v)))
1170 freetargets = TRUE; 1171 freetargets = true;
1171 } 1172 }
1172 1173
1173 if (!freebarrels || !freetargets) 1174 if (!freebarrels || !freetargets)
1174 ret->completed = TRUE; 1175 ret->completed = true;
1175 } 1176 }
1176 1177
1177 return ret; 1178 return ret;
@@ -1261,7 +1262,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1261 ds->grid = snewn(w*h, unsigned short); 1262 ds->grid = snewn(w*h, unsigned short);
1262 for (i = 0; i < w*h; i++) 1263 for (i = 0; i < w*h; i++)
1263 ds->grid[i] = INVALID; 1264 ds->grid[i] = INVALID;
1264 ds->started = FALSE; 1265 ds->started = false;
1265 1266
1266 return ds; 1267 return ds;
1267} 1268}
@@ -1371,7 +1372,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1371 draw_line(dr, COORD(x), COORD(0), COORD(x), COORD(h), 1372 draw_line(dr, COORD(x), COORD(0), COORD(x), COORD(h),
1372 COL_LOWLIGHT); 1373 COL_LOWLIGHT);
1373 1374
1374 ds->started = TRUE; 1375 ds->started = true;
1375 } 1376 }
1376 1377
1377 /* 1378 /*
@@ -1419,9 +1420,9 @@ static int game_status(const game_state *state)
1419 return state->completed ? +1 : 0; 1420 return state->completed ? +1 : 0;
1420} 1421}
1421 1422
1422static int game_timing_state(const game_state *state, game_ui *ui) 1423static bool game_timing_state(const game_state *state, game_ui *ui)
1423{ 1424{
1424 return TRUE; 1425 return true;
1425} 1426}
1426 1427
1427static void game_print_size(const game_params *params, float *x, float *y) 1428static void game_print_size(const game_params *params, float *x, float *y)
@@ -1444,15 +1445,15 @@ const struct game thegame = {
1444 encode_params, 1445 encode_params,
1445 free_params, 1446 free_params,
1446 dup_params, 1447 dup_params,
1447 TRUE, game_configure, custom_params, 1448 true, game_configure, custom_params,
1448 validate_params, 1449 validate_params,
1449 new_game_desc, 1450 new_game_desc,
1450 validate_desc, 1451 validate_desc,
1451 new_game, 1452 new_game,
1452 dup_game, 1453 dup_game,
1453 free_game, 1454 free_game,
1454 FALSE, solve_game, 1455 false, solve_game,
1455 FALSE, game_can_format_as_text_now, game_text_format, 1456 false, game_can_format_as_text_now, game_text_format,
1456 new_ui, 1457 new_ui,
1457 free_ui, 1458 free_ui,
1458 encode_ui, 1459 encode_ui,
@@ -1469,8 +1470,8 @@ const struct game thegame = {
1469 game_anim_length, 1470 game_anim_length,
1470 game_flash_length, 1471 game_flash_length,
1471 game_status, 1472 game_status,
1472 FALSE, FALSE, game_print_size, game_print, 1473 false, false, game_print_size, game_print,
1473 FALSE, /* wants_statusbar */ 1474 false, /* wants_statusbar */
1474 FALSE, game_timing_state, 1475 false, game_timing_state,
1475 0, /* flags */ 1476 0, /* flags */
1476}; 1477};
diff --git a/apps/plugins/puzzles/src/unruly.c b/apps/plugins/puzzles/src/unruly.c
index 6506029d7e..e69c31b6b9 100644
--- a/apps/plugins/puzzles/src/unruly.c
+++ b/apps/plugins/puzzles/src/unruly.c
@@ -52,7 +52,7 @@
52#include "puzzles.h" 52#include "puzzles.h"
53 53
54#ifdef STANDALONE_SOLVER 54#ifdef STANDALONE_SOLVER
55int solver_verbose = FALSE; 55bool solver_verbose = false;
56#endif 56#endif
57 57
58enum { 58enum {
@@ -77,7 +77,7 @@ enum {
77 77
78struct game_params { 78struct game_params {
79 int w2, h2; /* full grid width and height respectively */ 79 int w2, h2; /* full grid width and height respectively */
80 int unique; /* should row and column patterns be unique? */ 80 bool unique; /* should row and column patterns be unique? */
81 int diff; 81 int diff;
82}; 82};
83#define DIFFLIST(A) \ 83#define DIFFLIST(A) \
@@ -95,12 +95,12 @@ static char const unruly_diffchars[] = DIFFLIST(ENCODE);
95#define DIFFCONFIG DIFFLIST(CONFIG) 95#define DIFFCONFIG DIFFLIST(CONFIG)
96 96
97static const struct game_params unruly_presets[] = { 97static const struct game_params unruly_presets[] = {
98 { 8, 8, FALSE, DIFF_EASY}, 98 { 8, 8, false, DIFF_EASY},
99 { 8, 8, FALSE, DIFF_NORMAL}, 99 { 8, 8, false, DIFF_NORMAL},
100 {10, 10, FALSE, DIFF_EASY}, 100 {10, 10, false, DIFF_EASY},
101 {10, 10, FALSE, DIFF_NORMAL}, 101 {10, 10, false, DIFF_NORMAL},
102 {14, 14, FALSE, DIFF_EASY}, 102 {14, 14, false, DIFF_EASY},
103 {14, 14, FALSE, DIFF_NORMAL} 103 {14, 14, false, DIFF_NORMAL}
104}; 104};
105 105
106#define DEFAULT_PRESET 0 106#define DEFAULT_PRESET 0
@@ -133,13 +133,18 @@ enum {
133#define FF_FLASH2 0x0800 133#define FF_FLASH2 0x0800
134#define FF_IMMUTABLE 0x1000 134#define FF_IMMUTABLE 0x1000
135 135
136typedef struct unruly_common {
137 int refcount;
138 bool *immutable;
139} unruly_common;
140
136struct game_state { 141struct game_state {
137 int w2, h2; 142 int w2, h2;
138 int unique; 143 bool unique;
139 char *grid; 144 char *grid;
140 unsigned char *immutable; 145 unruly_common *common;
141 146
142 int completed, cheated; 147 bool completed, cheated;
143}; 148};
144 149
145static game_params *default_params(void) 150static game_params *default_params(void)
@@ -151,13 +156,13 @@ static game_params *default_params(void)
151 return ret; 156 return ret;
152} 157}
153 158
154static int game_fetch_preset(int i, char **name, game_params **params) 159static bool game_fetch_preset(int i, char **name, game_params **params)
155{ 160{
156 game_params *ret; 161 game_params *ret;
157 char buf[80]; 162 char buf[80];
158 163
159 if (i < 0 || i >= lenof(unruly_presets)) 164 if (i < 0 || i >= lenof(unruly_presets))
160 return FALSE; 165 return false;
161 166
162 ret = snew(game_params); 167 ret = snew(game_params);
163 *ret = unruly_presets[i]; /* structure copy */ 168 *ret = unruly_presets[i]; /* structure copy */
@@ -166,7 +171,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
166 171
167 *name = dupstr(buf); 172 *name = dupstr(buf);
168 *params = ret; 173 *params = ret;
169 return TRUE; 174 return true;
170} 175}
171 176
172static void free_params(game_params *params) 177static void free_params(game_params *params)
@@ -185,7 +190,7 @@ static void decode_params(game_params *params, char const *string)
185{ 190{
186 char const *p = string; 191 char const *p = string;
187 192
188 params->unique = FALSE; 193 params->unique = false;
189 194
190 params->w2 = atoi(p); 195 params->w2 = atoi(p);
191 while (*p && isdigit((unsigned char)*p)) p++; 196 while (*p && isdigit((unsigned char)*p)) p++;
@@ -199,7 +204,7 @@ static void decode_params(game_params *params, char const *string)
199 204
200 if (*p == 'u') { 205 if (*p == 'u') {
201 p++; 206 p++;
202 params->unique = TRUE; 207 params->unique = true;
203 } 208 }
204 209
205 if (*p == 'd') { 210 if (*p == 'd') {
@@ -216,7 +221,7 @@ static void decode_params(game_params *params, char const *string)
216 } 221 }
217} 222}
218 223
219static char *encode_params(const game_params *params, int full) 224static char *encode_params(const game_params *params, bool full)
220{ 225{
221 char buf[80]; 226 char buf[80];
222 227
@@ -273,7 +278,7 @@ static game_params *custom_params(const config_item *cfg)
273 return ret; 278 return ret;
274} 279}
275 280
276static const char *validate_params(const game_params *params, int full) 281static const char *validate_params(const game_params *params, bool full)
277{ 282{
278 if ((params->w2 & 1) || (params->h2 & 1)) 283 if ((params->w2 & 1) || (params->h2 & 1))
279 return "Width and height must both be even"; 284 return "Width and height must both be even";
@@ -344,7 +349,7 @@ static const char *validate_desc(const game_params *params, const char *desc)
344 return NULL; 349 return NULL;
345} 350}
346 351
347static game_state *blank_state(int w2, int h2, int unique) 352static game_state *blank_state(int w2, int h2, bool unique)
348{ 353{
349 game_state *state = snew(game_state); 354 game_state *state = snew(game_state);
350 int s = w2 * h2; 355 int s = w2 * h2;
@@ -353,12 +358,14 @@ static game_state *blank_state(int w2, int h2, int unique)
353 state->h2 = h2; 358 state->h2 = h2;
354 state->unique = unique; 359 state->unique = unique;
355 state->grid = snewn(s, char); 360 state->grid = snewn(s, char);
356 state->immutable = snewn(s, unsigned char); 361 state->common = snew(unruly_common);
362 state->common->refcount = 1;
363 state->common->immutable = snewn(s, bool);
357 364
358 memset(state->grid, EMPTY, s); 365 memset(state->grid, EMPTY, s);
359 memset(state->immutable, FALSE, s); 366 memset(state->common->immutable, 0, s*sizeof(bool));
360 367
361 state->completed = state->cheated = FALSE; 368 state->completed = state->cheated = false;
362 369
363 return state; 370 return state;
364} 371}
@@ -379,14 +386,14 @@ static game_state *new_game(midend *me, const game_params *params,
379 pos += (*p - 'a'); 386 pos += (*p - 'a');
380 if (pos < s) { 387 if (pos < s) {
381 state->grid[pos] = N_ZERO; 388 state->grid[pos] = N_ZERO;
382 state->immutable[pos] = TRUE; 389 state->common->immutable[pos] = true;
383 } 390 }
384 pos++; 391 pos++;
385 } else if (*p >= 'A' && *p < 'Z') { 392 } else if (*p >= 'A' && *p < 'Z') {
386 pos += (*p - 'A'); 393 pos += (*p - 'A');
387 if (pos < s) { 394 if (pos < s) {
388 state->grid[pos] = N_ONE; 395 state->grid[pos] = N_ONE;
389 state->immutable[pos] = TRUE; 396 state->common->immutable[pos] = true;
390 } 397 }
391 pos++; 398 pos++;
392 } else if (*p == 'Z' || *p == 'z') { 399 } else if (*p == 'Z' || *p == 'z') {
@@ -409,7 +416,8 @@ static game_state *dup_game(const game_state *state)
409 game_state *ret = blank_state(w2, h2, state->unique); 416 game_state *ret = blank_state(w2, h2, state->unique);
410 417
411 memcpy(ret->grid, state->grid, s); 418 memcpy(ret->grid, state->grid, s);
412 memcpy(ret->immutable, state->immutable, s); 419 ret->common = state->common;
420 ret->common->refcount++;
413 421
414 ret->completed = state->completed; 422 ret->completed = state->completed;
415 ret->cheated = state->cheated; 423 ret->cheated = state->cheated;
@@ -420,14 +428,17 @@ static game_state *dup_game(const game_state *state)
420static void free_game(game_state *state) 428static void free_game(game_state *state)
421{ 429{
422 sfree(state->grid); 430 sfree(state->grid);
423 sfree(state->immutable); 431 if (--state->common->refcount == 0) {
432 sfree(state->common->immutable);
433 sfree(state->common);
434 }
424 435
425 sfree(state); 436 sfree(state);
426} 437}
427 438
428static int game_can_format_as_text_now(const game_params *params) 439static bool game_can_format_as_text_now(const game_params *params)
429{ 440{
430 return TRUE; 441 return true;
431} 442}
432 443
433static char *game_text_format(const game_state *state) 444static char *game_text_format(const game_state *state)
@@ -517,7 +528,7 @@ static void unruly_free_scratch(struct unruly_scratch *scratch)
517} 528}
518 529
519static int unruly_solver_check_threes(game_state *state, int *rowcount, 530static int unruly_solver_check_threes(game_state *state, int *rowcount,
520 int *colcount, int horizontal, 531 int *colcount, bool horizontal,
521 char check, char block) 532 char check, char block)
522{ 533{
523 int w2 = state->w2, h2 = state->h2; 534 int w2 = state->w2, h2 = state->h2;
@@ -594,23 +605,23 @@ static int unruly_solver_check_all_threes(game_state *state,
594 605
595 ret += 606 ret +=
596 unruly_solver_check_threes(state, scratch->zeros_rows, 607 unruly_solver_check_threes(state, scratch->zeros_rows,
597 scratch->zeros_cols, TRUE, N_ONE, N_ZERO); 608 scratch->zeros_cols, true, N_ONE, N_ZERO);
598 ret += 609 ret +=
599 unruly_solver_check_threes(state, scratch->ones_rows, 610 unruly_solver_check_threes(state, scratch->ones_rows,
600 scratch->ones_cols, TRUE, N_ZERO, N_ONE); 611 scratch->ones_cols, true, N_ZERO, N_ONE);
601 ret += 612 ret +=
602 unruly_solver_check_threes(state, scratch->zeros_rows, 613 unruly_solver_check_threes(state, scratch->zeros_rows,
603 scratch->zeros_cols, FALSE, N_ONE, 614 scratch->zeros_cols, false, N_ONE,
604 N_ZERO); 615 N_ZERO);
605 ret += 616 ret +=
606 unruly_solver_check_threes(state, scratch->ones_rows, 617 unruly_solver_check_threes(state, scratch->ones_rows,
607 scratch->ones_cols, FALSE, N_ZERO, N_ONE); 618 scratch->ones_cols, false, N_ZERO, N_ONE);
608 619
609 return ret; 620 return ret;
610} 621}
611 622
612static int unruly_solver_check_uniques(game_state *state, int *rowcount, 623static int unruly_solver_check_uniques(game_state *state, int *rowcount,
613 int horizontal, char check, char block, 624 bool horizontal, char check, char block,
614 struct unruly_scratch *scratch) 625 struct unruly_scratch *scratch)
615{ 626{
616 int w2 = state->w2, h2 = state->h2; 627 int w2 = state->w2, h2 = state->h2;
@@ -680,18 +691,18 @@ static int unruly_solver_check_all_uniques(game_state *state,
680 int ret = 0; 691 int ret = 0;
681 692
682 ret += unruly_solver_check_uniques(state, scratch->ones_rows, 693 ret += unruly_solver_check_uniques(state, scratch->ones_rows,
683 TRUE, N_ONE, N_ZERO, scratch); 694 true, N_ONE, N_ZERO, scratch);
684 ret += unruly_solver_check_uniques(state, scratch->zeros_rows, 695 ret += unruly_solver_check_uniques(state, scratch->zeros_rows,
685 TRUE, N_ZERO, N_ONE, scratch); 696 true, N_ZERO, N_ONE, scratch);
686 ret += unruly_solver_check_uniques(state, scratch->ones_cols, 697 ret += unruly_solver_check_uniques(state, scratch->ones_cols,
687 FALSE, N_ONE, N_ZERO, scratch); 698 false, N_ONE, N_ZERO, scratch);
688 ret += unruly_solver_check_uniques(state, scratch->zeros_cols, 699 ret += unruly_solver_check_uniques(state, scratch->zeros_cols,
689 FALSE, N_ZERO, N_ONE, scratch); 700 false, N_ZERO, N_ONE, scratch);
690 701
691 return ret; 702 return ret;
692} 703}
693 704
694static int unruly_solver_fill_row(game_state *state, int i, int horizontal, 705static int unruly_solver_fill_row(game_state *state, int i, bool horizontal,
695 int *rowcount, int *colcount, char fill) 706 int *rowcount, int *colcount, char fill)
696{ 707{
697 int ret = 0; 708 int ret = 0;
@@ -733,7 +744,7 @@ static int unruly_solver_fill_row(game_state *state, int i, int horizontal,
733} 744}
734 745
735static int unruly_solver_check_complete_nums(game_state *state, 746static int unruly_solver_check_complete_nums(game_state *state,
736 int *complete, int horizontal, 747 int *complete, bool horizontal,
737 int *rowcount, int *colcount, 748 int *rowcount, int *colcount,
738 char fill) 749 char fill)
739{ 750{
@@ -768,19 +779,19 @@ static int unruly_solver_check_all_complete_nums(game_state *state,
768 int ret = 0; 779 int ret = 0;
769 780
770 ret += 781 ret +=
771 unruly_solver_check_complete_nums(state, scratch->ones_rows, TRUE, 782 unruly_solver_check_complete_nums(state, scratch->ones_rows, true,
772 scratch->zeros_rows, 783 scratch->zeros_rows,
773 scratch->zeros_cols, N_ZERO); 784 scratch->zeros_cols, N_ZERO);
774 ret += 785 ret +=
775 unruly_solver_check_complete_nums(state, scratch->ones_cols, FALSE, 786 unruly_solver_check_complete_nums(state, scratch->ones_cols, false,
776 scratch->zeros_rows, 787 scratch->zeros_rows,
777 scratch->zeros_cols, N_ZERO); 788 scratch->zeros_cols, N_ZERO);
778 ret += 789 ret +=
779 unruly_solver_check_complete_nums(state, scratch->zeros_rows, TRUE, 790 unruly_solver_check_complete_nums(state, scratch->zeros_rows, true,
780 scratch->ones_rows, 791 scratch->ones_rows,
781 scratch->ones_cols, N_ONE); 792 scratch->ones_cols, N_ONE);
782 ret += 793 ret +=
783 unruly_solver_check_complete_nums(state, scratch->zeros_cols, FALSE, 794 unruly_solver_check_complete_nums(state, scratch->zeros_cols, false,
784 scratch->ones_rows, 795 scratch->ones_rows,
785 scratch->ones_cols, N_ONE); 796 scratch->ones_cols, N_ONE);
786 797
@@ -788,7 +799,7 @@ static int unruly_solver_check_all_complete_nums(game_state *state,
788} 799}
789 800
790static int unruly_solver_check_near_complete(game_state *state, 801static int unruly_solver_check_near_complete(game_state *state,
791 int *complete, int horizontal, 802 int *complete, bool horizontal,
792 int *rowcount, int *colcount, 803 int *rowcount, int *colcount,
793 char fill) 804 char fill)
794{ 805{
@@ -928,26 +939,26 @@ static int unruly_solver_check_all_near_complete(game_state *state,
928 int ret = 0; 939 int ret = 0;
929 940
930 ret += 941 ret +=
931 unruly_solver_check_near_complete(state, scratch->ones_rows, TRUE, 942 unruly_solver_check_near_complete(state, scratch->ones_rows, true,
932 scratch->zeros_rows, 943 scratch->zeros_rows,
933 scratch->zeros_cols, N_ZERO); 944 scratch->zeros_cols, N_ZERO);
934 ret += 945 ret +=
935 unruly_solver_check_near_complete(state, scratch->ones_cols, FALSE, 946 unruly_solver_check_near_complete(state, scratch->ones_cols, false,
936 scratch->zeros_rows, 947 scratch->zeros_rows,
937 scratch->zeros_cols, N_ZERO); 948 scratch->zeros_cols, N_ZERO);
938 ret += 949 ret +=
939 unruly_solver_check_near_complete(state, scratch->zeros_rows, TRUE, 950 unruly_solver_check_near_complete(state, scratch->zeros_rows, true,
940 scratch->ones_rows, 951 scratch->ones_rows,
941 scratch->ones_cols, N_ONE); 952 scratch->ones_cols, N_ONE);
942 ret += 953 ret +=
943 unruly_solver_check_near_complete(state, scratch->zeros_cols, FALSE, 954 unruly_solver_check_near_complete(state, scratch->zeros_cols, false,
944 scratch->ones_rows, 955 scratch->ones_rows,
945 scratch->ones_cols, N_ONE); 956 scratch->ones_cols, N_ONE);
946 957
947 return ret; 958 return ret;
948} 959}
949 960
950static int unruly_validate_rows(const game_state *state, int horizontal, 961static int unruly_validate_rows(const game_state *state, bool horizontal,
951 char check, int *errors) 962 char check, int *errors)
952{ 963{
953 int w2 = state->w2, h2 = state->h2; 964 int w2 = state->w2, h2 = state->h2;
@@ -987,7 +998,7 @@ static int unruly_validate_rows(const game_state *state, int horizontal,
987 return ret; 998 return ret;
988} 999}
989 1000
990static int unruly_validate_unique(const game_state *state, int horizontal, 1001static int unruly_validate_unique(const game_state *state, bool horizontal,
991 int *errors) 1002 int *errors)
992{ 1003{
993 int w2 = state->w2, h2 = state->h2; 1004 int w2 = state->w2, h2 = state->h2;
@@ -1011,11 +1022,11 @@ static int unruly_validate_unique(const game_state *state, int horizontal,
1011 if (nfull != nc) 1022 if (nfull != nc)
1012 continue; 1023 continue;
1013 for (r2 = r+1; r2 < nr; r2++) { 1024 for (r2 = r+1; r2 < nr; r2++) {
1014 int match = TRUE; 1025 bool match = true;
1015 for (c = 0; c < nc; c++) 1026 for (c = 0; c < nc; c++)
1016 if (state->grid[r*rmult + c*cmult] != 1027 if (state->grid[r*rmult + c*cmult] !=
1017 state->grid[r2*rmult + c*cmult]) 1028 state->grid[r2*rmult + c*cmult])
1018 match = FALSE; 1029 match = false;
1019 if (match) { 1030 if (match) {
1020 if (errors) { 1031 if (errors) {
1021 for (c = 0; c < nc; c++) { 1032 for (c = 0; c < nc; c++) {
@@ -1035,14 +1046,14 @@ static int unruly_validate_all_rows(const game_state *state, int *errors)
1035{ 1046{
1036 int errcount = 0; 1047 int errcount = 0;
1037 1048
1038 errcount += unruly_validate_rows(state, TRUE, N_ONE, errors); 1049 errcount += unruly_validate_rows(state, true, N_ONE, errors);
1039 errcount += unruly_validate_rows(state, FALSE, N_ONE, errors); 1050 errcount += unruly_validate_rows(state, false, N_ONE, errors);
1040 errcount += unruly_validate_rows(state, TRUE, N_ZERO, errors); 1051 errcount += unruly_validate_rows(state, true, N_ZERO, errors);
1041 errcount += unruly_validate_rows(state, FALSE, N_ZERO, errors); 1052 errcount += unruly_validate_rows(state, false, N_ZERO, errors);
1042 1053
1043 if (state->unique) { 1054 if (state->unique) {
1044 errcount += unruly_validate_unique(state, TRUE, errors); 1055 errcount += unruly_validate_unique(state, true, errors);
1045 errcount += unruly_validate_unique(state, FALSE, errors); 1056 errcount += unruly_validate_unique(state, false, errors);
1046 } 1057 }
1047 1058
1048 if (errcount) 1059 if (errcount)
@@ -1051,63 +1062,63 @@ static int unruly_validate_all_rows(const game_state *state, int *errors)
1051} 1062}
1052 1063
1053static int unruly_validate_counts(const game_state *state, 1064static int unruly_validate_counts(const game_state *state,
1054 struct unruly_scratch *scratch, int *errors) 1065 struct unruly_scratch *scratch, bool *errors)
1055{ 1066{
1056 int w2 = state->w2, h2 = state->h2; 1067 int w2 = state->w2, h2 = state->h2;
1057 int w = w2/2, h = h2/2; 1068 int w = w2/2, h = h2/2;
1058 char below = FALSE; 1069 bool below = false;
1059 char above = FALSE; 1070 bool above = false;
1060 int i; 1071 int i;
1061 1072
1062 /* See if all rows/columns are satisfied. If one is exceeded, 1073 /* See if all rows/columns are satisfied. If one is exceeded,
1063 * mark it as an error (if required) 1074 * mark it as an error (if required)
1064 */ 1075 */
1065 1076
1066 char hasscratch = TRUE; 1077 bool hasscratch = true;
1067 if (!scratch) { 1078 if (!scratch) {
1068 scratch = unruly_new_scratch(state); 1079 scratch = unruly_new_scratch(state);
1069 hasscratch = FALSE; 1080 hasscratch = false;
1070 } 1081 }
1071 1082
1072 for (i = 0; i < w2; i++) { 1083 for (i = 0; i < w2; i++) {
1073 if (scratch->ones_cols[i] < h) 1084 if (scratch->ones_cols[i] < h)
1074 below = TRUE; 1085 below = true;
1075 if (scratch->zeros_cols[i] < h) 1086 if (scratch->zeros_cols[i] < h)
1076 below = TRUE; 1087 below = true;
1077 1088
1078 if (scratch->ones_cols[i] > h) { 1089 if (scratch->ones_cols[i] > h) {
1079 above = TRUE; 1090 above = true;
1080 if (errors) 1091 if (errors)
1081 errors[2*h2 + i] = TRUE; 1092 errors[2*h2 + i] = true;
1082 } else if (errors) 1093 } else if (errors)
1083 errors[2*h2 + i] = FALSE; 1094 errors[2*h2 + i] = false;
1084 1095
1085 if (scratch->zeros_cols[i] > h) { 1096 if (scratch->zeros_cols[i] > h) {
1086 above = TRUE; 1097 above = true;
1087 if (errors) 1098 if (errors)
1088 errors[2*h2 + w2 + i] = TRUE; 1099 errors[2*h2 + w2 + i] = true;
1089 } else if (errors) 1100 } else if (errors)
1090 errors[2*h2 + w2 + i] = FALSE; 1101 errors[2*h2 + w2 + i] = false;
1091 } 1102 }
1092 for (i = 0; i < h2; i++) { 1103 for (i = 0; i < h2; i++) {
1093 if (scratch->ones_rows[i] < w) 1104 if (scratch->ones_rows[i] < w)
1094 below = TRUE; 1105 below = true;
1095 if (scratch->zeros_rows[i] < w) 1106 if (scratch->zeros_rows[i] < w)
1096 below = TRUE; 1107 below = true;
1097 1108
1098 if (scratch->ones_rows[i] > w) { 1109 if (scratch->ones_rows[i] > w) {
1099 above = TRUE; 1110 above = true;
1100 if (errors) 1111 if (errors)
1101 errors[i] = TRUE; 1112 errors[i] = true;
1102 } else if (errors) 1113 } else if (errors)
1103 errors[i] = FALSE; 1114 errors[i] = false;
1104 1115
1105 if (scratch->zeros_rows[i] > w) { 1116 if (scratch->zeros_rows[i] > w) {
1106 above = TRUE; 1117 above = true;
1107 if (errors) 1118 if (errors)
1108 errors[h2 + i] = TRUE; 1119 errors[h2 + i] = true;
1109 } else if (errors) 1120 } else if (errors)
1110 errors[h2 + i] = FALSE; 1121 errors[h2 + i] = false;
1111 } 1122 }
1112 1123
1113 if (!hasscratch) 1124 if (!hasscratch)
@@ -1121,7 +1132,7 @@ static int unruly_solve_game(game_state *state,
1121{ 1132{
1122 int done, maxdiff = -1; 1133 int done, maxdiff = -1;
1123 1134
1124 while (TRUE) { 1135 while (true) {
1125 done = 0; 1136 done = 0;
1126 1137
1127 /* Check for impending 3's */ 1138 /* Check for impending 3's */
@@ -1215,8 +1226,8 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1215 * Generator * 1226 * Generator *
1216 * ********* */ 1227 * ********* */
1217 1228
1218static int unruly_fill_game(game_state *state, struct unruly_scratch *scratch, 1229static bool unruly_fill_game(game_state *state, struct unruly_scratch *scratch,
1219 random_state *rs) 1230 random_state *rs)
1220{ 1231{
1221 1232
1222 int w2 = state->w2, h2 = state->h2; 1233 int w2 = state->w2, h2 = state->h2;
@@ -1263,17 +1274,17 @@ static int unruly_fill_game(game_state *state, struct unruly_scratch *scratch,
1263 1274
1264 if (unruly_validate_all_rows(state, NULL) != 0 1275 if (unruly_validate_all_rows(state, NULL) != 0
1265 || unruly_validate_counts(state, scratch, NULL) != 0) 1276 || unruly_validate_counts(state, scratch, NULL) != 0)
1266 return FALSE; 1277 return false;
1267 1278
1268 return TRUE; 1279 return true;
1269} 1280}
1270 1281
1271static char *new_game_desc(const game_params *params, random_state *rs, 1282static char *new_game_desc(const game_params *params, random_state *rs,
1272 char **aux, int interactive) 1283 char **aux, bool interactive)
1273{ 1284{
1274#ifdef STANDALONE_SOLVER 1285#ifdef STANDALONE_SOLVER
1275 char *debug; 1286 char *debug;
1276 int temp_verbose = FALSE; 1287 bool temp_verbose = false;
1277#endif 1288#endif
1278 1289
1279 int w2 = params->w2, h2 = params->h2; 1290 int w2 = params->w2, h2 = params->h2;
@@ -1289,7 +1300,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
1289 1300
1290 while (1) { 1301 while (1) {
1291 1302
1292 while (TRUE) { 1303 while (true) {
1293 attempts++; 1304 attempts++;
1294 state = blank_state(w2, h2, params->unique); 1305 state = blank_state(w2, h2, params->unique);
1295 scratch = unruly_new_scratch(state); 1306 scratch = unruly_new_scratch(state);
@@ -1307,7 +1318,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
1307 sfree(debug); 1318 sfree(debug);
1308 1319
1309 temp_verbose = solver_verbose; 1320 temp_verbose = solver_verbose;
1310 solver_verbose = FALSE; 1321 solver_verbose = false;
1311 } 1322 }
1312#endif 1323#endif
1313 1324
@@ -1348,7 +1359,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
1348 1359
1349#ifdef STANDALONE_SOLVER 1360#ifdef STANDALONE_SOLVER
1350 if (temp_verbose) { 1361 if (temp_verbose) {
1351 solver_verbose = TRUE; 1362 solver_verbose = true;
1352 1363
1353 printf("Final puzzle:\n"); 1364 printf("Final puzzle:\n");
1354 debug = game_text_format(state); 1365 debug = game_text_format(state);
@@ -1361,7 +1372,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
1361 * See if the game has accidentally come out too easy. 1372 * See if the game has accidentally come out too easy.
1362 */ 1373 */
1363 if (params->diff > 0) { 1374 if (params->diff > 0) {
1364 int ok; 1375 bool ok;
1365 game_state *solver; 1376 game_state *solver;
1366 1377
1367 solver = dup_game(state); 1378 solver = dup_game(state);
@@ -1369,7 +1380,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
1369 1380
1370 unruly_solve_game(solver, scratch, params->diff - 1); 1381 unruly_solve_game(solver, scratch, params->diff - 1);
1371 1382
1372 ok = unruly_validate_counts(solver, scratch, NULL); 1383 ok = unruly_validate_counts(solver, scratch, NULL) > 0;
1373 1384
1374 free_game(solver); 1385 free_game(solver);
1375 unruly_free_scratch(scratch); 1386 unruly_free_scratch(scratch);
@@ -1420,7 +1431,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
1420 1431
1421struct game_ui { 1432struct game_ui {
1422 int cx, cy; 1433 int cx, cy;
1423 char cursor; 1434 bool cursor;
1424}; 1435};
1425 1436
1426static game_ui *new_ui(const game_state *state) 1437static game_ui *new_ui(const game_state *state)
@@ -1428,7 +1439,7 @@ static game_ui *new_ui(const game_state *state)
1428 game_ui *ret = snew(game_ui); 1439 game_ui *ret = snew(game_ui);
1429 1440
1430 ret->cx = ret->cy = 0; 1441 ret->cx = ret->cy = 0;
1431 ret->cursor = FALSE; 1442 ret->cursor = false;
1432 1443
1433 return ret; 1444 return ret;
1434} 1445}
@@ -1455,10 +1466,10 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1455struct game_drawstate { 1466struct game_drawstate {
1456 int tilesize; 1467 int tilesize;
1457 int w2, h2; 1468 int w2, h2;
1458 int started; 1469 bool started;
1459 1470
1460 int *gridfs; 1471 int *gridfs;
1461 int *rowfs; 1472 bool *rowfs;
1462 1473
1463 int *grid; 1474 int *grid;
1464}; 1475};
@@ -1474,10 +1485,10 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
1474 ds->tilesize = 0; 1485 ds->tilesize = 0;
1475 ds->w2 = w2; 1486 ds->w2 = w2;
1476 ds->h2 = h2; 1487 ds->h2 = h2;
1477 ds->started = FALSE; 1488 ds->started = false;
1478 1489
1479 ds->gridfs = snewn(s, int); 1490 ds->gridfs = snewn(s, int);
1480 ds->rowfs = snewn(2 * (w2 + h2), int); 1491 ds->rowfs = snewn(2 * (w2 + h2), bool);
1481 1492
1482 ds->grid = snewn(s, int); 1493 ds->grid = snewn(s, int);
1483 for (i = 0; i < s; i++) 1494 for (i = 0; i < s; i++)
@@ -1518,15 +1529,15 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1518 && oy >= (ds->tilesize / 2) && gy < h2) { 1529 && oy >= (ds->tilesize / 2) && gy < h2) {
1519 hx = gx; 1530 hx = gx;
1520 hy = gy; 1531 hy = gy;
1521 ui->cursor = FALSE; 1532 ui->cursor = false;
1522 } else 1533 } else
1523 return NULL; 1534 return NULL;
1524 } 1535 }
1525 1536
1526 /* Keyboard move */ 1537 /* Keyboard move */
1527 if (IS_CURSOR_MOVE(button)) { 1538 if (IS_CURSOR_MOVE(button)) {
1528 move_cursor(button, &ui->cx, &ui->cy, w2, h2, 0); 1539 move_cursor(button, &ui->cx, &ui->cy, w2, h2, false);
1529 ui->cursor = TRUE; 1540 ui->cursor = true;
1530 return UI_UPDATE; 1541 return UI_UPDATE;
1531 } 1542 }
1532 1543
@@ -1539,7 +1550,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1539 char buf[80]; 1550 char buf[80];
1540 char c, i; 1551 char c, i;
1541 1552
1542 if (state->immutable[hy * w2 + hx]) 1553 if (state->common->immutable[hy * w2 + hx])
1543 return NULL; 1554 return NULL;
1544 1555
1545 c = '-'; 1556 c = '-';
@@ -1595,7 +1606,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1595 p++; 1606 p++;
1596 } 1607 }
1597 1608
1598 ret->completed = ret->cheated = TRUE; 1609 ret->completed = ret->cheated = true;
1599 return ret; 1610 return ret;
1600 } else if (move[0] == 'P' 1611 } else if (move[0] == 'P'
1601 && sscanf(move + 1, "%c,%d,%d", &c, &x, &y) == 3 && x >= 0 1612 && sscanf(move + 1, "%c,%d,%d", &c, &x, &y) == 3 && x >= 0
@@ -1604,7 +1615,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1604 ret = dup_game(state); 1615 ret = dup_game(state);
1605 i = y * w2 + x; 1616 i = y * w2 + x;
1606 1617
1607 if (state->immutable[i]) { 1618 if (state->common->immutable[i]) {
1608 free_game(ret); 1619 free_game(ret);
1609 return NULL; 1620 return NULL;
1610 } 1621 }
@@ -1613,7 +1624,7 @@ static game_state *execute_move(const game_state *state, const char *move)
1613 1624
1614 if (!ret->completed && unruly_validate_counts(ret, NULL, NULL) == 0 1625 if (!ret->completed && unruly_validate_counts(ret, NULL, NULL) == 0
1615 && (unruly_validate_all_rows(ret, NULL) == 0)) 1626 && (unruly_validate_all_rows(ret, NULL) == 0))
1616 ret->completed = TRUE; 1627 ret->completed = true;
1617 1628
1618 return ret; 1629 return ret;
1619 } 1630 }
@@ -1786,7 +1797,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1786 TILE_SIZE*h2 + 2*(TILE_SIZE/10) - 1, COL_GRID); 1797 TILE_SIZE*h2 + 2*(TILE_SIZE/10) - 1, COL_GRID);
1787 1798
1788 draw_update(dr, 0, 0, TILE_SIZE * (w2+1), TILE_SIZE * (h2+1)); 1799 draw_update(dr, 0, 0, TILE_SIZE * (w2+1), TILE_SIZE * (h2+1));
1789 ds->started = TRUE; 1800 ds->started = true;
1790 } 1801 }
1791 1802
1792 flash = 0; 1803 flash = 0;
@@ -1797,7 +1808,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1797 ds->gridfs[i] = 0; 1808 ds->gridfs[i] = 0;
1798 unruly_validate_all_rows(state, ds->gridfs); 1809 unruly_validate_all_rows(state, ds->gridfs);
1799 for (i = 0; i < 2 * (h2 + w2); i++) 1810 for (i = 0; i < 2 * (h2 + w2); i++)
1800 ds->rowfs[i] = 0; 1811 ds->rowfs[i] = false;
1801 unruly_validate_counts(state, NULL, ds->rowfs); 1812 unruly_validate_counts(state, NULL, ds->rowfs);
1802 1813
1803 for (y = 0; y < h2; y++) { 1814 for (y = 0; y < h2; y++) {
@@ -1820,7 +1831,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1820 1831
1821 tile |= flash; 1832 tile |= flash;
1822 1833
1823 if (state->immutable[i]) 1834 if (state->common->immutable[i])
1824 tile |= FF_IMMUTABLE; 1835 tile |= FF_IMMUTABLE;
1825 1836
1826 if (ui->cursor && ui->cx == x && ui->cy == y) 1837 if (ui->cursor && ui->cx == x && ui->cy == y)
@@ -1854,9 +1865,9 @@ static int game_status(const game_state *state)
1854 return state->completed ? +1 : 0; 1865 return state->completed ? +1 : 0;
1855} 1866}
1856 1867
1857static int game_timing_state(const game_state *state, game_ui *ui) 1868static bool game_timing_state(const game_state *state, game_ui *ui)
1858{ 1869{
1859 return TRUE; 1870 return true;
1860} 1871}
1861 1872
1862static void game_print_size(const game_params *params, float *x, float *y) 1873static void game_print_size(const game_params *params, float *x, float *y)
@@ -1913,15 +1924,15 @@ const struct game thegame = {
1913 encode_params, 1924 encode_params,
1914 free_params, 1925 free_params,
1915 dup_params, 1926 dup_params,
1916 TRUE, game_configure, custom_params, 1927 true, game_configure, custom_params,
1917 validate_params, 1928 validate_params,
1918 new_game_desc, 1929 new_game_desc,
1919 validate_desc, 1930 validate_desc,
1920 new_game, 1931 new_game,
1921 dup_game, 1932 dup_game,
1922 free_game, 1933 free_game,
1923 TRUE, solve_game, 1934 true, solve_game,
1924 TRUE, game_can_format_as_text_now, game_text_format, 1935 true, game_can_format_as_text_now, game_text_format,
1925 new_ui, 1936 new_ui,
1926 free_ui, 1937 free_ui,
1927 encode_ui, 1938 encode_ui,
@@ -1938,9 +1949,9 @@ const struct game thegame = {
1938 game_anim_length, 1949 game_anim_length,
1939 game_flash_length, 1950 game_flash_length,
1940 game_status, 1951 game_status,
1941 TRUE, FALSE, game_print_size, game_print, 1952 true, false, game_print_size, game_print,
1942 FALSE, /* wants_statusbar */ 1953 false, /* wants_statusbar */
1943 FALSE, game_timing_state, 1954 false, game_timing_state,
1944 0, /* flags */ 1955 0, /* flags */
1945}; 1956};
1946 1957
@@ -1986,7 +1997,7 @@ int main(int argc, char *argv[])
1986 seed = (time_t) atoi(*++argv); 1997 seed = (time_t) atoi(*++argv);
1987 argc--; 1998 argc--;
1988 } else if (!strcmp(p, "-v")) 1999 } else if (!strcmp(p, "-v"))
1989 solver_verbose = TRUE; 2000 solver_verbose = true;
1990 else if (*p == '-') 2001 else if (*p == '-')
1991 usage_exit("unrecognised option"); 2002 usage_exit("unrecognised option");
1992 else 2003 else
@@ -2000,7 +2011,7 @@ int main(int argc, char *argv[])
2000 2011
2001 params = default_params(); 2012 params = default_params();
2002 decode_params(params, id); 2013 decode_params(params, id);
2003 err = validate_params(params, TRUE); 2014 err = validate_params(params, true);
2004 if (err) { 2015 if (err) {
2005 fprintf(stderr, "Parameters are invalid\n"); 2016 fprintf(stderr, "Parameters are invalid\n");
2006 fprintf(stderr, "%s: %s", argv[0], err); 2017 fprintf(stderr, "%s: %s", argv[0], err);
@@ -2014,8 +2025,8 @@ int main(int argc, char *argv[])
2014 if (!params) 2025 if (!params)
2015 params = default_params(); 2026 params = default_params();
2016 printf("Generating puzzle with parameters %s\n", 2027 printf("Generating puzzle with parameters %s\n",
2017 encode_params(params, TRUE)); 2028 encode_params(params, true));
2018 desc_gen = new_game_desc(params, rs, &aux, FALSE); 2029 desc_gen = new_game_desc(params, rs, &aux, false);
2019 2030
2020 if (!solver_verbose) { 2031 if (!solver_verbose) {
2021 char *fmt = game_text_format(new_game(NULL, params, desc_gen)); 2032 char *fmt = game_text_format(new_game(NULL, params, desc_gen));
diff --git a/apps/plugins/puzzles/src/untangle.c b/apps/plugins/puzzles/src/untangle.c
index 0bcd04d658..eff93382cd 100644
--- a/apps/plugins/puzzles/src/untangle.c
+++ b/apps/plugins/puzzles/src/untangle.c
@@ -97,7 +97,7 @@ struct game_state {
97 int *crosses; /* mark edges which are crossed */ 97 int *crosses; /* mark edges which are crossed */
98#endif 98#endif
99 struct graph *graph; 99 struct graph *graph;
100 int completed, cheated, just_solved; 100 bool completed, cheated, just_solved;
101}; 101};
102 102
103static int edgecmpC(const void *av, const void *bv) 103static int edgecmpC(const void *av, const void *bv)
@@ -127,7 +127,7 @@ static game_params *default_params(void)
127 return ret; 127 return ret;
128} 128}
129 129
130static int game_fetch_preset(int i, char **name, game_params **params) 130static bool game_fetch_preset(int i, char **name, game_params **params)
131{ 131{
132 game_params *ret; 132 game_params *ret;
133 int n; 133 int n;
@@ -139,7 +139,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
139 case 2: n = 15; break; 139 case 2: n = 15; break;
140 case 3: n = 20; break; 140 case 3: n = 20; break;
141 case 4: n = 25; break; 141 case 4: n = 25; break;
142 default: return FALSE; 142 default: return false;
143 } 143 }
144 144
145 sprintf(buf, "%d points", n); 145 sprintf(buf, "%d points", n);
@@ -148,7 +148,7 @@ static int game_fetch_preset(int i, char **name, game_params **params)
148 *params = ret = snew(game_params); 148 *params = ret = snew(game_params);
149 ret->n = n; 149 ret->n = n;
150 150
151 return TRUE; 151 return true;
152} 152}
153 153
154static void free_params(game_params *params) 154static void free_params(game_params *params)
@@ -168,7 +168,7 @@ static void decode_params(game_params *params, char const *string)
168 params->n = atoi(string); 168 params->n = atoi(string);
169} 169}
170 170
171static char *encode_params(const game_params *params, int full) 171static char *encode_params(const game_params *params, bool full)
172{ 172{
173 char buf[80]; 173 char buf[80];
174 174
@@ -204,7 +204,7 @@ static game_params *custom_params(const config_item *cfg)
204 return ret; 204 return ret;
205} 205}
206 206
207static const char *validate_params(const game_params *params, int full) 207static const char *validate_params(const game_params *params, bool full)
208{ 208{
209 if (params->n < 4) 209 if (params->n < 4)
210 return "Number of points must be at least four"; 210 return "Number of points must be at least four";
@@ -300,7 +300,7 @@ static int64 dotprod64(long a, long b, long p, long q)
300 * between b1 and b2, intersect. We count it as an intersection if 300 * between b1 and b2, intersect. We count it as an intersection if
301 * any of the endpoints lies _on_ the other line. 301 * any of the endpoints lies _on_ the other line.
302 */ 302 */
303static int cross(point a1, point a2, point b1, point b2) 303static bool cross(point a1, point a2, point b1, point b2)
304{ 304{
305 long b1x, b1y, b2x, b2y, px, py; 305 long b1x, b1y, b2x, b2y, px, py;
306 int64 d1, d2, d3; 306 int64 d1, d2, d3;
@@ -333,7 +333,7 @@ static int cross(point a1, point a2, point b1, point b2)
333 /* If they have the same non-zero sign, the lines do not cross. */ 333 /* If they have the same non-zero sign, the lines do not cross. */
334 if ((sign64(d1) > 0 && sign64(d2) > 0) || 334 if ((sign64(d1) > 0 && sign64(d2) > 0) ||
335 (sign64(d1) < 0 && sign64(d2) < 0)) 335 (sign64(d1) < 0 && sign64(d2) < 0))
336 return FALSE; 336 return false;
337 337
338 /* 338 /*
339 * If the dot products are both exactly zero, then the two line 339 * If the dot products are both exactly zero, then the two line
@@ -350,13 +350,13 @@ static int cross(point a1, point a2, point b1, point b2)
350 d2 = dotprod64(b2x, px, b2y, py); 350 d2 = dotprod64(b2x, px, b2y, py);
351 /* If they're both strictly negative, the lines do not cross. */ 351 /* If they're both strictly negative, the lines do not cross. */
352 if (sign64(d1) < 0 && sign64(d2) < 0) 352 if (sign64(d1) < 0 && sign64(d2) < 0)
353 return FALSE; 353 return false;
354 /* Otherwise, take the dot product of a2-a1 with itself. If 354 /* Otherwise, take the dot product of a2-a1 with itself. If
355 * the other two dot products both exceed this, the lines do 355 * the other two dot products both exceed this, the lines do
356 * not cross. */ 356 * not cross. */
357 d3 = dotprod64(px, px, py, py); 357 d3 = dotprod64(px, px, py, py);
358 if (greater64(d1, d3) && greater64(d2, d3)) 358 if (greater64(d1, d3) && greater64(d2, d3))
359 return FALSE; 359 return false;
360 } 360 }
361 361
362 /* 362 /*
@@ -375,12 +375,12 @@ static int cross(point a1, point a2, point b1, point b2)
375 d2 = dotprod64(b2x, px, b2y, py); 375 d2 = dotprod64(b2x, px, b2y, py);
376 if ((sign64(d1) > 0 && sign64(d2) > 0) || 376 if ((sign64(d1) > 0 && sign64(d2) > 0) ||
377 (sign64(d1) < 0 && sign64(d2) < 0)) 377 (sign64(d1) < 0 && sign64(d2) < 0))
378 return FALSE; 378 return false;
379 379
380 /* 380 /*
381 * The lines must cross. 381 * The lines must cross.
382 */ 382 */
383 return TRUE; 383 return true;
384} 384}
385 385
386static unsigned long squarert(unsigned long n) { 386static unsigned long squarert(unsigned long n) {
@@ -422,7 +422,7 @@ static void addedge(tree234 *edges, int a, int b)
422 add234(edges, e); 422 add234(edges, e);
423} 423}
424 424
425static int isedge(tree234 *edges, int a, int b) 425static bool isedge(tree234 *edges, int a, int b)
426{ 426{
427 edge e; 427 edge e;
428 428
@@ -491,7 +491,7 @@ static void make_circle(point *pts, int n, int w)
491} 491}
492 492
493static char *new_game_desc(const game_params *params, random_state *rs, 493static char *new_game_desc(const game_params *params, random_state *rs,
494 char **aux, int interactive) 494 char **aux, bool interactive)
495{ 495{
496 int n = params->n, i; 496 int n = params->n, i;
497 long w, h, j, k, m; 497 long w, h, j, k, m;
@@ -542,7 +542,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
542 edges = newtree234(edgecmp); 542 edges = newtree234(edgecmp);
543 vlist = snewn(n, vertex); 543 vlist = snewn(n, vertex);
544 while (1) { 544 while (1) {
545 int added = FALSE; 545 bool added = false;
546 546
547 for (i = 0; i < n; i++) { 547 for (i = 0; i < n; i++) {
548 v = index234(vertices, i); 548 v = index234(vertices, i);
@@ -604,7 +604,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
604 * the two vertices involved, and break. 604 * the two vertices involved, and break.
605 */ 605 */
606 addedge(edges, j, ki); 606 addedge(edges, j, ki);
607 added = TRUE; 607 added = true;
608 del234(vertices, vs+j); 608 del234(vertices, vs+j);
609 vs[j].param++; 609 vs[j].param++;
610 add234(vertices, vs+j); 610 add234(vertices, vs+j);
@@ -761,13 +761,13 @@ static const char *validate_desc(const game_params *params, const char *desc)
761 761
762static void mark_crossings(game_state *state) 762static void mark_crossings(game_state *state)
763{ 763{
764 int ok = TRUE; 764 bool ok = true;
765 int i, j; 765 int i, j;
766 edge *e, *e2; 766 edge *e, *e2;
767 767
768#ifdef SHOW_CROSSINGS 768#ifdef SHOW_CROSSINGS
769 for (i = 0; (e = index234(state->graph->edges, i)) != NULL; i++) 769 for (i = 0; (e = index234(state->graph->edges, i)) != NULL; i++)
770 state->crosses[i] = FALSE; 770 state->crosses[i] = false;
771#endif 771#endif
772 772
773 /* 773 /*
@@ -781,9 +781,9 @@ static void mark_crossings(game_state *state)
781 continue; 781 continue;
782 if (cross(state->pts[e2->a], state->pts[e2->b], 782 if (cross(state->pts[e2->a], state->pts[e2->b],
783 state->pts[e->a], state->pts[e->b])) { 783 state->pts[e->a], state->pts[e->b])) {
784 ok = FALSE; 784 ok = false;
785#ifdef SHOW_CROSSINGS 785#ifdef SHOW_CROSSINGS
786 state->crosses[i] = state->crosses[j] = TRUE; 786 state->crosses[i] = state->crosses[j] = true;
787#else 787#else
788 goto done; /* multi-level break - sorry */ 788 goto done; /* multi-level break - sorry */
789#endif 789#endif
@@ -799,7 +799,7 @@ static void mark_crossings(game_state *state)
799 done: 799 done:
800#endif 800#endif
801 if (ok) 801 if (ok)
802 state->completed = TRUE; 802 state->completed = true;
803} 803}
804 804
805static game_state *new_game(midend *me, const game_params *params, 805static game_state *new_game(midend *me, const game_params *params,
@@ -816,7 +816,7 @@ static game_state *new_game(midend *me, const game_params *params,
816 state->graph = snew(struct graph); 816 state->graph = snew(struct graph);
817 state->graph->refcount = 1; 817 state->graph->refcount = 1;
818 state->graph->edges = newtree234(edgecmp); 818 state->graph->edges = newtree234(edgecmp);
819 state->completed = state->cheated = state->just_solved = FALSE; 819 state->completed = state->cheated = state->just_solved = false;
820 820
821 while (*desc) { 821 while (*desc) {
822 a = atoi(desc); 822 a = atoi(desc);
@@ -1025,9 +1025,9 @@ static char *solve_game(const game_state *state, const game_state *currstate,
1025 return ret; 1025 return ret;
1026} 1026}
1027 1027
1028static int game_can_format_as_text_now(const game_params *params) 1028static bool game_can_format_as_text_now(const game_params *params)
1029{ 1029{
1030 return TRUE; 1030 return true;
1031} 1031}
1032 1032
1033static char *game_text_format(const game_state *state) 1033static char *game_text_format(const game_state *state)
@@ -1043,8 +1043,8 @@ struct game_ui {
1043 * again -1 if none */ 1043 * again -1 if none */
1044 1044
1045 point newpoint; /* where it's been dragged to so far */ 1045 point newpoint; /* where it's been dragged to so far */
1046 int just_dragged; /* reset in game_changed_state */ 1046 bool just_dragged; /* reset in game_changed_state */
1047 int just_moved; /* _set_ in game_changed_state */ 1047 bool just_moved; /* _set_ in game_changed_state */
1048 float anim_length; 1048 float anim_length;
1049}; 1049};
1050 1050
@@ -1053,7 +1053,7 @@ static game_ui *new_ui(const game_state *state)
1053 game_ui *ui = snew(game_ui); 1053 game_ui *ui = snew(game_ui);
1054 ui->dragpoint = -1; 1054 ui->dragpoint = -1;
1055 ui->cursorpoint = -1; 1055 ui->cursorpoint = -1;
1056 ui->just_moved = ui->just_dragged = FALSE; 1056 ui->just_moved = ui->just_dragged = false;
1057 return ui; 1057 return ui;
1058} 1058}
1059 1059
@@ -1076,7 +1076,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
1076{ 1076{
1077 ui->dragpoint = -1; 1077 ui->dragpoint = -1;
1078 ui->just_moved = ui->just_dragged; 1078 ui->just_moved = ui->just_dragged;
1079 ui->just_dragged = FALSE; 1079 ui->just_dragged = false;
1080} 1080}
1081 1081
1082struct game_drawstate { 1082struct game_drawstate {
@@ -1153,7 +1153,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1153 */ 1153 */
1154 sprintf(buf, "P%d:%ld,%ld/%ld", p, 1154 sprintf(buf, "P%d:%ld,%ld/%ld", p,
1155 ui->newpoint.x, ui->newpoint.y, ui->newpoint.d); 1155 ui->newpoint.x, ui->newpoint.y, ui->newpoint.d);
1156 ui->just_dragged = TRUE; 1156 ui->just_dragged = true;
1157 return dupstr(buf); 1157 return dupstr(buf);
1158 } 1158 }
1159 else if(IS_CURSOR_MOVE(button)) 1159 else if(IS_CURSOR_MOVE(button))
@@ -1202,13 +1202,13 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1202 if(angle < 0) 1202 if(angle < 0)
1203 angle += 2*PI; 1203 angle += 2*PI;
1204 1204
1205 right_direction = FALSE; 1205 right_direction = false;
1206 1206
1207 if((button == CURSOR_UP && (1*PI/4 <= angle && angle <= 3*PI/4)) || 1207 if((button == CURSOR_UP && (1*PI/4 <= angle && angle <= 3*PI/4)) ||
1208 (button == CURSOR_LEFT && (3*PI/4 <= angle && angle <= 5*PI/4)) || 1208 (button == CURSOR_LEFT && (3*PI/4 <= angle && angle <= 5*PI/4)) ||
1209 (button == CURSOR_DOWN && (5*PI/4 <= angle && angle <= 7*PI/4)) || 1209 (button == CURSOR_DOWN && (5*PI/4 <= angle && angle <= 7*PI/4)) ||
1210 (button == CURSOR_RIGHT && (angle >= 7*PI/4 || angle <= 1*PI/4))) 1210 (button == CURSOR_RIGHT && (angle >= 7*PI/4 || angle <= 1*PI/4)))
1211 right_direction = TRUE; 1211 right_direction = true;
1212 1212
1213 if ((best == -1 || bestd > d) && right_direction) { 1213 if ((best == -1 || bestd > d) && right_direction) {
1214 best = i; 1214 best = i;
@@ -1281,7 +1281,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
1281 */ 1281 */
1282 sprintf(buf, "P%d:%ld,%ld/%ld", p, 1282 sprintf(buf, "P%d:%ld,%ld/%ld", p,
1283 ui->newpoint.x, ui->newpoint.y, ui->newpoint.d); 1283 ui->newpoint.x, ui->newpoint.y, ui->newpoint.d);
1284 ui->just_dragged = TRUE; 1284 ui->just_dragged = true;
1285 return dupstr(buf); 1285 return dupstr(buf);
1286 } 1286 }
1287 else if(ui->cursorpoint < 0) 1287 else if(ui->cursorpoint < 0)
@@ -1301,13 +1301,13 @@ static game_state *execute_move(const game_state *state, const char *move)
1301 long x, y, d; 1301 long x, y, d;
1302 game_state *ret = dup_game(state); 1302 game_state *ret = dup_game(state);
1303 1303
1304 ret->just_solved = FALSE; 1304 ret->just_solved = false;
1305 1305
1306 while (*move) { 1306 while (*move) {
1307 if (*move == 'S') { 1307 if (*move == 'S') {
1308 move++; 1308 move++;
1309 if (*move == ';') move++; 1309 if (*move == ';') move++;
1310 ret->cheated = ret->just_solved = TRUE; 1310 ret->cheated = ret->just_solved = true;
1311 } 1311 }
1312 if (*move == 'P' && 1312 if (*move == 'P' &&
1313 sscanf(move+1, "%d:%ld,%ld/%ld%n", &p, &x, &y, &d, &k) == 4 && 1313 sscanf(move+1, "%d:%ld,%ld/%ld%n", &p, &x, &y, &d, &k) == 4 &&
@@ -1444,7 +1444,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1444 int w, h; 1444 int w, h;
1445 edge *e; 1445 edge *e;
1446 int i, j; 1446 int i, j;
1447 int bg, points_moved; 1447 int bg;
1448 bool points_moved;
1448 1449
1449 /* 1450 /*
1450 * There's no terribly sensible way to do partial redraws of 1451 * There's no terribly sensible way to do partial redraws of
@@ -1469,7 +1470,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1469 * Also in this loop we work out the coordinates of all the 1470 * Also in this loop we work out the coordinates of all the
1470 * points for this redraw. 1471 * points for this redraw.
1471 */ 1472 */
1472 points_moved = FALSE; 1473 points_moved = false;
1473 for (i = 0; i < state->params.n; i++) { 1474 for (i = 0; i < state->params.n; i++) {
1474 point p = state->pts[i]; 1475 point p = state->pts[i];
1475 long x, y; 1476 long x, y;
@@ -1484,7 +1485,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
1484 y = p.y * ds->tilesize / p.d; 1485 y = p.y * ds->tilesize / p.d;
1485 1486
1486 if (ds->x[i] != x || ds->y[i] != y) 1487 if (ds->x[i] != x || ds->y[i] != y)
1487 points_moved = TRUE; 1488 points_moved = true;
1488 1489
1489 ds->x[i] = x; 1490 ds->x[i] = x;
1490 ds->y[i] = y; 1491 ds->y[i] = y;
@@ -1585,9 +1586,9 @@ static int game_status(const game_state *state)
1585 return state->completed ? +1 : 0; 1586 return state->completed ? +1 : 0;
1586} 1587}
1587 1588
1588static int game_timing_state(const game_state *state, game_ui *ui) 1589static bool game_timing_state(const game_state *state, game_ui *ui)
1589{ 1590{
1590 return TRUE; 1591 return true;
1591} 1592}
1592 1593
1593static void game_print_size(const game_params *params, float *x, float *y) 1594static void game_print_size(const game_params *params, float *x, float *y)
@@ -1610,15 +1611,15 @@ const struct game thegame = {
1610 encode_params, 1611 encode_params,
1611 free_params, 1612 free_params,
1612 dup_params, 1613 dup_params,
1613 TRUE, game_configure, custom_params, 1614 true, game_configure, custom_params,
1614 validate_params, 1615 validate_params,
1615 new_game_desc, 1616 new_game_desc,
1616 validate_desc, 1617 validate_desc,
1617 new_game, 1618 new_game,
1618 dup_game, 1619 dup_game,
1619 free_game, 1620 free_game,
1620 TRUE, solve_game, 1621 true, solve_game,
1621 FALSE, game_can_format_as_text_now, game_text_format, 1622 false, game_can_format_as_text_now, game_text_format,
1622 new_ui, 1623 new_ui,
1623 free_ui, 1624 free_ui,
1624 encode_ui, 1625 encode_ui,
@@ -1635,8 +1636,8 @@ const struct game thegame = {
1635 game_anim_length, 1636 game_anim_length,
1636 game_flash_length, 1637 game_flash_length,
1637 game_status, 1638 game_status,
1638 FALSE, FALSE, game_print_size, game_print, 1639 false, false, game_print_size, game_print,
1639 FALSE, /* wants_statusbar */ 1640 false, /* wants_statusbar */
1640 FALSE, game_timing_state, 1641 false, game_timing_state,
1641 SOLVE_ANIMATES, /* flags */ 1642 SOLVE_ANIMATES, /* flags */
1642}; 1643};
diff --git a/apps/plugins/puzzles/src/windows.c b/apps/plugins/puzzles/src/windows.c
index 8e5b40650d..38559c5454 100644
--- a/apps/plugins/puzzles/src/windows.c
+++ b/apps/plugins/puzzles/src/windows.c
@@ -61,7 +61,7 @@ static HINSTANCE hh_dll;
61#endif /* NO_HTMLHELP */ 61#endif /* NO_HTMLHELP */
62enum { NONE, HLP, CHM } help_type; 62enum { NONE, HLP, CHM } help_type;
63char *help_path; 63char *help_path;
64int help_has_contents; 64bool help_has_contents;
65 65
66#ifndef FILENAME_MAX 66#ifndef FILENAME_MAX
67#define FILENAME_MAX (260) 67#define FILENAME_MAX (260)
@@ -114,7 +114,7 @@ LPCSTR getenv(LPCSTR buf)
114 114
115BOOL GetKeyboardState(PBYTE pb) 115BOOL GetKeyboardState(PBYTE pb)
116{ 116{
117 return FALSE; 117 return false;
118} 118}
119 119
120static TCHAR wClassName[256], wGameName[256]; 120static TCHAR wClassName[256], wGameName[256];
@@ -229,15 +229,17 @@ struct frontend {
229 HFONT cfgfont; 229 HFONT cfgfont;
230 HBRUSH oldbr; 230 HBRUSH oldbr;
231 HPEN oldpen; 231 HPEN oldpen;
232 int help_running; 232 bool help_running;
233 enum { DRAWING, PRINTING, NOTHING } drawstatus; 233 enum { DRAWING, PRINTING, NOTHING } drawstatus;
234 DOCINFO di; 234 DOCINFO di;
235 int printcount, printw, printh, printsolns, printcurr, printcolour; 235 int printcount, printw, printh;
236 bool printsolns, printcurr, printcolour;
236 float printscale; 237 float printscale;
237 int printoffsetx, printoffsety; 238 int printoffsetx, printoffsety;
238 float printpixelscale; 239 float printpixelscale;
239 int fontstart; 240 int fontstart;
240 int linewidth, linedotted; 241 int linewidth;
242 bool linedotted;
241 drawing *dr; 243 drawing *dr;
242 int xmin, ymin; 244 int xmin, ymin;
243 float puzz_scale; 245 float puzz_scale;
@@ -495,7 +497,7 @@ static void win_reset_brush(frontend *fe)
495 DeleteObject(br); 497 DeleteObject(br);
496} 498}
497 499
498static void win_set_pen(frontend *fe, int colour, int thin) 500static void win_set_pen(frontend *fe, int colour, bool thin)
499{ 501{
500 HPEN pen; 502 HPEN pen;
501 assert(fe->drawstatus != NOTHING); 503 assert(fe->drawstatus != NOTHING);
@@ -656,7 +658,7 @@ static void win_draw_rect(void *handle, int x, int y, int w, int h, int colour)
656 SetPixel(fe->hdc, x, y, fe->colours[colour]); 658 SetPixel(fe->hdc, x, y, fe->colours[colour]);
657 } else { 659 } else {
658 win_set_brush(fe, colour); 660 win_set_brush(fe, colour);
659 win_set_pen(fe, colour, TRUE); 661 win_set_pen(fe, colour, true);
660 p = win_transform_point(fe, x, y); 662 p = win_transform_point(fe, x, y);
661 q = win_transform_point(fe, x+w, y+h); 663 q = win_transform_point(fe, x+w, y+h);
662 Rectangle(fe->hdc, p.x, p.y, q.x, q.y); 664 Rectangle(fe->hdc, p.x, p.y, q.x, q.y);
@@ -673,7 +675,7 @@ static void win_draw_line(void *handle, int x1, int y1, int x2, int y2, int colo
673 if (fe->drawstatus == NOTHING) 675 if (fe->drawstatus == NOTHING)
674 return; 676 return;
675 677
676 win_set_pen(fe, colour, FALSE); 678 win_set_pen(fe, colour, false);
677 pp[0] = win_transform_point(fe, x1, y1); 679 pp[0] = win_transform_point(fe, x1, y1);
678 pp[1] = win_transform_point(fe, x2, y2); 680 pp[1] = win_transform_point(fe, x2, y2);
679 Polyline(fe->hdc, pp, 2); 681 Polyline(fe->hdc, pp, 2);
@@ -698,7 +700,7 @@ static void win_draw_circle(void *handle, int cx, int cy, int radius,
698 else 700 else
699 fe->oldbr = SelectObject(fe->hdc, GetStockObject(NULL_BRUSH)); 701 fe->oldbr = SelectObject(fe->hdc, GetStockObject(NULL_BRUSH));
700 702
701 win_set_pen(fe, outlinecolour, FALSE); 703 win_set_pen(fe, outlinecolour, false);
702 p = win_transform_point(fe, cx - radius, cy - radius); 704 p = win_transform_point(fe, cx - radius, cy - radius);
703 q = win_transform_point(fe, cx + radius, cy + radius); 705 q = win_transform_point(fe, cx + radius, cy + radius);
704 Ellipse(fe->hdc, p.x, p.y, q.x+1, q.y+1); 706 Ellipse(fe->hdc, p.x, p.y, q.x+1, q.y+1);
@@ -727,12 +729,12 @@ static void win_draw_polygon(void *handle, int *coords, int npoints,
727 729
728 if (fillcolour >= 0) { 730 if (fillcolour >= 0) {
729 win_set_brush(fe, fillcolour); 731 win_set_brush(fe, fillcolour);
730 win_set_pen(fe, outlinecolour, FALSE); 732 win_set_pen(fe, outlinecolour, false);
731 Polygon(fe->hdc, pts, npoints); 733 Polygon(fe->hdc, pts, npoints);
732 win_reset_brush(fe); 734 win_reset_brush(fe);
733 win_reset_pen(fe); 735 win_reset_pen(fe);
734 } else { 736 } else {
735 win_set_pen(fe, outlinecolour, FALSE); 737 win_set_pen(fe, outlinecolour, false);
736 Polyline(fe->hdc, pts, npoints+1); 738 Polyline(fe->hdc, pts, npoints+1);
737 win_reset_pen(fe); 739 win_reset_pen(fe);
738 } 740 }
@@ -772,7 +774,7 @@ static void win_draw_update(void *handle, int x, int y, int w, int h)
772 r.bottom = y + h; 774 r.bottom = y + h;
773 775
774 OffsetRect(&r, fe->bitmapPosition.left, fe->bitmapPosition.top); 776 OffsetRect(&r, fe->bitmapPosition.left, fe->bitmapPosition.top);
775 InvalidateRect(fe->hwnd, &r, FALSE); 777 InvalidateRect(fe->hwnd, &r, false);
776} 778}
777 779
778static void win_end_draw(void *handle) 780static void win_end_draw(void *handle)
@@ -799,7 +801,7 @@ static void win_line_width(void *handle, float width)
799 fe->linewidth = (int)(width * fe->printpixelscale); 801 fe->linewidth = (int)(width * fe->printpixelscale);
800} 802}
801 803
802static void win_line_dotted(void *handle, int dotted) 804static void win_line_dotted(void *handle, bool dotted)
803{ 805{
804 frontend *fe = (frontend *)handle; 806 frontend *fe = (frontend *)handle;
805 807
@@ -900,7 +902,7 @@ static void win_begin_puzzle(void *handle, float xm, float xc,
900 fe->printpixelscale = scale; 902 fe->printpixelscale = scale;
901 903
902 fe->linewidth = 1; 904 fe->linewidth = 1;
903 fe->linedotted = FALSE; 905 fe->linedotted = false;
904} 906}
905 907
906static void win_end_puzzle(void *handle) 908static void win_end_puzzle(void *handle)
@@ -1222,9 +1224,9 @@ static void init_help(void)
1222 strcpy(r, HELP_CNT_NAME); 1224 strcpy(r, HELP_CNT_NAME);
1223 if ( (fp = fopen(b, "r")) != NULL) { 1225 if ( (fp = fopen(b, "r")) != NULL) {
1224 fclose(fp); 1226 fclose(fp);
1225 help_has_contents = TRUE; 1227 help_has_contents = true;
1226 } else 1228 } else
1227 help_has_contents = FALSE; 1229 help_has_contents = false;
1228 1230
1229 return; 1231 return;
1230 } 1232 }
@@ -1256,7 +1258,7 @@ static void start_help(frontend *fe, const char *topic)
1256 cmd = HELP_CONTENTS; 1258 cmd = HELP_CONTENTS;
1257 } 1259 }
1258 WinHelp(fe->hwnd, help_path, cmd, (DWORD)str); 1260 WinHelp(fe->hwnd, help_path, cmd, (DWORD)str);
1259 fe->help_running = TRUE; 1261 fe->help_running = true;
1260 break; 1262 break;
1261 case CHM: 1263 case CHM:
1262#ifndef NO_HTMLHELP 1264#ifndef NO_HTMLHELP
@@ -1269,7 +1271,7 @@ static void start_help(frontend *fe, const char *topic)
1269 str = dupstr(help_path); 1271 str = dupstr(help_path);
1270 } 1272 }
1271 htmlhelp(fe->hwnd, str, HH_DISPLAY_TOPIC, 0); 1273 htmlhelp(fe->hwnd, str, HH_DISPLAY_TOPIC, 0);
1272 fe->help_running = TRUE; 1274 fe->help_running = true;
1273 break; 1275 break;
1274#endif /* NO_HTMLHELP */ 1276#endif /* NO_HTMLHELP */
1275 case NONE: 1277 case NONE:
@@ -1300,7 +1302,7 @@ static void stop_help(frontend *fe)
1300 assert(!"This shouldn't happen"); 1302 assert(!"This shouldn't happen");
1301 break; 1303 break;
1302 } 1304 }
1303 fe->help_running = FALSE; 1305 fe->help_running = false;
1304 } 1306 }
1305} 1307}
1306 1308
@@ -1361,12 +1363,12 @@ static void get_menu_size(HWND wh, RECT *r)
1361 * furniture (wx,wy). 1363 * furniture (wx,wy).
1362 */ 1364 */
1363 1365
1364static int check_window_resize(frontend *fe, int cx, int cy, 1366static bool check_window_resize(frontend *fe, int cx, int cy,
1365 int *px, int *py, 1367 int *px, int *py, int *wx, int *wy)
1366 int *wx, int *wy)
1367{ 1368{
1368 RECT r; 1369 RECT r;
1369 int x, y, sy = get_statusbar_height(fe), changed = 0; 1370 int x, y, sy = get_statusbar_height(fe);
1371 bool changed = false;
1370 1372
1371 /* disallow making window thinner than menu bar */ 1373 /* disallow making window thinner than menu bar */
1372 x = max(cx, fe->xmin); 1374 x = max(cx, fe->xmin);
@@ -1376,7 +1378,7 @@ static int check_window_resize(frontend *fe, int cx, int cy,
1376 * See if we actually got the window size we wanted, and adjust 1378 * See if we actually got the window size we wanted, and adjust
1377 * the puzzle size if not. 1379 * the puzzle size if not.
1378 */ 1380 */
1379 midend_size(fe->me, &x, &y, TRUE); 1381 midend_size(fe->me, &x, &y, true);
1380 if (x != cx || y != cy) { 1382 if (x != cx || y != cy) {
1381 /* 1383 /*
1382 * Resize the window, now we know what size we _really_ 1384 * Resize the window, now we know what size we _really_
@@ -1385,10 +1387,10 @@ static int check_window_resize(frontend *fe, int cx, int cy,
1385 r.left = r.top = 0; 1387 r.left = r.top = 0;
1386 r.right = x; 1388 r.right = x;
1387 r.bottom = y + sy; 1389 r.bottom = y + sy;
1388 AdjustWindowRectEx(&r, WINFLAGS, TRUE, 0); 1390 AdjustWindowRectEx(&r, WINFLAGS, true, 0);
1389 *wx = r.right - r.left; 1391 *wx = r.right - r.left;
1390 *wy = r.bottom - r.top; 1392 *wy = r.bottom - r.top;
1391 changed = 1; 1393 changed = true;
1392 } 1394 }
1393 1395
1394 *px = x; 1396 *px = x;
@@ -1430,14 +1432,14 @@ static void get_max_puzzle_size(frontend *fe, int *x, int *y)
1430{ 1432{
1431 RECT r, sr; 1433 RECT r, sr;
1432 1434
1433 if (SystemParametersInfo(SPI_GETWORKAREA, 0, &sr, FALSE)) { 1435 if (SystemParametersInfo(SPI_GETWORKAREA, 0, &sr, false)) {
1434 *x = sr.right - sr.left; 1436 *x = sr.right - sr.left;
1435 *y = sr.bottom - sr.top; 1437 *y = sr.bottom - sr.top;
1436 r.left = 100; 1438 r.left = 100;
1437 r.right = 200; 1439 r.right = 200;
1438 r.top = 100; 1440 r.top = 100;
1439 r.bottom = 200; 1441 r.bottom = 200;
1440 AdjustWindowRectEx(&r, WINFLAGS, TRUE, 0); 1442 AdjustWindowRectEx(&r, WINFLAGS, true, 0);
1441 *x -= r.right - r.left - 100; 1443 *x -= r.right - r.left - 100;
1442 *y -= r.bottom - r.top - 100; 1444 *y -= r.bottom - r.top - 100;
1443 } else { 1445 } else {
@@ -1485,7 +1487,7 @@ static frontend *frontend_new(HINSTANCE inst)
1485 fe->timer = 0; 1487 fe->timer = 0;
1486 fe->hwnd = NULL; 1488 fe->hwnd = NULL;
1487 1489
1488 fe->help_running = FALSE; 1490 fe->help_running = false;
1489 1491
1490 fe->drawstatus = NOTHING; 1492 fe->drawstatus = NOTHING;
1491 fe->dr = NULL; 1493 fe->dr = NULL;
@@ -1523,7 +1525,7 @@ static frontend *frontend_new(HINSTANCE inst)
1523 GetWindowRect(fe->hwnd, &rc); 1525 GetWindowRect(fe->hwnd, &rc);
1524 GetWindowRect(mbi.hwndMB, &rcBar); 1526 GetWindowRect(mbi.hwndMB, &rcBar);
1525 rc.bottom -= rcBar.bottom - rcBar.top; 1527 rc.bottom -= rcBar.bottom - rcBar.top;
1526 MoveWindow(fe->hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, FALSE); 1528 MoveWindow(fe->hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, false);
1527 1529
1528 fe->numpad = NULL; 1530 fe->numpad = NULL;
1529 } 1531 }
@@ -1557,7 +1559,7 @@ static void savefile_write(void *wctx, const void *buf, int len)
1557 fwrite(buf, 1, len, fp); 1559 fwrite(buf, 1, len, fp);
1558} 1560}
1559 1561
1560static int savefile_read(void *wctx, void *buf, int len) 1562static bool savefile_read(void *wctx, void *buf, int len)
1561{ 1563{
1562 FILE *fp = (FILE *)wctx; 1564 FILE *fp = (FILE *)wctx;
1563 int ret; 1565 int ret;
@@ -1576,8 +1578,8 @@ static int savefile_read(void *wctx, void *buf, int len)
1576 * permissible. 1578 * permissible.
1577 */ 1579 */
1578static midend *midend_for_new_game(frontend *fe, const game *cgame, 1580static midend *midend_for_new_game(frontend *fe, const game *cgame,
1579 char *arg, int maybe_game_id, 1581 char *arg, bool maybe_game_id,
1580 int maybe_save_file, char **error) 1582 bool maybe_save_file, char **error)
1581{ 1583{
1582 midend *me = NULL; 1584 midend *me = NULL;
1583 1585
@@ -1717,7 +1719,11 @@ static int fe_set_midend(frontend *fe, midend *me)
1717 int x, y; 1719 int x, y;
1718 RECT r; 1720 RECT r;
1719 1721
1720 if (fe->me) midend_free(fe->me); 1722 if (fe->me) {
1723 midend_free(fe->me);
1724 fe->preset_menu = NULL;
1725 sfree(fe->preset_menuitems);
1726 }
1721 fe->me = me; 1727 fe->me = me;
1722 fe->game = midend_which_game(fe->me); 1728 fe->game = midend_which_game(fe->me);
1723 1729
@@ -1757,12 +1763,12 @@ static int fe_set_midend(frontend *fe, midend *me)
1757 fe->statusbar = NULL; 1763 fe->statusbar = NULL;
1758 1764
1759 get_max_puzzle_size(fe, &x, &y); 1765 get_max_puzzle_size(fe, &x, &y);
1760 midend_size(fe->me, &x, &y, FALSE); 1766 midend_size(fe->me, &x, &y, false);
1761 1767
1762 r.left = r.top = 0; 1768 r.left = r.top = 0;
1763 r.right = x; 1769 r.right = x;
1764 r.bottom = y; 1770 r.bottom = y;
1765 AdjustWindowRectEx(&r, WINFLAGS, TRUE, 0); 1771 AdjustWindowRectEx(&r, WINFLAGS, true, 0);
1766 1772
1767#ifdef _WIN32_WCE 1773#ifdef _WIN32_WCE
1768 if (fe->numpad) 1774 if (fe->numpad)
@@ -1781,7 +1787,7 @@ static int fe_set_midend(frontend *fe, midend *me)
1781 rcClient.bottom - (rcTB.bottom - rcTB.top) - 1, 1787 rcClient.bottom - (rcTB.bottom - rcTB.top) - 1,
1782 rcClient.right, 1788 rcClient.right,
1783 rcTB.bottom - rcTB.top, 1789 rcTB.bottom - rcTB.top,
1784 FALSE); 1790 false);
1785 SendMessage(fe->numpad, TB_SETINDENT, (rcClient.right - (10 * 21)) / 2, 0); 1791 SendMessage(fe->numpad, TB_SETINDENT, (rcClient.right - (10 * 21)) / 2, 0);
1786 } 1792 }
1787 else { 1793 else {
@@ -1803,7 +1809,7 @@ static int fe_set_midend(frontend *fe, midend *me)
1803 fe->hwnd, NULL, fe->inst, NULL); 1809 fe->hwnd, NULL, fe->inst, NULL);
1804#ifdef _WIN32_WCE 1810#ifdef _WIN32_WCE
1805 /* Flat status bar looks better on the Pocket PC */ 1811 /* Flat status bar looks better on the Pocket PC */
1806 SendMessage(fe->statusbar, SB_SIMPLE, (WPARAM) TRUE, 0); 1812 SendMessage(fe->statusbar, SB_SIMPLE, (WPARAM) true, 0);
1807 SendMessage(fe->statusbar, SB_SETTEXT, 1813 SendMessage(fe->statusbar, SB_SETTEXT,
1808 (WPARAM) 255 | SBT_NOBORDERS, 1814 (WPARAM) 255 | SBT_NOBORDERS,
1809 (LPARAM) L""); 1815 (LPARAM) L"");
@@ -1845,12 +1851,14 @@ static int fe_set_midend(frontend *fe, midend *me)
1845 AppendMenu(menu, MF_ENABLED, IDM_SEED, TEXT("Rando&m Seed...")); 1851 AppendMenu(menu, MF_ENABLED, IDM_SEED, TEXT("Rando&m Seed..."));
1846#endif 1852#endif
1847 1853
1848 if (!fe->preset_menu) { 1854 assert(!fe->preset_menu);
1855
1856 fe->preset_menu = midend_get_presets(
1857 fe->me, &fe->n_preset_menuitems);
1858 fe->preset_menuitems = snewn(fe->n_preset_menuitems,
1859 struct preset_menuitemref);
1860 {
1849 int i; 1861 int i;
1850 fe->preset_menu = midend_get_presets(
1851 fe->me, &fe->n_preset_menuitems);
1852 fe->preset_menuitems = snewn(fe->n_preset_menuitems,
1853 struct preset_menuitemref);
1854 for (i = 0; i < fe->n_preset_menuitems; i++) 1862 for (i = 0; i < fe->n_preset_menuitems; i++)
1855 fe->preset_menuitems[i].which_menu = NULL; 1863 fe->preset_menuitems[i].which_menu = NULL;
1856 } 1864 }
@@ -2013,7 +2021,7 @@ static int CALLBACK AboutDlgProc(HWND hwnd, UINT msg,
2013 SetDlgItemTextA(hwnd, IDC_ABOUT_VERSION, ver); 2021 SetDlgItemTextA(hwnd, IDC_ABOUT_VERSION, ver);
2014 } 2022 }
2015#endif 2023#endif
2016 return TRUE; 2024 return 1;
2017 2025
2018 case WM_COMMAND: 2026 case WM_COMMAND:
2019 if (LOWORD(wParam) == IDOK) 2027 if (LOWORD(wParam) == IDOK)
@@ -2078,18 +2086,18 @@ static config_item *frontend_get_config(frontend *fe, int which,
2078 2086
2079 ret[i].name = "Include currently shown puzzle"; 2087 ret[i].name = "Include currently shown puzzle";
2080 ret[i].type = C_BOOLEAN; 2088 ret[i].type = C_BOOLEAN;
2081 ret[i].u.boolean.bval = TRUE; 2089 ret[i].u.boolean.bval = true;
2082 i++; 2090 i++;
2083 2091
2084 ret[i].name = "Print solutions"; 2092 ret[i].name = "Print solutions";
2085 ret[i].type = C_BOOLEAN; 2093 ret[i].type = C_BOOLEAN;
2086 ret[i].u.boolean.bval = FALSE; 2094 ret[i].u.boolean.bval = false;
2087 i++; 2095 i++;
2088 2096
2089 if (fe->game->can_print_in_colour) { 2097 if (fe->game->can_print_in_colour) {
2090 ret[i].name = "Print in colour"; 2098 ret[i].name = "Print in colour";
2091 ret[i].type = C_BOOLEAN; 2099 ret[i].type = C_BOOLEAN;
2092 ret[i].u.boolean.bval = FALSE; 2100 ret[i].u.boolean.bval = false;
2093 i++; 2101 i++;
2094 } 2102 }
2095 2103
@@ -2270,7 +2278,7 @@ static int CALLBACK ConfigDlgProc(HWND hwnd, UINT msg,
2270 create_config_controls(fe); 2278 create_config_controls(fe);
2271 } 2279 }
2272#endif 2280#endif
2273 return TRUE; 2281 return 1;
2274 2282
2275 case WM_COMMAND: 2283 case WM_COMMAND:
2276 /* 2284 /*
@@ -2352,7 +2360,7 @@ HWND mkctrl(frontend *fe, int x1, int x2, int y1, int y2,
2352 ret = CreateWindowEx(exstyle, wclass, wtext, 2360 ret = CreateWindowEx(exstyle, wclass, wtext,
2353 wstyle | WS_CHILD | WS_VISIBLE, x1, y1, x2-x1, y2-y1, 2361 wstyle | WS_CHILD | WS_VISIBLE, x1, y1, x2-x1, y2-y1,
2354 fe->cfgbox, (HMENU) wid, fe->inst, NULL); 2362 fe->cfgbox, (HMENU) wid, fe->inst, NULL);
2355 SendMessage(ret, WM_SETFONT, (WPARAM)fe->cfgfont, MAKELPARAM(TRUE, 0)); 2363 SendMessage(ret, WM_SETFONT, (WPARAM)fe->cfgfont, MAKELPARAM(true, 0));
2356 return ret; 2364 return ret;
2357} 2365}
2358#endif 2366#endif
@@ -2398,11 +2406,11 @@ static void about(frontend *fe)
2398 hdc = GetDC(fe->hwnd); 2406 hdc = GetDC(fe->hwnd);
2399 SetMapMode(hdc, MM_TEXT); 2407 SetMapMode(hdc, MM_TEXT);
2400 2408
2401 fe->dlg_done = FALSE; 2409 fe->dlg_done = 0;
2402 2410
2403 fe->cfgfont = CreateFont(-MulDiv(8, GetDeviceCaps(hdc, LOGPIXELSY), 72), 2411 fe->cfgfont = CreateFont(-MulDiv(8, GetDeviceCaps(hdc, LOGPIXELSY), 72),
2404 0, 0, 0, 0, 2412 0, 0, 0, 0,
2405 FALSE, FALSE, FALSE, DEFAULT_CHARSET, 2413 false, false, false, DEFAULT_CHARSET,
2406 OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, 2414 OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
2407 DEFAULT_QUALITY, 2415 DEFAULT_QUALITY,
2408 FF_SWISS, 2416 FF_SWISS,
@@ -2453,7 +2461,7 @@ static void about(frontend *fe)
2453 DS_MODALFRAME | WS_POPUP | WS_VISIBLE | 2461 DS_MODALFRAME | WS_POPUP | WS_VISIBLE |
2454 WS_CAPTION | WS_SYSMENU*/) &~ 2462 WS_CAPTION | WS_SYSMENU*/) &~
2455 (WS_MAXIMIZEBOX | WS_OVERLAPPED), 2463 (WS_MAXIMIZEBOX | WS_OVERLAPPED),
2456 FALSE, 0); 2464 false, 0);
2457 2465
2458 /* 2466 /*
2459 * Centre the dialog on its parent window. 2467 * Centre the dialog on its parent window.
@@ -2474,7 +2482,7 @@ static void about(frontend *fe)
2474 fe->hwnd, NULL, fe->inst, NULL); 2482 fe->hwnd, NULL, fe->inst, NULL);
2475 } 2483 }
2476 2484
2477 SendMessage(fe->cfgbox, WM_SETFONT, (WPARAM)fe->cfgfont, FALSE); 2485 SendMessage(fe->cfgbox, WM_SETFONT, (WPARAM)fe->cfgfont, false);
2478 2486
2479 SetWindowLongPtr(fe->cfgbox, GWLP_USERDATA, (LONG_PTR)fe); 2487 SetWindowLongPtr(fe->cfgbox, GWLP_USERDATA, (LONG_PTR)fe);
2480 SetWindowLongPtr(fe->cfgbox, DWLP_DLGPROC, (LONG_PTR)AboutDlgProc); 2488 SetWindowLongPtr(fe->cfgbox, DWLP_DLGPROC, (LONG_PTR)AboutDlgProc);
@@ -2498,7 +2506,7 @@ static void about(frontend *fe)
2498 2506
2499 SendMessage(fe->cfgbox, WM_INITDIALOG, 0, 0); 2507 SendMessage(fe->cfgbox, WM_INITDIALOG, 0, 0);
2500 2508
2501 EnableWindow(fe->hwnd, FALSE); 2509 EnableWindow(fe->hwnd, false);
2502 ShowWindow(fe->cfgbox, SW_SHOWNORMAL); 2510 ShowWindow(fe->cfgbox, SW_SHOWNORMAL);
2503 while ((gm=GetMessage(&msg, NULL, 0, 0)) > 0) { 2511 while ((gm=GetMessage(&msg, NULL, 0, 0)) > 0) {
2504 if (!IsDialogMessage(fe->cfgbox, &msg)) 2512 if (!IsDialogMessage(fe->cfgbox, &msg))
@@ -2506,14 +2514,14 @@ static void about(frontend *fe)
2506 if (fe->dlg_done) 2514 if (fe->dlg_done)
2507 break; 2515 break;
2508 } 2516 }
2509 EnableWindow(fe->hwnd, TRUE); 2517 EnableWindow(fe->hwnd, true);
2510 SetForegroundWindow(fe->hwnd); 2518 SetForegroundWindow(fe->hwnd);
2511 DestroyWindow(fe->cfgbox); 2519 DestroyWindow(fe->cfgbox);
2512 DeleteObject(fe->cfgfont); 2520 DeleteObject(fe->cfgfont);
2513#endif 2521#endif
2514} 2522}
2515 2523
2516static int get_config(frontend *fe, int which) 2524static bool get_config(frontend *fe, int which)
2517{ 2525{
2518#ifdef _WIN32_WCE 2526#ifdef _WIN32_WCE
2519 fe->cfg_which = which; 2527 fe->cfg_which = which;
@@ -2552,11 +2560,11 @@ static int get_config(frontend *fe, int which)
2552 hdc = GetDC(fe->hwnd); 2560 hdc = GetDC(fe->hwnd);
2553 SetMapMode(hdc, MM_TEXT); 2561 SetMapMode(hdc, MM_TEXT);
2554 2562
2555 fe->dlg_done = FALSE; 2563 fe->dlg_done = 0;
2556 2564
2557 fe->cfgfont = CreateFont(-MulDiv(8, GetDeviceCaps(hdc, LOGPIXELSY), 72), 2565 fe->cfgfont = CreateFont(-MulDiv(8, GetDeviceCaps(hdc, LOGPIXELSY), 72),
2558 0, 0, 0, 0, 2566 0, 0, 0, 0,
2559 FALSE, FALSE, FALSE, DEFAULT_CHARSET, 2567 false, false, false, DEFAULT_CHARSET,
2560 OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, 2568 OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
2561 DEFAULT_QUALITY, 2569 DEFAULT_QUALITY,
2562 FF_SWISS, 2570 FF_SWISS,
@@ -2633,7 +2641,7 @@ static int get_config(frontend *fe, int which)
2633 DS_MODALFRAME | WS_POPUP | WS_VISIBLE | 2641 DS_MODALFRAME | WS_POPUP | WS_VISIBLE |
2634 WS_CAPTION | WS_SYSMENU*/) &~ 2642 WS_CAPTION | WS_SYSMENU*/) &~
2635 (WS_MAXIMIZEBOX | WS_OVERLAPPED), 2643 (WS_MAXIMIZEBOX | WS_OVERLAPPED),
2636 FALSE, 0); 2644 false, 0);
2637 2645
2638 /* 2646 /*
2639 * Centre the dialog on its parent window. 2647 * Centre the dialog on its parent window.
@@ -2655,7 +2663,7 @@ static int get_config(frontend *fe, int which)
2655 sfree(title); 2663 sfree(title);
2656 } 2664 }
2657 2665
2658 SendMessage(fe->cfgbox, WM_SETFONT, (WPARAM)fe->cfgfont, FALSE); 2666 SendMessage(fe->cfgbox, WM_SETFONT, (WPARAM)fe->cfgfont, false);
2659 2667
2660 SetWindowLongPtr(fe->cfgbox, GWLP_USERDATA, (LONG_PTR)fe); 2668 SetWindowLongPtr(fe->cfgbox, GWLP_USERDATA, (LONG_PTR)fe);
2661 SetWindowLongPtr(fe->cfgbox, DWLP_DLGPROC, (LONG_PTR)ConfigDlgProc); 2669 SetWindowLongPtr(fe->cfgbox, DWLP_DLGPROC, (LONG_PTR)ConfigDlgProc);
@@ -2691,7 +2699,7 @@ static int get_config(frontend *fe, int which)
2691 mkctrl(fe, col1l, col2r, y, y+height, "BUTTON", 2699 mkctrl(fe, col1l, col2r, y, y+height, "BUTTON",
2692 BS_NOTIFY | BS_AUTOCHECKBOX | WS_TABSTOP, 2700 BS_NOTIFY | BS_AUTOCHECKBOX | WS_TABSTOP,
2693 0, i->name, (j->ctlid = id++)); 2701 0, i->name, (j->ctlid = id++));
2694 CheckDlgButton(fe->cfgbox, j->ctlid, (i->u.boolean.bval != 0)); 2702 CheckDlgButton(fe->cfgbox, j->ctlid, i->u.boolean.bval);
2695 y += height; 2703 y += height;
2696 break; 2704 break;
2697 2705
@@ -2745,7 +2753,7 @@ static int get_config(frontend *fe, int which)
2745 2753
2746 SendMessage(fe->cfgbox, WM_INITDIALOG, 0, 0); 2754 SendMessage(fe->cfgbox, WM_INITDIALOG, 0, 0);
2747 2755
2748 EnableWindow(fe->hwnd, FALSE); 2756 EnableWindow(fe->hwnd, false);
2749 ShowWindow(fe->cfgbox, SW_SHOWNORMAL); 2757 ShowWindow(fe->cfgbox, SW_SHOWNORMAL);
2750 while ((gm=GetMessage(&msg, NULL, 0, 0)) > 0) { 2758 while ((gm=GetMessage(&msg, NULL, 0, 0)) > 0) {
2751 if (!IsDialogMessage(fe->cfgbox, &msg)) 2759 if (!IsDialogMessage(fe->cfgbox, &msg))
@@ -2753,7 +2761,7 @@ static int get_config(frontend *fe, int which)
2753 if (fe->dlg_done) 2761 if (fe->dlg_done)
2754 break; 2762 break;
2755 } 2763 }
2756 EnableWindow(fe->hwnd, TRUE); 2764 EnableWindow(fe->hwnd, true);
2757 SetForegroundWindow(fe->hwnd); 2765 SetForegroundWindow(fe->hwnd);
2758 DestroyWindow(fe->cfgbox); 2766 DestroyWindow(fe->cfgbox);
2759 DeleteObject(fe->cfgfont); 2767 DeleteObject(fe->cfgfont);
@@ -2822,19 +2830,19 @@ static void new_game_size(frontend *fe, float scale)
2822 int x, y; 2830 int x, y;
2823 2831
2824 get_max_puzzle_size(fe, &x, &y); 2832 get_max_puzzle_size(fe, &x, &y);
2825 midend_size(fe->me, &x, &y, FALSE); 2833 midend_size(fe->me, &x, &y, false);
2826 2834
2827 if (scale != 1.0) { 2835 if (scale != 1.0) {
2828 x = (int)((float)x * fe->puzz_scale); 2836 x = (int)((float)x * fe->puzz_scale);
2829 y = (int)((float)y * fe->puzz_scale); 2837 y = (int)((float)y * fe->puzz_scale);
2830 midend_size(fe->me, &x, &y, TRUE); 2838 midend_size(fe->me, &x, &y, true);
2831 } 2839 }
2832 fe->ymin = (fe->xmin * y) / x; 2840 fe->ymin = (fe->xmin * y) / x;
2833 2841
2834 r.left = r.top = 0; 2842 r.left = r.top = 0;
2835 r.right = x; 2843 r.right = x;
2836 r.bottom = y; 2844 r.bottom = y;
2837 AdjustWindowRectEx(&r, WINFLAGS, TRUE, 0); 2845 AdjustWindowRectEx(&r, WINFLAGS, true, 0);
2838 2846
2839 if (fe->statusbar != NULL) { 2847 if (fe->statusbar != NULL) {
2840 GetWindowRect(fe->statusbar, &sr); 2848 GetWindowRect(fe->statusbar, &sr);
@@ -2859,7 +2867,7 @@ static void new_game_size(frontend *fe, float scale)
2859 new_bitmap(fe, x, y); 2867 new_bitmap(fe, x, y);
2860 2868
2861#ifdef _WIN32_WCE 2869#ifdef _WIN32_WCE
2862 InvalidateRect(fe->hwnd, NULL, TRUE); 2870 InvalidateRect(fe->hwnd, NULL, true);
2863#endif 2871#endif
2864 midend_redraw(fe->me); 2872 midend_redraw(fe->me);
2865} 2873}
@@ -2871,7 +2879,7 @@ static void new_game_size(frontend *fe, float scale)
2871 * new window size. 2879 * new window size.
2872 */ 2880 */
2873 2881
2874static void adjust_game_size(frontend *fe, RECT *proposed, int isedge, 2882static void adjust_game_size(frontend *fe, RECT *proposed, bool isedge,
2875 int *wx_r, int *wy_r) 2883 int *wx_r, int *wy_r)
2876{ 2884{
2877 RECT cr, wr; 2885 RECT cr, wr;
@@ -2881,7 +2889,7 @@ static void adjust_game_size(frontend *fe, RECT *proposed, int isedge,
2881 * difference in size we're asking for. */ 2889 * difference in size we're asking for. */
2882 GetClientRect(fe->hwnd, &cr); 2890 GetClientRect(fe->hwnd, &cr);
2883 wr = cr; 2891 wr = cr;
2884 AdjustWindowRectEx(&wr, WINFLAGS, TRUE, 0); 2892 AdjustWindowRectEx(&wr, WINFLAGS, true, 0);
2885 2893
2886 xdiff = (proposed->right - proposed->left) - (wr.right - wr.left); 2894 xdiff = (proposed->right - proposed->left) - (wr.right - wr.left);
2887 ydiff = (proposed->bottom - proposed->top) - (wr.bottom - wr.top); 2895 ydiff = (proposed->bottom - proposed->top) - (wr.bottom - wr.top);
@@ -2958,17 +2966,17 @@ static void new_game_type(frontend *fe)
2958 update_copy_menu_greying(fe); 2966 update_copy_menu_greying(fe);
2959} 2967}
2960 2968
2961static int is_alt_pressed(void) 2969static bool is_alt_pressed(void)
2962{ 2970{
2963 BYTE keystate[256]; 2971 BYTE keystate[256];
2964 int r = GetKeyboardState(keystate); 2972 int r = GetKeyboardState(keystate);
2965 if (!r) 2973 if (!r)
2966 return FALSE; 2974 return false;
2967 if (keystate[VK_MENU] & 0x80) 2975 if (keystate[VK_MENU] & 0x80)
2968 return TRUE; 2976 return true;
2969 if (keystate[VK_RMENU] & 0x80) 2977 if (keystate[VK_RMENU] & 0x80)
2970 return TRUE; 2978 return true;
2971 return FALSE; 2979 return false;
2972} 2980}
2973 2981
2974static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, 2982static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
@@ -3139,7 +3147,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
3139 "supported by this program"; 3147 "supported by this program";
3140 } else { 3148 } else {
3141 me = midend_for_new_game(fe, gamelist[i], NULL, 3149 me = midend_for_new_game(fe, gamelist[i], NULL,
3142 FALSE, FALSE, &err_w); 3150 false, false, &err_w);
3143 err = err_w; 3151 err = err_w;
3144 rewind(fp); /* for the actual load */ 3152 rewind(fp); /* for the actual load */
3145 } 3153 }
@@ -3181,7 +3189,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
3181 int p = wParam - IDM_GAMES; 3189 int p = wParam - IDM_GAMES;
3182 char *error = NULL; 3190 char *error = NULL;
3183 fe_set_midend(fe, midend_for_new_game(fe, gamelist[p], NULL, 3191 fe_set_midend(fe, midend_for_new_game(fe, gamelist[p], NULL,
3184 FALSE, FALSE, &error)); 3192 false, false, &error));
3185 sfree(error); 3193 sfree(error);
3186 } else 3194 } else
3187#endif 3195#endif
@@ -3432,12 +3440,13 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
3432 case WM_SIZING: 3440 case WM_SIZING:
3433 { 3441 {
3434 RECT *sr = (RECT *)lParam; 3442 RECT *sr = (RECT *)lParam;
3435 int wx, wy, isedge = 0; 3443 int wx, wy;
3444 bool isedge = false;
3436 3445
3437 if (wParam == WMSZ_TOP || 3446 if (wParam == WMSZ_TOP ||
3438 wParam == WMSZ_RIGHT || 3447 wParam == WMSZ_RIGHT ||
3439 wParam == WMSZ_BOTTOM || 3448 wParam == WMSZ_BOTTOM ||
3440 wParam == WMSZ_LEFT) isedge = 1; 3449 wParam == WMSZ_LEFT) isedge = true;
3441 adjust_game_size(fe, sr, isedge, &wx, &wy); 3450 adjust_game_size(fe, sr, isedge, &wx, &wy);
3442 3451
3443 /* Given the window size the puzzles constrain 3452 /* Given the window size the puzzles constrain
@@ -3456,7 +3465,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
3456 } else { 3465 } else {
3457 sr->right = sr->left + wx; 3466 sr->right = sr->left + wx;
3458 } 3467 }
3459 return TRUE; 3468 return true;
3460 } 3469 }
3461 break; 3470 break;
3462#endif 3471#endif
@@ -3475,10 +3484,10 @@ static int FindPreviousInstance()
3475 if (hOtherWnd) 3484 if (hOtherWnd)
3476 { 3485 {
3477 SetForegroundWindow (hOtherWnd); 3486 SetForegroundWindow (hOtherWnd);
3478 return TRUE; 3487 return true;
3479 } 3488 }
3480 3489
3481 return FALSE; 3490 return false;
3482} 3491}
3483#endif 3492#endif
3484 3493
@@ -3632,7 +3641,7 @@ void split_into_argv(char *cmdline, int *argc, char ***argv,
3632 p = cmdline; q = outputline; outputargc = 0; 3641 p = cmdline; q = outputline; outputargc = 0;
3633 3642
3634 while (*p) { 3643 while (*p) {
3635 int quote; 3644 bool quote;
3636 3645
3637 /* Skip whitespace searching for start of argument. */ 3646 /* Skip whitespace searching for start of argument. */
3638 while (*p && isspace(*p)) p++; 3647 while (*p && isspace(*p)) p++;
@@ -3642,7 +3651,7 @@ void split_into_argv(char *cmdline, int *argc, char ***argv,
3642 outputargv[outputargc] = q; 3651 outputargv[outputargc] = q;
3643 outputargstart[outputargc] = p; 3652 outputargstart[outputargc] = p;
3644 outputargc++; 3653 outputargc++;
3645 quote = 0; 3654 quote = false;
3646 3655
3647 /* Copy data into the argument until it's finished. */ 3656 /* Copy data into the argument until it's finished. */
3648 while (*p) { 3657 while (*p) {
@@ -3676,7 +3685,7 @@ void split_into_argv(char *cmdline, int *argc, char ***argv,
3676 3685
3677 if (quotes > 0) { 3686 if (quotes > 0) {
3678 /* Outside a quote segment, a quote starts one. */ 3687 /* Outside a quote segment, a quote starts one. */
3679 if (!quote) quotes--, quote = 1; 3688 if (!quote) quotes--, quote = true;
3680 3689
3681 /* Now we produce (n+1)/3 literal quotes... */ 3690 /* Now we produce (n+1)/3 literal quotes... */
3682 for (i = 3; i <= quotes+1; i += 3) *q++ = '"'; 3691 for (i = 3; i <= quotes+1; i += 3) *q++ = '"';
@@ -3785,7 +3794,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
3785 3794
3786 fe = frontend_new(inst); 3795 fe = frontend_new(inst);
3787 me = midend_for_new_game(fe, gg, argc > 0 ? argv[0] : NULL, 3796 me = midend_for_new_game(fe, gg, argc > 0 ? argv[0] : NULL,
3788 TRUE, TRUE, &error); 3797 true, true, &error);
3789 if (!me) { 3798 if (!me) {
3790 char buf[128]; 3799 char buf[128];
3791#ifdef COMBINED 3800#ifdef COMBINED