Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions WordGuessGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,35 @@
*/
class WordGuessGame implements Game {



@Override
public String getName() {
return "Word Guess";
}

@Override
public Optional<Integer> play() {

/**
Game Logic Pseudocode:
int UserScore = 100; //initial score
String WordToGuess = WordGenerator(); Generates word to guess
while (MaxAttempts >= UserAttempts){
prompt user for guess
if guess is correct
return score
break
else
increment userattempts
score = score - 10; reduce 10 points each missed attempt


}



*/
Comment on lines +25 to +43
Copy link
Contributor

Choose a reason for hiding this comment

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

This contains potentially useful information, but isn't consistent with our coding conventions. Information like this probably best appears in the associated Issue, rather than in the code.

System.out.println(
"[Playing Word Guess - You will have a limited number of attempts"
+ " to guess a secret 5 letter word.]"
Expand All @@ -33,4 +55,15 @@ public Optional<Integer> play() {
);
return Optional.empty();
}

public String WordGenerator(){
//Word generation logic to be implemented
return "placeholder";
}

public boolean isValidGuess(String guess){
//Guess validation logic to be implemented
return true;
}
}