Day 21 part 2
This commit is contained in:
parent
1c0ad51b60
commit
dc85aadc3a
|
@ -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
|
||||||
|
|
16
2019/day21-p2.springscript
Normal file
16
2019/day21-p2.springscript
Normal 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
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue