From 054b4636e0aa1411f0427e2756a19994e056a434 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Thu, 18 Apr 2024 21:50:48 +0200 Subject: [PATCH] version 10.3 --- README.md | 8 ++------ docs/source/index.rst | 6 ++---- gradle.properties | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 6833131ef..1394f2d88 100644 --- a/README.md +++ b/README.md @@ -121,12 +121,11 @@ 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() { - sys.memset(sieve, 256, false) ; clear the sieve + sys.memset(sieve, 256, 0) ; clear the sieve txt.print("prime numbers up to 255:\n\n") ubyte amount=0 repeat { @@ -162,9 +161,6 @@ This code calculates prime numbers using the Sieve of Eratosthenes algorithm:: } } - - - when compiled an ran on a C-64 you'll get: ![c64 screen](docs/source/_static/primes_example.png) diff --git a/docs/source/index.rst b/docs/source/index.rst index 83ce68e6c..26435e5ef 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -124,9 +124,7 @@ This code calculates prime numbers using the Sieve of Eratosthenes algorithm:: ubyte candidate_prime = 2 ; is increased in the loop sub start() { - ; clear the sieve, to reset starting situation on subsequent runs - sys.memset(sieve, 256, false) - ; calculate primes + sys.memset(sieve, 256, 0) ; clear the sieve txt.print("prime numbers up to 255:\n\n") ubyte amount=0 repeat { @@ -147,7 +145,7 @@ This code calculates prime numbers using the Sieve of Eratosthenes algorithm:: while sieve[candidate_prime] { candidate_prime++ if candidate_prime==0 - return 0 ; we wrapped; no more primes available in the sieve + return 0 ; we wrapped; no more primes } ; found next one, mark the multiples and return it. diff --git a/gradle.properties b/gradle.properties index 11bdc8a45..86638f9f3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,4 +5,4 @@ org.gradle.daemon=true kotlin.code.style=official javaVersion=11 kotlinVersion=1.9.22 -version=10.3-SNAPSHOT +version=10.3