Skip to content

theAlgorithmist/TypescriptRandom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Utility Functions For Use with Math.random

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

Installation involves all the usual suspects

  • npm installed globally
  • Clone the repository
  • npm install
  • get coffee (this is the most important step)

Building and running the tests

  1. npm test (it really should not be this easy, but it is)

  2. Standalone compilation only (npm build)

Specs (random.spec.ts) reside in the tests folder.

Introduction

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.

License

Apache 2.0

Free Software? Yeah, Homey plays that

About

Some Typescript classes and functions for dealing with computations involving random processes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published