Puyo Puyo by hide24

t=proc{|_,i|$&==_[i,1]&&[_[i]=1,9,-1,-9].map{|j|t[_,i+j]}
_.count'\x01'}
gets p
$.+=?d.times{sub! /(\w)(.{8}) /m,' \2\1'}while$_>gsub(/\w/){t[$_*1,$`.size]<4?$&:' '}
puts$_,"#{$./?d} chains"

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

download

return top