i was making a math program for calculus, you basically input an equation for the derivative and the calc will spit out a slope plot (lots of lines aproximating a function with an unknown constant)
anyway the problem is that i set the calc to do 2 for loops so it will hit a bunch of points in a square. but for the inside loop's first iterations before it returns back to the outer loop, the loop starts at zero. then later once it goes in again after it hops out, it executes properly. Another odd thing is that the varialbe starts at the correct value up untill it hits an "expr(str1)" then seems to change to zero when it should start at Ymin (Ymin = -3). The only thing that changes the varialbe is the for loop so im confused as to how this could be happening. I've tried having the loop count up and down but no matter what it starts at zero.
Ex.
c1-->CODE |
ec1 For (X,Xmin,Xmax,LLen(1)*6 For (Y,Ymin,Ymax,LLen(2)*6 :here Y = -3 (Ymin = -3) expr(Str1) :here Y = 0...wtf? line(X+LLen(1),Y+LLen(2)Ans,X-LLen(1),Y-LLen(2)Ans End End c2 |
ec2
I am 100% sure that the comments are correct because tested it using a pause and then i broke and checked what Y was.
So who can tell me whats wrong, and it really is aas simple a code as this, im not leaving anything out between the for's and the ends