diff options
Diffstat (limited to '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 +} + |