Posts
 
Reputation
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
~2K People Reached
Favorite Forums
Favorite Tags

1 Posted Topic

Member Avatar for BlackIris

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: …

Member Avatar for fgmart
0
2K

The End.