I have a fun little problem.

I need to count the amount of 'groups' of characters in a file. Say the file is...

```
..##.#..#
##..####.
.........
###.###..
##...#...

```

The code will then count the amount of groups of #'s. For example, the above would be `3`. It includes diagonals. Here is my code so far:

```
build = []
height = 0
with open('file.txt') as i:
  build.append(i)
  height += 1
length = len(build[0])
dirs = {'up':(-1, 0), 'down':(1, 0), 'left':(0, -1), 'right':(0, 1), 'upleft':(-1, -1), 'upright':(-1, 1), 'downleft':(1, -1), 'downright':(1, 1)}

def find_patches(grid, length):
  queue = []
  queue.append((0, 0))
  patches = 0
  while queue:
    current = queue.pop(0)
    line, cell = path[-1]
    if ## This is where I am at. I was making a pathfinding system.

```