Ver Mensaje Individual
  #4 (permalink)  
Antiguo 24/03/2008, 23:30
nerublanco
 
Fecha de Ingreso: marzo-2008
Mensajes: 13
Antigüedad: 17 años
Puntos: 0
Re: Ayuda con codigo

Hola de nuevo. hice algunos cambios pero me presenta un error.

SecretPhrase.java:34: illegal start of expression
}
^
1 error



Código:
/*SecretPhrase.java*/

import javax.swing.JOptionPane;
import java.util.Arrays;

public class SecretPhrase
{

	public static void main(String [ ] args)
	{

	String palabra = "Life is a field of unlimited possibilities",  
                                 wordtoguess="--f-------f------f-u---m-t------------t---",
                                 phrasetoguess;
	int x=0, y=0;
	String aciertos="";
	String errados="";
	String letra="";
	char[ ] dashes = wordtoguess.toCharArray();
	char[ ] compare = palabra.toCharArray();

		do
		{

			phrasetoguess=JOptionPane.showInputDialog("Pick a word or 
                         letter?");

			if (phrasetoguess.equalsIgnoreCase("palabra"))

			{
			phrasetoguess=JOptionPane.showInputDialog("Guess the 
                        phrase");

			if (phrasetoguess.equalsIgnoreCase(palabra))

			System.out.println("Life is a field of unlimited possibilities\nYou got 
                         it!\nCongratulations!!!");
			}

		else 
		{

			x=0;
			y++;

			String player=JOptionPane.showInputDialog("Enter a letter or 
                 phrase");
		}
		
		while(palabra != wordtoguess);
		{
			if(palabra.indexOf(letra) >= 0)
			aciertos+=letra;
		else
			errados+=letra;

		for(int i = 0; i < palabra.length(); i++)
		{
			String l = palabra.substring(i,i+1);
			if(aciertos.indexOf(letra) >= 0)
		{
			System.out.println(" " + letra);
		}
		else
			System.out.println(" _ ");
		}
		}
		}
System.exit(0);
	}
}