Borderizing Texts by pooq

a=readLines("stdin");c=2;d=e=f={};g=2;for(i in 1:nchar(a)){g=3-g;c=c+1;b=substr(a,i,i);if(b>" "){d=c(d,c("|"," ")[g]);e=c(e,b);f=c(f,c("_","|")[g])}else{g=2;c=c+2;d=c(d," | ");e=c(e," | ");f=c(f,"_|_")}};cat(" ",rep("_",c),"
| ",d," |
| ",e," |
|_",f,"_|",sep="")

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

download

return to the top page