mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-11-21 22:17:41 +01:00
updated test
This commit is contained in:
parent
11dd03b9e6
commit
21d105627e
@ -78,13 +78,14 @@ echo "Tiebreak 5: " . $sws->getTournament()->getTiebreaks()[4]->getValue() . P
|
||||
echo "Tiebreak 6: " . $sws->getTournament()->getTiebreaks()[5]->getValue() . PHP_EOL;
|
||||
echo "Average Elo: " . $sws->getTournament()->getAverageElo() . PHP_EOL;
|
||||
foreach ($sws->getTournament()->getRanking() as $player) {
|
||||
echo str_pad($player->getName() . '(' . $player->getElo($sws->getTournament()->getPriorityElo()) . ') ', 35) . implode_pad(' ', $player->getTiebreaks(), 5,' ') . PHP_EOL;
|
||||
echo str_pad($player->getName() . '(' . $player->getElo($sws->getTournament()->getPriorityElo()) . ') ', 35) . implode_pad(' ', $player->getTiebreaks(), 5, ' ') . PHP_EOL;
|
||||
}
|
||||
|
||||
function implode_pad ($glue, $collection, $padlength, $padstring): string {
|
||||
$newarray = [];
|
||||
foreach ($collection as $elem) {
|
||||
$newarray[] = str_pad($elem, $padlength, $padstring);
|
||||
}
|
||||
return implode($glue, $newarray);
|
||||
function implode_pad($glue, $collection, $padlength, $padstring): string
|
||||
{
|
||||
$newarray = [];
|
||||
foreach ($collection as $elem) {
|
||||
$newarray[] = str_pad($elem, $padlength, $padstring);
|
||||
}
|
||||
return implode($glue, $newarray);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user