Excal
Four of the globals are semantic constant use every where. (well the EMPTY and WALL are just used for the Maze Generation part so you could put them in local constant in this group if you really want)
There shouldn't be any issue with them, and I found out that they were more helpfull in global scope than in local. If you were to define the same constant at other places you wouldn't be sure of if they have the same value or not. I think local constant can lead to confusion.
Now the 3 other constant (WIDTH,HEIGHT and DENSITY) are parameters for the whole algorithm. Soooo I think they have their place on global scope as well.
As far as the runtime variable, generating is a kind of global state of the algorithm so well.. makes sense to be global, and for the three last, if I could initialize them with an expression as it's possible in C they would also be constant.
So yeah as much as I would agree with you that too much globals is bad because of global namespace cluttering and overall incertainty (which doesn't exist with constant). I think these ones are justified.
Now as far as the vector list is concerned, you could actually put the function on start of layout.
The vector list is just a look-up table of the four possible directions you can travel in the maze.
It looks like:
Array.At(0,0) = 1
Array.At(0,1) = 0
Array.At(1,0) = 0
Array.At(1,1) = 1
Array.At(2,0) = -1
Array.At(2,1) = 0
Array.At(3,0) = 0
Array.At(3,1) = -1
This way can just represent a direction by a number (the X index of the array)
For instance going West is the #2 direction.
It's the same as goint X + Array.At(2,0), Y + Array.At(2,1)
If you look at the dig function, you have a local variable named choice with the four direction represented in a string. I should one of this number at random and then remove it, and run the dig function on this direction recursively.
Since the variable is local the list is rebuilt automagically for each new cell you travel.
So for a clear and simple answer, no, you don't need to create other vector list, it's not something that gets modified (which you could create constant array :D)
Also, placing the createVectorList call in start of layout would make more sense (:
Hope I was clear.
Edit: you can redownload my capx, I implemented multiple steps (another constant to control how many)