mirror of https://github.com/me50/kukemuna.git
automated commit by check50 [check50=True]
This commit is contained in:
parent
83872efa5b
commit
1aa9ac6167
10
runoff.c
10
runoff.c
|
|
@ -188,16 +188,20 @@ int find_min(void)
|
||||||
// Return true if the election is tied between all candidates, false otherwise
|
// Return true if the election is tied between all candidates, false otherwise
|
||||||
bool is_tie(int min)
|
bool is_tie(int min)
|
||||||
{
|
{
|
||||||
int match = 0;
|
bool tie = false;
|
||||||
|
|
||||||
for (int i = 0; i < candidate_count; i++)
|
for (int i = 0; i < candidate_count; i++)
|
||||||
{
|
{
|
||||||
if (candidates[i].votes == min && !candidates[i].eliminated)
|
if (candidates[i].votes == min && !candidates[i].eliminated)
|
||||||
{
|
{
|
||||||
match++;
|
tie = true;;
|
||||||
|
}
|
||||||
|
else if (candidates[i].votes != min && !candidates[i].eliminated)
|
||||||
|
{
|
||||||
|
tie = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (match > 1)
|
if (tie == true)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue