summaryrefslogtreecommitdiff
path: root/wk3/pset/runoff/runoff.c
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-02-19 20:47:15 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-02-19 20:47:15 +0000
commit6968450aec041b03188594c348436359368c64fb (patch)
tree1c75a7aa03f686d7a27933358a64666e785004c4 /wk3/pset/runoff/runoff.c
parentbf105e7f446d2808eb5bb3e854762f0f593efebe (diff)
Mon, Feb 19, 2024, 12:47 PM -08:00
Diffstat (limited to 'wk3/pset/runoff/runoff.c')
-rw-r--r--wk3/pset/runoff/runoff.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/wk3/pset/runoff/runoff.c b/wk3/pset/runoff/runoff.c
index 0fbb055..f6acc50 100644
--- a/wk3/pset/runoff/runoff.c
+++ b/wk3/pset/runoff/runoff.c
@@ -164,14 +164,25 @@ void tabulate(void)
// Print the winner of the election, if there is one
bool print_winner(void)
{
- // go through each candidate
- // if they have more than 50% of the votes they win
- // print winner
- // return true;
- // else
- // filter through all candidates
- // see who has the least votes and eliminate them
- // return false;
+ /*
+ go through each candidate
+ if they have more than 50% of the votes they win
+ print winner
+ return true;
+ else
+ filter through all candidates
+ see who has the least votes and eliminate them
+ return false;
+ */
+
+ /*
+ for (candidates) {
+ if (candidates.votes >= (voter_count / 2)) {
+ printf("%s", candidate.name);
+ return true;
+ } else if ()
+ }
+ */
return false;
}