/***********************************************************************
  Dackral Phillips
  COMP 7600 - Artificial Intelligence
  Dr. Dozier
  Final Project
  Feb. 27, 2K2

  Description:       This project deals with how to solve
                     N-queens problem.  It uses six different
					      methods to solve the problem, O(N),
                     modified backtracking algorithm,
					      arc consistent look ahead, next and steepest 
                     ascent hill climbing, and genetic search 
                     algorithms.
  ChessSquare.java:  This is a java file that defines a 
                     ChessSquare.  A ChessSquare has two
                     boolean values.  Checked is set when
                     a queen endangers this square. QueenOn
                     is set when a queen is on this position.
**********************************************************************/

   import java.io.*;				// Let me print some stuff!

	// Begin the ChessSquare class definition

    public class ChessSquare
   {
   	// Make me some variables!
   
      private boolean checked;
      private boolean queenOn;
   
   	// Constructor - sets everything to false initially
   
       public ChessSquare()
      {
         queenOn = false;
         checked = false;
      }
   
   	// Set this square to endangered
   
       public void checkSquare()
      {
         checked = true;		
      }
   
   	// Place a queen on this square
   
       public void placeQueen()
      {
         queenOn = true;
         checked = true;		
      }
   
   	// Remove the danger from this square
   
       public void unCheckSquare()
      {
         checked = false;		
      }
   
   	// Remove the queen from this square
   
       public void removeQueen()
      {
         queenOn = false;	
         checked = false;
      }
   
   	// Tell whether this square is in danger or not
   
       public boolean getChecked()
      {
         return checked;
      }
   
   	// Tell whether a queen is on this square or not
   
       public boolean getQueenOn()
      {
         return queenOn;
      }
   
   	// Print out the variable states for this square - useful for debugging
       public String toString()
      {
      
         String print = new String("Square\n\n");
      
         if (checked)
            print = print + "Checked: True\n";
         else 
            print = print + "Checked: False\n";
      
         if (queenOn)
            print = print + "QueenOn: True\n";
         else 
            print = print + "QueenOn: False\n";
      
         print = print + "\n";
      
         return print;
      }
   }	// End class definition