It is still a work in progress.
Source code, executables, disk images and documentation at https://github.com/bobbimanners/EightBa ... /Eightball
Here is a sample program, to give you a flavour:
Code: Select all
' Sieve of Eratosthenes
' Globals
byte nr = 10
word n = nr * nr
byte A[n] = 1
pr.msg "Sieve of Eratosthenes ..."; pr.nl
call doall()
end
sub doall()
call sieve()
call printresults()
return 0
sub sieve()
word i = 0; word j = 0
for i = 2 : (nr - 1)
if A[i]
j = i * i
while (j < n)
A[j] = 0
j = j + i
endwhile
endif
endfor
return 0
sub printresults()
word i = 0
for i = 2 : (n - 1)
if A[i]
if i > 2
pr.msg ", "
endif
pr.dec i
endif
endfor
pr.msg "."
return 0