Bulebots / mmlib

A library for shared code among different micromice
4 stars 3 forks source link

Improve visited cell bits implementation #45

Open Peque opened 6 years ago

Peque commented 6 years ago

Use 4 bits for "visited", one for each wall.

0000 - 0000 == known(n-e-s-w) - walls(n-e-s-w)

http://blog.livedoor.jp/takayanagi_s_/archives/8915367.html

Could be useful in cases like:

o---o---o---o---o
|       |     G |
o   o---o   o---o
|   | ?     |
o   o   o   o
|           |
o   o---o---o
| S |
o---o

Where ? would need to be visited in order to do the diagonal, when it would not be necessary.