elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Security Series.XSS. [Cross Site Scripting]


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  Java
| | | |-+  [principiante] Loteria
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [principiante] Loteria  (Leído 3,261 veces)
Geek7

Desconectado Desconectado

Mensajes: 57


Be Free!


Ver Perfil
[principiante] Loteria
« en: 27 Junio 2013, 19:57 pm »

A base d emis conecptos basicos he hecho un mini programa que funciona como una loteria. Permite al usuario elegir entre 1 y 5 tickets y chequear si gano.. Quiero saber criticas a nivel de codigo (ubicacion de declaracion de variables, nombres etc...).

Código
  1. package exercise;
  2.  
  3. import java.util.Random;
  4. import java.util.Scanner;
  5.  
  6. public class Lotto {
  7.  
  8. /**
  9. * @author geek7
  10. */
  11. public static void main(String[] args) {
  12. Scanner keyboard = new Scanner(System.in);
  13. int choice;
  14.  
  15. while(true) {
  16. System.out.println("$$$$$$$ LOTTO $$$$$$$");
  17. System.out.println("Hi, how many tickets would you like to buy?");
  18. System.out.println(" 1) 1 Ticket");
  19. System.out.println(" 2) 2 Tickets");
  20. System.out.println(" 3) 3 Tickets");
  21. System.out.println(" 4) 4 Tickets");
  22. System.out.println(" 5) 5 Tickets");
  23. System.out.println(" 0) In bankrupt - Nothing\n");
  24. choice = keyboard.nextInt();
  25.  
  26. if (choice == 0) {
  27. System.out.println("EXITING...");
  28. System.exit(0);
  29. }
  30.  
  31.  
  32. System.out.println("\nPrinting tickets...");
  33. System.out.println("----------------------");
  34.  
  35. Random generateNumbers = new Random();
  36. int[] tickets = new int[59];
  37. int[] yourTickets = new int[choice];
  38. int i, matched = 0;
  39.  
  40. // Generate list of numbers
  41. for(i = 0; i < tickets.length; i++) {
  42. tickets[i] = generateNumbers.nextInt(60);
  43. }
  44.  
  45. // Give him his tickets
  46. System.out.print("\nThese are your tickets: \t");
  47. for (i = 0; i < yourTickets.length; i++) {
  48. yourTickets[i] = generateNumbers.nextInt(60);
  49. System.out.print(yourTickets[i] + " ");
  50. }
  51. System.out.println("\n\nLet's if you won something... \n");
  52.  
  53. // Check if something matched
  54. for(i = 0; i < yourTickets.length; i++) {
  55. for(int j = 0; j < tickets.length; j++) {
  56. if (yourTickets[i] == tickets[j]) {
  57. matched++;
  58. }
  59. }
  60. }
  61. // Make a pause
  62. try {
  63. Thread.sleep(3000);
  64. } catch(InterruptedException e) {
  65. }
  66.  
  67. switch (matched) {
  68. case 1:
  69. System.out.println("You won $100!");
  70. break;
  71.  
  72. case 2:
  73. System.out.println("You won $200!");
  74. break;
  75.  
  76. case 3:
  77. System.out.println("You won $500!");
  78. break;
  79.  
  80. case 4:
  81. System.out.println("You won $800!");
  82. break;
  83.  
  84. case 5:
  85. System.out.println("GREAT. You've got the pot: $1000!");
  86. break;
  87.  
  88. case 0:
  89. System.out.println("Have luck next time!");
  90. break;
  91.  
  92. default:
  93. System.out.println("Something went wrong");
  94. System.exit(1);
  95. }
  96.  
  97. // Ask if he wants to try again
  98. System.out.print("Would you like to try again? (X to exit) \t");
  99. String tryAgain = keyboard.next();
  100.  
  101. if(tryAgain.compareToIgnoreCase("x") == 0) {
  102. System.out.println("Thank you. Bye");
  103. System.exit(0);
  104. }
  105.  
  106. // Just clear screen
  107. for (int l = 0; l < 1000; l++) {
  108. System.out.println();
  109. }
  110.  
  111. }
  112.  
  113.  
  114. }
  115.  
  116. }
  117.  


En línea

Mitgus

Desconectado Desconectado

Mensajes: 63


Programming Lover


Ver Perfil
Re: [principiante] Loteria
« Respuesta #1 en: 27 Junio 2013, 21:17 pm »

