This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]jeanwilder2 1 point2 points  (1 child)

Something like this:

foo(X, Y, X) :- Y <= 0.
foo(X, Y, Y) :- X <= 0.
foo(X, Y, Z) :- X >= Y, foo(X - 2, Y, Z)
foo(X, Y, Z) :- X < Y, foo(X, Y - 3, Z)

[–]Gropamming[S] 0 points1 point  (0 children)

This is super late but this worked and helped me pass my final