in reply to Golf: Movie style code cracker.
perl -e'$d=shift;$c=sprintf"%0${d}d",int rand 10**$d;@n=split//,$c;x() +;for(0..$#n-1){$m.=$n[$_];$d--;x();}print$c,$/;sub x{for(1..1e5){prin +tf"$m%0${d}d\n",int rand 10**$d}}' 10
It runs for about 15 seconds (10 digits), but will take 10 times as long (150 seconds, or 2.5 minutes) by changing "1e5" to "1e6".
|
|---|