@database MineSweeper.guide
@author "John F. Matthews"
@(c) "Copyright © 1993 Commodore-Amiga, Inc."
@$VER: Sample.guide 2.5 (13.12.93)
@font helvetica.font 11

@node Main "MineSweeper Documentation"

               @{b}MineSweeper Version 2.5
                  John F. Matthews@{ub}


@{" About MineSweeper 2.5 " link About}
@{" Copyright Notice " link Copyright}
@{" History " link History}
@{" Bugs " link Bugs}
@{" Author " link Author}


@{u}Instructions@{uu}

@{" Introduction:  What Is Minesweeper?" link Intro}

@{i}How to ...@{ui}
	@{" Keep Score " link KeepScore}
	@{" Mark a Square " link MarkSquare}
	@{" Play the Game " link PlayGame}
	@{" Understand the Rules of the Game " link RulesGame}
	@{" Use Strategies and Hints " link Strategies}

@{" Mouse " link Mouse}
@{" Keyboard " link Keyboard}
@{" Menus " link Menus}

@ENDNODE

@NODE About "About MineSweeper 2.5"

This version of MineSweeper was written in Modula2 by myself,
John Matthews, to be as close as possible to the version that
comes with Microsoft Windows 3.1 (tm), without being based at
all on either the source or object code of that version.

This version of MineSweeper, is public domain. Feel free to
give it away, or upload it to your favourite FTP site or BBS,
but please don't modify it. If you want the source, let me know.

This program looks best on WB2.0 or higher, on a deinterlaced,
or dblscan workbench, but should work on earlier, lower resolution
displays also. Lower resolutions will limit the size of the custom
option however.

MineSweeper is one of those games which are simple in concept,
while surprisingly absorbing and addictive to play.

Minesweeper is a challenging game of strategy and luck. Here
follow some instructions on how to play.

@ENDNODE

@NODE Copyright "Copyright"

This version of MineSweeper is copyright 1992-1993 John Matthews,
and is totally freeware. Distribute it as you like but leave the
documentation intact, and don't modify the program itself. And
please do not sell it for profit, or as part of another product.

@ENDNODE

@NODE History "History"

Version 2.0 - June 1992 (I think).
 First Release


Version 2.1 - April 6 1993.
 Bug Fix :
  Enforcer hits at startup, font colour.


Version 2.2 - September 10 1993.
 Bug Fixes : 
  Window refreshing after obscure, while high score window up.
  Handles right mouse button better now
   - now works with popup menu programs,
     like Magic Menu (© Martin Korndörfer)

 Modified operation a little
   (if you can't figure out how to use it,
    you won't be any good at the game :-) )

 Added Custom mode.


Version 2.3 - September 22 1993
 Bug Fix :
  hashing of display during right mouse button moves on
  non interlaced displays.

 Enhancements :
  optimised search routines into assembly language for greater speed
  flashes display at end of game
  changed "Shrink Window" to @{"Pause" link Menus}, doesn't reset game.
  added keyboard equivalents
  changed from stack search to queue search
    (ripple out after uncovering instead of diagonal paths :-) )
  modified docs into AmigaGuide (tm) format!

Version 2.4 - September 28 1993
 I was in town on Thursday, uploading the new version, and I read my mail.
 So here are the improvements that were requested.
 
 1. Sun-Glasses on successful game :-) (Ingimar Robertsson)
 2. Different methods for Game-Over test
     - All the mines found
     - All the spaces not containing mines uncovered
     - Both of the above
    (Ingimar Robertsson)
    I felt the choice was necessary, as the purpose of a Minesweeper
    should be to Find all the mines, not all the safe locations.
    Really, to make this more interesting, there should be an
    option of a random number of mines, undisclosed.
    Maybe later...
 3. Colour coding of numbers.
    This feature is only available under Version 39 or greater
    of the OS (Kickstart 3)
    (Hannes Gnad)
 4. Previously, the upper left square never contained a mine.
    Now, whatever square you first uncover will have no mine in it.
    (Ingimar Robertsson)

