title: Snake Game Artificial Intelligence
body: <p>I am developing a snake game for iOS:
  <a href="https://github.com/ScottBouloutian/Snake" rel="nofollow">https://github.com/ScottBouloutian/Snake</a></p>
  
  <p>My goal is to have the AI complete the game of snake optimally (have the snake fill the board).</p>
  
  <p>I am using IDA* to find a path from a snake's current location to the food. This works. However, the algorithm doesn't take into account the fact that it may need to get more food in the future. As a result, sometimes it tends to box itself in.</p>
  
  <p>i.e. The snake's goal at any given time is to find the food, whereas it's goal should be to fill the board (finding food along the way).</p>
  
  <p>How can I add to or modify this approach to make the AI win the game of snake? Is there a better approach I should use instead? I'm just trying to come up with some ideas. Thanks!</p>