Procedural generation fun

How did you instantiate your mesh for make the wall of cubes? Im trying to make a maze from cubes like a laberynth from a static mesh? (well Im on C++, thought I accept suguestions)