Jump to content

  • Log In with Google      Sign In   
  • Create Account

#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