Search:

Type: Posts; User: Spidey1980

Search: Search took 0.15 seconds.

  1. Replies
    13
    Views
    2,666

    Re: random not working in .class method

    so I wrote up small example.java and a testRand.java subclass. Guess what? It works perfect! so something in my big starscape program messed it up, not the random function itself.

    Since I crated...
  2. Replies
    13
    Views
    2,666

    Re: random not working in .class method

    Here it is then.....
    look for this line in folowing code:
    {//resetStar method<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<here, look at next four lines

    Star.java

    //...
  3. Replies
    13
    Views
    2,666

    Re: random not working in .class method

    lol i'm so far past that anyways. Moving the randoms to the main and calling a set works well. And sorry, it output "NaN" since I'm working with doubles, not Null.
  4. Replies
    13
    Views
    2,666

    Re: random not working in .class method

    when I had the random in the setMethod, I had a println right after it.

    pseudo - code:


    public class Test()
    {
    public void test()
    {
    numberX = random() * 100
  5. Replies
    13
    Views
    2,666

    random not working in .class method

    Just wondering, why does Math.random() (or any random technique) not work in a constructor or setMethod? It just outputs Null. However Math.sqrt(), ect. does work inside the method.

    Once I moved...
Results 1 to 5 of 5