AdventOfCode/2023/day10/part1.py

33 lines
555 B
Python
Raw Normal View History

2023-12-11 10:23:30 +01:00
import sys
from pprint import pprint
#colors
from termcolor import colored
grid = []
log = True
def p(x):
global log
if log:
for i in x:
for j in i:
if j == 'S':
print(colored(j,'red'),end='')
else:
print(j,end='')
print()
with open(sys.argv[1]) as file:
for line in file:
grid.append(line.rstrip())
for ldx,line in enumerate(grid):
grid[ldx] = line.translate(str.maketrans("-|F7LJ.", "─│┌┐└┘ "))
p(grid)