Task

Compute the sum and product of an array of integers.




4 cells is-array foo
 
212 1 foo array.put
51 2 foo array.put
12 3 foo array.put
91 4 foo array.put
 
[ ( array size -- sum )
  >r 0 r> 0 [ over i swap array.get + ] countedLoop nip ] is sum-array
 
 ( product )
reset 1 4 0 [ i foo array.get * ] countedLoop .