View the step-by-step solution to:

The code must be in Prolog. Implement a rule "crypto" that solves the following cryptarithmetic multiplication problem:

The code must be in Prolog.


Implement a rule "crypto" that solves the following cryptarithmetic multiplication problem:


 CHOW * CHOW = BRIGCHOW


Each of the 4 letters (C,H,O,W) stands for a different digit.

The 4 letters (B,R,I,G) can each be matched by any digit.

The aim is to find a substitution of digits for the letters

such that the above stated product is arithmetically correct.

Your program should find all answers.


It should be possible to query your solution in this manner:


?- crypto(B,R,I,G,C,H,O,W).


 Your solution should then produce all of the combinations of

 the digits that satisfy the multiplication problem above.Don't get

 confused between the letter "O" and the number "0" (zero).


 Make sure you never let C=H, or O=W, etc... all of the distinct

 letters C,H,O,W have to stand for distinct digits

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question