Está bien, sintaxis limpia y clara. Lo que te puedo recomendar es que lo hagas mediante un Thread y algo muy importante:

Aprovecha la POO, no hagas todo en el main. Así tendrás un código limpio, y fácil de mantener.

Código
  1. import java.util.Random;
  2. import java.util.Scanner;
  3.  
  4. public class Loteria {
  5.  
  6. int choice;
  7. int[] tickets;
  8. int[] yourTickets;
  9. int matched;
  10. Scanner keyboard = new Scanner(System.in);
  11.  
  12. public Loteria(){
  13. Jugar instance = new Jugar();
  14. instance.start();
  15. }
  16.  
  17. void generar_tickets(int eleccion){
  18.  
  19. System.out.println("\nPrinting tickets...");
  20. System.out.println("----------------------");
  21.  
  22. Random generateNumbers = new Random();
  23. tickets = new int[59];
  24. yourTickets = new int[eleccion];
  25. int i;
  26.  
  27. // Generate list of numbers
  28. for(i = 0; i < tickets.length; i++) {
  29. tickets[i] = generateNumbers.nextInt(60);
  30. }
  31.  
  32. // Give him his tickets
  33. System.out.print("\nThese are your tickets: \t");
  34. for (i = 0; i < yourTickets.length; i++) {
  35. yourTickets[i] = generateNumbers.nextInt(60);
  36. System.out.print(yourTickets[i] + " ");
  37. }
  38.  
  39. } // fin metodo
  40.  
  41.  
  42. void comparar(){
  43.  
  44. System.out.println("\n\nLet's if you won something... \n");
  45.  
  46. // Check if something matched
  47. for(int i = 0; i < yourTickets.length; i++) {
  48. for(int j = 0; j < tickets.length; j++) {
  49. if (yourTickets[i] == tickets[j]) {
  50. matched++;
  51.     }
  52.   }
  53. }
  54.  
  55. // Make a pause
  56. try {
  57. Thread.sleep(3000);
  58. } catch(InterruptedException e) {
  59. }
  60.  
  61. switch (matched) {
  62. case 1:
  63. System.out.println("You won $100!");
  64. break;
  65.  
  66. case 2:
  67. System.out.println("You won $200!");
  68. break;
  69.  
  70. case 3:
  71. System.out.println("You won $500!");
  72. break;
  73.  
  74. case 4:
  75. System.out.println("You won $800!");
  76. break;
  77.  
  78. case 5:
  79. System.out.println("GREAT. You've got the pot: $1000!");
  80. break;
  81.  
  82. case 0:
  83. System.out.println("Have luck next time!");
  84. break;
  85.  
  86. default:
  87. System.out.println("Something went wrong");
  88. System.exit(1);
  89. }
  90.  
  91. } // fin metodo
  92.  
  93. boolean jugar_denuevo() {
  94.  
  95. // Ask if he wants to try again
  96. System.out.print("Would you like to try again? (X to exit) \t");
  97. String tryAgain = keyboard.next();
  98.  
  99. if(tryAgain.compareToIgnoreCase("x") == 0) {
  100. System.out.println("Thank you. Bye");
  101. System.exit(0);
  102. return false;
  103. }
  104. else {
  105. // Just clear screen
  106. for (int l = 0; l < 1000; l++) {
  107. System.out.println();
  108.  }
  109. return true;
  110.  
  111.  }
  112. }// fin metodo
  113.  
  114.  
  115. // clase que empieza el juego mediante thread
  116. private class Jugar extends Thread{
  117.  
  118. private boolean continuar=true; //condicion del thread
  119.  
  120.  
  121. public void run()  { // incia el thread
  122. while(continuar) { // hace la tarea mientras continuar sea true
  123.  
  124. try {
  125. System.out.println("$$$$$$$ LOTTO $$$$$$$");
  126.                                        System.out.println("Hi, how many tickets would you like to buy?");
  127.                                        System.out.println(" 1) 1 Ticket");
  128.                                        System.out.println(" 2) 2 Tickets");
  129.                                        System.out.println(" 3) 3 Tickets");
  130.                                        System.out.println(" 4) 4 Tickets");
  131.                                        System.out.println(" 5) 5 Tickets");
  132.                                        System.out.println(" 0) In bankrupt - Nothing\n");
  133.                                        choice = keyboard.nextInt();
  134.  
  135.                                        if (choice == 0) {
  136.                                        System.out.println("EXITING...");
  137.                                        System.exit(0);
  138.                                      }
  139.  
  140.                                       generar_tickets(choice);
  141.                                       comparar();
  142.                                       continuar = jugar_denuevo();
  143.  
  144.                                      }
  145. catch(Exception e){
  146. System.out.println("Ha ocurrido un error");
  147. }
  148. }
  149. }
  150. }
  151.  
  152.  
  153.                       public static void main(String[] args) {
  154.                        new Loteria();
  155.                       }
  156.                   } // fin.
  157.  


