evinw / spiralmatrix

prints a square spiral with coordinates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spiral Matrix

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.

About

prints a square spiral with coordinates


Languages

Language:Python 100.0%