def main(): rel_route_input = "../input" path = local_path(__file__, rel_route_input) values = [int(x) for x in get_lines(path)[0].split(',')] print(get_nth_value(values, 30000000))
def main(): to_input = "../input" path = local_path(__file__, to_input) config = get_lines(path) print(count_living_cells(config))
def main(): rel_route_input = "../input" path = local_path(__file__, rel_route_input) instructions = get_lines(path) print(sum_up_values(instructions))
def test_first_example(self): to_input = "../smallinput" path = local_path(__file__, to_input) config = get_lines(path) should_be = 112 self.assertEqual(count_living_cells(config), should_be)
def sums_up_correctly(self): rel_route_input = "../smallinput1" path = local_path(__file__, rel_route_input) instructions = get_lines(path) real_sum = 165 self.assertEqual(sum_up_values(instructions), real_sum)
def test_sums_correctly(self): rel_route_input = '../smallinput2' path = local_path(__file__, rel_route_input) instructions = get_lines(path) mem = write_memory(instructions) s = sum(mem.values()) actual_sum = 208 self.assertEqual(s, actual_sum)
def main(): to_input = "../input" path = local_path(__file__, to_input) prec = {'+': 2, '*': 1} print(sum_exprs(get_lines(path), prec))