day23: correct naming

This commit is contained in:
Stefan Harmuth 2020-12-23 12:54:10 +01:00
parent d82dcaa421
commit 3a396c8c47

View File

@ -11,7 +11,7 @@ class Cup:
self.right = right
def buildDoubleLinkedListDict(cup_list):
def buildLinkedListDict(cup_list):
cups = {}
left_cup = None
first_cup = None
@ -47,7 +47,7 @@ def play(cups, current_cup, max_label):
def part1(test_mode=False):
my_input = aoclib.getInputAs2DArray(day=DAY, return_type=int, test=test_mode)
cups, current_cup = buildDoubleLinkedListDict(my_input[0])
cups, current_cup = buildLinkedListDict(my_input[0])
for _ in range(100):
cups, current_cup = play(cups, current_cup, 9)
@ -63,7 +63,7 @@ def part1(test_mode=False):
def part2(test_mode=False):
my_input = aoclib.getInputAs2DArray(day=DAY, return_type=int, test=test_mode)
cups, current_cup = buildDoubleLinkedListDict(my_input[0] + list(range(max(my_input[0]) + 1, 1000001)))
cups, current_cup = buildLinkedListDict(my_input[0] + list(range(max(my_input[0]) + 1, 1000001)))
for _ in range(10000000):
cups, current_cup = play(cups, current_cup, 1000000)