Posts: 75
Threads: 28
Joined: Apr 2009
Reputation:
0
Hi, I want to make a random car color with all the 127 colors.
Have I to do new rc[]={0,1,3,...,and so on,...,127,126};, or is it possible to write it like rc[]={from 0 to 126};?
Posts: 546
Threads: 22
Joined: Jul 2007
Reputation:
0
can't you use random function? random(127) which would return a value from 0 to 126 you can use to set color as? ;]
Posts: 546
Threads: 22
Joined: Jul 2007
Reputation:
0
that, won't select ALL random colors, there are 126 colors and 127 is 0, so if a random starts from 0 it hsould be 127 of size which would not make the car go black as this can't return 127. btw there are nice colors at 400+ 432 I think is verry dark green, looking sexy ;]
Posts: 75
Threads: 28
Joined: Apr 2009
Reputation:
0
And what to do if I need numbers between e.g. 100 and 200?
Posts: 546
Threads: 22
Joined: Jul 2007
Reputation:
0
umm new rand = 100+random(101);
this would go for numbers 100 - 200. figuring how it works? ;]
Posts: 2,200
Threads: 14
Joined: Apr 2009
Reputation:
0
I use this system, It's easier to remember
random(max-min+1)+min;