hi
to be able to quickly and easy compare your 2005 function version
with the new 2007 version
I setup this roundrobin.php
It is for most PHP coders self-explaining, I hope
<?php
$n = 4; // number of players in tournament
$functions = 2; // total number of versions of this function
if (isset($_GET['n']) && !empty($_GET['n']) && ctype_digit($_GET['n'])) {
$n = $_GET['n'];
}
if ( $n > 40 )
$n = 40;
$f = $functions;
if (isset($_GET['f']) && !empty($_GET['f']) && ctype_digit($_GET['f'])) {
$f = $_GET['f'];
}
if ( $f > $functions || $f < 1 )
$f = $functions;
// include and run function, using values of $f and $n
include "func.generate-rr$f.php";
echo "generateRoundRobinPairings($n);<br>\n";
echo "Version: $f<br>\n";
echo '<pre>' . generateRoundRobinPairings($n) . '</pre>';
?>
Files, all in same web folder:
func.generate-rr1.php ---- 2005 version include
func.generate-rr2.php ---- 2007 version include
roundrobin.php ------- main script
How to use:
URL/roundrobin.php?n=8&f=2
... where n= number of players ( max 40 players )
... if no value of n, 4 players ( like in original roundrobin.php, see Post #1 )
... and f= function version ( 1=2005, 2=2007 );
... if no value of f, the latest version will be used=highest number=total number of version
halojoy