Same thing without the array:
my $joined_string = '-' x 600; foreach ( 1 .. 10 ) { my $i = int rand 600; redo if 'X' eq substr $joined_string, $i, 1; substr $joined_string, $i, 1, 'X'; }
In reply to Re^2: Difficulty in randomization
by jwkrahn
in thread Difficulty in randomization
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |