テキストの最大値を認識できるプログラムが必要です。最初にテキストファイルをストリーミングし、
charごとにinfosを取得しますが、正方形かどうかに関係なく計算と結果を取得できません。正方形の場合は、sample.txtの座標に数値を入力します。
setup:-process('sample.txt').
process(File) :-
open(File, read, In),
get_char(In, Char1),
process_stream(Char1, In),
close(In).
process_stream(end_of_file, _) :- !.
process_stream(Char, In) :-
get_char(In, Char2),
look(Char,Char2),
process_stream(Char2, In).