La Web del Programador: Comunidad de Programadores
https://www.lawebdelprogramador.com/foros/Java/536704-codigo-del-triqui-tres-en-linea-y-ahorcado.html

codigo del triqui, tres en linea y ahorcado

codigo del triqui, tres en linea y ahorcado

Publicado por leonardo alvis (1 intervención) el 23/08/2005 00:01:52
Que tal monstruos de la programacion:

les pido el favor muy amablemente me puedan proporcionar los codigos de los juegos triqui, ahorcado y tres en raya les agradezco en el alma la persona que me pueda colaborar.

RE:codigo del triqui, tres en linea y ahorcado

Publicado por crispo (6 intervenciones) el 23/08/2005 01:28:36
El 3 en raya lo tengo en ejemplos por mi ordenador en alguna instalación del jsdk que hice. Es un applet y la propia máquina hace de oponente. Espero que te sirva

/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* -Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* -Redistribution in binary form must reproduct the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT
* BE LIABLE FOR ANY DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT
* OF OR RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR ITS
* DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
* REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
* INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
* OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN
* IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that Software is not designed, licensed or intended for
* use in the design, construction, operation or maintenance of any nuclear
* facility.
*/

/*
* @(#)TicTacToe.java 1.8 03/01/23
*/

import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.net.*;
import java.applet.*;

