Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create the word game GHOST in Java. Based in the following instructions. At the beginning of the program, read a file words.txt and save the

Create the word game GHOST in Java. Based in the following instructions.

At the beginning of the program, read a file words.txt and save the words into an array. There would be many words in the file. Do not read the file more than once in the program.

Ask for the number of players. Then, begin prompting players to enter a letter, one at a time. In the prompt, show the letters that have been entered so far. After the final player enters a letter, the first player goes again and so on until the game ends.

The game ends when either of two conditions occurs: 1) the letters entered form a word of at least four letters, or 2) the player enters a * to challenge the previous player. If the letters form a word of at least four letters, the last player to enter a letter loses. If a * is entered, check to see if any word begins with the sequence of letters entered so far. If so, the player who entered a * loses. Otherwise, the last player to enter a letter loses. When the game ends, output the loser and end the program.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions

Question

=+j Describe the various support services delivered by IHR.

Answered: 1 week ago