このディレクトリの索引
#  I have to fill out a list of length n digits. I know that n-1 is in the range from 1 to 9, and one digit can be in the range from 1 to 99. I did it this way:
#  
#  generate([First|Next],Czynniki):-
#      between(1,99,First),
#      generate2(Next).
#  generate2(Next):-
#      sublist([1,2,3,4,5,6,7,8,9],Next).
#  sublist([],[]).
#  sublist([H|T],[H|S]):-
#      sublist(T,S).
#  sublist([_|T],S):-
#      sublist(T,S).
#  Doing it this way I generate some of the same solutions. Maybe you have some idea ??how I can generate lists without repetition?

generate(_n,L) :-
        length(L,_n),
        generate(_n,99,L).

generate(_,_,[]) :- !.
generate(_,99,[J]) :-
        J is random(99) + 1,!.
generate(_n,99,[J|R]) :-
        0 is random(_n),
        J is random(99) + 1,
        generate(_n,9,R).
generate(_n,99,[J|R]) :-
        J is random(9) + 1,
        generate(_n,99,R).
generate(_,9,[J|R]) :-
        J is random(M) + 1,
        generate(_,9,R).