box world by jonathan camacho

$t=<>;chomp$t;$l=length$t;
@grid=(" "x($l+1))x($l+1);
substr($grid[0],0,$l,$t);
substr($grid[$l],1,$l,reverse($t));
for(split(//,$t)){substr($grid[$c],$l,1,$_);substr($grid[$l-$c],0,1,$_);$c++}
for(@grid){print"$_\n"}

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

download

return to the top page