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-01 23:01:59 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2013-04-01 23:01:59 -0400
commite77c8b23c148ffaa5991da18c981e61db2a5e55c (patch)
tree23cb193169eaf72587fc20085754d7818b117407 /Fallen/Util.hs
parent0bdac482014e4bffb04005fbc09c16aa5f612b8f (diff)
downloadfallen-hs-e77c8b23c148ffaa5991da18c981e61db2a5e55c.tar.gz
fallen-hs-e77c8b23c148ffaa5991da18c981e61db2a5e55c.tar.bz2
fallen-hs-e77c8b23c148ffaa5991da18c981e61db2a5e55c.zip
Initial commit
Haskell version now has most of the functionality from the C++ version, except for color, and
overworld generation is REALLY slow.
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