DigitalKitty has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; my $numTop; my $numSide; my @top; my @side; print "Number of pairs for top of punnett square:"; chomp( $numTop = <STDIN> ); for( my $x = 0; $x < $numTop; $x++ ) { print "Enter pairs ( xx ): "; chomp( $_ = <STDIN> ); push @top, $_; } print "Number of pairs for side of punnett square:"; chomp( $numSide = <STDIN> ); for( my $y = 0; $y < $numSide; $y++ ) { print "Enter pairs ( xx ): "; chomp( $_ = <STDIN> ); push @side, $_; } for( my $i = 0; $i < @top; $i++ ) { for( my $j = 0; $j < @side; $j++ ) { print "$top[$i]" . "$side[$j]\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Punnett squares and perl.
by graff (Chancellor) on May 15, 2003 at 02:24 UTC | |
by belg4mit (Prior) on Dec 01, 2006 at 07:45 UTC | |
|
Re: Punnett squares and perl.
by runrig (Abbot) on May 15, 2003 at 02:09 UTC | |
|
Re: Punnett squares and perl.
by BrowserUk (Patriarch) on May 15, 2003 at 02:37 UTC | |
|
Re: Punnett squares and perl.
by wufnik (Friar) on May 15, 2003 at 08:10 UTC |