Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export function randomExclude( min: number , max: number , excludeList: number[] ): number {
- excludeList = excludeList.sort();
- let value: number = random( min , ( max - excludeList.length ) );
- excludeList.forEach( (n: number) => {
- if ( n <= value ) {
- value += 1;
- }
- } );
- return value;
- }
Advertisement
Add Comment
Please, Sign In to add comment