summaryrefslogtreecommitdiff
path: root/wk3/pset/runoff
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-02-19 22:10:58 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-02-19 22:10:58 +0000
commite113afe2c85c0abd6d679e4c1b0cefec5e2530ed (patch)
tree00a91626cc992e4ccfc9d6f3246222fd1eefd103 /wk3/pset/runoff
parent3be40cd1ea9ba53f342b6462a14db8ad78143546 (diff)
Mon, Feb 19, 2024, 2:10 PM -08:00
Diffstat (limited to 'wk3/pset/runoff')
-rw-r--r--wk3/pset/runoff/runoff.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/wk3/pset/runoff/runoff.c b/wk3/pset/runoff/runoff.c
index 5434132..ac6a067 100644
--- a/wk3/pset/runoff/runoff.c
+++ b/wk3/pset/runoff/runoff.c
@@ -146,11 +146,11 @@ void tabulate(void)
//
for (int j = 0; j < candidate_count; j++)
{
- if (!candidates[preferences[i][j]].eliminated)
- {
- candidates[preferences[i][j]].votes++;
- break;
- }
+ if (!candidates[preferences[i][j]].eliminated)
+ {
+ candidates[preferences[i][j]].votes++;
+ break;
+ }
}
}
return;
@@ -208,7 +208,8 @@ bool is_tie(int min)
{
if (!candidates[i].eliminated)
{
- if (candidates[i].votes != min) {
+ if (candidates[i].votes != min)
+ {
return false;
}
}
@@ -223,7 +224,8 @@ void eliminate(int min)
{
if (!candidates[i].eliminated)
{
- if (candidates[i].votes == min) {
+ if (candidates[i].votes == min)
+ {
candidates[i].eliminated = true;
}
}