created csv to blt converter

This commit is contained in:
2024-03-17 00:19:16 +01:00
parent add30f3515
commit a88045226b
6 changed files with 311 additions and 156 deletions

18
example/sample.blt Normal file
View File

@@ -0,0 +1,18 @@
4 2 # four candidates are competing for two seats
-2 # Bob has withdrawn (optional)
1 4 1 3 2 0 # first ballot
1 2 4 1 3 0
1 1 4 2 3 0 # The first number is the ballot weight (>= 1). Weigth is to deduplicate ballots.
1 1 2 4 3 0 # The last 0 is an end of ballot marker.
1 1 4 3 0 # Numbers in between correspond to the candidates
1 3 2 4 1 0 # on the ballot.
1 3 4 1 2 0
1 3 4 1 2 0 # Chuck, Diane, Amy, Bob
1 4 3 2 0
1 2 3 4 1 0 # last ballot
0 # end of ballots marker
"Amy" # candidate 1
"Bob" # candidate 2
"Chuck" # candidate 3
"Diane" # candidate 4
"Gardening Club Election" # title

10
example/sample.csv Normal file
View File

@@ -0,0 +1,10 @@
Diane,Amy,Chuck,Bob
Bob,Diane,Amy,Chuck
Amy,Diane,Bob,Chuck
Amy,Bob,Diane,Chuck
Amy,Diane,Chuck
Chuck,Bob,Diane,Amy
Chuck,Diane,Amy,Bob
Chuck,Diane,Amy,Bob
Diane,Chuck,Bob
Bob,Chuck,Diane,Amy
1 Diane,Amy,Chuck,Bob
2 Bob,Diane,Amy,Chuck
3 Amy,Diane,Bob,Chuck
4 Amy,Bob,Diane,Chuck
5 Amy,Diane,Chuck
6 Chuck,Bob,Diane,Amy
7 Chuck,Diane,Amy,Bob
8 Chuck,Diane,Amy,Bob
9 Diane,Chuck,Bob
10 Bob,Chuck,Diane,Amy