Version 2.5 - December 13 1993
 A few modifications made on request, and one minor bug fix.

 1. Apparently, faulty mice (ie any that came with an Amiga since
    the Amiga 1000, the best quality machine) make it difficult
    to use the 'mobile cursor', or release over the desired
    square technique.
    At the request of Jonas Peterrson (and wife), this is now switchable.
    The setting is remembered between games ;-)
 2. In the continuing quest to make my version as similar to that
    other version as practical, and desirable, and to make the above
    option safer, at the suggestion (again) of Jonas Peterrson (and wife),
    clicking the other mouse button during an operation, aborts.
 3. The clock no longer restarts after the sequence:
    game over, shrink, unshrink
    (Steven Kuck)

 4. Released the source, that is to say the main program file.
    This file is over 3000 lines of messy code. Over the year and
    a half or so that I have worked, off and on, on MineSweeper,
    there is little that hasn't been changed to improve the game
    technique, look and feel, smoothness of display, and speed.
    Not to mention suggestions.
    The code is not pretty, and the purpose of much of it will seem
    obscure. The most obscure parts are those dealing with the
    inadequacies of my compiler to modern Amiga programming, and
    attempts to provide a 2.0+ look and feel even under 1.3.
    Also the optimisations 'occasionally' cause a mess.

    I don't include the full source, as what is missing would only be
    useful to someone with M2Sprint Modula-2, and even then most of my
    libraries have been modified.
    

@ENDNODE

@NODE Bugs "Bugs"

None that I know of. :-)

@ENDNODE

@NODE Author "Author"

The author ...

   John Matthews

can be reached on internet as

   tribble@gphs.vuw.ac.nz

or at

   4 Wadham Grove
   Tawa, 6203
   New Zealand

@ENDNODE


@NODE Intro "Introduction : What Is Minesweeper?"

When playing Minesweeper you are presented with a mine field,  and your
objective is to locate all the mines as quickly as  possible.

To locate the mines, you uncover the squares on the game board
that do not contain mines, and you mark the squares that do  contain mines.

The trick is determining which squares are which.

If you uncover all the squares without mines, and mark all those with,
you win; if you  uncover a mine instead of marking it, you lose the game.

The  faster you play, the lower your score.

You can use the counters at  the top of the window to keep
track of your progress.

The counter in the upper-right corner of the window is a timer,
which displays your playing time in seconds. The timer does
not  begin counting until you select a square.

The counter in the upper-left corner of the window initially
indicates the number of mines hidden in the mine field. Every time
you mark a square as a mine, this number decreases by one,
@{u}even if you incorrectly mark a square@{uu}.

@ENDNODE

@NODE KeepScore "Keeping Score"

Minesweeper scoring is simple. The counter in the upper-right  corner
of the window indicates your playing time. The faster  you find
all the mines, the better your score. 

To see a list of your fastest playing times

  From the Game menu, choose Best Times. 

@ENDNODE

@NODE MarkSquare "Marking a Square"

Knowing when to mark a square as a mine is the key to winning 
the game. 

To uncover a square ...

  Point to the square, and click the left mouse button. 

To mark a square as a mine ...

  Point to the square, and click the right mouse button once. 

To mark a square as a question mark ...

  Point to the square, and click the right mouse button twice. 

To change a square marked as a mine into a question mark ...

  Point to the square, and click the right mouse button once. 

To clear a square marked as a mine ...

  Point to the square, and click the right mouse button twice. 

Once you have marked at least one square as a mine, you may  be able to
safely uncover more squares by "clearing around"  them. 

To uncover all the squares around an uncovered square ...

  Click the right mouse button over that square.

Instead of just clicking on a square, you can click-drag across the
board until you reach your desired square and then release.

In the case of the right mouse button, the effect of drag clicking
depends on the square you clicked on, not the one you released over.

For instance, clicking the right mouse button down over a covered
square and (before releasing the button) moving the mouse will
result in attempting to mark the square you release over as a mine.

