it's dead, jim
This commit is contained in:
parent
1c95794285
commit
d3212425d5
1 changed files with 2 additions and 20 deletions
|
@ -122,10 +122,8 @@ placeHalls rng fc input =
|
||||||
(fst (matmin b) + 10, fst (matmax b) - 10) agen
|
(fst (matmin b) + 10, fst (matmax b) - 10) agen
|
||||||
(col, g2) = randomR
|
(col, g2) = randomR
|
||||||
(snd (matmin b) + 10, snd (matmax b) - 10) g1
|
(snd (matmin b) + 10, snd (matmax b) - 10) g1
|
||||||
-- (nw, g3) = randomR (2, wmax) g2
|
|
||||||
(nbs, nmat) = buildHall cross 3 b amat
|
(nbs, nmat) = buildHall cross 3 b amat
|
||||||
in
|
in
|
||||||
-- if hallRatio nmat < 0.33 && wmax - 1 >= 2
|
|
||||||
if wmax - 1 >= 3 &&
|
if wmax - 1 >= 3 &&
|
||||||
all (\(Boundaries (minr, minc) (maxr, maxc)) ->
|
all (\(Boundaries (minr, minc) (maxr, maxc)) ->
|
||||||
maxr - minr > 3 && maxc - minc > 3) nbs
|
maxr - minr > 3 && maxc - minc > 3) nbs
|
||||||
|
@ -311,24 +309,11 @@ buildFacilities
|
||||||
-> Matrix TileState
|
-> Matrix TileState
|
||||||
-> (StdGen, Matrix TileState)
|
-> (StdGen, Matrix TileState)
|
||||||
buildFacilities gen fc input =
|
buildFacilities gen fc input =
|
||||||
-- let flood ts mat coords@(cr, cc) =
|
|
||||||
-- let cur = mat M.! coords
|
|
||||||
-- altered = M.setElem ts coords mat
|
|
||||||
-- in
|
|
||||||
-- if cur == ts || cur /= Offi
|
|
||||||
-- then mat
|
|
||||||
-- else foldl (flood ts)
|
|
||||||
-- altered
|
|
||||||
-- [ (cr + 1, cc)
|
|
||||||
-- , (cr - 1, cc)
|
|
||||||
-- , (cr, cc + 1)
|
|
||||||
-- , (cr, cc - 1)
|
|
||||||
-- ]
|
|
||||||
let nearests = map (findNearestOffice input) (fcFacilities fc)
|
let nearests = map (findNearestOffice input) (fcFacilities fc)
|
||||||
in foldl (\(agen, acc) x ->
|
in foldl (\(agen, acc) x ->
|
||||||
let (numfac, ngen) = randomR (0 :: Int, 1 :: Int) agen
|
let (numfac, ngen) = randomR (0 :: Int, 1 :: Int) agen
|
||||||
facil = if numfac == 1 then Kitc else Toil
|
facil = if numfac == 1 then Kitc else Toil
|
||||||
in (ngen, flood facil acc x)
|
in (ngen, facilFlood facil acc x)
|
||||||
) (gen, input) nearests
|
) (gen, input) nearests
|
||||||
|
|
||||||
facilFlood ts mat coords@(cr, cc) =
|
facilFlood ts mat coords@(cr, cc) =
|
||||||
|
@ -337,7 +322,7 @@ facilFlood ts mat coords@(cr, cc) =
|
||||||
in
|
in
|
||||||
if cur == ts || cur /= Offi
|
if cur == ts || cur /= Offi
|
||||||
then mat
|
then mat
|
||||||
else foldl (flood ts)
|
else foldl (facilFlood ts)
|
||||||
altered
|
altered
|
||||||
[ (cr + 1, cc)
|
[ (cr + 1, cc)
|
||||||
, (cr - 1, cc)
|
, (cr - 1, cc)
|
||||||
|
@ -543,9 +528,6 @@ findNeighbor (dir, _) bnds ingraph
|
||||||
in
|
in
|
||||||
case filtered of
|
case filtered of
|
||||||
[a@(GRoom _ _ _ _)] -> Just a
|
[a@(GRoom _ _ _ _)] -> Just a
|
||||||
-- if ts == neighTile row col
|
|
||||||
-- then Just a
|
|
||||||
-- else error "findNeighbor: Query Result does not match"
|
|
||||||
[] -> Nothing
|
[] -> Nothing
|
||||||
_ -> error "findNeighbor: Non-singleton filter result"
|
_ -> error "findNeighbor: Non-singleton filter result"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue