From aefe594fa5c594719db4e3a050d983577127c1ad Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Tue, 14 Aug 2018 18:23:43 +0200 Subject: moving-sum --- moving-sum | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 moving-sum (limited to 'moving-sum') 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 +} + -- cgit v1.2.3