void CREATE_SNAKE::AI() {
if (Food[1] > Vertical[0]) { if (LastMove != CONTROL[0]) { LastMove = CONTROL[1]; } else { LastMove = CONTROL[2]; } } else
if (Food[1] < Vertical[0]) { if (LastMove != CONTROL[1]) { LastMove = CONTROL[0]; } else { LastMove = CONTROL[2]; } } else
if (Food[0] > Horizontal[0]) { if (LastMove != CONTROL[2]) { LastMove = CONTROL[3]; } else { LastMove = CONTROL[0]; } } else
if (Food[0] < Horizontal[0]) { if (LastMove != CONTROL[3]) { LastMove = CONTROL[2]; } else { LastMove = CONTROL[0]; } }
return;
}
Is it considered AI? Also, I have a book on AI (from 2001 I believe, "AI Techniques for Game Programming"), I've never really read it or put that much time/thought into it because I've been rather busy with school (was at the time), anyhow.
It has the typical, "Help Bob Through a Maze." Would that be more probable than what I have now? More or less, I'm clueless when it comes to AI and am looking for opinions on what to do. :)
Thanks!














