Task

Draw a Cantor set.



See details at this Wikipedia webpage:   Cantor set

const WIDTH=81, HEIGHT=5;
var lines=HEIGHT.pump(List,List.createLong(WIDTH,"\U2588;").copy);  // full block
 
fcn cantor(start,len,index){
   (seg:=len/3) or return();
   foreach i,j in ([index..HEIGHT-1], [start + seg .. start + seg*2 - 1]){
      lines[i][j]=" ";
   }
   cantor(start, seg, index + 1);
   cantor(start + seg*2, seg, index + 1);
}(0,WIDTH,1);
 
lines.pump(Console.println,"concat");