My Advent of Code solutions in Python. kevinyap.ca/2019/12/going-fast-in-advent-of-code/
advent-of-code python
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove animation from day08.py

+12 -7
+12 -7
2016/day08.py
··· 1 1 # -*- coding: utf-8 -*- 2 - import sys 3 - import time 2 + # import sys 3 + # import time 4 4 import fileinput 5 5 6 6 from utils import parse_line ··· 10 10 SCREEN = [[False for _ in range(WIDTH)] for _ in range(HEIGHT)] 11 11 12 12 # Make space for animated output 13 - print '\n' * HEIGHT 13 + # print '\n' * HEIGHT 14 14 15 15 for line in fileinput.input(): 16 16 if line.startswith('rect'): ··· 34 34 SCREEN[(offset+i) % HEIGHT][n] = x 35 35 36 36 37 - sys.stdout.write('\033[F' * HEIGHT) 37 + # sys.stdout.write('\033[F' * HEIGHT) 38 + 39 + # for row in SCREEN: 40 + # print ''.join('█' if x else ' ' for x in row) 41 + 42 + # time.sleep(0.02) 38 43 39 - for row in SCREEN: 40 - print ''.join('█' if x else ' ' for x in row) 41 44 42 - time.sleep(0.02) 45 + print '' 46 + for row in SCREEN: 47 + print ''.join('█' if x else ' ' for x in row) 43 48 44 49 print "\nNumber of lit pixels: %i" % sum(sum(row) for row in SCREEN)