/**
* A TicTacToe applet. A very simple, and mostly brain-dead
* implementation of your favorite game! <p>
*
* In this game a position is represented by a white and black
* bitmask. A bit is set if a position is ocupied. There are
* 9 squares so there are 1<<9 possible positions for each
* side. An array of 1<<9 booleans is created, it marks
* all the winning positions.
*
* @version 1.2, 13 Oct 1995
* @author Arthur van Hoff
* @modified 04/23/96 Jim Hagen : winning sounds
* @modified 02/10/98 Mike McCloskey : added destroy()
*/
public
class TicTacToe extends Applet implements MouseListener {
/**
* White's current position. The computer is white.
*/
int white;

/**
* Black's current position. The user is black.
*/
int black;

/**
* The squares in order of importance...
*/
final static int moves[] = {4, 0, 2, 6, 8, 1, 3, 5, 7};

/**
* The winning positions.
*/
static boolean won[] = new boolean[1 << 9];
static final int DONE = (1 << 9) - 1;
static final int OK = 0;
static final int WIN = 1;
static final int LOSE = 2;
static final int STALEMATE = 3;

/**
* Mark all positions with these bits set as winning.
*/
static void isWon(int pos) {
for (int i = 0 ; i < DONE ; i++) {
if ((i & pos) == pos) {
won[i] = true;
}
}
}

/**
* Initialize all winning positions.
*/
static {
isWon((1 << 0) | (1 << 1) | (1 << 2));
isWon((1 << 3) | (1 << 4) | (1 << 5));
isWon((1 << 6) | (1 << 7) | (1 << 8));
isWon((1 << 0) | (1 << 3) | (1 << 6));
isWon((1 << 1) | (1 << 4) | (1 << 7));
isWon((1 << 2) | (1 << 5) | (1 << 8));
isWon((1 << 0) | (1 << 4) | (1 << 8));
isWon((1 << 2) | (1 << 4) | (1 << 6));
}

/**
* Compute the best move for white.
* @return the square to take
*/
int bestMove(int white, int black) {
int bestmove = -1;

loop:
for (int i = 0 ; i < 9 ; i++) {
int mw = moves[i];
if (((white & (1 << mw)) == 0) && ((black & (1 << mw)) == 0)) {
int pw = white | (1 << mw);
if (won[pw]) {
// white wins, take it!
return mw;
}
for (int mb = 0 ; mb < 9 ; mb++) {
if (((pw & (1 << mb)) == 0) && ((black & (1 << mb)) == 0)) {
int pb = black | (1 << mb);
if (won[pb]) {
// black wins, take another
continue loop;
}
}
}
// Neither white nor black can win in one move, this will do.
if (bestmove == -1) {
bestmove = mw;
}
}
}
if (bestmove != -1) {
return bestmove;
}

// No move is totally satisfactory, try the first one that is open
for (int i = 0 ; i < 9 ; i++) {
int mw = moves[i];
if (((white & (1 << mw)) == 0) && ((black & (1 << mw)) == 0)) {
return mw;
}
}

// No more moves
return -1;
}

/**
* User move.
* @return true if legal
*/
boolean yourMove(int m) {
if ((m < 0) || (m > 8)) {
return false;
}
if (((black | white) & (1 << m)) != 0) {
return false;
}
black |= 1 << m;
return true;
}

/**
* Computer move.
* @return true if legal
*/
boolean myMove() {
if ((black | white) == DONE) {
return false;
}
int best = bestMove(white, black);
white |= 1 << best;
return true;
}

/**
* Figure what the status of the game is.
*/
int status() {
if (won[white]) {
return WIN;
}
if (won[black]) {
return LOSE;
}
if ((black | white) == DONE) {
return STALEMATE;
}
return OK;
}

/**
* Who goes first in the next game?
*/
boolean first = true;

/**
* The image for white.
*/
Image notImage;

/**
* The image for black.
*/
Image crossImage;

/**
* Initialize the applet. Resize and load images.
*/
public void init() {
notImage = getImage(getCodeBase(), "images/not.gif");
crossImage = getImage(getCodeBase(), "images/cross.gif");

addMouseListener(this);
}

public void destroy() {
removeMouseListener(this);
}

/**
* Paint it.
*/
public void paint(Graphics g) {
Dimension d = getSize();
g.setColor(Color.black);
int xoff = d.width / 3;
int yoff = d.height / 3;
g.drawLine(xoff, 0, xoff, d.height);
g.drawLine(2*xoff, 0, 2*xoff, d.height);
g.drawLine(0, yoff, d.width, yoff);
g.drawLine(0, 2*yoff, d.width, 2*yoff);

int i = 0;
for (int r = 0 ; r < 3 ; r++) {
for (int c = 0 ; c < 3 ; c++, i++) {
if ((white & (1 << i)) != 0) {
g.drawImage(notImage, c*xoff + 1, r*yoff + 1, this);
} else if ((black & (1 << i)) != 0) {
g.drawImage(crossImage, c*xoff + 1, r*yoff + 1, this);
}
}
}
}

/**
* The user has clicked in the applet. Figure out where
* and see if a legal move is possible. If it is a legal
* move, respond with a legal move (if possible).
*/
public void mouseReleased(MouseEvent e) {
int x = e.getX();
int y = e.getY();

switch (status()) {
case WIN:
case LOSE:
case STALEMATE:
play(getCodeBase(), "audio/return.au");
white = black = 0;
if (first) {
white |= 1 << (int)(Math.random() * 9);
}
first = !first;
repaint();
return;
}

// Figure out the row/column
Dimension d = getSize();
int c = (x * 3) / d.width;
int r = (y * 3) / d.height;
if (yourMove(c + r * 3)) {
repaint();

switch (status()) {
case WIN:
play(getCodeBase(), "audio/yahoo1.au");
break;
case LOSE:
play(getCodeBase(), "audio/yahoo2.au");
break;
case STALEMATE:
break;
default:
if (myMove()) {
repaint();
switch (status()) {
case WIN:
play(getCodeBase(), "audio/yahoo1.au");
break;
case LOSE:
play(getCodeBase(), "audio/yahoo2.au");
break;
case STALEMATE:
break;
default:
play(getCodeBase(), "audio/ding.au");
}
} else {
play(getCodeBase(), "audio/beep.au");
}
}
} else {
play(getCodeBase(), "audio/beep.au");
}
}

public void mousePressed(MouseEvent e) {
}

public void mouseClicked(MouseEvent e) {
}

public void mouseEntered(MouseEvent e) {
}

public void mouseExited(MouseEvent e) {
}

public String getAppletInfo() {
return "TicTacToe by Arthur van Hoff";
}
}

RE:codigo del triqui, tres en linea y ahorcado

