APL/APL1.1/CM2/lancer.c
2022-01-25 14:25:17 +01:00

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