wo lernen?

master
orange 12 years ago
parent ff5ec6af02
commit 15840e821d

1
.gitignore vendored

@ -14,3 +14,4 @@ checkcheck
multibrot
multibrot.png
bloom
wo-lernen

@ -1,7 +1,7 @@
CFLAGS=-std=c99 -Wall -g -O2
INDENTOPTS=-kr --no-tabs --braces-on-func-def-line --indent-level2
TARGETS=approximate-pi linked-list mandelbrot threads circular-buffer structs ncurses-pong bit-fuckery bit-fuckery2 checkcheck multibrot bloom
TARGETS=approximate-pi linked-list mandelbrot threads circular-buffer structs ncurses-pong bit-fuckery bit-fuckery2 checkcheck multibrot bloom wo-lernen
EXTRAS=mandelbrot.bmp multibrot.png
.PHONY: all

@ -0,0 +1,27 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
// http://www.concentric.net/~Ttwang/tech/inthash.htm
unsigned long mix(unsigned long a, unsigned long b, unsigned long c) {
a=a-b; a=a-c; a=a^(c >> 13);
b=b-c; b=b-a; b=b^(a << 8);
c=c-a; c=c-b; c=c^(b >> 13);
a=a-b; a=a-c; a=a^(c >> 12);
b=b-c; b=b-a; b=b^(a << 16);
c=c-a; c=c-b; c=c^(b >> 5);
a=a-b; a=a-c; a=a^(c >> 3);
b=b-c; b=b-a; b=b^(a << 10);
c=c-a; c=c-b; c=c^(b >> 15);
return c;
}
int main(int argc, char* argv[]) {
unsigned long seed = mix(clock(), time(NULL), getpid());
srand(seed);
char* wo[] = { "unibib", "blb", "theater" };
int i = rand() % 3;
printf("%s\n", wo[i]);
}
Loading…
Cancel
Save