Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- groesser([], [], 0).
- groesser([A|As], [B|Bs], X) :- greater_than_list([A], [B|Bs], 0, X), X is X + 1, write(X), nl, groesser(As, B, X).
- groesser([A|As], [B|Bs], X) :- ignore(greater_than_list([A], [B|Bs], 0, X)), write(X), nl, groesser(As, B, X).
- greater_than_list(A, [B|Bs], Y, _) :- A>B, Y is Y + 1, greater_than_list(A, Bs, Y, _).
- greater_than_list(_, [], Y, X) :- Y>0, X is X + 1.
- % groesser([], [], 0).
- % groesser([A|As], [B|Bs], X) :- greater_than_list([A], [B|Bs]), X is X + 1, write(X), nl, groesser(As, B, X).
- % groesser([A|As], [B|Bs], X) :- greater_than_list([A], [B|Bs]), write(X), nl, groesser(As, B, X).
- % greater_than_list(A, [B|Bs]) :- A>B, greater_than_list(A, Bs).
- % greater_than_list(_, []).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement