DU CODE Snake Competition
 
Loading...
Searching...
No Matches
EvilBot Class Reference
Inheritance diagram for EvilBot:

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.
 

Member Function Documentation

◆ think()

Direction EvilBot::think ( const Grid & grid) const

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.


The documentation for this class was generated from the following files: