44 lines
859 B
Python
44 lines
859 B
Python
|
#!/bin/python3
|
||
|
import sys,re
|
||
|
from pprint import pprint
|
||
|
sys.path.insert(0, '../../')
|
||
|
from fred import list2int,get_re,nprint,lprint,loadFile
|
||
|
|
||
|
input_f = 'test'
|
||
|
|
||
|
part = 1
|
||
|
#########################################
|
||
|
# #
|
||
|
# Part 1 #
|
||
|
# #
|
||
|
#########################################
|
||
|
|
||
|
def parse(line):
|
||
|
line = get_re(r'^"(.*)"$',line)
|
||
|
tmp = line
|
||
|
|
||
|
|
||
|
if part == 1:
|
||
|
instructions = loadFile(input_f)
|
||
|
|
||
|
char = 0
|
||
|
total = 0
|
||
|
for i in instructions:
|
||
|
total += len(i)
|
||
|
print(i)
|
||
|
|
||
|
print(total)
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
#########################################
|
||
|
# #
|
||
|
# Part 2 #
|
||
|
# #
|
||
|
#########################################
|
||
|
if part == 2:
|
||
|
exit()
|