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
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:
- How to implement different clickable Area on an image-page through image map?Best solution by Stack Overflow
- How to implement List in .Net?Best solution by Stack Overflow
- How to implement an openid in PHP?Best solution by Stack Overflow
- How to implement chat application in C# MVC?Best solution by stackoverflow.com
- How to tell if my toe is broken?Best solution by wiki.answers.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.