 	startGame(deviceStates, rootState, reiterations, moveX, moveY, wins, visits);
 }
 
-const int FIELD_DIMENSION = 8;
-
-// __global__ bool flip(int playfieldX, int playfieldY, Field* playfield, size_t moveX, size_t moveY, int directionX, int directionY, int offset, Field expectedPlayer)
-// {
-//     int oldMovedX = moveX + directionX * offset - 1;
-//     int oldMovedY = moveY + directionY * offset - 1;
-//     int oldMovedIndex = moveX + moveY * FIELD_DIMENSION;
-//     int movedX = oldMovedX + directionX;
-//     int movedY = oldMovedY + directionY;
-//     int movedIndex = moveX + directionX + (moveY + directionY) * FIELD_DIMENSION;
-//     bool allowed = true;
-//     if (playfieldX == movedX && playfieldY == movedY)
-//     {
-//         if (playfield[movedIndex] == 0) && playfield[oldMovedIndex] != playfield[movedIndex])
-//         {
-            
-//         }
-//     }
-// return true;
-// }
+
+
 
 __device__ Player getEnemyPlayer(Player currentPlayer)
 {

	__shared__ size_t randomIndex;
	if (playfieldIndex == 0)
	{
		randomIndex = getRandomMoveIndex(state, possibleMoves, moveCount);
	}
	__syncthreads();
	return randomIndex;
}

__device__ size_t sum(size_t* counts, size_t playfieldIndex, size_t arraySize)
{
	__syncthreads();
	if (arraySize > 1)
	{
		arraySize = arraySize / 2;

        calculatePossibleMoves(possibleMoves, sharedPlayfield, playfieldIndex, currentPlayer);
        moveCount = countPossibleMoves(possibleMoves, playfieldIndex, sharedPlayfield);
        debug++;
	};

    if (playfieldIndex == 0 && moveCount== 0)
        printf("Runs: %d\n", debug);
    
    __syncthreads();
    
	playfield[playfieldIndex] = sharedPlayfield[playfieldIndex];
}