in reply to Golf: Movie style code cracker.

OK, I'll bite. 139 characters.

perl -le'sub r{join"",map{int rand 10}1..$_[0]}$C=r($l=shift);while($t +!=$C){print"$t";($r)="$t-$C"=~/^(.*).*-\1/;$t=$r.r($l-length$r)}print +"$t"' 10

Some bug-like things:

  1. It compares its guesses with the target number using "!=" (shorter than "ne" with spaces), so it goes goofy if you ask for a large number.
  2. The first "guess" is an empty string.

It does not take 2.5 minutes to run. On my machine, it's less than .1 sec, actually. Perhaps a slow motion camera or digital special effects department could compensate.