Public Member Functions | |
| Direction | think (const Grid &grid) const |
| This evil bot goes to the closest fruit on the board if one exists, else, just go in a random direction. | |
There are a couple of flaws with this bot. Firstly, EvilBot doesn't check to see if the direction they're going in is safe (i.e isn't a segment or wall.) Secondly, EvilBot never moves towards fruit diagonally, only cardinally. And many more. This initial code is meant to give an example of how to use Grid and write a bot.