diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2013-04-01 23:01:59 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2013-04-01 23:01:59 -0400 |
commit | e77c8b23c148ffaa5991da18c981e61db2a5e55c (patch) | |
tree | 23cb193169eaf72587fc20085754d7818b117407 /Fallen/Util.hs | |
parent | 0bdac482014e4bffb04005fbc09c16aa5f612b8f (diff) | |
download | fallen-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.hs | 8 |
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 @@ | |||
1 | module 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 | ||