Struggling with switching Arduino and Random numbers

Yes I definitely want a random number every time and yes that could mean the same one quite a number of times in a row.....Some call it luck, I call it variance.

However I left the program running for a good half hour and during that time it would have had the input switch turn on and off many hundreds of times and the chances of the same number coming up that many times are astronomical.

I have added the code and it has not changed anything except that now its selected number 7 as its lock in number so that removes the clue of the first number which I never really believed anyways. (see last post by me)

Looking at the way its coded though isnt the program selecting that random number and calling it inputState and then in the very next line changing it to equal digitalRead(2)?

Just to be 100% certain I have everything the way you intended...........

byte whichpin = 3;	// set to 3 so turning it off is harmless
int inputState=HIGH, oldState=LOW;
void setup() {
    Serial.begin(9600);          
    randomSeed(analogRead(0));
    for(int i=3;i<11;i++) {
     pinMode(i, OUTPUT); 
    }
    pinMode(2,INPUT);
}

void loop() {
  inputState = random(0,10);
 inputState = digitalRead(2);
	if (inputState != oldState) {  // a change has occoured
            if(inputState == HIGH) { // input high so turn on a random LED
		whichpin = random(3,10); // calculate what LED is to be on
		digitalWrite(whichpin, HIGH);  // set the LED on
            } // end of input high
            else { // here if input is low
                digitalWrite(whichpin, LOW); // turn of the LED that was on
            } // end of input is low
	} // end of a change has occoured
oldState = inputState;
}