estbase / round-robin
Package to generate Round-robin schedule for a tournament.
v2.0.0
2024-05-23 16:50 UTC
Requires
- php: ^8.3
Requires (Dev)
- phpunit/phpunit: ^11.1.3
This package is auto-updated.
Last update: 2025-03-23 18:32:10 UTC
README
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.