Algorithm: fill table with obstacles

Viewed 127

I'm making a simple game with Javascript: a table (in this case 6x6) with some random obstacles, we have to start from a point and move around trying to fill all the table

In this example there are three obstacles, and if we try some different route there are ALWAYS three missing blocks that we can't fill.

Is there a mathematical theorem or an algorithm that can solve this problem? Why can't we fill all the table? How to place obstacles to avoid this?

Example of table with some different routes

0 Answers
Related