Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualÁlvaro

Posted 05 March 2013 - 08:55 AM

So my question is: Why should getScore() check for 3 in a line?

 

It doesn't have to! If your search is looking for 3 in a line, you can just return a losing score when it happens: Since the 3-in-a-line condition just appeared, it must be that the opponent of the player to move won.

 

Tic-tac-toe is such a small game that you don't need an evaluation function at all. You can always just explore the tree to the end.


#1Álvaro

Posted 05 March 2013 - 08:55 AM

So my question is: Why should getScore() check for 3 in a line?

 

It doesn't have to! If your search is looking for 3 in a line, you can just return a losing score at that point: Since the 3-in-a-line condition just appeared, it must be that the opponent of the player to move won.

 

Tic-tac-toe is such a small game that you don't need an evaluation function at all. You can always just explore the tree to the end.


PARTNERS