Skip to content

A Simple 'Hangmanesque' word guessing game that picks a random word from a dictionary file and takes in single character inputs.

Notifications You must be signed in to change notification settings

fin10g/Java-Word-Guessing-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Java-Word-Guessing-Game

A Simple 'Hangmanesque' word guessing game that picks a random word from a dictionary file and takes in single character inputs.

Features

• A Java program which uses a Dictionary class and dictionary.txt file.

• The program randomly picks a word of minimum length 5 letters from the dictionary.txt.

• The user must guess the letters in the word and try to get the whole word in as few guesses as possible. (a politically incorrect person might call the game 'Hangman’)

• The program displays missing letters as ‘-’ characters and replaces them with the correct letters as they are guessed by using the StringBuilder class.

Sample output

I have picked a secret word. Try to guess its letters!


Guess> e

-e---e-

Guess> s

-e---es

Guess> r

-err-es

Guess> i

-erries

Guess> b

-erries

Guess> f

ferries

You got it in 6 guesses.

About

A Simple 'Hangmanesque' word guessing game that picks a random word from a dictionary file and takes in single character inputs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages