ks.common.games
Interface SolvableSolitaire


public interface SolvableSolitaire

This is the superclass for all games that provide the necessary interfaces to enable a brute force backtracking algorithm to solve the game.

To turn your solitaire plugin into a Solvable Solitaire plugin, simply provide the following method:

Enumeration availableMoves()

This method should return an Enumeration of Move objects that represent valid moves from the current solitaire state.

In addition, you must ensure that your move objects have a boolean doMove(Solitaire game) method. This feature was not ready before the class started, so I have provided in the Move class a default method that returns No moves; simply override this method to make your plugin solvable. The doMove() method effects the given move, and is the opposite of the undo() method in the Move class (or is it vice versa?).

To date, numerous plugins provide solvable implementations

Creation date: (11/21/01 9:13:44 PM)


Method Summary
 java.util.Enumeration availableMoves()
          Return an Enumeration of valid moves currently available.
 

Method Detail

availableMoves

public java.util.Enumeration availableMoves()
Return an Enumeration of valid moves currently available.

Returns:
java.util.Enumeration