Hi Java group, this is my first posting here.

I'm trying to build my own poker bot, and I'm trying to create a  
random number.  After fishing around online, I found some code that  
claims to create a random number simply.  The statements are

Random a = new Random()
int r = generator.nextInt().

The second command gives an error: cannot find symbol
                                                                    symbol: 
variable generator
                                                                    location: 
class cactuskev.Main

                                                                   cannot find 
symbol
                                                                   symbol: 
method nextInt()
                                                                   location: 
class generator

I therefore commented out the second command, which is supposed to  
give the next integer in the random number generated.
When I run the first command alone in the NetBeans IDE, I get the  
following:

run:
a = java.util.ran...@e09713 b = java.util.ran...@de6f34
BUILD SUCCESSFUL (total time: 1 second)


I don't really know how to use this as a random number.  The second  
command is supposed to extract it.  Has anybody had experience with  
this or knows what I'm doing wrong?  I loaded the java.util.Random  
class and all.  My code is at the bottom.

P.S.  For anyone interested, Cactus Kev has created a lightning-fast  
hand evaluator for poker hands.  You can read about it at:
http://www.suffecool.net/poker/evaluator.html

Thanks,
Joel



package cactuskev;

import java.util.Random;

public class Main {

     public static void main(String[] args) {
         double c,d;

         Random a = new Random();
         Random b = new Random();

         int r = generator.nextInt();

         System.out.println("a = " + a + " b = " + b);
     }
}

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to