Class ChessHorseOne
java.lang.Object
topics.backtracking.ChessHorseOne
BACKTRACKING PROBLEM: THE HORSE JUMPING PROBLEM
This program calculates all the ways of moving a
horse through an entire chessboard of side n
- Author:
- vicegd
-
Constructor Summary
ConstructorsConstructorDescriptionChessHorseOne(int n, int startingX, int startingY) Constructor for ChessHorseOne objects -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanReturns whether there is a solution
-
Constructor Details
-
ChessHorseOne
public ChessHorseOne(int n, int startingX, int startingY) Constructor for ChessHorseOne objects- Parameters:
n- Size of the boardstartingX- starting position in the board (horizontally)startingY- starting position in the board (vertically)
-
-
Method Details
-
backtracking
public void backtracking() -
isSolution
public boolean isSolution()Returns whether there is a solution- Returns:
- True is there is a solution. False otherwise
-