about summary refs log tree commit diff stats
path: root/Fallen/Util.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Fallen/Util.hs')
-rw-r--r--Fallen/Util.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Fallen/Util.hs b/Fallen/Util.hs new file mode 100644 index 0000000..dd01fff --- /dev/null +++ b/Fallen/Util.hs
@@ -0,0 +1,8 @@
1module Fallen.Util
2( randomSetElement
3) where
4 import System.Random
5
6 randomSetElement rg set = do
7 let (index,rg') = randomR (0,length set - 1) rg :: (Int,StdGen)
8 (set !! index, rg') \ No newline at end of file