15 May 20:25
[SUMMARY] The Turing Machine (#162)
From: Matthew Moss <matthew.moss <at> gmail.com>
Subject: [SUMMARY] The Turing Machine (#162)
Newsgroups: gmane.comp.lang.ruby.general
Date: 2008-05-15 18:26:44 GMT
Subject: [SUMMARY] The Turing Machine (#162)
Newsgroups: gmane.comp.lang.ruby.general
Date: 2008-05-15 18:26:44 GMT
While waiting for 48 hours to pass, several examples of Turing Machine
code were sent in, including one example of over 1,500 lines,
generated by code. Most others were simpler, handcrafted rulesets and
tapes, dealing primarily with the limited input set of binary numbers.
This kept code size smaller and easier to understand.
A thought occurred to me that we might make an Extended Turing
Machine, so we would no longer have to eliminate very repetitive state
information. To take a small portion of one example:
...
mark_start v mark_start v L
mark_start w mark_start w L
mark_start x mark_start x L
mark_start y mark_start y L
mark_start z mark_start z L
mark_start _ mark_end S R
mark_end a mark_end a R
mark_end b mark_end b R
mark_end c mark_end c R
mark_end d mark_end d R
...
Using a regular expression for the second argument with an implicit
grouping, we could write our Turing Machines more easily.
...
mark_start [a-z] mark_start $1 L
mark_start _ mark_end S R
mark_end [a-z] mark_end $1 R
(Continue reading)
RSS Feed