Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds extra check for Plurality #52

Open
wants to merge 3 commits into
base: 2020/fall
Choose a base branch
from
Open

Conversation

NaiculS
Copy link

@NaiculS NaiculS commented Nov 2, 2020

This extra check ensures that only the winner's name is printed, even if the losers tied, thus preventing some hack around logic, such as can be seen on my first check50 submission of the problem as an example.

This extra check makes sure that only the winner's name is printed out, even if the two losers tied 1-1.
See proposed changes to __init__.py.
@rongxin-liu rongxin-liu added the CS50x CS50x label Feb 6, 2024
@RemArcAble08
Copy link
Contributor

Unless I see the "hack-around" code and it changes my mind, I see minimal value in this PR.

Though for complete thoroughness, it is not a bad quick change to make. Still, a whole new case is unnecessary. Simply just change one of the loser's amount of votes in a print_winner function to match the other loser. For example, I would just change line 84 in testing.c to candidates[2].votes = 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CS50x CS50x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants