HockeyGame

Represent a the scoring of a hockey game. The two teams playing are "home" and "away".

new HockeyGame()
Instance Members
▸ home
▸ away
▸ homeTeamScores()
▸ awayTeamScores()
▸ winner()

HockeyPlayer

Class representing a simple hockey player. The hockey player has a name (first and last) and a date of birth.

new HockeyPlayer(firstName: String, lastName: String, dateOfBirth: Date)
Parameters
firstName (String) the first name of the player
lastName (String) the last name of the player
dateOfBirth (Date) the birth date of the player
Instance Members
▸ firstName
▸ lastName
▸ dateOfBirth
▸ name
▸ currentAge()

HockeyPlayerStatistics

Class representing a simple hockey player with some statistics attached to it.

new HockeyPlayerStatistics(firstName: String, lastName: String, dateOfBirth: Date)
Parameters
firstName (String) the first name of the player
lastName (String) the last name of the player
dateOfBirth (Date) the birth date of the player
Instance Members
▸ firstName
▸ lastName
▸ dateOfBirth
▸ setNumberOfPlayedGames(numberOfPlayedGames)
▸ setNumberOfPlayedPlayoffGames(numberOfPlayedPlayoffGames)
▸ setNumberOfPointsDuringPlayoffGames(numberOfPointsDuringPlayoffGames)
▸ setNumberOfPoints(numberOfPoints)
▸ setNumberOfGoals(goals)
▸ pointsPerGame
▸ pointsPerPlayoffGame
▸ goalByPlayedGame

isValidIsbn13

Validate is the input string is a valid 13 digits ISBN as defined in https://en.wikipedia.org/wiki/ISBN

isValidIsbn13(str: String): boolean
Parameters
str (String) a text we want to test if it is a real isbn
Returns
boolean: true/false depending is str is a valid 13 digits ISBN

isValidIsbn10

Validate is the input string is a valid 10 digits ISBN as defined in https://en.wikipedia.org/wiki/ISBN

isValidIsbn10(str: String): boolean
Parameters
str (String) a text we want to test if it is a real isbn
Returns
boolean: true/false depending is str is a valid 10 digits ISBN

isValidIsbn

Validate is the input string is a valid ISBN https://en.wikipedia.org/wiki/ISBN

isValidIsbn(str: String): boolean
Parameters
str (String) a text we want to test if it is a real isbn
Returns
boolean: true/false depending is str is a valid isbn

INFINITY

In statistics, infinity is set to 30.

INFINITY

Type: number

average

Computes the average of the list. If the list is empty, the function returns NaN

average(lst: Array<number>): any
Parameters
lst (Array<number>)
Returns
any: the average of the list.

std

Computes the standard deviation of the list. If the list is empty, the function returns NaN

std(lst: Array<number>): any
Parameters
lst (Array<number>)
Returns
any: the standard deviation of the list.

Point

Classe qui représente un point sur un plan cartésien. Le point est donc représenté par deux coordonnées x et y.

new Point(x: any, y: any)
Parameters
x (any)
y (any)

Circle

Classe qui représente un cercle. Le cercle est définit par un Point et un rayon.

Par défaut, le cercle est noir. Mais le cercle peut changer de couleur.

new Circle(center: Point, radius: number, id: number)
Parameters
center (Point) le point au centre du cercle
radius (number) le rayon du cercle
id (number) l'id unique du cercle. C'est au créateur de l'instance de s'assurer de l'unicité de l'id.
Instance Members
▸ getCenter()
▸ getRadius()
▸ getColor()
▸ setColor(color)
▸ getId()

drawCircles

Dessine tous les cercles dans un svg. Cette fonction nettoye le svg avant d'ajouter les cercles.

drawCircles(node: any, circles: any)
Parameters
node (any) {HTMLElement} un element svg
circles (any) {Circle[]} Les cercles à dessiner

populateTable

populateTable(node: any, circles: any, pointToString: any, onClickUp: any, onClickDown: any, onClickLeft: any, onClickRight: any, onClickPaint: any)
Parameters
node (any) {HTMLElement} un element tbody
circles (any) {Circle[]} Les cercles
pointToString (any = undefined) Argument optionnel qui doit être une fonction qui prend en paramêtre un Point et retourne un String qui représente le point.
onClickUp (any = undefined) Argument optionnel qui doit être une fonction qui sera appelée lorsque la flèche pointant vers le haut sera cliquée. L'id du cercle sera passé en argument de la fonction.
onClickDown (any = undefined) Argument optionnel qui doit être une fonction qui sera appelée lorsque la flèche pointant vers le bas sera cliquée. L'id du cercle sera passé en argument de la fonction.
onClickLeft (any = undefined) Argument optionnel qui doit être une fonction qui sera appelée lorsque la flèche pointant vers la gauche sera cliquée. L'id du cercle sera passé en argument de la fonction.
onClickRight (any = undefined) Argument optionnel qui doit être une fonction qui sera appelée lorsque la flèche pointant vers la droite sera cliquée. L'id du cercle sera passé en argument de la fonction.
onClickPaint (any = undefined) Argument optionnel qui doit être une fonction qui sera appelée lorsque l'icone peinture sera cliquée. L'id du cercle sera passé en argument de la fonction.

randomColor

Retourne une couleur de gris aléatoire à partir d'un nombre entier.

randomColor(i: any): string
Parameters
i (any) {number} (entier) qui sera utilisé comme "seed".
Returns
string: une couleur hexadécimale