When executing the next Prolog program with YAP, the output is always the same, namely the integer 233.
:- use_module(library(random)).
x:- random(1,1000,X), writeln(X).
For example, if I execute the following bash script, the output will always be the same integer (233).
for k in `seq 0`
do
yap -l test.pl << %
x.
%
done
If I repeat this procedure using swipl, then each time each result will be different, i.e. random.
Can anyone explain this?
source
share