He modificado tu método para jugar de nuevo. Para que lee devuelva true o false a la condición del while del thread. Si se elige un caracter que no sea X, devuelve true a la variable de condición y se seguirá jugando. De lo contrario, saldrá del juego.


Prueba el code y me comentas. Un saludo.
 



En línea

Linux User #560388
Geek7

Desconectado Desconectado

Mensajes: 57


Be Free!


Ver Perfil
Re: [principiante] Loteria
« Respuesta #2 en: 27 Junio 2013, 21:53 pm »

Un poco avanzado para mi, todavia no he entendiddo threads y clases, gracias. ;D

Con respecto a tabulacion, comentarios de codigo esta bien?
En línea

Mitgus

Desconectado Desconectado

Mensajes: 63


Programming Lover


Ver Perfil
Re: [principiante] Loteria
« Respuesta #3 en: 27 Junio 2013, 22:07 pm »

Para mí its okay, yo comento mucho más mis códigos (creo que es una manía mía jeje) pero se entiende bastante bien lo que quieres hacer (aunque el 100% del code esté en inglés).

Respecto a tabulación ¿A qué te refieres?

Y por último como recomendación aprende POO, si usamos Java sin POO mejor irnos a C  ;D


Saludos.

PD: Léete el libro 'Cómo programar en Java 7ma edición - Deitel'. Aprenderás muy rápido con este libro.
En línea

Linux User #560388
Geek7

Desconectado Desconectado

Mensajes: 57


Be Free!


Ver Perfil
Re: [principiante] Loteria
« Respuesta #4 en: 27 Junio 2013, 22:18 pm »

O sea, mi problema es que no comento porque no se que exactamente comentar. Si hay una funcion "jugar" y una variable "tickets" se entiende, el tema sera si en un futuro entendere.

Tabulacion seria hacer esto:
Código
  1. for (i = 0; i < 10; i++) {
  2.    System.out......
  3.        for() {
  4.        }
  5.    if {
  6.    }        
  7. }

en vez de:
Código
  1. for (i = 0; i < 10; i++) {
  2. System.out......
  3. for() {
  4. }
  5. if {
  6. }        
  7. }
Solo cuestion de "vista".
En línea

Mitgus

Desconectado Desconectado

Mensajes: 63


Programming Lover


Ver Perfil
Re: [principiante] Loteria
« Respuesta #5 en: 27 Junio 2013, 22:32 pm »

Claro, es importante una buena praxis. La identación es muy importante en un código ya que lo hace más legible. Pero la identación la coloca automáticamente el IDE. ¿Qué IDE usas? ¿O usas un editor de texto común?

No es necesario comentar solo con funciones. Simplemente, cuando haya un pedazo de código que creas conveniente comentar, simplemente coméntalo. Cuando recién empecé, no comentaba mis algoritmos, y a las 3 semanas no sabía ni qué había hecho. Comentar el código es muy importante.

Saludos.
En línea

Linux User #560388
Mitgus

Desconectado Desconectado

Mensajes: 63


Programming Lover


Ver Perfil
Re: [principiante] Loteria
« Respuesta #6 en: 28 Junio 2013, 01:47 am »

En tu código hay un bug. ¿Que pasaría si se ingresara por error una letra o caracter? Terminaría en una expeción tipo InputMismatchException. Para evitar esto, pediríamos el ingreso del número de tickets y determinaríamos si es o no un número.

Código
  1. // Este metodo se encargar&#225; de avisarnos si lo ingresado es un n&#250;mero
  2. private static boolean isNumeric(String cadena){
  3.  try {
  4.    Integer.parseInt(cadena);
  5.    return true;
  6.  } catch (NumberFormatException nfe){
  7.    System.out.println("Ingrese solo numeros");
  8.    return false;
  9.   }
  10. }

Y lo llamaríamos al ingresar un valor:

