Guest User

asd

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