freelanceprogrammers.org Forum Index » Perl
request for guidance....
Joined: 11 Jul 2004
Posts: 2
request for guidance....
I am in a Perl class this summer and we are allowed to seek
outside help. I`ve tried other Perl groups (I`ve gotten tremendous
support from a sys admin group I`m on but don`t want to bug them with
alot of Perl questions at this time); I`m trying this group now.
I have a looping algorithm problem. The following code emulates
the CA super lotto. For $1, say, you get 1 set of 5 numbers; for $12,
you would get 12 sets of 5 numbers. Each set is designated with
a letter. There are twelve letters--A-J. This is my problem:
the program needs to loop back and repeat the letters, for ex.,
if the number exceeds 10. The program fails at this point if the
number exceeds 10.
Here`s the code and any hint or guidance would be appreciated.
Mind you I am not looking for someone to write my code for me:
require 5.004;
die "$0 requires some money!
" if $#ARGV < 0;
#$storeNumber="96j3328";
@letters=qw/A B C D E F G H I J/;
$i=0;
$pick=$ARGV[0];
while($pick)
{
print $letters[$i++], " ";
for ( $j = 0; $j <= 3; $j++)
{
$little=int(rand(47)) +1 ;
print "$little ";
sleep(1);
}
$big=int(rand(28)) +1 ;
print " $big ";
print "
";
$pick--;
}
Thanks in advance, Kathryn
Joined: 11 Jul 2004
Posts: 2
request for guidance....
I am finished with this program but wish to thank anyone who
read this!
Kathryn
On Jul 10, 2004, at 1:14 PM, Kathryn Tate wrote:
> I am in a Perl class this summer and we are allowed to seek
> outside help. I`ve tried other Perl groups (I`ve gotten tremendous
> support from a sys admin group I`m on but don`t want to bug them with
> alot of Perl questions at this time); I`m trying this group now.
> I have a looping algorithm problem. The following code emulates
> the CA super lotto. For $1, say, you get 1 set of 5 numbers; for $12,
> you would get 12 sets of 5 numbers. Each set is designated with
> a letter. There are twelve letters--A-J. This is my problem:
> the program needs to loop back and repeat the letters, for ex.,
> if the number exceeds 10. The program fails at this point if the
> number exceeds 10.
>
> Here`s the code and any hint or guidance would be appreciated.
> Mind you I am not looking for someone to write my code for me:
>
> require 5.004;
>
>
> die "$0 requires some money!
" if $#ARGV < 0;
>
> #$storeNumber="96j3328";
> @letters=qw/A B C D E F G H I J/;
> $i=0;
> $pick=$ARGV[0];
> while($pick)
> {
> print $letters[$i++], " ";
>
> for ( $j = 0; $j <= 3; $j++)
>
> {
> $little=int(rand(47)) +1 ;
> print "$little ";
> sleep(1);
> }
> $big=int(rand(28)) +1 ;
> print " $big ";
> print "
";
> $pick--;
> }
>
> Thanks in advance, Kathryn
>
>
>
>
>
> Yahoo! Groups Sponsor
>
> ADVERTISEMENT
> <lrec_companion_043004.gif>
> <l.gif>
>
> Yahoo! Groups Links
>
> • To visit your group on the web, go to:
> http://groups.yahoo.com/group/perl_official/
>
> • To unsubscribe from this group, send an email to:
> perl_official-unsubscribe@yahoogroups.com
>
> • Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service.
>
>
[Non-text portions of this message have been removed]
All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







