11 Aug 2000 decklin   » (Master)

The coconuts problem in almost 80 chars:

perl -le'N:for(0..9999){$x=5*$_+1;for(1..5){$x=int($x*5/4+1);next N if$x%5!=1;}print$x;}'

I'm sure this can be improved, as I'm not much of a golfer (search Deja...), but it's still wonderfully evil. Note that the lower bound for where I have placed 9999 is good old familiar 1024... since bwtaylor has obviously taken a much more mathematical approach to the solution, perhaps he can enlighten us here. (And yes, I do have a non-obfuscated version of the above.)

Haven't gotten anywhere on the 12 coins problem. I once read a Piers Anthony book in which this puzzle played a semi-important part, so I'm sure the solution is rolling about in my subconscious somewhere.

If anyone wishes, I can type up the oracle problem...

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!