Skip to content

Instantly share code, notes, and snippets.

View igordonin's full-sized avatar

Igor Donin igordonin

View GitHub Profile
@igordonin
igordonin / spiral.js
Last active May 28, 2022 02:26
Spiral algorithm
// matrix(5)
// [[1, 2, 3, 4, 5],
// [16, 17, 18, 19, 6],
// [15, 24, 25, 20, 7],
// [14, 23, 22, 21, 8],
// [13, 12, 11, 10, 9]]
function Position(n) {
this.row = 0;
this.column = 0;