How can i make a list of cumulative sum of a other list?
i tried it that way:
;;all temperatrue-values around the turtle saved in list set tempera
As Jen suggested, you can use foreach. Another nice approach is reduce:
foreach
to-report partial-sums [#lst] set #lst (fput [0] #lst) ;;prepare for reduce report butfirst reduce [lput (?2 + last ?1) ?1] #lst end