move waforth2c to src/

This commit is contained in:
Remko Tronçon 2022-04-17 17:07:52 +02:00
parent 31bf2734b8
commit ef0a360366
11 changed files with 1 additions and 22 deletions

View file

@ -1,21 +0,0 @@
: prime? HERE + C@ 0= ;
: composite! HERE + 1 SWAP C! ;
: sieve
HERE OVER ERASE
2
BEGIN
2DUP DUP * >
WHILE
DUP prime? IF
2DUP DUP * DO
I composite!
DUP +LOOP
THEN
1+
REPEAT
DROP
1 SWAP 2 DO I prime? IF DROP I THEN LOOP .
;
: main 10000 sieve ;

View file

@ -17,7 +17,7 @@ all: main
.PHONY: example
example:
./waforth2c.js examples/sieve.f
./waforth2c.js ../examples/sieve.f
$(MAKE)
./main