Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- numbers = []
- def layer(l, n):
- for i in range(0, len(l), n):
- yield l[i:i + n]
- def main():
- global numbers
- f = open("Day8Numbers.txt", "r")
- cond = f.readline()
- nums = []
- for x in str(cond):
- if x == "\n":
- break
- else:
- nums.append(int(x))
- halfLayered = list(layer(nums, 25))
- numbers = list(layer(halfLayered, 6))
- print(numbers)
- def part1():
- global numbers
- total = []
- cond = 0
- for x in numbers:
- if cond == 0:
- print("initiated")
- else:
- total.append(count)
- cond = 1
- count = 0
- for y in x:
- for z in y:
- if z == 0:
- count += 1
- num1 = 0
- num2 = 0
- for x in range(len(total)):
- if total[x] == max(total):
- maxNum = x
- for x in numbers:
- if x == numbers[maxNum]:
- for y in x:
- for z in y:
- if z == 1:
- num1 += 1
- elif z == 2:
- num2 += 1
- print(num1 * num2)
- main()
- part1()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement