the next step tho is to test each of them with each value in guesse with each value in rannum.
the problem is that no matter what I cannot get $correct to be more than 1 or 0; it almost seems to be acting like a bool.
sub TestCorrect #tests for the correct numbers in the correct order
{
my $correct = 0;
@guesse = split " ,_-/", $guesse;
print"@guesse\n";
if($guesse[0]==$rannum[0]){ $correct++}
if($guesse[1]==$rannum[1]){ $correct++}
if($guesse[2]==$rannum[2]){ $correct++}
if($guesse[3]==$rannum[3]){ $correct++}
print"$correct\n";
return $correct;
}
thanks for any help
This post has been edited by Jingle: 07 June 2012 - 02:38 AM

New Topic/Question
Reply


MultiQuote




|