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

Re: [FWP] Perl Card Games



On Wed, Aug 04, 1999 at 06:16:19PM -0400, John Porter wrote:
> $handsize = 5; # straight poker.
> @hands = 5;    # O.k., who's in?
> @$_ = splice @deck, 0, $handsize  for @hands;  # too much fun.
> 

That assigns the first 5 elements of @deck to @5.

$handsize = 5;
@hands = 1 .. 5;
$_ = [splice @deck, 0, $handsize] for @hands;   # fun and effective.

Ronald


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