Skip to main content
added 327 characters in body
Source Link
MelaGo
  • 9.1k
  • 1
  • 11
  • 26
shape = {{1, 0, 1}, {0, 1, 0}, {1, 0, 1}};
newshape[oldshape_] := 
 Flatten[Table[
   Table[p shape, {p, row}], {row, oldshape}], {{1, 3}, {2, 4}}]

fr = NestList[newshape, shape, 3];
Row[ArrayPlot[#, Frame -> None, ImageSize -> 200] & /@ fr, Spacer[5]]

enter image description here

Or

Row[ColorNegate@Image[#, ImageSize -> 200] & /@ fr, Spacer[5]]

enter image description here

Updated with alternative:

newshape2[oldshape_] := 
 ArrayFlatten[Table[Table[p shape, {p, row}], {row, oldshape}]]

fr2 = NestList[newshape2, shape, 3];
Row[ArrayPlot[#, Frame -> None, ImageSize -> 200] & /@ fr2, Spacer[5]]

enter image description here

shape = {{1, 0, 1}, {0, 1, 0}, {1, 0, 1}};
newshape[oldshape_] := 
 Flatten[Table[
   Table[p shape, {p, row}], {row, oldshape}], {{1, 3}, {2, 4}}]

fr = NestList[newshape, shape, 3];
Row[ArrayPlot[#, Frame -> None, ImageSize -> 200] & /@ fr, Spacer[5]]

enter image description here

Or

Row[ColorNegate@Image[#, ImageSize -> 200] & /@ fr, Spacer[5]]

enter image description here

shape = {{1, 0, 1}, {0, 1, 0}, {1, 0, 1}};
newshape[oldshape_] := 
 Flatten[Table[
   Table[p shape, {p, row}], {row, oldshape}], {{1, 3}, {2, 4}}]

fr = NestList[newshape, shape, 3];
Row[ArrayPlot[#, Frame -> None, ImageSize -> 200] & /@ fr, Spacer[5]]

enter image description here

Or

Row[ColorNegate@Image[#, ImageSize -> 200] & /@ fr, Spacer[5]]

enter image description here

Updated with alternative:

newshape2[oldshape_] := 
 ArrayFlatten[Table[Table[p shape, {p, row}], {row, oldshape}]]

fr2 = NestList[newshape2, shape, 3];
Row[ArrayPlot[#, Frame -> None, ImageSize -> 200] & /@ fr2, Spacer[5]]

enter image description here

Source Link
MelaGo
  • 9.1k
  • 1
  • 11
  • 26

shape = {{1, 0, 1}, {0, 1, 0}, {1, 0, 1}};
newshape[oldshape_] := 
 Flatten[Table[
   Table[p shape, {p, row}], {row, oldshape}], {{1, 3}, {2, 4}}]

fr = NestList[newshape, shape, 3];
Row[ArrayPlot[#, Frame -> None, ImageSize -> 200] & /@ fr, Spacer[5]]

enter image description here

Or

Row[ColorNegate@Image[#, ImageSize -> 200] & /@ fr, Spacer[5]]

enter image description here