diff --git a/Main.hs b/Main.hs index a595531..33f439b 100644 --- a/Main.hs +++ b/Main.hs @@ -1,22 +1,18 @@ module Main where import Colors ---import Influence import InfiniteHexGrid -import System.Random (newStdGen, StdGen, getStdGen, randomR, randomRs) -import Data.Char +import System.Random (getStdGen) import Data.List (zip, transpose, unfoldr) -import Data.Sequence (mapWithIndex, Seq) -import Data.Maybe seed = 2022 -screenLen = 33 +screenLen = 20 -biomes = "-*8/" -- PutInto data w rangeInput +biomes = "-|*¤X" -- PutInto data w rangeInput rRange = (0, length biomes - 1) main :: IO () -main = drawGrid screenLen $ screenLen +main = drawGrid screenLen screenLen drawGrid :: Int -> Int -> IO () @@ -26,8 +22,8 @@ drawGrid maxCols maxRows = do let grid = initIHexGrid g rRange let fGrid = finiteHexGrid (maxCols,maxRows) (x,y) grid let rasterized = map (zoomRow2x biomes) fGrid - --let nicerRows = map (\r -> bgC 0 ++ r ++ toNorm) rasterized - mapM_ putStrLn rasterized + let nicerRows = map (\r -> bgC 0 ++ r ++ toNorm) rasterized + mapM_ putStrLn nicerRows zoomRow2x :: [Char] -> FiniteRow -> String zoomRow2x biomeSet (off, x:xs) = diff --git a/src/InfiniteHexGrid.hs b/src/InfiniteHexGrid.hs index 3f838a7..3098921 100644 --- a/src/InfiniteHexGrid.hs +++ b/src/InfiniteHexGrid.hs @@ -15,7 +15,6 @@ import System.Random ( type Point2D = (Int, Int) type FiniteRow = (RowOffset,[Int]) -randLimits = (0,9) data RowOffset = Complete | CappedEnds deriving (Show,Eq,Ord) @@ -33,7 +32,6 @@ data IHexGridCursor a = IHexGridCursor { south :: [IHexRowCursor a] } deriving (Show, Eq, Ord) - initIHexGrid :: RandomGen g => g -> (Int,Int)-> IHexGridCursor Int initIHexGrid g rRange = IHexGridCursor n row' s