Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

how to write a function to check the diagonal for the 8 queens problem (in Prolog)

My friend I just started learning Prolog in class. We are writing a function to solve the 8 queens problem. We are writing this function called CheckDiagonals and it checks whether if there are more than one queens on the diagonal.

We have no idea how to start it, so would anybody be able to give us some insight? Please and thank you.

this is all we got:

eightQueens(Board) :-
   permutation([1,2,3,4,5,6,7,8],Board),
   checkDiagonals(Board).

Comments