<<"MultiwaySystems/Multiway.m";
mkrule[rule_]:=ToCharsX[(#1/.({a_,b_}{c_,d_}){a,-1,-1,b}{-1,c,d,-1}&)/@rule]
ToCharsX[rule_]:=rule/.x:{___Integer}StringJoin@@(x/.{0"A",1"B",-1"-"})
Show[BlockCARuleGraphic[First[Last[NumberedBlockRule[60,2,2]]]]];
NEED to get this symmetrical; Erik's stupid code does it wrong....
Show[BlockGridCAGraphics[(Take[#1,{2,-2}]&)/@FromCAState[CAEvolveList[NumberedBlockRule[60,2,2],Join[Table[0,{6}],{1,1},Table[0,{8}]],6]],2,.5]];
dhrules={"B--B""-AA-","B--A""-BB-","A--B""-BB-","A--A""-AA-","---A-""---AA--","-A---""--AA---"};
mwcolormap={"A"GrayLevel[0.85`],"B"GrayLevel[0],"-"GrayLevel[.5]};
Show[MWCharRuleGraphic[dhrules]];
SortStrings[list_]:=Sort[list,StringCompare[Last[#1],Last[#2]]&]
StringCompare[s1_,s2_]:=OrderedQ@(FromDigits[ToExpression/@Characters[StringReplace[StringReplace[#,{"--""1"}],{"-""2","A""","B"""}]],3]&/@{s1,s2})
MWEvolGraphicNonSorted[hist_]:=Module{hh,rp,arrows,t1,t2},hh=Map[Last,hist,{2}];rp=MapIndexed(#2〚2〛-1)1.2+Length[hh〚#2〚1〛,i〛],-4.4(#2〚1〛-1)&,hh,{2};arrows=FlattenTablet1=Position[hh〚y-1〛,hist〚y,x,1〛,1,1]1,1;t2=Position[hh〚y〛,hist〚y,x,2〛,1,1]1,1;rpy-1,t1+Length[hh〚y-1,t1〛],-.3,rpy,t2+Length[hh〚y,t2〛],1.3,{y,2,Length[hist]},{x,1,Length[hist〚y〛]},1;Graphics[{MapThread[rowblock,{Flatten[hh,1],Flatten[rp,1]}],(Arrow[#1,.5,ArrowStyleAbsoluteThickness[.25]]&)/@arrows},AspectRatioAutomatic]
#2〚2〛-1
∑
i=1
1
2
1
2
mwpixxc[{rr_,init_},t_]:=MWEvolGraphicNonSorted[FromCharsX[SortStrings/@MWEvolveListT[rr,{init},t]]]
Show[mwpixxc[{dhrules,"---AA--BB--AA---"},11],PlotRange{{-3,80},Automatic}];
Show[mwpixxc[{dhrules,"---AA--BB--AA---"},11],PlotRange{{-3,140},Automatic}];
A multiway system can emulate a block cellular automaton by having the successive steps be picked out by some criterion from the possible strings generated (cf. Chapter 9).
The sequences at each step are sorted so that whenever the relevant strings appear, they are sorted first.
[[[COMPARE: Chapter-09/Pending1.nb]]]