note
vrk
<p>
124 characters, with the following features:
</p>
<ul>
<li>Digits are displayed on a single line instead of scrolling the screen. (Tested only on Linux with bash.)</li>
<li>Execution takes anything between <code>$D</code> and <code>$D*10</code> seconds to run, when using base 10. Thus, if <code>$D == 10</code>, the program may run for as long as 100 seconds or 1 m 40 s. <code>$D == 15</code> will break the "bonus barrier".</li>
</ul>
<spoiler>
<code>
perl -e'$|++;split//,int rand 10**pop;sub f{$.=++$.%10;print$.;sleep 1,print"\b";$.==$_[0]||&f;print
shift;@_&& &f}&f;print"\n"' 10
</code>
<p>
You may additionally add <code>."\a"</code> after <code>print shift</code> to produce a bell sound after a digit has been successfully found. That increases character count to 129.
</p>
<p>
The OP is ambiguous, though. It says pick a number between 0 and 1e<sup><code>$D</code></sup>-1, but doesn't say whether it should contain prefix zeroes or not. My code doesn't produce prefix zeroes.
</p>
</spoiler>
<div class="pmsig">
<div class="pmsig-399589">
<p>
-- <br>
say "Just Another [href://http://prometheus.frii.com/~gnat/yapc/2000-stages/slide36.html|Perl Hacker]";
</p>
</div>
</div>
710927
710927