eastern-flames/eastern flames/scripts/array_sum/array_sum.gml

8 lines
136 B
Plaintext

function array_sum(array) {
var i;
var result = 0;
for (i=0; i<array_length(array); i++) {
result += array[i];
}
return result;
}