From e77c8b23c148ffaa5991da18c981e61db2a5e55c Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 1 Apr 2013 23:01:59 -0400 Subject: Initial commit Haskell version now has most of the functionality from the C++ version, except for color, and overworld generation is REALLY slow. --- Fallen/Util.hs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Fallen/Util.hs (limited to 'Fallen/Util.hs') 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 @@ +module Fallen.Util +( randomSetElement +) where + import System.Random + + randomSetElement rg set = do + let (index,rg') = randomR (0,length set - 1) rg :: (Int,StdGen) + (set !! index, rg') \ No newline at end of file -- cgit 1.4.1