Combining an LDR sensor with random blinking

cool thanks,

what would you have instead of digitalWrite though?