Hi,
how can i build a predicate to find the top card of a deck of cards. e.g
card(desk,a).
card(a,b).
card(b,c).
card(c,d).
card(d,e).
--------------------------
?- is_top(T).
T = e
Yes
?- is_top(d).
No
How can i create a prdicate for doubling every second entry of a list and discarding the others using an accumulator?
e.g
?-double(['g',o,o,g,l,e],T).
T = [o,o,g,g,e,e]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.