my dog learned polymorphism*
The moose likes Java in General and the fly likes TicTacToe - Computer's move Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "TicTacToe - Computer Watch "TicTacToe - Computer New topic
Author

TicTacToe - Computer's move

Max Horstmann
Greenhorn

Joined: Sep 25, 2007
Posts: 3
Hi this is my first message in this forum, I'll try to be the part of this community by time.

I need a help on the TicTacToe game that I am working on it. There is no error or I don't have any problem,but the thing that I want to learn is how to set the computer to make its move. I am not going to set a complex algorithm,because I am not working on algorithms I just wanted set a simple move pattern by myself.I need to see an example just for a move then I'll take care the rest of it.

For example; I want the computer(symbol O) to play the middle square, if is not occupied. Could you show and explain to me how to do the move for this particular way, please?

You can compile and run the program there is no error, after you made your move, the computer doesn't play because strategy.java is empty. I need help on that class. If you are interested here is the codes.Thanks

TicTacToe.java


LeftPanel.java


GamePanel.java


Board.java


Strategy.java (I need help here)


<b>�Example isn't another way to teach, it is the only way to teach�</b> Albert Einstein
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14117
    
  16

"Bone XXX", please check your private messages. You can see them by clicking My Private Messages.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
 
subject: TicTacToe - Computer's move