cosmetics

This commit is contained in:
Jonas Betzendahl 2014-04-29 00:18:38 +02:00
parent 853c11b4df
commit 6c4e63f085
3 changed files with 3 additions and 13 deletions

View File

@ -51,7 +51,7 @@ executable Pioneers
attoparsec-binary >= 0.1
Default-Language: Haskell2010
test-suite QuickCheckTests
test-suite MapTests
type: exitcode-stdio-1.0
hs-source-dirs: tests/Map, src
main-is: MapTestSuite.hs

View File

@ -31,7 +31,7 @@ gaussMountain :: Int -> PlayMap -> PlayMap
gaussMountain seed mp = aplByPlace (liftUp c) (\(_,_) -> True) mp
where
g = mkStdGen seed
c = head $ randomRs (bounds mp) g
c = let ((a,b), (x,y)) = bounds mp in (head (randomRs (a,x) g), (head (randomRs (b,y) g)))
amp = head $ randomRs (5.0, 20.0) g
sig = head $ randomRs (5.0, 25.0) g
fi = fromIntegral

View File

@ -2,19 +2,9 @@ module Map.Creation
where
import Map.Types
import Map.Map
-- import Map.Map unused (for now)
import Data.Array
import System.Random
-- Orphan instance since this isn't where either Random nor Tuples are defined
instance (Random x, Random y) => Random (x, y) where
randomR ((x1, y1), (x2, y2)) gen1 = let (a, gen2) = randomR (x1, x2) gen1
(b, gen3) = randomR (y1, y2) gen2
in ((a, b), gen3)
random gen1 = let (a, gen2) = random gen1
(b, gen3) = random gen2 in ((a,b), gen3)
-- | Generate a new Map of given Type and Size
--