Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

TicTacToe - Computer's move

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Bone XXX", please check your private messages. You can see them by clicking My Private Messages.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic