Since i started on the problem a bit early before anyone had a score to show for, i actually tried to solve the real problem and got a working solution. I'm not going to show my code for it, because it wasnt excactly short :)
But I knew that Two-Bits had said something about having a solution in the 40's, so i started looking for a better way. I figured i could look at the output from all possible input in the case with 27 cards, which gave me this table: 111 : 0 : 1 112 : 1 : 10 113 : 2 : 19 121 : 3 : 4 122 : 4 : 13 123 : 5 : 22 131 : 6 : 7 132 : 7 : 16 133 : 8 : 25 211 : 9 : 2 212 : 10 : 11 213 : 11 : 20 221 : 12 : 5 222 : 13 : 14 223 : 14 : 23 231 : 15 : 8 232 : 16 : 17 233 : 17 : 26 311 : 18 : 3 312 : 19 : 12 313 : 20 : 21 321 : 21 : 6 322 : 22 : 15 323 : 23 : 24 331 : 24 : 9 332 : 25 : 18 333 : 26 : 27 Tried to look for the pattern in the Integer Sequence Encyclopedia, but didnt find it, so i had to actually think for myself :) Obviously as it may look, it actually took me a few hours to see the pattern. I cant brag that i used any math to find the solution, just plain old try and fail :) Terje > -----Original Message----- > From: Riley [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 03, 2004 6:32 PM > To: [EMAIL PROTECTED] > Subject: Re: A new golf "Cardtrick" has started > > > Hello All! > > I thought I'd open the following up to discussion. > > In most of the solutions, we have something similar to: > > -lap $_=$F[s/.. / /g/2+$_+3*$&+9*$'-27] > (The above is Stephen Turner's) > > All of the solutions contain an inner expression of the form: > > 9a + 3b + 1c, (or 3**2 a + 3**1 b + 3**0 c), > > where a, b, and c correspond to the columns of cards selected. > > What strikes me as particularly odd is the fact that we all > needed to add a certain amount to the above expression, > namely @F/2 - 27, where the y-intercept is 27 (or 3**3). > > I guess my question is this: Is this just a coincidence, the > fact that our y-intercept is also a power of 3, and not > just any power of the three, but the next in sequence? > > -Riley > (o0lit3) > > P.s. -My solution: > -plaF [EMAIL PROTECTED]/2-/ . (.)/*28+9*$'+3*$1+$&]Why is it that I always forget > that I don't need the -F switch > when I'm not splitting by anything funny? >