I'm trying to call the random function inside another function. For example I want to do this assert(fact(random()). But it does not work. How can I insert a random number this way? Thanks.
How can I call a function random inside other function in prolog?
683 views Asked by Kim Doe At
1
In prolog there is no concept of functions like you are trying to do in your code. You should do:
I recommend reading at least first two chapters Learn Prolog Now! to better understand search and unification.