diff options
author | Patrick Simianer <pks@pks.rocks> | 2018-08-14 18:23:43 +0200 |
---|---|---|
committer | Patrick Simianer <pks@pks.rocks> | 2018-08-14 18:23:43 +0200 |
commit | aefe594fa5c594719db4e3a050d983577127c1ad (patch) | |
tree | 8a22ea5046aa9817efa10863d5e28c9e40a4b41c | |
parent | 6d9f77693dc39c2cf3c33a5af419f9bfebda71ec (diff) |
moving-sum
-rwxr-xr-x | moving-sum | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/moving-sum b/moving-sum new file mode 100755 index 0000000..697f47f --- /dev/null +++ b/moving-sum @@ -0,0 +1,10 @@ +#!/usr/bin/env ruby + +require 'zipf' + +sum = 0.0 +ReadFile.readlines_strip(ARGV[0]).each { |i| + sum += i.to_f + puts sum +} + |