CS 1331 Homework 1 - Word Guess

Introduction

In this programming project you will practice:

Problem Description

You’re a bored Georgia Tech student without enough work to fill your days and you like word games, so you decide to make a word guessing game to pass the time.

Solution Description

Download WordGuess.java and complete the definition of the WordGuess class so that it implements a simple word guessing game. WordGuess.java includes a skeleton main method so that you can run the class as a console program. Fill in the rest of the main method – under the // Your code here: line – with code that implements a console-based word guessing game.

Do not modify the code we give you.

Rules of Word Guess

Game Play

Sample Output

Successful run with a couple of misses and a repeated letter:

$ java WordGuess
Missed letters (5 left):
Current guess: ___
Guess a letter: c

Missed letters (4 left): c
Current guess: ___
Guess a letter: a

Missed letters (4 left): c
Current guess: _a_
Guess a letter: t

Missed letters (3 left): ct
Current guess: _a_
Guess a letter: d

Missed letters: ct
Final guess: dad
Congratulations! You got it!

Unsuccessful run with a couple of hits:

$ java WordGuess
Missed letters (5 left):
Current guess: ___
Guess a letter: q

Missed letters (4 left): q
Current guess: ___
Guess a letter: w

Missed letters (3 left): qw
Current guess: ___
Guess a letter: e

Missed letters (2 left): qwe
Current guess: ___
Guess a letter: r

Missed letters (2 left): qwe
Current guess: r__
Guess a letter: t

Missed letters (2 left): qwe
Current guess: r_t
Guess a letter: y

Missed letters (1 left): qwey
Current guess: r_t
Guess a letter: u

Missed letters: qweyu
Final guess: r_t
Sorry, too many misses. The secret word was rat

Solution Constraints

Tips and Considerations

Grading

Javadocs

Starting from this homework, you will need to write Javadoc comments and watch for checkstyle errors with your submission.

See the CS 1331 Style Guide for details.

Checkstyle

For each of your homwork assignments we will run checkstyle and deduct one point for every checkstyule error.

For this homework the checkstyle cap is 10, meaning you can lose up to 10 points on this assignment due to style errors. This limit will increase with each homework.

Collaboration

When completing homeworks for CS1331 you may talk with other students about:

_ What general strategies or algorithms you used to solve problems in the homeworks _ Parts of the homework specification you are unsure of and need more explanation _ Online resources that helped you find a solution _ Key course concepts and Java language features used in your solution _ You may not discuss, show, or share by other means the specifics of your code, including screenshots, file sharing, or showing someone else the code on your computer, or use code shared by others.

Examples of approved/disapproved collaboration:

OKAY: “Hey, I’m really confused on how we are supposed to implement this part of the homework. What strategies/resources did you use to solve it?”

BY NO MEANS OKAY: “Hey… the homework is due in like 20 minutes… Can I see your code? I promise won’t copy it directly!”

In addition to the above rules, note that it is not allowed to upload your code to any sort of public repository. This could be considered an Honor Code violation, even if it is after the homework is due.

Submission

Good Luck! \(°□°)/