tink-a-tink-tink
This commit is contained in:
parent
40d706887e
commit
5ab26a1507
1 changed files with 22 additions and 8 deletions
|
@ -170,11 +170,26 @@ buildInnerWalls rng input =
|
|||
then (col + 2, col + 2)
|
||||
else (col + 3,maxCol - 3)
|
||||
) g1
|
||||
(nngen, nnmat) = doCross
|
||||
g2
|
||||
(cr, cc)
|
||||
(Boundaries coord (maxRow, maxCol))
|
||||
mat
|
||||
(nngen, nnmat) =
|
||||
if (cr - 2 > row && cr + 2 < maxRow)
|
||||
&& (cc - 2 > col && cc + 2 < maxCol)
|
||||
then
|
||||
doCross
|
||||
g2
|
||||
(cr, cc)
|
||||
(Boundaries coord (maxRow, maxCol))
|
||||
mat
|
||||
else
|
||||
let btups = (,)
|
||||
<$> [fst (coord) .. maxRow]
|
||||
<*> [snd (coord) .. maxCol]
|
||||
in
|
||||
( g2
|
||||
, foldl
|
||||
(\acc coords ->
|
||||
M.setElem (replaceTile (acc M.! coords) Offi) coords acc
|
||||
) mat btups
|
||||
)
|
||||
doCross
|
||||
:: StdGen
|
||||
-> (Int, Int)
|
||||
|
@ -212,13 +227,12 @@ buildInnerWalls rng input =
|
|||
btups = (,)
|
||||
<$> [fst (matmin b) .. fst (matmax b)]
|
||||
<*> [snd (matmin b) .. snd (matmax b)]
|
||||
in if trace ("bs: " ++ show (boundSize b)) (boundSize b) >= 16
|
||||
in if boundSize b >= 16
|
||||
then foldl
|
||||
(\(agen, amat) (cr, nb) -> doCross agen cr nb amat)
|
||||
(ngen, omat)
|
||||
(zip crosses nbs)
|
||||
else trace
|
||||
("built cross at " ++ show coord ++ " within " ++ show b)
|
||||
else
|
||||
(gen, omat)
|
||||
in (nngen, nnmat)
|
||||
| otherwise = (gn, mat)
|
||||
|
|
Loading…
Reference in a new issue