Starting 2023-12-11
This commit is contained in:
parent
d3bd335e2b
commit
a6055b0f8f
32
2023/day10/part1.py
Normal file
32
2023/day10/part1.py
Normal file
@ -0,0 +1,32 @@
|
||||
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)
|
5
2023/day10/t1
Normal file
5
2023/day10/t1
Normal file
@ -0,0 +1,5 @@
|
||||
.....
|
||||
.S-7.
|
||||
.|.|.
|
||||
.L-J.
|
||||
.....
|
5
2023/day10/t2
Normal file
5
2023/day10/t2
Normal file
@ -0,0 +1,5 @@
|
||||
..F7.
|
||||
.FJ|.
|
||||
SJ.L7
|
||||
|F--J
|
||||
LJ...
|
Loading…
Reference in New Issue
Block a user