Package ai.libs.jaicore.problems.nqueens
Class NQueenSolutionChecker
- java.lang.Object
-
- ai.libs.jaicore.problems.nqueens.NQueenSolutionChecker
-
public class NQueenSolutionChecker extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanattack(java.util.List<java.lang.Integer> positions, int i, int j)Checks if a cell is attacked by the queens on the boardstatic booleanisSolution(java.util.List<java.lang.Integer> solution)
-
-
-
Method Detail
-
isSolution
public static boolean isSolution(java.util.List<java.lang.Integer> solution)
-
attack
public static boolean attack(java.util.List<java.lang.Integer> positions, int i, int j)Checks if a cell is attacked by the queens on the board- Parameters:
i- The row of the cell to be checked.j- The collumn of the cell to be checked.- Returns:
trueif the cell is attacked,falseotherwise.
-
-