Suanpan abacus by houmei

{W=length($0);E="==";F="||";P="  (__)";Q="   || ";for(i=0;i<W;i++){A[i]=substr($0,i+1,1);E=E "======"}print"|\\" E "/|";p(0,P,P);p(4,Q,P);p(0,Q,Q);p(4,P,Q);print"|<" E ">|";for(i=0;i<W;i++)A[i]-=A[i]>4?5:0;for(j=0;j<5;j++)p(j,P,Q);for(j=0;j<5;j++)p(j,Q,P);print"|/" E "\\|"}function p(j,h,l){n=F;for(i=0;i<W;i++)if(A[i]>j)n=n h;else n=n l;print n "  " F}

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

download

return to the top page