Solved

round robin team schedule

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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.

770 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