• line of visibility for the Bats

Question related to mission Bats Bunker

 

Hello all,

To complete this mission I am working in two tasks:

  1. getting the line of visibility for a bat.
  2. deciding which path results in the minimum time to alert the alpha bat.

The second part is done, but I am still have some difficulties with part 1. To resolve this part, I made a function that checks three cases:

  • two bats are in the same row (checks cells between for walls)
  • two bats are in the same column (checks cells between for walls)
  • the other cases (basically it checks if a wall is in the line formed by the two bats)

it seems like I am close to solve this task, but the first part looks really complex, and my experience here tells me this is not a good signal :), so I will stop for while (trying to think about other ways to solve the first part). In the meantime, I will appreciate any tip or suggestion.

Regards, Lij.