Objectives: * Practice random numbers * NO ARRAYS! * Use JAVA for the programmin
ID: 3598885 • Letter: O
Question
Objectives:
* Practice random numbers
* NO ARRAYS!
* Use JAVA for the programming laguage
Assignment:
In this assignment, you are going to create a simplified version of the board game Clue using java. You are the only active
player. Your goal is to solve the murder by correctly guessing the suspect, the weapon, and the room involved
in the crime, which are listed below. You only have 3 tries to solve the murder. YOU can be the murderer.
Suspect
1. Miss Scarlett
2. Professor Plum
3. Mrs. Peacock
4. Mr. Green
5. Colonel Mustard
6. Mrs. White
Weapon
1. Candlestick
2. Knife
3. Lead Pipe
4. Revolver
5. Rope
6. Wrench
Room
1. Kitchen
2. Ballroom
3. Conservatory
4. Dining Room
5. Billiard Room
6. Library
7. Lounge
8. Hall
9. Study
You will have 3 classes: a Character class, a GameOptions class, and a Clue class.
Character Class:
This class represent the characters in the game. This includes you and the other two randomly created
characters.
You will 6 instance variables, all Strings:
* Character name
* Suspect card – randomly dealt at start of game
* Weapon card – randomly dealt at start of game
* Room card – randomly dealt at start of game
* the current room the character is in
* the checklist the states what you know is and isn’t part of the crime
Argument and no-argument constructors.
Getters and setters for each instance variable.
A method that allows you to view the checklist. It has no parameters and returns the checklist.
A toString method that returns the cards the character was dealt.
GameOptions Class:
This class will be used to decide what the suspect, weapon, or room should be based on integers from the Clue
class. It will also handle displaying and getting the user’s option for the room they want to move to when the
roll the die from inside a room.
This class will have NO instance variables, and all of its methods will be STATIC.
Method that determines a suspect:
* 1 parameter – an integer
* Returns the suspect’s name
This method gets a number from the Clue class and determines the suspect based on that number. As shown in
the table above, 1 is for Miss Scarlett, 2 is for Professor Plum, etc. This is going to help when we randomly
assign the suspect cards for the characters and the actual crime.
Method that determines a weapon:
*1 parameter – an integer
* Returns the weapon
This method gets a number from the Clue class and determines the weapon based on that number. As shown in
the table above, 1 is for Candlestick, 2 is for Knife, etc. This is going to help when we randomly assign the
weapon cards for the characters and the actual crime.
Method that determines a room:
* 1 parameter – an integer
* Returns the room
This method gets a number from the Clue class and determines the room based on that number. As shown in the
table above, 1 is for Kitchen, 2 is for Ballroom, etc. This is going to help when we randomly assign the room
cards for the characters and the actual crime.
All 3 of these method can be used any time you need to know the card based on a number.
Method that displays and determines the move options from room to room:
* 1 parameter – the current room you are in
* Returns the name of the room the user is going to move to next
This method handles determining the room the user is going to move to when they roll the die. This method will
display the rooms you are able to move to (they must be adjacent) and then ask you to enter the room you want
to move to next. It will return the name of the room that you chose to move to.
Clue Class:
This class contains the actual game play for Clue and will use the Character and GameOptions classes.
Before the game starts, 3 cards are randomly selected to represent the crime: one with a suspect, one with a
weapon, and one with a room. No other characters can have these cards. To solve the crime, you have to
correctly guess these 3 cards.
To begin the game, you pick your character from the list of suspects. Then, you are randomly dealt 3 cards: one
with a suspect, one with a weapon, and one with a room. Then, two other characters are created. The characters
are randomly assigned, but cannot be the same as your character or each other. Each character is then dealt 3
random cards, as well: one with a suspect, one with a weapon, and one with a room. None of the characters,
including you, can have the same 3 random cards. These cards represent information about a suspect, a weapon,
and a room that was NOT involved in the crime.
You will have a checklist that will keep track of information about the suspects, weapons, and rooms for you to
reference when trying to solve the crime. You can view this checklist at any time.
You will start the game in a randomly selected room. To move to a new room, you roll a six sided die. You can
only move to adjacent rooms, and it takes 5 steps to reach any of the adjacent rooms. You cannot move to more
than 1 room in a single turn.
To help solve the crime, you will need to first narrow down the possibilities by suggesting a suspect, a weapon,
and a room. You can only make a suggestion while you are in a room. If you try to make a suggestion in the
Hallway, it should say you have to be in a room to make a suggestion, and then automatically roll the die.
Before you make your suggestion, you checklist will be displayed automatically. When making a suggestion,
the room you’re currently in will always be the room used in your suggestion, but the suspect and weapon can
be anything.
After you make a suggestion, if the other two characters have any cards that match your suggestion, they each
must show one of their matches. If neither have any cards that match, a message is shown say that there were no
matches. If there are any matches, they should be added to your checklist and marked No to represent that it is
not part of the crime. Once a card from the other characters has been added to the checklist, it will no longer
show as a match when used in a suggestion.
This continues until you know all the cards the other characters hold so that you’ve narrowed down the
possibilities to help solve the crime.
When you are ready to try solving the crime, you must go to the Cellar. Here you will enter the suspect,
weapon, and room you think were involved in the crime based on the information you’ve stored in your
checklist. For every guess, it will add the correct ones to the checklist marked with Yes, and the incorrect ones
marked with No. If they enter the same incorrect answer more than once, it still gets added to the checklist
again, and it’s essentially a wasted guess. Once you get all 3 correct, you win, the game ends, and it states the
details of the crime.
Explanation / Answer
The object of this project is to give the student a deep, experiential understanding of propositional knowledge representation and reasoning through explanation, worked examples, and implementation exercises.
Gain an understanding of the syntax and semantics of propositional logic, as well as general logic terminology, including "model", "(un)satisfiability", "entailment", "equivalence", "soundness", and "completeness".
Learn the process of knowledge base conversion to Conjunctive Normal Form (CNF).
Solve word problems with proof by contradiction (a.k.a. reductio ad absurdum) using resolution theorem proving.
Represent knowledge so as to complete a program implementation that performs expert reasoning for the game of Clue.
Compare deductive learning, inductive learning, and knowledge acquisition.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.