?
Solved

round robin team schedule

Posted on 2012-03-22
2
Medium Priority
?
870 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 2000 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 53

Author Closing Comment

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

752 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