Match-class: A Squash Match class

Description Fields Author(s) See Also Examples

Description

Models a Squash match consisting of several Games. For match play, a "game momentum" can be specified, which increases the odds in favor of the player that just has won a game.

Fields

game

(Game) contains all necessary game parameters

bestOf

(numeric) the maximum match length

played_games

(list) all played games are saved internally in this list

Author(s)

Roman Pahl, roman.pahl@gmail.com

See Also

Game,

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
m1 <- Match(Game())
m1$hasFinished()             # FALSE
m1$get_match_table()         #   1 2 3
                             # A 0 0 0
                             # B 0 0 0
set.seed(123)
m1$play()
m1$hasFinished()             # TRUE
m1$get_match_table()         #    1  2  3  4  5
                             # A 11 11  2  6  9
                             # B  9  2 11 11 11

m1$get_winner()$name         # "B"

rpahl/Squash documentation built on May 28, 2019, 12:35 a.m.