Application from a non 2x4.
js> importPackage(net.cscott.sdr.calls);
js> importPackage(net.cscott.sdr.calls.ast);
js> FormationList = FormationList.js(this); undefined;
js> const SD = StandardDancer;
js> f1 = FormationList.EIGHT_CHAIN_THRU.mapStd([SD.COUPLE_4_BOY, SD.COUPLE_1_GIRL, SD.COUPLE_4_GIRL, SD.COUPLE_1_BOY]); f1.toStringDiagram("|")
|4Bv 1Gv
|
|4G^ 1B^
|
|3Bv 2Gv
|
|3G^ 2B^
js> f2 = FormationList.LINES_FACING_OUT.mapStd([SD.COUPLE_4_BOY, SD.COUPLE_4_GIRL, SD.COUPLE_1_BOY, SD.COUPLE_1_GIRL]) ; f2.toStringDiagram("|")
|4B^ 4G^ 1B^ 1G^
|
|3Gv 3Bv 2Gv 2Bv
js> // merge these formations
js> f3 = f2; [SD.COUPLE_1_BOY, SD.COUPLE_1_GIRL, SD.COUPLE_3_BOY, SD.COUPLE_3_GIRL].forEach(function(d) { f3 = f3.move(d, f1.location(d)); });
js> f3.toStringDiagram("|")
| 1Gv
|
|4B^ 4G^ 1B^
|
| 3Bv 2Gv 2Bv
|
| 3G^
js> ds = new DanceState(new DanceProgram(Program.C4), f3); undefined;
js> Evaluator.parseAndEval(ds, "slim down")
js> // check result and confirm there is no roll or sweep
js> ds.currentFormation().toStringDiagramWithDetails("|")
| 4G^ ^
|
| 4B^ 1Gv 1B^ ^ v ^
|
|3Bv 3G^ 2Bv v ^ v
|
| 2Gv v
js> // check sashay flags
js> ds.movements(SD.COUPLE_1_BOY)
[DancerPath[from=1,1,n,to=3,1,n,time=2,pointOfRotation=<null>,flags=[SASHAY_START, SASHAY_FINISH]]]
js> ds.movements(SD.COUPLE_1_GIRL)
[DancerPath[from=1,3,s,to=1,1,s,time=2,pointOfRotation=<null>]]
js> // quickly check a more typical example
js> ds = new DanceState(new DanceProgram(Program.C4), FormationList.PARALLEL_RH_WAVES); undefined
js> ds.currentFormation().toStringDiagram("|")
|^ v ^ v
|
|^ v ^ v
js> Evaluator.parseAndEval(ds, "slim down")
js> ds.currentFormation().toStringDiagram("|")
|v ^
|
|^ v
|
|^ v
|
|v ^