mirror of
https://github.com/irmen/prog8.git
synced 2025-08-11 17:26:01 +00:00
fix sieve example
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user