Starting 2023-12-11

This commit is contained in:
FrederikBaerentsen 2023-12-11 10:23:30 +01:00
parent d3bd335e2b
commit a6055b0f8f
3 changed files with 42 additions and 0 deletions

32
2023/day10/part1.py Normal file
View 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
View File

@ -0,0 +1,5 @@
.....
.S-7.
.|.|.
.L-J.
.....

5
2023/day10/t2 Normal file
View File

@ -0,0 +1,5 @@
..F7.
.FJ|.
SJ.L7
|F--J
LJ...