What is the correct way to do the robot?

What is the best way to go about writing instructions for a robot to play a human in norts and crosses?

  • I have to write instructions for a robot arm to play a human at norts and crosses - the only way I can think of at the moment would be to write down every possible combination or ...show more

  • Answer:

    Store the results in an array you can rotate and flip according to your needs, and have it iterate through the following hierarchy on every move: 1. If 2 of my pieces exist in a row, place a third piece to win. 2. If 2 of my opponent's pieces exist in a row, place a third piece to block winning. 3. If 2 of my pieces exist in a row, place a piece such that it is adjacent to both, creating a fork. 4. If 2 of my opponent's pieces exist in a row, place a piece such that I now have two in a row. 5. Place a piece in the center. 6. Place a piece in a corner opposite my opponents' piece. 7. Place a piece in any empty corner. 8. Place a piece in the center of any empty edge. Tic Tac Toe is a solved game; this should get the computer a fairly competent win/loss record.

AJYXDZSWBC3BCHRVJ4MCWNMIFQ at Yahoo! Answers Visit the source

Was this solution helpful to you?

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.