Hi err, Mr T.
Here's a solution to your question, but from a different point of view...
--
#!perl -w
use strict;
my $im_thinking_of = int(rand 10);
my $guess;
do {
print "Pick a number:";
$guess = ;
chomp $guess;
if ($guess > $im_thinking_of)
A little fix: the line below must come before the "while()"
$im_thinking_of=int(rand 10);
> while(){
> print "Pick a number:";
> $guess=;
> chomp $guess;
> if ($guess>$im_thinking_of) {
> print "You guessed too high!\n";
> } elsif ($guess
} else {
print "You got it right!\n";
last;
}
}
<~~~ paste
- Original Message -
From: Mr.T Mr.X
To: Mark G
Sent: Sunday, June 15, 2003 2:40 AM
Subject: Re: I need to make this not end
all right, the only problem with the script you sent is t
got it right!\n";
last;
}
}
<~~~paste
- Original Message -
From: "Mr.T Mr.X" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 15, 2003 1:17 AM
Subject: I need to make this not end
> #!/user/bin/perl -w
>
> $im_thinking_of=int(rand
#!/user/bin/perl -w
$im_thinking_of=int(rand 10);
print "Pick a number:";
$guess=;
chomp $guess;
if ($guess>$im_thinking_of) {
print "You guessed too high!\n";
} elsif ($guess < $im_thinking_of) {
print "You guessed too low!\