Main Page | Class Hierarchy | Class List | File List | Class Members

Strategy Class Reference

#include <Strategy.h>

Inheritance diagram for Strategy:

LeastCandidatesStrategy SimpleStrategy List of all members.

Detailed Description

A Strategy is an approach to solving a Sudoku puzzle.

This is an abstract class meant to be extended by overriding the setStartCell function. The solve function is implemented, but may also be overridden if a more efficient method can be found.


Public Member Functions

 Strategy (const Puzzle &p)
 Creates this Strategy for use on the given Puzzle.

virtual ~Strategy ()
 Destructor.

virtual void setStartCell (size_t &x, size_t &y)=0
 Sets the coordinates of the starting point of this Strategy's solution.

virtual bool solve ()
 Recursively solves the Puzzle for which this Strategy was created.

void printPuzzle ()
 Prints this Strategy's puzzle.


Public Attributes

size_t calls

Protected Attributes

Puzzlep
 The Puzzle to be solved using this Strategy.

size_t depth
 Indexes the recursion depth of a given call to this SimpleStrategy's solve function.


Private Member Functions

 Strategy ()
 Default constructor.

 Strategy (const Strategy &s)
 Copy constructor.

Strategyoperator= (const Strategy &s)
 Assignment operator.


Constructor & Destructor Documentation

Strategy::Strategy  )  [private]
 

Default constructor.

Not implemented.

Strategy::Strategy const Strategy s  )  [private]
 

Copy constructor.

Not implemented.


Member Function Documentation

Strategy& Strategy::operator= const Strategy s  )  [private]
 

Assignment operator.

Not implemented.

bool Strategy::solve  )  [virtual]
 

Recursively solves the Puzzle for which this Strategy was created.

Returns true if the Puzzle has been solved, false if it has no solution.


The documentation for this class was generated from the following files:
Generated on Tue Aug 2 12:58:49 2005 for Generalized Sudoku Puzzle Solver by doxygen 1.3.4