■ [ruby] shinhさんの迷路ゴルフ解読した ビフォー: q=gets(p)*1,~/S/ (a,i,*q=q a[i]<?S&&a[i]=?$ 4.times{|x|q+=[a*1,x]if$_[x=-~x%3*-~~/$/-~/$/+-x/2+i]!=$_[x]=?*})while/G/ puts a http://shinh.skr.jp/m/?date=20100113#p06 アフター: seen = gets(nil) queue = [[seen.dup, ~/S/]] wid = ~/$/ while seen =~ /G/ maze, here = *queue.shift maze[here] = ?$ unless maze[here] == ?S 4.times{|k| d = (k+1) % 3 n = here + (d-1)*wid + (d + -k