mirror of
https://github.com/irmen/prog8.git
synced 2025-02-02 19:32:21 +00:00
fix sieve example
This commit is contained in:
parent
054b4636e0
commit
a1ebc7090d
@ -119,7 +119,7 @@ This code calculates prime numbers using the Sieve of Eratosthenes algorithm::
|
||||
|
||||
%import textio
|
||||
%zeropage basicsafe
|
||||
|
||||
|
||||
main {
|
||||
bool[256] sieve
|
||||
ubyte candidate_prime = 2 ; is increased in the loop
|
||||
|
@ -120,7 +120,7 @@ This code calculates prime numbers using the Sieve of Eratosthenes algorithm::
|
||||
%zeropage basicsafe
|
||||
|
||||
main {
|
||||
ubyte[256] sieve
|
||||
bool[256] sieve
|
||||
ubyte candidate_prime = 2 ; is increased in the loop
|
||||
|
||||
sub start() {
|
||||
|
@ -4,12 +4,11 @@
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
|
||||
bool[256] sieve
|
||||
ubyte candidate_prime = 2 ; is increased in the loop
|
||||
|
||||
sub start() {
|
||||
sys.memset(sieve, 256, 0) ; clear the sieve, to reset starting situation on subsequent runs
|
||||
sys.memset(sieve, 256, 0) ; clear the sieve
|
||||
|
||||
; calculate primes
|
||||
txt.print("prime numbers up to 255:\n\n")
|
||||
@ -26,8 +25,6 @@ main {
|
||||
txt.print("number of primes (expected 54): ")
|
||||
txt.print_ub(amount)
|
||||
txt.nl()
|
||||
|
||||
; test_stack.test()
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user