I'm making a little RL in haskell (with hscurses) and now, I write the code to make/print the dungeon.
The first thing I do is making a list/array with 'walls'
In python(v3) it would be like this:
def mk_list(x, y):
dungeon = [['#' for j in range(y)] for i in range(x)]
return dungeon
And it would be printed like this:
import curses
def print_dungeon(window, x, y, dungeon):
for i in range(x):
for j in range(y):
window.addstr(j, i, dungeon[x][y])
window.refresh()
So my question is: How can I do this in haskell?
I know there excist the module Data.Array
but as I understand, they support only 2D arrays.
Also the array must be mutable because I must 'dig' the rooms and corridors in it later.
But my question is also that should I use arrays for it, or is a list better?
Thanks in advance!