Publicado por crispo (6 intervenciones) el 23/08/2005 01:29:41
El 3 en raya lo tengo en ejemplos por mi ordenador en alguna instalación del jsdk que hice. Es un applet y la propia máquina hace de oponente. Espero que te sirva

/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* -Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* -Redistribution in binary form must reproduct the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT
* BE LIABLE FOR ANY DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT
* OF OR RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR ITS
* DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
* REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
* INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
* OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN
* IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that Software is not designed, licensed or intended for
* use in the design, construction, operation or maintenance of any nuclear
* facility.
*/

/*
* @(#)TicTacToe.java 1.8 03/01/23
*/

import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.net.*;
import java.applet.*;

/**
* A TicTacToe applet. A very simple, and mostly brain-dead
* implementation of your favorite game! <p>
*
* In this game a position is represented by a white and black
* bitmask. A bit is set if a position is ocupied. There are
* 9 squares so there are 1<<9 possible positions for each
* side. An array of 1<<9 booleans is created, it marks
* all the winning positions.
*
* @version 1.2, 13 Oct 1995
* @author Arthur van Hoff
* @modified 04/23/96 Jim Hagen : winning sounds
* @modified 02/10/98 Mike McCloskey : added destroy()
*/
public
class TicTacToe extends Applet implements MouseListener {
/**
* White's current position. The computer is white.
*/
int white;

/**
* Black's current position. The user is black.
*/
int black;

/**
* The squares in order of importance...
*/
final static int moves[] = {4, 0, 2, 6, 8, 1, 3, 5, 7};

/**
* The winning positions.
*/
static boolean won[] = new boolean[1 << 9];
static final int DONE = (1 << 9) - 1;
static final int OK = 0;
static final int WIN = 1;
static final int LOSE = 2;
static final int STALEMATE = 3;

/**
* Mark all positions with these bits set as winning.
*/
static void isWon(int pos) {
for (int i = 0 ; i < DONE ; i++) {
if ((i & pos) == pos) {
won[i] = true;
}
}
}

/**
* Initialize all winning positions.
*/
static {
isWon((1 << 0) | (1 << 1) | (1 << 2));
isWon((1 << 3) | (1 << 4) | (1 << 5));
isWon((1 << 6) | (1 << 7) | (1 << 8));
isWon((1 << 0) | (1 << 3) | (1 << 6));
isWon((1 << 1) | (1 << 4) | (1 << 7));
isWon((1 << 2) | (1 << 5) | (1 << 8));
isWon((1 << 0) | (1 << 4) | (1 << 8));
isWon((1 << 2) | (1 << 4) | (1 << 6));
}

/**
* Compute the best move for white.
* @return the square to take
*/
int bestMove(int white, int black) {
int bestmove = -1;

loop:
for (int i = 0 ; i < 9 ; i++) {
int mw = moves[i];
if (((white & (1 << mw)) == 0) && ((black & (1 << mw)) == 0)) {
int pw = white | (1 << mw);
if (won[pw]) {
// white wins, take it!
return mw;
}
for (int mb = 0 ; mb < 9 ; mb++) {
if (((pw & (1 << mb)) == 0) && ((black & (1 << mb)) == 0)) {
int pb = black | (1 << mb);
if (won[pb]) {
// black wins, take another
continue loop;
}
}
}
// Neither white nor black can win in one move, this will do.
if (bestmove == -1) {
bestmove = mw;
}
}
}
if (bestmove != -1) {
return bestmove;
}

// No move is totally satisfactory, try the first one that is open
for (int i = 0 ; i < 9 ; i++) {
int mw = moves[i];
if (((white & (1 << mw)) == 0) && ((black & (1 << mw)) == 0)) {
return mw;
}
}

// No more moves
return -1;
}

/**
* User move.
* @return true if legal
*/
boolean yourMove(int m) {
if ((m < 0) || (m > 8)) {
return false;
}
if (((black | white) & (1 << m)) != 0) {
return false;
}
black |= 1 << m;
return true;
}

/**
* Computer move.
* @return true if legal
*/
boolean myMove() {
if ((black | white) == DONE) {
return false;
}
int best = bestMove(white, black);
white |= 1 << best;
return true;
}

/**
* Figure what the status of the game is.
*/
int status() {
if (won[white]) {
return WIN;
}
if (won[black]) {
return LOSE;
}
if ((black | white) == DONE) {
return STALEMATE;
}
return OK;
}

/**
* Who goes first in the next game?
*/
boolean first = true;

/**
* The image for white.
*/
Image notImage;

/**
* The image for black.
*/
Image crossImage;

/**
* Initialize the applet. Resize and load images.
*/
public void init() {
notImage = getImage(getCodeBase(), "images/not.gif");
crossImage = getImage(getCodeBase(), "images/cross.gif");

addMouseListener(this);
}

public void destroy() {
removeMouseListener(this);
}

/**
* Paint it.
*/
public void paint(Graphics g) {
Dimension d = getSize();
g.setColor(Color.black);
int xoff = d.width / 3;
int yoff = d.height / 3;
g.drawLine(xoff, 0, xoff, d.height);
g.drawLine(2*xoff, 0, 2*xoff, d.height);
g.drawLine(0, yoff, d.width, yoff);
g.drawLine(0, 2*yoff, d.width, 2*yoff);

int i = 0;
for (int r = 0 ; r < 3 ; r++) {
for (int c = 0 ; c < 3 ; c++, i++) {
if ((white & (1 << i)) != 0) {
g.drawImage(notImage, c*xoff + 1, r*yoff + 1, this);
} else if ((black & (1 << i)) != 0) {
g.drawImage(crossImage, c*xoff + 1, r*yoff + 1, this);
}
}
}
}

/**
* The user has clicked in the applet. Figure out where
* and see if a legal move is possible. If it is a legal
* move, respond with a legal move (if possible).
*/
public void mouseReleased(MouseEvent e) {
int x = e.getX();
int y = e.getY();

switch (status()) {
case WIN:
case LOSE:
case STALEMATE:
play(getCodeBase(), "audio/return.au");
white = black = 0;
if (first) {
white |= 1 << (int)(Math.random() * 9);
}
first = !first;
repaint();
return;
}

// Figure out the row/column
Dimension d = getSize();
int c = (x * 3) / d.width;
int r = (y * 3) / d.height;
if (yourMove(c + r * 3)) {
repaint();

switch (status()) {
case WIN:
play(getCodeBase(), "audio/yahoo1.au");
break;
case LOSE:
play(getCodeBase(), "audio/yahoo2.au");
break;
case STALEMATE:
break;
default:
if (myMove()) {
repaint();
switch (status()) {
case WIN:
play(getCodeBase(), "audio/yahoo1.au");
break;
case LOSE:
play(getCodeBase(), "audio/yahoo2.au");
break;
case STALEMATE:
break;
default:
play(getCodeBase(), "audio/ding.au");
}
} else {
play(getCodeBase(), "audio/beep.au");
}
}
} else {
play(getCodeBase(), "audio/beep.au");
}
}

public void mousePressed(MouseEvent e) {
}

public void mouseClicked(MouseEvent e) {
}

public void mouseEntered(MouseEvent e) {
}

public void mouseExited(MouseEvent e) {
}

public String getAppletInfo() {
return "TicTacToe by Arthur van Hoff";
}
}


