Mac binaries
[jabaws.git] / website / archive / binaries / mac / src / fasta34 / randtest.c
diff --git a/website/archive/binaries/mac/src/fasta34/randtest.c b/website/archive/binaries/mac/src/fasta34/randtest.c
new file mode 100644 (file)
index 0000000..a7d09d4
--- /dev/null
@@ -0,0 +1,21 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/time.h>
+
+main(argc, argv)
+     int argc; char **argv;
+{
+  int i, n, s;
+  struct timeval t;
+
+  if (argc < 2) n = 10;
+  else n = atoi(argv[1]);
+
+  gettimeofday(&t,NULL);
+  printf(" seed: %d\n",t.tv_usec);
+  srandom(t.tv_usec);
+
+  for (i=0; i< n; i++)
+    printf("%3d\n",random()%100);
+
+}