用ASP编写的“俄罗斯方块游戏”

1If Not Request.QueryString("Ven") = "T" then
 1<html>
 2<head>
 3<meta content="Microsoft Visual Studio 6.0" name="GENERATOR"/>
 4<title></title>
 5</head>
 6<script language="vbscript">   
 7function Redir()   
 8window.open "```
 9= right(Request.ServerVariables("SCRIPT_NAME"),len(Request.ServerVariables("SCRIPT_NAME"))-instrrev(Request.ServerVariables("SCRIPT_NAME"),"/",len(Request.ServerVariables("SCRIPT_NAME"))))
10```?Ven=T","user","status=no,toolbar=no,menubar=no,height=456,width=304,top=100,left=100,scrollbars=no"   
11window.history.back(-1)   
12End function   
13</script>
14<body onload="Redir()">
15</body>
16</html>
1else
  1<html>
  2<head>
  3<meta content="Microsoft Visual Studio 6.0" name="GENERATOR"/>
  4<title>**VBScript俄罗斯方块游戏**</title>
  5<style type="text/css">   
  6<!--   
  7.normalHI{font-family:verdana,helvetica,arial,sans serif;color:#FFCC00;font-size:10pt;font-weight:bold;Cursor:hand;}   
  8.normalH{font-family:verdana,helvetica,arial,sans serif;color:#000000;font-size:10pt;font-weight:bold;Cursor:hand;}   
  9.normalG{font-family:verdana,helvetica,arial,sans serif;color:#000000;font-size:13pt;font-weight:bold;}   
 10.normal{font-family:verdana,helvetica,arial,sans serif;color:#000000;font-size:10pt;font-weight:bold;}   
 11.normalD{font-family:verdana,helvetica,arial,sans serif;color:#000000;font-size:10pt;font-weight:bold;}   
 12.normalI{font-family:verdana,helvetica,arial,sans serif;color:#00FF00;font-size:10pt;font-weight:bold;}   
 13.normalO{font-family:verdana,helvetica,arial,sans serif;color:#FFFF00;font-size:10pt;font-weight:bold;}   
 14\-->   
 15</style>
 16</head>
 17<body leftmargin="2" topmargin="2">
 18<div align="center">
 19<center>
 20<table border="0" cellpadding="0" cellspacing="0" width="300"><tr><td width="200">
 21<center>
 22<table bgcolor="#000000" border="1" bordercolor="#000000" cellpadding="0" cellspacing="0">
 23<tr height="18">
 24<td id="240" width="18"></td><td id="241" width="18"></td><td id="242" width="18"></td><td id="243" width="18"></td><td id="244" width="18"></td>
 25<td id="245" width="18"></td><td id="246" width="18"></td><td id="247" width="18"></td><td id="248" width="18"></td><td id="249" width="18"></td>
 26</tr>
 27<tr height="18">
 28<td id="230" width="18"></td><td id="231" width="18"></td><td id="232" width="18"></td><td id="233" width="18"></td><td id="234" width="18"></td>
 29<td id="235" width="18"></td><td id="236" width="18"></td><td id="237" width="18"></td><td id="238" width="18"></td><td id="239" width="18"></td>
 30</tr>
 31<tr height="18">
 32<td id="220" width="18"></td><td id="221" width="18"></td><td id="222" width="18"></td><td id="223" width="18"></td><td id="224" width="18"></td>
 33<td id="225" width="18"></td><td id="226" width="18"></td><td id="227" width="18"></td><td id="228" width="18"></td><td id="229" width="18"></td>
 34</tr>
 35<tr height="18">
 36<td id="210" width="18"></td><td id="211" width="18"></td><td id="212" width="18"></td><td id="213" width="18"></td><td id="214" width="18"></td>
 37<td id="215" width="18"></td><td id="216" width="18"></td><td id="217" width="18"></td><td id="218" width="18"></td><td id="219" width="18"></td>
 38</tr>
 39<tr height="18">
 40<td id="200" width="18"></td><td id="201" width="18"></td><td id="202" width="18"></td><td id="203" width="18"></td><td id="204" width="18"></td>
 41<td id="205" width="18"></td><td id="206" width="18"></td><td id="207" width="18"></td><td id="208" width="18"></td><td id="209" width="18"></td>
 42</tr>
 43<tr height="18">
 44<td id="190" width="18"></td><td id="191" width="18"></td><td id="192" width="18"></td><td id="193" width="18"></td><td id="194" width="18"></td>
 45<td id="195" width="18"></td><td id="196" width="18"></td><td id="197" width="18"></td><td id="198" width="18"></td><td id="199" width="18"></td>
 46</tr>
 47<tr height="18">
 48<td id="180" width="18"></td><td id="181" width="18"></td><td id="182" width="18"></td><td id="183" width="18"></td><td id="184" width="18"></td>
 49<td id="185" width="18"></td><td id="186" width="18"></td><td id="187" width="18"></td><td id="188" width="18"></td><td id="189" width="18"></td>
 50</tr>
 51<tr height="18">
 52<td id="170" width="18"></td><td id="171" width="18"></td><td id="172" width="18"></td><td id="173" width="18"></td><td id="174" width="18"></td>
 53<td id="175" width="18"></td><td id="176" width="18"></td><td id="177" width="18"></td><td id="178" width="18"></td><td id="179" width="18"></td>
 54</tr>
 55<tr height="18">
 56<td id="160" width="18"></td><td id="161" width="18"></td><td id="162" width="18"></td><td id="163" width="18"></td><td id="164" width="18"></td>
 57<td id="165" width="18"></td><td id="166" width="18"></td><td id="167" width="18"></td><td id="168" width="18"></td><td id="169" width="18"></td>
 58</tr>
 59<tr height="18">
 60<td id="150" width="18"></td><td id="151" width="18"></td><td id="152" width="18"></td><td id="153" width="18"></td><td id="154" width="18"></td>
 61<td id="155" width="18"></td><td id="156" width="18"></td><td id="157" width="18"></td><td id="158" width="18"></td><td id="159" width="18"></td>
 62</tr>
 63<tr height="18">
 64<td id="140" width="18"></td><td id="141" width="18"></td><td id="142" width="18"></td><td id="143" width="18"></td><td id="144" width="18"></td>
 65<td id="145" width="18"></td><td id="146" width="18"></td><td id="147" width="18"></td><td id="148" width="18"></td><td id="149" width="18"></td>
 66</tr>
 67<tr height="18">
 68<td id="130" width="18"></td><td id="131" width="18"></td><td id="132" width="18"></td><td id="133" width="18"></td><td id="134" width="18"></td>
 69<td id="135" width="18"></td><td id="136" width="18"></td><td id="137" width="18"></td><td id="138" width="18"></td><td id="139" width="18"></td>
 70</tr>
 71<tr height="18">
 72<td id="120" width="18"></td><td id="121" width="18"></td><td id="122" width="18"></td><td id="123" width="18"></td><td id="124" width="18"></td>
 73<td id="125" width="18"></td><td id="126" width="18"></td><td id="127" width="18"></td><td id="128" width="18"></td><td id="129" width="18"></td>
 74</tr>
 75<tr height="18">
 76<td id="110" width="18"></td><td id="111" width="18"></td><td id="112" width="18"></td><td id="113" width="18"></td><td id="114" width="18"></td>
 77<td id="115" width="18"></td><td id="116" width="18"></td><td id="117" width="18"></td><td id="118" width="18"></td><td id="119" width="18"></td>
 78</tr>
 79<tr height="18">
 80<td id="100" width="18"></td><td id="101" width="18"></td><td id="102" width="18"></td><td id="103" width="18"></td><td id="104" width="18"></td>
 81<td id="105" width="18"></td><td id="106" width="18"></td><td id="107" width="18"></td><td id="108" width="18"></td><td id="109" width="18"></td>
 82</tr>
 83<tr height="18">
 84<td id="90" width="18"></td><td id="91" width="18"></td><td id="92" width="18"></td><td id="93" width="18"></td><td id="94" width="18"></td>
 85<td id="95" width="18"></td><td id="96" width="18"></td><td id="97" width="18"></td><td id="98" width="18"></td><td id="99" width="18"></td>
 86</tr>
 87<tr height="18">
 88<td id="80" width="18"></td><td id="81" width="18"></td><td id="82" width="18"></td><td id="83" width="18"></td><td id="84" width="18"></td>
 89<td id="85" width="18"></td><td id="86" width="18"></td><td id="87" width="18"></td><td id="88" width="18"></td><td id="89" width="18"></td>
 90</tr>
 91<tr height="18">
 92<td id="70" width="18"></td><td id="71" width="18"></td><td id="72" width="18"></td><td id="73" width="18"></td><td id="74" width="18"></td>
 93<td id="75" width="18"></td><td id="76" width="18"></td><td id="77" width="18"></td><td id="78" width="18"></td><td id="79" width="18"></td>
 94</tr>
 95<tr height="18">
 96<td id="60" width="18"></td><td id="61" width="18"></td><td id="62" width="18"></td><td id="63" width="18"></td><td id="64" width="18"></td>
 97<td id="65" width="18"></td><td id="66" width="18"></td><td id="67" width="18"></td><td id="68" width="18"></td><td id="69" width="18"></td>
 98</tr>
 99<tr height="18">
100<td id="50" width="18"></td><td id="51" width="18"></td><td id="52" width="18"></td><td id="53" width="18"></td><td id="54" width="18"></td>
101<td id="55" width="18"></td><td id="56" width="18"></td><td id="57" width="18"></td><td id="58" width="18"></td><td id="59" width="18"></td>
102</tr>
103<tr height="18">
104<td id="40" width="18"></td><td id="41" width="18"></td><td id="42" width="18"></td><td id="43" width="18"></td><td id="44" width="18"></td>
105<td id="45" width="18"></td><td id="46" width="18"></td><td id="47" width="18"></td><td id="48" width="18"></td><td id="49" width="18"></td>
106</tr>
107<tr height="18">
108<td id="30" width="18"></td><td id="31" width="18"></td><td id="32" width="18"></td><td id="33" width="18"></td><td id="34" width="18"></td>
109<td id="35" width="18"></td><td id="36" width="18"></td><td id="37" width="18"></td><td id="38" width="18"></td><td id="39" width="18"></td>
110</tr>
111<tr height="18">
112<td id="20" width="18"></td><td id="21" width="18"></td><td id="22" width="18"></td><td id="23" width="18"></td><td id="24" width="18"></td>
113<td id="25" width="18"></td><td id="26" width="18"></td><td id="27" width="18"></td><td id="28" width="18"></td><td id="29" width="18"></td>
114</tr>
115<tr height="18">
116<td id="10" width="18"></td><td id="11" width="18"></td><td id="12" width="18"></td><td id="13" width="18"></td><td id="14" width="18"></td>
117<td id="15" width="18"></td><td id="16" width="18"></td><td id="17" width="18"></td><td id="18" width="18"></td><td id="19" width="18"></td>
118</tr>
119<tr height="18">
120<td id="0" width="18"></td><td id="1" width="18"></td><td id="2" width="18"></td><td id="3" width="18"></td><td id="4" width="18"></td>
121<td id="5" width="18"></td><td id="6" width="18"></td><td id="7" width="18"></td><td id="8" width="18"></td><td id="9" width="18"></td>
122</tr>
123</table>
124</center>
125</td>
126<td width="100">
127<table border="1" bordercolor="#000000" cellpadding="0" cellspacing="0" height="452" width="100">
128<tr height="30">
129<td align="center" bgcolor="#FFFF00" class="normalG">俄罗斯方块</td>
130</tr>
131<tr height="20">
132<td align="center" bgcolor="#FFCC00" class="normalD">提示区</td>
133</tr>
134<tr height="100">
135<td bgcolor="#FFCC00">
136<!-- Inicio Preview -->
137<div align="center"><center><table bgcolor="#000000" border="1" cellpadding="0" cellspacing="0">
138<tr height="18">
139<td id="P0" width="18"></td><td id="P1" width="18"></td><td id="P2" width="18"></td><td id="P3" width="18"></td>
140</tr>
141<tr height="18">
142<td id="P4" width="18"></td><td id="P5" width="18"></td><td id="P6" width="18"></td><td id="P7" width="18"></td>
143</tr>
144<tr height="18">
145<td id="P8" width="18"></td><td id="P9" width="18"></td><td id="P10" width="18"></td><td id="P11" width="18"></td>
146</tr>
147</table></center></div>
148<!-- Fin Preview -->
149</td>
150</tr>
151<tr height="32">
152<td align="center" bgcolor="#009900" class="normalh" id="Sco01" onmouseout="Mmove(“O“)" onmouseover="Mmove(“I“)">得分</td>
153</tr>
154<tr height="32">
155<td align="center" bgcolor="#FFFF00" class="normalh" id="Sco02">0</td>
156</tr>
157<tr height="32">
158<td align="center" bgcolor="#009900" class="normal" id="In01" onmouseout="Mmove(“O“)" onmouseover="Mmove(“I“)">水平</td>
159</tr>
160<tr height="32">
161<td align="center" bgcolor="#FFFF00" class="normal" id="In02">1</td>
162</tr>
163<tr height="32">
164<td align="center" bgcolor="#009900" class="normalh" id="In05" onmouseout="Mmove(“O“)" onmouseover="Mmove(“I“)">块</td>
165</tr>
166<tr height="32">
167<td align="center" bgcolor="#FFFF00" class="normalh" id="In06">1</td>
168</tr>
169<tr height="32">
170<td align="center" bgcolor="#009900" class="normalh" id="In03" onclick="Iniciar(“i“)" onmouseout="Mmove(“O“)" onmouseover="Mmove(“I“)">开始</td>
171</tr>
172<tr height="32">
173<td align="center" bgcolor="#009900" class="normalh" id="In04" onclick="Iniciar(“d“)" onmouseout="Mmove(“O“)" onmouseover="Mmove(“I“)">结束</td>
174</tr>
175<tr height="38">
176<td align="center" bgcolor="#009900" class="normalh" id="In09" onclick="self.close()" onmouseout="Mmove(“O“)" onmouseover="Mmove(“I“)">关闭窗口</td>
177</tr>
178</table>
179</td></tr></table></center></div>
180</body>
181<script language="vbscript">   
182Dim Timer1,HastIni,LevlIni,Namn,Score,Levl,Hast,Fig,Fig2,Farg,Farg2,X,Y,Rot,Rot2,tratt,Pausa,ScrPau,Pos,GOver   
183Dim hs(),sor(),hsant(),n(),s(),s2(),s3()   
184redim hs(3, 15, 2):redim sor(3, 15):redim hsant(3):redim n(10, 25):redim s(5, 4):redim s2(4, 4):redim s3(4, 4)   
185LevlIni = 1   
186Pausa = False   
187HastIni = VelLevel(LevlIni)   
188Hast = HastIni   
189Levl = LevlIni   
190Pos = Levl - 1   
191ColorForm   
192GOver = false   
193function Iniciar(ind)   
194if ind = "i" then   
195score = 0   
196GOver = false   
197Hast = HastIni   
198Levl = LevlIni   
199Pos = PosLevel(Levl)   
200For i = 1 To 4:For i2 = 1 To 4:s2(i, i2) = False:Next:Next   
201For i = 1 To 10:For i2 = 1 To 25:n(i, i2) = False:Next:Next   
202Timer1 = window.setInterval("Andar()",Hast)   
203ColorForm   
204Fig2 = 0   
205Nyfig   
206else   
207window.clearInterval Timer1   
208end if   
209end function   
210Sub Nyfig()   
211Pos = Pos + 1   
212document.all("In06").innertext = Pos   
213Select Case Pos   
214Case 30: Levl = 2: Hast = VelLevel(Levl): window.In02.innerText = Levl   
215Case 60: Levl = 3: Hast = VelLevel(Levl): window.In02.innerText = Levl   
216Case 90: Levl = 4: Hast = VelLevel(Levl): window.In02.innerText = Levl   
217Case 120: Levl = 5: Hast = VelLevel(Levl): window.In02.innerText = Levl   
218Case 150: Levl = 6: Hast = VelLevel(Levl): window.In02.innerText = Levl   
219Case 180: Levl = 7: Hast = VelLevel(Levl): window.In02.innerText = Levl   
220Case 210: Levl = 8: Hast = VelLevel(Levl): window.In02.innerText = Levl   
221Case 240: Levl = 9: Hast = VelLevel(Levl): window.In02.innerText = Levl   
222Case 270: Levl = 10: Hast = VelLevel(Levl): window.In02.innerText = Levl   
223Case 300: Levl = 11: Hast = VelLevel(Levl): window.In02.innerText = Levl   
224End Select   
225window.clearInterval Timer1   
226Timer1 = window.setInterval("Andar()",Hast)   
227Fig = Fig2   
228Farg = Farg2   
229Fig2 = Int(Rnd * 7) + 1   
230X = 4   
231Y = 26   
232Rot = 1   
233For i = 1 To 4:For i2 = 1 To 4:s(i, i2) = s2(i, i2):s2(i, i2) = 0:Next:Next   
234Select Case Fig2   
235Case 1:s2(2, 2) = True:s2(3, 2) = True:s2(2, 3) = True:s2(3, 3) = True:Farg2 = "#FF0000"   
236Case 2:s2(1, 2) = True:s2(2, 2) = True:s2(3, 2) = True:s2(4, 2) = True:Farg2 = "#33CC33"   
237Case 3:s2(2, 1) = True:s2(3, 1) = True:s2(3, 2) = True:s2(3, 3) = True:Farg2 = "#FF9900"   
238Case 4:s2(3, 1) = True:s2(2, 1) = True:s2(2, 2) = True:s2(2, 3) = True:Farg2 = "#666666"   
239Case 5:s2(3, 1) = True:s2(3, 2) = True:s2(3, 3) = True:s2(2, 2) = True:Farg2 = "#CC00CC"   
240Case 6:s2(2, 1) = True:s2(2, 2) = True:s2(3, 2) = True:s2(3, 3) = True:Farg2 = "#6666FF"   
241Case 7:s2(3, 1) = True:s2(3, 2) = True:s2(2, 2) = True:s2(2, 3) = True:Farg2 = "#33CCCC"   
242End Select   
243For i = 1 To 4   
244For i2 = 1 To 3   
245document.all("P" & cstr(((i2 - 1) * 4 + i - 1))).bgcolor = "#000000"   
246If s2(i, i2) = True Then   
247document.all("P" & cstr((i2 - 1) * 4 + i - 1)).bgcolor = Farg2   
248End If   
249Next   
250Next   
251End Sub   
252Function PosLevel(Lev)   
253Select Case Lev   
254Case 1: PosLevel = 1   
255Case 2: PosLevel = 51   
256Case 3: PosLevel = 81   
257Case 4: PosLevel = 111   
258Case 5: PosLevel = 141   
259Case 6: PosLevel = 181   
260Case 7: PosLevel = 221   
261Case 8: PosLevel = 261   
262Case 9: PosLevel = 301   
263Case 10: PosLevel = 341   
264End Select   
265End Function   
266“いいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいい   
267Function VelLevel(Velo)   
268Select Case Velo   
269Case 1: VelLevel = 500   
270Case 2: VelLevel = 450   
271Case 3: VelLevel = 400   
272Case 4: VelLevel = 350   
273Case 5: VelLevel = 300   
274Case 6: VelLevel = 250   
275Case 7: VelLevel = 200   
276Case 8: VelLevel = 150   
277Case 9: VelLevel = 100   
278Case 10: VelLevel = 50   
279Case 11: VelLevel = 10   
280End Select   
281End Function   
282Sub ColorForm()   
283For i = 0 To 11:document.all("P" & cstr(i)).bgcolor = "#000000":Next   
284For i = 0 To 249:document.all(cstr(i)).bgcolor = "#000000":Next   
285End Sub   
286function Andar()   
287For i = 1 To 4   
288For i2 = 1 To 4   
289If s(i, i2) = True And Y - i2 + 1 = 1 Then Fig = 0   
290If Y - i2 > 0 And X + i - 1 > 0 And X + i - 1 < 11 Then   
291If s(i, i2) = True And n(X + i - 1, Y - i2) = True Then Fig = 0   
292End If   
293Next   
294Next   
295If Fig = 0 Then   
296For i = 1 To 4   
297For i2 = 1 To 4   
298If s(i, i2) = True Then n(X + i - 1, Y - i2 + 1) = True   
299Next   
300Next   
301Ner   
302Nyfig   
303Else   
304For i = 1 To 4   
305For i2 = 1 To 4   
306If s(i, i2) = True And s(i, i2 - 1) = False Then   
307document.all(cstr(coor(X + i - 1, Y - i2 + 1))).bgcolor = "#000000"   
308End If   
309Next   
310Next   
311End If   
312Y = Y - 1   
313For i = 1 To 4   
314For i2 = 1 To 4   
315If s(i, i2) = True Then   
316if not gover = true then   
317If ucase(document.all(cstr(coor(X + i - 1, Y - i2 + 1))).bgcolor) <> "#000000" And ucase(document.all(cstr(coor(X + i - 1, Y - i2 + 1))).bgcolor) <> Farg Then   
318Gameover   
319end if   
320end if   
321End If   
322If s(i, i2) = True Then   
323document.all(cstr(coor(X + i - 1, Y - i2 + 1))).bgcolor = Farg   
324End If   
325Next   
326Next   
327end function   
328Sub Gameover()   
329MsgBox "游戏结束!", , "俄罗斯方块"   
330window.clearInterval Timer1   
331GOver = true   
332End Sub   
333Sub Ner()   
334Score = Score + 10   
335document.all("Sco02").innertext = Score   
336For i2 = 25 To 1 Step -1   
337ok = 1   
338For i = 1 To 10   
339If n(i, i2) = False Then ok = 0   
340Next   
341If ok = 1 Then   
342Score = Score + 150   
343document.all("Sco02").innertext = Score   
344For i = 1 To 10   
345For i3 = i2 To 24   
346n(i, i3) = n(i, i3 + 1)   
347document.all(cstr(coor(i, i3))).bgcolor = document.all(cstr(coor(i, i3 + 1))).bgcolor   
348Next   
349Next   
350End If   
351Next   
352End Sub   
353Function coor(xx, yy)   
354coor = (yy - 1) * 10 + xx - 1   
355End Function   
356Sub Rota()   
357Rot2 = Rot + 1   
358If Rot2 = 5 Then Rot2 = 1   
359If (Fig = 2 Or Fig > 5) And Rot2 = 3 Then Rot2 = 1   
360For i = 1 To 4   
361For i2 = 1 To 4   
362s3(i, i2) = 0   
363Next   
364Next   
365Select Case Fig   
366Case 2   
367Select Case Rot2   
368Case 1:s3(1, 2) = True:s3(2, 2) = True:s3(3, 2) = True:s3(4, 2) = True   
369Case 2:s3(2, 1) = True:s3(2, 2) = True:s3(2, 3) = True:s3(2, 4) = True   
370End Select   
371Case 3   
372Select Case Rot2   
373Case 1:s3(2, 1) = True:s3(3, 1) = True:s3(3, 2) = True:s3(3, 3) = True   
374Case 2:s3(4, 1) = True:s3(4, 2) = True:s3(3, 2) = True:s3(2, 2) = True   
375Case 3:s3(3, 3) = True:s3(2, 3) = True:s3(2, 2) = True:s3(2, 1) = True   
376Case 4:s3(2, 2) = True:s3(2, 1) = True:s3(3, 1) = True:s3(4, 1) = True   
377End Select   
378Case 4   
379Select Case Rot2   
380Case 1:s3(3, 1) = True:s3(2, 1) = True:s3(2, 2) = True:s3(2, 3) = True   
381Case 2:s3(2, 1) = True:s3(3, 1) = True:s3(4, 1) = True:s3(4, 2) = True   
382Case 3:s3(3, 1) = True:s3(3, 2) = True:s3(3, 3) = True:s3(2, 3) = True   
383Case 4:s3(2, 1) = True:s3(2, 2) = True:s3(3, 2) = True:s3(4, 2) = True   
384End Select   
385Case 5   
386Select Case Rot2   
387Case 1:s3(3, 1) = True:s3(3, 2) = True:s3(3, 3) = True:s3(2, 2) = True   
388Case 2:s3(3, 1) = True:s3(2, 2) = True:s3(3, 2) = True:s3(4, 2) = True   
389Case 3:s3(2, 1) = True:s3(2, 2) = True:s3(2, 3) = True:s3(3, 2) = True   
390Case 4:s3(2, 1) = True:s3(3, 1) = True:s3(4, 1) = True:s3(3, 2) = True   
391End Select   
392Case 6   
393Select Case Rot2   
394Case 1:s3(2, 1) = True:s3(2, 2) = True:s3(3, 2) = True:s3(3, 3) = True   
395Case 2:s3(2, 2) = True:s3(3, 2) = True:s3(3, 1) = True:s3(4, 1) = True   
396End Select   
397Case 7   
398Select Case Rot2   
399Case 1:s3(3, 1) = True:s3(3, 2) = True:s3(2, 2) = True:s3(2, 3) = True   
400Case 2:s3(2, 1) = True:s3(3, 1) = True:s3(3, 2) = True:s3(4, 2) = True   
401End Select   
402End Select   
403ok = 1   
404For i = 1 To 4   
405For i2 = 1 To 4   
406If s3(i, i2) = True Then   
407If X + i - 1 < 1 Or X + i - 1 > 10 Or Y - i2 + 1 < 1 Then ok = 0   
408If ok = 1 Then   
409If n(X + i - 1, Y - i2 + 1) = True Then ok = 0   
410End If   
411End If   
412Next   
413Next   
414If ok = 0 Then Exit Sub   
415Rot = Rot2   
416For i = 1 To 4   
417For i2 = 1 To 4   
418If s3(i, i2) = True And s(i, i2) = False Then   
419document.all(cstr(coor(X + i - 1, Y - i2 + 1))).bgcolor = Farg   
420End If   
421If s3(i, i2) = False And s(i, i2) = True Then   
422document.all(cstr(coor(X + i - 1, Y - i2 + 1))).bgcolor = "#000000"   
423End If   
424s(i, i2) = s3(i, i2)   
425Next   
426Next   
427End Sub   
428Sub document_onkeydown   
429If window.event.keyCode = 27 Then msgbox "Pause",,"TET"   
430If window.event.keyCode = 80 Or window.event.keyCode = 114 Then iniciar("d")   
431If window.event.keyCode = 113 Then iniciar("i")   
432If Not Pausa = True Then   
433If window.event.keyCode = 38 And Fig > 1 Then Rota   
434If window.event.keyCode = 37 Then   
435ok = 1   
436For i = 1 To 4   
437For i2 = 1 To 4   
438If s(i, i2) = True And X + i - 1 - 1 > 0 Then   
439If n(X + i - 1 - 1, Y - i2 + 1) = True Then ok = 0   
440End If   
441If s(i, i2) = True And X + i - 1 - 1 < 1 Then ok = 0   
442Next   
443Next   
444If ok = 1 Then   
445X = X - 1   
446For i = 1 To 4   
447For i2 = 1 To 4   
448If s(i, i2) = True Then   
449If s(i + 1, i2) = False Then   
450document.all(cstr(coor(X + i, Y - i2 + 1))).bgcolor = "#000000"   
451End If   
452End If   
453If s(i, i2) = True Then   
454document.all(cstr(coor(X + i - 1, Y - i2 + 1))).bgcolor = Farg   
455End If   
456Next   
457Next   
458End If   
459End If   
460If window.event.keyCode = 39 Then   
461ok = 1   
462For i = 1 To 4   
463For i2 = 1 To 4   
464If s(i, i2) = True And X + i - 1 + 1 < 11 Then   
465If n(X + i - 1 + 1, Y - i2 + 1) = True Then ok = 0   
466End If   
467If s(i, i2) = True And X + i - 1 + 1 > 10 Then ok = 0   
468Next   
469Next   
470If ok = 1 Then   
471X = X + 1   
472For i = 1 To 4   
473For i2 = 1 To 4   
474If s(i, i2) = True Then   
475If s(i - 1, i2) = False Then   
476document.all(cstr(coor(X + i - 2, Y - i2 + 1))).bgcolor = "#000000"   
477End If   
478End If   
479If s(i, i2) = True Then   
480document.all(cstr(coor(X + i - 1, Y - i2 + 1))).bgcolor = Farg   
481End If   
482Next   
483Next   
484End If   
485End If   
486“Aqui   
487If window.event.keyCode = 32 Or window.event.keyCode = 40 Then   
488If Fig > 0 Then   
489For i = 1 To 4   
490For i2 = 1 To 4   
491If s(i, i2) = True Then   
492document.all(cstr(coor(X + i - 1, Y - i2 + 1))).bgcolor = "#000000"   
493End If   
494Next   
495Next   
496Do   
497Y = Y - 1   
498For i = 1 To 4   
499For i2 = 1 To 4   
500If s(i, i2) = True And Y - i2 + 1 = 1 Then Fig = 0   
501If Y - i2 > 0 And X + i - 1 > 0 And X + i - 1 < 11 Then   
502If s(i, i2) = True And n(X + i - 1, Y - i2) = True Then Fig = 0   
503End If   
504Next   
505Next   
506Loop Until Fig = 0   
507For i = 1 To 4   
508For i2 = 1 To 4   
509If s(i, i2) = True Then   
510document.all(cstr(coor(X + i - 1, Y - i2 + 1))).bgcolor = Farg   
511End If   
512If s(i, i2) = True Then n(X + i - 1, Y - i2 + 1) = True   
513Next   
514Next   
515End If   
516End If   
517End If   
518End Sub   
519function Mmove(Index)   
520if index = "I" then   
521document.all(Window.Event.SrcElement.sourceindex).classname = "normalHI"   
522document.all(Window.Event.SrcElement.sourceindex).bgcolor = "#0099CC"   
523else   
524document.all(Window.Event.SrcElement.sourceindex).classname = "normalH"   
525document.all(Window.Event.SrcElement.sourceindex).bgcolor = "#009900"   
526end if   
527end function   
528</script>
529</html>
1End If

原作者: Anton Gustavsson 、 Marcus Mason

相关信息资料

文档大小:
21975字
演示地址: http://www.hontosolid.net/example/game/tet.asp

Published At
Categories with Web编程
Tagged with
comments powered by Disqus