RNG Source

What follows is the source for the RNG used to draft riders. It randomizes a series of strings passed in through the command line.

 

/**
* Class that will print the strings in args in a randomly random fashion.
*
* @author Dieter Laskowski
*
*/
public class DraftOrder {
 
/**
* Main method, read the args and prints them at random w/ no repeats
*
* @param args - strings
*/
public static void main(String[] args) {
 for(int i=args.length-1; i >= 0; i--) { //foreach of the strings
  int place = Math.round((float)(Math.random()*i)); //choose a random place
  System.out.println(args[place]); //print the string
  args[place]=args[i]; //fill the gap
 }//for
}//main
}//DraftOrder