cs50 / problems

Checks for check50
134 stars 227 forks source link

Instructions for plurality problem don't specify format for printing multiple winners #251

Closed chriscarrollsmith closed 2 months ago

chriscarrollsmith commented 2 months ago

I noticed that in the instructions for the plurality problem, nothing specifies whether to print multiple winners separated by newlines rather than spaces. However, check50 returns a failure if you print them with spaces. Probably either the instructions should be clarified, or the check50 test expectation should be relaxed a bit.

Edited to correct name of the problem I was referencing.

curiouskiwi commented 2 months ago

As the specification explains:

The function should print out the name of the candidate who is the source of the graph. You may assume there will not be more than one source.

As such, printing multiple winners should cause the check to fail, whether they are separated by spaces or newlines.

chriscarrollsmith commented 2 months ago

Oh, my mistake. I meant plurality, not Tideman. Sorry!

curiouskiwi commented 2 months ago

Oh, okay. :) But you may have missed this instruction in the Plurality specification, which tells you that you must print each on a separate line. This is also demonstrated in the Demo.

The election could end in a tie if multiple candidates each have the maximum number of votes. In that case, you should output the names of each of the winning candidates, each on a separate line.

chriscarrollsmith commented 2 months ago

Oh, okay. :) But you may have missed this instruction in the Plurality specification, which tells you that you must print each on a separate line. This is also demonstrated in the Demo.

The election could end in a tie if multiple candidates each have the maximum number of votes. In that case, you should output the names of each of the winning candidates, each on a separate line.

Thanks; I did miss that.