summaryrefslogtreecommitdiff
path: root/AutoVideos/src/GNULinux/Random.h
diff options
context:
space:
mode:
Diffstat (limited to 'AutoVideos/src/GNULinux/Random.h')
-rw-r--r--AutoVideos/src/GNULinux/Random.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/AutoVideos/src/GNULinux/Random.h b/AutoVideos/src/GNULinux/Random.h
new file mode 100644
index 0000000..80d0259
--- /dev/null
+++ b/AutoVideos/src/GNULinux/Random.h
@@ -0,0 +1,9 @@
+double rand01()
+{
+ return (double)rand() / RAND_MAX;
+}
+
+int randrange(int start, int end)
+{
+ return (int)(rand01()*(end-start)) + start;
+}