in reply to Golf: Movie style code cracker.
$n=pop;for(;;){warn$f,map(int rand 10,1..$n),$/;++$i%1e3 or$f.=int ran +d 10 and$n--or last}
You could make it run for >2.5 minutes by ...
Update: Here is another one that fills in the fixed positions not left-to-right, but randomly, to look more Matrix-like. As it gets more and more characters fixed, it slows down to increase the drama (this is me trying to sell a design inefficiency as a feature). It's 124 characters.
@x=("%d")x($n=pop);$"="";for(;;){printf"@x\n",map(int rand 10,1..$n);+ ++$i%500 or$n-=$x[rand@x]=~s/../int rand 10/e or last;}
On my machine, it looks nice doing 20-digit combinations.
blokhead
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Golf: Movie style code cracker.
by repellent (Priest) on Sep 14, 2008 at 01:47 UTC |