All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface map.Map

public interface Map
The inteface Map describes a mine map. A strategy operates on a mine map. By invoking the operations of probing and marking, the strategy attempts to place the mine map in a state in which every cell that does not contain a mine has been probed, without probing a cell that does contain a mine.

See Also:
Strategy

Variable Index

 o BOOM
Boom return code.
 o MARKED
Marked return code.
 o OUT_OF_BOUNDS
Out of bounds return code.
 o UNPROBED
Unprobed return code.

Method Index

 o columns()
Provide the number of columns in this mine map.
 o display()
Display the mine map on the standard output stream.
 o done()
Is this game finished? The game is finished if it has been won or if a cell with a mine has been probed.
 o look(int, int)
Look at a cell.
 o mark(int, int)
Mark a cell.
 o mines_minus_marks()
Provide the number of mines minus the number of marks in this mine map.
 o pick(int)
Pick a number at random.
 o probe(int, int)
Probe a cell for a mine.
 o rows()
Provide the number of rows in this mine map.
 o unmark(int, int)
Unmark a cell.
 o won()
Has this game been won? A game is won if every cell which does not contain a mine has been probed, but no cell with a mine has been probed.

Variables

 o OUT_OF_BOUNDS
 public static final int OUT_OF_BOUNDS
Out of bounds return code.

See Also:
look
 o MARKED
 public static final int MARKED
Marked return code.

See Also:
look
 o UNPROBED
 public static final int UNPROBED
Unprobed return code.

See Also:
look
 o BOOM
 public static final int BOOM
Boom return code.

See Also:
look

Methods

 o won
 public abstract boolean won()
Has this game been won? A game is won if every cell which does not contain a mine has been probed, but no cell with a mine has been probed.

 o done
 public abstract boolean done()
Is this game finished? The game is finished if it has been won or if a cell with a mine has been probed.

 o probe
 public abstract int probe(int x,
                           int y)
Probe a cell for a mine.

Parameters:
x - x coordinate of cell
y - y coordinate of cell
 o look
 public abstract int look(int x,
                          int y)
Look at a cell.

Parameters:
x - x coordinate of cell
y - y coordinate of cell
 o mark
 public abstract int mark(int x,
                          int y)
Mark a cell.

Parameters:
x - x coordinate of cell
y - y coordinate of cell
 o unmark
 public abstract int unmark(int x,
                            int y)
Unmark a cell.

Parameters:
x - x coordinate of cell
y - y coordinate of cell
 o mines_minus_marks
 public abstract int mines_minus_marks()
Provide the number of mines minus the number of marks in this mine map.

 o rows
 public abstract int rows()
Provide the number of rows in this mine map.

 o columns
 public abstract int columns()
Provide the number of columns in this mine map.

 o display
 public abstract void display()
Display the mine map on the standard output stream. Used only for debugging.

 o pick
 public abstract int pick(int n)
Pick a number at random.

Parameters:
n - a positive number (not checked)
Returns:
a nonnegative number less than n

All Packages  Class Hierarchy  This Package  Previous  Next  Index