I am battling with prolog like a weary adversary, and i'd like some help or even just to tell me where i'm going wrong. I've got a list of 6 items which i then turn into 3 pairs of colours. I then try and run a check on it to see if it identifies the pair of colours within the list. When i run it, it converts the pairs, does the check, but only finds the pair when they are the first item in the list. I am thinking my tail recursion is wrong. If anyone could help, greatly appreciated. Thanks. (Code below)
isredwhite([X1|_], XP):-member(red,X1),member(white,X1), XP is 1.
isredwhite([_|T], 0):-isredwhite(T, 0).
:- dynamic cube/6.