random number, 0-18

i am confused about how random works in arduino.
i see everyone using millis() as a seed, but that number is WAY too high for me.
i just want a random number between 0 and 18.

i'm excerpting some parts of my code, i know some of my variable choices might seem strange.
basically, given a user action, i want to turn off a random LED from among the LEDs that are currently off.

const int numLights = 9; //number of LEDs connected
long whichLight; //which LED i should turn on
long numOff = 9; //number of lights that are off

randomSeed(numLights);
whichLight = random(numOff);

digitalWrite(whichLight, HIGH);

by the way, can i use an int, instead of long, for random?

thanks so much,
aya.

You can just call random(18); to get a number from 0-18 (actually, it might only go from 0 to 17, so you might to call random(19)). Actually, even though it's in the documentation, millis() is probably not the best thing to pass to randomSeed(), since it will probably always have the same value. You might try seeding it with analogRead(0) (or any other unconnected analog input). The number passed to randomSeed() can be much larger than the random numbers you want - the range that you get is limited by the value you pass to random(). Yes, you can store the return value of random() in an int.