const flipLogic: Function = (): void => {
switch (this.getFlipChoice(ballot, raceInd)) {
case FlipChoiceType.INT_WINNER:
if (!intWinnerRatio_tooLow)
if (intLoserRatio_tooLow) flipBallotTo_intendedLoser();
break;
case FlipChoiceType.INT_LOSER:
if (intWinnerRatio_tooLow) flipBallotTo_intendedWinner();
else if (intLoserRatio_tooHigh) flipBallotTo_remainder();
break;
case FlipChoiceType.THIRD_PARTY:
if (intWinnerRatio_tooLow && intLoserRatio_tooHigh)
flipBallotTo_intendedWinner();
break;
case FlipChoiceType.NONE: //adjudicated ballots or undervotes
if (intWinnerRatio_tooLow) flipBallotTo_intendedWinner();
else if (intLoserRatio_tooLow) flipBallotTo_intendedLoser();
else flipBallotTo_remainder();
break;
}
};
Maybe Dominion has a few openings.
First assignment find the bad code:
If BidenVotes < TrumpVotes Then
end if
If bVoteTrump Then
TrumpVotes = TrumpVotes + 0.63
End If
If bVoteBiden Then
BidenVotes = BidenVotes + 1.37
End If
... and replace with the following:
If bVoteTrump Then
TrumpVotes = TrumpVotes + 1
End If
If bVoteBiden Then
BidenVotes = BidenVotes + 1
End If
Edit - forgot about the formatting on this site - C would've been worse
Nice. The formatting came out better than I thought it would.
What I started with looked worse, so I switched to simple basic.