Cody

Solution 518264

Submitted on 30 Oct 2014 by J.R.! Menzinger
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
%% N = 4; xn=[0 1 1 0 -1 -1 -1 0 1 2 2 2 2 1 0 -1]; yn=[0 0 1 1 1 0 -1 -1 -1 -1 0 1 2 2 2 2]; correct=[xn' yn']; [x,y]=Ulam_Spiral_2(N); assert(isequal([x y],correct))

2   Pass
%% N = 5; xn=[0 1 1 0 -1 -1 -1 0 1 2 2 2 2 1 0 -1 -2 -2 -2 -2 -2 -1 0 1 2]; yn=[0 0 1 1 1 0 -1 -1 -1 -1 0 1 2 2 2 2 2 1 0 -1 -2 -2 -2 -2 -2]; correct=[xn' yn']; [x,y]=Ulam_Spiral_2(N); assert(isequal([x y],correct))