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

CS50P problem_set4 guessing game #328

Closed
Kaazeeb opened this issue Feb 26, 2024 · 2 comments
Closed

CS50P problem_set4 guessing game #328

Kaazeeb opened this issue Feb 26, 2024 · 2 comments

Comments

@Kaazeeb
Copy link

Kaazeeb commented Feb 26, 2024

"""
Prompts the user for a level, n. If the user does not input a positive integer, the program should prompt again.
Randomly generates an integer between 1 and n, inclusive, using the random module.
Prompts the user to guess that integer. If the guess is not a positive integer, the program should prompt the user again.
"""

The instructions for both 'level' and 'guess' specify that if a positive integer is not entered, the program should prompt the user again. However, the program is expected to accept 0 for 'guess' but not for 'level.' I believe 0 should not be classified as a positive integer, so perhaps the instructions should be updated to reflect consistent behavior for both inputs.

curiouskiwi added a commit to cs50/problems that referenced this issue Feb 26, 2024
Fixed test for "below range" to have it check input of 1 vs level of 2.  (current test is for 0 which should be rejected due to not being positive)

Added test for "non positive" input.

to address: cs50/check50#328
@curiouskiwi
Copy link
Contributor

@Kaazeeb check50 is incorrectly expecting 0 to be valid. This will be fixed. Thanks.

@curiouskiwi
Copy link
Contributor

Fixed with above change. Thanks!

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

No branches or pull requests

2 participants