import java.awt.*; import java.util.*; import java.lang.Object.*; import java.io.*; import java.lang.String.*; import java.util.Random.*; /** * La clase PalabraPanel es el panel que muestra la palabra * que se debe adivinar. */ public class MuchasPalabras { private String[] palabra; private static final int maxpalabras = 100; /** * Constructor de la clase: recive un arreglo de caracteres * que corresponden con las letras ya adivinadas. * @param char[] pal El arreglo que contiene los caracteres * que deben ser imprimidos. */ public MuchasPalabras() { palabra = new String [maxpalabras]; palabra[0] = "NICOLAS"; palabra[1] = "PIERRE"; palabra[2] = "INGO"; palabra[3] = "PROYECTO"; palabra[4] = "PUTA"; palabra[5] = "YOGURT"; palabra[6] = "MADITO"; palabra[7] = "EDITOR"; palabra[8] = "PRIMERA"; palabra[9] = "VIEJO"; palabra[10] = "FIGURAS"; palabra[11] = "ULTIMA"; palabra[12] = "PIZARRA"; palabra[13] = "COCODRILO"; palabra[14] = "BORRACHO"; palabra[15] = "AGUSTIN"; palabra[16] = "DINOSAURIO"; palabra[17] = "DORMIR"; palabra[18] = "OBJETO"; palabra[19] = "ELEFANTE"; palabra[20] = "MICRO"; palabra[21] = "JAVA"; palabra[22] = "GALLO"; palabra[23] = "CERRO"; palabra[24] = "GRASP"; palabra[25] = "CONDOR"; palabra[26] = "ALEGRE"; palabra[27] = "FRAME"; palabra[28] = "HUEMUL"; palabra[29] = "PLACERES"; palabra[30] = "PALABRA"; palabra[31] = "AGUILA"; palabra[32] = "SANTA"; palabra[33] = "EJEMPLO"; palabra[34] = "RANA"; palabra[35] = "MARIA"; palabra[36] = "ALEMANIA"; palabra[37] = "LINUX"; palabra[38] = "TECNICA"; palabra[39] = "FRANCIA"; palabra[40] = "COMIDA"; palabra[41] = "COMPUTADOR"; palabra[42] = "CHILE"; palabra[43] = "HAMBRE"; palabra[44] = "PLANETA"; palabra[45] = "TAREA"; palabra[46] = "PAN"; palabra[47] = "TELEFONO"; palabra[48] = "FINALMENTE"; palabra[49] = "VENTANA"; palabra[50] = "CARRETE"; palabra[51] = "ELECTRONICA"; palabra[52] = "REFRIGERADOR"; palabra[53] = "OCEANO"; palabra[54] = "VALPARAISO"; palabra[55] = "CERVEZA"; palabra[56] = "PLEGARIA"; palabra[57] = "ROBOTICA"; palabra[58] = "LASER"; palabra[59] = "ORBITA"; palabra[60] = "VENTILADOR"; palabra[61] = "CARRETERA"; palabra[62] = "ALERGIA"; palabra[63] = "PLAYA"; palabra[64] = "BALLENA"; palabra[65] = "GUERRA"; palabra[66] = "TORRE"; palabra[67] = "LOCOMOTORA"; palabra[68] = "PASTEL"; palabra[69] = "LLUVIA"; palabra[70] = "COMPILADOR"; palabra[71] = "LASTRE"; palabra[72] = "MANZANA"; palabra[73] = "PLATANO"; palabra[74] = "CHIRIMOYA"; palabra[75] = "BICICLETA"; palabra[76] = "RUEDA"; palabra[77] = "CAMION"; palabra[78] = "TOMATE"; palabra[79] = "ZANAHORIA"; palabra[80] = "LECHUGA"; palabra[81] = "TOMATE"; palabra[82] = "ZANAHORIA"; palabra[83] = "LECHUGA"; palabra[84] = "ETIQUETA"; palabra[85] = "PANAL"; palabra[86] = "CARBONO"; palabra[88] = "CADMIO"; palabra[89] = "NIQUEL"; palabra[90] = "COBRE"; palabra[91] = "ESTABLO"; palabra[92] = "QUIMICO"; palabra[93] = "TOXICO"; palabra[94] = "DIAMANTE"; palabra[95] = "FRAMBUEZA"; palabra[96] = "MUERTE"; palabra[97] = "VOLCAN"; palabra[98] = "FRUTILLA"; palabra[99] = "COHETE"; } /** * Cambia la palabra que esta en la posicion i */ public void setPalabra(String pal, int index) { palabra[index] = pal; } /** * Retorna la palabra que esta en la posicion i * Como string */ public String getPalabra(int index) { return palabra[index]; } public String randPalabra() { Random rindex = new Random(); String tempalabra = palabra[rindex.nextInt(maxpalabras+1)]; return (tempalabra); } }