cs50 / problems

Checks for check50
134 stars 227 forks source link

PSET4 Guessing Game check "rejects guess below specified range with "Too Small" #234

Closed jmvcode closed 6 months ago

jmvcode commented 6 months ago

the problem requires to Randomly generates an integer between 1 and n, inclusive, using the random module.

for this check "rejects guess below specified range with "Too Small", check50 is sending 2 as the level, and sending a guess of 1 and is expecting "Too Small"

However, 1 would still be in the specified range and this causes a 50-50 chance of failing then check as the randomly generated integer can be 1 or 2 pset4sc

curiouskiwi commented 6 months ago

check50 hardcodes the "expected answer" to 4 so 1 <4 is always true, but I do see there's a logical issue with the test given that it sets the level to 2 and the answer to 4 (which couldn't happen). But that shouldn't impact whether or not your code fails the test, as 1 will always be smaller than 4. We'll rethink the test. Thanks.

rongxin-liu commented 6 months ago

https://github.com/cs50/problems/commit/3328778ca64749e9b74f5abbca8192d6c0489baf