From 40d706887e9d2f15e9eeeadb10ad8a0a6b4f3139 Mon Sep 17 00:00:00 2001 From: nek0 Date: Wed, 14 Feb 2018 16:45:12 +0100 Subject: [PATCH] tinkering with room generation --- src/Floorplan.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Floorplan.hs b/src/Floorplan.hs index 10e3cf6..fde5e6c 100644 --- a/src/Floorplan.hs +++ b/src/Floorplan.hs @@ -160,8 +160,16 @@ buildInnerWalls rng input = doCol c | M.safeGet row (c + 1) mat == Just Unde = doCol (c + 1) | otherwise = c - (cr, g1) = randomR (row, maxRow) gn - (cc, g2) = randomR (col, maxCol) g1 + (cr, g1) = randomR + ( if maxRow - 3 < row + 3 + then (row + 2, row + 2) + else (row + 3, maxRow - 3) + ) gn + (cc, g2) = randomR + ( if maxCol - 3 < col + 3 + then (col + 2, col + 2) + else (col + 3,maxCol - 3) + ) g1 (nngen, nnmat) = doCross g2 (cr, cc)