This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/Logtalk/examples/threads/msort/generator.lgt
pmoura a7cfc6e799 Logtalk 2.29.5 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1859 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-03-28 22:50:26 +00:00

20 lines
328 B
Plaintext

:- object(generator).
:- info([
version is 1.0,
author is 'Paulo Moura',
date is 2007/03/22,
comment is 'Simple object defining a predicate for generating lists of random values.']).
:- public(list/2).
list(0, []).
list(N, [R| Rs]) :-
N > 0,
N2 is N - 1,
random::random(R),
list(N2, Rs).
:- end_object.