mirror of
https://gitlab.com/80486DX2-66/gists
synced 2024-11-12 22:45:54 +05:30
C: jokes: add bytebeat-cryptic.c
This commit is contained in:
parent
d285fe2950
commit
ba278632e2
38
c-programming/jokes/bytebeat-cryptic.c
Normal file
38
c-programming/jokes/bytebeat-cryptic.c
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* bytebeat-cryptic.c
|
||||||
|
*
|
||||||
|
* NOTE: PulseAudio: Pipe STDOUT of this program to aplay -c 1 -f U8 -r 44100
|
||||||
|
*
|
||||||
|
* Author: Intel A80486DX2-66
|
||||||
|
* License: Unlicense
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
srand(time(NULL));
|
||||||
|
|
||||||
|
volatile float k[] = {0.7088250000000000f, 0.9451000000000000f,
|
||||||
|
1.2601333301830002f, 1.4176500000000000f};
|
||||||
|
|
||||||
|
unsigned A = 4294967295, B = rand();
|
||||||
|
|
||||||
|
for (unsigned i = 0; i < 3; i++) {
|
||||||
|
for (unsigned j = 1; j < 4; j++) {
|
||||||
|
if (rand() & 1) {
|
||||||
|
k[i] = *(float*)(unsigned[]){(*(unsigned*)&k[i]) ^ (*(unsigned*)&k[j])};
|
||||||
|
k[j] = *(float*)(unsigned[]){(*(unsigned*)&k[j]) ^ (*(unsigned*)&k[i])};
|
||||||
|
k[i] = *(float*)(unsigned[]){(*(unsigned*)&k[i]) ^ (*(unsigned*)&k[j])};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
float C = k[(A / 65536) & 0b11];
|
||||||
|
C *= ((B >> ((7 & A >> 13) << 1)) & 6);
|
||||||
|
unsigned D = ++A * C / 4;
|
||||||
|
putchar(D);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user