Part 1 worked with the following inventory:
- space heater
- antenna
- spool of cat6
- klein bottle
This commit is contained in:
Dece 2019-12-28 23:24:12 +01:00
parent 4a35800124
commit fcb6b51a3e

32
2019/day25.py Normal file
View file

@ -0,0 +1,32 @@
from intcode import Intcode, AIC
def main():
codes = Intcode.parse_file("day25.txt")
dr = DroidRemote(codes)
dr.run()
class DroidRemote(AIC):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.input_text = ""
def input_data(self):
if not self.input_text:
self.input_text = self.keybind(input(">")) + "\n"
return super().input_data()
def keybind(self, s):
return {
"i": "inv",
"n": "north",
"e": "east",
"s": "south",
"w": "west",
}.get(s, s)
if __name__ == "__main__":
main()