Guest User

sdasd

a guest
Jul 27th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export function randomExlude( min: number , max: number , excludeList: number[] ): number {
  2.  
  3.     excludeList = excludeList.sort();
  4.  
  5.     let value: number = random( min , ( max - excludeList.length ) );
  6.     excludeList.forEach( (n: number) => {
  7.         if ( value >= n ) {
  8.             value += 1;
  9.         }
  10.     } );
  11.  
  12.     return value;
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment