Classes | |
class | Cell |
Static Public Member Functions | |
static Set< Cell > | nqueens_int (int n) |
static Set< Cell > | nqueens_rel (int n) |
static void | knightsTour (int n, int m, Cell[] result) |
static void | knightsTour2 (int n, int m, Cell[] result, Set< Cell >[] next) |
static Cell[] | knightsTour (int n, int m) |
static Cell[] | knightsTour2 (int n, int m) |
static void | printNQueens (Collection< Cell > queens) |
static void | main (String[] args) |
Static Private Member Functions | |
static void | nqueens2 (int n, Set< Cell > result) |
static void | nqueens (int n, Set< Cell > result) |
Implements several chess problems/puzzles.
Definition at line 24 of file ChessBoard.java.
static Cell [] edu.mit.csail.sdg.squander.examples.chess.ChessBoard.knightsTour | ( | int | n, | |
int | m | |||
) | [static] |
Definition at line 136 of file ChessBoard.java.
References edu.mit.csail.sdg.squander.examples.chess.ChessBoard.knightsTour().
static void edu.mit.csail.sdg.squander.examples.chess.ChessBoard.knightsTour | ( | int | n, | |
int | m, | |||
Cell[] | result | |||
) | [static] |
Solves the Knight's Tour problem.
Definition at line 117 of file ChessBoard.java.
Referenced by edu.mit.csail.sdg.squander.examples.chess.ChessBoard.knightsTour(), and edu.mit.csail.sdg.squander.examples.chess.ChessBoard.main().
static Cell [] edu.mit.csail.sdg.squander.examples.chess.ChessBoard.knightsTour2 | ( | int | n, | |
int | m | |||
) | [static] |
Definition at line 146 of file ChessBoard.java.
References edu.mit.csail.sdg.squander.examples.chess.ChessBoard.knightsTour2().
static void edu.mit.csail.sdg.squander.examples.chess.ChessBoard.knightsTour2 | ( | int | n, | |
int | m, | |||
Cell[] | result, | |||
Set< Cell >[] | next | |||
) | [static] |
A different (potentially more efficient) encoding for the Knight's Tour problem.
Definition at line 132 of file ChessBoard.java.
Referenced by edu.mit.csail.sdg.squander.examples.chess.ChessBoard.knightsTour2().
static void edu.mit.csail.sdg.squander.examples.chess.ChessBoard.main | ( | String[] | args | ) | [static] |
Definition at line 186 of file ChessBoard.java.
References edu.mit.csail.sdg.squander.examples.chess.ChessBoard.knightsTour().
static void edu.mit.csail.sdg.squander.examples.chess.ChessBoard.nqueens | ( | int | n, | |
Set< Cell > | result | |||
) | [static, private] |
A different encoding for the N-Queens problem.
Definition at line 88 of file ChessBoard.java.
Referenced by edu.mit.csail.sdg.squander.examples.chess.ChessBoard.nqueens_rel().
static void edu.mit.csail.sdg.squander.examples.chess.ChessBoard.nqueens2 | ( | int | n, | |
Set< Cell > | result | |||
) | [static, private] |
Solves the N-Queens problem.
Definition at line 60 of file ChessBoard.java.
Referenced by edu.mit.csail.sdg.squander.examples.chess.ChessBoard.nqueens_int().
static Set<Cell> edu.mit.csail.sdg.squander.examples.chess.ChessBoard.nqueens_int | ( | int | n | ) | [static] |
Definition at line 64 of file ChessBoard.java.
References edu.mit.csail.sdg.squander.examples.chess.ChessBoard.nqueens2().
static Set<Cell> edu.mit.csail.sdg.squander.examples.chess.ChessBoard.nqueens_rel | ( | int | n | ) | [static] |
Definition at line 92 of file ChessBoard.java.
References edu.mit.csail.sdg.squander.examples.chess.ChessBoard.nqueens().
static void edu.mit.csail.sdg.squander.examples.chess.ChessBoard.printNQueens | ( | Collection< Cell > | queens | ) | [static] |
Definition at line 169 of file ChessBoard.java.