Clicking the right mouse button down over an uncovered square and
dragging will result in attempting to uncover all the squares
around the square.

In each of these two cases, releasing over a square of the opposite
type (covered/uncovered) will have no effect.

@ENDNODE

@NODE PlayGame "Playing the Game"

The object of Minesweeper is to correctly mark all mines as 
quickly as possible without uncovering one. The following 
section explains how to play the game. 

To choose a skill level

	From the Game menu, choose Beginner, Intermediate, or 
Expert. The higher the skill level, the larger the mine field. 

To start a new game

	From the Game menu, choose New, or use Right-Amiga-N. Or you
can  click the yellow "happy face" at the top of the game board. 

To locate the mines

1.  To uncover a square, select it using the left mouse button. 
    If the square is a mine, you lose. 

2.  If the square isn't a mine, a number may appear. This number 
represents the number of mines in the surrounding eight  squares.
    If there are no mines around the square, it will show blank,
and all the squares around it will automatically be uncovered.
This process is recursive, and can result in large areas of the
board being uncovered.

3.  To mark a square as a mine, select it with the right mouse  button. 
    To mark a square you are uncertain about, point to it and  click
twice with the right mouse button. This marks the  square with a
question mark (?). Later, you can either mark  the square as a mine, or
uncover it. 

@ENDNODE

@NODE RulesGame "Understanding the Rules of the Game"

Follow these rules when playing Minesweeper

The playing area is a mine field, simulated by a grid of  squares.
Initially, all the squares are covered. 

To uncover a square, point to it and click the left mouse  button. You
continue to uncover squares until only the  squares containing mines
are covered. 

If you uncover a square that does not contain a mine, it  either
contains a number or is blank. 

If the square contains a number, N, then there are N  mines in the
surrounding eight squares. If the square is  blank, there are no mines
in the surrounding eight squares. 

If you uncover a blank square, the surrounding eight  squares are
uncovered automatically because there  cannot be any mines under them. 

If you know that a square is a mine, you can mark the  square. 

If you uncover a square that contains a mine, the game is  over and all
the mines are displayed. 

You can also "clear around" an uncovered number square  whose mine has
already been marked.  For example, two squares labeled 1 may both be
touching a  marked square. If you clear around the uncovered squares, 
you may uncover additional squares that do not contain mines.  If you
clear around a square whose mine is already marked,  the surrounding
numbered squares are uncovered. 

To clear around a square ...

Point to the numbered square, and then click the right mouse  button. 

You are not allowed to clear around a square if you have  not marked
enough mines, or have marked to many mines, in the surrounding eight
squares,  or if the square is covered.

For example, if you try to clear around a square labeled 3, and you
have marked only two squares with mines, nothing will happen.
Or, if you try to  clear around an uncovered square, nothing will
happen. 

If you clear around a square, and there is an unmarked  mine in the
surrounding eight squares, it is uncovered and  the game is over.

If you clear around a square whose mines are incorrectly  marked and a
mine is uncovered, the game is over. 

@ENDNODE

@NODE Strategies "Using Strategies and Hints"

Helpful hints for playing Minesweeper

If an uncovered square is labeled 1, and there is only one  covered
square touching it, that covered square must be a  mine. 

If an uncovered square already has the correct number of  adjacent
mines marked, clear around it. 

Don't guess unless you have to. If you can't figure out how to move,
try  approaching the area from a different direction or marking
squares with question marks.

Guessing may occasionally finish the game more quickly by opening
out the board, but it defeats the purpose of skill.

@ENDNODE

@NODE Mouse "Using the Mouse"
The Amiga mouse is fully utilised by MineSweeper, mainly to point at
the minefield. Both mouse buttons are used, and because of this,
accessing the menus via the mouse is only possible when the mouse
is not over the minefield.

The @{b}Left Mouse Button@{ub} is used to uncover a square, when you
are sure there is no mine under it, or if you have been reduced
to guessing. The square you release the mouse over, is the square
which will be uncovered. If there is a mine there, the game is over.

