d = array("国际米兰","尤文图斯","罗马","拉齐奥","切沃","博洛尼亚","锡耶纳","卡利亚里","布雷西亚","AC米兰","乌迪内斯")
L = Ubound(d)
If L mod 2 = 0 Then '单数补双
ReDim Preserve d(L+1)
d(L+1) = ""
L = L + 1
End If
LoopNum = Cint(Request("Loop")) - 1 '轮次-1
If LoopNum < 0 Or Not IsNumeric(LoopNum) Then LoopNum = 0
Function GetVs(Index,n) '根据index和轮次获取对于此index的d中元素在对应轮次的对阵对手
GetVs = ""
Dim i
i = L - n - Index + 1
If i < 0 Then i = L + i
GetVs = i
If i = Index - 1 Then GetVs = L
If Index = L + 1 And n > 0 Then
Redim Temp1((L - 1) / 2 - 1)
Redim Temp2((L - 1) / 2 - 1)
Redim Temp3(L - 1)
For i = 1 To (L - 1) / 2
Temp1(i - 1) = 9 - i
Next
For i = (L - 1) / 2 + 1 To L - 1
Temp2(i - ((L - 1) / 2 + 1)) = 9 - i
Next
Dim i1,i2
i1 = 0
i2 = 0
For i = 0 to n - 1
If i Mod 2 <> 0 And i <> 0 Then
Temp3(i) = Temp1(i1)
i1 = i1 + 1
Else
Temp3(i) = Temp2(i2)
i2 = i2 + 1
End If
Next
'for each a in temp3
'response.write n & " "
'next
'response.end
GetVs = Temp3(n-1)
End If
End Function
'Response.write GetVs(10,LoopNum)
'response.end
If Request("d") = "" Or Not IsNumeric(Request("d")) Then
dIndex = L + 1
Else
dIndex = Cint(Request("d"))
End If
response.write "
参加比赛的队伍有:"
for i = 0 to L
response.write d(i)
if i <> L Then
If d(i + 1) <> "" then response.write ","
End If
next
response.write "
选择查看 "
response.write " 在"
response.write " 的对阵情况 "
response.write "
第 [ " & LoopNum + 1 & " ] 轮的比赛"
If dIndex > L Then
response.write " [ 所有球队 ] "
Else
response.write " [ " & d(dIndex) & " ] "
End If
response.write "的对阵安排如下
"
dim Temp()
redim temp(L)
for i = 0 to L
temp(i) = "NoneMatch"
Next
If dIndex > L Then
for i = 0 to L
If temp(i) = "NoneMatch" Then
Vs = d(GetVs(i+1,LoopNum))
If Vs = "" Then
response.write "
" & d(i) & " [ 本轮轮空 ]
"
Else
response.write "
" & d(i) & " VS " & Vs & "
"
End If
temp(GetVs(i+1,LoopNum)) = i
End If
next
Else
Vs = d(GetVs(dIndex+1,LoopNum))
If Vs <> "" Then
response.write "