Not going to say no to another gentle one:
def run(program): pointer, opcode = 0, 0 output = program[:] while True: opcode = output[pointer] if opcode == 99: return output [param1, param2, address] = output[pointer+1:pointer+4] if opcode == 1: output[address] = output[param1] + output[param2] elif opcode == 2: output[address] = output[param1] * output[param2] pointer += 4
Given an "Intcode program" we hop through the opcodes by incrementing a pointer four places at a time, altering the program as we go along.
For the second star we just need to find what first two parameters, in the range 0-99, for the program would result in a final state where the first address contains a target number. Thankfully it did mean integers within that range!
def find(program, target): for noun in range(0, 100): for verb in range(0, 100): test = program[:] test = noun test = verb if finalState(test) == target: return (noun, verb) break else: continue break