summaryrefslogtreecommitdiff
path: root/random_choice.pl
blob: 43e47351e83bfd5f187331a4c8b5281fc79cb390 (plain)
1
2
3
4
random_choice_do(c,Number):-Number < 0.5,!.
random_choice_do(d,_).

random_choice(_, Choice, _, _) :- random(Number), random_choice_do(Choice, Number).