in reply to Why does my get_max_index function return zero? (High Water Mark Algorithm)

You're codeblind. Have a beer, a snack and then look again. If you still don't see it:
$imax=$i if ($_[$i] > $imax);
Edit: Nevermind. I was too quick and misread the question.


holli

You can lead your users to water, but alas, you cannot drown them.
  • Comment on Re: Why does my get_max_index function return zero? (High Water Mark Algorithm)
  • Download Code

Replies are listed 'Best First'.
Re^2: Why does my get_max_index function return zero? (High Water Mark Algorithm)
by haukex (Archbishop) on Jun 03, 2019 at 17:11 UTC
    $imax=$i if ($_[$i] > $imax);

    No, sorry, that doesn't make sense.

    Update: Oh, I see you noticed it too, sorry :-)

      Indeed it doesn't. But taking breaks and having beers is still a good advice =)


      holli

      You can lead your users to water, but alas, you cannot drown them.
Re^2: Why does my get_max_index function return zero? (High Water Mark Algorithm)
by hghosh (Acolyte) on Jun 03, 2019 at 17:51 UTC
    Hello, I've followed the other respondent's advice, and I'm still getting the same error. Could you look at my updated code?
      The inner my $imask is masking the outer one.


      holli

      You can lead your users to water, but alas, you cannot drown them.