Alpha Chen | 16 May 00:00

Re: The Turing Machine (#162)

Thanks for the writeup!

But a small nitpick... =)

On May 15, 11:26 am, Matthew Moss <matthew.m...@gmail.com> wrote:
>       puts @tape.sort.map {|_,v| v}.join.gsub(/^_*|_*$/, '')
>
> "useful" content of the tape is displayed. Chen's regular expression
> (slightly corrected in the code shown above), removes all blanks
> immediately after the start of the line _or_ immediately preceding the
> end of the line.

Shouldn't the regex return "a" instead of "a_b" for "_a_b_"?


Gmane