1
0
mirror of https://gitlab.com/80486DX2-66/gists synced 2024-11-09 21:32:02 +05:30

C: jokes: add bytebeat-cryptic.c

This commit is contained in:
Intel A80486DX2-66 2024-06-25 16:41:39 +03:00
parent d285fe2950
commit ba278632e2
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View 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);
}
}