about summary refs log tree commit diff
path: root/src/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs32
1 files changed, 21 insertions, 11 deletions
diff --git a/src/Main.hs b/src/Main.hs
index d49e082b7c6c..2da277b64071 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -1,20 +1,23 @@
-module Main where
-
-import Xanthous.Prelude
-import Brick
+module Main ( main ) where
+--------------------------------------------------------------------------------
+import           Xanthous.Prelude
+import           Brick
 import qualified Options.Applicative as Opt
-import System.Random
-
-import Xanthous.Game (getInitialState)
-import Xanthous.App (makeApp)
-import Xanthous.Generators
+import           System.Random
+--------------------------------------------------------------------------------
+import           Xanthous.Game (getInitialState)
+import           Xanthous.App (makeApp)
+import           Xanthous.Generators
   ( GeneratorInput(..)
   , parseGeneratorInput
   , generateFromInput
   , showCells
   )
-import Xanthous.Data (Dimensions, Dimensions'(Dimensions))
-
+import           Xanthous.Generators.Util (regions)
+import           Xanthous.Generators.LevelContents
+import           Xanthous.Data (Dimensions, Dimensions'(Dimensions))
+import           Data.Array.IArray ( amap )
+--------------------------------------------------------------------------------
 data Command
   = Run
   | Generate GeneratorInput Dimensions
@@ -61,6 +64,13 @@ runGenerate :: GeneratorInput -> Dimensions -> IO ()
 runGenerate input dims = do
   randGen <- getStdGen
   let res = generateFromInput input dims randGen
+      rs = regions $ amap not res
+  putStr "num regions: "
+  print $ length rs
+  putStr "region lengths: "
+  print $ length <$> rs
+  putStr "character position: "
+  print =<< chooseCharacterPosition res
   putStrLn $ showCells res
 
 runCommand :: Command -> IO ()