# Prolog puzzle project | Computer Science homework help

## Overview

The “funniest” way I can think of to practice logic programming is to use it to solve a logic puzzle. A logic puzzle is typically presented as a mystery and list of clues that can be used to infer facts such as “who done it”.

For this assignment, we will use the Printable Logic Puzzles (Links to an external site.) website to find two puzzles to solve. One will be a “challenging” puzzle and the other will be a “Very Hard” puzzle.

For this assignment, you will write all of the clues as rules in a prolog program.

Your prolog file must obey the following format:

1. The name of the prolog files must be ‘challenging.pl’ and ‘veryhard.pl’
2. Your prolog file must provide a `url/1` fact to get the URL of the puzzle being solced.
3. Your prolog file must also provide a `solution/1` fact with the correct solution hardcoded in. You will get the correct solution from the Printable Logic Puzzles (Links to an external site.) website.
4. Your prolog file must provide a `solve/1` rule that uses the clues to find one, and only one, table that is the solution.
5. Your puzzle must have a series of `clueX(T)` rules that are satisfied whenever the solution in `T` is consistent with clue X.
6. Your puzzle must include the `check` rule as follows:
``check :- solution(S), solve(S), aggregate_all(count, (solve(_T)), Count), format("Found ~w solutions~n", [Count]), Count=1. ``

To receive credit, your puzzle must find one, and only one, solution to the puzzle.

Your assignment will be checked by running swipl in the docker container as follows:

``swipl -q -g check -g halt challenging.pl ``

or

``swipl -q -g check -g halt veryhard.pl ``

which will use your `solve` and `solution` predicates to make sure you find exactly one solution and that it is the correct solution.

You can, of course, work on your solution using SWISH (Links to an external site.) in which case you may want to also use their table rendering plugin (Links to an external site.) to display your solution. Once you have a solution, however, you should confirm that it runs properly in the container. This may mean commenting out the part where you load the plugin.

## Checking Your Solution

``make check``

or

``make check-challengingmake check-veryhard``

All of these MUST pass before you submit the assignment.

## Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
\$26
The price is based on these factors:
Number of pages
Urgency
Basic features
• Free title page and bibliography
• Unlimited revisions
• Plagiarism-free guarantee
• Money-back guarantee
On-demand options
• Writer’s samples
• Part-by-part delivery
• Overnight delivery
• Copies of used sources
Paper format
• 275 words per page
• 12 pt Arial/Times New Roman
• Double line spacing
• Any citation style (APA, MLA, Chicago/Turabian, Harvard)

# Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

### Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

### Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

### Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.