
Ayuda, tengo un error y no se cual es
Publicado por martin (2 intervenciones) el 25/05/2015 18:01:25
Hola, estoy etudiando programacion... el "Juego" que estoy haciendo se trata de que tu pones tu cedula o nombre(lo que quieras), luego 5 numero tuyos (hasta el 48 inclusive) y cuando le das en jugar, te muestra 5 numeros diferentes. Luego tengo que comprar esos numeros que el usuario coloco y los numeros al azar del programa... y ahi ver si acerto o no.. pero no puedo hacer..
Aca le dejo el codigo
(PUSE EN EL ALERT PARFA VER SI RECONOCIA, PERO QUIERO SABER, MECOLOCA LA CEDLA QUE ELEJI, PERO NO LOS NUMEROS QUE YO ELEJI)
No se si entendieron :(
Aca le dejo el codigo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
var pozo=100000
var numeros= new Array();
var cedulas= new Array();
function Ingresar(){
pozo=pozo+35;
var cedula = $("#cedula").val();
var num1 = $("#numero1").val();
var num2 = $("#numero2").val();
var num3 = $("#numero3").val();
var num4 = $("#numero4").val();
var num5 = $("#numero5").val();
$("#cedula").val(" ");
$("#numero1").val(" ");
$("#numero2").val(" ");
$("#numero3").val(" ");
$("#numero4").val(" ");
$("#numero5").val(" ");
$("#cedula").focus();
numeros[numeros.length]=[num1,num2,num3,num4,num5];
cedulas[cedulas.length]=cedula;
$("#pozo").val(pozo);
}
function asd(){
alert(cedulas.toString());
alert(numeros.toString());
}
function ejecutar(){
var numplay= new Array();
var sorteados= new Array();
var num1= Math.round(Math.random()*(48-2));
var num2= Math.round(Math.random()*(48-2));
while (num1 == num2 ){
num2= Math.round(Math.random()*(48-2));
}
var num3= Math.round(Math.random()*(48-2));
while (num1 == num3 || num2 == num3){
num3= Math.round(Math.random()*(48-2));
}
var num4= Math.round(Math.random()*(48-2));
while (num1 == num4 || num2 == num4 || num3 == num4){
num4= Math.round(Math.random()*(48-2));
}
var num5= Math.round(Math.random()*(48-2));
while (num1 == num5 || num2 == num5 || num3 == num5 || num4 == num5) {
num5= Math.round(Math.random()*(48-2));
}
$("#numsorteado1").val(num1);
$("#numsorteado2").val(num2);
$("#numsorteado3").val(num3);
$("#numsorteado4").val(num4);
$("#numsorteado5").val(num5);
sorteados.push(num1+" ",num2+" ",num3+" ",num4+" ",num5+" ");
var Jugador = parseInt(numeros.length);
var numcinco = parseInt(Jugador * 5);
for(var y=0; y<=cedulas.length-1 ; y++){
for (var i=0; i<=Jugador ; i++){
numplay1= numeros[i+numcinco];
numplay += numplay1+" ";
}
alert(cedulas[y]+" "+numplay);
Jugador--
}
}
(PUSE EN EL ALERT PARFA VER SI RECONOCIA, PERO QUIERO SABER, MECOLOCA LA CEDLA QUE ELEJI, PERO NO LOS NUMEROS QUE YO ELEJI)
No se si entendieron :(
Valora esta pregunta


0