Here's an approach without If
or For
. First somea helper functionsfunction:
f[x_](* :=Thanks mrowto Belisarius for the mrow& suggestion *)
g[x_] := NestWhile[fNestWhile[mrow&, x, MemberQ[x - #, 0] &]
Then:
NestList[g, mrow, 9] // MatrixPlot
Where mrow
is as you've defined it in the question.