knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

tournamentbuildr

An R package for building and scheduling tournaments.

Build

Build your very own tournament!

library(tournamentbuildr)

# build a round-robin tournament
x <- Tournament$new(teams = LETTERS[1:8], type = "round_robin")

# view the schedule
x$schedule

Play

Once created, you can also record the results and track progress.

# play the first few games
x$play(game = 1, winner = "A")
x$play(game = 2, winner = "A")
x$play(game = 3, winner = "D")

# playing is chainable, cool!
x$play(4, "A")$play(5, "F")$play(6, "G")

# how do things stand now?
x$standings()

Variety

Right now, you can choose from these types of tournaments: - round-robin (round_robin) - random-robin (random_robin) - single-elimination bracket (bracket)

Note that for the single-elimination tournament, teams are assumed to be pre-ranked and ordered from best-to-worst.

# round-robin
Tournament$new(teams = LETTERS[1:8], type = "round_robin")

# random-robin (i.e., a round-robin that's been cut short!)
Tournament$new(teams = LETTERS[1:8], type = "random_robin", n_games = 10)

# single-elimination bracket
Tournament$new(teams = LETTERS[1:8], type = "bracket")

Future Work

Equipment/Facility/Timeslot Scheduling

Given some restrictions on necessary equipment and availability of facilities, how should tournament games be scheduled?

Additional Tournament Options



anthonypileggi/tournamentbuildr documentation built on May 6, 2019, 1:35 a.m.