hb.icn: Program for Hearts & Bones game

March 10, 1998; Robert J. Alexander
Requires: Version 9 graphics
This file is in the public domain.
Hearts & Bones

Usage: hb [-h <board height>] [-w <board width>] [-b <# bones>] [-B]

-B says to print the actual number of bones placed.

For best results, use odd board heights and widths, and even
square heights and widths.

Defaults: board height = 9, board width = 13, # bones = 25.

--- Game Play ---

Hit "q" to quit, "r" to start a new game.

The object is to visit all the safe squares without stepping on a
bone.

You *visit* a square by clicking the left mouse button in it.  If the
square is safe, a number is posted in it that reveals the number of
squares in the eight neighboring squares the contain bones.  Squares
containing hearts (represented by $) are always safe.

You can only visit squares that are adjacent to squares already
visited.  At the start of a game, the upper left square (a heart
square) is pre-visited for you.  If a visited square has no
neighbors, its adjacent squares are automatically visited for you, as
a convenience.

At any time you can *mark* a square that you believe has a bone by
clicking the right (or center) mouse button on it.  This is a memory
aid only -- if you visit it later (and you were right), you're dead.
There is no confirmation whether a square you have marked really
contains a bone, although you will probably find out later when it
causes you to make a mistake.  A right-button click on a marked
square unmarks it.

The game ends when you have visited all safe squares or stepped on a
bone.  (Presently, there is no automatic detection of a winning board
-- you just have to notice that for yourself).

NOTE:  If you use the command line options to alter the setup
parameters (e.g.  increasing the number of squares, or *decreasing*
the number of bones), you might get a stack overflow due, I think, to
deep recursion.  I have found that setting the environment variable
MSTKSIZE=30000 works well.

Source code | Program Library Page | Icon Home Page