RE: guessing script

2004-04-15 Thread Guay Jean-Sébastien
Hello Greg, > Thanks for you comments. Is this the best way then? Seems to work, but I'm > curious what could be any better.. Your version is fine. Here's mine, just so you have another take on how to do some things. Among a few other things, I added checking for so that the guess has to be a

Re: guessing script

2004-04-15 Thread James Edward Gray II
On Apr 15, 2004, at 1:24 PM, Greg Donald wrote: On Thursday 15 April 2004 12:43 pm, James Edward Gray II wrote: Looks like you already got some good answers. Let me add a few minor comments... Thanks for you comments. Is this the best way then? Seems to work, but I'm curious what could be any

Re: guessing script

2004-04-15 Thread Greg Donald
On Thursday 15 April 2004 12:43 pm, James Edward Gray II wrote: > Looks like you already got some good answers. Let me add a few minor > comments... Thanks for you comments. Is this the best way then? Seems to work, but I'm curious what could be any better.. #!/usr/bin/env perl use Math::Ran

Re: guessing script

2004-04-15 Thread James Edward Gray II
On Apr 15, 2004, at 10:40 AM, Greg Donald wrote: Learning Perl here.. So I wrote this number guessing script but can't see what is wrong with it. I can never get the solution even when I know it's correct. What am I doing wrong? Looks like you already got some good answers. Let me

Re: guessing script

2004-04-15 Thread WilliamGunther
In a message dated 4/15/2004 12:09:40 PM Eastern Daylight Time, [EMAIL PROTECTED] writes: Learning Perl here.. So I wrote this number guessing script but can't see what is wrong with it. I can never get the solution even when I know it's correct. What am I doing wrong? [Snipped Cod

RE: guessing script

2004-04-15 Thread Jayakumar Rajagopal
(my $guess = ); 'my' is your problem.. that creates new varialbe remove it.. HTH Jay -Original Message- From: Greg Donald [mailto:[EMAIL PROTECTED] Sent: Thursday, April 15, 2004 11:41 AM To: [EMAIL PROTECTED] Subject: guessing script Learning Perl here.. So I wrote t

guessing script

2004-04-15 Thread Greg Donald
Learning Perl here.. So I wrote this number guessing script but can't see what is wrong with it. I can never get the solution even when I know it's correct. What am I doing wrong? #!/usr/bin/env perl use Math::Random; use strict; sub run(){ my $solution = random_uniform_in