in reply to list of four digit lock combinations without repeated digits
Algorithm::Combinatorics is good for this (though it sometimes takes trial and error to work out which of it algorithms you need), and it generates these kinds of patterns very efficiently:
#! perl -slw use strict; use Algorithm::Combinatorics qw[:all]; my $iter = combinations( [0..9], 4 ); print "@$_" while $_ = $iter->next; __END__ C:\test>4of10Combinations.pl | wc -l 210
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: list of four digit lock combinations without repeated digits
by usemodperl (Beadle) on Jun 21, 2018 at 01:23 UTC | |
by BrowserUk (Patriarch) on Jun 21, 2018 at 04:34 UTC | |
by usemodperl (Beadle) on Jun 21, 2018 at 08:18 UTC | |
by BrowserUk (Patriarch) on Jun 21, 2018 at 10:32 UTC | |
by usemodperl (Beadle) on Jun 22, 2018 at 02:35 UTC | |
| |
|
Re^2: list of four digit lock combinations without repeated digits
by Lotus1 (Vicar) on Jun 20, 2018 at 20:10 UTC |