on master help sign in
Bugfix: vty-rouge: use correct bounds when constructing level geography array

Before this fix, attempts to inspect indices using `levelWidth` and `levelHeight` would result in a runtime exception.

commit18ad37af1c6d8250ea42d65d636c1a7a8a6a425c authorJonathan Daugherty <cygnus@foobox.com> dateFri 1 Aug 2014, 15:13 (12 years ago) parentda216cb
1 file changed+1−1
test/Rouge.hs+1−1
test/Rouge.hs+1−1
@@ -59,7 +59,7 @@ mkLevel difficulty = do
5959 start <- randomP
6060 end <- randomP
6161 -- first the base geography: all rocks
62− let baseGeo = array ((0,0), (levelWidth, levelHeight))
62+ let baseGeo = array ((0,0), (levelWidth-1, levelHeight-1))
6363 [((x,y),Rock) | x <- [0..levelWidth-1], y <- [0..levelHeight-1]]
6464 -- next the empty spaces that make the rooms
6565 -- for this we generate a number of center points