Program create variation with repeated list elements
Source: Guide to Prolog Programming (on-line tutorial)
Program source code: variation_2.pl
varia_rep(0,_,[]). varia_rep(N,L,[H|RVaria]):-N>0,N1 is N-1,delete(H,L,_),varia_rep(N1,L,RVaria). delete(X,[X|T],T). delete(X,[H|T],[H|NT]):-delete(X,T,NT).