random-lotto
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

README.md

generator random lotto 樂透獎號生成器

install

yarn add random-lotto
yarn-tool add random-lotto
yt add random-lotto
import { randomLottoGenerator } from 'random-lotto';
import fill from 'fill-range';

let g = randomLottoGenerator({
	ranges: [
		[
			fill(1, 38),
			6,
		],
		[
			fill(1, 8),
			1,
		],
	],
})

for (let i = 0; i < 10; i++)
{
	let actual = g.next().value;
	console.log(actual)
}
[ [ 35, 33, 10, 34, 20, 26 ], 4 ]
[ [ 15, 2, 25, 34, 14, 7 ], 7 ]
[ [ 1, 24, 15, 28, 32, 20 ], 2 ]
[ [ 19, 20, 2, 33, 13, 5 ], 7 ]
[ [ 7, 25, 22, 1, 30, 20 ], 3 ]
[ [ 21, 38, 6, 36, 10, 35 ], 2 ]
[ [ 8, 38, 11, 25, 20, 6 ], 6 ]
[ [ 27, 36, 17, 9, 20, 24 ], 8 ]
[ [ 35, 24, 5, 3, 33, 29 ], 7 ]
[ [ 37, 26, 7, 20, 23, 19 ], 6 ]

Package Sidebar

Install

npm i random-lotto

Weekly Downloads

2

Version

1.0.4

License

ISC

Unpacked Size

20.3 kB

Total Files

6

Last publish

Collaborators

  • bluelovers