public boolean checkForMate(boolean white) {
		for (int i = 0; i < 8; i++)
			// for all places
			for (int j = 0; j < 8; j++) {
				if (board[i][j] != null && board[i][j].isWhite() == white) {// of
																			// all
																			// pieces
					for (int x = 0; x < 8; x++)
						// check for all positions
						for (int y = 0; y < 8; y++) {
							if (board[i][j].move(i, j, x, y) != -1) {// whether
																		// they
																		// can
																		// move
																		// there
								// if they can check for check
								boolean b = false;
								Piece p = board[x][y];
								board[x][y] = board[i][j];
								board[i][j] = null;
								if (!check(white))
									b = true; // if not check, then we need to
												// rebuild the board and return
												// false
								board[i][j] = board[x][y];
								board[x][y] = p;
								if (b) {
									return false;
								}
							}
						}
				}
			}
		return true; // there is no possible move which does not yield a check
						// situation
	}