Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Averages in bowling

by MCS (Monk)
on Mar 21, 2006 at 13:13 UTC ( [id://538177]=note: print w/replies, xml ) Need Help??


in reply to Averages in bowling

Well first, when dealing with a point in an array, you need to use $, not @. ie:

until ($k==2) { $averages[$k]=int(($scores[$i][$j]+$scores[$i][$j+1]+$scores[$ +i][$j+2]+$scores[$i][$j+3])/3); $i++; $j++; $k++; }

The above runs fine for me, granted I have no data and no idea what $i, $j and $k mean (though I can guess). So if the above doesn't help, we'll need more information, namely the values for $i, $j, $k up to this point and the expected output.

*Edit: I thought I would take a second and look at what you had and fill in some default values and unless you have major parts of this loop excluded for whatever reason, what you are doing doesn't make sense. First, $i, $j and $k are all set to the same values. You probably want nested for loops or something and if you provide more information on how your arrays are setup, we can help you more.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://538177]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-25 17:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found