'$DEBUG
_TITLE "The Patterns in Primes"
Limit = WDTH * HGHT
Flags(0) = 1
Flags(1) = 1
Flags(2) = 0
Flags(3) = 0
Flags(K) = 1
' Display the primes
'Spiral________________________________________________________________________
'N = 2
'E = UBOUND(Flags)
'Radius! = 0
'HalfWdth = WDTH / 2
'HalfHght = HGHT / 2
'FOR i# = 0 TO Limit STEP .007
' IF Flags(N) = 0 THEN
' PSET (HalfWdth + Radius# * COS(i#), HalfHght - Radius# * SIN(i#)), _RGB(0, 160, 0)
' ELSE
' PSET (HalfWdth + Radius# * COS(i#), HalfHght - Radius# * SIN(i#)), _RGB(0, 0, 0)
' END IF
' IF N = E THEN EXIT FOR
' N = N + 1
' 'PSET (HalfWdth + Radius# * COS(i#), HalfHght - Radius# * SIN(i#))
' Radius# = Radius# + .0007
'NEXT i#
'L to R, T to B________________________________________________________________
N = 0
N = N + 1