General
Material
Lecture 1
Lecture 2
Lecture 3
Lecture 4
Lecture 5

Crossword puzzle

Here are six English words:

abalone, abandon, anagram, connect, elegant, enhance.
They are to be arranged in a crossword puzzle like fashion in the grid given below.
The following knowledge base represents a lexicon containing these words.
word(abalone,a,b,a,l,o,n,e).
word(abandon,a,b,a,n,d,o,n).
word(enhance,e,n,h,a,n,c,e).
word(anagram,a,n,a,g,r,a,m).
word(connect,c,o,n,n,e,c,t).
word(elegant,e,l,e,g,a,n,t).
    
Download knowledge base.

Write a predicate crosswd/6 that computes all the different ways of how to fill the grid. The first three arguments should be the vertical words from left to right and the following three arguments the horizontal words from top to bottom.

Hint

Back to the practical session of day 2.