Solved

round robin team schedule

Posted on 2012-03-22
2
822 Views
Last Modified: 2012-03-23
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>")
response.write "<table  cellpadding=""10"">"
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>"
%>

Open in new window


I would prefer an asp version but would accept an ms sql optioin.
0
Comment
Question by:Scott Fell,  EE MVE
2 Comments
 
LVL 35

Accepted Solution

by:
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

Open in new window

0
 
LVL 52

Author Closing Comment

by:Scott Fell, EE MVE
ID: 37756105
Thanks!  2nd eyes always seem to work.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

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.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now