private void MoveEmptyTileRandomly(IGrid grid) { var neighbourTiles = this.GetNeighbours(grid); int randomNeighbourIndex = random.Next() % neighbourTiles.Count; Tile targetTile = neighbourTiles[randomNeighbourIndex]; grid.SwapTiles(targetTile); }