[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Perl Card Games



On Fri, Aug 06, 1999 at 10:53:58AM +0100, Peter Haworth wrote:
> > Why waste characters<tm>[1]?
> > 
> > %cards = ( sort(1..10,1..10),  J => 11, Q => 12, K => 13, A => 14, );
> > #                                                and note A != K :-)
> 
> Oh dear. Now your deck has 56 or 58 cards. You don't need both '1' and 'A' in
> there, even if A != K

You're right, of course. The following should fix it:

%cards = ( sort(1..10,1..10), J => 11, Q => 12,
	K => 13, A => $cards{1}, ) for (1,2);

(of course this may mess up your sorts. But who said dealing with
cards was safe?)

-- 
believing is seeing
gaal@forum2.org
http://www.forum2.org/gaal/

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe