Cody

# Problem 45270. Game of life - 02

Solution 2097749

Submitted on 18 Jan 2020 by William
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
x = [1 0;1 1]; n=30; r=[50;51;50;51]; c=[50;50;51;51]; [y1,y2] = find(gameoflife_4(x,n)); assert(isequal(r,y1)) assert(isequal(c,y2))

2   Pass
x = [1,0;1,1;0,1]; n=10; r=[51;50;52;50;52;51]; c=[49;50;50;51;51;52]; [y1,y2] = find(gameoflife_4(x,n)); assert(isequal(r,y1)) assert(isequal(c,y2))

3   Pass
x = [0,1,0;0,0,1;1,1,1]; n=100; r=[77;75;77;76;77]; c=[75;76;76;77;77]; [y1,y2] = find(gameoflife_4(x,n)); assert(isequal(r,y1)) assert(isequal(c,y2))

4   Pass
x = [1 0 0 1 1;0 1 1 0 0;0 1 0 0 0;1 1 0 0 1; 0 1 1 1 0]; n=30; r=[54,55,53,56,54,55]'; c=[52,52,53,53,54,54]'; [y1,y2] = find(gameoflife_4(x,n)); assert(isequal(r,y1)) assert(isequal(c,y2))

5   Pass
x=[1,1,1,1,1;1,1,0 0 0;1,0 0 0 1; 1 1 1 0 0; 0 0 1 1 1]; n=15; r=[45 46 47 53 54 55 44 48 51 52 54 55 44 49 50 45 46 49 50 56 47 48 51 56 52 55]; c=[50 50 50 50 50 50 51 51 51 51 51 51 52 52 52 53 53 53 53 53 54 54 54 54 55 55] [y1,y2] = find(gameoflife_4(x,n)); assert(isequal(r,y1)) assert(isequal(c,y2))

c = 50 50 50 50 50 50 51 51 51 51 51 51 52 52 52 53 53 53 53 53 54 54 54 54 55 55

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!