char*p,*q[]={"|y |\n|b yyg|\n","| r|\n| b|\n|g b|\n|ybgrbg|\n|yrrbgg|\n|rgbgyy|\n|brbgyr|\n|gbyyrb|\n",""};n;main(m,s){for(;n++<5;)p=gets(s)+2;for(;m++<=*p%55/5+5;)puts("| |");printf("%s+------+\n%d chains",q[*p%10/3],*p%56%23);}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).