Skip to content

[hangman] Sync tests & Update solution to match canonical rules#3109

Open
thibault2705 wants to merge 6 commits intoexercism:mainfrom
thibault2705:sync_hangman_tests
Open

[hangman] Sync tests & Update solution to match canonical rules#3109
thibault2705 wants to merge 6 commits intoexercism:mainfrom
thibault2705:sync_hangman_tests

Conversation

@thibault2705
Copy link
Copy Markdown
Contributor

pull request

What has been done:

  • Rename and simplify method play(Observable<String> words, Observable<String> letters) to guess(String word, Observable<String> letters)
  • Add, rename output params maskedWord, state, and remainingFailures to match canonical expectations
  • Introduced MAX_FAILURES = 10 based on canonical rules
  • Added error handling for guesses after win and lose states
  • Aligned test cases with canonical scenarios

This PR partially solves issues #2959.


Reviewer Resources:

Track Policies

@github-actions
Copy link
Copy Markdown
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!

Comment thread exercises/practice/hangman/src/main/java/Hangman.java Outdated
Comment thread exercises/practice/hangman/src/main/java/Output.java Outdated
Comment thread exercises/practice/hangman/src/main/java/Output.java Outdated
@thibault2705 thibault2705 changed the title [hangman] Sync tests & Update solution to match tests.toml [hangman] Sync tests & Update solution to match canonical rules Apr 28, 2026
@thibault2705 thibault2705 requested a review from kahgoh April 28, 2026 19:02
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.

2 participants