Skip to content

Instantly share code, notes, and snippets.

@vpatov
Created August 7, 2017 14:54
Show Gist options
  • Save vpatov/f916b006dfa4861c2e76172c66b6dcc3 to your computer and use it in GitHub Desktop.
Save vpatov/f916b006dfa4861c2e76172c66b6dcc3 to your computer and use it in GitHub Desktop.
"""
Each grid is a 2d-matrix.
Each cell is either '-' or '#'.
"""
grids = []
f = open('problem3_input.txt','r')
while(True):
grid = []
line = f.readline()
if (len(line) < 1):
break
width,height = (int(i) for i in line.split())
for row in range(height):
line = f.readline().strip()
grid.append(list(line))
grids.append(grid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment