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

queen-attack test that prevents incorrectly accepted answers due to unsigned type. #1012

Closed
wants to merge 1 commit into from

Conversation

edu-bm7
Copy link

@edu-bm7 edu-bm7 commented Sep 10, 2024

Issue: 1011

A lot of user solutions that I've seen use some type of abs(queen_1.row - queen_2.row) == abs(queen_1.column - queen_2.column);. This test make sure that students are taking into account underflow that happens because of the Unsigned int type.

Tests if Queens can attack each other even when they crossed sides of the board, which is a common position on chest. Also it ensure that the students start to take into account overflows/underflows that happens often in C/C++

…igned types and its overflow. E.g. abs(queen_1.row - queen_2.row) == abs(queen_1.column - queen_2.column)

Tests if Queens can attack each other even when they crossed sides of the board, which is a common position on chest.
Also it ensure that the students start to take into account overflows that happens often in C/C++
Copy link
Contributor

This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested.

If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

@edu-bm7
Copy link
Author

edu-bm7 commented Sep 10, 2024

or, for example, adds an edge case that is not worth rerunning all tests for

I do believe that it is a case where re-testing should be consider since the test enforces good practice when coding in C/C++ also makes them search why their solution is wrong.

@edu-bm7 edu-bm7 changed the title This test invalidate wrongly correct answers that didn't consider Unsigned type queen-attack test that prevents incorrectly accepted answers due to unsigned type. Sep 10, 2024
@edu-bm7 edu-bm7 closed this Sep 10, 2024
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

Successfully merging this pull request may close these issues.

1 participant