Using the following function, write a function that returns a 0 or a 1 with equal probability.
int random() {
return ((rand() % 5) + 1);
}
int random01() {
return ((([]{ for (;;) if (int r = random(); r - 5 && r) return r; })() % 2) << 1) >> 1;
}
Just to see you squirm a bit.