public byte whoWin() {
		// The player with the most pieces on the board at the end of the game
		// wins
		// State.DARK dark wins, State.LIGHT light wins, State.TIE tie,
		// state.NONE nobody wins yet(game hasnt finished yet)

		if (getNumberOfMoves(state.board, State.DARK) != 0
				|| getNumberOfMoves(state.board, State.LIGHT) != 0) {
			return State.NONE; // nobody wins yet
		}

		int dark_pieces = 0;
		int light_pieces = 0;

		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 8; j++) {
				if (state.board[i][j] == State.DARK)
					dark_pieces++;
				else if (state.board[i][j] == State.LIGHT)
					light_pieces++;
			}
		}

		if (dark_pieces > light_pieces)
			return State.DARK;
		else if (dark_pieces < light_pieces)
			return State.LIGHT;
		else
			return State.TIE;
	}