BeginnerPro
Programmer
Hi,
Im new to Prolog and was looking for some assistance. What i am trying to do is basically get the sum of the list of list, if that makes sense? lol
What i am trying to achieve is.... sum([ [1,2],[3,4],[5,6] ]). should return:
Number Of Lists: 3
List 1
3
List 2
7
List 3
11
....etc
I can get the Number of Lists which is fairly simple but im not quite sure how to loop through the List and then for each List add the numbers up. Am i making this more complicated than it actually is? lol!
If anyone can help me or point me in the general direction that would be great.
Thanks in advance
Im new to Prolog and was looking for some assistance. What i am trying to do is basically get the sum of the list of list, if that makes sense? lol
What i am trying to achieve is.... sum([ [1,2],[3,4],[5,6] ]). should return:
Number Of Lists: 3
List 1
3
List 2
7
List 3
11
....etc
I can get the Number of Lists which is fairly simple but im not quite sure how to loop through the List and then for each List add the numbers up. Am i making this more complicated than it actually is? lol!
If anyone can help me or point me in the general direction that would be great.
Thanks in advance