2
$\begingroup$

Imagine a game with grid size 10x10, there is a good guy and a bad guy and obstacles in the grid, i.e. essentially a maze. The goal of the bad guy is to find the good guy and trap him by erecting walls around him. The good guy is able to move in the maze using a simple random movement, only in 4 directions - up, down, right or left.

I've used the A* algorithm to find the shortest path to the good guy but am still unsure as to how to go about trapping the good guy in his own space?

$\endgroup$
3
  • 1
    $\begingroup$ The good guy is able to move in the maze using a simple random movement, only in 4 directions - up, down, right or left. $\endgroup$ Commented Nov 7, 2021 at 21:08
  • $\begingroup$ What do you mean by "erecting walls around him"? It seems that you imply that the bad guy has more actions than up, down, right and left. It has also the actions of building walls. But how? You need to explain more in detail how this works. $\endgroup$
    – nbro
    Commented Nov 8, 2021 at 15:37
  • $\begingroup$ Agree you need to define how the "bad guy" builds walls (can he build in adjacent cells, or anywhere?), and what it means to trap the "good guy" (seal him in a 1x1 cell, seal him in a 2x1 with the bad guy, cut him off from the bad guy?). $\endgroup$ Commented Nov 8, 2021 at 15:42

0

You must log in to answer this question.

Browse other questions tagged .