Hey, i am new to this forum so hope i am asking this question in the right spot, sorry if im not!
I just started prolog and am trying to understand lists.
say i have two lists of lists eg:
L1 = [[_,_,_],[_,_,_],[_,_,_].
L2 = [[1,0,5],[8,2,0],[0,0,9]].
how do i compare the two lists of lists so that L1 is replaced by the contents of L2 except if it is a zero (0), then it remains anonymous??
ie: L1 = [[1,_,5],[8,2,_],[_,_,9]].
Any tips would be very helpful, Cheers!
I just started prolog and am trying to understand lists.
say i have two lists of lists eg:
L1 = [[_,_,_],[_,_,_],[_,_,_].
L2 = [[1,0,5],[8,2,0],[0,0,9]].
how do i compare the two lists of lists so that L1 is replaced by the contents of L2 except if it is a zero (0), then it remains anonymous??
ie: L1 = [[1,_,5],[8,2,_],[_,_,9]].
Any tips would be very helpful, Cheers!