42 lines
858 B
Python
42 lines
858 B
Python
|
#!/usr/bin/env python
|
||
|
# 2021 - Advent Of Code - 15
|
||
|
# 2022: cheat for pylint to start fresh for 2022
|
||
|
# pylint: skip-file
|
||
|
# unfinished
|
||
|
|
||
|
class Color:
|
||
|
PURPLE = '\033[95m'
|
||
|
CYAN = '\033[96m'
|
||
|
DARKCYAN = '\033[36m'
|
||
|
BLUE = '\033[94m'
|
||
|
GREEN = '\033[92m'
|
||
|
YELLOW = '\033[93m'
|
||
|
RED = '\033[91m'
|
||
|
BOLD = '\033[1m'
|
||
|
UNDERLINE = '\033[4m'
|
||
|
END = '\033[0m'
|
||
|
|
||
|
|
||
|
def parse_file(file):
|
||
|
with open(file, encoding="utf-8") as f:
|
||
|
columns = []
|
||
|
for line in f.readlines():
|
||
|
columns.append([int(c) for c in line.strip()])
|
||
|
|
||
|
return columns
|
||
|
|
||
|
|
||
|
def print_grid(grid):
|
||
|
for y in range(len(grid)):
|
||
|
for x in range(len(grid[y])):
|
||
|
print(grid[y][x], end='')
|
||
|
print()
|
||
|
print()
|
||
|
|
||
|
|
||
|
cave_map = parse_file('input_example.txt')
|
||
|
print_grid(cave_map)
|
||
|
|
||
|
|
||
|
print(color.BOLD + 'Hello World !' + color.END)
|