Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ai_snake.hpp"
- #include <cstdlib>
- // AI Snake Implementation
- //
- void AISnake::move()
- {
- static const Direction directions[] = {
- Direction::North, Direction::East, Direction::South, Direction::West
- };
- if((rand() % 1000) > 750) {
- changeDirection(directions[rand() % 4]);
- }
- Snake::move();
- }
Advertisement
Add Comment
Please, Sign In to add comment