aoc23/08/test.pl

10 lines
255 B
Perl
Raw Normal View History

2023-12-08 19:10:35 -06:00
% 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.