How to implement a relative timer in a game?

How to implement tic tac toe game that is played against the computer?

  • Answer:

    maybe have a function that checks a location of an open square, and returns a value of "risk" which is determined by neighboring squares; if the opponent would get 3 in a row or something. Do this for all open squares, and fill in the one that benefits the opponent the least, and you the most. If multiple squares are equivalent, select one randomly

Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

maybe have a function that checks a location of an open square, and returns a value of "risk" which is determined by neighboring squares; if the opponent would get 3 in a row or something. Do this for all open squares, and fill in the one that benefits the opponent the least, and you the most. If multiple squares are equivalent, select one randomly

Sur

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.