HTML::TableBracket - Tournament Table Bracket Generator
use HTML::TableBracket; # Create the Bracket, list of names in seeded order $temp=HTML::TableBracket->new("Jeek", "Tom", "Dick", "Harry", "Larry", "Curly", "Moe"); # Process the matches (TEAM1 => SCORE1, TEAM2 => SCORE2) $temp->match(Larry => 10, Harry => 20); $temp->match(Jeek => 10, Harry => 20); $temp->match(Dick => 20, Curly => 21); $temp->match(Moe => 10, Tom => 20); # For matches that don't have a score, such as chess matches, # Use the round method. (WINNER,LOSER) $temp->round("Tom","Curly"); # Display the table in HTML format print $temp->as_html; # Display the table in XHTML format print $temp->as_xhtml; # Display the table in .dot format (name of graph as argument) print $temp->as_directed_graph_source("Tournament"); # Display the table as a directed graph (name of graph as argument) print $temp->as_directed_graph("Tournament")->as_png;
This module generates a tournament bracket drawing for standard single-elimination-style matchups.
Thanks to Fletch and autrijus of the #perl that doesn't officially exist for interface suggestions.
More thanks to autrijus for setting up the original distribution.
Yet more thanks to autrijus for his continuing assistance in polishing th code.
The as_directed_graph function is commented out until I can find a way to only load it if the user has GraphViz installed.
T. J. Eckman <firstname.lastname@example.org>.
Copyright 2001 by T. J. Eckman <email@example.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.