about summary refs log tree commit diff stats
path: root/Fallen/Util.hs
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2013-04-02 01:57:09 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2013-04-02 01:57:09 -0400
commit94fc90c32fb9d6694a95a9c191553aa39eabd10a (patch)
treeefafaeee96cba98f76353e18f59f0cb045fc6d70 /Fallen/Util.hs
parent8cb868224840c734f38e9041aa1567cdecd17797 (diff)
downloadfallen-hs-94fc90c32fb9d6694a95a9c191553aa39eabd10a.tar.gz
fallen-hs-94fc90c32fb9d6694a95a9c191553aa39eabd10a.tar.bz2
fallen-hs-94fc90c32fb9d6694a95a9c191553aa39eabd10a.zip
Got rid of pure functional randomness and started using IO monad
Diffstat (limited to 'Fallen/Util.hs')
-rw-r--r--Fallen/Util.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Fallen/Util.hs b/Fallen/Util.hs index dd01fff..bf528c2 100644 --- a/Fallen/Util.hs +++ b/Fallen/Util.hs
@@ -3,6 +3,6 @@ module Fallen.Util
3) where 3) where
4 import System.Random 4 import System.Random
5 5
6 randomSetElement rg set = do 6 randomSetElement set = do
7 let (index,rg') = randomR (0,length set - 1) rg :: (Int,StdGen) 7 index <- randomRIO (0, length set - 1)
8 (set !! index, rg') \ No newline at end of file 8 return $ set !! index \ No newline at end of file