cs50 / problems

Checks for check50
145 stars 238 forks source link

CS50P: NUMB3RS allows leading zeroes #260

Open Makaze opened 4 months ago

Makaze commented 4 months ago

The error: When a student declares a test for a case with the correct number of digits but disallowing leading zeroes, e.g. by not allowing 025, check50 says the correct version fails the tests.

The student is arguably correct. Leading zeroes are generally not allowed in correct IP address notation.

If this were intentional by the course, I would expect it to be in the specification and for there to be a check50 test case to make sure the student's validator function allows it. However, there is no such test case by CS50. A submission that does not allow leading zeroes will pass check50 as well as one that does.

Due to these inconsistencies, it seems to be a missed edge case.

Suggested solution: Make the correct solution used by CS50 check for and disallow leading zeroes.