Day 21 part 2

This commit is contained in:
Dece 2019-12-22 01:00:00 +01:00
parent 1c0ad51b60
commit dc85aadc3a
3 changed files with 21 additions and 0 deletions

View file

@ -1,6 +1,9 @@
# In any case, jump only if 4th tile is ground as it's where we land.
OR D J OR D J
# If 3rd is a hole, jump.
NOT C T NOT C T
AND T J AND T J
# If the next tile is a hole, you must jump anyway.
NOT A T NOT A T
OR T J OR T J
WALK WALK

View file

@ -0,0 +1,16 @@
# Jump if 1 is a hole.
NOT A J
# Jump if there are holes that can be directly jumped.
NOT B T
OR T J
NOT C T
OR T J
# Don't jump if 4 is a hole.
AND D J
# Don't jump if 5 and 8 are holes.
NOT E T
NOT T T
OR H T
AND T J
# Go!
RUN

View file

@ -1,3 +1,5 @@
"""Pipe springscript file to stdin. Comments (#) can be escaped with grep -v."""
import sys import sys
from intcode import AIC from intcode import AIC