average = a ->
  weight, divider, total = 0 ..

  do {1..a._} i ->
    weight += 1
    total += a.i * weight; divider += weight
  ;

  if divider -> total / divider
  else 0
_
  a : array : I|F : +-
;