prints a square spiral with coordinates.
a matrix of size n*n, then it sets the initial position and direction of the spiral, then it iterates over the range of numbers and sets the current position to the current number and check if the next position in the current direction is out of bounds, if it is, the direction will change, then it moves to the next position.