2025 Advent of Code Day 11 Part 2

Prolog. Developed and tested with GNU Prolog 1.5.0. :- dynamic ([ connected / 2 , memoized_paths / 3 ]). check_and_read ( 10 , [] , _ ):- !. check_and_read ( Char , [ Char | Chars ], Stream ):- get_code ( Stream , NextChar ), check_and_read ( NextChar , Chars , Stream ). read_data ( Stream , []):- at_end_of_stream ( Stream ). read_data ( Stream , [ X | L ]):- \+ at_end_of_stream ( Stream ),…