packages icon



 XMINES(1)                 X Version 11 Release 4                  XMINES(1)
                               22 August 1990



 NAME
      xmines - a minefield game

 SYNOPSIS
      xmines [ -toolkitoption ...] [-cellsize cellsize] [-rows rows] [-
      columns columns] [-mines mines]

 DESCRIPTION
      The xmines program is a game in which you attempt to cross a minefield
      without getting blown up.  You can control the size of the minefield
      and the density of the mines.  At each step, you are told how many
      mines are in the neighboring locations, from which you can often
      deduce the locations of the mines.  If you are stuck, you have the
      option of asking for a hint if you don't feel like taking a chance on
      moving to a location which might contain a mine.  Xmines keeps track
      of how many moves and hints you have used, and how many safe and mined
      locations you have marked.

 OPTIONS
      Xmines accepts all of the standard X Toolkit command line options.  In
      addition, the command line options listed below may be specified.
      Each of these command line options corresponds to a resource.  For
      more information about the effect of these command line options, see
      the RESOURCES section below.

      The command line options and the resources they represent are:

      -cellsize size
              This option specifies the size in pixels of each of the cells
              (squares) in the playing field.  The cellsize command line
              option corresponds to the "cellSize" resource.

      -rows number
              This option specifies the number of rows in the playing field.
              The rows command line option corresponds to the "rows"
              resource.

      -columns number
              This option specifies the number of columns in the playing
              field.  The columns command line option corresponds to the
              "columns" resource.

      -mines number
              This option specifies the number of mines to be placed in the
              playing field.  The mines command line option corresponds to
              the "mines" resource.

 THE DISPLAY
      The xmines window contains the following: a title line, a command
      widget line, a count display line, a status line, and the playing
      field.



                                    - 1 -         Formatted:  April 27, 2024






 XMINES(1)                 X Version 11 Release 4                  XMINES(1)
                               22 August 1990



      The title line lists the class name (XMines) and the current version
      of xmines.

      The command widget line contains a number of input widgets that you
      use to control the program.  These are:

      Mine count
              This text field allows you to enter a new mine count.  This
              allows you to play an easier or harder game.  When you enter a
              return in this field, a restart is automatically done.  Note
              that you must delete the old number before putting in a new
              number.  If you enter a number that is too large, xmines will
              limit it to the largest number of mines that will fit into the
              board; however, this will always produce a minefield which is
              impossible to traverse (see the discussion under the "restart"
              button below).  This is a standard text widget, so you can cut
              and paste or define editing translations to your own desires
              using the standard text widget actions.

      restart When this button is pressed, xmines resets the playing field.
              The number of mines specified in the "Mine count" widget are
              hidden in the playing field, and the player is placed into the
              upper left square.  The object of the game is to move the
              player to the goal square in the lower right corner of the
              playing field.  Xmines will never place a mine in the starting
              square, the goal square, or the three squares immediately
              adjacent to the starting square.  Thus, when you first start a
              game, you will always see the message "No mines nearby" in the
              status line.  If the number of mines is very large, it is
              possible to generate a minefield which has no safe path from
              start to goal.  In this case, the word "(impossible)" appears
              in the status line.  You can either select a smaller number of
              mines and try again, or simply try again with the same number
              until a potentially traversable minefield is generated.

      hint    If you are stuck and want to know which neighboring square you
              can move to that is guaranteed not to contain a mine, you can
              press this button, and xmines will mark one of the adjacent
              squares as "ok", meaning there is no mine there.  If one of
              the adjacent squares is already marked as "ok" but not yet
              traversed, or if there are no adjacent and untraversed squares
              which do not contain mines, then no square is marked.  The
              number of hints you have asked for is displayed in the line
              below the buttons.

      quit    When this button is pressed, xmines exits.

      The count display line displays the various numbers that the program
      keeps track of:





                                    - 2 -         Formatted:  April 27, 2024






 XMINES(1)                 X Version 11 Release 4                  XMINES(1)
                               22 August 1990



      Moves   The number of moves that you have made so far in this round.

      Hints   The number of hints that you have asked for so far in this
              round.  This number is incremented even if you ask for a hint
              and no squares are marked "ok".

      Safes   The number of squares which are marked "ok".  Each time you
              mark a square as safe, this number increments.  Each time you
              unmark a safe square, either by explicitly unmarking it,
              marking it as a mine, or moving onto it, this number is
              decremented.

      Mines   The number of squares which are marked as mines.  Each time
              you mark a square as mined, this number increments.  Each time
              you unmark a mined square, either by explicitly unmarking it,
              marking it as safe, this number is decremented.

      The status line displays messages concerning the progress of the game.
      On a normal move, it tells you how many mines are in the adjacent
      squares.  If you reach the goal, or step on a mine, it displays an
      appropriate message.

      The playing field is an array of cells (locations, squares), each of
      which can potentially contain a mine.  One of the squares contains a
      stick man which represents your current location in the minefield.
      Squares which you have already been traversed show the number of mines
      which are adjacent to that square.  The number in the same square as
      the stick man shows the number of mines adjacent to that position.
      You use the pointer buttons to move your man around the minefield or
      to mark squares as safe or mined (see the section "ACTIONS" below).

 X RESOURCES
      Xmines accepts all of the standard X Toolkit resource names and
      classes as well as:

      cellSize (class CellSize)
              This resource specifies the size, in pixels, of each cell in
              the playing field.  Since the pictures which are placed into
              the cells are pixmaps, cell sizes which do not match the
              pixmap sizes lead to white space (if cell size is larger than
              pixmap size), or a cropped picture (if cell size is smaller
              than pixmap size).  There are two sizes of pixmap available,
              16 and 32.  Xmines will use the 16 bit pixmaps if the cell
              size is 31 or less, and will use the 32 bit pixmaps if the
              cell size is 32 or greater.

      rows (class ArraySize)
              This resource specifies the number of the rows in the playing
              field.  This is typically the same number as the columns
              resources.




                                    - 3 -         Formatted:  April 27, 2024






 XMINES(1)                 X Version 11 Release 4                  XMINES(1)
                               22 August 1990



      columns (class ArraySize)
              This resource specifies the number of the columns in the
              playing field.  This is typically the same number as the rows
              resources.

      mines (class Mines)
              This resource specifies the number of mines to place into the
              playing field.

 WIDGET NAMES
      This section describes the widget tree used in xmines.  By using these
      names in your resource specifications, you can configure things like
      colors and sizes for the various widgets.

      The program name is taken from the command line, and the class name is
      XMines.

      The chart below gives the widget name followed by the name of its
      class in parentheses.  All of the widgets are from the Athena Widget
      set.

      xmines(Shell - top level toolkit widget)
           form(Form)
                title(Label)
                info(Command)
                countlabel(Label)
                mineinputcount(AsciiText)
                restart(Command)
                hint(Command)
                quit(Command)
                movelabel(Label)
                movecount(Label)
                hintlabel(Label)
                hintcount(Label)
                safelabel(Label)
                safecount(Label)
                minelabel(Label)
                minecount(Label)
                message(Label)
                cell(Form)
                     R%dC%d(Widget) *
      xmines_info(ApplicationShell)
           info(Form)
                version(Label)
                text(Command)

      * The widgets labeled R%dC%d are the array of cells.   The  %d  fields
      are filled in with the row and column number of that cell, starting at
      0.  Thus the cell in the top left corner of the  array  is  R0C0,  the
      cell  to  its  right is R0C1, etc.  These widgets are Core widgets, so
      they have only the basic resources.



                                    - 4 -         Formatted:  April 27, 2024






 XMINES(1)                 X Version 11 Release 4                  XMINES(1)
                               22 August 1990



 ACTIONS
      XMines defines four actions that can be invoked through  translations.
      These actions are:

      DrawCell(row,col)
              Refreshes the specified cell.  This action is invoked by  each
              cell  in  response  to  an  expose  event  in order to refresh
              itself.  If DrawCell is invoked with no  parameters,  it  will
              refresh the current cell.

      MovePlayer()
              Moves the player  to  the  cell  from  which  the  action  was
              invoked.   This  is normally bound to the left mouse button to
              allow you to move around the playing field.  If you move  onto
              a  mine,  the  game ends.  You can not move to a cell which is
              marked as mined.  You can move directly to  any  square  which
              has  been  previously  traversed, or to any square immediately
              adjacent to one which has been  previously  traversed  (except
              those marked as mined).

      MarkMined()
              Marks the cell as a mined cell.  This is normally bound to the
              center  mouse button.  If the cell is already marked as mined,
              it will be unmarked.  If the cell is marked as safe,  it  will
              be  marked  as  mined.   The  safe  and mined count fields are
              updated.

      MarkSafe()
              Marks the cell as a safe cell.  This is normally bound to  the
              right mouse button.  If the cell is already marked as safe, it
              will be unmarked.  If the cell is marked as mined, it will  be
              marked as safe.  The safe and mined count fields are updated.

 COPYRIGHT
      Copyright 1987, Tom Anderson
      Copyright 1990, Globetrotter Software, Inc.
      See X(1) for a full statement of rights and permissions.

 AUTHORS
      Tom Anderson, Fluke Manufacturing Co. Inc.
      Brian Dalio, Mentor Graphics, Silicon Design Division.
      Jim McBeath, Globetrotter Software, Inc.












                                    - 5 -         Formatted:  April 27, 2024