First spiral, then diagonal – codegolf.stackexchange.com

Given a positive input number n, construct a spiral of numbers from 1 to n^2, with 1 in the top-left, spiraling inward clockwise. Take the sum of the diagonals (if n is odd, the middle number n^2 is ...

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

Artikel Terkait

0 Comment to "First spiral, then diagonal – codegolf.stackexchange.com"