Created
November 23, 2020 02:23
-
-
Save mattmazzola/871ba764e963676f7067b0d1b2987254 to your computer and use it in GitHub Desktop.
Create Players
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create players | |
const initialRating = 1000 | |
const numPlayers = 10 | |
const playerTiers = 5 | |
const playerRatingRange = 6000 - initialRating | |
const playerSegmentSize = Math.floor(numPlayers / playerTiers) | |
const playerIncrementAmount = Math.floor(playerRatingRange / playerTiers) | |
const playerGeneration = { | |
total: numPlayers, | |
tiers: playerTiers, | |
ratingRange: playerRatingRange, | |
segmentSize: playerSegmentSize, | |
incrementAmount: playerIncrementAmount | |
} | |
const createPlayersFn = (prefix: string) => createPlayers( | |
prefix, | |
playerGeneration.total, | |
initialRating, | |
playerGeneration.segmentSize, | |
playerGeneration.incrementAmount | |
) | |
const players = createPlayersFn('player') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment