expand text by jonathan camacho

($m,$t)=<>;chomp$t;
print@f=map({$_ x$m}split(//,$t));print$/;
for(0 ..$m-3){print map({$_ ." "x($m-2).$_ }split(//,$t) );print$/}
print@f

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page