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).