The @{b}Right Mouse Button@{ub} has two uses, dependant on the state of
the square it is over when pressed down.

If the square is covered, the right mouse button cycles through the
following - blank->marked->?->blank, though the '?' stage can be
switched of with the @{"Marks (?)" link Menus} menu item.

If the square over which the right mouse button is pressed is uncovered,
the operation is @{b}clear around@{ub}, and when the right mouse button is
released, if the conditions are met, the surrounding squares will be
uncovered. The conditions are -
	1. the square must be uncovered
	2. the number it shows must equal the number of mines marked around it.

Of course, if one or more of the marked mines around the square are incorrect,
you will be uncovering the real mines, and will lose the game.

@ENDNODE

@NODE Keyboard "Keyboard Equivalents"

This version of MineSweeper has some keyboard equivalents, as follows.

@{b}M or G@{ub}
Mark or Guess a square as a Mine.

@{b}U or 1@{ub}
Uncover a square. Same as @{b}Left Mouse Button@{ub}.

@{b}L or A@{ub}
Look Around. Same as @{b}Right Mouse Button@{ub} initiated over an uncovered square.

@{b}2@{ub}
Same as @{b}Right Mouse Button@{ub}.

@{b}P@{ub}
Pause.

@ENDNODE

@NODE Menus "Menus"

Due to the left mouse button being used by MineSweeper, you can
only access the Menus via their hotkeys, or while the mouse is
not over the minefield.
@{b}@{u}Game@{uu} Menu@{ub}

@{b}New@{ub}  @{i}Amiga - @{ui} @{b}N@{ub}
Begins a new game, quitting the one in progress if necessary.
The new game will be at the same difficulty level.
This is equivalent to clicking on the smiley face gadget.

@{b}Beginner@{ub}  @{i}Amiga - @{ui} @{b}B@{ub}
Begins a new game, changing to Beginner level first if necessary.
Beginner Level is an 8 by 8 grid with 10 mines.

@{b}Intermediate@{ub}  @{i}Amiga - @{ui} @{b}I@{ub}
Begins a new game, changing to Intermediate level first if necessary.
Intermediate Level is an 16 by 16 grid with 40 mines.

@{b}Expert@{ub}  @{i}Amiga - @{ui} @{b}E@{ub}
Begins a new game, changing to Expert level first if necessary.
Expert Level is an 32 by 16 grid with 99 mines.

@{b}Custom@{ub}  @{i}Amiga - @{ui} @{b}C@{ub}
Begins a new game, after first prompting for the size of the Custom
board, and number of mines.
If you change any settings, the old high score for Custom is forgotten.
The upper limit on the board size is 32 by 32 squares, with 1023 mines.

@{b}Marks (?)@{ub}  @{i}Amiga - @{ui} @{b}M@{ub}
When on, this allows the cycle blank->marked->?->blank. If off, you just
get blank->marked->blank from the right mouse button.

@{b}Best Times@{ub}  @{i}Amiga - @{ui} @{b}T@{ub}
Shows the Best Times table

@{b}About MineSweeper@{ub}  @{i}Amiga - @{ui} @{b}?@{ub}
Information about the version/author.

@{b}Pause@{ub}  @{i}Amiga - @{ui} @{b}P@{ub}
Shrinks the window @{i}(so you can't study the board)@{ui}, and stops the clock.
Click on the smiley face to return to play.

@{b}Quit@{ub}  @{i}Amiga - @{ui} @{b}Q@{ub}
Quits.

@{b}@{u}Completion@{uu} Menu@{ub}

@{b}All Mines Found@{ub}
Game over when all the mines have markers over them, ie they have
all been located.

@{b}All Non Mines Found@{ub}
Game over when all empty spaces uncovered.

@{b}Both@{ub}
Game over when all squares are either uncovered or marked as mined.

@{b}Either@{ub}
Game over when you have either marked all the mines, or clear all
non-mined squares.

Be aware that finding all mined squares takes into account incorrectly
marked squares. The 'Mines still remaining' count can read zero, without
the game being over.
@ENDNODE

