state-of-tic-tac-toe: sync tests and fix example.jl win/turn parity bug#1125
Merged
colinleach merged 2 commits intoJul 18, 2026
Merged
Conversation
Applies the same fix to the active implementation and to the three alternative implementations left as comments, all of which had the same gap: win detection was validated independently of turn-count parity, so a board where the wrong player had an extra move after a win was incorrectly accepted.
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. For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping |
colinleach
approved these changes
Jul 18, 2026
Contributor
|
There are only 21 completions on this relatively recent exercise, so I'll let them re-test. |
Contributor
|
Thank you for fixing this! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
state-of-tic-tac-toe: Sync tests for playing after a win (exercism/problem-specifications#2667)
Sync
tests.tomlandruntests.jlwith the two new canonical test cases that verify an error is thrown when a player makes a move after the game has already been won:Fix example.jl: enforce win/turn-count parity
The reference solution failed both new test cases — it validated turn order and rejected simultaneous double wins, but never checked that a win matched the expected move count, so a board where the wrong player had an extra move after a win was incorrectly accepted. Added the missing parity check (
X winning requires sum(M) == 1,O winning requires sum(M) == 0). The three alternative implementations kept as comments shared the same gap and were fixed too.