subject

Description:
The purpose of this assignment is to practice with ArrayLists (and hopefully, you'll have some fun). As far as the user knows, play is exactly as it would be for a normal game of hangman, but behind the scenes, the computer cheats by delaying settling on a mystery word for as long as possible, which forces the user to use up several (perhaps all) chances.

Initialization:
The program reads a list of possible dictionary words, but instead of choosing one, it only decides on the length of a mystery word, which you might call randLength, a value chosen at random within some interval RAND_MIN and RAND_MAX, which are constants that you define in your program. Instead of choosing a word of randLength, the program removes all words from the list that are not of this length. That is, instead of choosing a word of length randLength, it keeps a list of all the words from the dictionary that are randLength letters long.

cheat phase:
During this phase of the game, the program delays choosing a real random word for as long as possible. As in a normal game of hangman, the user may during any given round make a guess which is a full word, or a single letter. If the user guesses a word, and that word appears in our list of possible words, it is removed. If the guess is a single letter, every word remaining in the list that contains the letter is removed. The purpose of the cheat is to force the player to eat through as many chances as possible, increasing the chances that the player loses.
Obviously, at some point this phase must end. Otherwise, the user will realize that the cheat has taken place. This phase is ended if either of two conditions is true:
The user has run out of guesses. In this case, the program prints a message telling the user that they've lost. It chooses some word at random from the remaining words in the list, and tells the user that this was the mystery word all along.
The computer can't cheat anymore. If the user makes a guess, and removing a word or words as we've specified previously would result in an empty list, the computer would get caught cheating. Your program must ensure that this never happens. Instead of removing the words from the list, the program should settle on a mystery word, by choosing it at random from the list of remaining words, and play continues as it would have during a normal game of hangman.

non-cheat phase:
Play continues just as it would have during a normal game of hangman, except of course, because of the cheats, the user has fewer chances remaining.

the dictionary:
Use "dic. txt" as a dictionary.

be stealthy:
Remember that the cheating is done behind the scenes. To the user, the program should look like a normal game of hangman.

ArrayList:
During each round of the cheat phase, you'll be manipulating a collection of words and you won't know in advance how much the size will change as the game progresses. At the beginning of the program, you'll have a large number of words, but you won't know how large. At each stage, it'll be reduced, but you won't know how much. While this is possible with an array, it's clear that ArrayList, which can grow and shrink as needed, is more appropriate.

dic. txt

account
acid
across
angry
animal
answer
ant
any
apparatus
apple
approval
arch
awake
baby
back
bad
bitter
black
blade
blood
blow
blue
chief
chin
church
circle
clean
clear
clock
condition
existence
expansion
fowl
frame
free
frequent
friend
from
front
fruit
full
future
garden
general
get
girl
give
glass
glove
go
goat
gold
good
hat
hate
have
he
head
healthy
hearing
heart
how
ice
idea
if
ill
important
impulse
in
interest
invention
iron
island
jell
journey
nation
needle
nerve

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:20
This problem has been solved! see the answeran evil king has a cellar containing n bottles of expensive wine, and his guards have just caught a spy trying to poison the king’s wine. fortunately, the guards caught the spy after he succeeded in poisoning only one bottle. unfortunately, they don’t know which one. to make matters worse, the poison the spy used was very deadly; just one drop diluted even a billion to one will still kill someone. even so, the poison works slowly; it takes a full month for the person to die. design a scheme that allows the evil king to determine exactly which one of his wine bottles was poisoned in just one month’s time while expending at most o(logn) of his taste testers.you are not allowed to use n testers, one for each bottle, and see which one tester dies after 30 days.(no pseudocode needed. just answer in words, how many testers you use, how you use them and why you correctly identify the poisoned bottle in 30 days)
Answers: 2
question
Computers and Technology, 23.06.2019 06:30
You are consulting for a beverage distributor who is interested in determining the benefits it could achieve from implementing new information systems. what will you advise as the first step?
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
Does read theory have answers keys ?
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
What does the faves button do? a. users mark a web page as a favorite b. leads other readers to favor a specific page c. readers sort and align their favicons, or favorite icons d. leads users to a message board where they can post questions
Answers: 1
You know the right answer?
Description:
The purpose of this assignment is to practice with ArrayLists (and hopefully, you...
Questions