Joined
Last Seen
0 Reputation Points
Unknown Quality Score
No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
0 Endorsements
Ranked #107.70K
1 Posted Topic
Rashakil was correct that the rule matching a single number needs to come last. Here is a complete answer. Your first line also had to be changed: totalSum([],N) :- N is 0. totalSum([H|T],S):- totalSum(H,Sum1), totalSum(T,Sum2), S is Sum1+Sum2. totalSum(N,S):- S is N. and here are some examples of using it: …
The End.
fgmart