All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class map.PGMS

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----map.PGMS

public class PGMS
extends Applet
The class PGMS creates and displays minesweeper games played by Java programs. A user contributes a Java class that conforms to the interface called Strategy. The strategy plays a game of minesweeper using the methods provided by the Map class.

This class provides both an applet for graphical presentations using browsers, and a main routine for applications.

See Also:
Strategy, Map

Constructor Index

 o PGMS()
Create applet PGMS

Method Index

 o init()
Initialize applet by processing the attributes.
 o main(String[])
Application entry point.
 o start()
 o stop()

Constructors

 o PGMS
 public PGMS()
Create applet PGMS

Methods

 o main
 public static void main(String args[])
Application entry point.

Parameters:
args - program arguments
-b
play a beginner game
-i
play an intermediate game
-e
play an expert game
-s strategy class name
play with given strategy
-n number of games
play multiple games - graphics will be disabled with more than one game
 o init
 public void init()
Initialize applet by processing the attributes.
strategy
class name of user supplied strategy
game
level of game, one of
  • beginner
  • intemediate
  • expert

Sample:

 <applet codebase="classes" code="map/PGMS.class" 
       width=302 height=262>
 <param name="strategy" value="eqn.EqnStrategy">
 <param name="game" value="intermediate">
 </applet>
 

Overrides:
init in class Applet
 o start
 public void start()
Overrides:
start in class Applet
 o stop
 public void stop()
Overrides:
stop in class Applet

All Packages  Class Hierarchy  This Package  Previous  Next  Index