summaryrefslogtreecommitdiff
path: root/src/bundles.adb
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-02-12 23:07:52 +1100
committerJed Barber <jjbarber@y7mail.com>2017-02-12 23:07:52 +1100
commit348dc88775fac78f5c1afa30c4f00d6d14dff592 (patch)
treeb96db643d0642edf54242da5c672f3096bb98e22 /src/bundles.adb
parent60b2207a469a5a1e7a7e5619a8eb1b01c67f314a (diff)
Election counting now works, logging improved from Haskell version, still need to fix exhausted paper collection
Diffstat (limited to 'src/bundles.adb')
-rw-r--r--src/bundles.adb12
1 files changed, 12 insertions, 0 deletions
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