PHP code example of boraguler / round-robin
1. Go to this page and download the library: Download boraguler/round-robin library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once ('vendor/autoload.php' );
boraguler / round-robin example snippets
BoraGuler\RoundRobin\RoundRobinServiceProvider::class,
'RoundRobin' => boraguler\RoundRobin\RoundRobinFacade::class,
use BoraGuler \RoundRobin \RoundRobin ;
$teams = ['Galatasaray' , 'Arsenal' , 'Atlético de Madrid' , 'Borussia' , 'Barcelona' ,'Liverpool' , 'Bayer 04' , 'Real Madrid' ];
$schedule = new RoundRobin($teams)->make();
$schedule = RoundRobin::from($teams)->make();
$teams = ['Galatasaray' , 'Arsenal' , 'Atlético de Madrid' , 'Borussia' , 'Barcelona' ,'Liverpool' , 'Bayer 04' , 'Real Madrid' ];
$schedule = RoundRobin::from($teams)->make();
$teams = ['Galatasaray' , 'Arsenal' , 'Atlético de Madrid' , 'Borussia' , 'Barcelona' ,'Liverpool' , 'Bayer 04' , 'Real Madrid' ];
$schedule = RoundRobin::from($teams)->doNotShuffle()->make();
$teams = ['Galatasaray' , 'Arsenal' , 'Atlético de Madrid' , 'Borussia' , 'Barcelona' ,'Liverpool' , 'Bayer 04' , 'Real Madrid' ];
$schedule = RoundRobin::from($teams)->shuffle(15 )->make();
$teams = ['Galatasaray' , 'Arsenal' , 'Atlético de Madrid' , 'Borussia' , 'Barcelona' ,'Liverpool' , 'Bayer 04' , 'Real Madrid' ];
$schedule = RoundRobin::from($teams)->rounds(3 )->make();
$teams = ['Galatasaray' , 'Arsenal' , 'Atlético de Madrid' , 'Borussia' , 'Barcelona' ,'Liverpool' , 'Bayer 04' , 'Real Madrid' ];
$schedule = RoundRobin::from($teams)->doubleRoundRobin()->make();
$teams = ['Galatasaray' , 'Arsenal' , 'Atlético de Madrid' , 'Borussia' , 'Barcelona' ,'Liverpool' , 'Bayer 04' , 'Real Madrid' ];
$schedule = RoundRobin::from($teams)->makeSchedule();