Generates a random grid of NxN dimension