# round robin team schedule

I have tried to convert this to classic asp vbscript http://www.devenezia.com/javascript/article.php/RoundRobin2.html and missing something.

Below is what I have an it not coming out like the sample data. I'm sure it is the math.

``````<%
response.Write("<br>")
n=11
if n mod 2 <> 0 then
oddteam= 1
else
oddteam =0
end if
for r = 1 to 8 'n
response.write "<tr>"
response.write "<td><b>"&r&"</b></td>"
for i = 1 to (n)/2
if i=1 then
response.write "<td>1,"& (( n-1+r+1) mod (n-1)+2)  &"</td>"
else
response.write "<td>"& (( r + i + 2) mod (n-1)+2)  &","& ((n-1+r+1) mod (n-1) +2)  & "</td>"

end if
next
response.Write "</tr>"
next
response.write "</table>"
%>
``````

I would prefer an asp version but would accept an ms sql optioin.
LVL 56
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Software EngineerCommented:
There were some copying errors like +/- and 1 instead of i, here is the corrected part:

``````for r = 1 to n-1
response.write "<tr>"
response.write "<td><b>"&r&"</b></td>"
for i = 1 to (n)/2
if i=1 then
response.write "<td>1,"& (( n-1+r-1) mod (n-1) + 2)  &"</td>"
else
response.write "<td>"& (( r + i - 2) mod (n-1) + 2)  &","& ((n-1+r-i) mod (n-1) + 2)  & "</td>"
end if
next
response.Write "</tr>"
next
``````
0

Experts Exchange Solution brought to you by