Re: Original Progress Thread
Posted: Wed 12 Nov, 2008 1:56 am
Here's an interesting speed comparison between BBC BASIC and the native TI-OS programming language. The test is the Sierpinski Triangle program in the guidebook (17-7):-
Translated into BBC BASIC, it looks like this:-
On a regular TI-83+ (6MHz) the TI-OS program takes 7 minutes and 8 seconds to complete. The BBC BASIC program takes 2 minutes and 21 seconds. That's quite a speed difference!
Here it is running on an emulated 83+SE at 15MHz.
Code: Select all
:FnOff :ClrDraw
:PlotsOff
:AxesOff
:0→Xmin:1→Xmax
:0→Ymin:1→Ymax
:rand→X:rand→Y
:For(K,1,3000)
:rand→N
:If N≤1/3
:Then
:.5X→X
:.5Y→Y
:End
:If 1/3<N and N≤2/3
:Then
:.5(.5+X)→X
:.5(1+Y)→Y
:End
:If 2/3<N
:Then
:.5(1+X)→X
:.5Y→Y
:End
:Pt-On(X,Y)
:End
Code: Select all
10 REM Sierpinski Triangle by Texas Instruments.
20 REM Taken from the TI-83 Plus Guidebook.
30 CLG
40 X=RND(1):Y=RND(1)
50 FOR K=1 TO 3000
60 N=RND(1)
70 IF N<=1/3 THEN X=.5*X : Y=.5*Y
80 IF 1/3<N AND N<=2/3 THEN X=.5*(.5+X) : Y=.5*(1+Y)
90 IF 2/3<N THEN X=.5*(1+X) : Y=.5*Y
100 PLOT 69,X*96,64-Y*64
110 NEXT K
Here it is running on an emulated 83+SE at 15MHz.