Skip to content

Latest commit

 

History

History
46 lines (27 loc) · 722 Bytes

File metadata and controls

46 lines (27 loc) · 722 Bytes

Match Score Simulation

A quick function to return random football scores with realistic score probabilities.

Installation

In your desired console run:

npm i match-simulation-algorithm

Usage

In your js file require the package by writing:

const matchSim = require('match-simulation-algorithm');

Call the getScore() function like so (must be assigned to a variable):

const result = matchSim.getScore();

Output

returns an object with two variables: homeScore and awayScore

Example output:

{ homeScore: 3, awayScore: 2 }

These can be accessed like so:

const homeScore = result.homeScore;
const awayScore = result.awayScore;