Hi,
I'm trying to make this program work :)
we have a list common([a,d,a,c,d,a,b],R). and R=a the most common letter!
so this is how we probably should find it:
common([X|T],E):- last(T,E),%find the last element (b)
sum([X|T],E,M1),%find how many times that element repeats itself...
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.