Documentation Prolog Predicate Reference random random_member/2

random_member/2

Get random element of list.

Description

random_member( ?term, ?list )

random_member(Member, List) succeeds if a randomly chosen value from List can unify with Member. If List is the empty list, or if Member is binded with a value which is not the one randomly chosen, the goal will fail.

Implementation