that makes sense. does the code look good as far as optimization and stuff as well so i can make optimization changes while i have it at this stage.
I see no major optimizations to be made to your code at this points. Looks pretty good in that department.
lafferjm wrote:
that makes sense. does the code look good as far as optimization and stuff as well so i can make optimization changes while i have it at this stage.

The code looks good overall, but I did notice some optimizations you can make.

Code:

:ClrHome
:ClrDraw
:AxesOff
:PlotsOff
:FnOff
:0→Xmin:1→ΔX
:-62→Ymin:1→ΔY
:Text(9,20,"SPREAD SHEET V1.0
:Text(18,42,"BY
:Text(27,30,"LAFFERJM
:Text(55,5,"C
:Circle(6,-58,4
:Text(55,12,"LAFFERJM
:Pause
:Repeat Ans=14
:ClrDraw
:DelVar [A]{8,7→dim([A]
:Text(0,20,"NEW
:Text(0,60,"QUIT
:Horizontal -6
:Line(0,-6,0,Ymin
:Line(Xmax,-6,Xmax,Ymin
:For(A,-6,Ymin,-7
:Horizontal A
:End
:For(A,13,78,13
:Line(A,-6,A,Ymin
:End

Assuming you just want to display the matrix value of [A](1,1 on each place on the screen, you can just use two nested For loops. For loops are a specialized form of a While loop, and they are faster than While/Repeat loops.

:For(D,2,88,13
:For(C,7,56,7
:Text(C,D,[A](1,1
:End
:End
:Repeat Ans
:getKey
:End
:End
:ClrDraw
:ClrHome
:ZStandard
:AxesOn
:DelVar [A]Disp "THANKS FOR
:Pause "USING.
:ClrHome:"
i tried with for loop it didnt go as fast as the repeat at least on my calc.
Are you sure? That definitely looks like it should go faster based on standard optimization rules for speed and size.
i am having some problems with the following code. i am using it so i can make a side scrolling type game but whenever b = 25 and a = 10 i get a dimension error. can someone tell me what could be causeing it because the string i use is 32 characters long.


Code:

:ClrHome
:"+-*/+-*/+-*/+-*/+-*/+-*/+-*/+-*/→Str1
:1→A
:16→B
:1→C
:Repeat K=45
:Output(7,C,"X
:Output(8,1,sub(Str1,A,B
:getKey→K
:If max(K=24,26
:Then
:Output(7,C,"
:C+(K=26)(C<16)-(K=24)(C>1→C
:B+(C=16)(K=26)(B<32)-(C=1)(K=24)(A>1→B
:B-15→A
:End
:End
:DelVar ADelVar BDelVar CDelVar KDelVar Str1ClrHome
Well, sub(Str1,10,25 on a 32 character string can be expected to throw an error. This situation is trying to return 25 characters from str1 starting at the tenth character, and there aren't enough characters. Remember, the syntax for sub( is

Code:

sub(string,start_position,number_characters)
oh well that makes sense. i thought it was


Code:

sub(start, end


thanks for the help
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 3 of 3
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement