Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

tic tac toe help!


  • Please log in to reply

#1
sigfrid

sigfrid

    Member

  • Member
  • PipPip
  • 42 posts
:whistling: I need to make the game called TIC TAC TOE(in java) using a three structure, the thing is, that i have to use a predetermined node, to make the three, :blink: and i need to make it run on an aplication, i have little idea of what to do, but little is not enought i have to use one of this two nodes
//this is one
public Nodo(Object o, int nh)
{
elemento = new Object[1];
elemento[0] = o;
hijo = new Nodo[nh];
for(int i=0; i<nh; i++)
hijo[i] = null;
cuenta = 1;
}
// this is the other

/**
* Constructor que recibe un arreglo de objetos y nh hijos
* @param o Object[]
* @param nh int
*/

public Nodo(Object o[], int nh)
{
int i, n;
n = o.length;
elemento = new Object[n];
for (i = 0; i < o.length; i++)
elemento[i] = o[i];
hijo = new Nodo[nh];

for(i=0; i<nh; i++)
hijo[i] = null;
cuenta = 1;
}
I was thinking of using a three, inserting in each node a matrix 3*3, i have to automatically generate the posibles moves and make a decision, and i also need to use toogle buttons in the application, instead of just pictures, so i need to make it somehow when you push the toogle button an "X" is written, then, the computer decides, and the toogle button where the computers makes its move must have an "O" on it, so, if any of you could be of any help, please help me :help: .
  • 0

Advertisements


#2
MOLEXRULZ

MOLEXRULZ

    Member

  • Member
  • PipPipPip
  • 346 posts
I'm sorry that I have no constructive advice but...


DUDE, YOUR CODE IS IN SPANISH!! THATS AWESOME
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP