Sv: TI-M: Faster Basic


[Prev][Next][Index][Thread]

Sv: TI-M: Faster Basic




I optimized the lines without a ">". It should work but im at my school without my calc.


> ClrHome
{1,1,2,3,4,5,6,7,8,8->List1
{1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,16->List2
{-1,0,1,0,0,0,0,0,0,0,0->List3
{0,-1,0,0,0,0,0,0,0,0,1->List4
> 1->R
> 1->C
> Lbl A
Output(R,C," 
> getKey->K
If not(int((ans-24)/11
> Then
C+List3(K-23->C
R+List4(K-23->R
> End
List1(R+1->R
List2(C+1->C
Output(R,C,"X
> Goto A


Andreas Hjordt


----- Original Message ----- 
From: tfobrien <tfobrien@mindspring.com>
To: <ti-math@lists.ticalc.org>
Sent: Thursday, May 25, 2000 6:10 AM
Subject: Re: TI-M: Faster Basic


> 
> I came up with a way to do it rmuch faster.  The old program had 8
> conditionals(=,>,<,ect...) and conditions take some of the longest time to
> process.  This program has 1 conditional when it used to take 8.  It could
> be made with 0 conditionals but that would require much memory.  Some
> people said it couldn't get much faster but I knew there had a to be a way.
> 
> 
> ClrHome
> {1,1,2,3,4,5,6,7,8,8}->List1
> {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,16}->List2
> {-1,0,1,0,0,0,0,0,0,0,0}->List3
> {0,-1,0,0,0,0,0,0,0,0,1}->List4
> 1->R
> 1->C
> Lbl A
> Output(R,C," ")
> getKey->K
> If int((K-24)/11)=0
> Then
> C+List3(K-23)->C
> R+List4(K-23)->R
> End
> List1(R+1)->R
> List2(C+1)->C
> Output(R,C,"X")
> Goto A
> 
> 
> 
> Old program....
> 
> ClrHome
> 1->R
> 1->C
> Lbl A
> Output(R,C," ")
> getKey->K
> If K=24
> C-1->C
> If K=26
> C+1->C
> If K=25
> R-1->R
> If K=34
> R+1->R
> If R=0
> 1->R
> If R=9
> 8->R
> If C=0
> 1->C
> If C=17
> 16->C
> Output(R,C,"X")
> Goto A
> 
> 
> 





References: