On 4/4/09 Sat Apr 4, 2009 8:34 PM, "Andrew Fithian"
scribbled:
> What's a slick way to enumerate all subarrays of length n from a master
> array of length m? For example I've been enumerating all possible two
> card hands from a deck of 52 cards (n=2, m<=52) using nested for loops:
> for ( $i =
What's a slick way to enumerate all subarrays of length n from a master
array of length m? For example I've been enumerating all possible two
card hands from a deck of 52 cards (n=2, m<=52) using nested for loops:
for ( $i = 0 ; $i < $#deck ; $i++ ) {
for ( $j = $i+1 ; $j <= $#deck ; $j++