java.lang.ObjectSachovnice
public class Sachovnice
Class Sachovnice solves Eight queen puzzle by means of min conflicts algorithm.
Constructor Summary | |
---|---|
Sachovnice()
Nonparametric constructor for objects of class Sachovnice that creates random chessboard. |
|
Sachovnice(Pozice[] damy)
Constructor for objects of class Sachovnice. |
Method Summary | |
---|---|
static void |
main()
Solves two chosen chessboard setting and one random |
java.lang.String |
toString()
Returns a string representation of the object. |
void |
Vyres(boolean vypisy,
int maxCounter)
Moves the queens in their columns until it finds a nonconflict setting or overruns the maxCounter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Sachovnice()
public Sachovnice(Pozice[] damy)
damy
- Array of objects of class Pozice that represent positions of queens.Method Detail |
---|
public static void main()
public java.lang.String toString()
toString
in class java.lang.Object
public void Vyres(boolean vypisy, int maxCounter)
vypisy
- If true prints out chessboard after every step.maxCounter
- Maximal number of steps after which computation is terminated.