My task is to write a rule in SWI Prolog, which takes two strings as input. It should then divide and merge them at a random point and generate two new lists.
Example:
?- crossover([a,r,s,u,p],[b,t,c,z,k],NewList1,NewList2).
NewList1 = [a,r,s,z,k]
NewList2 = [b,t,c,u,p]
I have no idea how to split lists at a random point and then generating two new lists from there.. Thanks a lot in advance to anyone who can help! :)