May You please suggest me how to implement computer's move inside game without having while loop in main method which will eventually burden the thread?
As It is easy when I have game between 2 human players, because I can manage whose move it is by managing actionPerformed()
method. So I dont need any loop.
I already have logic for computer's move inside computerPlays()
method.
Probably it is bit easier if one player is human, one computer..where I can do something like: increase int n
after each human move. and then in main()
if(n%2!=0)
{
computerPlays();
}
but I still need loop to have complete game flow.
What if both players are computer?
If You are willing to help me, please try using simpler words as I am pretty new to Java. Thanks.
edit: whats wrong with question ?