So I know how to find the minimum in a list, but what if I wanted to square the result? Here is what I have to find the minimum:
min_in_list([Min],Min).
min_in_list([H,K|T],M) :-
H =< K,
min_in_list([H|T],M).
min_in_list([H,K|T],M) :-
H > K,
min_in_list([K|T],M).
It’s been awhile, but I think something like: