コード例 #1
0
def main():
    intcode = loadv2("data/d9.txt")
    intcode = Intcode(intcode)

    part1 = parse(intcode, 1)
    part2 = parse(intcode, 2)
    return part1, part2
コード例 #2
0
def main():
    intcode = loadv2("data/d2.txt")
    target_value = 19690720
    for noun in range(100):
        for verb in range(100):
            intcode_copy = list(intcode)
            intcode_copy[1], intcode_copy[2] = noun, verb
            output = parser(intcode_copy)
            if output[0] == target_value:
                return 100 * noun + verb

    return float("inf")
コード例 #3
0
ファイル: d2p1.py プロジェクト: Johnxjp/aoc2019
def main():
    intcode = loadv2("data/d2.txt")
    intcode[1] = 12
    intcode[2] = 2
    intcode = parser(intcode)
    return intcode[0]
コード例 #4
0
ファイル: d7p1.py プロジェクト: Johnxjp/aoc2019
def main():
    intcode = loadv2("data/d7.txt")
    return max_thruster(intcode)
コード例 #5
0
ファイル: d5p1.py プロジェクト: Johnxjp/aoc2019
def main():
    intcode = loadv2("data/d5.txt")
    output = parse(intcode, input=1)
    return output
コード例 #6
0
ファイル: d11p1.py プロジェクト: Johnxjp/aoc2019
def main():
    data = loadv2("data/d11.txt")
    computer = Intcode()
    computer.load_data(data)
    n_unique_panels = paint(computer)
    return n_unique_panels