public override bool Equals(Object o) { if (this == o) { return(true); } if ((o == null) || (this.GetType() != o.GetType())) { return(false); } NQueensBoard aBoard = (NQueensBoard)o; bool retVal = true; ArrayList locs = getQueenPositions(); foreach (XYLocation loc in locs) { if (!(aBoard.queenExistsAt(loc))) { retVal = false; } } return(retVal); }