generate a matrix in spiral order