Skip to content

Package to generate Round-robin schedule for a tournament

Notifications You must be signed in to change notification settings

estbase/round-robin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Travis (.org) License

EST Base Packages

  • RoundRobin Schedule Generator
  • TBC

About Round-Robin EST Package

This package will generate a tournament or seasonal calendar instantly, through the round-robin system.

Based on code of: https://github.com/mnito/round-robin

Features

  • Schedule generation by Round-robin system
  • Support for any number of teams (Indicated for no more than 12 or 14 teams)
  • Ability to generate a number of rounds on demand
  • Ability to configure add a bye for odd-numbered team counts
  • PHP 8.3
  • PHPUnit tested

Installation

If you use Composer, run on your terminal:

composer require estbase/round-robin

in other cases add the following line on required packages:

"estbase/round-robin": "^2.0"

Ready to use!

Usage

Short call, generating a schedule where each player meets every other player once:

$schedule = Schedule::create(['A','B','C','D']);

or

$teams = ['A','B','C','D'];
$schedule = Schedule::create($teams);

Generate schedule with personalized number of rounds or on each team plays with other team twice:

$teams = ['A','B','C','D'];
$schedule = Schedule::create($teams, 5);

or

$teams = ['A','B','C','D'];
$rounds = (($count = count($teams)) % 2 === 0 ? $count - 1 : $count) * 2;
$schedule = Schedule::create($teams, $rounds);

Generate schedule with or without adding a bye for an odd-numbered tournaments:

This case generates a Schedule adding a bye.

$teams = ['A','B','C','D','E'];
$schedule = Schedule::create($teams);

or without it

$teams = ['A','B','C','D','E'];
$schedule = Schedule::create($teams, null, false);

Generate a schedule without randomly shuffling the teams:

$schedule = Schedule::createSchedule(['A','B','C','D'],null,true, false);

Using your own seed to generate the schedule with predetermined shuffling:

$schedule = Schedule::createSchedule(['A','B','C','D'],null,true, true, 9);

License

EST Base round-robin package is free software distributed under the terms of the MIT license.

About

Package to generate Round-robin schedule for a tournament

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages