New to prolog, trying to get my head around dealing with lists of lists recursively.
Say I have a list:
prices([20, 20, 40]).
And another list (of lists):
items([ [12, 14, 23],[8, 16, 22],[18, 12, 14] ]).
I want to append an element from prices to each list in items:
items([ [12, 14, 23, 20],[8, 16, 22, 20],[18, 12, 14, 40] ]).
I'm having trouble with working through both a single list and a list of lists at the same time.
Any pointers would be appreciated.
Thanks!