PD: además de el código necesitarás las imágenes de la X y el O, y algunos sonidos...

el ahorcado

Publicado por Kathy (10 intervenciones) el 23/08/2005 02:47:38
Aquí va el juego del Ahorcado para las palabras de arreglo:
private final String[] palabras = {"Victor","Francisco","vramiro", "fclaude",
"Computacion","Astronomia","Injenieria",
"Felicidad","Salud","Dinero","Energia",
"Fuerza","Flojera"};

import java.awt.*;
import java.awt.event.*;

class Ahorcado extends Frame implements ActionListener{

private TextField letra = new TextField(3);
private Label palabra = new Label("");
private Label letras_ocupadas = new Label("");
private Label ganador = new Label("");
private Button ok = new Button("Ingresar");
private Graphics g;
private final String[] palabras = {"Victor","Francisco","vramiro", "fclaude",
"Computacion","Astronomia","Injenieria",
"Felicidad","Salud","Dinero","Energia",
"Fuerza","Flojera"};
private int comparador[];
private String palabra_actual = "";
private int caso = 1;

public Ahorcado(){
super("Juego del Ahorcado");
setLayout(new BorderLayout());
setBackground(Color.yellow);
setResizable(false);
Canvas canvas = new Canvas();
canvas.setSize(200,300);

elige_palabra(palabra);

Panel p = new Panel(new GridLayout(5,1));
Panel p1 = new Panel();
p1.add(new Label("Ingrese una Letra : "));
p1.add(letra);p1.add(ok);
Panel p2 = new Panel();
p2.add(new Label("Palabra : "));
p2.add(palabra);
Panel p3 = new Panel();
p3.add(new Label("Ha ingresado las siguientes Letras : "));
//Panel p5 = new Panel();
//p5.add(ganador);
p.add(p1);p.add(p2);p.add(p3);p.add(letras_ocupadas);p.add(ganador);

add("West",canvas);
add("Center",p);

ok.addActionListener(this);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent w){
System.exit(0);
}});

