|
S|
is K.
For a large K/N it enumerates 1..N and
decides randomly to include the number or not. For example:
?- randset(5, 5, S). S = [1, 2, 3, 4, 5]. (always) ?- randset(5, 20, S). S = [2, 7, 10, 19, 20].
- See also
- randseq/3.
|
S|
is K.
For a large K/N it enumerates 1..N and
decides randomly to include the number or not. For example:
?- randset(5, 5, S). S = [1, 2, 3, 4, 5]. (always) ?- randset(5, 20, S). S = [2, 7, 10, 19, 20].