Round Robin Cyclic Algorithm

Now we move into a more object orientated flavor. Each pair will be an object with two principal properties, one and two, whose values will be the number corresponding to the items being paired. Each round will be an array of pairs and each tournament will be an array of rounds. Sure, everything could be done on a functional level, but objects are fun.

Maths

Simple renderers

HTML with CSS renderers

A simple script block generates a listing

<SCRIPT LANGUAGE="JAVASCRIPT">t = new Tournament(12); document.write (t.toString('CODE'))</SCRIPT>

And another generates a table

<SCRIPT LANGUAGE="JAVASCRIPT">document.write (t.TABLE("RR"))</SCRIPT>

This table relies on the following CSS:

table#RR { border-collapse: collapse }
table#RR tr td { border: 1px solid black; padding:4px 0.5em 3px 0.5em }
table#RR tr td.rc00 { background-color:#FFF }
table#RR tr td.rc01 { background-color:#EEE }
table#RR tr td.rc10 { background-color:#CF9 }
table#RR tr td.rc11 { background-color:#BE8 }

Don't worry, this all leads up to a nice visual.

More stuff regarding round robins.