From a6055b0f8fcf2960aa3075ea8c81104cfc1eb602 Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Mon, 11 Dec 2023 10:23:30 +0100 Subject: [PATCH] Starting 2023-12-11 --- 2023/day10/part1.py | 32 ++++++++++++++++++++++++++++++++ 2023/day10/t1 | 5 +++++ 2023/day10/t2 | 5 +++++ 3 files changed, 42 insertions(+) create mode 100644 2023/day10/part1.py create mode 100644 2023/day10/t1 create mode 100644 2023/day10/t2 diff --git a/2023/day10/part1.py b/2023/day10/part1.py new file mode 100644 index 0000000..0857c10 --- /dev/null +++ b/2023/day10/part1.py @@ -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) diff --git a/2023/day10/t1 b/2023/day10/t1 new file mode 100644 index 0000000..7650925 --- /dev/null +++ b/2023/day10/t1 @@ -0,0 +1,5 @@ +..... +.S-7. +.|.|. +.L-J. +..... diff --git a/2023/day10/t2 b/2023/day10/t2 new file mode 100644 index 0000000..682499d --- /dev/null +++ b/2023/day10/t2 @@ -0,0 +1,5 @@ +..F7. +.FJ|. +SJ.L7 +|F--J +LJ...