Solved

round robin team schedule

Posted on 2012-03-22
822 Views
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.
0
Question by:Scott Fell,  EE MVE

LVL 35

Accepted Solution

Robert Schutt earned 500 total points
ID: 37756043
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

LVL 52

Author Closing Comment

ID: 37756105
Thanks!  2nd eyes always seem to work.
0

Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.