Keep It Simple, Stupid | |
PerlMonks |
Re: Golf: Movie style code cracker.by betterworld (Curate) |
on Sep 14, 2008 at 19:34 UTC ( [id://711315]=note: print w/replies, xml ) | Need Help?? |
108 characters:
Update: Adopted the required counting method, thus I have 108 characters, not 103. Update 2: New version with 71 characters (however it would be a few (about 4) characters more if I hadn't copied a trick from BrowserUk; I'll elaborate in the spoiler tag): Caveat: The second version will probably not terminate for a 1-digit code. Update 3: :-( I just noticed that my 71 character solution has the problem that it always prints "8" as the last digit. For the moment, I offer the following fix, which makes it 75 characters long (and I'll omit the spoiler tags as the contest seems to be over):
(And you can modify the 1e6 constant to shorten the runtime.)
In Section
Meditations
|
|