Subject: [SWIPL] random/1

From: Дмитрий С. Кузьмин <[email-masked]>
Date: Fri, 2 Mar 2001 13:21:20 +0300 (MSK)

Hi !
--------------------------------------------------------
	I read on-line documentation
	from
http://www.swi.psy.uva.nl/projects/SWI-Prolog/Manual/sec-3.27.html#random/

	anr read this:

random(+Int) 	Evaluates to a random integer i for which 0 =< i < Int. The
		seed of this random generator is determined by the system clock when
		SWI-Prolog was started.

	But :

?- time((X=10,repeat,Y is random(X),(Y==9 -> true; fail))). % 6 inferences
in 0.00 seconds (Infinite Lips)
 
X = 10 Y = 9
 
Yes
?- time((X=10,repeat,Y is random(X),(Y==10 -> true; fail))).                                 

and may wait how want for result.

May be random(+Int) generate i from 0=< i =< Int-1 ? 

Thanks for answer.

--------------------------------------------------------
 With regard to all, Dima