Cody

# Problem 52. What is the next step in Conway's Life?

Solution 2950960

Submitted on 15 Sep 2020 by Drake Madison
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
A = [ ... 1 1 0 0 0 1 0 0 1 1 0 0 0 0 0 0]; B = [ ... 1 1 0 0 0 0 1 0 1 1 0 0 0 0 0 0]; assert(isequal(gameOfLife(A),B))

r = 1 c = 1 nei_r = 4 1 2 4 2 4 1 2 nei_r = 4 1 2 4 2 4 1 2 nei_c = 4 4 4 1 1 2 2 2 nei_c = 4 4 4 1 1 2 2 2 r = 2 c = 1 nei_r = 1 2 3 1 3 1 2 3 nei_r = 1 2 3 1 3 1 2 3 nei_c = 4 4 4 1 1 2 2 2 nei_c = 4 4 4 1 1 2 2 2 r = 3 c = 1 nei_r = 2 3 4 2 4 2 3 4 nei_r = 2 3 4 2 4 2 3 4 nei_c = 4 4 4 1 1 2 2 2 nei_c = 4 4 4 1 1 2 2 2 r = 4 c = 1 nei_r = 3 4 5 3 5 3 4 5 nei_r = 3 4 1 3 1 3 4 1 nei_c = 4 4 4 1 1 2 2 2 nei_c = 4 4 4 1 1 2 2 2 r = 1 c = 2 nei_r = 4 1 2 4 2 4 1 2 nei_r = 4 1 2 4 2 4 1 2 nei_c = 1 1 1 2 2 3 3 3 nei_c = 1 1 1 2 2 3 3 3 r = 2 c = 2 nei_r = 1 2 3 1 3 1 2 3 nei_r = 1 2 3 1 3 1 2 3 nei_c = 1 1 1 2 2 3 3 3 nei_c = 1 1 1 2 2 3 3 3 r = 3 c = 2 nei_r = 2 3 4 2 4 2 3 4 nei_r = 2 3 4 2 4 2 3 4 nei_c = 1 1 1 2 2 3 3 3 nei_c = 1 1 1 2 2 3 3 3 r = 4 c = 2 nei_r = 3 4 5 3 5 3 4 5 nei_r = 3 4 1 3 1 3 4 1 nei_c = 1 1 1 2 2 3 3 3 nei_c = 1 1 1 2 2 3 3 3 r = 1 c = 3 nei_r = 4 1 2 4 2 4 1 2 nei_r = 4 1 2 4 2 4 1 2 nei_c = 2 2 2 3 3 4 4 4 nei_c = 2 2 2 3 3 4 4 4 r = 2 c = 3 nei_r = 1 2 3 1 3 1 2 3 nei_r = 1 2 3 1 3 1 2 3 nei_c = 2 2 2 3 3 4 4 4 nei_c = 2 2 2 3 3 4 4 4 r = 3 c = 3 nei_r = 2 3 4 2 4 2 3 4 nei_r = 2 3 4 2 4 2 3 4 nei_c = 2 2 2 3 3 4 4 4 nei_c = 2 2 2 3 3 4 4 4 r = 4 c = 3 nei_r = 3 4 5 3 5 3 4 5 nei_r = 3 4 1 3 1 3 4 1 nei_c = 2 2 2 3 3 4 4 4 nei_c = 2 2 2 3 3 4 4 4 r = 1 c = 4 nei_r = 4 1 2 4 2 4 1 2 nei_r = 4 1 2 4 2 4 1 2 nei_c = 3 3 3 4 4 5 5 5 nei_c = 3 3 3 4 4 1 1 1 r = 2 c = 4 nei_r = 1 2 3 1 3 1 2 3 nei_r = 1 2 3 1 3 1 2 3 nei_c = 3 3 3 4 4 5 5 5 nei_c = 3 3 3 4 4 1 1 1 r = 3 c = 4 nei_r = 2 3 4 2 4 2 3 4 nei_r = 2 3 4 2 4 2 3 4 nei_c = 3 3 3 4 4 5 5 5 nei_c = 3 3 3 4 4 1 1 1 r = 4 c = 4 nei_r = 3 4 5 3 5 3 4 5 nei_r = 3 4 1 3 1 3 4 1 nei_c = 3 3 3 4 4 5 5 5 nei_c = 3 3 3 4 4 1 1 1

