Jump to content

tecci06's Photo

tecci06

Member Since 21 Aug 2010
OFFLINE Last Active Yesterday, 1:39 AM

#3903547 BASIC Interpreter Speed Comparison: Prime Number Generation

Posted by tecci06 on Sun Dec 3, 2017 3:51 PM

used your code from post #94 on my Commodore 64 (BASIC 2.0)

Limit 250: 3,133

Limit 10000: 136,5




#3903265 BASIC Interpreter Speed Comparison: Prime Number Generation

Posted by tecci06 on Sun Dec 3, 2017 6:26 AM

Results on a Apple IIc

10 HOME : CLEAR
20 K = 0:I = 0:T = 0:P = 0

100 PRINT "Prime Number Generator"
110 INPUT "Upper Limit";N
130 T = INT ((N-3) / 2)
140 DIM A(T + 1)

150 FOR I = 0 TO T:A(I) = 0: NEXT
200 FOR I = 0 TO T: IF A(I) = 1 THEN PRINT "..";: NEXT: GOTO 340
210 P = I + I + 3: PRINT P;".";: K = I + P: IF K <  = T THEN FOR K = K TO T STEP P:A(K) = 1: NEXT
260 NEXT

340  PRINT : PRINT "Done"
350  END

With hand timing:

 

Limit 250: ~3 seconds

Limit 10000: 125 seconds




#3724720 The UAV Rev. D Video Upgrade Thread

Posted by tecci06 on Wed Mar 22, 2017 5:15 PM

If I put the "plug in" unit in a socket, then it is to high for the original shielding. I will remove the socket and will solder the "plug in" unit directly on the board. I let you know with pictures.