Interleaving Elements of a Prolog list
问题 I am new to Prolog and came across this practice excercise. The question asks to define a predicate zipper([[List1,List2]], Zippered). //this is two lists within one list. This predicate should interleave elements of List1 with elements of List2. For example, zipper([[1,3,5,7], [2,4,6,8]], Zippered) -> Zippered = [1,2,3,4,5,6,7,8]. zipper([[1,3,5], [2,4,6,7,8]], Zippered) -> Zippered = [1,2,3,4,5,6,7,8]. So far I have a solution for two different list: zipper ([],[],Z). zipper([X],[],[X]).