Time for an 2014 update…

This commit is contained in:
Ingy döt Net 2014-01-17 05:32:22 +00:00
parent 372c577f83
commit 09687c4926
2520 changed files with 34227 additions and 7318 deletions

View file

@ -4,13 +4,8 @@ def spiral(n)
delta = [[1,0], [0,1], [-1,0], [0,-1]].cycle
x, y, value = -1, 0, -1
for run in runs
dx,dy = delta.next
run.times do |i|
x += dx
y += dy
value += 1
spiral[y][x] = value
end
dx, dy = delta.next
run.times { spiral[y+=dy][x+=dx] = (value+=1) }
end
spiral
end