All Projects → Heroyt → tournament-generator

Heroyt / tournament-generator

Licence: MIT license
A set of classes used to create multiple kinds of tournament brackets in PHP

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to tournament-generator

brackets-viewer.js
A simple library to display tournament brackets (round-robin, single elimination, double elimination).
Stars: ✭ 52 (+36.84%)
Mutual labels:  tournament, bracket
lazy ncaa elm
An Elm app to randomly generate tournament bracket winners
Stars: ✭ 14 (-63.16%)
Mutual labels:  tournament, bracket
WildWorld
Sandbox freestyle multiplayer game/engine in LÖVE/LUA.
Stars: ✭ 35 (-7.89%)
Mutual labels:  games
arxwasm
Port of Arx Libertatis to WebAssembly using Emscripten
Stars: ✭ 28 (-26.32%)
Mutual labels:  games
EMF
Extended Mechanics & Flavor
Stars: ✭ 33 (-13.16%)
Mutual labels:  games
coronate
A Swiss-style chess tournament management app.
Stars: ✭ 96 (+152.63%)
Mutual labels:  tournament
osgc
Open Source Game Collection - mini games created with xygine and SFML!
Stars: ✭ 17 (-55.26%)
Mutual labels:  games
GTA-One-Liners
A collection of gifs made out of almost every dialogue in GTA and other games.
Stars: ✭ 37 (-2.63%)
Mutual labels:  games
StadiaIcons
A set of icons for games based on the Google Stadia logo.
Stars: ✭ 20 (-47.37%)
Mutual labels:  games
moon-cheeser
Moon Cheeser is an infinite runner where the player plays as a mouse gathering cheese pieces and avoiding craters and other astronomical objects, such as comets and planets, on a moon made of cheese.
Stars: ✭ 32 (-15.79%)
Mutual labels:  games
CKBracketView
Tournament bracket view for iOS. Developed in swift.
Stars: ✭ 38 (+0%)
Mutual labels:  tournament
webDOOM
Classic DOOM recompiled with WebAssembly
Stars: ✭ 61 (+60.53%)
Mutual labels:  games
pokerwars.io-starterbot-python
A starter bot written in python for the pokerwars.io platform. To play: pull this code, register on pokerwars.io, get your API token and play!
Stars: ✭ 37 (-2.63%)
Mutual labels:  games
AI4U
AI4U is a multi-engine plugin (Unity and Godot) that allows you to specify agents with reinforcement learning visually. Non-Player Characters (NPCs) of games can be designed using ready-made components. In addition, AI4U has a low-level API that allows you to connect the agent to any algorithm made available in Python by the reinforcement learni…
Stars: ✭ 34 (-10.53%)
Mutual labels:  games
uno-game
🎴 An UNO Game made in Javascript
Stars: ✭ 93 (+144.74%)
Mutual labels:  games
open-source-games
A list of open source games.
Stars: ✭ 65 (+71.05%)
Mutual labels:  games
HandyRL
HandyRL is a handy and simple framework based on Python and PyTorch for distributed reinforcement learning that is applicable to your own environments.
Stars: ✭ 228 (+500%)
Mutual labels:  games
crossbow
Cross-Platform Rust Toolkit for Games 🏹
Stars: ✭ 80 (+110.53%)
Mutual labels:  games
zx-spectrum-games
Collection of ZX Spectrum annotated game source code dissasemblies as .skool files
Stars: ✭ 35 (-7.89%)
Mutual labels:  games
gamebox
Gamebox is a collection of minigames written in C using Gtk+-3.0
Stars: ✭ 15 (-60.53%)
Mutual labels:  games


Tournament Generator

A set of multiple classes to generate and work with all different kinds of tournament brackets or defining a custom bracket.

Latest Stable Version Total Downloads Scrutinizer Code Quality Scrutinizer Build Code Coverage Documentation Status Mutation testing badge

Documentation

API documentation

Features

  • Creating a custom tournament bracket with any number of categories, rounds, groups and teams
  • Defining a multiple different conditions
  • Easily generating Robin-Robin tournaments
  • Generating a tournament using a predefined preset (single elimination, double elimination, 2R2G) with any number of teams
  • Generating brackets with 2 to 4 teams in one game against each other
  • Filling your bracket with results and getting teams table with scores

Installation

$ composer require heroyt/tournament-generator

Basic Usage

require 'vendor/autoload.php';

// Create a tournament
$tournament = new TournamentGenerator\Tournament('Tournament name');

// Set tournament lengths - could be omitted
$tournament
	->setPlay(7) // SET GAME TIME TO 7 MINUTES
	->setGameWait(2) // SET TIME BETWEEN GAMES TO 2 MINUTES
	->setRoundWait(0); // SET TIME BETWEEN ROUNDS TO 0 MINUTES

// Create a round and a final round
$round = $tournament->round("First's round's name");
$final = $tournament->round("Final's round's name");

// Create 2 groups for the first round
$group_1 = $round->group('Round 1')
	->setInGame(2) // 2 TEAMS PLAYING AGAINST EACH OTHER
	->setType(TournamentGenerator\Constants::ROUND_ROBIN); // ROBIN-ROBIN GROUP
$group_2 = $round->group('Round 2')
	->setInGame(2) // 2 TEAMS PLAYING AGAINST EACH OTHER
	->setType(TournamentGenerator\Constants::ROUND_ROBIN); // ROBIN-ROBIN GROUP

// Create a final group
$final_group = $final->group('Finale')
	->setInGame(2) // 2 TEAMS PLAYING AGAINST EACH OTHER
	->setType(TournamentGenerator\Constants::ROUND_ROBIN); // ROBIN-ROBIN GROUP

// CREATE 6 TEAMS
for ($i=1; $i <= 6; $i++) {
	$tournament->team('Team '.$i);
}

// SET PROGRESSIONS FROM GROUP 1 AND 2 TO FINAL GROUP
$group_1->progression($final_group, 0, 2); // PROGRESS 2 BEST WINNING TEAMS
$group_2->progression($final_group, 0, 2); // PROGRESS 2 BEST WINNING TEAMS

// Generate games in the first round
$round->genGames();
// Simulate results (or you can fill it with your own real results)
$round->simulate();
// Progress best teams from first round to final round
$round->progress();
// Generate games in the final round
$final->genGames();
// Simulate results (or you can fill it with your own real results)
$final->simulate();

// GET ALL TEAMS
$teams = $tournament->getTeams(true); // TRUE to get teams ordered by their results

Creating a tournament with a template

require 'vendor/autoload.php';

// Create a tournament
$tournament = new TournamentGenerator\Preset\SingleElimination('Tournament name');

// Set tournament lengths - could be omitted
$tournament
	->setPlay(7) // SET GAME TIME TO 7 MINUTES
	->setGameWait(2) // SET TIME BETWEEN GAMES TO 2 MINUTES
	->setRoundWait(0); // SET TIME BETWEEN ROUNDS TO 0 MINUTES

// CREATE 6 TEAMS
for ($i=1; $i <= 6; $i++) {
	$tournament->team('Team '.$i);
}

// GENERATE ALL GAMES
$tournament->generate();

// Simulate games
$tournament->genGamesSimulate(); // Simulate only games for example to only save bracket to DB
$tournament->genGamesSimulateReal(); // Simulate games with results like a real tournament

// GET ALL TEAMS
$teams = $tournament->getTeams(true); // TRUE to get teams ordered by their results
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].