• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

TicTacToe - Computer's move

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
"Bone XXX", please check your private messages. You can see them by clicking My Private Messages.
 
Being a smart alec beats the alternative. This tiny ad knows what I'm talking about:
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
    Bookmark Topic Watch Topic
  • New Topic