
::<state
	<Tm 1 2 1 1 -1>;
	<Tm 1 1 1 2 -1>;
	<Tm 1 0 2 1 1 >;
	<Tm 2 2 1 0 1 >;
	<Tm 2 1 2 2 1 >;
	<Tm 2 0 1 2 -1>;
	<Tm #s #c #s #c 0>;
>;

::<TuringMachine
	<head 0>
	;
	<state 1>
	;
	<init>
		::self <delVar tape>
		<set 0>
	;
	<set #color>
		<head #head>
		::self <setArray tape #color #head>
	;
	<get #color #pos>
		( <tape #color #pos>
		| <is #color 0>)
	;
	<get #color>
		<head #head>
		<tape #color #head>
	;
	<transition>
		<head #head>
		<state #state>
		<get #color #head>
		::state <Tm #state #color #state1 #color1 #offset>
		<set #color1>
		<#head1 = #head + #offset>
		::self <setVar head #head1>
		::self <setVar state #state1>
	;
	<printTuringMachine>
		<head #head>
		<state #state>
		<for (#i -19 19)
			<get #color #i>
			( <compare #i == #head>
			  <printf <%_"1d"  #state>>
			|
			  <printf " ">
			)
			(
			  <compare #color == 0>
			  <printf "_">
			|
			  <compare #color == 1>
			  <printf "%">
			|
			  <compare #color == 2>
			  <printf "#">
			| 
			  <#code = 0x37+#color>
			  <printf ::sys <concatcode _ (#code)>>
			)
		>
		<print>
	;
			
			
>;

<wtu>
	::TuringMachine <init>
	<for (#i 100)
		::TuringMachine <printTuringMachine>
		::TuringMachine <transition>>
	;

? <wtu>;

