From: Zed Lopez Date: 2005-11-23T15:29:54+09:00 Subject: Re: [QUIZ SOLUTION] Euchre Hands (#55) On 11/22/05, Bob Showalter wrote: > Zed Lopez wrote: > > A couple of my early attempts depended on the idea that the trump suit > > absolutely determined the ranking of the cards, independent of knowing > > anything else. It doesn't work, though. > > ... > > Ordering the hand can't come without considering what suits are present. > > I addressed this by generating a suit order in alternating colors > starting with the trump suit. Then some hand checking of the various > possibilities showed me that the only adjustment needed was to swap the > second and fourth suits if the hand was void in the second suit. Given > that adjustment, any combination of suits in the hand should yield > properly alternating colors. I did it kind of bottom-up to your approach's top-down -- starting with array of the suits present in the hand, in arbitrary order, I moved the trump suit to the front. Then, if there were three or more suits, if the second suit was the same color as the trump suit, I swapped the second and third suits.