Question: DOMINOS (USING PROLOG!!!!!!) Each domino is unique and is oriented left to right, but can be flipped. So, the domino 3-4 can appear as 4-3.

DOMINOS (USING PROLOG!!!!!!)

Each domino is unique and is oriented left to right, but can be flipped. So, the domino 3-4 can appear as 4-3. The dominos in this particular rendition of the game are: 1-4 4-2 9-8 7-8 15-7 10-12 2-12 10-4 These dominos are shown below. When you submit, the dominos must appear as they are originally given to you. */

dom(1, 4). dom(4, 2). dom(9, 8). dom(7, 8). dom(15, 7). dom(10, 12). dom(2, 12). dom(10, 4).

dom(100, 101).

dom(50, 51). dom(52, 51). dom(53, 52). dom(55, 54). dom(55, 55). dom(54, 56). dom(56, 53). dom(55, 60). dom(55, 61). dom(60, 51).

/* The dominos can be sequenced if the numbers on the adjacent dominos match. For example, here is a legal sequence of three dominos: 4-2 2-12 12-10 The game is played by determining if a sequence of dominos exist that start and end with particular values. For example, there exists a sequence of dominos that start with 4 and end with 10. Write a rule that succeeds if a sequence exists. The dominos can be used at most once in a sequence.

Successful queries: dominos(4, 10). dominos(10, 4). dominos(15, 7). dominos(7, 9).

Unsuccessful queries: dominos(1, 15). dominos(15, 1). */

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!