Primes by Trial Division - Applesoft BASIC

13 August 2016

This is the reference implementation of the n Primes by Trial Division benchmark. There is no special reason for it to be the reference implementation, apart from it being the version I wrote first.

 1  GOTO 10
 5 COUNT = COUNT + 1
 6  GOTO 50
 10  DIM PRIMES(99)
 20 PRIMES(0) = 2
 25  PRINT PRIMES(0)
 30 COUNT = 3
 40  FOR FOUND = 1 TO 99
 50  FOR INDEX = 0 TO (FOUND - 1)
 60 V = COUNT / PRIMES(INDEX)
 65  IF ( V =  INT (V)) THEN  GOTO 5
 70  NEXT INDEX
 80  PRINT COUNT
 90 PRIMES(FOUND) = COUNT
 100 COUNT = COUNT + 1
 110  NEXT FOUND
 120  END

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026

Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Primes Benchmark Source

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

Primes Benchmark Results

Other BASICs

Applesoft BASIC

Atari 2600 BASIC

BBC BASIC

Commodore BASIC

DRI Personal BASIC

HP BASIC/V

IBM 5100 BASIC

IBM PC BASIC

PICK/BASIC

Rocky Mountain BASIC

Sinclair ZX80 BASIC

Spectravideo Compumate

TI 99/4 BASIC

TRS-80 Level 1 BASIC

V-Tech Laser 50

VAX BASIC

Structured BASIC

Amiga BASIC

Dartmouth True BASIC

Microsoft QuickBASIC

Microware Basic09

Topaz S-BASIC