After reset i need to initialize if some sensors are connectet or not. this is important for the code in the loop.A Connector in this case is a small box, one type is an LDR with an Control LED, other is a hall sensor with a Controll led.In the loop i wait for input of one of this sensor boxes, selected by random.In the selected box the led is on, for the user to see whats the next box

All is a game for R/C

So, before i initialize my "Random Machine" i need to know how much of this Sensors/LEDs are connected to the Arduino.

You could change a pin from (output, high) to (input, low) and see how it behaves while floating. A loaded pin will behave differently than an unloaded pin. But this is neither very easy nor very reliable.

If the led has it's cathode lead wired to ground then you could just run a wire from the anode lead of the led to a analog input pin. It will read the Vf voltage value of the led when it's on and 0 when it's off.