Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prolog crossword

Status
Not open for further replies.

doobybug

Technical User
Feb 23, 2009
21
MT
Hi all,

I have a prolog assignment to do a crossword. I am a very new to all this and I thought perhaps someone will have some free time to help me.

The question in my assignment is this:

1. Choose the number of rows and columns and form an empty grid of that size
2. Choose a set of words that could appear in the puzzle - the dictionary
3. Randomly choose a word from the dictionary and a direction either down or across
4. Try to fit th chosen word in the current grid in the direction chosen
5. Repear from step 3 until puzzle is complete

Any type of help will very much be appreciated
 
Your puzzle will be like that, for 3 rows of 4 columns, :
[[A1,A2,A3,A4],
[B1,B2,B3,B4],
[C1,C2,C3,C4]
]

You can generate lists of length N in SWI-Prolog with the rule length(Lst, N).

First you have to write a rule that gives you the colums : column(Puzzle, NbRow, NbCol, NumCol, Col).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top