in reply to Shuffling CODONS
My favorite shuffle
#!/usr/bin/perl # http://perlmonks.org/?node_id=1216102 use strict; use warnings; my @trips = 'a' .. 'z'; my @shuftrips = myshuffle( @trips ); print "@shuftrips\n"; sub myshuffle { map $_->[0], sort { $a->[1] <=> $b->[1] } map [ $_, rand ], @_; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Shuffling CODONS
by BrowserUk (Patriarch) on Jun 07, 2018 at 14:41 UTC | |
|
Re^2: Shuffling CODONS
by WouterVG (Novice) on Jun 07, 2018 at 14:02 UTC | |
by tybalt89 (Monsignor) on Jun 07, 2018 at 14:23 UTC | |
by tobyink (Canon) on Jun 07, 2018 at 14:48 UTC |