Skip to content

sandrawangyx/Prolog

Repository files navigation

Prolog

Valentine’s Day Puzzle #1

Each of five men spent the day searching for the perfect Valentine’s Day gift for his wife. After seeing several exquisite items in the windows of local jewelry stores, each man purchased a piece of jewelry set with a different gemstone. Each piece was bought in a different store. From the information provided, match each husband (Jay, Dane, Duncan, Dan, and Kendrick) with his wife (Jen, Jenny, Jennifer, Jenna, or JennA*), the store where each made his purchase (Target, Wal-Mart, Walgreens, Menard’s, or Conkey’s), and the type of gemstone (Emerald, Ruby, Topaz, Opal, or Sapphire) each man purchased.

• Jay is married to Jen. • Jenny is not married to Dane or Duncan. • Dane is not married to Jennifer. • Dan did not shop at Target or Wal-Mart. • Dane did not shop at Walgreens. • Duncan bought the Emerald. • Dan did not buy the Ruby. • Jay did not buy the Topaz. • Jenny did not get the Topaz. • Jenna received the Opal. • The Ruby was bought at Menard’s. • The Emerald was not bought at Target. • Jennifer received the gift from Target. • Jenny did not receive a gift from Walgreens.

Trouble at Dunsmore Manor

It's early evening and Miss Secrest has just found Lord Peter Dunsmore dead on the drawing room floor. Lady Emily retired to her chambers in shock and the esteemed Inspector Hercule Krebsbach has been called in. Upon examining the body, Krebsbach declared that Lord Dunsmore had been administered a lethal dose of poison within the last few hours. Here are other facts noted by Krebsbach:

• Lord Dunsmore is married to Lady Emily. • The gardener is married to the maid. • Lord Dunsmore is a tennis player. • Lord Secrest's hobby is philosophy. • The gardener enjoys music. • Lord Dunsmore's main rival is Lord Secrest. • Mr. Mason is a chemist. • The Inspector is a customer of Mr. Mason. • Miss Secrest is Lord Secrest's daughter. • The butler owes 10,000 pounds to Lord Dunsmore. • The professor is an armchair philosopher. • Lord Secrest is a customer of Mr. Mason. • Poison is sold by a chemist. • Lady Emily plays the flute (i.e., is a musician). • Philosophy is Mr. Mason's hobby. • The professor was once a suitor of Lady Emily.

Your job is to encode these facts in a Prolog database that mimics the brain of the famous detective Hercule Krebsbach. Of course, these facts do not include the common sense rules the esteemed inspector needs to solve the problem, so you must also augment your Prolog database with these rules and then use it to solve the mystery. For example, any good inspector would realize that the customer of a chemist can buy poison, that relatives and friends of people who have bought poison themselves have access to that poison, and that people with the same hobby often become friends.

Naturally, it is common knowledge that someone will commit a murder only if they have a motive and the means to commit the murder, but what motives would drive someone to murder? Rivalry? A love triangle? Money? All three are possibilities, but which motivation, combined with which means, will expose the killer and be added to the unparalleled record of solved cases in Krebsbach's impressive career? See if you can get there first!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages