From e1a780e72883d56f6584bd42facfa6a456a3533e Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Sat, 14 Dec 2024 14:22:41 +0100 Subject: [PATCH] Added colors to 2024/14 --- 2024/14/solution.py | 7 ++++--- __pycache__/fred.cpython-311.pyc | Bin 29594 -> 29514 bytes 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/2024/14/solution.py b/2024/14/solution.py index 46a36d9..d079435 100644 --- a/2024/14/solution.py +++ b/2024/14/solution.py @@ -2,6 +2,7 @@ import sys,time,re from pprint import pprint from termcolor import colored +import secrets sys.path.insert(0, '../../') from fred import get_re,loadFile,addTuples,flood_fill @@ -24,11 +25,11 @@ def nprint(grid,pos=None,x=None,positions:list=None): print(x,end='') elif positions is not None: if (c,r) in positions: - print(x,end='') + print(colored(x,secrets.choice(['green','yellow','blue','magenta','white','red','cyan'])),end='') else: - print(colored(grid[r][c],'red'),end='') + print(' ',end='') else: - print(colored(grid[r][c],'red'),end='') + print(' ',end='') print() ######################################### diff --git a/__pycache__/fred.cpython-311.pyc b/__pycache__/fred.cpython-311.pyc index 4973a6928bc220a0dc1c41dd654ebdf9573b085e..5a6813bddbb71d57e4edc77cb0456cf69ff48ab3 100644 GIT binary patch delta 118 zcmbRBobl8%M&9MTyj%=Gz+D=fzG)+`d^VdSBLjni!e)bPDaOftDr}R5(^NJe%c*A) ztY%_hDDDBO{Q(3G3}3}2hviptbMsGN@3if)y}%-|`Bwg7W?3s)M#&Ehm_(5tP%8jh C5caK|&=NsS3r3xv2^zl?AB^iNz3slEk8t%)E4kg8bsllFa-( zy~!+T#+%D>>X`(qm>3v}dw>@H0D=aFuM(5l@+-M{1SW`g`u6xH`BNQKSdd3IL5KJy8Gv