Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Array Help

Author
Message
matador
14
Years of Service
User Offline
Joined: 24th Apr 2010
Location: Florida
Posted: 24th Apr 2010 20:10
i need help with my array of colors. i have a simple program but i am trying to get the array to NOT display the same color twice. All input is welcome...

Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 24th Apr 2010 21:12
Store the index you last used and if the new random number is the same as the last one, then get a new random number. Example:



If you initialize both index and LastIndex to the same value, that ensures that you will certainly get a new random number even on the first try.
matador
14
Years of Service
User Offline
Joined: 24th Apr 2010
Location: Florida
Posted: 24th Apr 2010 22:05
wow, that helps, thanx alot.
sylena2286
14
Years of Service
User Offline
Joined: 15th Jun 2010
Location:
Posted: 16th Jun 2010 02:10
Thankyou all for your help. My program now works perfectly!!!!

Login to post a reply

Server time is: 2024-11-20 01:18:12
Your offset time is: 2024-11-20 01:18:12