I'm using LPA WIN-PROLOG and I want to get random values. I looked for a random predicate and I don't find one that is already defined. What I tried:
X is random(10)
random(1,10,X)
Can someone help me find the way to get a random value?
Thanks.
I'm using LPA WIN-PROLOG and I want to get random values. I looked for a random predicate and I don't find one that is already defined. What I tried:
X is random(10)
random(1,10,X)
Can someone help me find the way to get a random value?
Thanks.
Copyright © 2021 Jogjafile Inc.
LPA Win-Prolog provides a
rand/1built-in function and aseed/1predicate to get/set the seed of the random number generator. Therand/1function returns a float between zero and its argument. For example: