SOLVED: Homework #3 solution

28.99 \$

————————————————————————- 1. Implement a rule “spiralDown”, that takes a positive integer n and produces a list that counts down from n to 0, including negative copies of the values along the way. For example: spiralDown(4,L) should respond with: L=[4,-4,3,-3,2,-2,1,-1,0] ————————————————————————- 2. Implement a rule “secondCousinOnceRemoved”. For example, secondCousinOnceRemoved(scott,gail) would return true if gail is scott’s second cousin, once removed. Assume that the only facts available, are “parent” facts of the form: parent(x,y), meaning that person x is a parent of person y. For a definition of what is meant by a “second cousin, once removed”, see the wikipedia page: http://en.wikipedia.org/wiki/Cousin ————————————————————————- 3. Solve the following cryptarithmetic problem using Prolog: P I N G P O N G + F U N ——— I G N I P Each of the 7 different letters stands for a different digit. The aim is to find a substitution of digits for the letters such that the resulting sum is arithmetically correct. Your program should find ALL answers, that do not have leading zeros.

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . ` zip` solution files instantly, after Payment

Description

Rate this product