Re: Perl Quiz of the Week #24 (Turing Machine simulation)
Ronald J Kimball <[email protected]>
| Newsgroups | gmane.comp.lang.perl.qotw.discuss |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Sep 15, 2004 at 11:53:21AM -0400, colin.rafferty-/PgpppG8B+R7qynMiXIxWgC/[email protected] wrote: > John J. Trammell wrote: > > I'd say this is a perfect example of a customization that a user may > > wish to apply, but this should be implemented via command-line options, > > I disagree. I think that without it, you cannot specify any finite > initial state of a turing machine. You are mistaken. You can easily include instructions to move the tape head to the appropriate position on the tape before executing the actual program. Much like more tapes, more tape-heads, more registers, etc., this is an improvement that does not increase the actual computing power of the Turing machine. > And since it is a defaulted third parameter, it follows perfectly. It does follow very nicely. I might add it to my own program. But it's not necessary for a fully functional Turing machine. > Anyway, that's how I'm going to implement it, but it's a minor detail. > The interesting part is trying to model an infinite tape. Possible spoiler: don't try to allocate an infinite tape at the beginning of your program. ;) Ronald