Foros > Java: Juego de Ajedrez en Java

  1. rerramos

    Mensajes [5] - Enviado el Viernes 27 de Junio de 2008 a las 21:28hs

    Por favor el que tenga un juego de ajedrez echo en java o posea el codigo para hacerlo o tenga alguna dirección donde encontrarlo por favor publiquelo en este tema.

    Saludos y gracias de antemano.

  2. rerramos

    Mensajes [5] - Enviado el Viernes 27 de Junio de 2008 a las 22:52hs

    Perdon no es un juego de ajedrez lo que quiero. Lo que busco es el juego del gato y el raton en un tablero de ajedrez

    Salud2s

  3. usero

    Mensajes [6] - Enviado el Lunes 30 de Junio de 2008 a las 00:06hs

    package mytictactoe;

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;

    public class TicTacToeV2 implements ActionListener {
    /*Instance Variables*/
    private int[][] winCombinations = new int[][] {
    {0, 1, 2}, {3, 4, 5}, {6, 7, 8}, //horizontal wins
    {0, 3, 6}, {1, 4, 7}, {2, 5, 8}, //virticle wins
    {0, 4, 8}, {2, 4, 6} //diagonal wins
    };
    private JFrame window = new JFrame("Tic-Tac-Toe");
    private JButton buttons[] = new JButton[9];
    private int count = 0;
    private String letter = "";
    private boolean win = false;

    public TicTacToeV2(){
    /*Create Window*/
    window.setSize(300,300);
    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    window.setLayout(new GridLayout(3,3));

    /*Add Buttons To The Window*/
    for(int i=0; i

  4. usero

    Mensajes [6] - Enviado el Lunes 30 de Junio de 2008 a las 00:07hs

    package mytictactoe;

    import java.awt.*;
    import java.awt.event.*;
    import java.util.Random;

    import javax.swing.*;

    public class TicTacToeV4 implements ActionListener {
    /*Instance Variables*/
    private int[][] winCombinations = new int[][] {
    {1, 2, 3}, {4, 5, 6}, {7, 8, 9}, //horizontal wins
    {1, 4, 7}, {2, 5, 8}, {3, 6, 9}, //virticle wins
    {1, 5, 9}, {3, 5, 7} //diagonal wins
    };
    private JFrame window = new JFrame("Tic-Tac-Toe");
    private JButton buttons[] = new JButton[10];
    private int count = 0;
    private String letter = "";
    private boolean win = false;

    public TicTacToeV4(){
    /*Create Window*/
    window.setPreferredSize(new Dimension(300,300));
    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    window.setLayout(new GridLayout(3,3));

    /*Add Buttons To The Window*/
    for(int i = 1; i

  5. usero

    Mensajes [6] - Enviado el Lunes 30 de Junio de 2008 a las 00:07hs

    http://forum.codecall.net/java-tutorials/2141-java-tutorial-tic-tac-toe.html


responder

Para poder responder a este tema tenes que ingresar. Si no tenes una cuenta podes registrarse gratis..

publicidad