17 lines
353 B
C
17 lines
353 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int main(void) {
|
|
FILE* file = fopen("/dev/random", "r");
|
|
if (file) {
|
|
unsigned char randVal;
|
|
fread(&randVal, 1, 1, file);
|
|
|
|
printf("%d\n", (randVal % 6) + 1);
|
|
} else {
|
|
puts("Impossible d'ouvrir le fichier.");
|
|
return EXIT_FAILURE;
|
|
}
|
|
|
|
return EXIT_SUCCESS;
|
|
} |