From 348dc88775fac78f5c1afa30c4f00d6d14dff592 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Sun, 12 Feb 2017 23:07:52 +1100 Subject: Election counting now works, logging improved from Haskell version, still need to fix exhausted paper collection --- src/bundles.adb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/bundles.adb') diff --git a/src/bundles.adb b/src/bundles.adb index 9701c40..50741ee 100644 --- a/src/bundles.adb +++ b/src/bundles.adb @@ -86,6 +86,18 @@ package body Bundles is + procedure Count_Both + (This : in Bundle; + Votes : out Natural; + Papers : out Natural) is + begin + Papers := Count_Papers (This); + Votes := Rationals.Floor (Papers * This.Worth); + end Count_Both; + + + + function "<" (Left, Right : in Bundle) return Boolean is -- cgit