Here is a solution using just an array slice:
use v5.14; use strict; use warnings; my @options = (1 .. 100); for (1 .. 100) { my $choice = int(rand($#options + 1)); say 'Choice #', $_, ' is ', $options[$choice]; @options = @options[ 0 .. ($choice - 1), ($choice + 1) .. $#option +s ]; }
HTH,
Athanasius <°(((>< contra mundum
In reply to Re: biased random number picking
by Athanasius
in thread biased random number picking
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |