fork download
  1. create arr 9 , 1 , -1 , -3 , 4 , 0 , 5 , -6 , -7 , 9 ,
  2.  
  3. : each: ( array ) r> swap
  4. dup @ cells swap cell+ dup >r + r>
  5. do i @ swap >r r@ execute r> cell +loop drop ;
  6.  
  7. : negatives ( array - count ) 0 swap each: 0< if 1+ then ;
  8. : zeroes ( array - count ) 0 swap each: 0= if 1+ then ;
  9. : positives ( array - count ) 0 swap each: 0 > if 1+ then ;
  10.  
  11. : main
  12. cr ." Negatives=" arr negatives .
  13. cr ." Zeroes=" arr zeroes .
  14. cr ." Posiives=" arr positives . ;
  15.  
  16. main
  17.  
Runtime error #stdin #stdout 0.02s 7504KB
stdin
Standard input is empty
stdout
Negatives=