alter hall placement

This commit is contained in:
nek0 2018-03-25 20:35:07 +02:00
parent 045659caf3
commit c25de466fb

View file

@ -56,14 +56,17 @@ placeHalls rng fc input =
where
doHalls rand bs cross wmax mat =
foldl (\(agen, amat) b ->
let (row, g1) = randomR (fst (matmin b), fst (matmax b)) agen
(col, g2) = randomR (snd (matmin b), snd (matmax b)) g1
(nw, g3) = randomR (2, wmax) g2
(nbs, nmat) = buildHall cross nw b amat
let (row, g1) = randomR
(fst (matmin b) + 10, fst (matmax b) - 10) agen
(col, g2) = randomR
(snd (matmin b) + 10, snd (matmax b) - 10) g1
-- (nw, g3) = randomR (2, wmax) g2
(nbs, nmat) = buildHall cross 3 b amat
in
if hallRatio nmat < 0.25 && wmax - 1 > 2
then doHalls g3 nbs (row, col) (wmax -1) nmat
else (g3, nmat)
-- if hallRatio nmat < 0.33 && wmax - 1 >= 2
if wmax - 1 >= 3
then doHalls g2 nbs (row, col) (wmax -1) nmat
else (g2, nmat)
) (rand, mat) bs
boundSize :: Boundaries Int -> Int