private Move getBestOnePixelOffMove(Board board) {
    List<Move> otherPlayersMove = board.getPrevMovesByPlayerId(1);
    double maxScore = 0;
    Move bestMove = null;

    for (int j = 0; j < otherPlayersMove.size(); j++) {
      Move prevMove = otherPlayersMove.get(j);
      for (int i = 0; i < directions.length; i++) {
        int nextX = prevMove.x + directions[i][0];
        int nextY = prevMove.y + directions[i][1];
        if (isValidMove(board, nextX, nextY)) {
          Move thisMove = Move.createMyMove(nextX, nextY);
          double thisScore = board.testMyScoreWithThisMove(thisMove);
          if (thisScore > maxScore) {
            maxScore = thisScore;
            bestMove = thisMove;
          }
        } else {
          int nextX2 = prevMove.x + directions[i][0] * 2;
          int nextY2 = prevMove.y + directions[i][1] * 2;
          if (isValidMove(board, nextX2, nextY2)) {
            Move thisMove = Move.createMyMove(nextX2, nextY2);
            double thisScore = board.testMyScoreWithThisMove(thisMove);
            if (thisScore > maxScore) {
              maxScore = thisScore;
              bestMove = thisMove;
            }
          }
        }
      }
    }
    return bestMove;
  }
  private Move getBestRandomMove(Board board, int startX, int startY, int offset) {
    int poolNo = 1000;
    Move bestMove = null;
    double maxScore = 0;

    for (int i = 0; i < poolNo; i++) {
      Move nextMove = null;
      while (nextMove == null) {
        int x = startX + r.nextInt(offset);
        int y = startY + r.nextInt(offset);

        // if this position is empty and the color of this position is not mine, then accept this
        // move
        if (isValidMove(board, x, y)) {
          nextMove = Move.createMyMove(x, y);
          double thisScoreDiff = board.testMyScoreWithThisMove(nextMove);
          if (thisScoreDiff > maxScore) {
            maxScore = thisScoreDiff;
            bestMove = nextMove;
          }
        }
      }
    }
    return bestMove;
  }