in reply to Golf: Movie style code cracker.
124 characters, with the following features:
perl -e'$|++;split//,int rand 10**pop;sub f{$.=++$.%10;print$.;sleep 1 +,print"\b";$.==$_[0]||&f;print shift;@_&& &f}&f;print"\n"' 10
You may additionally add ."\a" after print shift to produce a bell sound after a digit has been successfully found. That increases character count to 129.
The OP is ambiguous, though. It says pick a number between 0 and 1e$D-1, but doesn't say whether it should contain prefix zeroes or not. My code doesn't produce prefix zeroes.
--
say "Just Another Perl Hacker";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Golf: Movie style code cracker.
by BrowserUk (Patriarch) on Sep 14, 2008 at 03:44 UTC |