Basic skeleton for the latest TD1 exercice
[TD_IML.git] / TD1 / part_three / balle / balle.c
diff --git a/TD1/part_three/balle/balle.c b/TD1/part_three/balle/balle.c
new file mode 100644 (file)
index 0000000..7881ec5
--- /dev/null
@@ -0,0 +1,20 @@
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <time.h>
+
+int main() {
+
+    srand(time(NULL));
+    int randValue = rand() % 5 + 1;
+
+    printf("[%d] Je suis la balle et je vole\n", getpid());
+
+    sleep(randValue);
+
+    return EXIT_SUCCESS;
+}