krandom(0,[]). krandom(N,[X|Xs]) :- random(0,100,X), M is N-1, krandom(M,Xs), !.