Skip to content

Commit

Permalink
slim -er
Browse files Browse the repository at this point in the history
  • Loading branch information
dynnamitt committed Feb 17, 2022
1 parent 7914b04 commit 60b63f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
16 changes: 6 additions & 10 deletions Main.hs
Original file line number Diff line number Diff line change
@@ -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 ()
Expand All @@ -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) =
Expand Down
2 changes: 0 additions & 2 deletions src/InfiniteHexGrid.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand Down

0 comments on commit 60b63f1

Please sign in to comment.