Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



This topic is 5762 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, i''m actually referring to a question in java application programming... but the loops and format are very similar to c/c++... i wrote a class that draws three random numbers and return a string for each one to the actual program... however.. when i create the "deal" object... deal deck = new deal(); it is supposed to return the value randomly picked into the object deck... and if i do a System.out.println(deck); it will work perfectly fine... however... i want to be able to loop around and randomly choose 20 deck values... do i have to use an array or am i just not looping it correctly? while(blah > 0) { for(int count = 1; count < 21; count++) { deal deck = new deal(); System.out.println(deck); } blah = 0; } now this is a very generic example, but it should work in my opinion... but what it seems to do is prints the same drawn variables from the class.... 20 times... when its supposed to draw random values... WHICH IT DOES the first time...

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!