💾 Archived View for thrig.me › blog › 2023 › 07 › 14 › badnumbers.c captured on 2023-07-22 at 16:33:28.

View Raw

More Information

-=-=-=-=-=-=-

#include <stdio.h>

int seed = 1;

// the rogue 3.6.3 random number generator
#define RN (((seed = seed * 11109 + 13849) & 0x7fff) >> 1)

int coinflip(void) { return RN & 1; }

int main(void) {
	for (int i = 0; i < 100; i++) printf("%d ", coinflip());
	putchar('\n');
}