in reply to Punnett squares and perl.
And definitely don't use the C style for loop for that last loop. Use for my $t (@top) {, etc. Then you don't have to worry about off by one errors, or having to index your array to get to the elements.print "Number of pairs for top of punnett square:"; chomp( $numTop = <STDIN> ); my @top = (0) x $numTop; for ( @top ) { print "Enter pairs ( xx ): "; chomp( $_ = <STDIN> ); }
|
|---|