How do I make a number randomizer for seperate VEX LED's


#1

Our team is required to make five VEX LED’s flash on and off one after the other randomly…


#2

Sounds like a homework assignment, I charge $5 each to do them :wink:

What part are you stuck at? Questions I answer for free.


#3

its not homework, we are just tryna make a game.


#4

but i just need to know how to randomize the light flashes


#5

you want the rand() function and you want to say

LightToFlash = rand(4); // give me a random number between 0 and 4

Then you can use If else to light the lights.


#6

@Drakay – Thanks for the heart, but would be happier if you post your code for others to see!