mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-10-31 23:09:49 +00:00
9 lines
127 B
C
9 lines
127 B
C
unsigned int lfsr = 1;
|
|
|
|
unsigned int rand() {
|
|
char lsb = lfsr & 1;
|
|
lfsr >>= 1;
|
|
if (lsb) lfsr ^= 0xd400;
|
|
return lfsr;
|
|
}
|