This post has been edited by Untalented: 04 August 2012 - 02:35 AM
Sequence Problem
Page 1 of 15 Replies - 223 Views - Last Post: 04 August 2012 - 02:43 AM
Replies To: Sequence Problem
#2
Re: Sequence Problem
Posted 04 August 2012 - 02:30 AM
1+1=2
2+2=4
3+4=7
4+7=11
5+11=16
Perhaps pass two parameters to sum, where one parameter increments (as you do now), and the other is the sum so far (those now colour coded above).
2+2=4
3+4=7
4+7=11
5+11=16
Perhaps pass two parameters to sum, where one parameter increments (as you do now), and the other is the sum so far (those now colour coded above).
#3
Re: Sequence Problem
Posted 04 August 2012 - 02:34 AM
On line 19, you have y = z + z; which is equivalent to y = x + x; Why not make sum() take two parameters: x and lastY, and change that line to something like y = x + lastY; ?
#5
Re: Sequence Problem
Posted 04 August 2012 - 02:38 AM
Do NOT delete your original post! That's just rude.
#6
Re: Sequence Problem
Posted 04 August 2012 - 02:43 AM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote






|