Cody

Solution 910942

Submitted on 18 Jun 2016 by Richard Zapor
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
rule = 30; n = 3; y_correct = [0 0 0 1 0 0 0 0 0 1 1 1 0 0 0 1 1 0 0 1 0 0 1 0 1 1 1 0] ; assert(isequal(cellular_automaton(rule,n),y_correct))

2   Pass
rule = 49; n = 2; y_correct = [0 0 1 0 0 0 0 0 1 0 0 1 0 0 0]; assert(isequal(cellular_automaton(rule,n),y_correct))

3   Pass
rule = 90 n = 4 y_correct = [0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0]; assert(isequal(cellular_automaton(rule,n),y_correct))

rule = 90 n = 4