create Random Array() Java Help

create Random Array()

The create Random Array () static method’ creates the two-dimension random array. It takes parameters that describe the size of the applet, It is highly optimized, because originally it Was,too slow. It includes its own random-number generator that is very fast, but with a short cycle. Because of this, it is fairly complicated and beyond the scope of this book. The basic idea is that Java’s built-in random-number generator is better at generating truly random distribution, but it is too slow for this application. Plus, the use rwill not notice exactly how random this,transition is, so Robert’s ,home-grown random-number generator is sufficient

init( )

The init( ) method for this transition starts like all other transitions, with a call to the base class’ init( ) method. Then, like some other transitions, it copies all of the old billboard pixels into’ the word pixels array , The two-dimensional random array is pulled out of the object_table for art applet of this size. If it does not exist yet;,it is created and stored in the object_table With the random array in hand, the method just loops through each cell and each index in the random array, copying pixels from the next billboard into the work pixels.

JavaHelpOnline.com

  • Feel free to send us an inquiry, we will reply back in hours.
 

Verification

Posted on September 18, 2014 in The Dynamic Billboard Applet

Share the Story

About the Author

Back to Top