Re: Perl Quiz of the Week #24 (Turing Machine simulation)

colin.rafferty-/PgpppG8B+R7qynMiXIxWgC/[email protected]
Newsgroups gmane.comp.lang.perl.qotw.discuss
Message-ID <[email protected]>
Zed Lopez wrote:

> Your program should take two parameters: the filename of a file
> containing the state transition instructions, and the tape's initial
> contents. The filename is required.    

> If an initial value for the tape is specified, the read/write head
> begins over the first character of that initial value.  

I would change the specification of the program to allow for a third
argument which is the head's initial location on the tape.  

It's value is any number, positive or negative, which specifies the
head's position relative to the first character of the second
argument.

By default, the third argument is 0, which is the first character of
the initial value.

I like to quiz.  I wrote a quick solution, but it's taking too long
initializing the tape. :-)

-- 
Colin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.