ty for the responses, but like you sed before, 216 or something combinations is still a lot, but thats not all of it tho 216 is only 3 moves ahead, and in an grid of 6 rows theres much more to it, plus, how do I implement the combinations so that my AI can interact with the user?
I've come up with something, but so far, doesn't work.
I made a AI method, and in it, i have, it first checks if a place can placed so that the computer...
User Profile
Collapse
-
i think u need some loops and if statements, i put it on my program to make it look good and i got good marks cuz i had lots of loops and ifs!
HOPE THIS HELP XD!Leave a comment:
-
sry, but i have no idea wut a matrix is.
but i somehow managed to figure out how to check win it's something like this.
[code=java]
public void checkWin1(){
for ( int i = 0; i <= 3; i ++){
for ( int j = 0; j < 6; j ++){
if ( myButtons[j][i].getText().equa ls("X") || myButtons[j][i].getText().equa ls("O")){
if...Leave a comment:
-
i c ur problem, well i think the best way to solve ur problem is to make some loops, like a nested loop.
for (int i = 0; i < letter.length; i ++){
for (int j = 0; j < letter2.length; j ++){
.......
.......
}
}Leave a comment:
-
Help needed with Connect4 game
hi, I recently started programing about a month ago. my teacher ask me to make a game. A connect 4 game. I try to make, but failed. I need help.
here is my code:
[CODE=Java]import java.awt.*;
import java.awt.event. *;
import javax.swing.*;
public class Connect implements ActionListener {
private JFrame window = new JFrame();
private JPanel myPanel = new JPanel();
...
No activity results to display
Show More
Leave a comment: