2025 Advent of Code Day 12 Part 1

Prolog. Developed and tested with GNU Prolog 1.5.0. :- dynamic ( shape / 2 ). read_line_codes ( Stream , Codes ):- get_code ( Stream , C ), ( C == - 1 -> Codes = end_of_file ; C == 10 -> Codes = [] ; read_line_codes ( Stream , Cs ), Codes = [ C | Cs ] ). read_all_lines ( Stream , Lines ):- read_line_codes ( Stream , Line ), ( Line == end_of_file -> Lines = [] ; Lines = [ Line | Rest ],…