Footprints

Each ship leaves a ``footprint'' on the water. That is, grid cells take on a particular value depending on where the ships are.

Example: $di(2,6) dj(2,5) \overline{dd(2)} \rightarrow \overline{f(5,4)}$. This says that a destroyer at (6,5) going across means that there is water at (5,4).

This can be made into a clause by negating the antecendent:

$di(2,6) dj(2,5) \overline{dd(2)} \rightarrow \overline{f(5,4)}$

Total: $2\times 7\times 10\times 18 + 2\times 2\times 8\times
10\times 15 + 3\times 2\times 9\times 10 \times 12 + 4\times 10\times
10\times 9 = 17400$.


next up previous
Next: Counts Up: BATTLESHIPS Previous: Initial Conditions