Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    May 2011
    Thanked 0 Times in 0 Posts

    Question Random() and Shuddle edits inconsistent when looped?

    I have a few edits to java's shuffle and random() algorithms to see how changing the System.nanotime modifier to a constant would affect them... when you leave system.nanotime to a constant value, the output of util.collections.shuffle is the same, however when you put it into a loop (like below) the consistency disappears,

    Am I failing to reset something in the loop? (am VERY new to java, please help!)

    int count = 0;
    while (seedL <= 30)
    seedL = seedL + 1;

    Deck = original;
    NewRandom.x = seedL;

    List<String> llist = Arrays.asList(Deck);



    a note, NewRandom and Nocollections are my edits, seedL is linked to where system.nanotime was (x) and the deck is preprogrammed with 52 strings (each representing a "card" i.e. "9d")

    Please help!
    Last edited by ericader; 05-23-2011 at 12:14 PM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts