aoc23/08/test.pl
2023-12-08 17:10:35 -08:00

10 lines
255 B
Prolog

% cat input.txt \
% | sed -r -e 's~^(.*) = \((.*), (.*)\)$~\L\1 to \L\2-\L\3.~' \
% | sed -r -e 's~^([RL]+)$~:- op(700, xfx, to).\ndirection("\L\1").~' > input.pl
:- op(700, xfx, to).
direction("llr").
aaa to bbb-bbb.
bbb to aaa-zzz.
zzz to zzz-zzz.