Código
  1. boolean esNumero;
  2. do {
  3.  
  4. System.out.println("$$$$$$$ LOTTO $$$$$$$");
  5.                                        System.out.println("Hi, how many tickets would you like to buy?");
  6.                                        System.out.println(" [1] 1 Ticket");
  7.                                        System.out.println(" [2] 2 Tickets");
  8.                                        System.out.println(" [3] 3 Tickets");
  9.                                        System.out.println(" [4] 4 Tickets");
  10.                                        System.out.println(" [5] 5 Tickets");
  11.                                        System.out.println(" [0] In bankrupt - Nothing\n");
  12.                                        String choice2 = keyboard.next();
  13.                                        esNumero = isNumeric(choice2);
  14.                                        if (esNumero == true){
  15.                                         choice = Integer.parseInt(choice2);
  16.                                        }
  17.  
  18. } while(esNumero==false || choice<0 || choice>5);


Como ves, ingresamos choice como String. Luego llamamos al metodo isNumeric para determinar si es un número. Si es un número devuelve true, de lo contrario devuelve false a la variable Boolean esNumero. Si esNumero ahora es true, convertimos choice a entero. Al final, en el while, colocamos que se vuelva a ingresar choice, mientras que No sea un numero, o mientras se ingrese un valor menor a 0 o mayor a 5.

El método isNumeric tiene un catch en caso no se pueda convertir choice a entero (aquí ya sabemos que lo ingresado no es un número), que mostrará el mensaje "Ingrese solo números".

Otro problema que tienes, es que los números que generas pueden repetirse, por lo que si hay 43, 43 en los tickets y tu tienes 43, cuenta como 2 aciertos.

Para arreglar esto, una opción es crear un método que nos avise si el ticket actual ya ha sido sacado:

Código
  1. //determina si el valor de la bola ya ha sido sacado
  2. boolean numeroRepetido(int num, int[] numeros, int count)
  3. {
  4.  // num = bola, numeros = textfields de numeros, count = cuenta
  5.  for(int i=0; i<count; i++)
  6.  {
  7.    // si el numero q se ha sacado ya esta en algun textfield
  8.    if(numeros[i] == num)
  9.    {
  10.      return true; //devuelve true
  11.    }
  12.  }
  13.  return false;
  14. }

Y lo llamamos cada vez que generamos un ticket:

Código
  1. // genera los tickets
  2. void generar_tickets(int eleccion){
  3.  
  4. System.out.println("\nPrinting tickets...");
  5. System.out.println("----------------------");
  6.  
  7. tickets = new int[59];
  8. yourTickets = new int[eleccion];
  9.  
  10.  
  11. // Generate list of numbers
  12. for(int i = 0; i < tickets.length; i++) {
  13. int numero;
  14. do{
  15.   numero = 1+generateNumbers.nextInt(60);
  16. }while(numeroRepetido(numero,tickets,i));
  17. tickets[i] = numero;
  18. }
  19. }

Código
  1. // genera nuestros numeros
  2. void generar_mistickets(){
  3. // Give him his tickets
  4. System.out.print("\nThese are your tickets: \t");
  5. for (int i = 0; i < yourTickets.length; i++) {
  6. int numero;
  7. do{
  8. numero = 1+generateNumbers.nextInt(60);
  9. }while(numeroRepetido(numero,yourTickets,i));
  10. yourTickets[i] = numero;
  11. if(i != yourTickets.length-1){
  12. System.out.print(yourTickets[i] + ", ");
  13. }
  14. else
  15. System.out.print(yourTickets[i]);
  16. }
  17.  
  18. } // fin metodo

Como podrás ver, dentro de cada for hacemos un do - while cuando se crea un nuevo ticket. Y la condición es:

Código
  1. while(numeroRepetido(numero,tickets,contador));

Donde numero es el número que se ha generado actualmente, tickets es el arreglo de tickets (yourTickets y tickets), y contador es la cuenta de cuántos numeros se van sacando actualmente.

Código
  1. //determina si el valor del ticket ya ha sido sacado
  2. boolean numeroRepetido(int num, int[] numeros, int count)
  3. {
  4.  // num = ticket, numeros = arreglo de tickets, count = cuenta
  5.  for(int i=0; i<count; i++)
  6.  {
  7.    // si el numero q se ha sacado ya se ha sacado
  8.    if(numeros[i] == num)
  9.    {
  10.      return true; //devuelve true
  11.    }
  12.  }
  13.  return false;
  14. }

Por ejemplo, si recién vamos sacando 3 tickets (i = 2). El for del método quedaría:

