This commit is contained in:
Virgil Dupras 2020-05-25 13:22:26 -04:00
parent a776df27d2
commit cc59d37658
4 changed files with 11 additions and 16 deletions

View File

@ -11,3 +11,4 @@
: C!+ ( c a -- a+1 ) TUCK C! 1+ ; : C!+ ( c a -- a+1 ) TUCK C! 1+ ;
: C@- ( a -- a-1 c ) DUP C@ SWAP 1- SWAP ; : C@- ( a -- a-1 c ) DUP C@ SWAP 1- SWAP ;
: C!- ( c a -- a-1 ) TUCK C! 1- ; : C!- ( c a -- a-1 ) TUCK C! 1- ;
: LEAVE R> R> DROP I 1- >R >R ; : UNLOOP R> 2R> 2DROP >R ;

25
blk/357
View File

@ -1,16 +1,11 @@
: (parsed) ( a -- n f ) : _ ( a len -- n f )
DUP C@ ( a c ) OVER C@ ( a len c )
DUP '-' = IF '-' = IF
DROP 1+ ( a+1 ) (parsed) 0 ROT ( f 0 n ) 1- SWAP 1+ SWAP ( a+1 len-1 ) _ 0 ROT ( f 0 n )
- SWAP EXIT ( 0-n f ) - SWAP EXIT ( 0-n f )
THEN THEN ( a len )
0 SWAP _pdacc ( a r f ) 0 SWAP ( len ) 0 DO ( a r )
?DUP IF 2DROP 0 EXIT THEN OVER I + C@ ( a r c ) _pdacc ( a r f )
BEGIN ( a r ) IF DROP 0 UNLOOP EXIT THEN LOOP ( a r )
SWAP 1+ ( r a+1 ) NIP 1 ;
DUP C@ ( r a c ) : (parsed) ( a -- n f ) DUP 1- C@ ( a l ) _ ;
ROT SWAP ( a r c )
_pdacc ( a r f )
?DUP UNTIL
1 = ( a r f )
ROT DROP ( r f ) ;

View File

@ -7,4 +7,3 @@
: / /MOD NIP ; : / /MOD NIP ;
: MOD /MOD DROP ; : MOD /MOD DROP ;
: ALLOT HERE +! ; : ALLOT HERE +! ;
: LEAVE R> R> DROP I 1- >R >R ;

Binary file not shown.