I just downloaded OpenSTV after seeing the most recent SO blog post, regarding the results of the moderator election. Jeff wrote that he used OpenSTV to conduct the election, and supplied a ballot file (.blt) along with it that contains the voting data.
My question is: how do you create a .BLT file in C#?
Here are two ways that I can think of that the voting page did it:
I'm interested in finding out how both possibilities work and how I can do that in C#. Thanks in advance. Oh, and I hope Jeff sees this question, because he'd probably have a great answer...
The best explanation of the BLT file format is here:
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). 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
All I did was
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With