tourneyjs
Tournament algorithms
Single Elimination
; // create single elimination tournament without bronze finals/** * SingleElimination( teams: any[], settings: Settings ) * Settings : { with_bronze_final : boolean, randomize : boolean }*/ const single_elim = ... teams ... ; // or with bronze finals /** * const single_elim = new SingleElimination( * [ ... teams ... ], * { * with_bronze_final: true, * randomize: false * });*/ // or with randomized seeding /** * const single_elim = new SingleElimination( * [ ... teams ... ], * { * with_bronze_final: false, * randomize: true * });*/ // add on_finished event listenersingle_elim; // add error event listenersingle_elim; /** * Allow for asynchronous progress of the tournament. * * fight_cb(match) : Promise<{}> * * needs to return the winner and loser of * a match (ie { winner: "bob", loser: "tom"}) * * success_cb(match) : Void * * will have the match with updated meta_data where the * result is stored * * failure_cb(match, error) : Void * * will be called for each failure, but the error event * listener will only execute once. the match and error * are parameters to the callback*/ single_elim; single_elim;single_elim; single_elim;single_elim;// Error thrown