Anonymous user
Sieve of Eratosthenes: Difference between revisions
m
→2i wheel emulation of Sinclair ZX81 BASIC
Line 1,656:
</lang>
====2i wheel emulation of Sinclair ZX81 BASIC====
Backward-compatible also on Spectrums
10 INPUT Z
15 LET L=SQR(Z)
Line 1,673:
130 NEXT I
</lang>
====2i wheel emulation of Sinclair ZX80 BASIC====
. . . with 2:1 compression (of 16-bit integer variables on ZX80s) such that it obviates having to cross out higher multiples of 2; one has to input odd upper limits on factors to be squared, L (=21 at most on 1K ZX80s for all primes till 439).<lang qbasic>
|