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

Re: adding items, but with interim results

by LanX (Canon)
on Mar 30, 2013 at 17:20 UTC ( #1026293=note: print w/ replies, xml ) Need Help??


in reply to adding items, but with interim results

please clarify your question!

> I would like to calculate the sums of all the items, but with interim results.

contradicts

> @newarray = qw ( 0 1 4 6 ); #0+1, 1+3, 3+2

where you are calculating only the sum of neighboring pairs, not all items (see 3+2)!

two different tasks, you got quite good answers for both.

Cheers Rolf

( addicted to the Perl Programming Language)


Comment on Re: adding items, but with interim results
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2015-07-07 09:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls