""" maze.py Advent of Code 2017 Day 19 in class Sep 28 """ #1234567890 # The first | in row 0 is at index 5 testcase = """ | | +--+ A | C F---|----E|--+ | | | D +B-+ +--+ """ # --- thinking about coordinates --- # matrix = [ [1, 2, 3], # [4, 5, 6], # [7, 8, 9]] # # row col # print("6 is ", matrix[1] [2]) def text_to_grid(text): """ given a string, return a list of strings """ return text.strip('\n').split('\n') assert text_to_grid(testcase)[0].index('|') == 5