문제 설명
그리드 맵 탐색/채우기 알고리즘 (Algorithm for exploring/filling grid map)
I'm working on a small game that takes place on a grid map. I'd like to write an AI that is able to explore the grid map by filling as much of its available space as possible.
From any given position there are four possible moves (north, south, east, west), but some of these may be blocked by walls. Also, once I visited a cell I don't want to visit it again. What's more, I want to avoid getting stuck: if moving in one direction means I'm going in a dead end, I'd rather not fill out that part of the grid.
Can you please help me with some pointers as to how I can do this?
참조 솔루션
방법 1:
This blog post should help you get started.
(by pulagroasa、Narayana)