in reply to Re: array shuffle
in thread array shuffle
I'm trying to test my skills without using the shuffle function. I was def using the wrong loop.
Here's my problem now though, I want to shuffle the "deck" twice.
using the while (@deck) I can get the deck shuffled once, but when I use:
@hand = shuf(@deck); print "deck shuffled once:\n"; print"@hand\n"; @deck = @hand; @newhand = shuf(@deck); print"deck shuffled twice:\n"; print"@newhand\n";
I don't get the result I'm hoping for, what am I doing wrong now?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: array shuffle
by davido (Cardinal) on Aug 18, 2011 at 04:19 UTC | |
|
Re^3: array shuffle
by jwkrahn (Abbot) on Aug 18, 2011 at 04:02 UTC | |
|
Re^3: array shuffle
by ikegami (Patriarch) on Aug 18, 2011 at 06:03 UTC |