setSize(500,330);
show();
g = canvas.getGraphics();
}

private void elige_palabra(Label palabra){
String aux = "";
palabra_actual = palabras[(int)(Math.random() * palabras.length)];
palabra_actual = palabra_actual.toUpperCase();
comparador = new int[palabra_actual.length()];
for(int i = 0; i < palabra_actual.length(); i++){
aux = aux + "_ ";
comparador[i] = 0;
}
palabra.setText(aux);
}

static public void main(String[] args){
new Ahorcado();
}

public void actionPerformed(ActionEvent e){
// recoger la letra del TextField
String caracter = null;
if(!letra.getText().equals("")){
caracter = letra.getText().substring(0,1).toUpperCase();
String aux = letras_ocupadas.getText();
if(aux.indexOf(caracter) < 0)
aux += " "+caracter;
letras_ocupadas.setText(aux);
}

if(caracter != null && palabra_actual.indexOf(caracter) >= 0){
String aux="";
for(int i = 0; i < comparador.length; i++)
{
if(caracter.equals(""+palabra_actual.charAt(i))){
comparador[i] = 1;
}
if(comparador[i]==1)
aux += palabra_actual.charAt(i);
else
aux += "_ ";
}
palabra.setText(aux);
}else{
switch(caso){
case 1:
g.setColor(Color.red);
g.fillRect(110,220,30,10);break;
case 2:
g.fillRect(120,20,10,200);break;
case 3:
g.fillRect(70,20,50,10);break;
case 4:
g.fillRect(68,20,5,20);break;
case 5:
g.setColor(Color.black);
g.drawOval(50,40,40,40);break;
case 6:// Cuerpo
g.drawLine(70,80,70,150);break;
case 7:// Brazos
g.drawLine(70,100,40,100);break;
case 8:
g.drawLine(70,100,100,100);break;
case 9:// Piernas
g.drawLine(70,150,40,190);break;
case 10:
g.drawLine(70,150,100,190);
ganador.setText("Perdiste!!!");
palabra.setText(palabra_actual);
}
caso++;
}

boolean winner = true;

for(int j = 0; j < comparador.length; j++)
if(comparador[j] != 1)
winner = false;

if(winner){
ganador.setText("Felicitaciones ganador!!!");
caso = 11;
}
}
}


*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*Made in Beauchef*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+

Fuente: http://www.dcc.uchile.cl/~vramiro/blog/index.php

RE:el ahorcado

Publicado por Amado (4 intervenciones) el 20/03/2007 20:02:35
no tienes el cdigo pero q sea un applet...

es necesario para mi q sea un applet gracias-....

RE:el ahorcado

Publicado por jaime (1 intervención) el 19/04/2009 05:58:45
gracias por todo...

RE:codigo del triqui, tres en linea y ahorcado

Publicado por andre (1 intervención) el 27/07/2012 00:48:06
copie el codigo anterior y el sistema me pide el metodo main, donde esta ?

