i'm writing a prolog code that will find the maximum number in a list , this is my code , it doesn't work , does anyone know where is the wrong
max([X],X).
max([H|T], M):-
max(T , M1),
T>=M1,
M is T.
i'm writing a prolog code that will find the maximum number in a list , this is my code , it doesn't work , does anyone know where is the wrong
max([X],X).
max([H|T], M):-
max(T , M1),
T>=M1,
M is T.