day 8 with all sub-pics
This commit is contained in:
7
08/08.py
7
08/08.py
@@ -13,7 +13,7 @@ f_columns = 50
|
||||
from time import time
|
||||
from copy import deepcopy
|
||||
import numpy as np
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
from PIL import Image
|
||||
|
||||
start_time = time()
|
||||
|
||||
@@ -97,8 +97,13 @@ def array_to_image(ar):
|
||||
if __name__ == "__main__":
|
||||
field = create_field(int(f_columns), int(f_rows))
|
||||
commands = read_file(file)
|
||||
counter=0
|
||||
for command in commands:
|
||||
field = do_command(command, field)
|
||||
img = array_to_image(field)
|
||||
img.save(f"./all_pics/pic{counter:03d}.png")
|
||||
counter+=1
|
||||
|
||||
print(f"Solution Part1: {count_pixel(field)}")
|
||||
|
||||
print(f"Solution Part2:")
|
||||
|
||||
Reference in New Issue
Block a user