In this assignment, you are expected to implement a solution in Prolog to the N-Tiles Problem.N-Tiles
problem is problem of placing N copies of a tile T (TX/TY) on an SxS square grid so that no two copies
touch each other. Namely, N-Tiles problem takes three inputs:
• S: Grid Size
• N: Number of copies to place
• T : Tile definition in (TX,TY) form.
and produces an N-sized set of points on the grid satisfying the non-touching condition.
A call to ntiles predicate should fail if there exists no solution for the problem specified with parameters.
Below is given examples for a no-solution case and a case with 4 different solutions.
>ntiles(2/1,3,3,P).
No
Comments
Leave a comment