Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zswang/jrands
The random function of the constructor can specify random seeds
https://github.com/zswang/jrands
math random
Last synced: about 1 month ago
JSON representation
The random function of the constructor can specify random seeds
- Host: GitHub
- URL: https://github.com/zswang/jrands
- Owner: zswang
- License: mit
- Created: 2015-08-13T16:34:27.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-03T13:16:44.000Z (over 6 years ago)
- Last Synced: 2024-10-09T23:05:38.276Z (about 1 month ago)
- Topics: math, random
- Language: JavaScript
- Size: 29.3 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jrands(#$)
[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Coverage Status][coverage-image]][coverage-url]## 概述
### jrands 是什么?
jrands 就是对 .NET 的 [Random Class]() 做另一个简单实现
* JS 写法
```js
let random = new jrands.Random(2)
let i = random.next() + random.next()
console.log(i)
```* 对应 C# 写法
```cs
var r = new Random(2);
var i = r.NextDouble() + r.NextDouble();
Console.Writeln(i);
```## License
MIT © [zswang](http://weibo.com/zswang)
[npm-url]: https://npmjs.org/package/jrands
[npm-image]: https://badge.fury.io/js/jrands.svg
[travis-url]: https://travis-ci.org/zswang/jrands
[travis-image]: https://travis-ci.org/zswang/jrands.svg?branch=master
[coverage-url]: https://coveralls.io/github/zswang/jrands?branch=master
[coverage-image]: https://coveralls.io/repos/zswang/jrands/badge.svg?branch=master&service=github