mirror of
https://github.com/remko/waforth
synced 2025-01-19 22:26:17 +01:00
move waforth2c to src/
This commit is contained in:
parent
31bf2734b8
commit
ef0a360366
11 changed files with 1 additions and 22 deletions
|
@ -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 ;
|
|
@ -17,7 +17,7 @@ all: main
|
|||
|
||||
.PHONY: example
|
||||
example:
|
||||
./waforth2c.js examples/sieve.f
|
||||
./waforth2c.js ../examples/sieve.f
|
||||
$(MAKE)
|
||||
./main
|
||||
|
Loading…
Reference in a new issue