Skip to content

Conversation

@hchagerman
Copy link

[USER STORY] Add input validation to WordGuessGame
#25
added the code to allow the user to input only a 5-letter word in word guess game
also added test cases to test more aspects of the problem to ensure proper working order
all test cases with this current issue have passed that don't need a loop (future issue)

JoshLapierre45 and others added 30 commits October 1, 2025 14:48
name

Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
add if Score == null

Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Update GameHistoryTracker.java
Signed-off-by: CamCranda11 <159499223+CamCranda11@users.noreply.github.com>
Signed-off-by: CamCranda11 <159499223+CamCranda11@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
@jody
Copy link
Contributor

jody commented Nov 1, 2025

Please review GitHub documentation for linking an Issue with a PR.
image

Copy link
Contributor

@jody jody left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does input validation to WordGuessGame involve changes to JottoGame.java?


public String GuessData(String guess){
int guessLength = guess.length();
if (guessLength != 5 || !guess.matches("[a-zA-Z0-9]{5}")){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are numerals included in input validation? The Acceptance Criteria for #25 indicates that only "alphabetic" inputs are accepted and more specifically: "reject inputs that contain numbers".

public String GuessData(String guess){
int guessLength = guess.length();
if (guessLength != 5 || !guess.matches("[a-zA-Z0-9]{5}")){
System.out.println("your guess needs to be 5 letters long");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the guess is length 5 but contains non-letters, this is a misleading error message.

Comment on lines +39 to +40
assertTrue(result.isPresent());
assertEquals(5, result.get());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this test whether input is valid or not?

@jody
Copy link
Contributor

jody commented Nov 1, 2025

Too many commits to review; not all appear to be relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

6 participants