public boolean check(boolean white) {
		// find King
		int x = -1;
		int y = -1;
		for (int i = 0; i < 8; i++)
			for (int j = 0; j < 8; j++) {
				if (board[i][j] != null)
					if (white) {
						if (board[i][j].getChar() == 'K') {
							x = i;
							y = j;
						}
					} else {
						if (board[i][j].getChar() == 'k') {
							x = i;
							y = j;
						}
					}
			}
		if (x == -1)
			return false; // no king found
		return checkAttacked(!white, x, y);
	}