Results 1 to 5 of 5
  1. #1
    carlos123 is offline Member
    Join Date
    Nov 2007
    Posts
    38
    Rep Power
    0

    Smile random numbers without random class`

    Java Code:
    int sec = cal.get(Calendar.SECOND);
    int sec2 = sec / 3;
    int sec3 = Math.round(sec2);

    ok i got a number 1-20 im gunna use as a seed to generate 10,000 random numbers 1-20. i need a formula to put it through, any suggestions?

  2. #2
    tim's Avatar
    tim
    tim is offline Senior Member
    Join Date
    Dec 2007
    Posts
    435
    Rep Power
    7

    Default

    Hello carlos123

    If you don't want to use the Random class then try Math.random(). If this is not what you want then your problem is mathematical and not Java related. See this site :Pseudorandom series

    Hope this helped. :p
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

  3. #3
    carlos123 is offline Member
    Join Date
    Nov 2007
    Posts
    38
    Rep Power
    0

    Default

    do you understand what i need to do?

  4. #4
    tim's Avatar
    tim
    tim is offline Senior Member
    Join Date
    Dec 2007
    Posts
    435
    Rep Power
    7

    Default

    Quote Originally Posted by carlos123
    do you understand what i need to do?
    I am sorry if my reply did not help, but please try to be patient with me. :(
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

  5. #5
    carlos123 is offline Member
    Join Date
    Nov 2007
    Posts
    38
    Rep Power
    0

Similar Threads

  1. random generation
    By carlos123 in forum New To Java
    Replies: 10
    Last Post: 01-09-2008, 03:43 AM
  2. random numbers
    By carlos123 in forum New To Java
    Replies: 1
    Last Post: 12-22-2007, 02:56 AM
  3. random numbers without using java funtions
    By carlos123 in forum New To Java
    Replies: 8
    Last Post: 11-16-2007, 10:13 AM
  4. generating random numbers in a 5x5 array.
    By acidacid in forum New To Java
    Replies: 3
    Last Post: 08-14-2007, 03:44 AM
  5. getting a random result
    By gradon in forum New To Java
    Replies: 2
    Last Post: 07-19-2007, 03:54 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
  •