You could check first whether there are likely to be enough a's and if not use tr/a/y/ to change them all and then go straight to the c's.
pojmy $letter='a'; if (($cnd_a + $cnd_y) <= $incrsdel){ $aob[$yb] =~ tr/a/y/; $cnd_y += $cnd_a; $letter='c'; } while ($cnd_y < $incrsdel){ my $xda = int rand( $chntot + 1 ); if ( substr( $aod[$yb], $xda, 1 ) eq $letter ) { substr $aod[$yb], $xda, 1, 'y'; $cnd_y++; } }
In reply to Re^2: More while issues
by poj
in thread More while issues
by Dandello
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |