mesa: simplify dependencies in mmakefiles
[AROS.git] / test / clib / random.c
bloba629215ff7fe2704be0f9cd3e135a674e715edc9
1 /*
2 * Copyright (C) 2012, The AROS Development Team
3 * All right reserved.
4 * Author: Jason S. McMullan <jason.mcmullan@gmail.com>
6 * Licensed under the AROS PUBLIC LICENSE (APL) Version 1.1
7 */
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <unistd.h>
13 int main(int argc, char **argv)
15 long seed;
16 int i, steps;
18 if (argc != 3) {
19 printf("Usage:\n%s <seed> <steps>\n", argv[0]);
20 return EXIT_FAILURE;
23 seed = strtol(argv[1], NULL, 0);
24 steps = strtol(argv[2], NULL, 0);
26 srandom(seed);
27 printf("Seed: %ld\n", seed);
28 for (i = 0; i < steps; i++) {
29 sleep(1);
30 printf("Step %d: %ld\n", i, random());
33 return 0;