Compare commits
No commits in common. "014aaffc0a9df7fe8b8b301bc153c640ef86065d" and "0ce07fa88d4a34042f3bb251ca2ae1b66d7c834c" have entirely different histories.
014aaffc0a
...
0ce07fa88d
@ -41,11 +41,10 @@ namespace snakeplusplus
|
||||
void AISnake::GetNewPath(const std::vector< std::vector<char> >& gameBoard, const sf::Vector2f& source, const sf::Vector2f& boundaries, const int snakeSize)
|
||||
{
|
||||
// Search for food
|
||||
if (snakeSize < 135) {
|
||||
BFS(gameBoard, source, boundaries);
|
||||
if (gameBoard[botPathUnsanitized.top().y][botPathUnsanitized.top().x] != 'X') {
|
||||
while (!botPathUnsanitized.empty()) { botPathUnsanitized.pop(); }
|
||||
} else {
|
||||
DFS(gameBoard, source, boundaries);
|
||||
while (botPathUnsanitized.size() > 15) { botPathUnsanitized.pop(); }
|
||||
}
|
||||
// Create path for food
|
||||
path.push(botPathUnsanitized.top());
|
||||
|
Loading…
Reference in New Issue
Block a user