Código
  1. for(int i=0; i<count; i++) {
  2.  // 0 < 2 &#243; 1 < 2 -> Si, entonces compara:
  3.  // si el numero q se ha sacado ya se ha sacado
  4.    if(numeros[i] == num)
  5.    {
  6.      return true; //devuelve true
  7.    }
  8.    else
  9.      return false;
  10.  }


Otra cosita es la cantidad de aciertos. Pueden haber más de 10 aciertos en tu código. Podemos hacer esto:

Código
  1. // Check if something matched
  2. for(int i = 0; i < yourTickets.length; i++) {
  3. for(int j = 0; j < tickets.length; j++) {
  4. if (yourTickets[i] == tickets[j]) {
  5. matched++;
  6. System.out.println(yourTickets[i]+ " = "+tickets[j]);
  7. }
  8. if(matched == 5){
  9. j=60;
  10. i=60;
  11.   }
  12.  
  13.  } // fin for interno
  14. } // fin for externo

Solamente se coloca un if (matched == 5). Cuando hayan 5 aciertos (que se suponen son lo máximo), i & j se les asigna 60 solo para romper los fors.

Espero hayas entendido este pedazo de código. Un saludo.

PD: Te dejo todo el code para que lo estudies cuando veas POO.

Código
  1. import java.util.Random;
  2. import java.util.Scanner;
  3.  
  4. public class Loteria {
  5.  
  6. int choice;
  7. int[] tickets;
  8. int[] yourTickets;
  9. int matched=0;
  10. Scanner keyboard = new Scanner(System.in);
  11. Random generateNumbers = new Random();
  12.  
  13. public Loteria(){
  14. Jugar instance = new Jugar();
  15. instance.start();
  16. }
  17.  
  18. // genera los tickets
  19. void generar_tickets(int eleccion){
  20.  
  21. System.out.println("\nPrinting tickets...");
  22. System.out.println("----------------------");
  23.  
  24. tickets = new int[59];
  25. yourTickets = new int[eleccion];
  26.  
  27.  
  28. // Generate list of numbers
  29. for(int i = 0; i < tickets.length; i++) {
  30. int numero;
  31. do{
  32.   numero = 1+generateNumbers.nextInt(60);
  33. }while(numeroRepetido(numero,tickets,i));
  34. tickets[i] = numero;
  35. }
  36. }
  37.  
  38. // genera nuestros numeros
  39. void generar_mistickets(){
  40. // Give him his tickets
  41. System.out.print("\nThese are your tickets: \t");
  42. for (int i = 0; i < yourTickets.length; i++) {
  43. int numero;
  44. do{
  45. numero = 1+generateNumbers.nextInt(60);
  46. }while(numeroRepetido(numero,yourTickets,i));
  47. yourTickets[i] = numero;
  48. if(i != yourTickets.length-1){
  49. System.out.print(yourTickets[i] + ", ");
  50. }
  51. else
  52. System.out.print(yourTickets[i]);
  53. }
  54.  
  55. } // fin metodo
  56.  
  57.  
  58. //determina si el valor de la bola ya ha sido sacado
  59. boolean numeroRepetido(int num, int[] numeros, int count)
  60. {
  61.  // num = bola, numeros = textfields de numeros, count = cuenta
  62.  for(int i=0; i<count; i++)
  63.  {
  64.    // si el numero q se ha sacado ya esta en algun textfield
  65.    if(numeros[i] == num)
  66.    {
  67.      return true; //devuelve true
  68.    }
  69.  }
  70.  return false;
  71. }
  72.  
  73. // compara nuestros numeros con los tickets y aumenta los aciertos
  74. void comparar(){
  75.  
  76. System.out.println("\n\nLet's if you won something... \n");
  77.  
  78. // Check if something matched
  79. for(int i = 0; i < yourTickets.length; i++) {
  80. for(int j = 0; j < tickets.length; j++) {
  81. if (yourTickets[i] == tickets[j]) {
  82. matched++;
  83. System.out.println(yourTickets[i]+ " = "+tickets[j]);
  84. }
  85. if(matched == 5){
  86. j=60;
  87. i=60;
  88.   }
  89.  
  90.  } // fin for interno
  91. } // fin for externo
  92.  
  93. // Make a pause
  94. try {
  95. Thread.sleep(3000);
  96. } catch(InterruptedException e) {
  97. }
  98. System.out.println("Matchs:\t"+matched);
  99. switch (matched) {
  100. case 1:
  101. System.out.println("You won $100!");
  102. break;
  103.  
  104. case 2:
  105. System.out.println("You won $200!");
  106. break;
  107.  
  108. case 3:
  109. System.out.println("You won $500!");
  110. break;
  111.  
  112. case 4:
  113. System.out.println("You won $800!");
  114. break;
  115.  
  116. case 5:
  117. System.out.println("GREAT. You've got the pot: $1000!");
  118. break;
  119.  
  120. case 0:
  121. System.out.println("Have luck next time!");
  122. break;
  123.  
  124. }
  125.  
  126. } // fin metodo
  127.  
  128. // pregunta si se desea jugar denuevo
  129. boolean jugar_denuevo() {
  130.  
  131. // Ask if he wants to try again
  132. matched = 0;
  133. System.out.println("Would you like to try again? (X to exit) \t");
  134. String tryAgain = keyboard.nextLine();
  135.  
  136. if(tryAgain.compareToIgnoreCase("x") == 0) {
  137. System.out.println("Thank you. Bye");
  138. System.exit(0);
  139. return false;
  140. }
  141. else {
  142. // Just clear screen
  143. for (int l = 0; l < 5; l++) {
  144. System.out.println();
  145.  }
  146. return true;
  147.  
  148.  }
  149. }// fin metodo
  150.  
  151. // este metodo nos indica si lo ingresado es un numero
  152. private static boolean isNumeric(String cadena){
  153.  try {
  154.    Integer.parseInt(cadena);
  155.    return true;
  156.  } catch (NumberFormatException nfe){
  157.    System.out.println("Ingrese solo numeros");
  158.    return false;
  159.   }
  160. }
  161.  
  162. // clase que empieza el juego mediante thread
  163. private class Jugar extends Thread{
  164.  
  165. private boolean continuar=true; //condicion del thread
  166.  
  167.  
  168. public void run()  { // incia el thread
  169. while(continuar) { // hace la tarea mientras continuar sea true
  170. boolean esNumero;
  171. do {
  172.  
  173. System.out.println("$$$$$$$ LOTTO $$$$$$$");
  174.                                        System.out.println("Hi, how many tickets would you like to buy?");
  175.                                        System.out.println(" [1] 1 Ticket");
  176.                                        System.out.println(" [2] 2 Tickets");
  177.                                        System.out.println(" [3] 3 Tickets");
  178.                                        System.out.println(" [4] 4 Tickets");
  179.                                        System.out.println(" [5] 5 Tickets");
  180.                                        System.out.println(" [0] In bankrupt - Nothing\n");
  181.                                        String choice2 = keyboard.nextLine();
  182.                                        esNumero = isNumeric(choice2);
  183.                                        if (esNumero == true){
  184.                                         choice = Integer.parseInt(choice2);
  185.                                        }
  186.  
  187. } while(esNumero==false || choice<0 || choice>5);
  188.  
  189.                                        if (choice == 0) {
  190.                                        System.out.println("EXITING...");
  191.                                        System.exit(0);
  192.                                      }
  193.  
  194.                                       generar_tickets(choice);
  195.                                       generar_mistickets();
  196.                                       comparar();
  197.                                       continuar = jugar_denuevo();
  198.  
  199.  
  200. }
  201. }
  202. }
  203.  
  204.  
  205.                       public static void main(String[] args) {
  206.                        new Loteria();
  207.                       }
  208.                   } // fin.
  209.  
« Última modificación: 28 Junio 2013, 16:50 pm por Darkgus » En línea

Linux User #560388
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
LOTERIA HELP!!
Java
kawasaki 3 4,730 Último mensaje 27 Diciembre 2008, 16:21 pm
por sapito169
“¡¡Me han tocado 800.000 € en el GordoLoto!!”Los falsos premios de la lotería...
Noticias
wolfbcn 0 1,456 Último mensaje 10 Marzo 2011, 12:54 pm
por wolfbcn
haber si es verdad que me a tocado la loteria
Foro Libre
sting time 4 4,277 Último mensaje 2 Octubre 2011, 00:59 am
por eat7herich
A los famosos también les toca la lotería
Noticias
wolfbcn 0 1,642 Último mensaje 14 Mayo 2012, 03:06 am
por wolfbcn
Programa Loteria « 1 2 »
Programación C/C++
mortaz 18 16,341 Último mensaje 20 Enero 2013, 20:59 pm
por flony
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines