re: Motion "N"

"Michael C. Toren" <[email protected]> Fri, 17 Sep 2004 12:15:42 -0400
Newsgroups gmane.comp.lang.perl.qotw.discuss
Message-ID <[email protected]>
On Fri, Sep 17, 2004 at 10:26:42AM -0400, Mark Jason Dominus wrote:
> The program supports a tape head motion of 'N' = 'none'; to suppress
> this feature, delete that entry from the %motion hash.

In writing Turing programs, I find myself using no-ops such as the
following to simulate no motion between states "Foo" and "Bar":

	Foo 0 NoMoveBar 1 L

	NoMoveBar _ Bar _ R
	NoMoveBar 0 Bar 0 R
	NoMoveBar 1 Bar 1 R

	Bar ...

Perhaps this would make a useful addition to the macro language, in
order keep the Turing machine pure?

-mct

-- 
perl -e'$u="\4\5\6";sub H{8*($_[1]%79)+($_[0]%8)}sub G{vec$u,H(@_),1}sub S{vec
($n,H(@_),1)=$_[2]}$_=q^{P`clear`;for$iX){PG($iY)?"O":" "forX8);P"\n"}for$iX){
forX8){$c=scalar grep{G@$_}[$i-1Y-1Z-1YZ-1Y+1ZY-1ZY+1Z+1Y-1Z+1YZ+1Y+1];S$iY,G(
$iY)?$c=~/[23]/?1:0:$c==3?1:0}}$u=$n;select$M,$C,$T,.2;redo}^;s/Z/],[\$i/g;s/Y
/,\$_/xg;s/X/(0..7/g;s/P/print+/g;eval' #     Michael C. Toren <[email protected]>