Hi, I made a simple program to graph slope fields on the graph screen of the calculator, and I'm getting this weird error where the program won't graph part of the field. I have no idea what the error could be, and I had the program working 100% on the same calculator before and I swear the code is unchanged (though that's probably not actually the case, obviously).
The code:
ClrHome
Input "dY/dX= ",Str1
Input "Xmin= ",A
Input "Xmax= ",B
Input "Ymin= ",C
Input "Ymax= ",D
C-.5→Ymin
D+.5→Ymax
(265/165)(D-C+1)→K
(A+B)/2+K/2→Xmax
(A+B)/2-K/2→Xmin
ClrHome
ClrDraw
inString(Str1,"/")→N
If Ans>0
sub(Str1,Ans+1,length(Str1)-Ans)→Str2
For(X,A,B)
For(Y,C,D)
If N>0 and expr(Str2)=0:Then
Line(X,Y-.25,X,Y+.25)
Else
tan^-1(expr(Str1))→M
Line(X-.25cos(M),Y-.25sin(M),X+.25cos(M),Y+.25sin(M),RED)
End
End
End

So as you can see, some of the bottom left lines are simply missing. Interestingly enough, the program will actually refuse to graph anything until Y = 0 from what I have found (except for the first one? idk). I changed the order of the for loops to run left->right and top->bottom, as opposed to the current bottom->top and left->right, and it resulted in the entire top half of the graph being cut off, again not working until Y=0. I have since changed it back.
Honestly, I have looked at this program for about a week and I still haven't figured out what's wrong. If anyone could help me out that would be amazing! Also I realize that this probably isn't very optimized, so if anyone would like to point out ways to make it more efficient that would be cool too! THANKS!