Simple Fractal square

coords = {{0, 0}, {0, 1}, {1, 1}, {1, 0}};
tf = Composition[TranslationTransform[{1/2, 0}], ScalingTransform[{1/2, 1/2}]]
n = 4;
rects = NestList[tf /@ # &, coords, n];
Graphics[{EdgeForm[Black], Rectangle[], White, Polygon[Most/@rects], Polygon@Last@rects}]

enter image description here

Row @ Table[With[{rects = NestList[tf /@ # &, coords, n]}, 
 Graphics[{ EdgeForm[Black], Rectangle[], White, 
  Polygon[Most /@ rects], Polygon @ Last @ rects}, ImageSize -> 200]], {n, 0, 5}]

enter image description here


n = 100;
T1 = Developer`ToPackedArray[{{-1., 0.}, {-0.5, 0.}, {-0.5, 0.5}}];
T2 = Developer`ToPackedArray[{{-0.5, 0.5}, {0., 0.5}, {0., 1.}}];
Graphics[{
  Polygon[Table[0.5^k T1, {k, 0, n}]],
  Polygon[Table[0.5^k T2, {k, 0, n}]]
  }]

enter image description here


Inspired by @HenrikSchumacher:

Graphics@NestList[Scale[#, 1/2, {0, 0}] &, 
  Polygon[{{{-2, 0}, {-1, 0}, {-1, 1}}, {{-1, 1}, {0, 1}, {0, 2}}}], 10]

enter image description here

This can be also shortened to:

Graphics@NestList[Scale[#, 1/2, {0, 0}] &, 
  Polygon[{{-2, 0}, {-1, 0}, {-1, 1}, {0, 1}, {0, 2}}], 10]