$_=$$;$a=$"x5;@a=/4/?('b yyg',"y$a"):/6/?(gbyyrb,brbgyr,rgbgyy,yrrbgg,ybgrbg,'g b',$a.b,$a.r):();print"|",@a[-$_]||$"x6,"| "for-12..0;print"+------+ ",/4/?9:/6/?2:19," chains"
Note that non-ascii characters in the above source code will be escaped (such as \x9f).