Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: proper use of .java files (layout) Date: Tue, 18 Dec 2012 13:49:16 -0500 Organization: A noiseless patient Spider Lines: 45 Message-ID: References: <20fa5c05-6fcc-47ed-9e80-a44975887928@googlegroups.com> <50cfcd0b$0$293$14726298@news.sunsite.dk> <50cfd4b9$0$295$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 18 Dec 2012 18:49:22 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="ffb8f7085759b339c1002252b48331a4"; logging-data="3110"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MeSzfttEEj027SbTeWj+L" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: Cancel-Lock: sha1:LEGMj623TFF11RfUz0bxUJ0zh3I= Xref: csiph.com comp.lang.java.programmer:20463 On 12/18/2012 12:23 PM, Patricia Shanahan wrote: > On 12/18/2012 9:13 AM, Gene Wirchenko wrote: >> On Tue, 18 Dec 2012 08:53:58 -0500, Eric Sosman >> wrote: >> >>> On 12/18/2012 12:10 AM, Gene Wirchenko wrote: >> >> [snip] >> >>>> And how would you handle the aces? >>>> >>>> A-6-4-3-2 is ace high, but A-5-4-3-2 is actually 5-4-3-2-A (a >>>> five-high straight). >>> >>> In some "high-low" games, A-5-4-3-2 can be both a >>> five-high straight *and* an Ace with four low cards, >>> possibly winning both the "high" and "low" shares of >>> the pot. >> >> Right. I have rarely ever played high-low and forgot about them. >> Does anyone else have an exception to ambush us with? > > I think that sort of issue could be handled by having game-dependent > Comparator implementations, rather than making Card Comparable. A comparator might have a hard time declaring "Ace is lower than Deuce" and "Ace is higher than Deuce" simultaneously ... And then, there are games where two identical ranks in the same hand can have different values. With A-A-9, for example, a Blackjack player would get the desired total of 21 by counting one Ace as a 1 and the other as an 11. (This appears to be the class of game the O.P. is interested in.) > I would be more concerned about jokers, which do not follow the > (suit,value) pattern. Other pattern-busters might be the Jacks of Spades and Hearts. When "one-eyed Jacks are wild," they can be of any rank or suit. (I've read that the King of Diamonds is sometimes considered wild, but have never actually encountered the practice.) -- Eric Sosman esosman@comcast-dot-net.invalid