title: Simple tic-tac-toe AI
body: <p>I know this has been asked a lot and I've searched other code but most of what I've seen doesn't seem flawless (never loses) and simple, elegant and efficient. And I'm unable to decide which type of solution would fit that description.</p>
  
  <p>The solutions I've seen are:</p>
  
  <p>(1) Using minimax with alpha-beta pruning. This seems complicated to me and possibly unnecessary for such a simple game? Is it probably too complicated? If not, would I need to do a lot of hard coding or am I misunderstanding the algorithm?</p>
  
  <p>(2) Write your code using the pseudocode strategy from Wikipedia... I'm not exactly sure how to implement this. For example, it just says "check for forks". Would most of these checks be done by having an array of winningLines and checking if they'd be filled in or something like that? If not, can someone give me hints on what data structures or any basic tips on how to implement the checks posed in the pseudocode here: <a href="http://en.wikipedia.org/wiki/Tic-tac-toe#Strategy" rel="noreferrer">http://en.wikipedia.org/wiki/Tic-tac-toe#Strategy</a> . I've also seen algorithms that give a numerical value to an 'X' square and an 'O' square and then use the sum to decide the winner but I don't see why this is particularly useful.</p>
  
  <p>Any other <em>reasonable</em> solutions?</p>