Solved

round robin team schedule

Posted on 2012-03-22
2
803 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

708 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

14 Experts available now in Live!

Get 1:1 Help Now