RE:codigo del triqui, tres en linea y ahorcado

Publicado por alexandra (1 intervención) el 26/10/2007 15:59:26
nesecito que porfavor me envien el codigo del triqui en java que juege contra la maquina y con dos jugadores

RE:codigo del triqui, tres en linea y ahorcado

Publicado por katherine robles emcno (1 intervención) el 23/11/2008 17:04:28
hola

necesito que por favor me envie el codigo triqui que juege con dos jugadores en java en forma recursiva

lo mas rapido posible.

RE:codigo del triqui, tres en linea y ahorcado

Publicado por jose andres| (1 intervención) el 06/08/2009 19:11:09
lo necesito para un tarea gracias

RE:codigo del triqui, tres en linea y ahorcado

Publicado por lui (1 intervención) el 04/10/2012 00:46:43
necesito el codigo del triqui y del ahorcado por fa ayudenme uso nestbeans

RE:codigo del triqui, tres en linea y ahorcado

Publicado por mauricio (1 intervención) el 14/03/2008 22:28:32
fghfghgh

RE:codigo del triqui, tres en linea y ahorcado

Publicado por ana leidy (1 intervención) el 29/04/2009 06:26:20
cdigo del triqui para jugar entre dos

RE:codigo del triqui, tres en linea y ahorcado

Publicado por roberto (1 intervención) el 11/09/2009 02:39:07
me podrian mandarmelo a mi correo se los agradesco mucho

RE:codigo del triqui

Publicado por Ernesto (1 intervención) el 24/02/2010 14:27:33
Hola.
la cuestion es que tengo que realizar un triqui en java (en netbeans) con las reglas tal y cual del juego.

Si me puedes dar una orientacion, te agradeceria mucho.

Gracias

Ernesto

RE:codigo del triqui

Publicado por yessica (1 intervención) el 09/06/2010 01:27:05
hola...
queria saber si me podrian hacer el favor de mandarme el codigo del juego triqui....
:D
es urgente!!!
muchas gracias!!!!!

RE:codigo del triqui (parametrizado)

Publicado por Alejandra (1 intervención) el 02/11/2010 14:18:27
hola quiero saber si me pueden ayadar con un codigo de triqui (parametrizado) en NetBeans.....hojala puedan hacerlo............GRACIAS

RE:codigo del triqui (parametrizado)

Publicado por jair pierahira viveros (1 intervención) el 14/12/2010 02:21:21
gracias

REahorcado

Publicado por raul banguera (1 intervención) el 25/05/2010 02:31:30
EL JUEGO DEL AHORCADO

j _ _ g _
El Juego del Ahorcado, es un juego en el que el jugador tiene que adivinar la palabra incompleta de un tema concreto o variado, tan solo conociendo su longitud sin cometer 6 errores (los necesarios para perder el juego). Las letras acertadas irán completando la palabra de modo que cada vez resulta más fácil encontrar la letras que faltan. No se emplearán acentos.
Usted debe hacer un programa en java, que implemente este juego de la siguiente manera:
• Debe tener almacenado en un archivo las palabras que el jugador debe adivinar, estas palabras deben relacionarse con un tema específico. Por ejemplo: tema--> animales, las palabras guardadas en el archivo: gato, perro tigre, serpiente, etc.
• Se debe presentar en pantalla la longitud de la palabra a adivinar con una serie de guiones, dependiendo de la cantidad de letras que tenga la palabra. Por ejemplo: perro: el programa deberá mostrar por pantalla 5 guiones en pantalla asì _ _ _ _ _
• Cada vez que el jugador adivine una letra el guion debe reemplazarse por la letra adivinada
• Debe mostrarse en cada jugada los intentos que le quedan al jugador. Y los aciertos que ha tenido.
El jugador solo puede equivocarse 6 veces, una vez el jugador haya digitado por teclado 6 letras erróneas de mostrarse en pantalla el mensaje " USTED PERDIO" desea intentarlo de nuevo?

REahorcado

Publicado por Daniela (1 intervención) el 03/03/2012 00:29:43
A que te refires cuando usas Canvas canvas = new Canvas(); que gurda y que es???