Don't ask to ask, just ask | |
PerlMonks |
Re: Perl Card Trickby Flexx (Pilgrim) |
on Sep 15, 2002 at 06:10 UTC ( [id://198000]=note: print w/replies, xml ) | Need Help?? |
Hi again, BTW, nice post, Lysander, I really got hung on that one... Below is my quickshot version. Of course, a serious version of this would need input checks, etc., etc. I was just courious how I'd do this in a generalized way, using a flat array (like a talon of cards). This version allows for matrices of arbitrary dimensions. The print_matrix sub should therefore also be generic for all (quadratic) arrays -- where sqrt(@array) returns a natural number (an integer).
So long,
In Section
Code Catacombs
|
|