Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!border2.nntp.ams2.giganews.com!backlog4.nntp.ams3.giganews.com!backlog4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 03 Aug 2014 14:34:12 -0500 Date: Sun, 03 Aug 2014 20:34:11 +0100 From: lipska the kat User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Help with Deck of cards assignment and getting it to deal... References: <53de8cd5$0$299$14726298@news.sunsite.dk> In-Reply-To: <53de8cd5$0$299$14726298@news.sunsite.dk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 36 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-QhUQ9tRIdbJvTGklUaz5Uevjpm8Mn2MV1Qb1+qy5RtpyeNNYJw7if0fm+amRoReRZcWWORmerSpEN08!YurgAewu+uEKSsyNOS48Wg2mRmvftiJsyGKVPeVwuDsv/0NkprgaatqCNsY/uO+VOaqtVMb+vYE= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2714 Xref: csiph.com comp.lang.java.programmer:29535 On 03/08/14 20:26, Arne Vajhøj wrote: > On 8/3/2014 3:00 PM, Eric Sosman wrote: >> On 8/3/2014 1:25 PM, Jeff Higgins wrote: >>> On 08/03/2014 11:41 AM, Eric Sosman wrote: >>>> On 8/3/2014 11:08 AM, Jeff Higgins wrote: >>>>> On 08/01/2014 09:16 PM, Scott Dunning wrote: >> Given the variety of card games, Comparable is a wrong-headed >> approach for ranks, for suits, and even for hands. >> >> Scott: Don't Go There; you'll just get lost. > > I must admit that I can not follow you. > > The fact that different games may use a different ordering is > not an argument against Comparable<>. > > Comparable<> is not the one and only ordering. Comparable<> is > just the natural ordering. It is perfectly valid to have a > Comparable<> with the natural ordering and a bunch of > Comparator<> to handle the context specific orderings. Exactly, and what better way to encapsulate the rules of a game than in a Comparator. You can develop Deck and Shuffle and Hand etc etc and simply (well perhaps not 'simply') implement different games by implementing different Comparators ... Sounds 'OO' to me. -- lipska the kat - treacherous feline. Proudly nominated for IPOTY 2014 - LIGAF GNU/Linux user #560883 - linuxcounter.net