home *** CD-ROM | disk | FTP | other *** search
/ AMIGA PD 1 / AMIGA-PD-1.iso / Programme_zum_Heft / Programmieren / Kurztests / ACE / Prgs / BenchMarks / sieve.b < prev   
Text File  |  1994-01-16  |  609b  |  29 lines

  1. 1  REM $EVENT OFF
  2. 2  REM $OPTION a-o-x-n-
  3. 3  REM modified for ACE BASIC v1.02, 14.3.1993
  4. 4  REM modified for ACE BASIC v2.0, 16.1.1994
  5. 5  DEFINT a-z
  6. 10 PRINT "BYTE SIEVE, 7000 numbers done 5 times"
  7. 15 t!=timer
  8. 20 MAX=7000
  9. 30 DIM FLAGS(7000)
  10. 35 FOR j=1 TO 5
  11. 40 ACOUNT=0
  12. 50 FOR I=0 TO MAX
  13. 60 FLAGS(I)=1
  14. 70 NEXT I
  15. 80 FOR I=0 TO MAX
  16. 90 IF FLAGS(I)=0 THEN GOTO 170
  17. 100 PRIME=I+I+3
  18. 110 K=I+PRIME
  19. 120 IF K>MAX THEN GOTO 160
  20. 130 FLAGS(K)=0
  21. 140 K=K+PRIME
  22. 150 GOTO 120
  23. 160 ACOUNT=ACOUNT+1
  24. 170 NEXT I
  25. 175 NEXT J
  26. 176 t!=timer-t!
  27. 180 PRINT ACOUNT;"primes found"
  28. 190 PRINT "in";t!/5;"seconds for each of the 5 iterations."
  29.