aoc23/08/test2.pl

20 lines
371 B
Prolog

:- op(700, xfx, to).
direction("lr").
mma to mmb-xxx.
mmb to xxx-mmz.
mmz to mmb-xxx.
nna to nnb-xxx.
nnb to nnc-nnc.
nnc to nnz-nnz.
nnz to nnb-nnb.
ooa to ooz-oob.
oob to ood-ooc.
ooc to ooa-oox.
ood to ooz-ood.
ooz to oob-ooz.
xxx to xxx-xxx.
% Routes = [mma-(2-2-[0-mmz]), nna-(6-3-[0-nnz, 3-nnz]), ooa-(8-1-[0-ooz, 1-ooz])].
% X = mmannaooa-(24-18-[0-mmznnzooz]).