
28/09/2012, 11:36
|
 | | | Fecha de Ingreso: mayo-2012 Ubicación: México D.F.
Mensajes: 59
Antigüedad: 12 años, 9 meses Puntos: 19 | |
Respuesta: Error en el Juego Gato Entonces es limit+1 el problema, según el api de java tenemos que:
nextInt(int n):
Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.
lo que significa que haces nextInt(10) ya que limit+1 = 10, y nextInt te devuelve un número entre 0 - 9, cuando te devuelve el 0 no entra a ningun case y nunca sale del while. |