-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpareja.html
More file actions
146 lines (142 loc) · 2.49 KB
/
pareja.html
File metadata and controls
146 lines (142 loc) · 2.49 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="estilo.css">
<title>PAREJAS</title>
</head>
<body>
<h1>Parejas de JavaScript</h1>
<button id="boton">En parejar</button>
<div id="box">
<div class="impar">
<div>
<h1 id="num1"></h1>
<h1 id="n1"></h1>
</div>
<div>
<h1 id="num3"></h1>
<h1 id="n3"></h1>
</div>
<div>
<h1 id="num5"></h1>
<h1 id="n5"></h1>
</div>
<div>
<h1 id="num7"></h1>
<h1 id="n7"></h1>
</div>
<div>
<h1 id="num9"></h1>
<h1 id="n9"></h1>
</div>
<div>
<h1 id="num11"></h1>
<h1 id="n11"></h1>
</div>
<div>
<h1 id="num13"></h1>
<h1 id="n13"></h1>
</div>
</div>
<div class="par">
<div>
<h1 id="num2"></h1>
<h1 id="n2"></h1>
</div>
<div>
<h1 id="num4"></h1>
<h1 id="n4"></h1>
</div>
<div>
<h1 id="num6"></h1>
<h1 id="n6"></h1>
</div>
<div>
<h1 id="num8"></h1>
<h1 id="n8"></h1>
</div>
<div>
<h1 id="num10"></h1>
<h1 id="n10"></h1>
</div>
<div>
<h1 id="num12"></h1>
<h1 id="n12"></h1>
</div>
<div>
<h1 id="num14"></h1>
<h1 id="n14"></h1>
</div>
</div>
<div class="solo">
<div>
<h1 id="num15"></h1>
<h1 id="n15"></h1>
</div>
</div>
</div>
<script type="text/javascript" src="scrip.js"></script>
<script>
/*
var num;
var parreja = new Array(14);
var repetir = true;
alert("hola");
/*
var a = 4;
var b = 4;
if (a > b-1) {
alert("cono si");
}
*/
/*
do{
num = 1 + Math.round(Math.random()*14);
document.write(num+"<br>");
//alert(num);
} while (num < 15);
alert("listo");
for (var i = 0; i<=14; i++) {
//alert("FORRRRR...");
do {
//alert("entre");
repetir = false;
num = 1 + Math.round(Math.random()*14);
if (i >= 1) {
// alert("IFy "+i);
for (var c = 0 ; c<=i-1; c++) {
//alert("for y i es "+i+" num es "+num+" c es "+c);
if (parreja[c] == num) {
// alert("VOY POR AQUI NUM es "+num);
repetir = true;
}
}
}
//alert(repetir);
} while (repetir === true);
//alert("num es"+num+" i es "+i);
parreja[i] = num;
/*
if( i == 14){
alert("wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww.....");
break;// es para salir del ciclo
}
*/
/*
//alert(parreja[i]);
//alert("aqui");
}
alert("si");
alert(parreja[14]);
for (var i = 0; i <= 14 ; i++) {
var a = i++;
if (i<=13) {
document.write("numero "+parreja[i]+" con el numero "+parreja[a]+"<br>");
} else {
document.write("numero quedo solo "+parreja[a]);
}
}
*/
</script>
</body>
</html>