Microsoft interview question

Code a spiral within a grid