I messed around with your code, and discovered that you are doing something
really weird in maze.c, which messes up the external variables in testlevel.c. The Nspire's support for global variables is pretty delicate at the moment, so if something doesn't work, try moving the contents of testlevel.c into main().
You probably want to have generate() take paramenters, so it should look something like:
void generate(int* maze)
where maze is the array you are writing to.
Oh, and random thought: I feel slightly happier about Ncaster now. With a map that dense, I was expecting it to be unbearably slow, but apparently that's not happening
.