This is the code distribution for the Medium article Random thoughts on randomization in TypeScript.
Author: Jim Armstrong - The Algorithmist
@algorithmist
theAlgorithmist [at] gmail [dot] com
Typescript: 3.4.5
Jest: 24.9.0
Version: 1.0
Installation involves all the usual suspects
- npm installed globally
- Clone the repository
- npm install
- get coffee (this is the most important step)
-
npm test (it really should not be this easy, but it is)
-
Standalone compilation only (npm build)
Specs (random.spec.ts) reside in the tests folder.
This repo contains a small number of Typescript utilities for dealing with computations involving random processes, some of which were moved over from the Typescript Math Toolkit. The following classes/functions are provided,
- TSMT$RandomIntInRange
- TSMT$Bin
- TSMT$Deviates
- SeededRng
- fisher-yates
Usage and API are covered in the Medium article.
Specs, written in jest, provide additional usage examples.
Apache 2.0
Free Software? Yeah, Homey plays that