2   Pass
A = [ ... 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0]; B = [ ... 1 0 1 1 1 0 0 0 0 0 1 1 0 1 1 0]; assert(isequal(gameOfLife(A),B))

r = 1 c = 1 nei_r = 4 1 2 4 2 4 1 2 nei_r = 4 1 2 4 2 4 1 2 nei_c = 4 4 4 1 1 2 2 2 nei_c = 4 4 4 1 1 2 2 2 r = 2 c = 1 nei_r = 1 2 3 1 3 1 2 3 nei_r = 1 2 3 1 3 1 2 3 nei_c = 4 4 4 1 1 2 2 2 nei_c = 4 4 4 1 1 2 2 2 r = 3 c = 1 nei_r = 2 3 4 2 4 2 3 4 nei_r = 2 3 4 2 4 2 3 4 nei_c = 4 4 4 1 1 2 2 2 nei_c = 4 4 4 1 1 2 2 2 r = 4 c = 1 nei_r = 3 4 5 3 5 3 4 5 nei_r = 3 4 1 3 1 3 4 1 nei_c = 4 4 4 1 1 2 2 2 nei_c = 4 4 4 1 1 2 2 2 r = 1 c = 2 nei_r = 4 1 2 4 2 4 1 2 nei_r = 4 1 2 4 2 4 1 2 nei_c = 1 1 1 2 2 3 3 3 nei_c = 1 1 1 2 2 3 3 3 r = 2 c = 2 nei_r = 1 2 3 1 3 1 2 3 nei_r = 1 2 3 1 3 1 2 3 nei_c = 1 1 1 2 2 3 3 3 nei_c = 1 1 1 2 2 3 3 3 r = 3 c = 2 nei_r = 2 3 4 2 4 2 3 4 nei_r = 2 3 4 2 4 2 3 4 nei_c = 1 1 1 2 2 3 3 3 nei_c = 1 1 1 2 2 3 3 3 r = 4 c = 2 nei_r = 3 4 5 3 5 3 4 5 nei_r = 3 4 1 3 1 3 4 1 nei_c = 1 1 1 2 2 3 3 3 nei_c = 1 1 1 2 2 3 3 3 r = 1 c = 3 nei_r = 4 1 2 4 2 4 1 2 nei_r = 4 1 2 4 2 4 1 2 nei_c = 2 2 2 3 3 4 4 4 nei_c = 2 2 2 3 3 4 4 4 r = 2 c = 3 nei_r = 1 2 3 1 3 1 2 3 nei_r = 1 2 3 1 3 1 2 3 nei_c = 2 2 2 3 3 4 4 4 nei_c = 2 2 2 3 3 4 4 4 r = 3 c = 3 nei_r = 2 3 4 2 4 2 3 4 nei_r = 2 3 4 2 4 2 3 4 nei_c = 2 2 2 3 3 4 4 4 nei_c = 2 2 2 3 3 4 4 4 r = 4 c = 3 nei_r = 3 4 5 3 5 3 4 5 nei_r = 3 4 1 3 1 3 4 1 nei_c = 2 2 2 3 3 4 4 4 nei_c = 2 2 2 3 3 4 4 4 r = 1 c = 4 nei_r = 4 1 2 4 2 4 1 2 nei_r = 4 1 2 4 2 4 1 2 nei_c = 3 3 3 4 4 5 5 5 nei_c = 3 3 3 4 4 1 1 1 r = 2 c = 4 nei_r = 1 2 3 1 3 1 2 3 nei_r = 1 2 3 1 3 1 2 3 nei_c = 3 3 3 4 4 5 5 5 nei_c = 3 3 3 4 4 1 1 1 r = 3 c = 4 nei_r = 2 3 4 2 4 2 3 4 nei_r = 2 3 4 2 4 2 3 4 nei_c = 3 3 3 4 4 5 5 5 nei_c = 3 3 3 4 4 1 1 1 r = 4 c = 4 nei_r = 3 4 5 3 5 3 4 5 nei_r = 3 4 1 3 1 3 4 1 nei_c = 3 3 3 4 4 5 5 5 nei_c = 3 3 3 4 4 1 1 1

### Community Treasure Hunt

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

Start Hunting!