pub fn select_char(
rnd: &mut impl Rng,
) -> char
Selects a random character the way
special is non-empty, there is a 50% chance that a character from this
array is chosen randomly, and will be returned if that character falls
preferred is non-empty, there is a 50% chance that any generation
which gets past the
special step picks a random element from this list,
then a random character from within that range (both endpoints inclusive).
That character will be returned if it falls within
In all other cases, an element is picked randomly from
ranges and a
random character within the range (both endpoints inclusive) is chosen and
Notice that in all cases,
ranges completely defines the set of characters
that can possibly be defined.
It is legal for ranges in all cases to contain non-characters.
ranges bias selection towards characters in smaller
ranges. This is deliberate.
preferred is usually tuned to select
particular characters anyway.
ranges is usually derived from some
external property, and the fact that a range is small often means it is