CSCI5260 Project 3 – Guess Who? Solved

30.00 $

Category:

Description

Rate this product

 

Game Description

Background

Guess Who? is a logic-based game distributed by Milton Bradley, and now, Hasbro. Your opponent chooses a character with a set of characteristics. You have perfect information about all characters and all of their characteristics, as follows, and as specified in file characters.csv:

 

NAME                  GENDER           HAIR COLOR      BALD                 HAT                   EYES                  MUSTACHE      BEARD              GLASSES           EARRINGS

ALEX Male Black FALSE FALSE Brown TRUE FALSE FALSE FALSE
ALFRED Male Red FALSE FALSE Blue TRUE FALSE FALSE FALSE
ANITA Female White FALSE FALSE Blue FALSE FALSE FALSE FALSE
ANNE Female Black FALSE FALSE Brown FALSE FALSE FALSE TRUE
BERNARD Male Brown FALSE TRUE Brown FALSE FALSE FALSE FALSE
BILL Male Red TRUE FALSE Brown FALSE TRUE FALSE FALSE
CHARLES Male Blonde FALSE FALSE Brown TRUE FALSE FALSE FALSE
CLAIRE Female Red FALSE TRUE Brown FALSE FALSE TRUE FALSE
DAVID Male Blonde FALSE FALSE Brown FALSE TRUE FALSE FALSE
ERIC Male Blonde FALSE TRUE Brown FALSE FALSE FALSE FALSE
FRANS Male Red FALSE FALSE Brown FALSE FALSE FALSE FALSE
GEORGE Male White FALSE TRUE Brown FALSE FALSE FALSE FALSE
HERMAN Male Red TRUE FALSE Brown FALSE FALSE FALSE FALSE
JOE Male Blonde FALSE FALSE Brown FALSE FALSE TRUE FALSE
MARIA Female Brown FALSE TRUE Brown FALSE FALSE FALSE TRUE
MAX Male Black FALSE FALSE Brown TRUE FALSE FALSE FALSE
PAUL Male White FALSE FALSE Brown FALSE FALSE TRUE FALSE
PETER Male White FALSE FALSE Blue FALSE FALSE FALSE FALSE
PHILIP Male Black FALSE FALSE Brown FALSE TRUE FALSE FALSE
RICHARD Male Brown TRUE FALSE Brown TRUE TRUE FALSE FALSE
ROBERT Male Red FALSE FALSE Blue FALSE FALSE FALSE FALSE
SAM Male White TRUE FALSE Brown FALSE FALSE TRUE FALSE
SUSAN Female Blonde FALSE FALSE Brown FALSE FALSE FALSE TRUE
TOM Male Black TRUE FALSE Blue FALSE FALSE TRUE FALSE

 

Purpose

The ultimate purpose of this assignment is to write a program that interrogates your knowledge base through a series of Asks in order to deduce which player it has chosen (no peeking!).

Part 1 – Propositional Logic

Description

  1. Given the information above, fully develop the game’s propositional logic description in a Word Document. You must include the propositional logic descriptions of each character and characteristic.

Coding Requirements

Download the project3.zip file from D2L. You will find two files contained in the archive:

  • py – contains the driver program.
  • py – contains a KnowledgeBase class that will represent what you know about the game and your opponent’s character. Reads the characters from characters.csv into the characters list, as a dictionary object for each character.
  • csv – contains the initial set of characteristics for each character.
  • (The other files will be used in Part 2).

 

  1. Add code to the KnowledgeBase that randomly sets one character as the item your driver program will attempt to guess.
  2. Add one or more ASK methods to the KnowledgeBase, as needed, for you to interrogate it. These should return only True or False.
  3. Add an ASK_VARS method to the KnowledgeBase that interrogates the knowledge base and returns a list of the characters that match the query.
  4. Add at least one TELL method to the KnowledgeBase to inform the knowledge base about new information that you have found.

 

  1. Write a driver program (in project3_guess_who.py) that:
    1. Uses the ASK, ASK_VARS, and TELL methods to interrogate the knowledge base.
    2. The program must choose the questions to ask and it must provide the information gained back to the knowledge base.
    3. The program must successfully solve the puzzle for each run. Allow the user to run the program again or exit.

Part 2 – Propositional Logic with Relationships

A Family Matter

As it turns out, all 24 of the Guess Who? characters are related. Relationships include:

Spouse (assume if two people are the parents of the same children, they are married), Sibling, Sister, Brother, Niece, Nephew, Cousin, Parent, Mother, Father, Grandparent, Grandfather, Grandmother, Great-Grandparent, GreatGrandmother, Great-Grandfather

I have provided a list of all parent/child relationships in file relationships.json.

Propositional Logic

  1. In a separate section of your Project 3 Word Document, define the relationships noted above using propositional logic.

Coding Requirements

From project3.zip, you will find the following two files:

  • py – Defines the Relationships class that reads the parent relationships from the json file.
  • json – Defines all Parent relationships in the data.
  • Note: You will need to import and use the KnowledgeBase from project3_guess_who.py to answer some of these questions.

 

  1. Using your propositional logic definitions from question 7, implement one method for each relationship noted that returns True if x is the {relationship} of y. So, parent(“Anita”,”Paul”) would return True based on relationships.json, but parent(“Anita”,”George”) returns False.
  2. Using this code, create an output CSV file that lists all relationship pairs contained in the family tree. This file should be in the following format:

 

Relationship_Name, Person_X, Person_Y

 

  1. Write a driver program that allows me to interact with your Knowledge Base. Allow me to manually ask questions about the relationships above.

rubric appears on the following page.

 

  • Project-3-4p7ahd.zip