/* -*- mode:text; indent-tabs-mode:nil; -*- */

// SD -- square dance caller's helper.
//
//    Copyright (C) 1990-2021  William B. Ackerman.
//
//    This file is part of "Sd".
//
//    ===================================================================
//
//    If you received this file with express permission from the licensor
//    to modify and redistribute it it under the terms of the Creative
//    Commons CC BY-NC-SA 3.0 license, then that license applies.  See
//    http://creativecommons.org/licenses/by-nc-sa/3.0/
//
//    ===================================================================
//
//    Otherwise, the GNU General Public License applies.
//
//    Sd is free software; you can redistribute it and/or modify it
//    under the terms of the GNU General Public License as published by
//    the Free Software Foundation; either version 2 of the License, or
//    (at your option) any later version.
//
//    Sd is distributed in the hope that it will be useful, but WITHOUT
//    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
//    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
//    License for more details.
//
//    You should have received a copy of the GNU General Public License,
//    in the file COPYING.txt, along with Sd.  See
//    http://www.gnu.org/licenses/
//
//    ===================================================================
//
//    This is for version 39.


//    Calls database source for Sd -- square dance caller's helper.
//
//    -----------------------------------------------------------------
//
//    The `mkcalls' program must be run once to compile `sd_calls.txt',
//    this file, into `sd_calls.dat', the binary file used by Sd.
//
//    -----------------------------------------------------------------
//
//    The version of this file is as shown below.  This string gets
//    encoded into the database file and then displayed at program
//    startup, and written to every sequence, as the "db" part of the
//    complete version.
//
//    ATTENTION!  If you modify the database, we recommend that
//    you change the version string below to identify the change.
//    This will facilitate tracking errors, since the database version
//    will be written onto every sequence.  Changing the version
//    string is also required by paragraphs 2(a) and 2(c) of the GNU
//    General Public License if you distribute the file.

version "39.36"

call "nothing" mainstream tag nullcall
            dont_use_in_resolve dont_raise_overcast
   nulldefine

call "_nothing, and dont roll" dontshow tag nullcall_noroll
            dont_use_in_resolve
   nulldefine_noroll

call "_nothing, other elongation" dontshow tag nullcall_other_elong
            dont_use_in_resolve dont_raise_overcast
   nulldefine_other_elong

call "_secondary nothing" dontshow tag nullsecond
   nulldefine

call "recenter" mainstream
            dont_use_in_resolve
   recenter

// We make these distinct calls so they won't get confused
// with any other call that gets replaced.
// They get encoded as base_calls base_call_tagger0 .. base_call_tagger3_noref.
// The substitution takes place in get_real_subcall.

call "(base ATC call 0)" dontshow tag tagnullcall0
   nulldefine

call "(base ATC call 1)" dontshow tag tagnullcall1
   nulldefine

call "(base ATC call 2)" dontshow tag tagnullcall2
   nulldefine

call "(base ATC call 3)" dontshow tag tagnullcall3
   nulldefine

call "(base circ call)" dontshow tag circnullcall
   nulldefine

// *************************** START OF TAG CALLS ***************************

// Note!  The base tag calls are not alphabetized.  They appear in the
// menu in the order in which we list them here.

call "tag" mainstream tag plain_tag
            left_means_mirror base_tag_call_1 yield_if_ambiguous
   setup 1x4 2x2 no_cutting_through restriction awkward_centers
      array [C0E C1E A2W A3W]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate
      array [CR0N AL1S]
            alternate_definition [3x3] c4
   setup 1x6 2x3
      array [C0E C1E C2E A3W A4W A5W]
   setup 3x4 2x6 rotate
      array [C11N C0N A10S A1S A3S A8S A5S A6S C4N C7N C9N C2N]
            alternate_definition [4x4] c4
   setup 1x8 2x4
      array [C0E C1E C3E C2E A4W A5W A7W A6W]
            alternate_definition [1x3] c4
   setup 1x4 2x3
      predscantdo
         if miniwave_side_of_out_3n1_line [C1E A0W A1W C2E]
         if couple_side_of_out_3n1_line   [C0E C1E A2W A1W]
            alternate_definition [3x1] c4    // Same as 1x3.
   setup 1x4 2x3
      predscantdo
         if miniwave_side_of_out_3n1_line [C1E A0W A1W C2E]
         if couple_side_of_out_3n1_line   [C0E C1E A2W A1W]

call "left tag" mainstream
            base_tag_call_1
   seq plain_tag [force_left]

call "flip" c1 tag base_tag_call_flip
            base_tag_call_1
   setup 1x4 2x2 restriction forbidden wave_only
      array [C1E A3E A0W C2W]
            alternate_definition [3x3] c4
   setup 3x4 2x6 rotate
      array [C0N A10N C1S A11S A9S C3S A7S C5S A6N C4N C2N A8N]

call "cross flip" c3
            base_tag_call_1
   setup 1x4 2x2 restriction forbidden 2fl_only
      array [C1E C2W A0W A3E]

call "vertical tag" c1 tag vertical_half_tag
            left_means_mirror base_tag_call_1
   setup 2x2 2x2 restriction not_tboned
      preds "Can't do this with phantoms or T-boned people."
         if vert1 [C1S A2S Z0N Z3N]
         if vert2 [0 A1S 0 Z0N]
            alternate_definition [single] c4
   setup 2x1 1x2 rotate
      array [ZM0W 1E]
             alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [Z0N Z1N C2S A3S]
            alternate_definition [3x3] c4
   setup 2x3 2x3 rotate
      array [0 0 0 Z5W Z4W Z3W]
            alternate_definition [4x4] c4
   setup 2x4 2x4 rotate
      array [0 0 0 0 Z7W Z6W Z5W Z4W]

// We don't allow things like "left" or "revert", since they would have
// to be spoken before the "<anyone> start", which isn't natural.
call "@6 start vertical tag" c1 tag anyone_start_vertical_half_tag
            base_tag_call_1
   setup trngl4 2x2 qualifier ntbone dmd_ctrs_1f
      predsnoselect
         if select   [  0   0 C1S A2S 0 0 Z0N Z3N]
         if unselect [Z3N Z0N   0   0 0 0 0 0]
   setup trngl4 2x2 qualifier ntbone dmd_ctrs_mwv
      predsnoselect
         if select   [  0   0 C1S A1S 0 0 Z0N Z0N]
         if unselect [Z3N Z0N   0   0 0 0 0 0]

call "vertical left tag" c2 tag vertical_left_half_tag
            base_tag_call_1
   setup 2x2 2x2 restriction not_tboned
      preds "Can't do this with phantoms or T-boned people."
         if vert1 [C0S A3S Z1N Z2N]
         if vert2 [0 A0S 0 Z1N]
             alternate_definition [single] c4
   setup 2x1 1x2 rotate
      array [ZM1W 0E]
             alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [Z3N Z2N C1S A0S]
            alternate_definition [3x3] c4
   setup 2x3 2x3 rotate
      array [0 0 0 Z0W Z1W Z2W]
            alternate_definition [4x4] c4
   setup 2x4 2x4 rotate
      array [0 0 0 0 Z0W Z1W Z2W Z3W]

call "chase" c3 tag chase_the_half_tag
            left_means_mirror split_large_setups base_tag_call_3
   setup 2x2 2x2
      array [C1S C2S 0 0]
            alternate_definition [single] c4
   setup 2x1 1x2 rotate
      array [0 CR1E]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [0 0 C2S C3S]
            alternate_definition [3x3] c4
   setup 2x3 2x3 rotate
      array [C0E C1E C2E 0 0 0]
            alternate_definition [4x4] c4
   setup 2x4 2x4 rotate
      array [C0E C1E C2E C3E 0 0 0 0]

// We allow both spellings -- "chase your leader" and "chase the tag your leader".
call "chase the tag" c3
            left_means_mirror split_large_setups base_tag_call_2
   setup 2x2 2x2
      array [C1S C2S 0 0]
            alternate_definition [single] c4
   setup 2x1 1x2 rotate
      array [0 CR1E]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [0 0 C2S C3S]
            alternate_definition [3x3] c4
   setup 2x3 2x3 rotate
      array [C0E C1E C2E 0 0 0]
            alternate_definition [4x4] c4
   setup 2x4 2x4 rotate
      array [C0E C1E C2E C3E 0 0 0 0]

call "double pass" c3a
            left_means_mirror base_tag_call_3
   setup 4x1 2x2
      array [ZM0N ZM1N 0 0]
            alternate_definition [3x3] c4
   setup 6x1 2x3
      array [ZM0N ZM1N ZM2N 0 0 0]
            alternate_definition [4x4] c4
   setup 8x1 2x4
      array [ZM0N ZM1N ZM3N ZM2N 0 0 0 0]

call "_start tag the star" dontshow tag start_tagstar
            left_means_mirror
   setup 2x2 dmd rotate restriction not_tboned
      array [0 0 AL2S ZM3W]
            alternate_definition [singlefile] c4
   setup 4x1 dmd
      array [AL0W ZM1N 0 0]

call "turn the diamond @b for tag the star" dontshow tag turndmdn_nostarsubst
   /* This is *NOT* a star call.  If it were, "tag the star reaction" with
      star turn modifications would get screwed up. */
   setup dmd dmd rotate qualifier num 1 none
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate qualifier num 1 none
      array [0 CR1N 0 AL1S]
   setup dmd dmd        qualifier num 2 none
      array [CR2S 0 AL0S 0]
   setup pmd dmd        qualifier num 2 none
      array [0 CR3S 0 AL1S]
   setup dmd dmd rotate qualifier num 3 none
      array [CR2S 0 AL2N 0]
   setup pmd dmd rotate qualifier num 3 none
      array [0 CR3S 0 AL3N]

call "tag the star" c4a
            left_means_mirror singlefile_is_inherited base_tag_call_2
   seq start_tagstar [inherit_left inherit_singlefile]
   seq turndmdn_nostarsubst [insert_number 2]
   seq dropin []

call "tag the star, turn the star 1/4" c4a
            left_means_mirror singlefile_is_inherited base_tag_call_2
   seq start_tagstar [inherit_left inherit_singlefile]
   seq turndmdn_nostarsubst [insert_number 1]
   seq dropin []

call "tag the star, turn the star 3/4" c4a
            left_means_mirror singlefile_is_inherited base_tag_call_2
   seq start_tagstar [inherit_left inherit_singlefile]
   seq turndmdn_nostarsubst [insert_number 3]
   seq dropin []

call "circle the tag" c4a tag circle_the_half_tag
            left_means_mirror split_large_setups base_tag_call_2
   setup 2x2 2x2 restriction not_tboned
      array [0 0 C0E C1E]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [C1E C2E 0 0]
            alternate_definition [3x3] c4
   setup 2x3 2x3
      array [0 0 0 C0E C1E C2E]
            alternate_definition [4x4] c4
   setup 2x4 2x4
      array [0 0 0 0 C0E C1E C2E C3E]

call "circle the @a tag" c4
            neednumber left_means_mirror nxn_is_inherited
            split_large_setups bigmatrix_is_inherited revert_is_inherited fractal_is_inherited
   seq circle_the_half_tag [inherit_left inherit_nxn inherit_bigmatrix]
   seq revert_if_needed [inherit_nxn inherit_revert inherit_fractal]
   seq extend_n [inherit_nxn inherit_bigmatrix]

call "snap the tag" c4a tag snap_the_half_tag
            left_means_mirror base_tag_call_2
   setup 1x4 2x2
      array [1E 0E 3W 2W]

call "dixie tag" c4 tag dixie_half_tag
            left_means_mirror base_tag_call_2
   setup 2x2 2x2
      array [0 0 ZM1N ZM2N]
   // Not required to say "single file" explicitly.  See discussion at "_start dixie style",
   setup 4x1 2x2 qualifier in 2fl_only
      array [ZM3N ZM2N 0 0]
            alternate_definition [singlefile] c4
   setup 4x1 2x2 qualifier in 2fl_only
      array [ZM3N ZM2N 0 0]

// The main <ATC> mechanism uses the word order "dixie tag N/4".  We provide
// this for the other common word order "dixie N/4 tag".
call "dixie @a tag" c4
            neednumber left_means_mirror singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq dixie_half_tag [inherit_left inherit_singlefile]
   seq revert_if_needed [inherit_revert inherit_fractal]
   seq extend_n []

call "loop and tag" c3 tag loop_and_half_tag
            left_means_mirror base_tag_call_2
   setup 2x2 2x2        restriction peelable_box
      array [A1E C3W C2W A0E]
            alternate_definition [magic] c4
   setup 2x2 2x2        restriction peelable_box
      array [A1E C3W A0E C2W]
            alternate_definition [cross] c3
   setup 2x2 2x2        restriction peelable_box
      array [C3W A1E A0E C2W]
            alternate_definition [magic cross] c4
   setup 2x2 2x2        restriction peelable_box
      array [C3W A1E C2W A0E]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate restriction wave_only
      array [A0N C1S]
            alternate_definition [cross single] c4
   setup 1x2 1x2 rotate restriction wave_only
      array [C1S A0N]
            alternate_definition [3x3] c4
   setup 3x2 2x3 rotate restriction peelable_box
      array [A0N A1N A2N C5S C4S C3S]
            alternate_definition [cross 3x3] c4
   setup 3x2 2x3 rotate restriction peelable_box
      array [C3S C4S C5S A2N A1N A0N]
            alternate_definition [4x4] c4
   setup 4x2 2x4 rotate restriction peelable_box
      array [A0N A1N A2N A3N C7S C6S C5S C4S]
            alternate_definition [cross 4x4] c4
   setup 4x2 2x4 rotate restriction peelable_box
      array [C4S C5S C6S C7S A3N A2N A1N A0N]
            alternate_definition [5x5] c4
   setup 5x2 2x5 rotate restriction peelable_box
      array [A0N A1N A2N A3N A4N C9S C8S C7S C6S C5S]
            alternate_definition [cross 5x5] c4
   setup 5x2 2x5 rotate restriction peelable_box
      array [C5S C6S C7S C8S C9S A4N A3N A2N A1N A0N]

call "cross loop and tag" c3
            left_means_mirror split_large_setups base_tag_call_2
   setup 2x2 2x2        restriction peelable_box
      array [C3W A1E A0E C2W]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate restriction wave_only
      array [C1S A0N]
            alternate_definition [3x3] c4
   setup 3x2 2x3 rotate restriction peelable_box
      array [C3S C4S C5S A2N A1N A0N]
            alternate_definition [4x4] c4
   setup 4x2 2x4 rotate restriction peelable_box
      array [C4S C5S C6S C7S A3N A2N A1N A0N]
            alternate_definition [5x5] c4
   setup 5x2 2x5 rotate restriction peelable_box
      array [C5S C6S C7S C8S C9S A4N A3N A2N A1N A0N]

call "invert" c2 tag invert_the_tag_half
            base_tag_call_3
   setup 4x2 2x4 rotate restriction forbidden peelable_box
      array [ZM6W ZM1W AL0E AM7E CM4E CR3E ZM2W ZM5W]
   // This one will likely fail, except for things like "cross invert er's flow".
            alternate_definition [cross] c2
   setup 4x2 2x4 rotate restriction forbidden peelable_box
      array [ZM6W ZM1W CR3E CM4E AM7E AL0E ZM2W ZM5W]
            alternate_definition [3x3] c4
   setup 6x2 3x4 rotate restriction forbidden peelable_box
      array [ZM8W ZM11W ZM1W AL0E AM10E AM9E CM6E CM4E CR3E ZM2W ZM5W ZM7W]
            alternate_definition [4x4] c4
   setup 8x2 4x4 restriction forbidden peelable_box
      array [ZM10N ZM15N ZM3N ZM1N AL0S AM14S AM13S AM12S
             CM8S CM6S CM5S CR4S ZM2N ZM7N ZM11N ZM9N]
            alternate_definition [magic cross] c4
   setup 4x2 2x4 rotate restriction forbidden magic_only
      array [ZM5W ZM1W AL0E CM4E AM7E CR3E ZM2W ZM6W]

call "cross invert" c3a
            base_tag_call_0
   setup 4x2 2x4 rotate restriction forbidden peelable_box
      array [ZM6W ZM1W CR3E CM4E AM7E AL0E ZM2W ZM5W]

call "magic cross invert" c3a
            base_tag_call_0
   setup 4x2 2x4 rotate restriction forbidden magic_only
      array [ZM5W ZM1W AL0E CM4E AM7E CR3E ZM2W ZM6W]

call "continue to invert another 1/4" c4a
            base_tag_call_0 yield_if_ambiguous
   setup qtag 2x4 restriction forbidden wave_only
      array [AL0S CR3S ZM3N ZM2N ZM5N ZM6N ZM0N ZM1N]

call "continue to magic cross invert another 1/4" c4
            base_tag_call_0 yield_if_ambiguous
   setup qtag 2x4 restriction forbidden wave_only
      array [CR3S AL0S ZM3N ZM2N ZM6N ZM5N ZM0N ZM1N]

call "track" c3
            left_means_mirror base_tag_call_0
   setup 4x2 2x4 rotate
      array [0 0 3E 4E 6E 1E 0 0]

call "_real @v tag base" dontshow tag real_base_0
            left_means_mirror
            singlefile_is_inherited single_is_inherited cross_is_inherited
            nxn_is_inherited bigmatrix_is_inherited
            magic_is_inherited revert_is_inherited fractal_is_inherited
   seq tagnullcall0 [inherit_left inherit_singlefile inherit_single inherit_cross
                     inherit_nxn inherit_bigmatrix inherit_magic]
   seq revert_if_needed [inherit_nxn inherit_revert inherit_fractal]

call "_real @v tag base, no flip" dontshow tag real_base_0_noflip
            left_means_mirror
            singlefile_is_inherited single_is_inherited cross_is_inherited
            nxn_is_inherited bigmatrix_is_inherited
            magic_is_inherited revert_is_inherited fractal_is_inherited
   seq tagnullcall0 [inherit_left inherit_singlefile inherit_single inherit_cross
                     inherit_nxn inherit_bigmatrix inherit_magic]
   seq revert_if_needed [inherit_nxn inherit_revert inherit_fractal]

call "_revert if needed" dontshow tag revert_if_needed
            split_large_setups 12_16_matrix_means_split
   setup 1x1 1x1
      array [ZM0N]
            alternate_definition [single] c3
   setup 1x1 1x1
      array [ZM0N]
            alternate_definition [3x3] c3
   setup 1x1 1x1
      array [ZM0N]
            alternate_definition [4x4] c3
   setup 1x1 1x1
      array [ZM0N]
            alternate_definition [5x5] c3
   setup 1x1 1x1
      array [ZM0N]
            alternate_definition [6x6] c3
   setup 1x1 1x1
      array [ZM0N]
            alternate_definition [7x7] c3
   setup 1x1 1x1
      array [ZM0N]
            alternate_definition [8x8] c3
   setup 1x1 1x1
      array [ZM0N]
            alternate_definition [revert] c3
   setup 1x2 1x2 rotate qualifier miniwaves
      array [CR1S AL1N]
   // Plain fractal not allowed; must have revert.
            alternate_definition [fractal revert] c4
   setup 1x2 1x2 rotate qualifier miniwaves
      array [CR0N AL0S]
            alternate_definition [reflect] c3
   setup 2x2 2x2
      array [CR1E AL0W AL1W CR0E]
            alternate_definition [single revert] c4
   setup 1x2 1x2 rotate qualifier miniwaves
      array [CR1S AL1N]
            alternate_definition [single reflect] c4
   setup 1x2 1x2 rotate qualifier miniwaves
      array [CR0N AL0S]
            alternate_definition [3x3 revert] c4
   setup 3x2 1x6 qualifier wave_only
      array [CR0W CR2W CR4W AL4E AL2E AL0E]
            alternate_definition [3x3 reflect] c4
   setup 3x2 2x3 rotate qualifier wave_only
      array [CR0N CR1N CR2N AL0S AL1S AL2S]
            alternate_definition [4x4 revert] c4
   setup 4x2 1x8 qualifier wave_only
      array [CR0W CR3W CR6W CR5W AL5E AL6E AL3E AL0E]
            alternate_definition [4x4 reflect] c4
   setup 4x2 2x4 rotate qualifier wave_only
      array [CR0N CR1N CR2N CR3N AL0S AL1S AL2S AL3S]
            alternate_definition [revertreflect] c3
   setup 1x4 2x2 qualifier wave_only
      array [CR0N AL2N AL1N CR3N]
            alternate_definition [3x3 revertreflect] c4
   setup 1x6 2x3 rotate qualifier wave_only
      array [CR5W AL2W CR4W AL0W CR3W AL1W]
            alternate_definition [4x4 revertreflect] c4
   setup 1x8 2x4 rotate qualifier wave_only
      array [CR7W AL3W AL2W CR6W AL0W CR4W CR5W AL1W]
            alternate_definition [reflectrevert] c3
   setup 2x2 1x4
      array [CR3N AL1N AL2N CR0N]
            alternate_definition [reflectreflect] c3
   setup 2x2 2x2 qualifier wave_only
      array [CR2S AL3S AL0S CR1S]
            alternate_definition [single reflectreflect] c4
   setup 1x2 1x2 qualifier miniwaves
      array [CR1S AL0S]
            alternate_definition [3x3 reflectreflect] c3
   setup 3x2 2x3 qualifier wave_only
      array [CR3S CR4S CR5S AL0S AL1S AL2S]
            alternate_definition [4x4 reflectreflect] c3
   setup 4x2 2x4 qualifier wave_only
      array [CR4S CR5S CR6S CR7S AL0S AL1S AL2S AL3S]
            alternate_definition [revertreflectrevert] c3
   setup 1x4 1x4 rotate
      array [CCR1S AAL2N AAL1N CCR2S]
            alternate_definition [reflectrevertreflect] c3
   setup 4x2 2x4 rotate
      array [CCR0N CCR2N CCR1N CCR3N AAL0S AAL2S AAL1S AAL3S]

/* **************************** END OF TAG CALLS **************************** */

/* *************************** START OF CIRC CALLS *************************** */

/*   Note!  The base circulate calls are not alphabetized.  They appear in the
   menu in the order in which we list them here. */

call "split@O circulate@P" mainstream
            base_circ_call take_right_hands
   simple_funny
   setup 2x2 2x2 no_cutting_through
      array [CR1S AL0S ZM1N ZM0N]
            alternate_definition [half] mainstream
   setup 2x2 dmd rotate no_cutting_through restriction wave_only
      array [CR0N AL0S ZM1W ZM3W]
            alternate_definition [lasthalf] mainstream
   setup dmd 2x2 restriction forbidden diamond_like qualifier right dmd_ctrs_mwv
      array [CR0E 0 0 0]
   setup dmd 2x2 restriction forbidden diamond_like qualifier left dmd_ctrs_mwv
      array [0 0 AL1W 0]
   setup pmd 2x2 restriction forbidden diamond_like
      array [0 ZM1N 0 ZM2N]
            alternate_definition [magic] c1
   // "Magic split circulate" isn't a call.  We allow it, but it's controversial.
   simple_funny
   setup 4x2 2x4 qualifier magic_only restriction controversial alwaysfail
      array [ZM6N CR6S ZM4N CR4S AL3S ZM3N AL1S ZM1N]
   setup 2x2 2x2 qualifier magic_only restriction controversial alwaysfail
      array [CR1S AL0S ZM0N ZM1N]
            alternate_definition [magic half] c1
   // "Magic split circulate" isn't a call.  We allow it, but it's controversial.
   // From a real magic column, we can obey the rules about what hand to take.
   setup 4x2 ptpd qualifier magic_only restriction controversial alwaysfail
      array [ZM1N CR2E ZM5N CR4E AL4W ZM7N AL2W ZM3N]
   // From plain inverted boxes, we can't.  We just take right hands.  Too bad.
   // People who care about correctness should be calling 1/2 split trade circulate.
   setup 2x2 dmd rotate qualifier magic_only restriction controversial alwaysfail
      array [CR0N AL0S ZM3W ZM3W]

call "trade@O circulate@P" a2
            force_trade base_circ_call take_right_hands
   // We use qualifiers to be sure this isn't called from, for example, inverted lines.
   // (In that case, the "lines_miniwave" predicate would be satisfied and everyone
   // would do a cross over circulate, which is wrong.)  We additionally use predicates
   // in order to be sufficiently strict.  The qualifiers simply check that the live
   // people are consistent with the indicated setup -- they don't check that there
   // are enough live people for the dancers to be able to tell unambiguously which
   // version of the call they should do.
   setup 2x4 2x4 qualifier wave_only
      preds "Can't determine whether waves or two-faced lines."
         if lines_miniwave [CR2S CR3S AL0S AL1S ZM2N ZM3N ZM0N ZM1N]
   setup 2x4 2x4 qualifier 2fl_only
      preds "Can't determine whether waves or two-faced lines."
         if lines_couple   [CR1S AL0S CR3S AL2S ZM1N ZM0N ZM3N ZM2N]
   setup 2x4 2x4 qualifier out 1fl_only restriction unusual alwaysfail      // If looking out, it's slightly weird.
      preds "Can't determine whether waves or two-faced lines."
         if lines_couple   [CR1S AL0S CR3S AL2S ZM1N ZM0N ZM3N ZM2N]
   setup 2x4 2x4 qualifier in 1fl_only restriction controversial alwaysfail // If looking in, it's abominable.
      preds "Can't determine whether waves or two-faced lines."
         if lines_couple   [CR1S AL0S CR3S AL2S ZM1N ZM0N ZM3N ZM2N]
            alternate_definition [half] a2
   setup 2x4 bigdmd rotate qualifier wave_only
      preds "Can't determine whether waves or two-faced lines."
         if lines_miniwave [CR11N CR0N AL10S AL1S ZM3W ZM3W ZM8W ZM8W]
   setup 2x4 bigdmd rotate qualifier 2fl_only
      preds "Can't determine whether waves or two-faced lines."
         if lines_couple   [CR11N AL10S CR0N AL1S ZM3W ZM8W ZM3W ZM8W]
            alternate_definition [12matrix] c3
   setup 3x4 3x4      // T'would be nice to have qualifiers that worked for this,
                      // and 16 matrix.
      preds "Can't determine whether waves or two-faced lines."
         if lines_miniwave [CR2S CR3S AL0S AL1S ZM2N ZM3N ZM5N ZM4N ZM10N ZM11N ZM1N ZM0N]
         if lines_couple   [CR1S AL0S CR3S AL2S ZM1N ZM0N ZM11N ZM10N ZM4N ZM5N ZM2N ZM3N]

call "cross over@O circulate@P" a1
            force_crossover base_circ_call
   simple_funny
   setup 2x4 2x4
      array [CR2S CR3S AL0S AL1S ZM2N ZM3N ZM0N ZM1N]
   setup 4x2 2x4
      array [6N 5N 4N 0 0 3N 2N 1N]
            alternate_definition [12matrix] c3a
   setup 3x4 3x4
      array [CR2S CR3S AL0S AL1S ZM2N ZM3N ZM5N ZM4N ZM10N ZM11N ZM1N ZM0N]
            alternate_definition [half] a1
   // We only endorse this from 2-faced lines.  Otherwise, from 3&1 lines,
   // we would get into messy collision questions involving people doing
   // the single shuffle.  So we don't want to allow collisions.
   // From waves, you can do 1/2 trade circulate,
   // getting the desired collision.
   setup 2x4 4x4 restriction 2fl_only
      array [CR13E CR14E AL13W AL14W ZM1N ZM2N ZM10N ZM9N]

call "in roll@O circulate@P" a2 tag inrollcirc
            force_inroll base_circ_call
   setup 2x4 2x4 qualifier inroller_is_cw
      array [CR1S CR2S CR3S    0    0 AL6S AL7S ZM0N]
   setup 2x4 2x4 qualifier inroller_is_ccw
      array [   0 AL0S AL1S AL2S ZM3N CR4S CR5S    0]
   // Catch the hard cases.
   setup 2x4 2x4
      predscantdocallinsetup
         if inroller_is_cw [CR1S CR2S CR3S    0    0 AL6S AL7S ZM0N]
         if always         [   0 AL0S AL1S AL2S ZM3N CR4S CR5S    0]
   setup 2x3 2x3
      predscantdocallinsetup
         if inroller_is_cw_2x3 [CR1S CR2S    0    0 AL5S ZM0N]
         if always             [   0 AL0S AL1S ZM2N CR3S    0]
            alternate_definition [half] a2
   setup 2x4 spindle
      predscantdocallinsetup
         if inroller_is_cw [CR0E CR1E CR2E    0    0 AL5W AL6W ZM7N]
         if always         [   0 AL0W AL1W AL2W ZM3N CR4E CR5E    0]
   setup 2x3 short6 rotate
      predscantdocallinsetup
         if inroller_is_cw_2x3 [CR5N CR0N    0    0 AL3S ZM4W]
         if always             [   0 AL5S AL0S ZM1W CR2N    0]
            alternate_definition [12matrix] c3
   setup 2x6 2x6
      predscantdocallinsetup
         if inroller_is_cw_2x6 [CR1S CR2S CR3S CR4S CR5S    0    0 AL8S AL9S AL10S AL11S ZM0N]
         if always             [   0 AL0S AL1S AL2S AL3S AL4S ZM5N CR6S CR7S  CR8S CR9S     0]
            alternate_definition [16matrix] c3
   setup 2x8 2x8
      predscantdocallinsetup
         if inroller_is_cw_2x8 [CR1S  CR2S  CR3S  CR4S  CR5S  CR6S  CR7S    0
                                   0 AL10S AL11S AL12S AL13S AL14S AL15S ZM0N]
         if always             [   0  AL0S  AL1S  AL2S  AL3S  AL4S  AL5S AL6S
                                ZM7N  CR8S  CR9S CR10S CR11S CR12S CR13S    0]
            alternate_definition [magic] c3
   setup 2x4 2x4
      predscantdocallinsetup
         if magic_inroller_is_cw [CR6S AL7S AL1S    0    0 CR3S CR5S ZM0N]
         if always               [   0 CR2S CR4S AL5S ZM3N AL6S AL0S    0]
   setup 2x3 2x3
      predscantdocallinsetup
         if magic_inroller_is_cw_2x3 [CR4S AL5S    0    0 CR2S ZM0N]
         if always                   [   0 CR3S AL4S ZM2N AL0S    0]

call "inroll@O circulate@P" a2
            force_inroll base_circ_call
   alias inrollcirc

call "out roll@O circulate@P" a2 tag outrollcirc
            force_outroll base_circ_call
   setup 2x4 2x4 qualifier outroller_is_cw
      array [   0 CR2S CR3S AL0S AL5S AL6S AL7S    0]
   setup 2x4 2x4 qualifier outroller_is_ccw
      array [CR3S AL0S AL1S    0    0 CR4S CR5S CR6S]
   // Catch the hard cases.
   setup 2x4 2x4
      predscantdocallinsetup
         if outroller_is_cw [   0 CR2S CR3S AL0S AL5S AL6S AL7S    0]
         if always          [CR3S AL0S AL1S    0    0 CR4S CR5S CR6S]
   setup 2x3 2x3
      predscantdocallinsetup
         if outroller_is_cw_2x3 [   0 CR2S AL0S AL4S AL5S    0]
         if always              [CR2S AL0S    0    0 CR3S CR4S]
            alternate_definition [half] a2
   setup 2x4 3x4 rotate
      predscantdocallinsetup
         if outroller_is_cw [    0 CR11N CR1N  AL10S AL2S AL5S AL7S    0]
         if always          [CR10N  AL8S AL11S     0    0 CR2N CR5N CR7N]
   setup 2x3 short6
      predscantdocallinsetup
         if outroller_is_cw_2x3 [   0 CR2E AL1W AL3W AL5W    0]
         if always              [CR1E AL0W    0    0 CR3E CR5E]
            alternate_definition [12matrix] c3
   setup 2x6 2x6
      predscantdocallinsetup
         if outroller_is_cw_2x6 [   0 CR2S CR3S  CR4S  CR5S  AL0S
                                 AL7S AL8S AL9S AL10S AL11S     0]
         if always              [CR5S AL0S AL1S  AL2S  AL3S     0
                                    0 CR6S CR7S  CR8S  CR9S CR10S]
            alternate_definition [16matrix] c3
   setup 2x8 2x8
      predscantdocallinsetup
         if outroller_is_cw_2x8 [   0  CR2S  CR3S  CR4S  CR5S  CR6S  CR7S  AL0S
                                 AL9S AL10S AL11S AL12S AL13S AL14S AL15S     0]
         if always              [CR7S  AL0S  AL1S  AL2S  AL3S  AL4S  AL5S     0
                                    0  CR8S  CR9S CR10S CR11S CR12S CR13S CR14S]
            alternate_definition [magic] c3
   setup 2x4 2x4
      predscantdocallinsetup
         if magic_outroller_is_cw [   0 AL7S AL1S AL0S AL2S CR3S CR5S    0]
         if always                [CR3S CR2S CR4S    0    0 AL6S AL0S CR1S]
   setup 2x3 2x3
      predscantdocallinsetup
         if magic_outroller_is_cw_2x3 [   0 AL5S AL0S AL1S CR2S    0]
         if always                    [CR2S CR3S    0    0 AL0S CR1S]

call "outroll@O circulate@P" a2
            force_outroll base_circ_call
   alias outrollcirc

call "prefer the @6 out roll circulate" c1
   // Yes, this can be called from a 1x4.  "Out" doesn't matter,
   // since we are specifying the person.
   setup 1x4 1x4 qualifier ripple_one_end restriction unusual alwaysfail
      predsnoselect
         if select_near_unselect   [CR2S 0    AL0S 0]
         if unselect_near_select   [0    AL0S 0    CR2S]
         if unselect_near_unselect [CR1S CR3S AL3S AL1S]
   // If in a 2x4, the selected person must not be facing in.
   setup 2x4 2x4 qualifier ripple_one_end
      predsnoselect
         if select_near_unselect   [CR3S 0    0    AL0S 0    0    0    0]
         if unselect_near_select   [0    AL0S CR3S 0    0    CR4S AL7S 0]
         if unselect_near_unselect [CR1S CR2S AL1S AL2S AL5S AL6S CR5S CR6S]

call "prefer the @6 in roll circulate" c1
   setup 2x4 2x4 qualifier ripple_one_end
      predsnoselect
         if select_near_unselect   [0    0    0    0    ZM3N 0    0    ZM0N]
         if unselect_near_select   [0    AL0S CR3S 0    0    CR4S AL7S 0]
         if unselect_near_unselect [CR1S CR2S AL1S AL2S AL5S AL6S CR5S CR6S]

call "zoom roll@O circulate@P" c4
            force_zoomroll base_circ_call
   setup 2x4 2x4 qualifier outroller_is_cw
      array [   0 CR2S CR3S CR4N AL5S AL6S AL7S    0]
   setup 2x4 2x4 qualifier outroller_is_ccw
      array [AL7N AL0S AL1S    0    0 CR4S CR5S CR6S]
   // Catch the hard cases.
   setup 2x4 2x4
      predscantdocallinsetup
         if outroller_is_cw [   0 CR2S CR3S CR4N AL5S AL6S AL7S    0]
         if always          [AL7N AL0S AL1S    0    0 CR4S CR5S CR6S]
   setup 2x3 2x3
      predscantdocallinsetup
         if outroller_is_cw_2x3 [   0 CR2S CR3N AL4S AL5S    0]
         if always              [AL5N AL0S    0    0 CR3S CR4S]
            alternate_definition [12matrix] c3
   setup 2x6 2x6
      predscantdocallinsetup
         if outroller_is_cw_2x6 [    0 CR2S CR3S  CR4S  CR5S  CR6N
                                  AL7S AL8S AL9S AL10S AL11S     0]
         if always              [AL11N AL0S AL1S  AL2S  AL3S     0
                                     0 CR6S CR7S  CR8S  CR9S CR10S]
            alternate_definition [16matrix] c3
   setup 2x8 2x8
      predscantdocallinsetup
         if outroller_is_cw_2x8 [    0  CR2S  CR3S  CR4S  CR5S  CR6S  CR7S  CR8N
                                  AL9S AL10S AL11S AL12S AL13S AL14S AL15S     0]
         if always              [AL15N  AL0S  AL1S  AL2S  AL3S  AL4S  AL5S     0
                                     0  CR8S  CR9S CR10S CR11S CR12S CR13S CR14S]
            alternate_definition [magic] c4
   setup 2x4 2x4
      predscantdocallinsetup
         if magic_outroller_is_cw [   0 AL7S AL1S CR4N AL2S CR3S CR5S    0]
         if always                [AL7N CR2S CR4S    0    0 AL6S AL0S CR1S]
   setup 2x3 2x3
      predscantdocallinsetup
         if magic_outroller_is_cw_2x3 [   0 AL5S CR3N AL1S CR2S    0]
         if always                    [AL5N CR3S    0    0 AL0S CR1S]

call "bias@O circulate@P" c3a
            force_bias base_circ_call
   setup 2x4 2x4 restriction unusual wave_only
      array [CR3S CR2S AL1S AL0S ZM1N ZM0N ZM3N ZM2N]
   setup 4x2 2x4 restriction unusual alwaysfail
      array [   0 ZM2N    0 CR4S AL3S    0 ZM5N    0]

call "bias trade@O circulate@P" c4
            force_biastrade base_circ_call
   setup 2x4 2x4 restriction wave_only
      array [CR2S CR3S AL0S AL1S ZM0N ZM1N ZM2N ZM3N]

call "orbit@O circulate@P" c4
            force_orbit base_circ_call left_means_mirror
   setup 2x4 2x4 restriction wave_only
      array [CR2S CR3S CR4N CR5N ZM2N ZM3N ZM0N ZM1N]

call "twin orbit@O circulate@P" c4
            force_twinorbit base_circ_call
   setup 2x4 2x4 restriction wave_only
      array [AL6N AL7N CR4N CR5N ZM2N ZM3N ZM0N ZM1N]
            alternate_definition [half] c4a
   setup 2x4 1x8 restriction wave_only
      array [AL1S AL1S CR4S CR4S ZM6N ZM6N ZM3N ZM3N]

call "rotary@O circulate@P" c4
            force_rotary base_circ_call
   setup 2x4 2x4 restriction wave_only
      array [CR5N AL4N CR7N AL6N AM1N CM0N AM3N CM2N]
            alternate_definition [single] c4
   setup 1x4 1x4 restriction wave_only
      array [C3N A2N A1N C0N]
   setup 2x2 2x2 restriction wave_only
      array [CR3N AL2N AM1N CM0N]
            alternate_definition [3x3 12matrix] c4
   setup 3x4 3x4 restriction wave_only
      array [C7N A6N C9N A8N A11N C10N A1N C0N A3N C2N C5N A4N]
   setup 2x6 2x6 restriction wave_only
      array [CR7N AL6N CR9N AL8N CR11N AL10N AM1N CM0N AM3N CM2N AM5N CM4N]
            alternate_definition [4x4 12matrix] c4
   setup 4x4 4x4 restriction wave_only
      array [A6N A11N A15N C9N A13N C12N A0N C10N
             C14N C3N C7N A1N C5N A4N C8N A2N]
   setup 2x8 2x8 restriction wave_only
      array [CR9N AL8N CR11N AL10N CR13N AL12N CR15N AL14N
             AM1N CM0N AM3N CM2N AM5N CM4N AM7N CM6N]
            alternate_definition [half] c4
   setup 2x4 2x4 rotate restriction wave_only
      array [CM0N AL4N CR3S AM7S AM6S CR2S AL5N CM1N]
            alternate_definition [lasthalf] c4
   setup 2x4 2x4 rotate qualifier 2fl_only
      array [CR1S CM6S AM1N AL6N AL0S AM7S CM0N CR7N]

call "rotary circulate, centers to a wave" c4
   setup 2x4 qtag restriction wave_only
      array [CR4N AL4N CR5N AL5N AL7N CR6N AL2N CR3N]

call "scatter@O circulate@P" c3a
            force_scatter base_circ_call take_right_hands
   simple_funny
   setup 2x4 2x4 restriction 2fl_only
      array [CR1S CR3S AL0S AL2S ZM3N ZM1N ZM2N ZM0N]
   setup 4x2 2x4
      array [ZM1N ZM5N ZM4N CR4S AL3S ZM3N ZM2N ZM6N]
            alternate_definition [half] c3a
   // The definition says the centers do a "box cross-over circulate".
   // So they presumably pass right shoulders.
   setup 2x4 wingedstar
      array [0 0 0 0 ZM5N ZM2N ZM2N ZM0N]
   setup 4x2 wingedstar
      array [0 ZM3N 0 0 0 0 ZM3N 0]
            alternate_definition [12matrix] c4
   setup 3x4 3x4 restriction 2fl_only
      array [CR1S CR3S AL0S AL2S ZM3N ZM1N ZM4N ZM11N ZM5N ZM10N ZM0N ZM2N]
            alternate_definition [16matrix] c4
   setup 4x4 4x4 restriction 2fl_only
      array [AL14S ZM0N ZM1N ZM13N ZM2N ZM11N ZM7N ZM15N
            ZM9N ZM10N ZM12N ZM3N CR13S CR0S AL12S ZM14N]
            alternate_definition [3x3] c4
   setup 2x6 2x6 qualifier 3x3_2fl_only
      array [CR1S CR3S CR5S AL0S AL2S AL4S ZM5N ZM3N ZM1N ZM4N ZM2N ZM0N]
            alternate_definition [4x4] c4
   setup 2x8 2x8 qualifier 4x4_2fl_only
      array [CR1S CR3S CR5S CR7S AL0S AL2S AL4S AL6S ZM7N ZM5N ZM3N ZM1N ZM6N ZM4N ZM2N ZM0N]
            alternate_definition [rewind] c4
   setup 2x4 2x4 qualifier wave_only
      array [CR2S AL0S CR3S AL1S ZM3N ZM1N ZM2N ZM0N]

call "split trade@O circulate@P" c2 tag split_trade_circ
            force_splittrade base_circ_call take_right_hands
   simple_funny
   setup 2x2 2x2 restriction magic_only
      array [CR1S AL0S ZM0N ZM1N]
            alternate_definition [half] c2
   /* We have to use the "forbidden" option, since this def'n
      is slightly sleazy, and wouldn't do the right thing
      from a leftie box. */
   setup 2x2 dmd rotate restriction forbidden magic_only
      array [CR0N AL0S ZM1W ZM3W]

call "counter@O rotate@P" c1 tag ctr_rot
            base_circ_call

            can_be_one_side_lateral
            parallel_conc_end       // This makes it win if we tell the ends only to do it.
            dont_raise_overcast
   counter_rotate [CR16E 16 AL16W 16]

            can_be_one_side_lateral
            ends_take_right_hands
            parallel_conc_end
            preserve_z_stuff
            dont_raise_overcast
   simple_funny
   setup 2x4 2x4 rotate
      array [CR0N CR1N AL6S AL7S AL0S AL1S CR6N CR7N]
   setup 4x2 2x4 rotate
      array [CR0N CR1N CR2N CR3N AL0S AL1S AL2S AL3S]
   setup 2x3 2x3 rotate
      array [CR0N 0 AL5S AL0S 0 CR5N]
   setup 3x2 2x3 rotate
      array [CR0N CR1N CR2N AL0S AL1S AL2S]
   setup 2x2 2x2
      array [CR1E AL0W AL1W CR0E]
   setup 2x5 2x5 rotate
      array [CR0N CR1N 0 AL8S AL9S AL0S AL1S 0 CR8N CR9N]
   setup 5x2 2x5 rotate
      array [CR0N CR1N CR2N CR3N CR4N AL0S AL1S AL2S AL3S AL4S]
   setup 2x6 2x6 rotate
      array [CR0N CR1N CR2N AL9S AL10S AL11S AL0S AL1S AL2S CR9N CR10N CR11N]
   setup 6x2 2x6 rotate
      array [CR0N CR1N CR2N CR3N CR4N CR5N AL0S AL1S AL2S AL3S AL4S AL5S]
   setup 2x8 2x8 rotate
      array [CR0N CR1N CR2N CR3N AL12S AL13S AL14S AL15S
            AL0S AL1S AL2S AL3S CR12N CR13N CR14N CR15N]
   setup 8x2 2x8 rotate
      array [CR0N CR1N CR2N CR3N CR4N CR5N CR6N CR7N
            AL0S AL1S AL2S AL3S AL4S AL5S AL6S AL7S]
   setup 3x4 3x4 rotate
      array [CR0N CR1N AL8S AL9S AL10S AL11S AL0S AL1S CR8N CR9N CR10N CR11N]
   setup 4x3 3x4 rotate
      array [CR0N CR1N CR2N CR3N 0 0 AL0S AL1S AL2S AL3S 0 0]
   setup 4x4 4x4
      array [AL12W AL13W AL14W AL15W AL0W AL1W CR10E AL3W
             CR12E CR13E CR14E CR15E CR0E CR1E AL10W CR3E]
   setup c1phan c1phan
      array [CR4E CR5E CR6E CR7E AL0W AL1W AL2W AL3W
             AL4W AL5W AL6W AL7W CR0E CR1E CR2E CR3E]
   setup thar thar
      array [CR2E CR3E 0 0 AL2W AL3W 0 0]
   setup short6 short6 rotate qualifier didnt_say_triangle
      array [CR0N 0 AL5S AL0S 0 CR5N]
   setup pshort6 short6 rotate qualifier didnt_say_triangle
      array [CR0N CR1N CR2N AL0S AL1S AL2S]
   setup bone6 bone6 rotate qualifier didnt_say_triangle
      array [CR0N AL4S AL5S AL0S CR4N CR5N]
   setup pbone6 bone6 rotate qualifier didnt_say_triangle
      array [CR0N CR1N    0 AL0S AL1S    0]
   setup bone bone rotate
      array [CR0N AL5S AL6S AL7S AL0S CR5N CR6N CR7N]
   setup pbone bone rotate
      array [CR0N CR1N    0    0 AL0S AL1S    0    0]
   setup trngl trngl rotate
      array [0 CR1N AL5S 0 AL1S CR5N]
   setup ptrngl trngl rotate
      array [AL3S CR1N CR2N CR3N AL1S AL2S]
   setup trngl4 trngl4 rotate
      array [0 0 CR2N AL7S 0 0 AL2S CR7N]
   // It can be argued that the "center" of the triangle (position 1 and 5)
   // can't actually counter rotate.  But in practice, this will only be legal
   // if the other 3 people in the group are moving in a consistent way, and,
   // in that case, the center person's turning direction should be clear.
   setup ptrngl4 trngl4 rotate
      array [AL4S AL5S CR2N CR3N CR4N CR5N AL2S AL3S]
   setup dmd dmd rotate
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate
      array [0 CR1N 0 AL1S]
   setup star star
      array [CR1E 0 AL1W 0]
   setup galaxy galaxy
      array [CR2E CR3E 0 AL1W AL2W AL3W 0 CR1E]
   setup hrglass hrglass rotate
      array [CR0N AL5S AL6S 0 AL0S CR5N CR6N 0]
   setup phrglass hrglass rotate
      array [CR0N CR1N 0 CR3N AL0S AL1S 0 AL3S]
   setup dhrglass dhrglass rotate
      array [CR0N AL5S AL6S 0 AL0S CR5N CR6N 0]
   setup pdhrglass dhrglass rotate
      array [CR0N CR1N 0 CR3N AL0S AL1S 0 AL3S]
   setup rigger rigger rotate
      array [CR0N AL5S AL6S AL7S AL0S CR5N CR6N CR7N]
   setup prigger rigger rotate
      array [CR0N CR1N    0    0 AL0S AL1S    0    0]
   setup 2stars 2stars rotate
      array [CR0N AL5S AL6S AL7S AL0S CR5N CR6N CR7N]
   setup p2stars 2stars rotate
      array [CR0N CR1N 0 0 AL0S AL1S 0 0]
   setup 3x1dmd 3x1dmd rotate
      array [CR0N CR1N CR2N    0 AL0S AL1S AL2S    0]
   setup p3x1dmd 3x1dmd rotate
      array [   0    0    0 CR3N    0    0    0 AL3S]
   setup 1x3dmd 1x3dmd rotate
      array [CR0N CR1N CR2N    0 AL0S AL1S AL2S    0]
   setup p1x3dmd 1x3dmd rotate
      array [   0    0    0 CR3N    0    0    0 AL3S]
   setup wingedstar wingedstar rotate
      array [CR0N CR1N CR2N    0 AL0S AL1S AL2S    0]
   setup pwingedstar wingedstar rotate
      array [   0    0    0 CR3N    0    0    0 AL3S]
   setup 2x1dmd 2x1dmd rotate
      array [CR0N CR1N    0 AL0S AL1S    0]
   setup p2x1dmd 2x1dmd rotate
      array [   0    0 CR2N    0    0 AL2S]
   setup 1x2dmd 1x2dmd rotate
      array [CR0N CR1N    0 AL0S AL1S    0]
   setup p1x2dmd 1x2dmd rotate
      array [   0    0 CR2N    0    0 AL2S]
   setup 3dmd 3dmd rotate
      array [CR0N    0 AL8S AL9S AL10S AL11S AL0S    0 CR8N CR9N CR10N CR11N]
   setup p3dmd 3dmd rotate
      array [CR0N CR1N CR2N    0     0     0 AL0S AL1S AL2S    0     0     0]
   setup 3mdmd 3mdmd rotate
      array [CR0N    0 AL8S AL9S AL10S AL11S AL0S    0 CR8N CR9N CR10N CR11N]
   setup p3mdmd 3mdmd rotate
      array [CR0N CR1N CR2N    0     0     0 AL0S AL1S AL2S    0     0     0]
   setup 4dmd 4dmd rotate
      array [CR0N CR1N AL10S AL11S AL12S AL13S AL14S AL15S AL0S AL1S CR10N CR11N CR12N CR13N CR14N CR15N]
   setup p4dmd 4dmd rotate
      array [CR0N CR1N CR2N   CR3N     0     0     0     0 AL0S AL1S  AL2S  AL3S     0     0     0     0]
   setup 2x2dmd 2x2dmd rotate
      array [CR0N CR1N CR2N CR3N AL12S AL13S AL14S AL15S AL0S AL1S AL2S AL3S CR12N CR13N CR14N CR15N]
   setup p2x2dmd 2x2dmd rotate
      array [CR0N CR1N CR2N CR3N  CR4N  CR5N  CR6N  CR7N AL0S AL1S AL2S AL3S  AL4S  AL5S  AL6S  AL7S]
   setup spindle spindle rotate
      array [CR0N    0 AL6S AL7S AL0S    0 CR6N CR7N]
   setup pspindle spindle rotate
      array [CR0N CR1N CR2N    0 AL0S AL1S AL2S    0]
   setup spindle12 spindle12 rotate
      array [CR0N    0 AL7S AL8S AL9S AL0S    0 CR7N CR8N CR9N]
   setup pspindle12 spindle12 rotate
      array [CR0N CR1N CR2N    0    0 AL0S AL1S AL2S    0    0]
   setup crosswave crosswave rotate
      array [CR0N CR1N    0    0 AL0S AL1S    0    0]
   setup pcrosswave crosswave rotate
      array [   0    0 CR2N CR3N    0    0 AL2S AL3S]
   setup bigdmd bigdmd rotate
      array [CR0N CR1N 0 0 AL10S AL11S AL0S AL1S 0 0 CR10N CR11N]
   setup pbigdmd bigdmd rotate
      array [CR0N CR1N CR2N CR3N CR4N CR5N AL0S AL1S AL2S AL3S AL4S AL5S]
   setup bigbone bigbone rotate
      array [CR0N CR1N CR2N CR3N AL10S AL11S AL0S AL1S AL2S AL3S CR10N CR11N]
   setup pbigbone bigbone rotate
      array [CR0N CR1N    0    0  CR4N  CR5N AL0S AL1S    0    0  AL4S AL5S]
   setup 1x2 1x2 rotate
      array [CR0N AL0S]
   setup 1x4 1x4 rotate
      array [CR0N CR1N AL0S AL1S]
   setup 1x6 1x6 rotate
      array [CR0N CR1N CR2N AL0S AL1S AL2S]
   setup 1x8 1x8 rotate
      array [CR0N CR1N CR2N CR3N AL0S AL1S AL2S AL3S]
   setup 1x10 1x10 rotate
      array [CR0N CR1N CR2N CR3N CR4N AL0S AL1S AL2S AL3S AL4S]
   setup 1x12 1x12 rotate
      array [CR0N CR1N CR2N CR3N CR4N CR5N AL0S AL1S AL2S AL3S AL4S AL5S]
   setup 1x14 1x14 rotate
      array [CR0N CR1N CR2N CR3N CR4N CR5N CR6N AL0S AL1S AL2S AL3S AL4S AL5S AL6S]
   setup 1x16 1x16 rotate
      array [CR0N CR1N CR2N CR3N CR4N CR5N CR6N CR7N AL0S AL1S AL2S AL3S AL4S AL5S AL6S AL7S]
   setup ptpd ptpd rotate
      array [CR0N CR1N CR2N CR3N AL0S AL1S AL2S AL3S]
   setup pptpd ptpd rotate
      array [0 CR1N 0 AL7S 0 AL1S 0 CR7N]
   setup 3x23 3x23 rotate
      array [CR0N    0 AL6S AL7S AL0S    0 CR6N CR7N]
   setup p3x23 3x23 rotate
      array [CR0N CR1N CR2N    0 AL0S AL1S AL2S    0]
            alternate_definition [stingy] c3
   setup 1x2 1x2
      array [ZM0N ZM1N]
   setup 1x4 dmd rotate
      array [CR0N ZM3W AL0S ZM1W]
   setup dmd 1x4 rotate
      array [CR0N 0 AL0S 0]
   setup pmd 1x4 rotate
      array [0 ZM1W 0 ZM3W]
   setup 1x6 1x2dmd rotate
      array [CR0N CR1N ZM5W AL0S AL1S ZM2W]
   setup 1x8 1x3dmd rotate
      array [CR0N CR1N ZM7W CR2N AL0S AL1S ZM3W AL2S]
            alternate_definition [generous] c3
   setup 1x2 1x2
      array [CR1S AL0S]
   setup 1x4 dmd rotate
      array [CR0N CR1E AL0S AL3E]
   setup dmd 1x4 rotate
      array [CR0N 0 AL0S 0]
   setup pmd 1x4 rotate
      array [0 CR3E 0 AL1E]
   setup 1x6 1x2dmd rotate
      array [CR0N CR1N CR2E AL0S AL1S AL5E]
   setup 1x8 1x3dmd rotate
      array [CR0N CR1N CR3E CR2N AL0S AL1S ZM3W AL7E]
            alternate_definition [fractal] c4
   setup 1x2 1x2 rotate
      array [CR1S AL1N]
   setup 1x4 1x4 rotate no_cutting_through
      array [CR0N CR3S AL0S AL3N]
   setup dmd dmd rotate
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate
      array [0 CR3S 0 AL3N]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate
      array [CR0N AL0S]
            alternate_definition [3x3] c4
   setup 3x2 2x3 rotate restriction controversial wave_only
      array [CR0N CR1N CR2N AL0S AL1S AL2S]
   setup 2x6 2x6 rotate restriction forbidden 3x3couples_only
      array [CR0N CR1N CR2N AL9S AL10S AL11S AL0S AL1S AL2S CR9N CR10N CR11N]
   setup 3x4 3x4 rotate
      array [CR0N CR1N AL8S AL9S AL10S AL11S AL0S AL1S CR8N CR9N CR10N CR11N]
            alternate_definition [4x4] c4
   setup 4x2 2x4 rotate restriction controversial wave_only
      array [CR0N CR1N CR2N CR3N AL0S AL1S AL2S AL3S]
   setup 2x8 2x8 rotate restriction forbidden 4x4couples_only
      array [CR0N CR1N CR2N CR3N AL12S AL13S AL14S AL15S
            AL0S AL1S AL2S AL3S CR12N CR13N CR14N CR15N]
   setup 4x4 4x4
      array [AL12W AL13W AL14W AL15W AL0W AL1W CR10E AL3W
             CR12E CR13E CR14E CR15E CR0E CR1E AL10W CR3E]
            alternate_definition [magic] c2
   setup 2x2 2x2 qualifier magic_only restriction serious_violation alwaysfail
      array [CR1E AL0W CR0E AL1W]
   // To be sure this doesn't just split into 2x2's.
   setup 2x4 2x4 qualifier magic_only restriction forbidden alwaysfail
      array [0 0 0 0 0 0 0 0]
   setup 4x2 2x4 qualifier magic_only restriction forbidden alwaysfail
      array [0 0 0 0 0 0 0 0]
            alternate_definition [half] c1
   setup 2x2 2x2 plus_eighth_rotation
      array [CR0N AL0W AL1W CR3N]
   setup 2x4 4x4 plus_eighth_rotation
      array [CR10N CR15N AL15W AL13W AL14W AL3W CR11N CR9N]
   setup 4x2 4x4 plus_eighth_rotation
      array [CR10N CR15N CR3N CR1N AL14W AL3W AL7W AL5W]
   setup 4x4 4x4 plus_eighth_rotation
      array [AL12W AL13W AL14W AL15W AL0W AL1W CR6N AL3W CR8N CR9N CR10N CR11N CR12N CR13N AL10W CR15N]
            alternate_definition [lasthalf] c1
   setup 2x4 4x4 plus_eighth_rotation
      array [CR10N CR15N AL15W AL13W AL14W AL3W CR11N CR9N]
   setup 4x2 4x4 plus_eighth_rotation
      array [CR10N CR15N CR3N CR1N AL14W AL3W AL7W AL5W]

// This is almost identical to plain counter rotate, just above.  It differs only in the
// single, 3x3, and 4x4 versions.
call "counter rotate for sidetrack" dontshow tag ctr_rot_for_sidetrack
            dont_raise_overcast
            parallel_conc_end       // This makes it win if we tell the ends only to do it.
   setup 2x4 2x4 rotate
      array [CR0N CR1N AL6S AL7S AL0S AL1S CR6N CR7N]
   setup 4x2 2x4 rotate
      array [CR0N CR1N CR2N CR3N AL0S AL1S AL2S AL3S]
   setup 2x3 2x3 rotate
      array [CR0N 0 AL5S AL0S 0 CR5N]
   setup 3x2 2x3 rotate
      array [CR0N CR1N CR2N AL0S AL1S AL2S]
   setup 2x2 2x2
      array [CR1E AL0W AL1W CR0E]
   setup 2x6 2x6 rotate
      array [CR0N CR1N CR2N AL9S AL10S AL11S AL0S AL1S AL2S CR9N CR10N CR11N]
   setup 6x2 2x6 rotate
      array [CR0N CR1N CR2N CR3N CR4N CR5N AL0S AL1S AL2S AL3S AL4S AL5S]
   setup 2x8 2x8 rotate
      array [CR0N CR1N CR2N CR3N AL12S AL13S AL14S AL15S
            AL0S AL1S AL2S AL3S CR12N CR13N CR14N CR15N]
   setup 8x2 2x8 rotate
      array [CR0N CR1N CR2N CR3N CR4N CR5N CR6N CR7N
            AL0S AL1S AL2S AL3S AL4S AL5S AL6S AL7S]
   setup 3x4 3x4 rotate
      array [CR0N CR1N AL8S AL9S AL10S AL11S AL0S AL1S CR8N CR9N CR10N CR11N]
   setup 4x3 3x4 rotate
      array [CR0N CR1N CR2N CR3N 0 0 AL0S AL1S AL2S AL3S 0 0]
   setup 4x4 4x4
      array [AL12W AL13W AL14W AL15W AL0W AL1W CR10E AL3W
             CR12E CR13E CR14E CR15E CR0E CR1E AL10W CR3E]
   setup c1phan c1phan
      array [CR4E CR5E CR6E CR7E AL0W AL1W AL2W AL3W
             AL4W AL5W AL6W AL7W CR0E CR1E CR2E CR3E]
   setup thar thar
      array [CR2E CR3E 0 0 AL2W AL3W 0 0]
   setup short6 short6 rotate qualifier didnt_say_triangle
      array [CR0N 0 AL5S AL0S 0 CR5N]
   setup pshort6 short6 rotate qualifier didnt_say_triangle
      array [CR0N CR1N CR2N AL0S AL1S AL2S]
   setup bone6 bone6 rotate qualifier didnt_say_triangle
      array [CR0N AL4S AL5S AL0S CR4N CR5N]
   setup pbone6 bone6 rotate qualifier didnt_say_triangle
      array [CR0N CR1N    0 AL0S AL1S    0]
   setup bone bone rotate
      array [CR0N AL5S AL6S AL7S AL0S CR5N CR6N CR7N]
   setup pbone bone rotate
      array [CR0N CR1N    0    0 AL0S AL1S    0    0]
   setup trngl trngl rotate
      array [0 CR1N AL5S 0 AL1S CR5N]
   setup ptrngl trngl rotate
      array [AL3S CR1N CR2N CR3N AL1S AL2S]
   setup trngl4 trngl4 rotate
      array [0 0 CR2N AL7S 0 0 AL2S CR7N]
   setup ptrngl4 trngl4 rotate
      array [AL4S 0 CR2N CR3N CR4N 0 AL2S AL3S]
   setup dmd dmd rotate
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate
      array [0 CR1N 0 AL1S]
   setup star star
      array [CR1E 0 AL1W 0]
   setup galaxy galaxy
      array [CR2E CR3E 0 AL1W AL2W AL3W 0 CR1E]
   setup hrglass hrglass rotate
      array [CR0N AL5S AL6S 0 AL0S CR5N CR6N 0]
   setup phrglass hrglass rotate
      array [CR0N CR1N 0 CR3N AL0S AL1S 0 AL3S]
   setup dhrglass dhrglass rotate
      array [CR0N AL5S AL6S 0 AL0S CR5N CR6N 0]
   setup pdhrglass dhrglass rotate
      array [CR0N CR1N 0 CR3N AL0S AL1S 0 AL3S]
   setup qtag qtag rotate
      array [CR0N AL5S AL6S AL7S AL0S CR5N CR6N CR7N]
   setup pqtag qtag rotate
      array [CR0N CR1N 0 0 AL0S AL1S 0 0]
   setup rigger rigger rotate
      array [CR0N AL5S AL6S AL7S AL0S CR5N CR6N CR7N]
   setup prigger rigger rotate
      array [CR0N CR1N    0    0 AL0S AL1S    0    0]
   setup 2stars 2stars rotate
      array [CR0N AL5S AL6S AL7S AL0S CR5N CR6N CR7N]
   setup p2stars 2stars rotate
      array [CR0N CR1N 0 0 AL0S AL1S 0 0]
   setup 3x1dmd 3x1dmd rotate
      array [CR0N CR1N CR2N    0 AL0S AL1S AL2S    0]
   setup p3x1dmd 3x1dmd rotate
      array [   0    0    0 CR3N    0    0    0 AL3S]
   setup 1x3dmd 1x3dmd rotate
      array [CR0N CR1N CR2N    0 AL0S AL1S AL2S    0]
   setup p1x3dmd 1x3dmd rotate
      array [   0    0    0 CR3N    0    0    0 AL3S]
   setup 2x1dmd 2x1dmd rotate
      array [CR0N CR1N    0 AL0S AL1S    0]
   setup p2x1dmd 2x1dmd rotate
      array [   0    0 CR2N    0    0 AL2S]
   setup 1x2dmd 1x2dmd rotate
      array [CR0N CR1N    0 AL0S AL1S    0]
   setup p1x2dmd 1x2dmd rotate
      array [   0    0 CR2N    0    0 AL2S]
   setup 3dmd 3dmd rotate
      array [CR0N    0 AL8S AL9S AL10S AL11S AL0S    0 CR8N CR9N CR10N CR11N]
   setup p3dmd 3dmd rotate
      array [CR0N CR1N CR2N    0     0     0 AL0S AL1S AL2S    0     0     0]
   setup 3mdmd 3mdmd rotate
      array [CR0N    0 AL8S AL9S AL10S AL11S AL0S    0 CR8N CR9N CR10N CR11N]
   setup p3mdmd 3mdmd rotate
      array [CR0N CR1N CR2N    0     0     0 AL0S AL1S AL2S    0     0     0]
   setup spindle spindle rotate
      array [CR0N    0 AL6S AL7S AL0S    0 CR6N CR7N]
   setup pspindle spindle rotate
      array [CR0N CR1N CR2N    0 AL0S AL1S AL2S    0]
   setup crosswave crosswave rotate
      array [CR0N CR1N    0    0 AL0S AL1S    0    0]
   setup pcrosswave crosswave rotate
      array [   0    0 CR2N CR3N    0    0 AL2S AL3S]
   setup bigdmd bigdmd rotate
      array [CR0N CR1N 0 0 AL10S AL11S AL0S AL1S 0 0 CR10N CR11N]
   setup pbigdmd bigdmd rotate
      array [CR0N CR1N CR2N CR3N CR4N CR5N AL0S AL1S AL2S AL3S AL4S AL5S]
   setup 1x2 1x2 rotate
      array [CR0N AL0S]
   setup 1x4 1x4 rotate
      array [CR0N CR1N AL0S AL1S]
   setup 1x6 1x6 rotate
      array [CR0N CR1N CR2N AL0S AL1S AL2S]
   setup 1x8 1x8 rotate
      array [CR0N CR1N CR2N CR3N AL0S AL1S AL2S AL3S]
   setup 1x10 1x10 rotate
      array [CR0N CR1N CR2N CR3N CR4N AL0S AL1S AL2S AL3S AL4S]
   setup 1x12 1x12 rotate
      array [CR0N CR1N CR2N CR3N CR4N CR5N AL0S AL1S AL2S AL3S AL4S AL5S]
   setup 1x14 1x14 rotate
      array [CR0N CR1N CR2N CR3N CR4N CR5N CR6N AL0S AL1S AL2S AL3S AL4S AL5S AL6S]
   setup 1x16 1x16 rotate
      array [CR0N CR1N CR2N CR3N CR4N CR5N CR6N CR7N AL0S AL1S AL2S AL3S AL4S AL5S AL6S AL7S]
   setup ptpd ptpd rotate
      array [CR0N CR1N CR2N CR3N AL0S AL1S AL2S AL3S]
   setup pptpd ptpd rotate
      array [0 CR1N 0 AL7S 0 AL1S 0 CR7N]
            alternate_definition [fractal] c4
   setup 1x4 1x4 rotate no_cutting_through
      array [CR0N CR3S AL0S AL3N]
   setup dmd dmd rotate
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate
      array [0 CR3S 0 AL3N]
            alternate_definition [single] c3
   setup 1x4 1x4 rotate
      array [CR0N CR1N AL0S AL1S]
            alternate_definition [3x3] c4
   setup 3x4 3x4 rotate
      array [CR0N CR1N AL8S AL9S AL10S AL11S AL0S AL1S CR8N CR9N CR10N CR11N]
   setup 6x2 2x6 rotate
      array [CR0N CR1N CR2N CR3N CR4N CR5N AL0S AL1S AL2S AL3S AL4S AL5S]
            alternate_definition [4x4] c4
   setup 4x4 4x4
      array [AL12W AL13W AL14W AL15W AL0W AL1W CR10E AL3W
            CR12E CR13E CR14E CR15E CR0E CR1E AL10W CR3E]
   setup 8x2 2x8 rotate
      array [CR0N CR1N CR2N CR3N CR4N CR5N CR6N CR7N
            AL0S AL1S AL2S AL3S AL4S AL5S AL6S AL7S]
            alternate_definition [half] c1
   setup 2x4 4x4 plus_eighth_rotation
      array [CR10N CR15N AL15W AL13W AL14W AL3W CR11N CR9N]
   setup 4x2 4x4 plus_eighth_rotation
      array [CR10N CR15N CR3N CR1N AL14W AL3W AL7W AL5W]
            alternate_definition [lasthalf] c1
   setup 2x4 4x4 plus_eighth_rotation
      array [CR10N CR15N AL15W AL13W AL14W AL3W CR11N CR9N]
   setup 4x2 4x4 plus_eighth_rotation
      array [CR10N CR15N CR3N CR1N AL14W AL3W AL7W AL5W]

call "counter rotate for split sidetrack" dontshow tag ctr_rot_for_splitsidetrack
            dont_raise_overcast
   setup 2x2 2x2
      array [CR1E AL0W AL1W CR0E]
   setup 1x4 1x4 rotate
      array [CR0N CR1N AL0S AL1S]
   setup 1x2 1x2 rotate
      array [CR0N AL0S]
   setup dmd dmd rotate
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate
      array [0 CR1N 0 AL1S]
   setup star star
      array [CR1E 0 AL1W 0]
            alternate_definition [single] c3
   setup 1x2 1x2 rotate
      array [CR0N AL0S]
            alternate_definition [3x3] c4
   setup 3x2 2x3 rotate restriction controversial wave_only
      array [CR0N CR1N CR2N AL0S AL1S AL2S]
            alternate_definition [4x4] c4
   setup 4x2 2x4 rotate restriction controversial wave_only
      array [CR0N CR1N CR2N CR3N AL0S AL1S AL2S AL3S]

// This one is used for detour.  Its claim to fame is that, if done stingy/generous/fractal,
// and it is appropriate to do it (e.g. lockit in a wave), it does it.  If not appropriate,
// it simply ignores that flag, assuming that the generous was intended only for the outsides.
call "counter rotate for detour" dontshow tag ctrsdetour
            preserve_z_stuff dont_raise_overcast
   simple_funny
   setup 2x2 2x2
      array [CR1E AL0W AL1W CR0E]
   // So you can do it when the centers are in a Z.
   setup 3x2 2x3 rotate
      array [CR0N CR1N CR2N AL0S AL1S AL2S]
   setup 1x2 1x2 rotate
      array [CR0N AL0S]
   setup 1x4 1x4 rotate
      array [CR0N CR1N AL0S AL1S]
   setup dmd dmd rotate
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate
      array [0 CR1N 0 AL1S]
   setup star star
      array [CR1E 0 AL1W 0]
            alternate_definition [stingy] c3
   setup 2x2 2x2  // Same as normal.  Do NOT split into 1x2's.
      array [CR1E AL0W AL1W CR0E]
   setup 1x2 1x2
      array [ZM0N ZM1N]
   setup 1x4 dmd rotate
      array [CR0N ZM3W AL0S ZM1W]
   setup dmd 1x4 rotate
      array [CR0N 0 AL0S 0]
   setup pmd 1x4 rotate
      array [0 ZM1W 0 ZM3W]
   setup star star
      array [CR1E 0 AL1W 0]
            alternate_definition [generous] c3
   setup 2x2 2x2
      array [CR1E AL0W AL1W CR0E]
   setup 1x2 1x2
      array [CR1S AL0S]
   setup 1x4 dmd rotate
      array [CR0N CR1E AL0S AL3E]
   setup dmd 1x4 rotate
      array [CR0N 0 AL0S 0]
   setup pmd 1x4 rotate
      array [0 CR3E 0 AL1E]
   setup star star
      array [CR1E 0 AL1W 0]
            alternate_definition [fractal] c4
   setup 2x2 2x2
      array [CR1E AL0W AL1W CR0E]
   setup 1x2 1x2 rotate
      array [CR1S AL1N]
   setup 1x4 1x4 rotate no_cutting_through
      array [CR0N CR3S AL0S AL3N]
   setup dmd dmd rotate
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate
      array [0 CR3S 0 AL3N]
   setup star star
      array [CR1E 0 AL1W 0]



call "counter rotate @b" c1 tag ctr_rot_number
            neednumber
            parallel_conc_end
   counter_rotate [CR16E 16 AL16W 16]
            neednumber visible_fractions distribute_repetitions
            magic_is_inherited funny_is_inherited single_is_inherited nxn_is_inherited dont_raise_overcast
   seq ctr_rot [inherit_magic inherit_funny inherit_single inherit_nxn repeat_n]

call "counter rotate @9/8" c1
            neednumber distribute_repetitions
   seq ctr_rot_number [force_half]

call "split counter@O rotate@P" a2 tag splitctrrot
            can_be_one_side_lateral
            base_circ_call magic_is_inherited funny_is_inherited single_is_inherited
            bigmatrix_is_inherited gen_sting_is_inherited
            nxn_is_inherited mxn_is_inherited dont_raise_overcast
   // This does the trick, and does it the RIGHT WAY!  The old way, if we had
   // a 2x6, if we did "triple boxes working together split counter rotate",
   // the warning about setups not interacting with each other wouldn't be raised,
   // because it was an 8 person call.
   splitseq ctr_rot [inherit_magic inherit_funny inherit_single inherit_bigmatrix
                     inherit_gensting inherit_nxn inherit_mxn]

call "split counter rotate @b" a2
            neednumber visible_fractions distribute_repetitions
            magic_is_inherited funny_is_inherited nxn_is_inherited dont_raise_overcast
   // Don't use "repeat_n" -- the underlying counter rotate call will take care of that.
   splitseq ctr_rot_number [inherit_magic inherit_funny inherit_nxn]

call "split counter rotate @9/8" a2
            neednumber distribute_repetitions
   splitseq ctr_rot_number [force_half]

call "box counter rotate @b" a2
            neednumber visible_fractions distribute_repetitions
            magic_is_inherited funny_is_inherited nxn_is_inherited dont_raise_overcast
   seq boxctrrot [inherit_magic inherit_funny inherit_nxn repeat_n]

call "trade counter rotate" c4
   setup 2x4 2x4 rotate
      array [CR1N CR0N AL7S AL6S AL1S AL0S CR7N CR6N]
   // Make sure that the "cross lockit" version below
   // is only done as a 4-person call.
   setup 1x8 1x8 rotate restriction forbidden alwaysfail
      array [0 0 0 0 0 0 0 0]
   setup 1x4 1x4 rotate
      array [CR1N CR0N AL1S AL0S]

// **************************** END OF CIRC CALLS ****************************

call "_illegal call" dontshow tag boguscall
   setup 1x4 1x4 restriction forbidden alwaysfail
      array [0 0 0 0]

call "_1/2 flip" dontshow tag half_flip
   setup 1x4 2x2 restriction forbidden wave_only
      array [C1E A3E A0W C2W]
            alternate_definition [cross] c3
   setup 1x4 2x2 restriction forbidden 2fl_only
      array [C1E C2W A0W A3E]
            alternate_definition [rewind] c4
   setup 2x2 1x4 rotate restriction forbidden wave_only
      array [C1S A1N A0S C0N]

call "_flip back part 1" dontshow tag flip_back_1
            cross_is_inherited revert_is_inherited fractal_is_inherited rewind_is_inherited
   seq half_flip [inherit_cross inherit_rewind]
   seq revert_if_needed [inherit_revert inherit_fractal]

call "_fudgy slip the clutch" dontshow tag fudgyslipclutch
            imprecise_rotation
   setup thar thar restriction forbidden wave_only
      array [0N 3E 0 0 4N 3W 0 0]
   setup crosswave thar restriction forbidden wave_only
      array [0N 3E 0 0 4N 3W 0 0]
   setup pcrosswave thar restriction forbidden wave_only
      array [0 0 2N 5E 0 0 6N 5W]

call "slip the clutch" mainstream
   setup thar thar plus_eighth_rotation restriction forbidden wave_only
      array [CR0N CR1N 0 0 AL2W AL3W 0 0]
   setup crosswave thar plus_eighth_rotation restriction forbidden wave_only
      array [CR0N CR1N 0 0 AL2W AL3W 0 0]
   setup pcrosswave thar plus_eighth_rotation restriction forbidden wave_only
      array [0 0 CR2N CR3N 0 0 AL4W AL5W]
   // Callerlab says this is improper.  Many people think it's OK.
   setup 2x4 thar qualifier wave_only restriction controversial alwaysfail
      array [CR2E CR3E AL3W AL2W ZM4N ZM5N ZM1N ZM0N]

call "move along and make lines" mainstream
            dont_use_in_resolve
   setup thar c1phan plus_eighth_rotation restriction forbidden 1fl_only
      array [13N 15N 0 0 4W 6W 0 0]
   setup crosswave c1phan plus_eighth_rotation restriction forbidden 1fl_only
      array [13N 15N 0 0 4W 6W 0 0]
   setup pcrosswave c1phan plus_eighth_rotation restriction forbidden 1fl_only
      array [0 0 1N 3N 0 0 8W 10W]

call "cross by" c1
   setup thar thar plus_eighth_rotation restriction forbidden wave_only
      array [R1N R0N 0 0 L3W L2W 0 0]
   // Callerlab doesn't allow these, which means they don't allow multiple
   // cross by's starting in a 2x4.  Whatever.
   setup crosswave thar plus_eighth_rotation restriction forbidden wave_only
      array [R1N R0N 0 0 L3W L2W 0 0]
   setup pcrosswave thar plus_eighth_rotation restriction forbidden wave_only
      array [0 0 R3N R2N 0 0 L5W L4W]
   // Callerlab says this goes to a crosswave.  Don't blame me
   // if you exploit this and your squares break down.
   setup 2x4 crosswave rotate restriction forbidden wave_only
      array [CR1N CR0N AL0S AL1S ZM3W ZM2W ZM6W ZM7W]
      // This appears in a published reference.
      // We need to make a clear statement that it is illegal.
   setup qtag 2x4 restriction forbidden alwaysfail
      array [0 0 0 0 0 0 0 0]

// This one is naturally any hand, of course.
call "remake the thar" a1
   setup thar thar restriction forbidden wave_only
      array [3W 2W 0 0 3E 2E 0 0]
   setup crosswave thar restriction forbidden wave_only
      array [3W 2W 0 0 3E 2E 0 0]
   setup pcrosswave thar restriction forbidden wave_only
      array [0 0 5W 4W 0 0 5E 4E]

call "all 8 fan the top" dontshow tag all8fanthetop
            step_to_wave left_means_mirror
   setup thar thar restriction forbidden wave_only
      array [CR2E CR7W 0 0 AL2W AL7E 0 0]
   setup crosswave thar restriction forbidden wave_only
      array [CR2E CR7W 0 0 AL2W AL7E 0 0]
   setup pcrosswave thar restriction forbidden wave_only
      array [0 0 CR4E CR1W 0 0 AL4W AL1E]

call "all 8 spin the top" plus
            step_to_wave left_means_mirror visible_fractions
   seq trade []
   seq all8fanthetop []

call "@b top" a1
            visible_fractions neednumber imprecise_rotation step_to_wave
   seq trade []
   seq fudgyslipclutch [repeat_n]

call "remember the alamo" c4
   setup 2x4 4x4 no_compress restriction wave_only
      array [CR14S AL10W CR1E AL13S AL1W CR5S AL6S CR10E]

call "@6 break the alamo" c4
   setup 2x4 2x4 rotate
      predsnoselect
         if select [0 C0N A7S 0 0 A6S C1N 0]
         if always [0 0 0 0 0 0 0 0]
   setup 4x2 2x4 rotate
      predsnoselect
         if unselect [Z6W 0 0 C3E A0E 0 0 Z5W]
         if always   [0 0 0 0 0 0 0 0]
   setup 4x4 c1phan
      predsnoselect
         if select_once_rem_from_select [0 0 0 0 0 A3W  C6E  0 0 0 0 0 0 C4E A1W 0]
         if unselect                    [0 0 0 0 0 Z10N Z15N 0 0 0 0 0 0 C5S A0S 0]
         if always                      [0 0 0 0 0 0    0    0 0 0 0 0 0 0   0   0]
   setup alamo c1phan
      predsnoselect
         if select_near_select [C4E A1W 0 0 A3W  C6E  0 0]
         if unselect           [C5S A0S 0 0 Z10N Z15N 0 0]
         if always             [0   0   0 0 0    0    0 0]
   setup c1phan c1phan
      predsnoselect
         if unselect           [0 0 C5S 0 0 0 0 A0S 0 0 Z10N 0 0 0 0 Z15N]
         if person_select_sum9 [0 0 C4E 0 0 0 0 A1W 0 0 A3W  0 0 0 0 C6E]
         if always             [0 0 0   0 0 0 0 0   0 0 0    0 0 0 0 0]

call "adjust alamo to other pairing" mainstream
            dont_use_in_resolve
   setup 4x4 alamo plus_eighth_rotation
      array [0 1W 2N 0 0 3W 4N 0 0 5W 6N 0 0 7W 0N 0]
   setup alamo alamo plus_eighth_rotation
      array [7W 0N 1W 2N 3W 4N 5W 6N]
   setup c1phan alamo plus_eighth_rotation
      array [0 0 7W 6N 0 0 1W 0N 0 0 3W 2N 0 0 5W 4N]

call "allemande left in the alamo style" mainstream
            dont_use_in_resolve imprecise_rotation
   setup 4x4 4x4
      array [0 AL1E 0 0 0 AL5S AL6N 0 0 0 AL10E 0 0 0 0 0]

call "allemande left" mainstream
            dont_use_in_resolve
   setup 4x4 4x4
      array [0 AL1S 0 0 0 AL5W AL6E 0 0 0 AL10S 0 0 0 0 0]
   setup alamo 4x4
      array [0 0 AL1S 0 AL5W AL6E 0 AL10S]

call "allemande thar, go right and left and form a star" mainstream
            dont_use_in_resolve imprecise_rotation
   setup 4x4 thar qualifier in in_or_out
      array [0 0 1N 0 0 0 0 0 0 6E 0 0 0 0 0 0]
   setup 4x4 thar qualifier out in_or_out
      array [0 1N 0 0 0 0 0 0 0 0 0S 0 0 0 0 0]
   setup alamo thar qualifier in in_or_out
      array [0 0 0 1N 0 0 6E 0]
   setup alamo thar qualifier out in_or_out
      array [0 0 1N 0 0 0 0 0S]

call "shoot the star" mainstream
            dont_use_in_resolve
   setup thar alamo qualifier miniwaves
      array [CR6S AL6S 0 0 AL3S CR3S 0 0]

call "_plain promenade @b" dontshow tag plainprom
            neednumber
   setup 2x2 2x2 qualifier ntbone num 1 couples_only
      array [CAL0E CAL3E CAL1W CAL2W]
   setup 2x2 2x2 qualifier ntbone num 2 couples_only
      array [CAL3N CAL2N CAL0S CAL1S]
   setup 2x2 2x2 qualifier ntbone num 3 couples_only
      array [CAL2W CAL1W CAL3E CAL0E]
   setup 2x2 2x2 qualifier ntbone num 4 couples_only
      array [CAL1S CAL0S CAL2N CAL3N]
   setup 1x4 2x2 qualifier ntbone num 1 couples_only
      array [0 0 AL0S AL1S]
   setup 1x4 2x2 qualifier ntbone num 2 couples_only
      array [0 0 AL3E AL0E]
   setup 1x4 2x2 qualifier ntbone num 3 couples_only
      array [0 0 AL2N AL3N]
   setup 1x4 2x2 qualifier ntbone num 4 couples_only
      array [0 0 AL1W AL2W]
   setup 2x1 1x2 rotate qualifier num 1 none
      array [CAL1S CAL0N]
   setup 2x1 1x2 qualifier num 2 none
      array [CAL1S CAL0N]
   setup 2x1 1x2 rotate qualifier num 3 none
      array [CAL0N CAL1S]
   setup 2x1 1x2 qualifier num 4 none
      array [CAL0N CAL1S]

call "_plain promenade @9/8" dontshow tag plainpromeighths
            neednumber
   setup 2x2 2x2 plus_eighth_rotation qualifier ntbone num 1 couples_only
      array [CAL0E CAL3E CAL1W CAL2W]
   setup 2x2 2x2 plus_eighth_rotation qualifier ntbone num 3 couples_only
      array [CAL3N CAL2N CAL0S CAL1S]
   setup 2x2 2x2 plus_eighth_rotation qualifier ntbone num 5 couples_only
      array [CAL2W CAL1W CAL3E CAL0E]
   setup 2x2 2x2 plus_eighth_rotation qualifier ntbone num 7 couples_only
      array [CAL1S CAL0S CAL2N CAL3N]

call "_centers back away" dontshow tag cba
   setup 2x4 2x4 rotate
      array [0    0    0    0    0    ZM3W ZM4W 0]
   setup 4x2 2x4 rotate
      array [ZM6W 0    0    0    0    0    0    ZM5W]
   setup spindle 3x23
      array [0    0    0    0    ZM4N ZM5N ZM6N 0]
   setup pspindle 3x23
      array [0    0    0    0    0    0    0 ZM7N]

call "_centers (maybe 2) do @0" dontshow tag centers_or_2_mandatory_call
   conc_or_2_6 nullcall [mandatory_anycall] nullcall []

call "centers back away, others come in and @0" mainstream
   seq cba []
   seq centers_or_2_mandatory_call []

call "promenade @b and @0" dontshow tag promenade_and_anycall
            neednumber
   seq plainprom []
   seq nullcall [mandatory_anycall]

call "promenade halfway, come in to the middle and @0" mainstream
            sequence_starter_promenade
   crossconc_specialpromenade promenade_and_anycall [insert_number 2] nullcall [conc_concentric_rules]

call "promenade @b, come in to the middle and @0" mainstream
            sequence_starter_promenade neednumber
   crossconc_specialpromenade promenade_and_anycall [] nullcall [conc_concentric_rules]

call "promenade halfway, while the others @0" mainstream
            sequence_starter_promenade
   conc_specialpromenade nullcall [mandatory_anycall] plainprom [conc_concentric_rules insert_number 2]

call "promenade @b, while the others @0" mainstream
            sequence_starter_promenade neednumber
   conc_specialpromenade nullcall [mandatory_anycall] plainprom [conc_concentric_rules]

call "promenade @9/8, while the others @0" mainstream
            sequence_starter_promenade neednumber
   conc_specialpromenade nullcall [mandatory_anycall] plainpromeighths [conc_concentric_rules]

// We need "conc_force_lines" on this because we already had so-and-so
// go into the center, so they perceive the elongation of the setup
// incorrectly.  If the number is odd, the call "rotate" from a 2x2
// would go to antispots (normally the right thing, of course), but
// that's not what we want here.

call "rotate @b while the others @0" c1
            sequence_starter_promenade reverse_means_mirror neednumber single_is_inherited dont_use_in_resolve
   conc_specialpromenade nullcall [mandatory_anycall] rotn [inherit_reverse inherit_single conc_force_lines]

call "_just separate" dontshow tag just_separate
   setup 2x2 2x2 qualifier ntbone none
      array [AL0S CR1S CAL2N ACR3N]

call "_separate and @0" dontshow tag separate_and
   seq just_separate []
   seq nullcall [mandatory_anycall]

call "separate and @0" mainstream
            sequence_starter_promenade
   conc_specialpromenade nullcall [] separate_and [conc_demand_columns conc_force_otherway]
   // If this is invoked not as part of a "heads separate ..." operation, the preceding definition will fail,
   // because the "[cross]conc_specialpromenade" schema is only legal in that case.  When it fails, it will
   // go to this next definition, which will have the ends do the separate.  Of course it is also legal
   // to say "ends separate" (or heads, or whatever), getting the call just below, which is somewhat more
   // sophisticated.

   // This is another definition clause, used when the clause above fails.
   conc nullcall [] separate_and [conc_demand_columns conc_force_otherway]

call "@6 separate and @0" mainstream
   seq prepare_to_separate [normalize]
   seq rest_of_separate []

call "@6 _prepare to separate" dontshow tag prepare_to_separate
   setup 2x4 2x4 rotate qualifier centers_sel
      array [ZM6W ZM7W ZM0W ZM1W ZM2W    0    0 ZM5W]
   setup 4x2 2x4 rotate qualifier centers_sel
      array [ZM6W    0    0 ZM1W ZM2W    0    0 ZM5W]
   setup 2x4 2x4 qualifier ends_sel
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 4x2 2x4 qualifier ends_sel
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 4x4 4x4
      predsnoselect
         if select   [  0    0    0 0 0 ZM5N  ZM6N 0  0     0     0 0 0 AL13S CR14S 0]
         if unselect [  0 ZM3N ZM7N 0 0 ZM7N ZM11N 0  0 ZM11N ZM15N 0 0 ZM15N ZM3N 0]

call "_rest of separate and @0" dontshow tag rest_of_separate
   conc nullcall [] separate_and [conc_demand_columns conc_force_otherway]

call "flip your lid" c3
   setup qtag qtag qualifier right wave_only
      array [0 0   0 C4N C5N C2S C7S   0]
   setup qtag qtag qualifier left wave_only
      array [0 0 A3S   0 A6S A4N   0 A5N]

call "ping-pong circulate" plus
   setup qtag qtag qualifier right wave_only
      array [0 0 0    AL0S ZM3N ZM6N CR1S 0]
   setup qtag qtag qualifier left wave_only
      array [0 0 AL0S 0    ZM2N ZM7N 0    CR1S]
   setup hrglass hrglass qualifier ctr_pts_rh
      array [0 0 0    0 0    ZM6N CR1S 0]
   setup hrglass hrglass qualifier ctr_pts_lh
      array [0 0 AL0S 0 ZM2N 0    0    0]
   setup bone bone rotate
      array [0 0 0 AL5E 0 0 CR0E 0]   // We only allow right hands here ....
   setup pbone bone rotate
      array [ZM6W 0 0 0 0 ZM3W 0 0]   // or else we would be hypocritical here.
         // Unless, of course, you think the outsides should look
         // at the handedness of a wave that is T-boned to them????
   // Want to be able to use the "split" concept.
   setup pmd dmd qualifier right wave_only restriction forbidden levelc4a
      array [ZM1N CR2S 0 0]
   setup pmd dmd qualifier left wave_only restriction forbidden levelc4a
      array [ZM3N 0 0 AL2S]

// Still need this:  From an hourglass-like thing, you can say
// "center 4 split ping-pong circulate", because "split ping-pong
// circulate" is a recognized call in its own right.  But you can't
// give the "split" concept.
call "split ping-pong circulate" c4a
   setup pmd dmd qualifier right wave_only
      array [ZM1N CR2S 0 0]
   setup pmd dmd qualifier left wave_only
      array [ZM3N 0 0 AL2S]

call "_top it off part 3" dontshow tag topitoff_part3
   conc nullcall [] fincoupleup []

call "_top it off part 2" dontshow tag topitoff_part2
            yoyo_is_inherited gen_sting_is_inherited
   conc6_2 boxy_cast_off_34 [] hinge []

call "@2top @3it off" c4x tag topitoff
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            first_part_visible
   seq trade [inherit_yoyo inherit_gensting or_anycall]
   seq topitoff_part2 [inherit_yoyo inherit_gensting inherit_fractal]
   seq topitoff_part3 [roll_transparent]

call "@0 it off" c4x
            dont_use_in_resolve first_part_visible
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq nullcall [mandatory_anycall]
   seq topitoff_part2 [inherit_yoyo inherit_gensting inherit_fractal]
   seq topitoff_part3 [roll_transparent]

call "fall into a column" c4a
            fudge_to_q_tag
   setup qtag 2x4 rotate qualifier right wave_only
      array [0 0    0 CR2E ZM4W ZM5W ZM7W    0]
   setup qtag 2x4 rotate qualifier left wave_only
      array [0 0 ZM0W    0 ZM2W ZM3W    0 AL5E]
   setup pqtag 2x4 rotate qualifier right wave_only
      array [ZM0W 0    0    0    0 ZM5W    0    0]
   setup pqtag 2x4 rotate qualifier left wave_only
      array [ZM6W 0    0    0    0 ZM3W    0    0]
   // Can do it this way if there are no outsides to get confused.
   setup qtag 2x4 rotate qualifier miniwaves
      array [0 0 ZM0W CR2E    0    0 ZM7W AL5E]
            alternate_definition [cross] c4
   setup qtag 2x4 rotate qualifier right 2fl_only
      array [0 0 0 0 ZM4W ZM5W ZM7W CR2E]
   setup qtag 2x4 rotate qualifier left 2fl_only
      array [0 0 ZM0W AL5E ZM2W ZM3W 0 0]

call "_ctrs stampede" dontshow tag ctrsstampede
            visible_fractions single_is_inherited nxn_is_inherited
   seq tradethewave [allow_forced_mod]
   seq hinge [allow_forced_mod]
   seq and_cross [allow_forced_mod inherit_single inherit_nxn roll_transparent]

call "_ctrs stampede but @m" dontshow tag ctrsstampedebut
            visible_fractions
   seq tradethewave [allow_forced_mod]
   seq hinge [allow_forced_mod]
   seq nullsecond [mandatory_secondary_call]

call "_ends stampede" dontshow tag endsstampede
            parallel_conc_end
   setup 2x2 2x2
      array [CR2W AL3E 0 0]

call "stampede" c3a tag stampede
            fudge_to_q_tag single_is_inherited nxn_is_inherited
   conc ctrsstampede [inherit_single inherit_nxn]
        endsstampede [conc_demand_columns conc_force_columns endscando inherit_single inherit_nxn]

call "stampede but @m" c3x tag stampedebut
            fudge_to_q_tag single_is_inherited nxn_is_inherited
   conc ctrsstampedebut []
        endsstampede [conc_demand_columns conc_force_columns endscando inherit_single inherit_nxn]

call "scoot your leader" c3a
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq scootbacktowave [inherit_yoyo inherit_gensting]
   seq leader [inherit_fractal]

call "@2scoot @3and stampede" c3a
            yoyo_is_inherited gen_sting_is_inherited
   seq qtagscootback [or_anycall inherit_yoyo inherit_gensting]
   seq stampede []

call "@2scoot @3and stampede but @m" c3x
            yoyo_is_inherited gen_sting_is_inherited
   seq qtagscootback [or_anycall inherit_yoyo inherit_gensting]
   seq stampedebut []

call "@2scoot @3and gravitate" c4a
            left_means_mirror yoyo_is_inherited gen_sting_is_inherited
   seq rtqtagscootback [or_anycall inherit_left inherit_yoyo inherit_gensting]
   seq gravitate [inherit_reverse]

call "scoot chain thru and gravitate" c4a
            yoyo_is_inherited gen_sting_is_inherited
   seq scootchainthru [inherit_yoyo inherit_gensting]
   seq gravitate []

call "@2scoot @3and scamper" c4a
            left_means_mirror yoyo_is_inherited gen_sting_is_inherited first_part_visible
   seq qtagscootback [or_anycall inherit_left inherit_yoyo inherit_gensting]
   seq scamper [inherit_left]

call "stroll part 1" dontshow tag stroll1
            fudge_to_q_tag
   setup qtag 3x4
      predscantdocallinsetup
         if q_line_front [ZM1N ZM2N ZM3N AL11S ZM7N  ZM8N ZM0N CR5S]
         if q_line_back  [   0    0 ZM3N AL11S ZM4N ZM10N ZM0N CR5S]
         if always       [   0    0 ZM3N AL11S    0     0 ZM0N CR5S]
            alternate_definition [yoyo] c4
   setup hrglass 3x4
      predscantdocallinsetup
         if q_line_front [ZM1N ZM2N ZM3N 0 ZM7N  ZM8N ZM0N 0]
         if q_line_back  [   0    0 ZM3N 0 ZM4N ZM10N ZM0N 0]
         if always       [   0    0 ZM3N 0    0     0 ZM0N 0]
   setup phrglass 3x4
      array [0 0 0 CR11W 0 0 0 AL11E]

call "stroll part 2" dontshow tag stroll2
   in_out_triple_squash waverecycle [or_anycall] nullcall []

call "stroll part 3" dontshow tag stroll3
   setup qtag 2x4 qualifier right 2fl_only
      array [ZM2N ZM3N ZM3N ZM2N ZM6N ZM7N ZM0N ZM1N]
   setup qtag 2x4 qualifier left 2fl_only
      array [ZM0N ZM1N ZM3N ZM2N ZM4N ZM5N ZM0N ZM1N]
   setup qtag 2x4
      array [   0    0 ZM3N ZM2N    0    0 ZM0N ZM1N]
   setup pqtag 2x4 qualifier right 2fl_only
      array [ZM2N ZM3N 0 0 ZM6N ZM7N 0 0]
   setup pqtag 2x4 qualifier left 2fl_only
      array [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]
   setup 3x2 2x4 rotate qualifier right dmd_ctrs_mwv
      array [ZM7W ZM1W ZM2W ZM3W 0    ZM6W]
   setup 3x2 2x4 rotate qualifier left dmd_ctrs_mwv
      array [ZM5W 0    ZM0W ZM1W ZM2W ZM4W]
   setup 2x3 2x4 rotate qualifier right dmd_ctrs_mwv
      array [ZM7W 0    ZM2W ZM3W 0    ZM6W]
   setup 2x3 2x4 rotate qualifier left dmd_ctrs_mwv
      array [ZM5W 0    ZM0W ZM1W 0    ZM4W]
   setup bigdmd c1phan qualifier right 2fl_only
      array [ZM0N ZM2N 0 0 0 0 ZM8N ZM10N 0 0 0 0]
   setup pbigdmd c1phan qualifier right 2fl_only
      array [ZM0N ZM2N ZM4N ZM6N 0 0 ZM8N ZM10N 0 0 0 0]
   setup bigdmd c1phan qualifier left 2fl_only
      array [0 0 0 0 ZM7N ZM5N 0 0 0 0 ZM15N ZM13N]
   setup pbigdmd c1phan qualifier left 2fl_only
      array [0 0 0 0 ZM7N ZM5N 0 0 ZM9N ZM11N ZM15N ZM13N]
   setup 4x5 c1phan qualifier right 2fl_only
      array [0 0 0 0 0 0 0 0 ZM2N ZM0N 0 0 0 0 0 0 0 0 ZM10N ZM8N]
   setup 5x4 c1phan qualifier right 2fl_only
      array [0 0 ZM4N 0 0 0 0 ZM6N ZM2N ZM0N 0 0 0 0 0 0 0 0 ZM10N ZM8N]
   setup 4x5 c1phan qualifier left 2fl_only
      array [0 0 0 0 0 ZM5N ZM7N 0 0 0 0 0 0 0 0 ZM13N ZM15N 0 0 0]
   setup 5x4 c1phan qualifier left 2fl_only
      array [0 0 0 0 0 ZM5N ZM7N 0 0 0 0 0 ZM9N 0 0 ZM13N ZM15N ZM11N 0 0]
   setup 3x4 2x4 qualifier right ctr_2fl_only
      array [ZM0N ZM1N ZM2N ZM3N 0 0 ZM4N ZM5N ZM6N ZM7N ZM0N ZM1N]
   setup 4x3 2x4 qualifier right ctr_2fl_only
      array [ZM0N ZM1N ZM2N ZM3N 0 0 ZM4N ZM5N ZM6N ZM7N 0 0]
   setup 3x4 2x4 qualifier left ctr_2fl_only
      array [ZM0N ZM1N ZM2N ZM3N ZM3N ZM2N ZM4N ZM5N ZM6N ZM7N 0 0]
   setup 4x3 2x4 qualifier left ctr_2fl_only
      array [ZM0N ZM1N ZM2N ZM3N 0 0 ZM4N ZM5N ZM6N ZM7N 0 0]
   setup crosswave c1phan qualifier right ctr_2fl_only
      array [ZM0N ZM2N 0 0 ZM8N ZM10N 0 0]
   setup pcrosswave c1phan qualifier right ctr_2fl_only
      array [ZM0N ZM2N ZM4N ZM6N ZM8N ZM10N 0 0]
   setup crosswave c1phan qualifier left ctr_2fl_only
      array [ZM13N ZM15N 0 0 ZM5N ZM7N 0 0]
   setup pcrosswave c1phan qualifier left ctr_2fl_only
      array [ZM13N ZM15N 0 0 ZM5N ZM7N ZM9N ZM11N]

call "stroll @2and cycle@3" c4a
            yoyo_is_inherited
   seq stroll1 [inherit_yoyo]
   seq stroll2 []
   seq stroll3 []

call "stroll @0" c4a
            yoyo_is_inherited
   seq stroll1 [inherit_yoyo]
   seq triple_squash_outers_anything []
   seq stroll3 []

call "bring us together" c4a
            sequence_starter left_means_mirror reverse_means_mirror
   setup 2x4 2x4
      array [0 0 0 0 0 CM2S CM3S 0]
   setup 4x2 c1phan
      array [CAL10W CM9S 0 AL0E AL2E 0 CM11S CAL8W]
   setup 3x2 2x3
      array [CAL4W 0 AL0E AL1E 0 CAL3W]
            alternate_definition [single] c4a
   setup dmd 2x2
      array [0 0 0 CM1S]
   setup pmd 2x2
      array [CAL2W 0 AL0E 0]
   setup 2x3 2x3
      array [0 0 0 0 CM2S 0]
            alternate_definition [1x3] c4
   setup spindle 2x4
      array [0 0 0 0 CM1S CM2S CM3S 0]
   setup pspindle 2x4
      array [0 0 0 AL0E 0 0 0 CAL4W]
   setup 3dmd 2x4 rotate
      array [AL4N AL5N AL6N 0 0 0 CAL0S CAL1S CAL2S 0 0 0]
   setup p3dmd 2x4 rotate
      array [0 0 0 0 0 0 0 0 0 0 0 CM3E]
            alternate_definition [3x1] c4    /* Same as 1x3. */
   setup spindle 2x4
      array [0 0 0 0 CM1S CM2S CM3S 0]
   setup pspindle 2x4
      array [0 0 0 AL0E 0 0 0 CAL4W]
   setup 3dmd 2x4 rotate
      array [AL4N AL5N AL6N 0 0 0 CAL0S CAL1S CAL2S 0 0 0]
   setup p3dmd 2x4 rotate
      array [0 0 0 0 0 0 0 0 0 0 0 CM3E]

call "1/4 circle bring us together" c4a
            single_is_inherited left_means_mirror reverse_means_mirror
   setup 4x2 c1phan
      array [CAL10W CM5E 0 AL0E AL2E 0 CM7E CAL8W]
   setup 2x4 c1phan
      array [0 0 0 0 0 CM3E CM1E 0]
            alternate_definition [single] c4a
   setup 4x1 2x2
      array [CAL2W CM1E AL0E 0]
            alternate_definition [3x3] c4
   setup 4x3 2x6
      array [CAL8W CM5E 0 AL0E AL1E 0 AL2E 0 CM3E CAL6W CAL7W CM4E]

call "3/4 circle bring us together" c4a
            single_is_inherited left_means_mirror reverse_means_mirror
   setup 4x2 c1phan
      array [CAL10W CM13W 0 AL0E AL2E 0 CM15W CAL8W]
   setup 2x4 c1phan
      array [0 0 0 0 0 CM11W CM9W 0]
            alternate_definition [single] c4a
   setup 4x1 2x2
      array [CAL2W CM3W AL0E 0]
            alternate_definition [3x3] c4
   setup 4x3 2x6
      array [CAL8W CM11W 0 AL0E AL1E 0 AL2E 0 CM9W CAL6W CAL7W CM10W]

call "ends go as you are, bring us together" c4a
            single_is_inherited left_means_mirror reverse_means_mirror
   setup 2x4 2x4
      array [0 0 0 AL0S AL1S CM2S CM3S 0]
            alternate_definition [single] c4
   setup dmd 2x2
      array [0 0 AL0S CM1S]

call "exchange the diamonds, first 1/4" dontshow tag exchd1
            fudge_to_q_tag take_right_hands
            // People shouldn't actually have to take right hands,
            // unless something very strange is going on.
   setup qtag bigdmd rotate qualifier wave_only
      array [   0    0 AL1S AL11S    0    0 CR10N CR0N]

/* old way */
   setup qtag qtag qualifier 2fl_only
      array [   0    0 AL1W AL0W    0    0 CR0E CR1E]

// New way
//   setup qtag wqtag qualifier 2fl_only
//      array [   0    0 AL1W AL0W    0    0 CR0E CR1E]


   setup pqtag bigdmd rotate qualifier wave_only
      array [CR9N CR2N    0     0 AL2S AL9S     0    0]
/* old way */
   setup pqtag qtag qualifier 2fl_only
      array [CR7E CR2E    0    0 AL2W AL7W    0    0]

// New way
//   setup pqtag wqtag qualifier 2fl_only
//      array [CR9E CR3E    0    0 AL3W AL9W    0    0]



   setup ptpd bigptpd qualifier dmd_not_intlk
      array [   CR4E    0 CR6E 0    AL7W    0 AL5W 0]
   setup ptpd ptpd qualifier dmd_intlk
      array [   CR1E    0 CR7E 0    AL7W    0 AL1W 0]
   setup pptpd bigptpd qualifier dmd_not_intlk
      array [0 CR3E    0     AL3W 0 AL8W     0    CR8E]
   setup pptpd ptpd qualifier dmd_intlk
      array [0 CR2E    0    AL2W 0 AL4W    0    CR4E]
            alternate_definition [interlocked] c2
   setup qtag bigdmd rotate qualifier 2fl_only
      array [   0    0 AL1S CR0N    0    0 CR10N AL11S]
   setup qtag qtag qualifier wave_only
      array [   0    0 AL1W CR1E    0    0 CR0E AL0W]
   setup pqtag bigdmd rotate qualifier 2fl_only
      array [CR3N CR2N    0     0 AL2S AL3S     0    0]
   setup pqtag qtag qualifier wave_only
      array [CR3E CR2E    0    0 AL2W AL3W    0    0]
   setup ptpd bigptpd qualifier dmd_intlk
      array [CR4E    0 AL5W 0    AL7W    0 CR6E 0]
   setup ptpd ptpd qualifier dmd_not_intlk
      array [CR1E    0 AL1W 0    AL7W    0 CR7E 0]
   setup pptpd bigptpd qualifier dmd_intlk
      array [0 CR9E    0     AL9W 0 AL8W     0    CR8E]
   setup pptpd ptpd qualifier dmd_not_intlk
      array [0 CR6E    0    AL6W 0 AL4W    0    CR4E]

call "continue to exchange the diamonds another 1/4" c2
   // We have to give this a "do_exchange_compress" flag, which exchd2 doesn't have.
            fudge_to_q_tag take_right_hands intlk_is_inherited do_exchange_compress
   seq exchd2 [inherit_intlk]

call "exchange the diamonds, second 1/4" dontshow tag exchd2
            fudge_to_q_tag take_right_hands
            // People shouldn't actually have to take right hands,
            // unless something very strange is going on.
   setup qtag bigdmd rotate
      array [   0    0 AL1S AL11S    0    0 CR10N CR0N]
   setup pqtag bigdmd rotate
      array [CR9N CR2N    0     0 AL2S AL9S     0    0]
   setup ptpd bigptpd
      array [   CR4E    0 CR6E 0    AL7W    0 AL5W 0]
   setup pptpd bigptpd
      array [0 CR3E    0     AL3W 0 AL8W     0    CR8E]
   setup bigdmd bigdmd   // If people have come from an incongruous hand, we allow it anyway.
      array [CR2E CR2E    0    0 AL2W AL2W AL9W AL9W    0    0 CR9E CR9E]
   setup pbigdmd bigdmd
      array [   0    0 CR4E CR6E    0    0    0    0 AL7W AL5W    0    0]
   setup bigptpd bigptpd
      array [   0    0 CR4E CR6E    0    0    0    0 AL7W AL5W    0    0]
   setup pbigptpd bigptpd
      array [AL3W AL3W    0    0 CR3E CR3E CR8E CR8E    0    0 AL8W AL8W]
   setup wqtag qtag
      array [   0    0 AL1W AL1W  0    0    0 CR0E CR0E 0]
   setup pwqtag qtag
      array [CR7E CR2E    0    0 0 AL2W AL7W    0    0    0]
            alternate_definition [interlocked] c2
   setup qtag bigdmd rotate
      array [   0    0 AL1S CR0N    0    0 CR10N AL11S]
   setup pqtag bigdmd rotate
      array [CR3N CR2N    0    0 AL2S AL3S    0    0]
   setup ptpd bigptpd
      array [CR4E    0 AL5W 0    AL7W    0 CR6E 0]
   setup pptpd bigptpd
      array [0 CR9E    0     AL9W 0 AL8W     0    CR8E]
   setup bigdmd bigdmd
      array [CR2E CR2E    0    0 AL2W AL2W AL3W AL3W    0    0 CR3E CR3E]
   setup pbigdmd bigdmd
      array [   0    0 CR4E AL5W    0    0    0    0 AL7W CR6E    0    0]
   setup bigptpd bigptpd
      array [   0    0 CR4E AL5W    0    0    0    0 AL7W CR6E    0    0]
   setup pbigptpd bigptpd
      array [AL9W AL9W    0    0 CR9E CR9E CR8E CR8E    0    0 AL8W AL8W]

call "exchange the diamonds, third or fourth 1/4" dontshow tag exchd3_or_4
            fudge_to_q_tag take_right_hands
            // The taking of right hands is serious for this one.
   setup qtag qtag restriction controversial diamond_like
      array [   0    0 AL1W AL0W    0    0 CR0E CR1E]
   setup pqtag qtag restriction controversial diamond_like
      array [CR7E CR2E    0    0 AL2W AL7W    0    0]
   setup bigdmd qtag rotate
      array [CR6N CR6N    0    0 AL6S AL6S AL3S AL3S    0    0 CR3N CR3N]
   setup pbigdmd qtag rotate
      array [   0    0 CR0N CR1N    0    0    0    0 AL1S AL0S    0    0]
   setup ptpd ptpd restriction controversial diamond_like
      array [   CR1E    0 CR7E 0    AL7W    0 AL1W 0]
   setup pptpd ptpd restriction controversial diamond_like
      array [0 CR2E    0    AL2W 0 AL4W    0    CR4E]
   setup bigptpd ptpd
      array [0 0 CR1E CR7E 0 0 0 0 AL7W AL1W 0 0]
   setup pbigptpd ptpd
      array [AL2W AL2W 0 0 CR2E CR2E CR4E CR4E 0 0 AL4W AL4W]
            alternate_definition [interlocked] c2
   setup qtag qtag restriction controversial diamond_like
      array [   0    0 AL1W CR1E    0    0 CR0E AL0W]
   setup pqtag qtag restriction controversial diamond_like
      array [CR3E CR2E    0    0 AL2W AL3W    0    0]
   setup bigdmd qtag rotate
      array [CR6N CR6N    0    0 AL6S AL6S AL7S AL7S    0    0 CR7N CR7N]
   setup pbigdmd qtag rotate
      array [   0    0 CR0N AL0S    0    0    0    0 AL1S CR1N    0    0]
   setup ptpd ptpd restriction controversial diamond_like
      array [CR1E    0 AL1W 0    AL7W    0 CR7E 0]
   setup pptpd ptpd restriction controversial diamond_like
      array [0 CR6E    0    AL6W 0 AL4W    0    CR4E]
   setup bigptpd ptpd restriction controversial diamond_like
      array [0 0 CR1E AL1W 0 0 0 0 AL7W CR7E 0 0]
   setup pbigptpd ptpd restriction controversial diamond_like
      array [AL6W AL6W 0 0 CR6E CR6E CR4E CR4E 0 0 AL4W AL4W]

// This one takes a fraction in the call name, at the end.
call "exchange the diamonds @a" c2 tag exchdmd
            fudge_to_q_tag take_right_hands intlk_is_inherited neednumber visible_fractions do_exchange_compress
   seq_with_fraction exchd1 [inherit_intlk]
   seq exchd2 [inherit_intlk]
   seq exchd3_or_4 [inherit_intlk]
   seq exchd3_or_4 [inherit_intlk]

// This one can take an optional fraction in front, in the usual way.
call "exchange the diamonds" c2
            fudge_to_q_tag take_right_hands intlk_is_inherited visible_fractions do_exchange_compress
   seq exchd1 [inherit_intlk]
   seq exchd2 [inherit_intlk]
   seq exchd3_or_4 [inherit_intlk]
   seq exchd3_or_4 [inherit_intlk]

call "exchange the boxes, first 1/4" dontshow tag exchb1
            take_right_hands
   setup 4x2 4x4 qualifier wave_only
      array [ZM15N ZM5N ZM1N CR2S AL1S ZM2N ZM14N ZM11N]
   setup 4x2 2x4 qualifier magic_only
      array [ZM1N ZM5N ZM3N CR4S AL3S ZM4N ZM2N ZM6N]

call "exchange the boxes, second 1/4" dontshow tag exchb2
   setup 4x4 4x4
      array [AL13S ZM0N 0 ZM0N ZM2N ZM7N ZM11N ZM10N ZM9N 0 ZM12N ZM1N CR14S CR14S AL13S ZM12N]
   setup 4x2 4x4
      array [ZM15N ZM5N ZM0N CR2S AL1S ZM4N ZM14N ZM11N]

call "exchange the boxes, third 1/4" dontshow tag exchb3
   setup 4x4 4x4
      array [AL13S ZM14N 0 0 0 ZM7N ZM11N ZM10N 0 0 ZM13N ZM1N CR14S CR14S AL13S 0]

call "exchange the boxes, fourth 1/4" dontshow tag exchb4
   setup 4x4 4x4
      array [AL13S ZM14N 0 0 0 ZM7N ZM11N ZM15N 0 0 ZM13N ZM3N CR14S CR14S AL13S 0]

// This one takes a fraction in the call name, at the end.
//
// For this and the version with no explicit fraction, we
// use both a by-parts definition and a by-array definition.
// We need the by-parts definition to handle fractional exchanges
// properly, with all the "collisions".  But it only works
// from columns.  We need the by-array definition to handle the call
// from lines of from T-bones.  This means that we can't handle
// "collisions" (that is, the fact of people taking inner and
// outer tracks) properly from lines.  When a "collision" occurs
// in an exchange from lines, it could presumably push other people
// farther out, the way collisions work in general.  We handle a few
// cases of this, using the "do_exchange_compress" mechanism.
// Only the outer people can participate in this.  I know of no theory
// that is actually used for the inner people.
// The array definition is given first, because it is better at knowing
// whether or not an array expansion is needed after fractional
// exchanges.  See ug06, vg01, vi05, nf17.
call "exchange the boxes @a" c3a
            neednumber do_exchange_compress
   setup 2x4 2x4 qualifier num 1 none
      array [CR1S AL0S CR3S AL2S ZM3N ZM1N ZM2N ZM0N]
   setup 4x2 2x4 qualifier num 1 none
      array [ZM1N ZM5N ZM3N CR4S AL3S ZM4N ZM2N ZM6N]
   setup 2x4 2x8 qualifier num 2 wave_only restriction controversial alwaysfail
      array [CM11S AM14S CM9S AM12S AL5S AL0S CR7S CR2S]
   setup 2x4 2x6 qualifier num 2 none
      array [CM8S AM10S CM7S AM9S AL3S AL0S CR5S CR2S]
   setup 4x2 4x4 qualifier num 2 none
      array [ZM5N ZM4N CR2S CM7S AM3S AL1S ZM0N ZM14N]
   setup 2x4 2x4 no_compress qualifier num 3 none
      array [CCAL4N AL6N CR5N AACR7N AM6S AM7S CM4S CM5S]
   setup 4x2 4x4 no_compress qualifier live num 3 none
      predscantdocallinsetup
         if columns_tandem [ZM2N AL1S CM7S CM13S AM6S AM3S CR2S ZM1N]
         if always         [ZM2N AL1S CM7S CM15S AM11S AM3S CR2S ZM1N]
   setup 4x2 2x4 no_compress qualifier num 3 none
      array [ZM4N AL3S CM5S CM1S AM6S AM2S CR4S ZM3N]
   setup 2x4 2x4 qualifier num 4 none
      array [CCAM3N AM2N CM1N AACM0N AACR7N AL6N CR5N CCAL4N]
   setup 4x2 2x4 qualifier num 4 none
      array [AL3S AM2S CM1S CM0S AM7S AM6S CM5S CR4S]
            take_right_hands neednumber visible_fractions do_exchange_compress
   seq_with_fraction exchb1 [normalize]
   seq exchb2 [normalize]
   seq exchb3 [normalize]
   seq exchb4 [normalize]

// This one can take an optional fraction in front, in the usual way.
call "exchange the boxes" c3a
   setup 2x4 2x4
      array [CCAM3N AM2N CM1N AACM0N AACR7N AL6N CR5N CCAL4N]
   setup 4x2 2x4
      array [AL3S AM2S CM1S CM0S AM7S AM6S CM5S CR4S]
            alternate_definition [3x3 12matrix] c4
   setup 6x2 2x6 restriction wave_only
      array [A5S A4S A3S C2S C1S C0S A11S A10S A9S C8S C7S C6S]
            alternate_definition [4x4 16matrix] c4
   setup 8x2 2x8 restriction wave_only
      array [A7S A6S A5S A4S C3S C2S C1S C0S A15S A14S A13S A12S C11S C10S C9S C8S]
            take_right_hands visible_fractions do_exchange_compress
   seq exchb1 [normalize]
   seq exchb2 [normalize]
   seq exchb3 [normalize]
   seq exchb4 [normalize]

call "exchange the boxes 7/8" c4
   setup 4x2 spindle qualifier ntbone wave_only
      array [AL3W AM2S CM1S CM0S AM6S AM5S CM4S CR3E]
   setup 4x2 hyperglass
      array [AL6W 0 CM4S 0 0 AM10S 0 CR6E]
   setup 2x4 qtag //qualifier wave_only
      array [CCAM2N AM3N CM7N AACM6N AACR5W AL5E CR4W CCAL4E]

call "exchange the triangles" c3a
   setup bone6 bone6
      array [CCAM1N AACM0N AL5N AACR4N CCAL3N CR2N]
   setup pbone6 bone6
      array [CAL1S CCCAL0S 0 AAACR4S ACR3S 0]
   setup short6 short6
      array [CM5S 0 AM3S CR2S 0 AL0S]
   setup pshort6 short6
      array [CR5N CCAL4N AM3N CM2N AACR1N AL0N]

call "exchange the triangles 1/3" c3a
   setup bone6 bone6 qualifier dmd_ctrs_mwv
      array [   0    0 AL0W    0    0 CR1E]
   setup bone6 bone6
      array [CR5S AL2S AL0S ZM1N ZM0N CR1S]
   setup pbone6 bone6
      array [CR5E CR3S    0 AL1S AL5W    0]
   setup short6 short6
      array [CR1E    0 AL1W ZM0N    0 ZM2N]
   setup pshort6 short6 qualifier dmd_ctrs_mwv
      array [   0 CR2E    0    0 AL3W    0]
   setup pshort6 short6
      array [ZM3N CR2S AL1S CR4S AL3S ZM2N]

call "exchange the triangles 2/3" c3a
   setup bone6 bone6 qualifier dmd_ctrs_mwv
      array [     0      0 AL4E    0     0 CR3W]
   setup bone6 bone6
      array [CCAL3N AACR4N AM4S AL2S  CR5S CM3S]
   setup pbone6 bone6
      array [ CAL3N   CR2W    0 AL2E ACR1N    0]

   // If the triangles are consistent and fully occupied,
   // we can correctly handle the "collision" (right or left
   // hands according to the exchange order, of course).
   setup short6 deep2x1dmd qualifier live nice_wv_triangles
      array [CR3S    0 AL1S CR2E    0 AL2W]
   setup pshort6 deep2x1dmd qualifier live nice_wv_triangles
      array [   0 CM9E    0    0 AM0W    0]
   // Otherwise, we won't recognize "collisions", and hence may
   // not be able to do it.
   setup short6 short6
      array [CR2S    0 AL0S CR1E    0 AL1W]
   setup pshort6 short6 qualifier dmd_ctrs_mwv
      array [   0 CM5E    0    0 AM0W    0]
   setup pshort6 short6
      array [CR4S CM5S AL0N CR5N AM0S AL1S]

call "exchange the 3x1 triangles" c3a
   setup 3x4 3x4 qualifier occupied_as_h
      array [CCAM3N 0 0 AACM0N AACM10N AL11N AACR9N 0 0 CCAL6N CCAM4N CR5N]
   setup 3x4 3x4 qualifier occupied_as_qtag
      array [0 AM2N CM1N 0 AACR10N AM11N 0 AL8N CR7N 0 CCAL4N CM5N]
   setup qtag qtag
      array [AM1N CM0N AACR6N AM7N AL5N CR4N CCAL2N CM3N]

call "exchange the 3x1 triangles 3/4" c3a
   setup 3x4 3x4 qualifier occupied_as_h
      array [CCAM4N 0 0 AACM10N AACM9N AM9S AL5S 0 0 CR11S CCAM6N CM6S]
   setup 3x4 3x4 qualifier occupied_as_qtag
      array [0 AM11N CM5N 0 AM8S AL8N 0 AL10S CR4S 0 CM7S CR7N]
   setup qtag qtag
      array [AM7N CM3N AM5S AL5N AL6S CR2S CM4S CR4N]

call "convert the triangle" c4 tag trngle_convert
   setup trngl trngl qualifier miniwaves
      predscantdocallinsetup
         if trngl_pt_rh [0 CR3E AL3W 0 CR1E CR1E]
         if always      [0 CR3E AL3W 0 AL2W AL2W]
   setup ptrngl trngl qualifier miniwaves
      array [ZM4N 0 0 ZM2N 0 0]
   setup trngl 1x3 qualifier couples_only
      predscantdocallinsetup
         if trngl_pt_rh [0    0    0 0 CR1E CR0E]
         if always      [0    0    0 0 AL2W AL1W]
   setup ptrngl 1x3 qualifier couples_only
      array [ZM2N 0 0 ZM2N 0 0]
   setup ptrngl trngl rotate qualifier right tgl_tandbase
      array [0 ZM5W CR3N ZM1W 0 0]
   setup ptrngl trngl rotate qualifier left tgl_tandbase
      array [ZM2W 0 0 0 AL3S ZM4W]

call "unwrap the@M@I diamonds" c2
            fudge_to_q_tag take_right_hands
   setup qtag 2x4
      array [0 0 AM1W CR4W 0 0 CM2E AL7E]
   setup pqtag 2x4
      array [ZM3N CM5S 0 0 AM2S ZM4N 0 0]
   setup ptpd 2x4
      array [CM2E 0 AL7E 0 AM1W 0 CR4W 0]
   setup pptpd 2x4
      array [0 ZM3N 0 ZM4N 0 AM2S 0 CM5S]
            alternate_definition [interlocked] c2
   setup qtag 2x4
      array [0 0 AM1W AL7E 0 0 CM2E CR4W]
   setup pqtag 2x4
      array [ZM3N CM5S 0 0 AM2S ZM4N 0 0]
            alternate_definition [magic] c3
   setup qtag 2x4
      array [0 0 AL7E CM2E 0 0 CR4W AM1W]
   setup pqtag 2x4
      array [ZM3N CM5S 0 0 AM2S ZM4N 0 0]

call "wrap to a@I diamond" c3a
   setup 4x2 qtag
      array [ZM1N CR2E CR4S CR3W AL3E AL1S AL2W ZM4N]
            alternate_definition [interlocked] c3a
   setup 4x2 qtag
      array [ZM1N CR2E CR4S CR7W AL7E AL1S AL2W ZM4N]

call "unwrap the hourglass" c2
            take_right_hands
   setup hrglass 2x4
      array [0 0 AM1W 0 0 0 CM2E 0]
   setup phrglass 2x4
      array [ZM3N CM5S 0 CR4S AM2S ZM4N 0 AL3S]

call "wrap to an hourglass" c3a
   setup 4x2 hrglass
      array [ZM1N CR2E CR4S CM7S AM3S AL1S AL2W ZM4N]

call "unwrap the galaxy" c2
            take_right_hands
   setup galaxy 4x4
      predscantdocallinsetup
         if next_galaxyspot_is_tboned [ZM3E  ZM3S 0 ZM15S ZM15W ZM14N 0 ZM13N]
         if always                    [CR14S ZM3S 0 ZM15S AL13S ZM14N 0 ZM13N]

call "unwrap the wave-based triangles" c2
   setup galaxy hyperglass
      predscantdocallinsetup
         if next_galaxyspot_is_tboned [CM4E CR5S 0 AL2S AM4W ZM5N 0 ZM2N]
         if always                    [ZM0N CR5S 0 AL2S ZM6N ZM5N 0 ZM2N]

call "unwrap the triangles" c2
   setup short6 2x3 rotate
      array [CR0E 0 AL5E ZM0W 0 ZM5W]
   setup pshort6 2x3 rotate
      array [0 CM1N 0 0 AM1S 0]

call "unwrap the stars" c2
   setup c1phan c1phan qualifier occupied_as_stars
      array [CM3S  0 AL0E 0 0 AM6S  0 CR5W AM15W 0 ZM4N 0 0 CM10E 0 ZM1N]
   setup 2stars 2x4
      array [0 0 AM1W CR4W 0 0 CM2E AL7E]
   setup p2stars 2x4
      array [ZM3N CM5S 0 0 AM2S ZM4N 0 0]

// Same as above, with more info.
call "unwrap the stars to a normal column, follow the @6" c2
   setup c1phan c1phan qualifier occupied_as_stars restriction forbidden nice_diamonds
      predsnoselect
         if select   [   0 0    0 0 0     0 0    0     0 0 ZM4N 0 0     0 0 ZM1N]
         if unselect [CM3S 0 AL0E 0 0  AM6S 0 CR5W AM15W 0    0 0 0 CM10E 0    0]

call "unwrap the boxes to a normal column, follow the @6" c3a
   setup 4x4 2x4 rotate restriction forbidden wave_only
      predsnoselect
         if select   [   0    0 0 0 0    0    0 ZM0W 0 0    0 ZM7W    0 0 0 0]
         if unselect [AM1E AL0E 0 0 0 ZM1W ZM6W    0 0 0 CR7E    0 CM6E 0 0 0]

call "unwrap the diamonds to a normal column, follow the @6" c3a
   setup 4x6 2x4 rotate qualifier normal_unwrap_sel
      array [0 0 0 0 0 0 AM1E 0 0 0 0 CM6E 0 0 0 0 0 0 0 0 ZM7W ZM0W 0 0]
   setup 6x4 2x4 rotate qualifier normal_unwrap_sel
      array [0 CM5N 0 0 0 0 0 AL0N 0 0 0 0 0 0 0 0 AM6S 0 0 0 0 0 CR3S 0]

   setup 2x2dmd 2x4 rotate qualifier normal_unwrap_sel
      array [CM6E 0 0 0     AM1E 0 0 0      0 0 ZM0W 0     0 0 ZM7W 0]
   setup p2x2dmd 2x4 rotate qualifier normal_unwrap_sel
      array [0 CM5N 0 0     0 AL0N 0 0      0 0 0 CR3S     0 0 0 AM6S]

   setup 4x6 2x4 qualifier ptp_unwrap_sel
      array [0 0 0 0 0 0 0 0 CR3W AL0E 0 0 0 0 0 0 0 0 CM5E 0 0 0 0 AM6W]
   setup 6x4 2x4 qualifier ptp_unwrap_sel
      array [0 0 0 0 CM2S 0 0 0 0 0 ZM3N 0 0 AM5S 0 0 0 0 0 ZM4N 0 0 0 0]

   setup 2x2dmd 2x4 qualifier ptp_unwrap_sel
      array [0 0 AL0E 0   0 0 CR3W 0    AM6W 0 0 0     CM5E 0 0 0]
   setup p2x2dmd 2x4 qualifier ptp_unwrap_sel
      array [0 0 0 ZM3N    0 0 0 CM2S      0 AM5S 0 0     0 ZM4N 0 0]

call "wrap to a galaxy" c3a
   setup 4x2 galaxy
      array [ZM3N CR4E CR5S CM6S AM2S AL3S AL4W ZM5N]

call "snap the diamond" c4
            fudge_to_q_tag
   setup qtag 2x4 rotate
      array [0 0 1N 2S 0 0 5S 6N]
   setup pqtag 2x4 rotate
      array [3W 4E 0 0 7E 0W 0 0]

call "dodge @2circulate@3" c2
   conc_ctrbox walkndodge [] circulate [or_anycall]

call "dodge @0" c2
            mxn_is_inherited
   conc_ctrbox walkndodge [] nullcall [mandatory_anycall]

call "_circ xocirc from cols" dontshow tag circ_xocirc
   setup 2x2 2x2 restriction unusual alwaysfail
      array [CM0S AM1S CM0N CM1N]

call "change lanes" c3
            fractal_is_inherited gen_sting_is_inherited
   crossconc circ_n_times [conc_demand_lines insert_number 2]
             any_hand_remake_start_with_n [inherit_fractal inherit_gensting conc_force_lines suppress_roll insert_number 1]
            fractal_is_inherited gen_sting_is_inherited
   crossconc circ_xocirc [conc_demand_columns]
             any_hand_remake_start_with_n [inherit_fractal inherit_gensting conc_force_lines suppress_roll insert_number 1]

call "like a rigger" c3x
   setup 2x6 rigger
      array [ZM6N ZM7N ZM0N ZM1N ZM3N ZM2N ZM2N ZM3N ZM4N ZM5N ZM7N ZM6N]
   setup 6x2 rigger
      array [ZM6N ZM7N ZM0N ZM1N ZM3N ZM2N ZM2N ZM3N ZM4N ZM5N ZM7N ZM6N]
   setup 3x4 qtag
      array [ZM0N ZM1N ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM4N ZM5N ZM6N ZM7N]
   setup 4x3 qtag
      array [ZM0N ZM1N ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM4N ZM5N ZM6N ZM7N]

call "retain your lane" c4
   conc any_hand_remake_start_with_n [insert_number 1]
        circ_n_times [conc_demand_lines conc_force_lines insert_number 2]

call "collapse the setup" c4a
            fudge_to_q_tag cross_is_inherited intlk_is_inherited
   conc stepnfold [inherit_cross inherit_intlk] endsdetour [conc_demand_lines conc_force_columns endscando]

// Another name.  That's right, we don't check that they are actual diamonds.
// Callers frequently abuse the terminology in this way (as in "dixie style to a wave"
// that doesn't go to a wave), so we will let them abuse this terminology too.
call "collapse the diamonds" c4a
            fudge_to_q_tag cross_is_inherited intlk_is_inherited
   conc stepnfold [inherit_cross inherit_intlk] endsdetour [conc_demand_lines conc_force_columns endscando]

call "strike out" c4a
            fractal_is_inherited gen_sting_is_inherited visible_fractions fudge_to_q_tag
   conc crossnwheel [inherit_fractal inherit_gensting force_single]
        endsdetour [inherit_fractal inherit_gensting conc_demand_lines conc_force_columns endscando]

call "_ends strip" dontshow tag endsstrip
   setup 2x2 1x4 restriction forbidden peelable_box
      array [AL1N CR3N CR2S AL0S]
            alternate_definition [stingy] c3
   setup 2x2 2x2 restriction forbidden peelable_box
      array [AL3E CR2W CR1E AL0W]
            alternate_definition [generous] c3
   setup 2x2 2x2 restriction forbidden peelable_box
      array [AL0W CR1E CR2W AL3E]
            alternate_definition [yoyo] c4
   setup 2x2 2x2 restriction forbidden peelable_box
      array [AL0W CR1E CR2W AL3E]

call "_ends strip but the @6 criss cross it" dontshow tag endsxxstrip
   setup 2x2 1x4 restriction forbidden peelable_box
      predsnoselect
      if select [AACR0N CCAL2N AL3S CR1S]
            alternate_definition [stingy] c3
   setup 2x2 2x2 restriction forbidden peelable_box
      predsnoselect
      if select [AACR3W CCAL2E AL1W CR0E]
            alternate_definition [generous] c3
   setup 2x2 2x2 restriction forbidden peelable_box
      predsnoselect
      if select [AACR0E CCAL1W AL2E CR3W]
            alternate_definition [yoyo] c4
   setup 2x2 2x2 restriction forbidden peelable_box
      predsnoselect
      if select [AACR0E CCAL1W AL2E CR3W]

call "strip the setup" c3a
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   reverse_checkpoint fanthetop [inherit_fractal inherit_gensting]
                      endsstrip [conc_demand_lines inherit_yoyo inherit_gensting endscando]

call "strip the diamonds" c3a
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   reverse_checkpoint linefanthetop [inherit_fractal inherit_gensting]
                      endsstrip [conc_demand_lines inherit_yoyo inherit_gensting endscando]

call "strip the hourglass" c3a
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   reverse_checkpoint dmdfanthetop [inherit_fractal inherit_gensting]
                      endsstrip [conc_demand_lines inherit_yoyo inherit_gensting endscando]

call "strip the diamonds but the @6 criss cross it" c3a
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   // Should actually check that no one is selected for the fan the top, too lazy.
   reverse_checkpoint linefanthetop [inherit_fractal inherit_gensting]
                      endsxxstrip [conc_demand_lines inherit_yoyo inherit_gensting endscando]

call "in style" c4a
            step_to_wave
   setup qtag 2x4
      array [ZM2N ZM3N 0 CR5S ZM6N ZM7N ZM0N 0]
   /* List this so don't need to use "gruesome". */
   setup 4x2 2x4 rotate
      array [ZM7W ZM0W 0 ZM2W ZM3W 0 CR5E ZM6W]

call "_outer 6 circle 1/4" dontshow tag outer6andcircle
   setup pshort6 short6 qualifier ctr_pts_rh
      array [ZM1N CR2S CR3S CR4S 0    ZM0N]
   setup pshort6 short6 qualifier ctr_pts_lh
      array [ZM5N 0    AL1S AL2S AL3S ZM4N]
   // The Callerlab definition actually prohibits doing this
   // from facing diamonds.  The points would have to go backwards.
   setup short6 short6 qualifier ctr_pts_rh
      array [CR1E 0 0 0 0 CR0E]
   setup short6 short6 qualifier ctr_pts_lh
      array [0 0 AL1W AL2W 0 0]
   // "Ctr_pts_r/lh" has a special meaning for stars.  It requires
   // that people not be T-boned, and selects the lateral people.
   setup star star qualifier ntbone ctr_pts_rh
      array [CR1S 0 0 ZM0N]
   setup star star qualifier ntbone ctr_pts_lh
      array [0 0 AL1S ZM2N]
            alternate_definition [magic] c3
   setup pshort6 short6 qualifier ctr_pts_rh
      array [ZM5N CR3S    0 AL2S 0    ZM1N]
   setup pshort6 short6 qualifier ctr_pts_lh
      array [ZM4N 0    CR3S 0    AL2S ZM0N]

call "and circle 1/4" c2 tag andcircle
            fudge_to_q_tag magic_is_inherited
   conc2_6_or_2_4 nullcall [] outer6andcircle [inherit_magic]

call "slip while circle 1/4" dontshow tag slipwhilecircle
            fudge_to_q_tag magic_is_inherited
   conc2_6_or_2_4 trade [] outer6andcircle [inherit_magic]

call "centers swing" dontshow tag ctrsswing
            yoyo_is_inherited gen_sting_is_inherited
   conc6p_or_normal swing [or_anycall inherit_yoyo inherit_gensting] nullcall []

call "center 4 cast off @b" dontshow tag ctrscastoff_n
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited neednumber yoyo_fractal_numbers
   select_center4 cast_off_n4_with_warn [inherit_yoyo inherit_fractal inherit_gensting allow_forced_mod] nullcall []

call "center 2 cast off @b" dontshow tag ctr2castoff_n
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited neednumber yoyo_fractal_numbers
   select_center2 cast_off_n4_with_warn [inherit_yoyo inherit_fractal inherit_gensting allow_forced_mod] nullcall []

call "centers @0" dontshow tag ctrsanything
   conc6p_or_normal nullcall [mandatory_anycall] nullcall []

// For this call and the next, we make the special case of 1/4 user-visible,
// so that it will have the "obvious" 2 parts.  For fractions higher than 1/4,
// there is a 2-level hierarchy of parts.
call "swing and circle 1/4" c1 tag swing_and_circle
            visible_fractions fudge_to_q_tag step_to_qtag left_means_touch_or_check
            yoyo_is_inherited gen_sting_is_inherited magic_is_inherited
   seq ctrsswing [inherit_yoyo inherit_gensting]
   seq slipwhilecircle [inherit_magic]

// We make this able to act on either a 4-person call for the
// centers, or an 8-person call.  4-person calls get priority.
call "@0 and circle 1/4" c2 tag anything_and_circle
            fudge_to_q_tag
   seq ctrsanything []
   seq andcircle []
            fudge_to_q_tag
   seq nullcall [mandatory_anycall]
   seq andcircle []

call "swing and circle @a" c1    // If modified, center 4 do the modification.
            neednumber visible_fractions distribute_repetitions yield_if_ambiguous
            step_to_qtag left_means_touch_or_check
            yoyo_is_inherited gen_sting_is_inherited magic_is_inherited
   seq swing_and_circle [repeat_n inherit_yoyo inherit_gensting inherit_magic]

call "swing and circle @9/16" c1
            neednumber visible_fractions distribute_repetitions yield_if_ambiguous
            step_to_qtag left_means_touch_or_check
            yoyo_is_inherited gen_sting_is_inherited magic_is_inherited
   seq swing_and_circle [repeat_nover4 inherit_yoyo inherit_gensting inherit_magic]

call "swing and circle @9/8" c1
            neednumber visible_fractions distribute_repetitions yield_if_ambiguous
            step_to_qtag left_means_touch_or_check
            yoyo_is_inherited gen_sting_is_inherited magic_is_inherited
   seq swing_and_circle [repeat_nover2 inherit_yoyo inherit_gensting inherit_magic]

call "@0 and circle @a" c2
            neednumber visible_fractions distribute_repetitions yield_if_ambiguous
   seq anything_and_circle [repeat_n]

call "gravitate" c4a tag gravitate
            fudge_to_q_tag reverse_means_mirror take_right_hands
   setup qtag 2x4 qualifier miniwaves
      array [C4W C5W A0W C6W AC0E AC1E C3E A5E]
   setup qtag 2x4 qualifier couples_only
      array [C4W C5W A7W C6W AC0E AC1E C3E AC2E]
   setup bone c1phan qualifier miniwaves
      array [   0    0 A0W  C15W    0    0 C5E A10E]
   setup bone c1phan qualifier couples_only
      array [   0    0 A13W C15W    0    0 C5E AC7E]
   setup pbone c1phan
      array [AC6E C12W    0    0 C14W AC4E   0    0]
            alternate_definition [reflect] c4
   setup qtag c1phan qualifier miniwaves
      array [C8W C10W A12S C3N AC0E AC2E C9S A6N]
   setup qtag c1phan qualifier couples_only
      array [C8W C10W AC1N C3N AC0E AC2E C9S AC11S]
   setup bone 2x4 rotate qualifier miniwaves
      array [   0   0  A4E C6W   0    0 C3E  A1W]
   setup bone 2x4 rotate qualifier couples_only
      array [   0   0 AC7W C6W   0    0 C3E AC2E]
   setup pbone 2x4 rotate
      array [AC1N C4S    0   0 C5S AC0N   0    0]

call "ends go as you are, gravitate" c4a
            fudge_to_q_tag reverse_means_mirror take_right_hands
   setup qtag 2x4 qualifier miniwaves
      array [0 0 A0W C6W 0 0 C3E A5E]
   setup qtag 2x4 qualifier couples_only
      array [0 0 A7W C6W 0 0 C3E AC2E]
   setup pqtag 2x4
      array [C4S C5S 0 0 A2S A3S 0 0]
   setup bone c1phan qualifier miniwaves
      array [C6S C3S A0W C15W C1S C4S C5E A10E]
   setup bone c1phan qualifier couples_only
      array [C6S C3S A13W C15W C1S C4S C5E AC7E]

call "_ends begin peel/trail chain thru" dontshow tag epeelchainthru
            left_means_mirror yoyo_is_inherited gen_sting_is_inherited cross_is_inherited
   seq real_leads_div_move_along [inherit_cross]
   seq touch [inherit_left]
   seq trade [inherit_yoyo inherit_gensting]

call "_peel/trail chain thru part 1" dontshow tag peelchain1
            fudge_to_q_tag left_means_mirror yoyo_is_inherited gen_sting_is_inherited cross_is_inherited
   conc waveswingslip [inherit_left inherit_yoyo inherit_gensting]
        epeelchainthru [inherit_left inherit_yoyo inherit_gensting inherit_cross conc_demand_columns]

call "peel chain thru" c3a
            left_means_mirror last_part_visible yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq peelchain1 [inherit_left inherit_yoyo inherit_gensting]
   seq pushyfanthetop [allow_forced_mod inherit_fractal]

call "trail chain thru" c4a
            left_means_mirror last_part_visible yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq peelchain1 [inherit_left inherit_yoyo inherit_gensting force_cross]
   seq pushyfanthetop [allow_forced_mod inherit_fractal]

call "create a diamond" c4a
            left_means_mirror
   setup 2x4 qtag restriction 2fl_only
      array [C0E C1E A0W A1W ZM3N ZM6N ZM3N ZM6N]
            alternate_definition [single] c4
   setup 2x2 dmd rotate restriction wave_only
      array [CR0N AL0S ZM3W ZM3W]
            alternate_definition [3x3] c4
   setup 2x6 3dmd restriction 3x3_2fl_only
      array [C0E C1E C2E A0W A1W A2W ZM4N ZM11N ZM9N ZM4N ZM11N ZM9N]
            alternate_definition [4x4] c4
   setup 2x8 4dmd restriction 4x4_2fl_only
      array [C0E C1E C2E C3E A0W A1W A2W A3W ZM5N ZM7N ZM14N ZM12N ZM5N ZM7N ZM14N ZM12N]
            alternate_definition [rewind] c4
   setup qtag 2x4 qualifier left nice_diamonds
      array [0 0 ZM3N 0 0 0 0 ZM2N]
   setup qtag 2x4 qualifier right dmd_facing
      array [0 0 ZM1N 0 0 0 0 ZM0N]
   setup pqtag 2x4
      array [CR2E CR3E 0 0 AL4W AL5W 0 0]

call "triple trade" a1 tag tripletrade
            yoyo_is_inherited gen_sting_is_inherited
   select_center6 trade [inherit_yoyo inherit_gensting] nullcall []
            yoyo_is_inherited gen_sting_is_inherited
   setup 5x4 4x5
      predscantdocallinsetup
         if person_real_sum9  [ZM0N CR8S ZM2N CR6S ZM4N ZM5N AL3S ZM7N AL1S ZM9N
                               ZM10N AL18S ZM12N AL16S ZM14N ZM15N CR13S ZM17N CR11S ZM19N]
         if person_real_sum24 [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N CR17S ZM8N ZM9N
                               ZM10N ZM11N ZM12N ZM13N ZM14N ZM15N ZM16N AL7S ZM18N ZM19N]
         if always            [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N
                               ZM10N ZM11N ZM12N ZM13N ZM14N ZM15N ZM16N ZM17N ZM18N ZM19N]
   setup 3x1dmd 3x1dmd   // This is here only to do the last half.  Otherwise previous def'n should have handled it.
      array [0 0 0 0 0 0 0 0]
            alternate_definition [lasthalf] c3
   setup 3x1dmd qtag rotate
      array [CR5N AL5S CR7N ZM3W AL0S CR0N AL7S ZM7W]
   setup p3x1dmd qtag rotate
      array [   0    0    0 ZM6W    0    0    0 ZM2W]

call "triple trade for coordinate" dontshow tag tripletrade_for_coord
//            yoyo_is_inherited gen_sting_is_inherited
   // The center 2 can't roll, so they won't be able to roll at the end.
   // The invocation of the last part is marked "roll_transparent".
   setup pspindle spindle
      array [CR6S CM5S CR4S ZM3N AL2S AM1S AL0S ZM7N]
   setup spindle spindle
      array [0 0 0 ZM3N 0 0 0 ZM7N]
   setup ptpd ptpd
      array [ZM0N 0 CM6S 0 ZM4N 0 AM2S 0]
   setup pptpd ptpd
      array [ZM0N CR3S 0 AL1S ZM4N AL7S 0 CR5S]
   setup 1x8 1x8
      array [ZM0N CR3S CM6S AL1S ZM4N AL7S AM2S CR5S]
   setup 1x3dmd 1x3dmd
      array [ZM0N CR2S AL1S 0 ZM4N AL6S CR5S 0]
   setup p1x3dmd 1x3dmd
      array [ 0 0 0 CM7S 0 0 0 AM3S]
   setup wingedstar wingedstar restriction controversial alwaysfail
      array [ZM0N CR2S AL1S 0 ZM4N AL6S CR5S 0]
   setup pwingedstar wingedstar
      array [ 0 0 0 CM7S 0 0 0 AM3S]
            alternate_definition [yoyo] c4
   setup 1x8 spindle
      array [ZM7N CR6W CM5W AL6E ZM3N AL4E AM5E CR4W]
   setup ptpd 1x3dmd
      array [ZM0N 0 CM7W 0 ZM4N 0 AM7E 0]
   setup pptpd 1x3dmd
      array [ZM0N CR1W 0 AL1E ZM4N AL6E 0 CR6W]

call "turn four" c4a
   setup 1x8 1x8 rotate restriction 2fl_only
      array [CR0N CR1N CR2N CR3N AL0S AL1S AL2S AL3S]

call "diamond circulate" plus tag diamondcirc
            take_right_hands fudge_to_q_tag 12_16_matrix_means_split
   simple_funny
   setup dmd dmd restriction forbidden diamond_like
      array [CR1E 0 AL1W 0]
   setup pmd dmd restriction forbidden diamond_like
      array [0 CR2E 0 AL2W]
   setup star star
      array [CR1E 0 AL1W 0]
            alternate_definition [grand] c3
   setup spindle spindle
      array [0 0 0 AL2W 0 0 0 CR0E]
   setup pspindle spindle
      array [ZM1N ZM2N CR3E 0 AL3W ZM4N ZM5N 0]
   setup short6 short6
      array [CR1E 0 AL1W ZM2N 0 ZM0N]
   setup pshort6 short6
      array [0 CR2E 0 0 AL3W 0]
            alternate_definition [half] c1
   setup dmd thar plus_eighth_rotation qualifier live dmd_facing
      array [CR0N 0 AL3W 0]
   setup pmd thar plus_eighth_rotation qualifier live dmd_facing
      array [0 CR2N 0 AL5W]

call "diamond single rotate 1/4" c4
            fudge_to_q_tag reverse_means_mirror
   setup dmd dmd
      array [0 AL0S 0 CAL2N]
   setup pmd dmd
      array [CAL3N 0 AL1S 0]

call "star circulate" c1
   setup star star
      array [CR1E 0 AL1W 0]

call "triangle circulate" c1 tag trngle_circ
            split_large_setups
   simple_funny
   setup trngl trngl
      array [0 CR2S AL1S 0 AL3W CR3E]
   setup ptrngl trngl
      predscantdocallinsetup
         if nexttrnglspot_is_tboned [AL2W ZM2N CR0S CR4E AL3S ZM4N]
         if always                  [AL2S ZM2N CR0S CR4S AL3S ZM4N]
            alternate_definition [interlocked] c2
   simple_funny
   setup short6 short6
      array [CR2S 0 AL0S AL1W 0 CR1E]
   setup pshort6 short6
      predscantdocallinsetup
         if nextinttrnglspot_is_tboned [ZM2N CR3E CR4S AL1S AL2W ZM3N]
         if always                     [ZM2N CR3S CR4S AL1S AL2S ZM3N]
   setup bone6 bone6
      predscantdocallinsetup
         if nextinttrnglspot_is_tboned [CR2S AL5S AL0W ZM1N ZM0N CR1E]
         if always                     [CR2S AL5S AL0S ZM1N ZM0N CR1S]
   setup pbone6 bone6
      array [CR2E CR3S 0 AL1S AL2W 0]
            alternate_definition [3x1] c2
   simple_funny
   setup 3x2 2x3 qualifier occupied_as_3x1tgl
      predscantdocallinsetup
         if zero_cw_people [   0 CR3S CR4S    0 AL2S ZM4N]
         if one_cw_person  [   0 ZM2N    0    0 ZM3N    0]
         if always         [ZM1N    0    0 AL1S    0    0]
            alternate_definition [interlocked 3x1] c2
   simple_funny
   setup 3x4 3x4 qualifier occupied_as_h
      array [CR5S 0 0 AL11S ZM3N AL0S ZM4N 0 0 ZM10N ZM0N CR3S]
   setup 3x4 3x4 qualifier occupied_as_qtag
      array [0 CR4S AL10S 0 AL1S ZM2N 0 ZM5N ZM11N 0 CR2S ZM1N]
   setup qtag qtag
      array [CR2S AL6S AL0S ZM1N ZM3N ZM7N CR1S ZM0N]

call "cut the 3x1 triangle" c4a
            split_large_setups
   setup bone6 bone6
      array [0 0 0 0 0 0]   // This should suffice to make it illegal.
            alternate_definition [reverse] c2
   setup 3x2 1x4 rotate qualifier occupied_as_3x1tgl
      predscantdocallinsetup
         if zero_cw_people [   0 CM2E CR3E    0 AM0E ZM3W]
         if one_cw_person  [   0 CM2E    0    0 AM0E    0]
         if always         [ZM1W    0    0 AL1E    0    0]

call "flip the 3x1 triangle" c4a
            split_large_setups
   setup bone6 bone6
      array [0 0 0 0 0 0]   /* This should suffice to make it illegal. */
            alternate_definition [reverse] c2
   setup 3x2 1x4 rotate qualifier occupied_as_3x1tgl
      predscantdocallinsetup
         if zero_cw_people [   0 AL0E CR3E    0 CR2E ZM3W]
         if one_cw_person  [   0 AL0E    0    0 CR2E    0]
         if always         [ZM1W    0    0 AL1E    0    0]

call "flip the Z" c4
            split_large_setups
   setup 3x2 1x4 array [0 0 0 0 0 0]
            alternate_definition [reverse] c4
   setup 3x2 1x4 rotate qualifier true_Z_cw
      array [   0 AL0E CR3E    0 CR2E ZM3W]
   setup 2x3 1x4 rotate qualifier true_Z_cw
      array [   0    0 AL1E    0    0 ZM1W]
   setup 3x2 1x4 rotate qualifier true_Z_ccw
      array [ZM1W AL0E 0    AL1E CR2E 0]
   setup 2x3 1x4 rotate qualifier true_Z_ccw
      array [CR1E    0 0    ZM1W    0 0]

call "cut the Z" c4
            split_large_setups
   setup 3x2 1x4 array [0 0 0 0 0 0]
            alternate_definition [reverse] c4
   setup 3x2 1x4 rotate qualifier true_Z_cw
      array [   0 CR2E CR3E    0 AL0E ZM3W]
   setup 2x3 1x4 rotate qualifier true_Z_cw
      array [   0    0 AL1E    0    0 ZM1W]
   setup 3x2 1x4 rotate qualifier true_Z_ccw
      array [ZM1W CR2E 0    AL1E AL0E 0]
   setup 2x3 1x4 rotate qualifier true_Z_ccw
      array [CR1E    0 0    ZM1W    0 0]
   // If just the center 1x2, don't know offset, but don't need it.
   setup 3x2 1x4 rotate
      array [   0 CR2E 0       0 AL0E 0]
   setup qtag 1x4
      array [0 0 0 AL0S ZM3N ZM1N 0 CR2S]

call "flip the trapezoid" c4
   setup 2x4 2x4 qualifier occupied_as_traps
      array [CR1S CR2S AL1S AL2S AL5S ZM3N ZM0N CR6S]
            alternate_definition [reverse] c4
   setup 2x4 2x4 qualifier occupied_as_traps
      array [CR3S AL0S CR3S AL0S ZM2N CR4S AL7S ZM1N]

call "cut the trapezoid" c4
   setup 2x4 2x4 qualifier occupied_as_traps
      array [CR2S CR2S AL1S AL1S AL6S ZM3N ZM0N CR5S]
            alternate_definition [reverse] c4
   setup 2x4 2x4 qualifier occupied_as_traps
      array [CR3S CM3S AM0S AL0S ZM2N AM7S CM4S ZM1N]

call "reshape the triangle" c2 tag trngle_reshape
   simple_funny
   setup trngl trngl
      array [0 CR2E AL1W 0 AL3W CR3E]
   setup ptrngl trngl
      predscantdocallinsetup
         if nexttrnglspot_is_tboned [AL2S CR2E CR0S CR4S AL3S AL4W]
         if always                  [AL2W CR2E CR0S CR4E AL3S AL4W]

call "arm turn @b" dontshow tag armturn_n4
            neednumber 12_16_matrix_means_split parallel_conc_end
            fractal_is_inherited gen_sting_is_inherited yoyo_is_inherited yoyo_fractal_numbers
   setup 1x2 1x2        restriction forbidden wave_only qualifier num 0 none
      array [ZM0N ZM1N]
   setup 1x2 1x2 rotate restriction forbidden wave_only qualifier num 1 none
      array [CR0N AL0S]
   setup 1x2 1x2        restriction forbidden wave_only qualifier num 2 none
      array [CR1S AL0S]
   setup 1x2 1x2 rotate restriction forbidden wave_only qualifier num 3 none
      array [CR1S AL1N]
   setup 1x2 1x2        restriction forbidden wave_only qualifier num 4 none
      array [CR0N AL1N]
            alternate_definition [half] mainstream
   setup 1x2 1x2        restriction forbidden wave_only qualifier num 0 none
      array [ZM0N ZM1N]
   setup 1x2 1x2        plus_eighth_rotation qualifier right live num 1 wave_only
      array [CR0N 0]
   setup 1x2 1x2 rotate plus_eighth_rotation qualifier  left live num 1 wave_only
      array [0 AL0S]
   setup 1x2 1x2 rotate restriction forbidden wave_only qualifier num 2 none
      array [CR0N AL0S]
   setup 1x2 1x2 rotate plus_eighth_rotation qualifier right live num 3 wave_only
      array [CR0N 0]
   setup 1x2 1x2        plus_eighth_rotation qualifier  left live num 3 wave_only
      array [0 AL0S]
   setup 1x2 1x2        restriction forbidden wave_only qualifier num 4 none
      array [CR1S AL0S]
   setup 1x2 1x2        plus_eighth_rotation qualifier right live num 5 wave_only
      array [CR1S 0]
   setup 1x2 1x2 rotate plus_eighth_rotation qualifier  left live num 5 wave_only
      array [0 AL1N]
            alternate_definition [lasthalf] mainstream
   setup 1x2 1x2        restriction forbidden wave_only qualifier num 0 none
      array [ZM0N ZM1N]
   setup 1x2 1x2 rotate restriction forbidden wave_only qualifier num 2 none
      array [CR0N AL0S]
   setup 1x2 1x2        restriction forbidden wave_only qualifier num 4 none
      array [CR1S AL0S]

call "arm turn @b, yoyo is optional" dontshow tag armturn_n4_yoyo_optional
            12_16_matrix_means_split neednumber parallel_conc_end
   setup 1x2 1x2 rotate restriction forbidden wave_only qualifier num 1 none
      array [CR0N AL0S]
   setup 1x2 1x2        restriction forbidden wave_only qualifier num 2 none
      array [CR1S AL0S]
   setup 1x2 1x2 rotate restriction forbidden wave_only qualifier num 3 none
      array [CR1S AL1N]
   setup 1x2 1x2        restriction forbidden wave_only qualifier num 4 none
      array [CR0N AL1N]
            alternate_definition [yoyo] c4
   setup 1x2 1x2 rotate restriction forbidden wave_only qualifier num 1 none
      array [CR0N AL0S]
   setup 1x2 1x2 rotate restriction forbidden wave_only qualifier num 2 none
      array [CR1S AL1N]
   setup 1x2 1x2 rotate restriction forbidden wave_only qualifier num 3 none
      array [CR1S AL1N]
   setup 1x2 1x2        restriction forbidden wave_only qualifier num 4 none
      array [CR0N AL1N]

call "_centers arm turn @b / ends turn back" dontshow tag ctrarmturn_n4_utb
            neednumber yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   singleconc armturn_n4 [inherit_yoyo inherit_fractal inherit_gensting] uturnback []

call "_centers arm turn @b / ends turn away" dontshow tag ctrarmturn_n4_utaway
            neednumber yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   singleconc armturn_n4 [inherit_yoyo inherit_fractal inherit_gensting] uturnaway []

call "_centers do @m / ends turn away" dontshow tag ctr_but_utaway
   singleconc_together nullsecond [mandatory_secondary_call] uturnaway []

call "_centers arm turn @b while ends roll @b times" dontshow tag ctrarmturn_n_ends_roll_n
            need_two_numbers yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   singleconc armturn_n4 [inherit_yoyo inherit_fractal inherit_gensting] roll_n [shift_one_number]

call "cast off 1/4" dontshow tag cast_off_14
            parallel_conc_end
   setup 1x2 1x2 rotate
      preds "Need to be in miniwave or line of 4."
         if cast_normal  [CR0N AL0S]
   setup 1x4 2x2
      predscantdo
         if cast_normal  [CR0E AL0W AL1W CR1E]
         if cast_pushy   [AL3W AL0W CR2E CR1E]
         if always       [0    AL0W 0    CR1E]
   setup 1x6 2x3
      predscantdo
         if cast_normal  [CR0E AL0W CR1E AL2W CR2E AL1W]
         if cast_pushy   [AL5W AL0W 0    CR3E CR2E 0]
         if always       [0    AL0W 0    0    CR2E 0]
            alternate_definition [single] c4
   setup 1x2 1x2
      array [AL0W CR1E]
            alternate_definition [3x3] c4
   setup 1x6 2x3 rotate qualifier 3x3couples_only
      array [AL3S AL4S AL5S CR2N CR1N CR0N]
   setup 3x4 2x6 rotate qualifier couples_only
      array [AL10S AL11S CR0N CR1N CR3N CR2N CR5N CR4N AL7S AL6S AL8S AL9S]
            alternate_definition [4x4] c4
   setup 1x8 2x4 rotate qualifier 4x4couples_only
      array [AL4S AL5S AL7S AL6S CR3N CR2N CR0N CR1N]

// Used for "relay the shadow".  This is the "slap someone and run away" near the end of the call.
// It is a hinge.  The Callerlab definition says "single hinge", but we know better.
// Roll info must be "M", since these people will implicitly spread as part of a crossconc.
call "hinge @b times, opt for normal" dontshow tag hinge_for_relay_shad
            neednumber fractal_is_inherited yoyo_is_inherited gen_sting_is_inherited yoyo_fractal_numbers
            fractional_numbers diamond_is_legal parallel_conc_end
   setup 1x4 2x2 qualifier num 1 none
      predscantdo
         if cast_normal_or_warn [CM0E AM0W AM1W CM1E]
         if always              [CM0E AM3W AM2W CM1E]
   // Use this if "fractal" given.  Must be miniwave.
   setup 1x4 2x2 qualifier num 3 none restriction forbidden wave_only
      array [CM3W AM3E  AM2E  CM2W]

call "cast off @b, opt for normal" dontshow tag cast_off_n4_with_warn
            neednumber yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited yoyo_fractal_numbers
            fractional_numbers diamond_is_legal parallel_conc_end
   setup 1x2 1x2 qualifier num 0 none
      preds "Need to be in miniwave or line of 4."
         if cast_normal_or_warn [ZM0N ZM1N]
   setup 1x2 1x2 rotate qualifier num 1 none
      preds "Need to be in miniwave or line of 4."
         if cast_normal_or_warn [CR0N AL0S]
   setup 1x2 1x2 qualifier num 2 none
      preds "Need to be in miniwave or line of 4."
         if cast_normal_or_warn [CR1S AL0S]
   setup 1x2 1x2 rotate qualifier num 3 none
      preds "Need to be in miniwave or line of 4."
         if cast_normal_or_warn [CR1S AL1N]
   setup 1x2 1x2 qualifier num 4 none
      preds "Need to be in miniwave or line of 4."
         if cast_normal_or_warn [CR0N AL1N]
   setup 1x4 1x4 qualifier num 0 not_miniwaves  // Need qualifier for crazy any hand remake.
      predscantdo
         if cast_normal_or_warn [ZM0N ZM1N ZM2N ZM3N]
         if always              [ZM0N ZM1N ZM2N ZM3N]
   setup 1x4 2x2 qualifier num 1 not_miniwaves
      predscantdo
         if cast_normal_or_warn [CR0E AL0W AL1W CR1E]
         if always              [AL3W AL0W CR2E CR1E]
   setup 1x4 1x4 qualifier num 2 not_miniwaves
      predscantdo
         if cast_normal_or_warn [CR1S AL0S AL3S CR2S]
         if always              [AL1S AL0S CR3S CR2S]
   setup 1x4 2x2 qualifier num 3 not_miniwaves
      predscantdo
         if cast_normal_or_warn [CR3W AL3E AL2E CR2W]
         if always              [AL0E AL3E CR1W CR2W]
   setup 1x4 1x4 qualifier num 4 not_miniwaves
      predscantdo
         if cast_normal_or_warn [CR0N AL1N AL2N CR3N]
         if always              [AL0N AL1N CR2N CR3N]
   setup 1x6 2x3 qualifier num 1 none
      predscantdo
         if cast_normal_or_warn [CR0E AL0W CR1E AL2W CR2E AL1W]
         if always              [AL5W AL0W 0    CR3E CR2E 0]
   setup 1x6 2x3 qualifier num 3 none
      predscantdo
         if cast_normal_or_warn [CR5W AL5E CR4W AL3E CR3W AL4E]
         if always              [AL0E AL5E 0    CR2W CR3W 0]
            alternate_definition [interlocked] c3  // For interlocked counter.
   setup 1x4 2x2 qualifier num 3 none
      predscantdo
         if intlk_cast_normal_or_warn [CR3W CR2W AL2E AL3E]
         if always                    [AL0E CR2W CR1W AL3E]
            alternate_definition [3x3 interlocked] c4
   setup 1x6 2x3 qualifier num 3 3x3_2fl_only
      array [CR5W CR4W CR3W AL3E AL4E AL5E]
            alternate_definition [4x4 interlocked] c4
   setup 1x8 2x4 qualifier num 3 4x4_2fl_only
      array [CR7W CR6W CR4W CR5W AL4E AL5E AL7E AL6E]
            alternate_definition [diamond] c3
   setup dmd dmd qualifier num 3 none restriction forbidden nice_diamonds
      array [CR3W 0 AL3E 0]
   setup pmd dmd qualifier num 3 none restriction forbidden nice_diamonds
      array [0 CR0W 0 AL0E]
            alternate_definition [half] mainstream
   setup 1x2 1x2        restriction forbidden wave_only qualifier num 0 none
      array [ZM0N ZM1N]
   setup 1x2 1x2        plus_eighth_rotation qualifier right live num 1 wave_only
      array [CR0N 0]
   setup 1x2 1x2 rotate plus_eighth_rotation qualifier  left live num 1 wave_only
      array [0 AL0S]
   setup 1x2 1x2                      rotate qualifier            num 2 none
      preds "Need to be in miniwave or line of 4."
         if cast_normal  [CR0N AL0S]
   setup 1x2 1x2 rotate plus_eighth_rotation qualifier right live num 3 wave_only
      array [CR0N 0]
   setup 1x2 1x2        plus_eighth_rotation qualifier  left live num 3 wave_only
      array [0 AL0S]
   setup 1x2 1x2                             qualifier            num 4 none
      preds "Need to be in miniwave or line of 4."
         if cast_normal  [CR1S AL0S]
   setup 1x2 1x2        plus_eighth_rotation qualifier right live num 5 wave_only
      array [CR1S 0]
   setup 1x2 1x2 rotate plus_eighth_rotation qualifier  left live num 5 wave_only
      array [0 AL1N]



   // Alternate definition for fractionalization.
            parallel_conc_end yield_if_ambiguous neednumber
            bigmatrix_is_inherited
            single_is_inherited nxn_is_inherited yoyo_fractal_numbers
            visible_fractions distribute_repetitions
   // Yes, recurse on same call.  See t18.
   // Well, without the "opt for normal" stuff.  Can't be bothered to make a "cast off 1/4, opt for normal" call.
   seq_remainder cast_off_14 [inherit_single inherit_nxn inherit_bigmatrix repeat_nm1]
   seq continue_cast [inherit_single inherit_nxn inherit_bigmatrix]

// This one has a pretty name, because it will be shown in "do you want to replace" messages.
// So we don't show the "opt for normal" stuff.
call "final cast off 3/4" dontshow tag final_cast_off_34
            fractal_is_inherited gen_sting_is_inherited
   seq cast_off_n4_with_warn [inherit_fractal inherit_gensting insert_number 3]

call "_boxy cast off 3/4" dontshow tag boxy_cast_off_34
            parallel_conc_end
   setup 2x2 1x4 rotate qualifier miniwaves
      array [CR1S AL1N AL2N CR2S]
   setup 1x2 1x2 rotate
      preds "Need to be in miniwave or line of 4."
         if cast_normal  [CR1S AL1N]
   setup 1x4 2x2
      predscantdo
         if cast_normal_or_warn  [CR3W AL3E AL2E CR2W]
         if cast_pushy           [AL0E AL3E CR1W CR2W]
         if always               [0    AL3E 0    CR2W]
            alternate_definition [fractal] c4
   setup 2x2 1x4 rotate qualifier miniwaves
      array [CR0N AL0S AL3S CR3N]
   setup 1x2 1x2 rotate
      preds "Need to be in miniwave or line of 4."
         if cast_normal  [CR0N AL0S]
   setup 1x4 2x2
      predscantdo
         if cast_normal_or_warn  [CR0E AL0W AL1W CR1E]
         if cast_pushy           [AL3W AL0W CR2E CR1E]
         if always               [0    AL0W 0    CR1E]
            alternate_definition [stingy] c3
   setup 1x2 1x2 qualifier miniwaves
         array [CR1S AL0S]
            alternate_definition [generous] c3
   setup 1x2 1x2 qualifier miniwaves
         array [CR0N AL1N]
   // Alternate definition for fractionalization.
            visible_fractions parallel_conc_end
   seq cast_off_n4 [insert_number 1]
   seq continue_cast []
   seq continue_cast []

// Use this only after setting up the roll direction from initial cast.
call "_continue to cast off" dontshow tag continue_cast
            parallel_conc_end
   setup 1x2 1x2 rotate
      preds "Can't figure out which way to cast."
         if roll_is_cw  [CR0N CR1N]
         if roll_is_ccw [AL1S AL0S]
            alternate_definition [single] c4
   setup 1x1 1x1
      preds "Can't figure out which way to cast."
         if roll_is_cw  [CR0N]
         if roll_is_ccw [AL0S]
            alternate_definition [3x3] c4
   setup 1x3 1x3 rotate
      preds "Can't figure out which way to cast."
         if roll_is_cw  [CR0N CR1N CR2N]
         if roll_is_ccw [AL2S AL1S AL0S]
            alternate_definition [4x4] c4
   setup 1x4 1x4 rotate
      preds "Can't figure out which way to cast."
         if roll_is_cw  [CR0N CR1N CR2N CR3N]
         if roll_is_ccw [AL2S AL3S AL0S AL1S]

// If given the fraction 1/4, 1/2, or 3/4, the other, more specific, definition will take precedence,
// which will make it do the right thing with the 1x3 modifier.

call "cast off @b" mainstream tag cast_off_n4
            parallel_conc_end yield_if_ambiguous gen_sting_is_inherited neednumber
   setup 1x2 1x2 rotate qualifier num 1 none
      preds "Need to be in miniwave or line of 4."
         if cast_normal_or_warn [CR0N AL0S]
   setup 1x2 1x2 qualifier num 2 none
      preds "Need to be in miniwave or line of 4."
         if cast_normal_or_warn [CR1S AL0S]
   setup 1x2 1x2 rotate qualifier num 3 none
      preds "Need to be in miniwave or line of 4."
         if cast_normal_or_warn [CR1S AL1N]
   setup 1x2 1x2 qualifier num 4 none
      preds "Need to be in miniwave or line of 4."
         if cast_normal_or_warn [CR0N AL1N]
   setup 1x4 2x2 qualifier num 1 none
      predscantdo
         if cast_normal  [CR0E AL0W AL1W CR1E]
         if cast_pushy   [AL3W AL0W CR2E CR1E]
         if always       [0    AL0W 0    CR1E]
   setup 1x4 1x4 qualifier num 2 none
      predscantdo
         if cast_normal  [CR1S AL0S AL3S CR2S]
         if cast_pushy   [AL1S AL0S CR3S CR2S]
         if always       [0    AL0S 0    CR2S]
   setup 1x4 2x2 qualifier num 3 not_miniwaves
      predscantdo
         if cast_normal  [CR3W AL3E AL2E CR2W]
         if cast_pushy   [AL0E AL3E CR1W CR2W]
         if always       [0    AL3E 0    CR2W]
   setup 1x6 2x3 qualifier num 1 none
      predscantdo
         if cast_normal  [CR0E AL0W CR1E AL2W CR2E AL1W]
         if cast_pushy   [AL5W AL0W 0    CR3E CR2E 0]
         if always       [0    AL0W 0    0    CR2E 0]
   setup 1x6 1x6 qualifier num 2 none
      predscantdo
         if cast_normal  [CR1S AL0S CR5S AL4S CR3S AL2S]
         if cast_pushy   [AL1S AL0S 0    CR4S CR3S 0]
         if always       [0    AL0S 0    0    CR3S 0]
   setup 1x6 2x3 qualifier num 3 none
      predscantdo
         if cast_normal  [CR5W AL5E CR4W AL3E CR3W AL4E]
         if cast_pushy   [AL0E AL5E 0    CR2W CR3W 0]
         if always       [0    AL5E 0    0    CR3W 0]
            alternate_definition [half] mainstream
   setup 1x2 1x2        restriction forbidden wave_only qualifier num 0 none
      array [ZM0N ZM1N]
   setup 1x2 1x2        plus_eighth_rotation qualifier right live num 1 wave_only
      array [CR0N 0]
   setup 1x2 1x2 rotate plus_eighth_rotation qualifier  left live num 1 wave_only
      array [0 AL0S]
   setup 1x2 1x2                      rotate qualifier            num 2 none
      preds "Need to be in miniwave or line of 4."
         if cast_normal  [CR0N AL0S]
   setup 1x2 1x2 rotate plus_eighth_rotation qualifier right live num 3 wave_only
      array [CR0N 0]
   setup 1x2 1x2        plus_eighth_rotation qualifier  left live num 3 wave_only
      array [0 AL0S]
   setup 1x2 1x2                             qualifier            num 4 none
      preds "Need to be in miniwave or line of 4."
         if cast_normal  [CR1S AL0S]
   setup 1x2 1x2        plus_eighth_rotation qualifier right live num 5 wave_only
      array [CR1S 0]
   setup 1x2 1x2 rotate plus_eighth_rotation qualifier  left live num 5 wave_only
      array [0 AL1N]

   setup 2x4 thar        plus_eighth_rotation qualifier  in   live num 1 magic_only
      array [CR0N 0 0 AL2W 0 CR5N AL7W 0]
   setup 2x4 alamo       plus_eighth_rotation qualifier  out  live num 1 magic_only
      array [0 AL7W CR0N 0 AL2W 0 0 CR5N]
   setup 2x4 alamo       plus_eighth_rotation qualifier  in   live num 3 magic_only
      array [CR7E 0 0 AL0S 0 CR2E AL5S 0]
   setup 2x4 thar        plus_eighth_rotation qualifier  out  live num 3 magic_only
      array [0 AL0S CR2E 0 AL5S 0 0 CR7E]
   setup 2x4 thar        plus_eighth_rotation qualifier  in   live num 5 magic_only
      array [CR1S 0 0 AL3E 0 CR4S AL6E 0]
   setup 2x4 alamo       plus_eighth_rotation qualifier  out  live num 5 magic_only
      array [0 AL6E CR1S 0 AL3E 0 0 CR4S]
   setup 2x4 qtag rotate plus_eighth_rotation qualifier right live num 1 2fl_only
      array [AL4S AL5S 0 0 0 0 AL3S AL2S]
   setup 2x4 qtag        plus_eighth_rotation qualifier  left live num 1 2fl_only
      array [0 0 CR0N CR1N CR2N CR3N 0 0]
   setup 2x4 thar        plus_eighth_rotation qualifier  in   live num 1 1fl_only
      array [0 0 0 0 CR4N CR5N AL7W AL6W]
   setup 2x4 alamo       plus_eighth_rotation qualifier out   live num 1 1fl_only
      array [AL6W AL7W CR0N CR1N 0 0 0 0]
   setup 2x4 qtag        plus_eighth_rotation qualifier right live num 3 2fl_only
      array [AL7S AL6S 0 0 0 0 AL5S AL4S]
   setup 2x4 qtag rotate plus_eighth_rotation qualifier  left live num 3 2fl_only
      array [0 0 CR6N CR7N CR1N CR0N 0 0]
   setup 2x4 alamo       plus_eighth_rotation qualifier  in   live num 3 1fl_only
      array [0 0 0 0 CR3E CR2E AL5S AL4S]
   setup 2x4 thar        plus_eighth_rotation qualifier out   live num 3 1fl_only
      array [AL1S AL0S CR2E CR3E 0 0 0 0]
   setup 2x4 qtag rotate plus_eighth_rotation qualifier right live num 5 2fl_only
      array [AL5N AL4N 0 0 0 0 AL2N AL3N]
   setup 2x4 qtag        plus_eighth_rotation qualifier  left live num 5 2fl_only
      array [0 0 CR1S CR0S CR3S CR2S 0 0]
   setup 2x4 thar        plus_eighth_rotation qualifier  in   live num 5 1fl_only
      array [0 0 0 0 CR5S CR4S AL6E AL7E]
   setup 2x4 alamo       plus_eighth_rotation qualifier out   live num 5 1fl_only
      array [AL7E AL6E CR1S CR0S 0 0 0 0]

   setup 1x4 2x2 qualifier num 2 none
      predscantdo
         if cast_normal  [CR0E AL0W AL1W CR1E]
         if cast_pushy   [AL3W AL0W CR2E CR1E]
         if always       [0    AL0W 0    CR1E]
   setup 1x4 1x4 qualifier num 4 none
      predscantdo
         if cast_normal  [CR1S AL0S AL3S CR2S]
         if cast_pushy   [AL1S AL0S CR3S CR2S]
         if always       [0    AL0S 0    CR2S]
   setup 1x6 2x3 qualifier num 2 none
      predscantdo
         if cast_normal  [CR0E AL0W CR1E AL2W CR2E AL1W]
         if cast_pushy   [AL5W AL0W 0    CR3E CR2E 0]
         if always       [0    AL0W 0    0    CR2E 0]
   setup 1x6 1x6 qualifier num 4 none
      predscantdo
         if cast_normal  [CR1S AL0S CR5S AL4S CR3S AL2S]
         if cast_pushy   [AL1S AL0S 0    CR4S CR3S 0]
         if always       [0    AL0S 0    0    CR3S 0]
            alternate_definition [single] c4
   setup 1x2 1x2 qualifier num 1 none
      array [AL0W CR1E]
   setup 1x2 1x2 qualifier num 2 none
      array [AL0S CR1S]
   setup 1x2 1x2 qualifier num 3 none
      array [AL0E CR1W]
            alternate_definition [3x3] c4
   setup 1x6 2x3 rotate qualifier num 1 3x3couples_only
      array [AL3S AL4S AL5S CR2N CR1N CR0N]
   setup 1x6 1x6 qualifier num 2 3x3couples_only
      array [AL2S AL1S AL0S CR5S CR4S CR3S]
   setup 1x6 2x3 rotate qualifier num 3 3x3couples_only
      array [AL5N AL4N AL3N CR0S CR1S CR2S]
   setup 3x4 2x6 rotate qualifier num 1 couples_only
      array [AL10S AL11S CR0N CR1N CR3N CR2N CR5N CR4N AL7S AL6S AL8S AL9S]
   setup 3x4 3x4 qualifier num 2 couples_only
      array [AL1S AL0S CR3S CR2S CR5S CR4S CR7S CR6S AL9S AL8S AL11S AL10S]
   setup 3x4 2x6 rotate qualifier num 3 couples_only
      array [AL11N AL10N CR1S CR0S CR2S CR3S CR4S CR5S AL6N AL7N AL9N AL8N]
            alternate_definition [4x4] c4
   setup 1x8 2x4 rotate qualifier num 1 4x4couples_only
      array [AL4S AL5S AL7S AL6S CR3N CR2N CR0N CR1N]
   setup 1x8 1x8 qualifier num 2 4x4couples_only
      array [AL2S AL3S AL0S AL1S CR6S CR7S CR4S CR5S]
   setup 1x8 2x4 rotate qualifier num 3 4x4couples_only
      array [AL7N AL6N AL4N AL5N CR0S CR1S CR3S CR2S]
            alternate_definition [yoyo] c4
   setup 1x2 1x2 rotate qualifier num 2 miniwaves
      array [CR1S AL1N]
   setup 1x4 2x2 other_elongate qualifier num 2 not_miniwaves restriction controversial alwaysfail
      // Many people consider things like "yoyo split cast"
      // with a pushy cast to be bogus.
      predscantdo
         if cast_normal  [CR3W AL3E AL2E CR2W]
         if cast_pushy   [AL0E AL3E CR1W CR2W]
         if always       [0    AL3E 0    CR2W]
   // Alternate definition for fractionalization.
            parallel_conc_end yield_if_ambiguous neednumber
            bigmatrix_is_inherited
            single_is_inherited nxn_is_inherited yoyo_fractal_numbers
            visible_fractions distribute_repetitions
   // Yes, recurse on same call.  See t15.
   seq_remainder cast_off_14 [inherit_single inherit_nxn inherit_bigmatrix repeat_nm1]
   seq continue_cast [inherit_single inherit_nxn inherit_bigmatrix]

call "_check odd number" dontshow tag check_odd_number
   setup 1x1 1x1 qualifier num 1 none
      array [ZM1N]
   setup 1x1 1x1 qualifier num 3 none
      array [ZM1N]

call "cast off @B, odd" dontshow tag cast_off_n4_odd
            parallel_conc_end fractal_is_inherited gen_sting_is_inherited neednumber
   seq check_odd_number []
   seq cast_off_n4_with_warn [inherit_fractal inherit_gensting insert_number 1]
   seq continue_cast [repeat_nm1]

call "_cast off @b and roll" dontshow tag cast_n_4_roll
            neednumber fractal_is_inherited yoyo_is_inherited gen_sting_is_inherited yoyo_fractal_numbers
            parallel_conc_end
   setup 1x2 1x2 rotate qualifier num 1 none
      preds "Need to be in miniwave or line of 4."
         if lines_miniwave [CR0E AL0E]
   setup 1x2 1x2 rotate qualifier num 3 none
      preds "Need to be in miniwave or line of 4."
         if lines_miniwave [CR1W AL1W]
   setup 1x4 2x2 qualifier num 1 none
      predscantdo
         if lines_miniwave [CR0S AL0S AL1S CR1S]
         if lines_couple   [AL3S AL0S CR2S CR1S]
         if always         [0    AL0S 0    CR1S]
   setup 1x4 2x2 qualifier num 3 none
      predscantdo
         if lines_miniwave [CR3N AL3N AL2N CR2N]
         if lines_couple   [AL0N AL3N CR1N CR2N]
         if always         [0    AL3N 0    CR2N]

call "_centers cast 3/4, opt for normal" dontshow tag ctrs_cast_3_4_with_warn
            single_is_inherited grand_is_inherited fractal_is_inherited gen_sting_is_inherited
   maybegrandsingleconc cast_off_n4_with_warn [insert_number 3 inherit_fractal inherit_gensting]
                        nullcall []

call "_centers cast 3/4, opt for normal but @m" dontshow tag ctrs_cast_3_4_with_warnbut2nd
            single_is_inherited grand_is_inherited fractal_is_inherited gen_sting_is_inherited
   maybegrandsingleconc nullsecond [mandatory_secondary_call]
                        nullcall []

call "_centers cast 3/4" dontshow tag ctrs_cast_3_4_withplainmod
            bigmatrix_is_inherited fractal_is_inherited gen_sting_is_inherited
   maybematrix_conc cast_off_n4_with_warn [insert_number 3 inherit_fractal inherit_gensting allow_plain_mod]
                    nullcall []

call "_centers mandatory @m" dontshow tag ctrs_mandatory_2ndcall
            bigmatrix_is_inherited
   maybematrix_conc nullsecond [mandatory_secondary_call] nullcall []

call "_centers boxy cast 3/4" dontshow tag ctrs_boxy_cast_3_4
   conc boxy_cast_off_34 [] nullcall []

call "_check line and centers boxy cast 3/4" dontshow tag checkline_and_ctrs_boxy_cast_3_4
   seq checkline_unusual []
   seq ctrs_boxy_cast_3_4 []

/* This is used for finishing a rotary spin.
   It has special interpretations of "grand/3x3/4x4 single". */
call "centers arm turn 3/4" dontshow tag ctrmaybearmturn3
            single_is_inherited grand_is_inherited nxn_is_inherited
            bigmatrix_is_inherited fractal_is_inherited gen_sting_is_inherited
   maybespecialsingleconc armturn_n4 [or_anycall insert_number 3 inherit_fractal inherit_gensting] nullcall []

call "centers arm turn @b" dontshow tag ctrarmturn_n
            neednumber single_is_inherited grand_is_inherited bigmatrix_is_inherited
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   maybegrandsingleormatrixconc armturn_n4 [inherit_yoyo inherit_fractal inherit_gensting] nullcall []

call "_centers hinge" dontshow tag ctrhinge
            left_means_mirror fractal_is_inherited gen_sting_is_inherited
   conc hinge [inherit_left inherit_fractal inherit_gensting] nullcall []

call "_single centers hinge" dontshow tag sglctrhinge
            left_means_mirror intlk_is_inherited fractal_is_inherited gen_sting_is_inherited
   singleconc hinge_with_warn [inherit_intlk inherit_left inherit_fractal inherit_gensting] nullcall []

call "_single centers together hinge" dontshow tag sglctrtogetherhinge
            left_means_mirror intlk_is_inherited gen_sting_is_inherited
   singleconc_together hinge_with_warn [inherit_intlk inherit_left inherit_gensting] nullcall []

call "_single centers together @0" dontshow tag sglctrtogetheranything
   singleconc_together nullcall [mandatory_anycall] nullcall []

call "turn the star 1/4" dontshow tag turnstar1
            is_star_call
   setup star star
      array [CR1E 0 AL1W 0]
   setup dmd dmd rotate
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate
      array [0 CR1N 0 AL1S]
   setup 2x2 2x2   /* We don't encode stability for this -- it's flaky. */
      array [R1S L0S M1N M0N]
   setup trngl trngl     /* Yes, three-person stars. */
      array [0 CR2S AL1S 0 AL3W CR3E]
   setup ptrngl trngl
      predscantdocallinsetup
         if nexttrnglspot_is_tboned [AL2W ZM2N CR0S CR4E AL3S ZM4N]
         if always                  [AL2S ZM2N CR0S CR4S AL3S ZM4N]

call "turn the star @b, qual" dontshow tag turnstar2
            dont_use_in_resolve is_star_call neednumber fractional_numbers
   setup 2x2 2x2 qualifier num 0 none
      array [ZM0N ZM1N ZM2N ZM3N]
   setup star star qualifier num 0 none
      array [ZM0N 0 ZM2N 0]
   setup dmd dmd qualifier num 0 none
      array [ZM0N 0 ZM2N 0]
   setup pmd dmd qualifier num 0 none
      array [0 ZM1N 0 ZM3N]
   setup 2x2 2x2 qualifier num 1 none
      array [R1S L0S M1N M0N]
   setup star star qualifier num 1 none
      array [CR1E 0 AL1W 0]
   setup dmd dmd rotate qualifier num 1 none
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate qualifier num 1 none
      array [0 CR1N 0 AL1S]
   setup 2x2 2x2 qualifier num 2 none
      array [C2S A3S A0S C1S]
   setup star star qualifier num 2 none
      array [CR2S 0 AL0S 0]
   setup dmd dmd qualifier num 2 none
      array [CR2S 0 AL0S 0]
   setup pmd dmd qualifier num 2 none
      array [0 CR3S 0 AL1S]
   setup 2x2 2x2 qualifier num 3 none
      array [CR3N AL2N AM3S CM2S]
   setup star star qualifier num 3 none
      array [CR3W 0 AL3E 0]
   setup dmd dmd rotate qualifier num 3 none
      array [CR2S 0 AL2N 0]
   setup pmd dmd rotate qualifier num 3 none
      array [0 CR3S 0 AL3N]
            alternate_definition [half] mainstream
   // This means we are to consider the incoming number
   // to be half of the actual given value.
   setup 2x2 dmd rotate qualifier num 1 wave_only
      array [CR0N AL0S ZM1W ZM3W]
   setup 2x2 dmd rotate qualifier num 3 wave_only
      array [ZM1E ZM3E AL0S CR0N]
            alternate_definition [lasthalf] mainstream
   setup dmd 2x2 qualifier num 1 nice_diamonds
      array [CR0E 0 AL1W 0]
   setup pmd 2x2 qualifier num 1 nice_diamonds
      array [0 ZM1N 0 ZM2N]
   setup dmd 2x2 qualifier num 3 nice_diamonds
      array [CR1E 0 AL0W 0]
   setup pmd 2x2 qualifier num 3 nice_diamonds
      array [0 CR2S 0 AL1S]

call "_turn star @b and fudge@S" dontshow tag turnstarn_fudge
            neednumber yoyo_fractal_numbers
   seq turndmdn [or_secondary_call]
   seq fudge_to_parallel_diamonds []

call "turn the star @b" plus tag turnstarn
            dont_use_in_resolve is_star_call neednumber
   seq turnstar1 [repeat_n]

// These are used for cross chain thru/and roll.  They allow
// "single" and "NxN" if the number is 2.

call "turn the star @b for cross chain thru" dontshow tag turnstarn_xchthru
            dont_use_in_resolve left_means_mirror is_star_call neednumber
   // We give these roll directions, in accordance with the Callerlab dictum
   // that you can roll after this call, and that the result is the same as
   // Cross Chain and Roll.  Since that dictum makes no sense in terms of
   // how people turn as they do the call, we do *not* put in stability stuff.
   setup 2x2 2x2 qualifier num 0 none
      array [0 0 L2S L3S]
   setup 2x2 2x2 qualifier num 1 none
      array [0 0 L1N L2S]
   setup 2x2 2x2 qualifier num 2 none
      array [0 0 L0N L1N]
   setup 2x2 2x2 qualifier num 3 none
      array [0 0 L3S 0N]
            alternate_definition [single] c4
   setup 2x1 1x2 qualifier num 2 none
      array [L1N 0]
            alternate_definition [3x3] c4
   setup 2x3 2x3 qualifier num 2 none
      array [0 0 0 L0N L1N L2N]
            alternate_definition [4x4] c4
   setup 2x4 2x4 qualifier num 2 none
      array [0 0 0 0 L0N L1N L2N L3N]

call "turn the star @b for cross chain and roll" dontshow tag turnstarn_xchroll
            dont_use_in_resolve left_means_mirror is_star_call neednumber
   setup 2x2 2x2 qualifier num 0 none
      array [0 0 CR2E CR3E]
   setup 2x2 2x2 qualifier num 1 none
      array [0 0 CAL1W CL2E]
   setup 2x2 2x2 qualifier num 2 none
      array [0 0 CAL0W CAL1W]
   setup 2x2 2x2 qualifier num 3 none
      array [0 0 CAL3E CAL0W]
            alternate_definition [single] c4
   setup 2x1 1x2 qualifier num 2 none
      array [CAL1W 0]
            alternate_definition [3x3] c4
   setup 2x3 2x3 qualifier num 2 none
      array [0 0 0 CA0W CA1W CA2W]
            alternate_definition [4x4] c4
   setup 2x4 2x4 qualifier num 2 none
      array [0 0 0 0 CA0W CA1W CA2W CA3W]

call "turn the star @9-1" dontshow tag turnstarnm1
            is_star_call neednumber
   /* This allows facing stars to be turned 2 spots.  Perhaps we should
      fix "turnstarn" to do a similar thing. */
   setup star star qualifier num 2 none
      array [CR1E 0 AL1W 0]
   setup dmd dmd rotate qualifier num 2 none
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate qualifier num 2 none
      array [0 CR1N 0 AL1S]
   setup 2x2 2x2 qualifier num 2 none
      array [R1S L0S M1N M0N]
   setup star star qualifier num 3 none
      array [CR2S 0 AL0S 0]
   setup dmd dmd qualifier num 3 none
      array [CR2S 0 AL0S 0]
   setup pmd dmd qualifier num 3 none
      array [0 CR3S 0 AL1S]
   setup 2x2 2x2 qualifier num 3 none
      array [C2S A3S A0S C1S]

call "turn the star @b, interrupt first with @0" c1
            dont_use_in_resolve is_star_call neednumber
   seq nullcall [mandatory_anycall]
   seq turnstar1 [repeat_n]

call "turn the star @b, interrupt after with @0" c1
            dont_use_in_resolve is_star_call neednumber
   seq turnstar1 [repeat_n]
   seq nullcall [mandatory_anycall]

call "turn the star @b, interrupt after 1/4 with @0" c1
            dont_use_in_resolve is_star_call neednumber
   seq turnstar1 []
   seq nullcall [mandatory_anycall]
   seq turnstarnm1 []

call "turn the star 3/4, interrupt after 1/2 with @0" c1
            dont_use_in_resolve is_star_call
   seq turnstar2 [insert_number 2]
   seq nullcall [mandatory_anycall]
   seq turnstar1 []

call "turn the star 2, interrupt after first with @0 and after second with @m" c1
            dont_use_in_resolve is_star_call
   seq turnstar1 []
   seq nullcall [mandatory_anycall]
   seq turnstar1 []
   seq nullsecond [mandatory_secondary_call]

/* We use this in cases in which we know the "star" must not be a box of four, such as
   "alter the diamond".  If we allowed boxes to circulate, then someone could accidentally
   call "reverse order alter the diamond" from parallel waves. */
/* By doing it with qualifiers instead of repetition, we allow people to do
   their part of star turns that could otherwise lead to collisions in
   intermediate states. */
call "turn the star @b, nobox" dontshow tag turndmdn
            is_star_call neednumber 12_16_matrix_means_split
            yoyo_is_inherited gen_sting_is_inherited yoyo_fractal_numbers dont_raise_overcast
   setup star star      qualifier num 0 none
      array [ZM0N 0 ZM2N 0]
   setup dmd dmd        qualifier num 0 none
      array [ZM0N 0 ZM2N 0]
   setup pmd dmd        qualifier num 0 none
      array [0 ZM1N 0 ZM3N]
   setup star star      qualifier num 1 none
      array [CR1E 0 AL1W 0]
   setup dmd dmd rotate qualifier num 1 none
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate qualifier num 1 none
      array [0 CR1N 0 AL1S]
   setup 1x4 dmd rotate qualifier num 1 none   // Empty centers?  No problem.
      array [CR0N 0 AL0S 0]
   setup star star      qualifier num 2 none
      array [CR2S 0 AL0S 0]
   setup dmd dmd        qualifier num 2 none
      array [CR2S 0 AL0S 0]
   setup pmd dmd        qualifier num 2 none
      array [0 CR3S 0 AL1S]
   setup 1x4 dmd        qualifier num 2 none
      array [CR2S 0 AL0S 0]
   setup star star      qualifier num 3 none
      array [CR3W 0 AL3E 0]
   setup dmd dmd rotate qualifier num 3 none
      array [CR2S 0 AL2N 0]
   setup pmd dmd rotate qualifier num 3 none
      array [0 CR3S 0 AL3N]
   setup 1x4 dmd rotate qualifier num 3 none
      array [CR2S 0 AL2N 0]
   setup star star      qualifier num 4 none
      array [CR0N 0 AL2N 0]
   setup dmd dmd        qualifier num 4 none
      array [CR0N 0 AL2N 0]
   setup pmd dmd        qualifier num 4 none
      array [0 CR1N 0 AL3N]
   setup 1x4 dmd        qualifier num 4 none
      array [CR0N 0 AL2N 0]
   setup star star      qualifier num 5 none
      array [CCR1E 0 AAL1W 0]
   setup dmd dmd rotate qualifier num 5 none
      array [CCR0N 0 AAL0S 0]
   setup pmd dmd rotate qualifier num 5 none
      array [0 CCR1N 0 AAL1S]
   setup 1x4 dmd rotate qualifier num 5 none
      array [CCR0N 0 AAL0S 0]
            alternate_definition [half] a2
   setup star star      qualifier num 2 none
      array [CR1E 0 AL1W 0]
   setup dmd dmd rotate qualifier num 2 none
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate qualifier num 2 none
      array [0 CR1N 0 AL1S]
            alternate_definition [lasthalf] a2
   setup star star      qualifier num 2 none
      array [CR1E 0 AL1W 0]
   setup dmd dmd rotate qualifier num 2 none
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate qualifier num 2 none
      array [0 CR1N 0 AL1S]

/* This allows diamonds or stars only -- no boxes. */
call "_turn the star @b / ends trade@S" dontshow tag turndmdn_endstrade
            neednumber bigmatrix_is_inherited fractal_is_inherited yoyo_is_inherited gen_sting_is_inherited
   maybematrix_conc_star turndmdn [or_secondary_call inherit_fractal inherit_yoyo inherit_gensting]
                         trade []

call "_turn the center star @b@S" dontshow tag turnstarn_endsnothing
            neednumber bigmatrix_is_inherited fractal_is_inherited
   maybematrix_conc_star turndmdn [or_secondary_call inherit_fractal] nullcall []

call "_turn the center star @b for qd@S" dontshow tag newturnstarn_endsnothing
            neednumber bigmatrix_is_inherited
   maybematrix_conc_bar turndmdn [or_secondary_call] nullcall []

call "_diamond ends isolate" dontshow tag diamond_ends_isolate
   setup dmd 1x4 rotate
      array [CR0N 0 AL0S 0]
   setup pmd 1x4 rotate
      array [0 ZM1W 0 ZM3W]
   setup 1x4 dmd rotate
      array [CR0N 0 AL0S 0]
   setup 4x1 dmd rotate
      array [0 ZM3W 0 ZM1W]

call "_centers slip/ends circulate" dontshow tag ctrsslipendscirc
            bigmatrix_is_inherited gen_sting_is_inherited
   maybematrix_conc any_hand_slip [inherit_bigmatrix inherit_gensting] circulate [conc_demand_lines conc_force_spots]

call "alter the wave@S" c1
            step_to_wave can_be_fan left_means_touch_or_check visible_fractions
            yoyo_is_inherited gen_sting_is_inherited
   seq trade_or_swing_half [inherit_yoyo inherit_gensting allow_forced_mod]
   seq fanback []
   seq turndmdn [allow_forced_mod insert_number 2]
   seq flipdiamond [allow_forced_mod]

call "alter the diamond@S" c4a
            visible_fractions gen_sting_is_inherited
   seq turndmdn [allow_forced_mod insert_number 2]
   seq flipdiamond [allow_forced_mod]
   seq fanback [inherit_gensting]

call "alter and circulate@S" c2
            step_to_wave can_be_fan left_means_touch_or_check visible_fractions
            yoyo_is_inherited gen_sting_is_inherited bigmatrix_is_inherited
   seq swing [inherit_yoyo inherit_gensting inherit_bigmatrix allow_forced_mod]
   seq fanback [inherit_bigmatrix]
   seq ctrsslipendscirc [inherit_gensting inherit_bigmatrix]
   seq turndmdn [allow_forced_mod inherit_bigmatrix insert_number 2]
   seq flipdiamond [inherit_bigmatrix allow_forced_mod]

call "@B the alter@S" c4a
            step_to_nonphantom_box left_means_touch_or_check
            neednumber yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq armturn_n4 [allow_forced_mod inherit_yoyo inherit_gensting inherit_fractal]
   seq ctrarmturn_n4_utb [allow_forced_mod inherit_yoyo inherit_gensting inherit_fractal]
   // This next part will demand diamonds, which the previous part
   // will create only if the fraction is odd.
   seq turndmdn [allow_forced_mod]
   seq flipdiamond [allow_forced_mod]

call "@9-@9-@9 quarter the alter" c4a
            step_to_nonphantom_box left_means_touch_or_check
            need_three_numbers yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq armturn_n4 [allow_forced_mod inherit_yoyo inherit_gensting inherit_fractal]
   seq ctrarmturn_n4_utb [allow_forced_mod shift_one_number inherit_yoyo inherit_gensting inherit_fractal]
   // This next part will demand diamonds, which the previous part
   // will create only if the fraction is odd.
   seq turndmdn [allow_forced_mod shift_two_numbers]
   seq flipdiamond [allow_forced_mod]

// Same as above.
call "@9-@9-@9 1/4 the alter" c4a
            step_to_nonphantom_box left_means_touch_or_check
            need_three_numbers yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq armturn_n4 [allow_forced_mod inherit_yoyo inherit_gensting inherit_fractal]
   seq ctrarmturn_n4_utb [allow_forced_mod shift_one_number inherit_yoyo inherit_gensting inherit_fractal]
   // This next part will demand diamonds, which the previous part
   // will create only if the fraction is odd.
   seq turndmdn [allow_forced_mod shift_two_numbers]
   seq flipdiamond [allow_forced_mod]

// Same as above.
call "@9-@9-@9 alter the wave" c4a
            step_to_nonphantom_box left_means_touch_or_check
            need_three_numbers yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq armturn_n4 [allow_forced_mod inherit_yoyo inherit_gensting inherit_fractal]
   seq ctrarmturn_n4_utb [allow_forced_mod shift_one_number inherit_yoyo inherit_gensting inherit_fractal]
   // This next part will demand diamonds, which the previous part
   // will create only if the fraction is odd.
   seq turndmdn [allow_forced_mod shift_two_numbers]
   seq flipdiamond [allow_forced_mod]

call "@B the alter and circulate" c4a
            step_to_nonphantom_box left_means_touch_or_check
            neednumber yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq armturn_n4 [allow_forced_mod inherit_yoyo inherit_gensting inherit_fractal]
   seq ctrarmturn_n4_utb [allow_forced_mod inherit_yoyo inherit_gensting inherit_fractal]
   seq ctrsslipendscirc [inherit_gensting]
   // This next part will demand diamonds, which the previous part
   // will create only if the fraction is odd.
   seq turndmdn [allow_forced_mod]
   seq flipdiamond [allow_forced_mod]

call "@9-@9-@9 alter and circulate" c4a
            step_to_nonphantom_box left_means_touch_or_check
            need_three_numbers yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq armturn_n4 [allow_forced_mod inherit_yoyo inherit_gensting inherit_fractal]
   seq ctrarmturn_n4_utb [allow_forced_mod shift_one_number inherit_yoyo inherit_gensting inherit_fractal]
   seq ctrsslipendscirc [inherit_gensting]
   // This next part will demand diamonds, which the previous part
   // will create only if the fraction is odd.
   seq turndmdn [allow_forced_mod shift_two_numbers]
   seq flipdiamond [allow_forced_mod]

// Same as above.
call "@9-@9-@9 quarter the alter and circulate" c4a
            dont_use_in_resolve
            step_to_nonphantom_box left_means_touch_or_check
            need_three_numbers yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq armturn_n4 [allow_forced_mod inherit_yoyo inherit_gensting inherit_fractal]
   seq ctrarmturn_n4_utb [allow_forced_mod shift_one_number inherit_yoyo inherit_gensting inherit_fractal]
   seq ctrsslipendscirc [inherit_gensting]
   // This next part will demand diamonds, which the previous part
   // will create only if the fraction is odd.
   seq turndmdn [allow_forced_mod shift_two_numbers]
   seq flipdiamond [allow_forced_mod]

// Same as above.
call "@9-@9-@9 1/4 the alter and circulate" c4a
            dont_use_in_resolve
            step_to_nonphantom_box left_means_touch_or_check
            need_three_numbers yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq armturn_n4 [allow_forced_mod inherit_yoyo inherit_gensting inherit_fractal]
   seq ctrarmturn_n4_utb [allow_forced_mod shift_one_number inherit_yoyo inherit_gensting inherit_fractal]
   seq ctrsslipendscirc [inherit_gensting]
   // This next part will demand diamonds, which the previous part
   // will create only if the fraction is odd.
   seq turndmdn [allow_forced_mod shift_two_numbers]
   seq flipdiamond [allow_forced_mod]

call "change the wave" c3
            step_to_wave can_be_fan left_means_touch_or_check
            yoyo_is_inherited gen_sting_is_inherited grand_is_inherited visible_fractions
   seq trade [inherit_yoyo inherit_gensting]
   seq maybegrandslip [inherit_grand inherit_yoyo inherit_gensting]
   seq ctrrun [force_cross inherit_grand]
   seq trade [inherit_yoyo inherit_gensting]

call "change the centers" c3
            step_to_wave can_be_fan left_means_touch_or_check
            yoyo_is_inherited gen_sting_is_inherited grand_is_inherited visible_fractions
   seq trade [inherit_yoyo inherit_gensting]
   seq maybegrandslip [inherit_grand inherit_yoyo inherit_gensting]
   seq ctrrun [force_cross inherit_grand]
   seq maybegrandslip [inherit_grand inherit_yoyo inherit_gensting roll_transparent]

call "and cross" dontshow tag and_cross
            split_large_setups anyone_who_moves_cant_roll
   simple_funny
   setup 2x2 2x2 restriction unusual wave_only
      array [ZM0N ZM1N ZM0N ZM1N]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate restriction forbidden wave_only
      array [ZM0W ZM0W]
            alternate_definition [grand] c3a
   setup 4x2 2x4 restriction quarterbox_or_col
      preds "Can't figure out whether to cross."
         if columns_magic_tandem     [ZM0N ZM5N ZM2N ZM3N ZM4N ZM5N ZM2N ZM7N]
         if columns_magic_antitandem [ZM6N ZM5N ZM4N ZM3N ZM4N ZM3N ZM2N ZM1N]
   setup 3x2 2x3 restriction forbidden wave_only // Until figure this out.
      array [ZM4N ZM3N ZM2N ZM3N ZM2N ZM1N]
            alternate_definition [3x3] c4
   setup 3x2 2x3 rotate restriction forbidden peelable_box
      array [ZM2W ZM1W ZM0W ZM2W ZM1W ZM0W]
   setup qtag 2x6      /* Ought to fix this !!!! */
      array [ZM2N ZM3N ZM4N ZM4N ZM5N ZM0N ZM1N ZM1N]
            alternate_definition [1x3] c4   /* same */
   setup 3x2 2x3 rotate restriction forbidden peelable_box
      array [ZM2W ZM1W ZM0W ZM2W ZM1W ZM0W]
   setup qtag 2x6
      array [ZM2N ZM3N ZM4N ZM4N ZM5N ZM0N ZM1N ZM1N]
            alternate_definition [4x4] c4
   setup 4x2 2x4 rotate restriction forbidden peelable_box
      array [ZM3W ZM2W ZM1W ZM0W ZM3W ZM2W ZM1W ZM0W]

call "@0 and cross" a1
            dont_use_in_resolve grand_is_inherited nxn_is_inherited visible_fractions
   seq nullcall [mandatory_anycall]
   seq and_cross [inherit_grand inherit_nxn roll_transparent]

call "@6 cross" a1      /* Actually, it's not on the list. */
   setup 2x2 2x2
      predsnoselect
         if select   [0 0 ZM0N ZM1N]
         if unselect [ZM0N ZM1N ZM2N ZM3N]

call "hinge (special)" dontshow tag hinge_for_nicely
            left_means_mirror
   setup 1x2 1x2 rotate
      predscantdocallinsetup
         if 1x2_beau_miniwave_or_warn [CR0N AL0S]
         if always                    [0    AL1S]
            alternate_definition [fractal] c4
   setup 1x2 1x2 rotate restriction forbidden wave_only
      array [CR1S AL1N]
            alternate_definition [generous] c3
   setup 1x2 1x2 restriction forbidden wave_only
      array [CR1S AL0S]
            alternate_definition [stingy] c3
   setup 1x2 1x2 restriction forbidden wave_only
      array [ZM0N ZM1N]
            alternate_definition [1x3] c4
   setup 1x4 2x3
      predscantdocallinsetup
         if miniwave_side_of_in_3n1_line  [AL0W CR1E CR2E AL1W]
         if couple_side_of_in_3n1_line    [CR0E CR1E AL2W AL1W]
            alternate_definition [3x1] c4   /* Same as 1x3. */
   setup 1x4 2x3
      predscantdocallinsetup
         if miniwave_side_of_in_3n1_line  [AL0W CR1E CR2E AL1W]
         if couple_side_of_in_3n1_line    [CR0E CR1E AL2W AL1W]
            alternate_definition [3x3] c4
   setup 1x6 2x3 restriction forbidden wave_only
      array [CR0E AL0W CR1E AL2W CR2E AL1W]
            alternate_definition [4x4] c4
   setup 1x8 2x4 restriction forbidden wave_only
      array [CR0E AL0W AL1W CR1E AL3W CR3E CR2E AL2W]

call "nicely" c4a tag nicely
            left_means_mirror visible_fractions
            bigmatrix_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            grand_is_inherited nxn_is_inherited single_is_inherited
   seq hinge_for_nicely [allow_forced_mod inherit_left inherit_yoyo inherit_gensting inherit_fractal
                         inherit_bigmatrix inherit_nxn]
   seq and_cross [allow_forced_mod inherit_grand inherit_nxn inherit_single roll_transparent]

call "connect the diamond" c4a
   setup dmd 2x2 restriction unusual diamond_like qualifier right dmd_ctrs_mwv
      array [CR1S 0 AL1S 0]
   setup dmd 2x2 restriction unusual diamond_like qualifier left dmd_ctrs_mwv
      array [CR0S 0 AL0S 0]
   setup dmd 2x2 restriction unusual alwaysfail qualifier dmd_ctrs_1f
      array [CR1S 0 AL1S 0]
   /* If no centers, assume diamond is "normal". */
   setup dmd 2x2 restriction unusual diamond_like
      array [CR1S 0 AL0S 0]
   setup pmd 2x2 restriction unusual diamond_like qualifier right dmd_ctrs_mwv
      array [0 CM2E 0 0]
   setup pmd 2x2 restriction unusual diamond_like qualifier left dmd_ctrs_mwv
      array [0 0 0 AM1W]
   setup pmd 2x2 restriction unusual alwaysfail qualifier dmd_ctrs_1f
      array [0 CM2E 0 AM0W]
            alternate_definition [straight] c4
   /* What's controversial about doing this from facing diamonds?  The definition
      of "connect" says that the handedness of the centers takes precedence, and
      the ends have to adjust.  But the definition of "straight" doesn't say that
      the end looking in just does their part of the call while switching with
      their opposite.  It specifically tells them to cross over circulate.  If
      we do a "straight connect" from a facing diamond, the only thing they can
      do is something that violates the definition of "straight". */
   setup qtag 2x4 restriction controversial nice_diamonds qualifier right dmd_ctrs_mwv
      array [0   0    AM2W CM3E  0   0  CM1E AM0W]
   setup pqtag 2x4 restriction controversial nice_diamonds qualifier right dmd_ctrs_mwv
      array [ZM2N CR4S  0   0  AL4S ZM2N 0 0]
   setup qtag 2x4 restriction controversial nice_diamonds qualifier left dmd_ctrs_mwv
      array [0   0    AM2W CM3E  0   0  CM1E AM0W]
   setup pqtag 2x4 restriction controversial nice_diamonds qualifier left dmd_ctrs_mwv
      array [ZM5N CR3S  0   0  AL3S ZM5N 0 0]
   /* Fall back on these if handedness of centers can't be determined. */
   setup qtag 2x4 restriction controversial nice_diamonds
      array [0   0    AM2W CM3E  0   0  CM1E AM0W]
   setup pqtag 2x4 restriction controversial nice_diamonds
      array [ZM2N CR4S  0   0  AL3S ZM5N 0 0]

call "flip the diamond" plus tag flipdiamond
            fudge_to_q_tag take_right_hands 12_16_matrix_means_split
   setup dmd 1x4 restriction forbidden diamond_like
      array [CR1S 0 AL3S 0]
   setup pmd 1x4 restriction forbidden diamond_like
      array [0 CR2E 0 AL2W]
            alternate_definition [straight] c4
   setup qtag 2x4 rotate restriction forbidden diamond_like
      array [0 0 AL0S CR0N 0 0 CR7N AL7S]
   setup pqtag 2x4 rotate restriction forbidden diamond_like
      array [ZM1W CR1E 0 0 AL2E ZM2W 0 0]
            alternate_definition [reverse] c2
   setup dmd 1x4 rotate restriction forbidden diamond_like
      array [CR1N 0 AL1S 0]
   setup pmd 1x4 rotate restriction forbidden diamond_like
      array [0 AL0E 0 CR2E]
            alternate_definition [interlocked] c1
   setup qtag 2x4 rotate restriction forbidden diamond_like
      array [0 0 AL0S AL7S 0 0 CR7N CR0N]
   setup pqtag 2x4 rotate restriction forbidden diamond_like
      array [CR6E CR1E 0 0 AL2E AL5E 0 0]
            alternate_definition [magic] c3
   setup qtag 2x4 rotate restriction forbidden diamond_like
      array [0 0 AL7S CR7N 0 0 CR0N AL0S]
   setup pqtag 2x4 rotate restriction forbidden diamond_like
      array [CR1E CR6E 0 0 AL5E AL2E 0 0]
            alternate_definition [magic interlocked] c3
   setup qtag 2x4 rotate restriction forbidden diamond_like
      array [0 0 AL7S AL0S 0 0 CR0N CR7N]
   setup pqtag 2x4 rotate restriction forbidden diamond_like
      array [CR1E CR6E 0 0 AL5E AL2E 0 0]
            alternate_definition [3x1] c3x
   setup 3x1dmd 1x8 rotate
      array [R0N R1N R3N 0 L0S L1S L3S 0]
   setup p3x1dmd 1x8 rotate
      array [0 0 0 R2E 0 0 0 L6E]

call "flip the interlocked diamond" c1     // Callerlab prefers this spelling.
            fudge_to_q_tag take_right_hands
   setup qtag 2x4 rotate restriction forbidden diamond_like
      array [0 0 AL0S AL7S 0 0 CR7N CR0N]
   setup pqtag 2x4 rotate restriction forbidden diamond_like
      array [CR6E CR1E 0 0 AL2E AL5E 0 0]

call "cut the diamond" plus tag cutdiamond
            fudge_to_q_tag take_right_hands
   setup dmd 1x4 restriction forbidden diamond_like
      array [CR3S 0 AL1S 0]
   setup pmd 1x4 restriction forbidden diamond_like
      array [0 CR2E 0 AL2W]
            alternate_definition [straight] c4
   setup qtag 2x4 rotate restriction forbidden diamond_like
      array [0 0 AL0S CR0N 0 0 CR7N AL7S]
   setup pqtag 2x4 rotate restriction forbidden diamond_like
      array [ZM1W CR2E 0 0 AL1E ZM2W 0 0]
            alternate_definition [yoyo] c4
   setup dmd dmd restriction forbidden diamond_like
      array [CR3W 0 AL3E 0]
   setup pmd dmd restriction forbidden diamond_like
      array [0 CR2E 0 AL2W]
            alternate_definition [generous] c3
   setup dmd dmd restriction forbidden diamond_like
      array [CR3W 0 AL3E 0]
   setup pmd dmd restriction forbidden diamond_like
      array [0 CR2E 0 AL2W]
            alternate_definition [stingy] c3
   setup dmd dmd restriction forbidden diamond_like
      array [CR1E 0 AL1W 0]
   setup pmd dmd restriction forbidden diamond_like
      array [0 CR2E 0 AL2W]
            alternate_definition [reverse] c2
   setup dmd 1x4 rotate restriction forbidden diamond_like
      array [CR1N 0 AL1S 0]
   setup pmd 1x4 rotate restriction forbidden diamond_like
      array [0 CM2E 0 AM0E]
            alternate_definition [reverse yoyo] c4
   setup dmd dmd restriction forbidden diamond_like
      array [CR1E 0 AL1W 0]
   setup pmd dmd restriction forbidden diamond_like
      array [0 CM0W 0 AM0E]
            alternate_definition [reverse generous] c3
   setup dmd dmd restriction forbidden diamond_like
      array [CR1E 0 AL1W 0]
   setup pmd dmd restriction forbidden diamond_like
      array [0 CM0W 0 AM0E]
            alternate_definition [reverse stingy] c3
   setup dmd dmd restriction forbidden diamond_like
      array [CR1E 0 AL1W 0]
   setup pmd dmd restriction forbidden diamond_like
      array [0 CM2E 0 AM2W]
            alternate_definition [interlocked] c1
   setup qtag 2x4 rotate restriction forbidden diamond_like
      array [0 0 AL0S AL7S 0 0 CR7N CR0N]
   setup pqtag 2x4 rotate restriction forbidden diamond_like
      array [CR5E CR2E 0 0 AL1E AL6E 0 0]
            alternate_definition [magic] c3
   setup qtag 2x4 rotate restriction forbidden diamond_like
      array [0 0 AL7S CR7N 0 0 CR0N AL0S]
   setup pqtag 2x4 rotate restriction forbidden diamond_like
      array [CR2E CR5E 0 0 AL6E AL1E 0 0]
            alternate_definition [magic interlocked] c3
   setup qtag 2x4 rotate restriction forbidden diamond_like
      array [0 0 AL7S AL0S 0 0 CR0N CR7N]
   setup pqtag 2x4 rotate restriction forbidden diamond_like
      array [CR2E CR5E 0 0 AL6E AL1E 0 0]
            alternate_definition [3x1] c3x
   setup 3x1dmd 1x8 rotate
      array [R0N R1N R3N 0 L0S L1S L3S 0]
   setup p3x1dmd 1x8 rotate
      array [0 0 0 R6E 0 0 0 L2E]

call "cut the interlocked diamond" c1      // Callerlab prefers this spelling.
            fudge_to_q_tag take_right_hands
   setup qtag 2x4 rotate restriction forbidden diamond_like
      array [0 0 AL0S AL7S 0 0 CR7N CR0N]
   setup pqtag 2x4 rotate restriction forbidden diamond_like
      array [CR5E CR2E 0 0 AL1E AL6E 0 0]

/* The name is sort of ambiguous, but we need to have the printout look nice
   when we replace this part of a "cooperate".  This call is much less capable
   than the full "drop <direction>" below.  It is here just for use in "cooperate"
   and "tag the star".  Of course, an "insert_direction" attribute would be nice. */
call "drop in" dontshow tag dropin
            yield_if_ambiguous
   setup dmd 2x2 restriction unusual diamond_like qualifier right dmd_ctrs_mwv
      array [CR0E 0 AL2W 0]
   setup dmd 2x2 restriction unusual diamond_like qualifier left dmd_ctrs_mwv
      array [CR3E 0 AL1W 0]
   // If no centers, assume diamond is "normal".
   setup dmd 2x2 restriction unusual diamond_like
      array [CR0E 0 AL1W 0]
   // This could happen if centers are phantoms.
   // We will not allow this if the setup is a recognizable line.
   setup 1x4 2x2
      array [CR0E 0 AL1W 0]
   setup pmd 2x2 restriction unusual diamond_like
      array [0 ZM1N 0 ZM2N]
            alternate_definition [rewind] c4
   setup 2x2 dmd rotate qualifier miniwaves
      array [CR0N AL0S ZM1W ZM3W]

call "drop @h" c2
            grand_is_inherited cross_is_inherited intlk_is_inherited
   seq prepare_to_drop [inherit_grand]
   seq finish_drop [inherit_grand inherit_cross inherit_intlk roll_transparent]

call "_prepare to drop @h" dontshow tag prepare_to_drop
   setup dmd dmd restriction unusual diamond_like
      preds "Direction must be right, left, in, or out."
         if inp      [CR0E 0 AL2W 0]
         if outp     [AL0W 0 CR2E 0]
         if rightp   [CR0E 0 CR2E 0]
         if leftp    [AL0W 0 AL2W 0]
         if backp    [CR0S 0 AL2S 0]
         if no_dir_p [ZM0N 0 ZM2N 0]
   setup pmd dmd restriction unusual diamond_like
      preds "Direction must be right, left, in, or out."
         if inp      [   0 ZM1N    0 ZM3N]
         if outp     [   0 ZM1N    0 ZM3N]
         if rightp   [CR0E ZM1N CR2E ZM3N]
         if leftp    [AL0W ZM1N AL2W ZM3N]
         if backp    [  0S ZM1N   2S ZM3N]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N]
   /* These still aren't right.  But they are good enough to pass tests t21t:1303, taat:76, and nf18t.
      What is needed is a qualifier that will pick them up only if they are truly needed, i.e.
      at least one point is qtag-like and the direction is in or out.  Otherwise, we run the
      risk of failing to raise non-interaction warnings (test t21t) and failure to identify
      true testup size (test taat). */
   setup pqtag qtag qualifier qtag_like restriction unusual diamond_like
      preds "Direction must be right, left, in, or out."
         if inp      [CR0E CR1E 0 0 AL4W AL5W 0 0]
         if outp     [AL0W AL1W 0 0 CR4E CR5E 0 0]
         if rightp   [CR0E CR1E 0 0 CR4E CR5E 0 0]
         if leftp    [AL0W AL1W 0 0 AL4W AL5W 0 0]
         if backp    [CR0S CR1S 0 0 AL4S AL5S 0 0]
         if no_dir_p [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]
   setup qtag qtag qualifier qtag_like restriction unusual diamond_like
      preds "Direction must be right, left, in, or out."
         if inp      [CR0E AL1W ZM2N ZM3N AL4W CR5E ZM6N ZM7N]
         if outp     [AL0W CR1E ZM2N ZM3N CR4E AL5W ZM6N ZM7N]
         if rightp   [CR0E CR1E ZM2N ZM3N CR4E CR5E ZM6N ZM7N]
         if leftp    [AL0W AL1W ZM2N ZM3N AL4W AL5W ZM6N ZM7N]
         if backp    [CR0S AL1S ZM2N ZM3N AL4S CR5S ZM6N ZM7N]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
            alternate_definition [grand] c4a
   setup short6 short6
      preds "Direction must be right, left, in, or out."
         if inp      [ZM0N    0 ZM2N ZM3N    0 ZM5N]
         if outp     [ZM0N    0 ZM2N ZM3N    0 ZM5N]
         if rightp   [ZM0N CR1E ZM2N ZM3N CR4E ZM5N]
         if leftp    [ZM0N AL1W ZM2N ZM3N AL4W ZM5N]
         if backp    [ZM0N   1S ZM2N ZM3N   4S ZM5N]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N]
   setup pshort6 short6
      preds "Direction must be right, left, in, or out."
         if inp      [0 CR1E 0 0 AL4W 0]
         if outp     [0 AL1W 0 0 CR4E 0]
         if rightp   [0 CR1E 0 0 CR4E 0]
         if leftp    [0 AL1W 0 0 AL4W 0]
         if backp    [0   1S 0 0   4S 0]
         if no_dir_p [0 ZM1N 0 0 ZM4N 0]
   setup pspindle spindle
      preds "Direction must be right, left, in, or out."
         if inp      [ZM0N ZM1N ZM2N    0 ZM4N ZM5N ZM6N    0]
         if outp     [ZM0N ZM1N ZM2N    0 ZM4N ZM5N ZM6N    0]
         if rightp   [ZM0N ZM1N ZM2N CR3E ZM4N ZM5N ZM6N CR7E]
         if leftp    [ZM0N ZM1N ZM2N AL3W ZM4N ZM5N ZM6N AL7W]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
         if backp    [ZM0N ZM1N ZM2N   3S ZM4N ZM5N ZM6N   7S]
   setup spindle spindle
      preds "Direction must be right, left, in, or out."
         if inp      [0 0 0 AL3W 0 0 0 CR7E]
         if outp     [0 0 0 CR3E 0 0 0 AL7W]
         if rightp   [0 0 0 CR3E 0 0 0 CR7E]
         if leftp    [0 0 0 AL3W 0 0 0 AL7W]
         if backp    [0 0 0   3S 0 0 0   7S]
         if no_dir_p [0 0 0 ZM3N 0 0 0 ZM7N]

call "_drop nothing" dontshow tag finish_drop
   setup dmd 2x2 qualifier right dmd_ctrs_mwv
      array [ZM0N 0 ZM2N 0]
   setup dmd 2x2 qualifier left dmd_ctrs_mwv
      array [ZM3N 0 ZM1N 0]
   setup pmd 2x2 qualifier right dmd_ctrs_mwv
      array [ZM0N ZM1N ZM2N 0]
   setup pmd 2x2 qualifier left dmd_ctrs_mwv
      array [ZM3N 0 ZM1N ZM2N]
            alternate_definition [grand] c4a
   setup short6 2x3 rotate qualifier right dmd_ctrs_mwv
      array [ZM5W ZM0W    0    0 ZM3W ZM4W]
   setup short6 2x3 rotate qualifier left dmd_ctrs_mwv
      array [   0 ZM5W ZM0W ZM1W ZM2W    0]
   setup pshort6 2x3 rotate qualifier right dmd_ctrs_mwv
      array [0 ZM0W 0 0 ZM3W 0]
   setup pshort6 2x3 rotate qualifier left dmd_ctrs_mwv
      array [0 ZM5W 0 0 ZM2W 0]
   setup pspindle 2x4 qualifier right dmd_ctrs_mwv
      array [ZM1N ZM2N ZM3N ZM4N ZM4N ZM5N ZM6N ZM0N]
   setup pspindle 2x4 qualifier left dmd_ctrs_mwv
      array [ZM1N ZM2N ZM3N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup spindle 2x4 qualifier right dmd_ctrs_mwv
      array [0 0 0 ZM4N 0 0 0 ZM0N]
   setup spindle 2x4 qualifier left dmd_ctrs_mwv
      array [0 0 0 ZM3N 0 0 0 ZM7N]
            alternate_definition [cross] c4a
   setup dmd 2x2 qualifier right dmd_ctrs_mwv
      array [ZM3N 0 ZM1N 0]
   setup dmd 2x2 qualifier left dmd_ctrs_mwv
      array [ZM0N 0 ZM2N 0]
   setup pmd 2x2 qualifier right dmd_ctrs_mwv
      array [ZM3N ZM2N ZM1N    0]
   setup pmd 2x2 qualifier left dmd_ctrs_mwv
      array [ZM0N    0 ZM2N ZM1N]
            alternate_definition [grand cross] c4a
   setup short6 2x3 rotate qualifier right dmd_ctrs_mwv
      array [ZM0W ZM5W    0    0 ZM2W ZM1W]
   setup short6 2x3 rotate qualifier left dmd_ctrs_mwv
      array [   0 ZM0W ZM5W ZM4W ZM3W    0]
   setup pshort6 2x3 rotate qualifier right dmd_ctrs_mwv
      array [0 ZM5W 0 0 ZM2W 0]
   setup pshort6 2x3 rotate qualifier left dmd_ctrs_mwv
      array [0 ZM0W 0 0 ZM3W 0]
   setup pspindle 2x4 qualifier right dmd_ctrs_mwv
      array [ZM6N ZM5N ZM4N ZM3N    0    0    0 ZM7N]
   setup pspindle 2x4 qualifier left dmd_ctrs_mwv
      array [   0    0    0 ZM4N ZM3N ZM2N ZM1N ZM0N]
   setup spindle 2x4 qualifier right dmd_ctrs_mwv
      array [0 0 0 ZM3N 0 0 0 ZM7N]
   setup spindle 2x4 qualifier left dmd_ctrs_mwv
      array [0 0 0 ZM4N 0 0 0 ZM0N]
            alternate_definition [interlocked] c3
   setup qtag 2x4 qualifier right 2fl_only
      array [ZM1N ZM3N    0    0 ZM5N ZM7N ZM0N ZM2N]
   setup qtag 2x4 qualifier left 2fl_only
      array [ZM0N ZM2N ZM3N ZM1N ZM4N ZM6N    0    0]
   setup pqtag 2x4 qualifier right 2fl_only
      array [ZM1N ZM3N    0    0 ZM5N ZM7N ZM0N ZM2N]
   setup pqtag 2x4 qualifier left 2fl_only
      array [ZM0N ZM2N ZM3N ZM1N ZM4N ZM6N    0    0]

call "_special drop in" dontshow tag spec_drop_in
            take_right_hands
   setup dmd 2x2 restriction forbidden diamond_like
      array [CR0E 0 AL1W 0]
   setup pmd 2x2 restriction forbidden diamond_like
      array [0 ZM1N 0 ZM2N]
            alternate_definition [12matrix] c3a
   setup pshort6 2x3 rotate
      array [0 CR0N 0 0 AL2S 0]
   setup short6 2x3 rotate
      array [ZM5W 0 ZM0W ZM1W 0 ZM4W]
            alternate_definition [16matrix] c3a
   setup pspindle 2x4
      array [ZM1N ZM2N ZM3N 0 ZM4N ZM5N ZM6N 0]
   setup spindle 2x4
      array [0 0 0 AL3W 0 0 0 CR0E]

call "switch the wave" a2
   setup 1x4 1x4 restriction wave_only
      array [CR3S AL0S AL1S CR2S]
            alternate_definition [grand] c4a
   setup 1x6 1x6 restriction wave_only
      array [CR2S AL0S CR4S AL5S CR3S AL1S]
   setup 1x8 1x8 restriction wave_only
      array [CR3S AL0S AL1S CR6S AL7S CR4S CR5S AL2S]
            alternate_definition [single] c4
   setup 1x2 1x2 restriction forbidden wave_only
      array [CR1S AL0S]
            alternate_definition [3x3] c4
   setup 1x6 1x6 restriction forbidden wave_only
      array [CR5S AL0S CR4S AL2S CR3S AL1S]
            alternate_definition [4x4] c4
   setup 1x8 1x8 restriction forbidden wave_only
      array [CR6S AL0S AL1S CR7S AL2S CR4S CR5S AL3S]
            alternate_definition [straight] c4
   setup 2x4 2x4 restriction wave_only
      array [CR2S AL0S CR3S AL1S ZM2N CR4S AL7S ZM1N]

call "switch the line" c1
   setup 1x4 1x4
      array [CR3S AL0S AL1S CR2S]
            alternate_definition [grand] c4a
   setup 1x6 1x6
      array [CR2S AL0S CR4S AL5S CR3S AL1S]
   setup 1x8 1x8
      array [CR3S AL0S AL1S CR6S AL7S CR4S CR5S AL2S]
            alternate_definition [straight] c4
   setup 2x4 2x4
      array [CR2S AL0S CR3S AL1S ZM2N CR4S AL7S ZM1N]

call "curl apart" c4a
   setup 1x4 1x4
      array [CR3S CCAL2N AL1S AACR0N]
   setup dmd dmd rotate restriction unusual alwaysfail
      array [CR1E 0 AL3E 0]
   setup pmd dmd rotate restriction unusual alwaysfail
      array [0 CCAL2W 0 AACR0W]
            alternate_definition [straight] c4
   setup 2x4 2x4
      array [CR2S CCAL3N AACR0N AL1S ZM2N AACR7N CCAL4N ZM1N]
            alternate_definition [yoyo] c4
   setup 1x4 dmd rotate
      array [CR1E CCCAL2N AL3E AAACR2S]
   setup dmd 1x4 restriction unusual alwaysfail
      array [CR3S 0 AL1S 0]
   setup pmd 1x4 restriction unusual alwaysfail
      array [0 CCCAL0E 0 AAACR0W]

call "mix" a1 tag mix
            grand_is_inherited yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq ctrrun [force_cross inherit_grand]
   seq maybegrandslip [inherit_grand inherit_yoyo inherit_gensting roll_transparent]
   // This definition is here (equivalent to trade the wave, of course)
   // only so that "straight" will work.
   setup 1x4 1x4 restriction forbidden wave_only
      array [CR3S CR2S AL1S AL0S]
            alternate_definition [straight] c4
   setup 2x4 2x4
      array [CR2S CR3S AL0S AL1S ZM2N AL7S CR4S ZM1N]

call "swing and mix" a2
            step_to_wave visible_fractions
            grand_is_inherited yoyo_is_inherited gen_sting_is_inherited left_means_touch_or_check
   seq swing [inherit_yoyo inherit_gensting inherit_grand]
   seq ctrrun [force_cross inherit_grand]
   seq maybegrandslip [inherit_grand roll_transparent]

call "@0 and mix" a2
            /* No "grand" on this--it could confuse the dancers on the "anything".
               If you want [anything] and grand mix, do it the hard way. */
            dont_use_in_resolve visible_fractions
   seq nullcall [mandatory_anycall]
   seq ctrrun [force_cross]
   seq maybegrandslip [roll_transparent]

call "trade the wave" plus tag tradethewave
            parallel_conc_end
   setup 1x4 1x4 restriction forbidden wave_only
      array [CR3S CR2S AL1S AL0S]
            alternate_definition [straight] c4
   setup 2x4 2x4
      array [CR2S CR3S AL0S AL1S ZM2N AL7S CR4S ZM1N]

call "cross roll" c1 tag crossroll
   setup 1x4 1x4
      array [CR1S CR2S AL3S AL0S]
            alternate_definition [half] c3
   setup 1x4 2x2 no_cutting_through qualifier 2fl_only
      array [CR0E CR1E AL1W AL0W]
   setup 1x4 2x2 no_cutting_through qualifier magic_only
      array [CR0E CR1E AL1W AL0W]
   /* If the above clauses fail, we know there will be a collision,
      so we create an expanded setup. */
   setup 1x4 2x4 rotate no_cutting_through
      predscantdo
         if x14_once_rem_couple [CR6N CR0N AL1S AL7S]
         if always              [CR6N CR1N AL1S AL6S]
            alternate_definition [grand] c3x
   setup 1x6 1x6
      array [CR1S CR5S AL0S AL4S AL2S CR3S]
   setup 1x8 1x8
      array [CR1S CR2S CR7S AL0S AL5S AL6S AL3S CR4S]
            alternate_definition [3x3] c4
   setup 1x6 1x6 restriction forbidden 3x3_2fl_only
      array [CR1S CR5S CR3S AL4S AL2S AL0S]
            alternate_definition [4x4] c4
   setup 1x8 1x8 restriction forbidden 4x4_2fl_only
      array [CR1S CR2S CR4S CR7S AL5S AL6S AL0S AL3S]

/* Same as above. */
call "cross roll to a wave" c1
   setup 1x4 1x4
      array [CR1S CR2S AL3S AL0S]
            alternate_definition [half] c3
   setup 1x4 2x2 no_cutting_through qualifier 2fl_only
      array [CR0E CR1E AL1W AL0W]
   setup 1x4 2x2 no_cutting_through qualifier magic_only
      array [CR0E CR1E AL1W AL0W]
   /* If the above clauses fail, we know there will be a collision,
      so we create an expanded setup. */
   setup 1x4 2x4 rotate no_cutting_through
      predscantdo
         if x14_once_rem_couple [CR6N CR0N AL1S AL7S]
         if always              [CR6N CR1N AL1S AL6S]
            alternate_definition [grand] c3x
   setup 1x6 1x6
      array [CR1S CR5S AL0S AL4S AL2S CR3S]
   setup 1x8 1x8
      array [CR1S CR2S CR7S AL0S AL5S AL6S AL3S CR4S]
            alternate_definition [3x3] c4
   setup 1x6 1x6 restriction forbidden 3x3_2fl_only
      array [CR1S CR5S CR3S AL4S AL2S AL0S]
            alternate_definition [4x4] c4
   setup 1x8 1x8 restriction forbidden 4x4_2fl_only
      array [CR1S CR2S CR4S CR7S AL5S AL6S AL0S AL3S]

call "run wild" c4a
            grand_is_inherited nxn_is_inherited mxn_is_inherited
            visible_fractions
   seq crossroll [inherit_grand inherit_nxn inherit_mxn]
   seq crossroll [inherit_grand inherit_nxn inherit_mxn]

/* We allow either "3/4, run wild" or "run wild 3/4". */
/* We intend to implement this correctly, when there is more time. */
call "run wild 1/4" c4a
            grand_is_inherited nxn_is_inherited mxn_is_inherited
   seq crossroll [inherit_grand inherit_nxn inherit_mxn force_half]

call "run wild 1/2" c4a
            grand_is_inherited nxn_is_inherited mxn_is_inherited
   seq crossroll [inherit_grand inherit_nxn inherit_mxn]

call "run wild 3/4" c4a
            grand_is_inherited nxn_is_inherited mxn_is_inherited
   seq crossroll [inherit_grand inherit_nxn inherit_mxn]
   seq crossroll [inherit_grand inherit_nxn inherit_mxn force_half]

call "any hand slip" dontshow tag any_hand_slip
            diamond_is_legal
   setup 1x4 1x4
      array [ZM0N CR3S ZM2N AL1S]
   setup thar thar
      array [ZM0N CR5S 0 0 ZM4N AL1S 0 0]
            alternate_definition [yoyo] c4
   setup 1x4 dmd
      array [ZM0N CR3W ZM2N AL3E]
   setup thar thar
      array [ZM0N CR7W 0 0 ZM4N AL7E 0 0]
            alternate_definition [generous] c3
   setup 1x4 dmd
      array [ZM0N CR3W ZM2N AL3E]
   setup thar thar
      array [ZM0N CR7W 0 0 ZM4N AL7E 0 0]
            alternate_definition [stingy] c3
   setup 1x4 dmd
      array [ZM0N CR1E ZM2N AL1W]
   setup thar thar
      array [ZM0N CR3E 0 0 ZM4N AL3W 0 0]
            alternate_definition [half] a2
   setup 1x4 dmd
      array [ZM0N CR1E ZM2N AL1W]
   setup thar thar
      array [ZM0N CR3E 0 0 ZM4N AL3W 0 0]
            alternate_definition [lasthalf] mainstream
   setup dmd 1x4
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4
      array [0 CR3E 0 AL3W]
            alternate_definition [12matrix] c3a
   setup 1x6 1x6
      array [ZM0N CR2S AL1S ZM3N AL5S CR4S]
            alternate_definition [16matrix] c3a
   setup 1x8 1x8
      array [ZM0N CR3S CR6S AL1S ZM4N AL7S AL2S CR5S]
            alternate_definition [diamond] c4
   setup qtag qtag restriction forbidden nice_diamonds
      array [0 0 ZM2N AL7S 0 0 ZM6N CR3S]
   setup pqtag qtag restriction forbidden nice_diamonds
      array [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]

call "slip" a2
            diamond_is_legal
   setup 1x4 1x4 restriction dmd_ctrs_mwv
      array [ZM0N CR3S ZM2N AL1S]
            alternate_definition [yoyo] c4
   setup 1x4 dmd restriction dmd_ctrs_mwv
      array [ZM0N CR3W ZM2N AL3E]
            alternate_definition [generous] c3
   setup 1x4 dmd restriction dmd_ctrs_mwv
      array [ZM0N CR3W ZM2N AL3E]
            alternate_definition [stingy] c3
   setup 1x4 dmd restriction dmd_ctrs_mwv
      array [ZM0N CR1E ZM2N AL1W]
            alternate_definition [half] a2
   setup 1x4 dmd restriction dmd_ctrs_mwv
      array [ZM0N CR1E ZM2N AL1W]
            alternate_definition [lasthalf] mainstream
   setup dmd 1x4
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4 restriction dmd_ctrs_mwv
      array [0 CR3E 0 AL3W]
            alternate_definition [12matrix] c3a
   setup 1x6 1x6
      array [ZM0N CR2S AL1S ZM3N AL5S CR4S]
            alternate_definition [16matrix] c3a
   setup 1x8 1x8
      array [ZM0N CR3S CR6S AL1S ZM4N AL7S AL2S CR5S]
            alternate_definition [diamond] c4
   setup qtag qtag restriction forbidden nice_diamonds
      array [0 0 ZM2N AL7S 0 0 ZM6N CR3S]
   setup pqtag qtag restriction forbidden nice_diamonds
      array [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]

call "slip for catch" dontshow tag slipforcatch
            diamond_is_legal
   setup 1x4 1x4
      array [ZM0N CR3S ZM2N AL1S]
   setup dmd dmd
      array [ZM0N 0 ZM2N 0]
   setup pmd dmd
      array [0 CR3S 0 AL1S]
            alternate_definition [diamond] c3
   setup qtag qtag restriction nice_diamonds
      array [0 0 ZM2N AL7S 0 0 ZM6N CR3S]
   setup pqtag qtag
      array [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]
            alternate_definition [yoyo] c4
   setup 1x4 dmd
      array [ZM0N CR3W ZM2N AL3E]
   setup dmd 1x4
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4
      array [0 CR1W 0 AL1E]
            alternate_definition [generous] c3
   setup 1x4 dmd
      array [ZM0N CR3W ZM2N AL3E]
   setup dmd 1x4
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4
      array [0 CR1W 0 AL1E]
            alternate_definition [stingy] c3
   setup 1x4 dmd
      array [ZM0N CR1E ZM2N AL1W]
   setup dmd 1x4
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4
      array [0 CR3E 0 AL3W]
            alternate_definition [grand] c3a
   setup 1x6 1x6
      array [ZM0N CR2S AL1S ZM3N AL5S CR4S]
   setup 1x8 1x8
      array [ZM0N CR3S CR6S AL1S ZM4N AL7S AL2S CR5S]
// Should this have the same bells and whistles as grand gen/sting?
            alternate_definition [grand yoyo] c4
   setup 1x6 short6 rotate
      array [ZM4W CR3S AL3N ZM1W AL2N CR2S]
   setup 1x8 spindle
      array [ZM7N CR6W CR5W AL6E ZM3N AL4E AL5E CR4W]
            alternate_definition [grand generous] c3
   setup 1x6 short6 rotate
      array [ZM4W CR3S AL3N ZM1W AL2N CR2S]
   setup 6x1 short6 rotate
      array [ZM4W    0    0 ZM1W    0    0]
   setup short6 1x6 rotate
      array [CR2S ZM0W AL2N AL4N ZM3W CR4S]
   setup pshort6 1x6 rotate
      array [   0 ZM0W    0    0 ZM3W 0]
   setup 1x8 spindle
      array [ZM7N CR6W CR5W AL6E ZM3N AL4E AL5E CR4W]
   setup 8x1 spindle
      array [ZM7N    0    0    0 ZM3N    0    0    0]
   setup spindle 1x8
      array [0    0    0    ZM4N 0    0    0    ZM0N]
   setup pspindle 1x8
      array [CR1W CR2W CR7W ZM4N AL7E AL2E AL1E ZM0N]
            alternate_definition [grand stingy] c3
   setup 1x6 short6 rotate
      array [ZM4W CR5N AL5S ZM1W AL0S CR0N]
   setup 6x1 short6 rotate
      array [ZM4W    0    0 ZM1W    0    0]
   setup short6 1x6 rotate
      array [CR1N ZM0W AL1S AL5S ZM3W CR5N]
   setup pshort6 1x6 rotate
      array [   0 ZM0W    0    0 ZM3W 0]
   setup 1x8 spindle
      array [ZM7N CR0E CR1E AL0W ZM3N AL2W AL1W CR2E]
   setup 8x1 spindle
      array [ZM7N    0    0    0 ZM3N    0    0    0]
   setup spindle 1x8
      array [0       0    0    ZM4N 0    0    0    ZM0N]
   setup pspindle 1x8
      array [CR3E CR6E CR5E ZM4N AL5W AL6W AL3W ZM0N]
            alternate_definition [half] a2
   setup 1x4 dmd
      array [ZM0N CR1E ZM2N AL1W]
   setup dmd 1x4
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4
      array [0 CR3E 0 AL3W]
            alternate_definition [lasthalf] mainstream
   setup 1x4 dmd
      array [ZM0N CR1E ZM2N AL1W]
   setup dmd 1x4
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4
      array [0 CR3E 0 AL3W]

call "_maybe grand slip" dontshow tag maybegrandslip
            diamond_is_legal
   setup 2x4 2x4 qualifier tbone none
      array [ZM0N CR2S AL1S ZM3N ZM4N AL6S CR5S ZM7N]
   setup 1x4 1x4
      array [ZM0N CR3S ZM2N AL1S]
   setup 4x2 2x4 qualifier tbone none restriction unusual alwaysfail
      array [ZM0N CR6S CR5S ZM3N ZM4N AL2S AL1S ZM7N]
   setup 4x1 1x4 restriction unusual alwaysfail
      array [ZM0N 0 ZM2N 0]
   setup dmd dmd
      array [ZM0N 0 ZM2N 0]
   setup pmd dmd
      array [ZM0N CR3S ZM2N AL1N]
            alternate_definition [half] c1
   setup 1x4 dmd
      // We would like to have them do a genuine hinge,
      // but we don't have the predicates for it.
      array [ZM0N CR1E ZM2N AL1W]
            alternate_definition [lasthalf] c1
   setup dmd 1x4
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4
      array [0 CR3E 0 AL3W]
            alternate_definition [diamond] c3
   setup qtag qtag restriction nice_diamonds
      array [0 0 ZM2N AL7S 0 0 ZM6N CR3S]
   setup pqtag qtag
      array [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]
            alternate_definition [yoyo] c4
   setup 1x4 dmd
      array [ZM0N CR3W ZM2N AL3E]
            alternate_definition [generous] c3
   setup 1x4 dmd
      array [ZM0N CR3W ZM2N AL3E]
            alternate_definition [stingy] c3
   setup 1x4 dmd
      array [ZM0N CR1E ZM2N AL1W]
            alternate_definition [grand] c3a
   setup 1x6 1x6
      array [ZM0N CR2S AL1S ZM3N AL5S CR4S]
   setup 1x8 1x8
      array [ZM0N CR3S CR6S AL1S ZM4N AL7S AL2S CR5S]
            alternate_definition [grand yoyo] c4
   setup 1x6 short6 rotate
      array [ZM4W CR3S AL3N ZM1W AL2N CR2S]
   setup 1x8 spindle
      array [ZM7N CR6W CR5W AL6E ZM3N AL4E AL5E CR4W]
            alternate_definition [grand generous] c3
   setup 1x6 short6 rotate
      array [ZM4W CR3S AL3N ZM1W AL2N CR2S]
   setup 1x8 spindle
      array [ZM7N CR6W CR5W AL6E ZM3N AL4E AL5E CR4W]
            alternate_definition [grand stingy] c3
   setup 1x6 short6 rotate
      array [ZM4W CR5N AL5S ZM1W AL0S CR0N]
   setup 1x8 spindle
      array [ZM7N CR0E CR1E AL0W ZM3N AL2W AL1W CR2E]

call "_maybe grand slip in left wave" dontshow tag maybegrandslip_in_lw
            left_means_mirror
   setup 2x4 2x4 qualifier tbone none restriction unusual alwaysfail
      array [ZM0N CR2S AL1S ZM3N ZM4N AL6S CR5S ZM7N]
   setup 1x4 1x4
      array [ZM0N CR3S ZM2N AL1S]
   setup qtag qtag qualifier left wave_only
      array [0 0 ZM2N 0 0 0 0 CR3S]
   setup pqtag qtag
      array [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]
   setup 4x2 2x4 qualifier tbone none restriction unusual alwaysfail
      array [ZM0N CR6S CR5S ZM3N ZM4N AL2S AL1S ZM7N]
   setup 4x1 1x4 restriction unusual alwaysfail
      array [ZM0N 0 ZM2N 0]
            alternate_definition [half] c1
   setup 1x4 dmd
      array [ZM0N CR1E ZM2N AL1W]
   setup qtag hrglass qualifier left wave_only
      array [0 0 ZM2N 0 0 0 0 CR3E]
   setup pqtag hrglass
      array [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]
            alternate_definition [lasthalf] c1
   setup dmd 1x4
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4
      array [0 CR3E 0 AL3W]
            alternate_definition [yoyo] c4
   setup 1x4 dmd
      array [ZM0N CR3W ZM2N AL3E]
            alternate_definition [grand] c3a
   setup 1x6 1x6
      array [ZM0N CR2S AL1S ZM3N AL5S CR4S]
   setup 1x8 1x8
      array [ZM0N CR3S CR6S AL1S ZM4N AL7S AL2S CR5S]
            alternate_definition [grand yoyo] c4
   setup 1x6 short6 rotate
      array [ZM4W CR3S AL3N ZM1W AL2N CR2S]
   setup 1x8 spindle
      array [ZM7N CR6W CR5W AL6E ZM3N AL4E AL5E CR4W]

call "_maybe grand slip, not c3" dontshow tag maybegrandslip_notc3
   setup 1x4 1x4
      array [ZM0N CR3S ZM2N AL1S]
            alternate_definition [half] c1
   setup 1x4 dmd
      /* We would like to have them do a genuine hinge, but we don't
         have the predicates for it. */
      array [ZM0N CR1E ZM2N AL1W]
            alternate_definition [yoyo] c4
   setup 1x4 dmd
      array [ZM0N CR3W ZM2N AL3E]
            alternate_definition [grand] a2
   setup 1x6 1x6
      array [ZM0N CR2S AL1S ZM3N AL5S CR4S]
   setup 1x8 1x8
      array [ZM0N CR3S CR6S AL1S ZM4N AL7S AL2S CR5S]
            alternate_definition [grand yoyo] c4
   setup 1x6 short6 rotate
      array [ZM4W CR3S AL3N ZM1W AL2N CR2S]
   setup 1x8 spindle
      array [ZM7N CR6W CR5W AL6E ZM3N AL4E AL5E CR4W]

call "_must be grand slip, not c3" dontshow tag mustbegrandslip_notc3
   // This call is illegal unless "grand" has been given.
   setup 1x2 1x2
      array [0 0]
            alternate_definition [grand] a2
   setup 1x6 1x6
      array [ZM0N CR2S AL1S ZM3N AL5S CR4S]
   setup 1x8 1x8
      array [ZM0N CR3S CR6S AL1S ZM4N AL7S AL2S CR5S]
            alternate_definition [grand yoyo] c4
   setup 1x6 short6 rotate
      array [ZM4W CR3S AL3N ZM1W AL2N CR2S]
   setup 1x8 spindle
      array [ZM7N CR6W CR5W AL6E ZM3N AL4E AL5E CR4W]


call "slide" a2
   setup 1x4 1x4 restriction controversial miniwaves
      array [ZM1N ZM0N ZM3N ZM2N]
            alternate_definition [half] a2
   setup 1x4 2x2 restriction controversial miniwaves
      array [ZM3N ZM3N ZM2N ZM2N]
            alternate_definition [twisted] c4
   setup 1x4 2x2 qualifier miniwaves
      array [AM0W CM0E CM1E AM1W]

call "spread" plus tag spread
            can_be_one_side_lateral
   // There are a number of problems with this call, not the least of
   // which is that it has two inconsistent definitions, accrding to the
   // Callerlab definitions, if the formation is parallel 2-faced lines.
   // The definition says that "from waves or lines", the centers spread
   // apart and the ends slide in, the way most people expect.  But, from
   // a couple following a couple, the leads spread and the trailers step
   // ahead.  Parallel 2-faced lines are both!  Of course no one really
   // uses the couple-following-a-couple version in such a case.  We mark
   // it as "unusual" and let it go at that.
   setup 1x4 1x4 restriction unusual miniwaves
      array [ZM1N ZM0N ZM3N ZM2N]
   setup 1x6 1x6 qualifier miniwaves
      array [ZM1N ZM0N ZM5N ZM4N ZM3N ZM2N]

   // If in 4x2 columns, the first thing we have to do is check for
   // all combinations of 1-faced 2x2 boxes.  This is because, independently
   // of all the other considerations, the definition from a 1-faced
   // box is clear: leads spread and trailers step between them.
   // So we check for the unsymmetrical case of everyone facing the same
   // way, along with the cases of a DPT and a CDPT.
   setup 4x2 2x4 rotate qualifier all_facing_same
      array [ZM6W ZM7W ZM1W ZM0W ZM3W ZM2W ZM4W ZM5W]
   setup 4x2 2x4 rotate qualifier 2fl_only     // DPT or CDPT
      array [ZM6W ZM7W ZM1W ZM0W ZM3W ZM2W ZM4W ZM5W]
   // Do the same for normal columns (or even unsymmetrical "tandem split trade circulate"
   // columns), but mark it unsusual.  PNTSDF 2012.
   setup 4x2 2x4 rotate qualifier siamese_in_quad restriction unusual alwaysfail
      array [ZM6W ZM7W ZM1W ZM0W ZM3W ZM2W ZM4W ZM5W]

   // If in an 8-chain, the centers spread, and we mark it as controversial.
   setup 4x2 2x4 rotate qualifier ntbone in in_or_out restriction controversial alwaysfail
      array [ZM6W 0 ZM0W 0 0 ZM3W 0 ZM5W]

   // Otherwise, we allow it.  This is really not right.  We should be
   // requiring the caller to designate some people, and require them
   // to be the centers.  But: (1) no one wants to do that -- they just say
   // "heads star thru and spread"; (2) we already have "<anyone> spread"
   // as a call, defined by matrix so it isn't compatible, that does something
   // illegal but commonly used at C1 or so for going into butterflies, blocks,
   // etc.  It is simply not possible to write a program that obeys the
   // Callerlab definitions and obeys common usage at the same time.
   setup 4x2 2x4 rotate qualifier col_ends_looking_in
      array [ZM6W ZM7W ZM0W 0 0 ZM3W ZM4W ZM5W]
   setup prigger qtag restriction unusual alwaysfail
      array [ZM0N ZM1N 0 0 ZM4N ZM5N ZM6N ZM7N]
   setup 2x2 1x4 qualifier 2fl_only
      array [ZM0N ZM2N ZM3N ZM1N]
   setup trngl 1x3 qualifier 2fl_only
      array [ZM1N ZM0N ZM2N 0 0 0]
            alternate_definition [twisted] c4
   setup 1x4 2x2 qualifier miniwaves
      array [AM0W CM0E CM1E AM1W]
            alternate_definition [2x1] mainstream
   setup trngl 1x3 qualifier 2fl_only
      array [ZM1N ZM0N ZM2N 0 0 0]
            alternate_definition [single] c4
   setup 1x2 1x2 restriction unusual miniwaves
      array [ZM1N ZM0N]
            alternate_definition [half] plus
   setup 1x4 2x2 qualifier miniwaves
      array [ZM3N ZM3N ZM2N ZM2N]
   setup 1x6 2x3 qualifier miniwaves
      array [ZM5N ZM5N ZM4N ZM3N ZM3N ZM4N]
   setup 1x8 2x4 qualifier miniwaves
      array [ZM7N ZM7N ZM6N ZM6N ZM4N ZM4N ZM5N ZM5N]

call "@6 spread" c1 tag selected_spread
   // We also need this for things like "motivate and the boys spread".
   setup 1x4 1x4 qualifier miniwaves
      preds "Selected people must be adjacent."
         if select_near_select_or_phantom [ZM1N ZM0N ZM3N ZM2N]
         if unselect_near_unselect        [ZM0N ZM1N ZM2N ZM3N]
   // This will allow nonsensical uses.  That's too bad.  Use of "<so-and-so> spread" to
   // go from columns to blocks (or whatever) violates the definition of the call anyway.
   partnermatrix use_selector tbone_is_ok both_selected_ok
      [ZM16N 16 ZM16N 16 ZM16N 16 ZM16N 16 ZM12N 16 ZM12N 16 ZM20N 16 ZM20N 16
      0 0 0 0 0 0 0 0]

call "@0 and spread" plus
            dont_use_in_resolve visible_fractions
   seq nullcall [mandatory_anycall]
   seq spread []

call "@0 and the @6 spread" plus
            dont_use_in_resolve visible_fractions
   seq nullcall [mandatory_anycall]
   seq selected_spread [seq_re_evaluate]

call "swing" a2 tag swing
            12_16_matrix_means_split diamond_is_legal parallel_conc_end   // For the "half" version.
   setup 1x4 1x4 restriction miniwaves   // See comment at spin chain the line.
      array [CR1S AL0S AL3S CR2S]
            alternate_definition [half] a2
   setup 1x4 2x2 restriction miniwaves
      array [CR0E AL0W AL1W CR1E]
            alternate_definition [lasthalf] a2
   setup 2x2 1x4 rotate restriction forbidden wave_only
      array [CR0N AL0S AL3S CR3N]
            alternate_definition [yoyo] c4
   setup 1x2 1x2 rotate restriction miniwaves
      array [CR1S AL1N]
            alternate_definition [generous] c3
   setup 1x2 1x2 rotate restriction miniwaves
      array [CR1S AL1N]
            alternate_definition [stingy] c3
   setup 1x2 1x2 rotate restriction miniwaves
      array [CR0N AL0S]
            alternate_definition [grand] c3a
   setup 1x6 1x6 restriction wave_only
      array [CR1S AL0S CR5S AL4S CR3S AL2S]
   setup 1x8 1x8 restriction wave_only
      array [CR1S AL0S AL3S CR2S AL5S CR4S CR7S AL6S]
            alternate_definition [grand yoyo] c3a
   setup 1x6 2x3 restriction wave_only
      array [CR5W AL5E CR4W AL3E CR3W AL4E]
   setup 1x8 2x4 restriction wave_only
      array [CR7W AL7E AL6E CR6W AL4E CR4W CR5W AL5E]
            alternate_definition [grand generous] c3
   setup 1x6 2x3 restriction wave_only
      array [CR5W AL5E CR4W AL3E CR3W AL4E]
   setup 1x8 2x4 restriction wave_only
      array [CR7W AL7E AL6E CR6W AL4E CR4W CR5W AL5E]
            alternate_definition [grand stingy] c3
   setup 1x6 2x3 restriction wave_only
      array [CR0E AL0W CR1E AL2W CR2E AL1W]
   setup 1x8 2x4 restriction wave_only
      array [CR0E AL0W AL1W CR1E AL3W CR3E CR2E AL2W]
            alternate_definition [diamond] c4
   setup qtag qtag restriction forbidden nice_diamonds
      array [0 0 AL3S CR2S 0 0 CR7S AL6S]
   setup pqtag qtag restriction forbidden nice_diamonds
      array [CR5S CR4S 0 0 AL1S AL0S 0 0]


// On the plain call "slither", the ends are prevented from
// rolling, because they participated in the call, but did not turn.
call "slither" a2
   setup 1x4 1x4 restriction dmd_ctrs_mwv
      array [ZM0N ZM3N ZM2N ZM1N]
            alternate_definition [twisted] c4
   setup 1x4 dmd restriction dmd_ctrs_mwv
      array [ZM0N AM1W ZM2N CM1E]
            alternate_definition [half] a2
   setup 1x4 dmd restriction dmd_ctrs_mwv
      array [ZM0N ZM3N ZM2N ZM3N]
            alternate_definition [single] c4
   setup 1x2 1x2
      array [ZM0N ZM1N]
            alternate_definition [3x3] c4
   setup 1x6 1x6 qualifier wave_only
      array [ZM0N ZM5N ZM1N ZM3N ZM2N ZM4N]
   setup 1x6 1x6 qualifier 3x3_2fl_only
      array [ZM0N ZM2N ZM4N ZM3N ZM5N ZM1N]
            alternate_definition [4x4] c4
   setup 1x8 1x8 qualifier wave_only
      array [ZM0N ZM6N ZM7N ZM1N ZM4N ZM2N ZM3N ZM5N]
   setup 1x8 1x8 qualifier 4x4_2fl_only
      array [ZM0N ZM3N ZM5N ZM6N ZM4N ZM7N ZM1N ZM2N]

call "_inner sashay" dontshow tag spiffy_sashay
   setup 1x2 1x2
      array [ZM1N ZM0N]
            alternate_definition [twisted] c4
   setup 1x2 1x2 rotate qualifier wave_only
      array [AM0S CM0N]

call "_inner slither" dontshow tag spiffy_slither
            twisted_is_inherited
   singleconc spiffy_sashay [inherit_twisted] nullcall []

// But if it's used in some other call, as in dixie sashay,
// we want the ends to be able to roll.  So we arrange for
// this to do the right thing.
call "_slither as subcall" dontshow tag slither
   // The first part of doing the right thing is avoiding
   // doing the wrong thing, so that the sequential/concentric
   // definition below will be used.
   setup 1x4 1x4
      array [0 0 0 0]
   // But if it's called with complex modifiers, we just do it
   // the ordinary way.  It's not worth the effort to make just
   // the outer 2 able to roll after a 4x4 right and left by.
            alternate_definition [single] c4
   setup 1x2 1x2
      array [ZM0N ZM1N]
            alternate_definition [3x3] c4
   setup 1x6 1x6 qualifier wave_only
      array [ZM0N ZM5N ZM1N ZM3N ZM2N ZM4N]
   setup 1x6 1x6 qualifier 3x3_2fl_only
      array [ZM0N ZM2N ZM4N ZM3N ZM5N ZM1N]
            alternate_definition [4x4] c4
   setup 1x8 1x8 qualifier wave_only
      array [ZM0N ZM6N ZM7N ZM1N ZM4N ZM2N ZM3N ZM5N]
   setup 1x8 1x8 qualifier 4x4_2fl_only
      array [ZM0N ZM3N ZM5N ZM6N ZM4N ZM7N ZM1N ZM2N]
   // Now, after the plain call has failed, we do the good stuff.
   // First, make sure we aren't in a diamond.  The "singleconc"
   // schema wouldn't mind, but we do.
            alternate_definition [1x3] c4
   setup 1x6 1x6 qualifier wave_only
      array [ZM0N ZM5N ZM1N ZM3N ZM2N ZM4N]
   setup 1x6 1x6 qualifier 3x3_2fl_only
      array [ZM0N ZM2N ZM4N ZM3N ZM5N ZM1N]
   setup 1x4 1x4
      predscantdo
         if miniwave_side_of_in_3n1_line [ZM1N ZM0N ZM3N ZM2N]
         if couple_side_of_in_3n1_line   [ZM0N ZM1N ZM2N ZM3N]
            alternate_definition [3x1] c4    // Same as 1x3.
   setup 1x6 1x6 qualifier wave_only
      array [ZM0N ZM5N ZM1N ZM3N ZM2N ZM4N]
   setup 1x6 1x6 qualifier 3x3_2fl_only
      array [ZM0N ZM2N ZM4N ZM3N ZM5N ZM1N]
   setup 1x4 1x4
      predscantdo
         if miniwave_side_of_in_3n1_line [ZM1N ZM0N ZM3N ZM2N]
         if couple_side_of_in_3n1_line   [ZM0N ZM1N ZM2N ZM3N]
            twisted_is_inherited
   seq checkline [roll_transparent]
   seq spiffy_slither [inherit_twisted]

call "_maybe grand slither" dontshow tag maybegrandslither
            diamond_is_legal
   setup 1x4 1x4
      array [ZM0N ZM3N ZM2N ZM1N]
            alternate_definition [3x3] c4
   setup 1x6 1x6 qualifier wave_only
      array [ZM0N ZM5N ZM1N ZM3N ZM2N ZM4N]
   setup 1x6 1x6 qualifier 3x3_2fl_only
      array [ZM0N ZM2N ZM4N ZM3N ZM5N ZM1N]
            alternate_definition [4x4] c4
   setup 1x8 1x8 qualifier wave_only
      array [ZM0N ZM6N ZM7N ZM1N ZM4N ZM2N ZM3N ZM5N]
   setup 1x8 1x8 qualifier 4x4_2fl_only
      array [ZM0N ZM3N ZM5N ZM6N ZM4N ZM7N ZM1N ZM2N]
            alternate_definition [grand] c3a
   setup 1x6 1x6
      array [ZM0N ZM2N ZM1N ZM3N ZM5N ZM4N]
   setup 1x8 1x8
      array [ZM0N ZM3N ZM6N ZM1N ZM4N ZM7N ZM2N ZM5N]
            alternate_definition [twisted] c4
   setup 1x4 dmd
      array [ZM0N AM1W ZM2N CM1E]
            alternate_definition [diamond] c3a
   setup qtag qtag
      array [0 0 ZM2N ZM7N 0 0 ZM6N ZM3N]
   setup pqtag qtag
      array [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]

call "swing/slip" dontshow tag swingslip
            step_to_wave
   setup 1x4 1x4
      array [CCAL3N AL0S AACR1N CR2S]

call "swing/slip" dontshow tag waveswingslip
            left_means_touch_or_check step_to_wave yoyo_is_inherited gen_sting_is_inherited grand_is_inherited
   seq swing [inherit_yoyo inherit_gensting]
   seq maybegrandslip [inherit_grand roll_transparent]

call "_rightable left swing thru" dontshow tag rightable_left_swing_thru
            left_means_mirror yoyo_is_inherited gen_sting_is_inherited grand_is_inherited
   seq rightable_left_touch [inherit_left]
   seq swing [inherit_yoyo inherit_gensting]
   seq maybegrandslip [inherit_grand roll_transparent]

call "_rightable left spin the top" dontshow tag rightable_left_spinthetop
            left_means_mirror yoyo_is_inherited gen_sting_is_inherited cross_is_inherited fractal_is_inherited
   seq rightable_left_touch [inherit_left]
   seq swing [inherit_yoyo inherit_gensting]
   seq fanthetop_maybe_cross [inherit_cross inherit_fractal]

/* This is here explicitly so that we don't need to give a direction.
   The parser gives it precedence over the use of the "central" concept, of course. */
call "central spin the windmill" c3 tag ctrwindmill
            left_means_touch_or_check step_to_wave visible_fractions
            yoyo_is_inherited gen_sting_is_inherited grand_is_inherited fractal_is_inherited
   seq trade_or_swing_half [inherit_yoyo inherit_gensting]
   seq maybegrandslip [inherit_grand inherit_yoyo inherit_gensting roll_transparent]
   seq cast_off_n4_with_warn [inherit_fractal inherit_gensting insert_number 3]

call "_centers @0 the windmill" dontshow tag ctr_any_windmill
            fractal_is_inherited gen_sting_is_inherited
   seq nullcall [mandatory_anycall]
   seq cast_off_n4_with_warn [inherit_fractal inherit_gensting insert_number 3]

call "_outsides face @h" dontshow tag set_windmill_direction
   maybesingleconc nullcall [] quarter_maybe [endscando]

call "_finish spin the windmill, circ @9" dontshow tag finish_windmill
            neednumber left_means_mirror yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   maybesingleconc ctrwindmill [inherit_left inherit_yoyo inherit_gensting inherit_fractal]
                   circ_n_times [conc_demand_lines conc_force_lines endscando]

call "_finish @0 the windmill, circ @9" dontshow tag finish_any_windmill
            neednumber fractal_is_inherited gen_sting_is_inherited
   maybesingleconc ctr_any_windmill [inherit_fractal inherit_gensting]
                   circ_n_times [conc_demand_lines conc_force_lines endscando]

call "_finish nothing the windmill, circ @9" dontshow tag finish_nothing_windmill
            neednumber fractal_is_inherited gen_sting_is_inherited
   maybesingleconc cast_off_n4_with_warn [inherit_fractal inherit_gensting insert_number 3]
                   circ_n_times [conc_demand_lines conc_force_lines endscando]

call "_finish spin the windmill, circ @9-1/2" dontshow tag finish_windmill_and_a_half
            neednumber left_means_mirror yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   maybesingleconc ctrwindmill [inherit_left inherit_yoyo inherit_gensting inherit_fractal]
                   circ_n_times_and_a_half [conc_demand_lines conc_force_lines endscando]

call "_finish @0 the windmill, circ @9-1/2" dontshow tag finish_any_windmill_and_a_half
            neednumber fractal_is_inherited gen_sting_is_inherited
   maybesingleconc ctr_any_windmill [inherit_fractal inherit_gensting]
                   circ_n_times_and_a_half [conc_demand_lines conc_force_lines endscando]

call "_finish nothing the windmill, circ @9-1/2" dontshow tag finish_nothing_windmill_and_a_half
            neednumber fractal_is_inherited gen_sting_is_inherited
   maybesingleconc cast_off_n4_with_warn [inherit_fractal inherit_gensting insert_number 3]
                   circ_n_times_and_a_half [conc_demand_lines conc_force_lines endscando]

call "spin the windmill, outsides @h" a2
            sequence_starter left_means_mirror yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq set_windmill_direction []
   seq finish_windmill [inherit_left inherit_yoyo inherit_gensting inherit_fractal insert_number 2]

call "spin the windmill, outsides go as you are" a2
            sequence_starter left_means_mirror yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq finish_windmill [inherit_left inherit_yoyo inherit_gensting inherit_fractal insert_number 2]

call "@0 the windmill, outsides @h" c1
   // This one if the <anything> is a 4-person call for the centers.
            sequence_starter fractal_is_inherited gen_sting_is_inherited
   seq set_windmill_direction []
   seq finish_any_windmill [inherit_fractal inherit_gensting insert_number 2]
   // This one if the <anything> is an 8-person call.
            sequence_starter fractal_is_inherited gen_sting_is_inherited
   seq nullcall [mandatory_anycall]
   seq set_windmill_direction []
   seq finish_nothing_windmill [inherit_fractal inherit_gensting insert_number 2]

call "spin the windmill, outsides @h and go @9 positions" a2
            sequence_starter neednumber left_means_mirror yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq set_windmill_direction []
   seq finish_windmill [inherit_left inherit_yoyo inherit_gensting inherit_fractal]

call "spin the windmill, outsides go @9 positions as you are" a2
            sequence_starter neednumber left_means_mirror yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq finish_windmill [inherit_left inherit_yoyo inherit_gensting inherit_fractal]

call "@0 the windmill, outsides @h and go @9 positions" c1
   // This one if the <anything> is a 4-person call for the centers.
            sequence_starter fractal_is_inherited gen_sting_is_inherited neednumber
   seq set_windmill_direction []
   seq finish_any_windmill [inherit_fractal inherit_gensting]
   // This one if the <anything> is an 8-person call.
            sequence_starter fractal_is_inherited gen_sting_is_inherited
   seq nullcall [mandatory_anycall]
   seq set_windmill_direction []
   seq finish_nothing_windmill [inherit_fractal inherit_gensting]

call "@0 the windmill, outsides go @9 positions as you are" c1
   // This one if the <anything> is a 4-person call for the centers.
            sequence_starter fractal_is_inherited gen_sting_is_inherited neednumber
   seq finish_any_windmill [inherit_fractal inherit_gensting]
   // This one if the <anything> is an 8-person call.
            sequence_starter fractal_is_inherited gen_sting_is_inherited
   seq nullcall [mandatory_anycall]
   seq finish_nothing_windmill [inherit_fractal inherit_gensting]

call "spin the windmill, outsides @h and go @9-1/2 positions" a2
            sequence_starter neednumber left_means_mirror yoyo_is_inherited gen_sting_is_inherited
   seq set_windmill_direction []
   seq finish_windmill_and_a_half [inherit_left inherit_yoyo inherit_gensting]

call "spin the windmill, outsides go @9-1/2 positions as you are" a2
            sequence_starter neednumber left_means_mirror yoyo_is_inherited gen_sting_is_inherited
   seq finish_windmill_and_a_half [inherit_left inherit_yoyo inherit_gensting]

call "@0 the windmill, outsides @h and go @9-1/2 positions" c1
   // This one if the <anything> is a 4-person call for the centers.
            sequence_starter fractal_is_inherited gen_sting_is_inherited neednumber
   seq set_windmill_direction []
   seq finish_any_windmill_and_a_half [inherit_fractal inherit_gensting]
   // This one if the <anything> is an 8-person call.
            sequence_starter fractal_is_inherited gen_sting_is_inherited
   seq nullcall [mandatory_anycall]
   seq set_windmill_direction []
   seq finish_nothing_windmill_and_a_half [inherit_fractal inherit_gensting]

call "@0 the windmill, outsides go @9-1/2 positions as you are" c1
   // This one if the <anything> is a 4-person call for the centers.
            sequence_starter fractal_is_inherited gen_sting_is_inherited neednumber
   seq finish_any_windmill_and_a_half [inherit_fractal inherit_gensting]
   // This one if the <anything> is an 8-person call.
            sequence_starter fractal_is_inherited gen_sting_is_inherited
   seq nullcall [mandatory_anycall]
   seq finish_nothing_windmill_and_a_half [inherit_fractal inherit_gensting]

call "spin the windmill, outsides @m" a2
            sequence_starter left_means_mirror yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   maybesingleconc ctrwindmill [inherit_left inherit_yoyo inherit_gensting inherit_fractal]
                   nullsecond [mandatory_secondary_call]

call "@0 the windmill, outsides @m" c1
            sequence_starter fractal_is_inherited gen_sting_is_inherited
   maybesingleconc ctr_any_windmill [inherit_fractal inherit_gensting] nullsecond [mandatory_secondary_call]

// This call is somewhat ambiguous, and has been declared "obsolete" in Ceder Chest.
call "rotary spin the windmill" c2
            first_part_visible dont_use_in_resolve left_means_mirror
            magic_is_inherited twisted_is_inherited
   seq passthru [inherit_left inherit_magic inherit_twisted]
   seq rotary [inherit_left force_straight]  // Not really straight; this is just a cookie to raise a warning.
   seq finish_windmill [insert_number 2]

call "partner tag" a1 tag partnertag
            left_means_mirror
   setup 1x2 1x2
      array [CM1E AM0W]
            alternate_definition [funny] c2
   setup 2x2 2x2
      predscantdocallinsetup
         if 2x2_miniwave [CM1E AM0W AM3W CM2E]
         if 2x2_couple   [CM1E AM0W AM3W CM2E]
         if always       [ZM0N ZM1N ZM2N ZM3N]
            alternate_definition [reflect] c4
   setup 1x2 1x2 rotate
      array [CM1E ACM0W]

// This call makes divide the ocean illegal from riggers.
call "_partner tag by pairs" dontshow tag partnertagbypairs
   setup 2x2 2x2
      array [CM1E AM0W AM3W CM2E]
            alternate_definition [single] c3
   setup 1x2 1x2
      array [CM1E AM0W]

call "lockit" a1 tag lockit
            ends_take_right_hands
   setup 1x4 1x4 rotate no_cutting_through
      array [CR0N CR1N AL0S AL1S]
   setup dmd dmd rotate
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate
      array [0 CR1N 0 AL1S]
            alternate_definition [fractal] c4
   setup 1x4 1x4 rotate no_cutting_through
      array [CR0N CR3S AL0S AL3N]
   setup dmd dmd rotate
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate
      array [0 CR3S 0 AL3N]
            alternate_definition [stingy] c3
   setup 1x4 dmd rotate no_cutting_through
      array [CR0N ZM3W AL0S ZM1W]
   setup dmd 1x4 rotate
      array [CR0N 0 AL0S 0]
   setup pmd 1x4 rotate
      array [0 ZM1W 0 ZM3W]
            alternate_definition [generous] c3
   setup 1x4 dmd rotate no_cutting_through
      array [CR0N CR1E AL0S AL3E]
   setup dmd 1x4 rotate
      array [CR0N 0 AL0S 0]
   setup pmd 1x4 rotate
      array [0 CR3E 0 AL1E]
            alternate_definition [cross] c3
   setup 1x4 1x4 rotate
      array [CR1N CR0N AL1S AL0S]
            alternate_definition [cross fractal] c4
   setup 1x4 1x4 rotate
      array [CR1N CR2S AL1S AL2N]
            alternate_definition [grand] c4
   setup 1x8 3x4 rotate
      array [CR9N CR8N CR11N AL8S AL0S AL1S AL11S CR1N]
            alternate_definition [3x3] c4
   setup 1x6 1x6 rotate
      array [CR0N CR1N CR2N AL0S AL1S AL2S]
            alternate_definition [4x4] c4
   setup 1x8 1x8 rotate
      array [CR0N CR1N CR2N CR3N AL0S AL1S AL2S AL3S]
            alternate_definition [cross 3x3] c4
   setup 1x6 1x6 rotate
      array [CR2N CR1N CR0N AL2S AL1S AL0S]
            alternate_definition [cross 4x4] c4
   setup 1x8 1x8 rotate
      array [CR2N CR3N CR0N CR1N AL2S AL3S AL0S AL1S]
            alternate_definition [half] c1
   setup 1x4 thar plus_eighth_rotation
      array [CR0N CR1N AL2W AL3W]
   setup dmd thar plus_eighth_rotation
      array [CR0N 0 AL2W 0]
   setup pmd thar plus_eighth_rotation
      array [0 CR3N 0 AL5W]

call "lock it" a1
   alias lockit

call "_cross lockit" dontshow tag crosslockit
            ends_take_right_hands
   // This isn't really presented as a call (the actual call cross lockit is above),
   // but is used for square thru and similar things.  As such, you can't roll.
   setup 1x4 1x4 rotate
      array [C1N C0N A1S A0S]

call "fan the top" plus tag fanthetop
            step_to_wave left_means_touch_or_check ends_take_right_hands
   setup 1x4 1x4 rotate no_cutting_through
      array [CR0N CR3S AL0S AL3N]
   setup dmd dmd rotate
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate
      array [0 CR3S 0 AL3N]
            alternate_definition [fractal] c4
   setup 1x4 1x4 rotate no_cutting_through
      array [CR0N CR1N AL0S AL1S]
            alternate_definition [grand] c3
   setup 1x8 3x4 rotate
      array [CR9N CR7S CR5S AL7N AL0S AL2N AL5N CR2S]
   setup 3x4 1x8 rotate
      array [CR0N CR3S AL3N AL0S 0 AL6N 0 AL5N CR5S 0 0 CR6S]
            alternate_definition [stingy] c3
   setup 1x4 dmd rotate no_cutting_through
      array [CR0N CR1E AL0S AL3E]
   setup dmd 1x4 rotate
      array [CR0N 0 AL0S 0]
   setup pmd 1x4 rotate
      array [0 CR3E 0 AL1E]
            alternate_definition [generous] c3
   setup 1x4 dmd rotate no_cutting_through
      array [CR0N CR3W AL0S AL1W]
   setup dmd 1x4 rotate
      array [CR0N 0 AL0S 0]
   setup pmd 1x4 rotate
      array [0 CR1W 0 AL3W]
            alternate_definition [half] c1
   setup 1x4 thar plus_eighth_rotation qualifier live none
      array [CR0N CR3E AL2W AL1S]
   setup dmd thar plus_eighth_rotation qualifier live none
      array [CR0N 0 AL2W 0]
   setup pmd thar plus_eighth_rotation qualifier live none
      array [0 CR5E 0 AL3S]
   // To allow the centers to do only part of the cast off 3/4.
            step_to_wave left_means_touch_or_check gen_sting_is_inherited visible_fractions
   singleconc cast_off_n4_with_warn [inherit_gensting insert_number 3] hinge []

call "_fan the top (maybe cross)" dontshow tag fanthetop_maybe_cross
            step_to_wave left_means_touch_or_check ends_take_right_hands
   setup 1x4 1x4 rotate no_cutting_through
      array [CR0N CR3S AL0S AL3N]
            alternate_definition [cross] c3
   setup 1x4 1x4 rotate no_cutting_through
      array [CR1N CR2S AL1S AL2N]
            alternate_definition [fractal] c4
   setup 1x4 1x4 rotate no_cutting_through
      array [CR0N CR1N AL0S AL1S]
            alternate_definition [cross fractal] c4
   setup 1x4 1x4 rotate no_cutting_through
      array [CR1N CR0N AL1S AL0S]

call "@6@C run the top" c4a
            visible_fractions cross_is_inherited fractal_is_inherited gen_sting_is_inherited yield_if_ambiguous
   seq anyonerun [inherit_cross]
   seq fanthetop [inherit_fractal inherit_gensting]

// Callers say "centers [cross] run the top" in a 1x8, and the usual
// meaninglessness of "centers" doesn't apply.  For this call, "centers"
// means centers of each 1x4.
call "centers@C run the top" c4a
            visible_fractions cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq ctrrun [inherit_cross]
   seq fanthetop [inherit_fractal inherit_gensting]

call "fan the top (line)" dontshow tag linefanthetop
            ends_take_right_hands
   setup 1x4 1x4 rotate no_cutting_through
      array [CR0N CR3S AL0S AL3N]
            alternate_definition [fractal] c4
   setup 1x4 1x4 rotate no_cutting_through
      array [CR0N CR1N AL0S AL1S]
            alternate_definition [stingy] c3
   setup 1x4 dmd rotate no_cutting_through
      array [CR0N CR1E AL0S AL3E]
            alternate_definition [generous] c3
   setup 1x4 dmd rotate no_cutting_through
      array [CR0N CR3W AL0S AL1W]

call "fan the top (diamond)" dontshow tag dmdfanthetop
            ends_take_right_hands
   setup dmd dmd rotate no_cutting_through
      array [CR0N 0    AL0S 0]
   setup pmd dmd rotate no_cutting_through
      array [0    CR3S 0    AL3N]
            alternate_definition [fractal] c4
   setup dmd dmd rotate no_cutting_through
      array [CR0N 0    AL0S 0]
   setup pmd dmd rotate no_cutting_through
      array [0    CR1N 0    AL1S]
            alternate_definition [stingy] c3
   setup dmd 1x4 rotate
      array [CR0N 0 AL0S 0]
   setup pmd 1x4 rotate
      array [0 CR3E 0 AL1E]
            alternate_definition [generous] c3
   setup dmd 1x4 rotate
      array [CR0N 0 AL0S 0]
   setup pmd 1x4 rotate
      array [0 CR1W 0 AL3W]

call "fan the top (pushy)" dontshow tag pushyfanthetop
            ends_take_right_hands
   setup 1x8 2x4 rotate qualifier dmd_ctrs_mwv
      array [CR7N CR5S AL7S AL5N AL0S AL2N CR0N CR2S]
   setup 1x8 2x4 rotate
      array [CR7N AL6N AL7S AL5N AL0S CR1S CR0N CR2S]
            alternate_definition [fractal] c4
   setup 1x8 2x4 rotate qualifier dmd_ctrs_mwv
      array [CR7N CR6N AL7S AL6S AL0S AL1S CR0N CR1N]
   setup 1x8 2x4 rotate
      array [CR7N AL5S AL7S AL6S AL0S CR2N CR0N CR1N]

call "spin the top" mainstream tag spinthetop
            step_to_wave can_be_fan left_means_touch_or_check
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited grand_is_inherited visible_fractions
   seq checkawaventrade [inherit_yoyo inherit_gensting]
   seq fanthetop [inherit_grand inherit_fractal inherit_gensting]

call "reverse the top" c3
            step_to_wave left_means_touch_or_check
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited grand_is_inherited visible_fractions
   seq fanthetop [inherit_grand inherit_fractal inherit_gensting]
   seq trade [inherit_yoyo inherit_gensting]

call "cross the top" c4
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            can_be_fan left_means_touch_or_check first_part_visible
   seq trade [inherit_yoyo inherit_gensting]
   seq fanthetop_maybe_cross [force_cross inherit_fractal inherit_gensting]

call "spin the yoyo" c4x
            dont_use_in_resolve
            step_to_wave left_means_touch_or_check fractal_is_inherited gen_sting_is_inherited
   seq armturn_n4 [inherit_fractal inherit_gensting insert_number 3]
   seq fanthetop [inherit_gensting inherit_fractal]

call "jay walk" c1 tag jaywalk
   partnermatrix find_jaywalkers
      [ZM16N 16 ZM16N 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0]

call "jaywalk" c1
   alias jaywalk

call "@6 jay walk" c1 tag anyone_jaywalk
   partnermatrix use_selector ignore_nonselectees find_jaywalkers
      [ZM16N 16 ZM16N 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0]

call "@6 jaywalk" c1
   alias anyone_jaywalk

call "jay touch 1/4" c3a
   partnermatrix find_jaywalkers
      [CR16E 16 CR16E 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0]

call "@6 jay touch 1/4" c3a
   partnermatrix use_selector ignore_nonselectees find_jaywalkers
      [CR16E 16 CR16E 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0]

call "jay slide thru" c3a
   partnermatrix find_jaywalkers
      [CR16E 16 AL16W 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0]

call "@6 jay slide thru" c3a
   partnermatrix use_selector ignore_nonselectees find_jaywalkers
      [CR16E 16 AL16W 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0]

call "@6 shove off" c4a
   partnermatrix use_selector stop_and_warn_on_tbone
      [ZGM20N 16 ZGM20N 16 ZFM12N 16 ZFM12N 16 AGL12S 16 AGL12S 16 CFR20S 16 CFR20S 16
      0 0 0 0 0 0 0 0]

call "@6 1/2 shove off" c4a
   partnermatrix use_selector stop_and_warn_on_tbone
      [ZGM18N 16 ZGM18N 16 ZFM14N 16 ZFM14N 16 AGL14W 16 AGL14W 16 CFR18E 16 CFR18E 16
      0 0 0 0 0 0 0 0]

call "@6 tow truck" c4
   partnermatrix use_selector stop_and_warn_on_tbone
      [ZGM20N 16 ZGM20N 16 ZFM12N 16 ZFM12N 16 ZFM12N 16 0 0 ZGM20N 16
      0 0 0 0 0 0 0 0]

call "@6 1/2 tow truck" c4
   partnermatrix use_selector stop_and_warn_on_tbone
      [ZGM18N 16 ZGM18N 16 ZFM14N 16 ZFM14N 16 ZFM14N 16 0 0 ZGM18N 16
      0 0 0 0 0 0 0 0]

call "@6 reverse tow truck" c4
   partnermatrix use_selector stop_and_warn_on_tbone
      [ZGM20N 16 ZGM20N 16 ZFM12N 16 ZFM12N 16 0 ZFM12N 16 ZGM20N 16 0
      0 0 0 0 0 0 0 0]

call "@6 1/2 reverse tow truck" c4
   partnermatrix use_selector stop_and_warn_on_tbone
      [ZGM18N 16 ZGM18N 16 ZFM14N 16 ZFM14N 16 0 ZFM14N 16 ZGM18N 16 0
      0 0 0 0 0 0 0 0]

/* This is somewhat pathetic, but people have used this call with "own the anyone",
   in which the phantoms that remained when the other people left the room were
   not considered sufficiently real to make the "partnermatrix" schema work
   properly.  We need to think carefully about just how empty the empty chairs
   are during an "own the anyone" call.  Not to mention "multiple formations
   working".  A major upheaval looms on the horizon. */
call "leads run the wheel" c4a
   setup 2x2 2x2
      array [CR3W AL2E AL3E CR2W]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate restriction forbidden wave_only
      array [CR1S AL1N]
            alternate_definition [3x3] c4
   setup 3x2 2x3 rotate restriction forbidden wave_only
      array [CR3S CR4S CR5S AL3N AL4N AL5N]
            alternate_definition [4x4] c4
   setup 4x2 2x4 rotate restriction forbidden wave_only
      array [CR4S CR5S CR6S CR7S AL4N AL5N AL6N AL7N]

call "@6 run the wheel" c4a
            yield_if_ambiguous
   partnerpartialmatrix use_selector stop_and_warn_on_tbone
      [CR20W 16 CR20W 16 AL12E 16 AL12E 16 CR16W 12 CR16W 12 AL16E 12 AL16E 12
      0 0 0 0 0 0 0 0]
            yield_if_ambiguous
   setup 2x2 2x2
      predscantdocallinsetup
         if select [CR3W AL2E    0    0]
         if always [CR1W AL0E AL3E CR2W]

call "bridge the gap" c4a
   partnerpartialmatrix tbone_is_ok include_phantoms not_true_invader
      [ZM12N 20 ZM12N 20 AL12S 20 AL12S 20 0 0 0 0 0 0 0 0 0 0 0 0]
   setup 4x2 2x4 rotate
      array [ZM7W ZM0W 0 0 0 0 AL1E AL6E]
            alternate_definition [generous] c3
   setup 4x2 qtag
      array [ZM0N ZM1N 0 0 0 0 AL3E AL6E]
            alternate_definition [stingy] c3
   setup 4x2 qtag
      array [ZM0N ZM1N 0 0 0 0 AL2W AL7W]
            alternate_definition [yoyo] c4
   setup 4x2 qtag
      array [ZM0N ZM1N 0 0 0 0 AL3E AL6E]
            alternate_definition [single] c4
   setup 2x2 1x4
      array [0 0 AL1S ZM0N]
            alternate_definition [3x3] c4
   setup 6x2 3x4 rotate
      array [ZM9W ZM10W ZM0W 0 0 0 0 0 0 AL1E AL11E AL8E]
            alternate_definition [4x4] c4
   setup 8x2 4x4
      array [ZM12N ZM13N ZM14N ZM0N 0 0 0 0 0 0 0 0 AL1S AL3S AL15S AL10S]
            alternate_definition [half] c4a
   setup 4x2 2x4 rotate
      array [0 0 0 0 0 0 ZM2W ZM5W]

call "@6 @eright@f anchor 1/4" c4
   left_means_mirror partnermatrix use_selector ignore_nonselectees must_face_same_way
      [0 0 0 0 CR20E 20 CR20E 20 CR16E 16 CR16E 16 0 0 0 0 0 0 0 0]

call "@6 @eright@f anchor 1/2" c4
   left_means_mirror partnermatrix use_selector ignore_nonselectees must_face_same_way
      [0 0 0 0 CR24S 16 CR24S 16 CR16S 16 CR16S 16 0 0 0 0 0 0 0 0]

call "@6 @eright@f anchor 3/4" c4
   left_means_mirror partnermatrix use_selector ignore_nonselectees must_face_same_way
      [0 0 0 0 CR20W 12 CR20W 12 CR16W 16 CR16W 16 0 0 0 0 0 0 0 0]

call "@eright@f anchor 1/4" c4
   left_means_mirror partnermatrix must_face_same_way
      [CR20E 20 CR20E 20 CR16E 16 CR16E 16 0 0 0 0 0 0 0 0 0 0 0 0]
            left_means_mirror
   setup 2x2 2x2
      array [0 0 CR2E CR1E]

call "@eright@f anchor 1/2" c4
   left_means_mirror partnermatrix must_face_same_way
      [CR24S 16 CR24S 16 CR16S 16 CR16S 16 0 0 0 0 0 0 0 0 0 0 0 0]

call "@eright@f anchor 3/4" c4
   left_means_mirror partnermatrix must_face_same_way
      [CR20W 12 CR20W 12 CR16W 16 CR16W 16 0 0 0 0 0 0 0 0 0 0 0 0]
            left_means_mirror no_elongation_allowed
   setup 2x2 2x2
      array [CR2W CR1W 0 0]

call "@6 in anchor 1/4" c4
   partnermatrix lateral_mirror_if_right_of_center use_selector ignore_nonselectees must_face_same_way
      [0 0 0 0 CR20E 20 CR20E 20 CR16E 16 CR16E 16 0 0 0 0 0 0 0 0]

call "@6 in anchor 1/2" c4
   partnermatrix lateral_mirror_if_right_of_center use_selector ignore_nonselectees must_face_same_way
      [0 0 0 0 CR24S 16 CR24S 16 CR16S 16 CR16S 16 0 0 0 0 0 0 0 0]

call "@6 in anchor 3/4" c4
   partnermatrix lateral_mirror_if_right_of_center use_selector ignore_nonselectees must_face_same_way
      [0 0 0 0 CR20W 12 CR20W 12 CR16W 16 CR16W 16 0 0 0 0 0 0 0 0]

call "in anchor 1/4" c4
   partnermatrix lateral_mirror_if_right_of_center must_face_same_way
      [CR20E 20 CR20E 20 CR16E 16 CR16E 16 0 0 0 0 0 0 0 0 0 0 0 0]

call "in anchor 1/2" c4
   partnermatrix lateral_mirror_if_right_of_center must_face_same_way
      [CR24S 16 CR24S 16 CR16S 16 CR16S 16 0 0 0 0 0 0 0 0 0 0 0 0]

call "in anchor 3/4" c4
   partnermatrix lateral_mirror_if_right_of_center must_face_same_way
      [CR20W 12 CR20W 12 CR16W 16 CR16W 16 0 0 0 0 0 0 0 0 0 0 0 0]

call "@6 out anchor 1/4" c4
   partnermatrix lateral_mirror_if_right_of_center use_selector ignore_nonselectees must_face_same_way
      [0 0 0 0 AL16W 16 AL16W 16 AL12W 20 AL12W 20 0 0 0 0 0 0 0 0]

call "@6 out anchor 1/2" c4
   partnermatrix lateral_mirror_if_right_of_center use_selector ignore_nonselectees must_face_same_way
      [0 0 0 0 AL16S 16 AL16S 16 AL8S 16 AL8S 16 0 0 0 0 0 0 0 0]

call "@6 out anchor 3/4" c4
   partnermatrix lateral_mirror_if_right_of_center use_selector ignore_nonselectees must_face_same_way
      [0 0 0 0 AL16E 16 AL16E 16 AL12E 12 AL12E 12 0 0 0 0 0 0 0 0]

call "out anchor 1/4" c4
   partnermatrix lateral_mirror_if_right_of_center must_face_same_way
      [AL16W 16 AL16W 16 AL12W 20 AL12W 20 0 0 0 0 0 0 0 0 0 0 0 0]

call "out anchor 1/2" c4
   partnermatrix lateral_mirror_if_right_of_center must_face_same_way
      [AL16S 16 AL16S 16 AL8S 16 AL8S 16 0 0 0 0 0 0 0 0 0 0 0 0]

call "out anchor 3/4" c4
   partnermatrix lateral_mirror_if_right_of_center must_face_same_way
      [AL16E 16 AL16E 16 AL12E 12 AL12E 12 0 0 0 0 0 0 0 0 0 0 0 0]

call "@6 squeeze" c1
            dont_use_in_resolve
   partnermatrix use_selector ignore_nonselectees stop_and_warn_on_tbone find_squeezers

   //                   near
   //          right B  right G  left B   left G
      [0 0 0 0 CM24S 16 CM24S 16 AM8S 16 AM8S 16
   //                   far
   //          right B  right G  left B   left G
       0 0 0 0 CR24S 16 CR24S 16 AL8S 16 AL8S 16 ]

            alternate_definition [generous] c3
   //                   near
   //          right B  right G  left B   left G
      [0 0 0 0 CM18W 10 CM18W 10 AM14E 10 AM14E 10
   //                   far
   //          right B  right G  left B   left G
       0 0 0 0 CR22W 15 CR22W 15 AL10E 15 AL10E 15]

            alternate_definition [stingy] c3
   //                   near
   //          right B  right G  left B   left G
      [0 0 0 0 CM18E 22 CM18E 22 AM14W 22 AM14W 22
   //                   far
   //          right B  right G  left B   left G
       0 0 0 0 CR22E 17 CR22E 17 AL10W 17 AL10W 17]

            alternate_definition [half] c1
      [0 0 0 0 CR20S 16 CR20S 16 AL12S 16 AL12S 16  // close: trade but do not slide
       0 0 0 0 ZM20N 16 ZM20N 16 ZM12N 16 ZM12N 16] // far: slide but do not trade
            alternate_definition [lasthalf] c1
      [0 0 0 0 CR20S 16 CR20S 16 AL12S 16 AL12S 16  // close: trade
       0 0 0 0 0 0 0 0]                             // far: not allowed

call "squeeze" c1
            dont_use_in_resolve
   partnermatrix stop_and_warn_on_tbone find_squeezers
      [CM24S 16 CM24S 16 AM8S 16 AM8S 16 0 0 0 0
       CR24S 16 CR24S 16 AL8S 16 AL8S 16 0 0 0 0]
            alternate_definition [half] c1
      [CR20S 16 CR20S 16 AL12S 16 AL12S 16 0 0 0 0  // close: trade but do not slide
       ZM20N 16 ZM20N 16 ZM12N 16 ZM12N 16 0 0 0 0] // far: slide but do not trade
            alternate_definition [lasthalf] c1
      [CR20S 16 CR20S 16 AL12S 16 AL12S 16 0 0 0 0  // close: trade
       0 0 0 0 0 0 0 0]                             // far: not allowed

call "@6 start a squeeze" c1
            dont_use_in_resolve
   /* Beware!  This isn't quite right. */
   setup 4x4 4x4
      predscantdocallinsetup
         if select               [AL13S AL15S AL11S ZM10S AL6S ZM8S ZM4S ZM9S CR5S CR7S CR3S ZM2S CR14S ZM0S ZM12S ZM1S]
         if semi_squeezer_select [0 0 0 AL15S 0 AL6S CR5S AL11S 0 0 0 CR7S 0 CR14S AL13S CR3S]
         if always               [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N ZM10N ZM11N ZM12N ZM13N ZM14N ZM15N]

call "@6 like a squeeze" c1    /* Not right!  Testing purposes only! */
            dont_use_in_resolve
   partnermatrix use_selector ignore_nonselectees stop_and_warn_on_tbone find_spreaders
      [0 0 0 0 ZM12N 16 ZM12N 16 ZM20N 16 ZM20N 16 0 0 0 0 0 0 0 0]

call "@6 quarter right" mainstream
            dont_use_in_resolve
   matrix use_selector [CR16E 16 CR16E 16]

call "@6 quarter left" mainstream
            dont_use_in_resolve
   matrix use_selector [AL16W 16 AL16W 16]

call "@6 1/4 right" mainstream
            dont_use_in_resolve
   matrix use_selector [CR16E 16 CR16E 16]

call "@6 1/4 left" mainstream
            dont_use_in_resolve
   matrix use_selector [AL16W 16 AL16W 16]

call "@6 face right" mainstream
            dont_use_in_resolve
   matrix use_selector [CR16E 16 CR16E 16]

call "@6 face left" mainstream
            dont_use_in_resolve
   matrix use_selector [AL16W 16 AL16W 16]

call "press ahead" mainstream
            dont_use_in_resolve
   matrix [ZM16N 20 ZM16N 20]
            alternate_definition [half] mainstream
   [ZM16N 18 ZM16N 18]

call "1/2 press ahead" mainstream
            dont_use_in_resolve
   matrix [ZM16N 18 ZM16N 18]

call "@6 press ahead" mainstream
            dont_use_in_resolve
   matrix use_selector [ZM16N 20 ZM16N 20]
            alternate_definition [half] mainstream
   [ZM16N 18 ZM16N 18]

call "@6 1/2 press ahead" mainstream
            dont_use_in_resolve
   matrix use_selector [ZM16N 18 ZM16N 18]

call "press back" mainstream
            dont_use_in_resolve
   matrix [ZM16N 12 ZM16N 12]
            alternate_definition [half] mainstream
   [ZM16N 14 ZM16N 14]

call "1/2 press back" mainstream
            dont_use_in_resolve
   matrix [ZM16N 14 ZM16N 14]

call "@6 press back" mainstream
            dont_use_in_resolve
   matrix use_selector [ZM16N 12 ZM16N 12]
            alternate_definition [half] mainstream
   [ZM16N 14 ZM16N 14]

call "@6 1/2 press back" mainstream
            dont_use_in_resolve
   matrix use_selector [ZM16N 14 ZM16N 14]

call "press right" mainstream
            dont_use_in_resolve
   matrix [ZGM20N 20 ZGM20N 20]
            alternate_definition [half] mainstream
   [ZGM18N 18 ZGM18N 18]

call "@6 press right" mainstream
            dont_use_in_resolve
   matrix use_selector [ZGM20N 20 ZGM20N 20]
            alternate_definition [half] mainstream
   [ZGM18N 18 ZGM18N 18]

call "press left" mainstream
            dont_use_in_resolve
   matrix [ZFM12N 20 ZFM12N 20]
            alternate_definition [half] mainstream
   [ZFM14N 18 ZFM14N 18]

call "@6 press left" mainstream
            dont_use_in_resolve
   matrix use_selector [ZFM12N 20 ZFM12N 20]
            alternate_definition [half] mainstream
   [ZFM14N 18 ZFM14N 18]

call "press in" mainstream
            dont_use_in_resolve
   matrix lateral_mirror_if_right_of_center [ZGM20N 20 ZGM20N 20]
            alternate_definition [half] mainstream
   [ZGM18N 18 ZGM18N 18]

call "@6 press in" mainstream
            dont_use_in_resolve
   matrix use_selector lateral_mirror_if_right_of_center [ZGM20N 20 ZGM20N 20]
            alternate_definition [half] mainstream
   [ZGM18N 18 ZGM18N 18]

call "press out" mainstream
            dont_use_in_resolve
   matrix lateral_mirror_if_right_of_center [ZFM12N 20 ZFM12N 20]
            alternate_definition [half] mainstream
   [ZFM14N 18 ZFM14N 18]

call "@6 press out" mainstream
            dont_use_in_resolve
   matrix use_selector lateral_mirror_if_right_of_center [ZFM12N 20 ZFM12N 20]
            alternate_definition [half] mainstream
   [ZFM14N 18 ZFM14N 18]

call "@6 cast back to the right" c1
            dont_use_in_resolve
   matrix use_selector [CR20S 12 CR20S 12]

call "@6 cast back to the left" c1
            dont_use_in_resolve
   matrix use_selector [AL12S 12 AL12S 12]

call "@6 cast back" c1
            dont_use_in_resolve
   matrix use_selector lateral_mirror_if_right_of_center [AL12S 12 AL12S 12]

call "@6 cross cast back" c1
            dont_use_in_resolve
   matrix use_selector lateral_mirror_if_right_of_center [CR24S 12 CR24S 12]

call "truck" c2
            dont_use_in_resolve reverse_means_mirror
   matrix [ZFM12N 16 ZGM20N 16]
            alternate_definition [half] c2
          [ZFM14N 16 ZGM18N 16]

call "1/2 truck" c2
            dont_use_in_resolve reverse_means_mirror
   matrix [ZFM14N 16 ZGM18N 16]

call "@6 truck" c2
            dont_use_in_resolve reverse_means_mirror
   matrix use_selector [ZFM12N 16 ZGM20N 16]
            alternate_definition [half] c2
                       [ZFM14N 16 ZGM18N 16]

call "@6 1/2 truck" c2
            dont_use_in_resolve reverse_means_mirror
   matrix use_selector [ZFM14N 16 ZGM18N 16]

call "reverse truck" c2
            dont_use_in_resolve
   matrix [ZGM20N 16 ZFM12N 16]
            alternate_definition [half] c2
          [ZGM18N 16 ZFM14N 16]

call "1/2 reverse truck" c2
            dont_use_in_resolve
   matrix [ZGM18N 16 ZFM14N 16]

call "@6 reverse truck" c2
            dont_use_in_resolve
   matrix use_selector [ZGM20N 16 ZFM12N 16]

call "@6 1/2 reverse truck" c2
            dont_use_in_resolve
   matrix use_selector [ZGM18N 16 ZFM14N 16]

call "E.R.A." c4
            dont_use_in_resolve
   matrix [ZM16N 12 ZM16N 20]
            alternate_definition [half] c4
          [ZM16N 14 ZM16N 18]

call "@6 E.R.A." c4
            dont_use_in_resolve
   matrix use_selector [ZM16N 12 ZM16N 20]

call "@6 1/2 E.R.A." c4
            dont_use_in_resolve
   matrix use_selector [ZM16N 14 ZM16N 18]

call "M.C.P." c4
            dont_use_in_resolve
   matrix [ZM16N 20 ZM16N 12]
            alternate_definition [half] c4
          [ZM16N 18 ZM16N 14]

call "@6 M.C.P." c4
            dont_use_in_resolve
   matrix use_selector [ZM16N 20 ZM16N 12]

call "@6 1/2 M.C.P." c4
            dont_use_in_resolve
   matrix use_selector [ZM16N 18 ZM16N 14]

call "@6 leap frog" c4
            yield_if_ambiguous dont_use_in_resolve
   matrix use_selector [ZM16N 24 ZM16N 24]

call "@6 leap frog @9" c4
            yield_if_ambiguous dont_use_in_resolve neednumber
   matrix add_2n use_selector [ZM16N 20 ZM16N 20]

call "trailers leap frog" c4   // Yeah, we allow this in an appropriate Z.
            dont_use_in_resolve
   setup 3x2 2x3 qualifier true_Z_cw restriction wave_only
      array [0 0 0 0 ZM4N ZM3N]
   setup 3x2 2x3 qualifier true_Z_ccw restriction wave_only
      array [ZM2N ZM1N 0 0 0 0]
   // If not in a Z we use this.
   matrix selector_is_trailers [ZM16N 24 ZM16N 24]

call "right loop @9" c2
            yield_if_ambiguous dont_use_in_resolve neednumber
   matrix add_2n [CR20S 16 CR20S 16]

call "@6 right loop @9" c2
            yield_if_ambiguous dont_use_in_resolve neednumber
   matrix add_2n use_selector [CR20S 16 CR20S 16]

call "left loop @9" c2
            yield_if_ambiguous dont_use_in_resolve neednumber
   matrix add_2n [AL12S 16 AL12S 16]

call "@6 left loop @9" c2
            yield_if_ambiguous dont_use_in_resolve neednumber
   matrix add_2n use_selector [AL12S 16 AL12S 16]

call "in loop @9" c2
            dont_use_in_resolve neednumber
   matrix add_2n lateral_mirror_if_right_of_center [CR20S 16 CR20S 16]

call "@6 in loop @9" c2
            dont_use_in_resolve neednumber
   matrix add_2n use_selector lateral_mirror_if_right_of_center [CR20S 16 CR20S 16]

call "out loop @9" c2
            dont_use_in_resolve neednumber
   matrix add_2n lateral_mirror_if_right_of_center [AL12S 16 AL12S 16]

call "@6 out loop @9" c2
            dont_use_in_resolve neednumber
   matrix add_2n use_selector lateral_mirror_if_right_of_center [AL12S 16 AL12S 16]

call "curve right" c4
            dont_use_in_resolve
   matrix [CR20E 20 CR20E 20]

call "@6 curve right" c4
            dont_use_in_resolve
   matrix use_selector [CR20E 20 CR20E 20]

call "curve left" c4
            dont_use_in_resolve
   matrix [AL12W 20 AL12W 20]

call "@6 curve left" c4
            dont_use_in_resolve
   matrix use_selector [AL12W 20 AL12W 20]

call "curve in" c4
            dont_use_in_resolve
   matrix lateral_mirror_if_right_of_center [CR20E 20 CR20E 20]

call "@6 curve in" c4
            dont_use_in_resolve
   matrix use_selector lateral_mirror_if_right_of_center [CR20E 20 CR20E 20]

call "curve out" c4
            dont_use_in_resolve
   matrix lateral_mirror_if_right_of_center [AL12W 20 AL12W 20]

call "@6 curve out" c4
            dont_use_in_resolve
   matrix use_selector lateral_mirror_if_right_of_center [AL12W 20 AL12W 20]

call "plus @9" c4 tag plainplus
            dont_use_in_resolve
   matrix use_veer_data use_number [ZFM14N 16 ZGM18N 16]

call "@6 plus @9" c4
            dont_use_in_resolve
   matrix use_selector use_veer_data use_number [ZFM14N 16 ZGM18N 16]

call "@0 plus @9" c4
            neednumber visible_fractions
   seq nullcall [mandatory_anycall]
   seq plainplus []

call "plus @9 (left)" c4 tag plainplusleft
            dont_use_in_resolve
   matrix use_number [ZFM14N 16 ZFM14N 16]

call "@6 plus @9 (left)" c4
            dont_use_in_resolve
   matrix use_selector use_number [ZFM14N 16 ZFM14N 16]

call "@0 plus @9 (left)" c4
            neednumber visible_fractions
   seq nullcall [mandatory_anycall]
   seq plainplusleft []

call "plus @9 (right)" c4 tag plainplusright
            dont_use_in_resolve
   matrix use_number [ZGM18N 16 ZGM18N 16]

call "@6 plus @9 (right)" c4
            dont_use_in_resolve
   matrix use_selector use_number [ZGM18N 16 ZGM18N 16]

call "@0 plus @9 (right)" c4
            neednumber visible_fractions
   seq nullcall [mandatory_anycall]
   seq plainplusright []

call "@6 roll" plus tag anyoneroll
            dont_use_in_nice_resolve
   rolldefine

call "roll" plus tag roll
            dont_use_in_nice_resolve one_person_call
   rolldefine
            dont_use_in_nice_resolve one_person_call
   setup 1x1 1x1 qualifier alwaysfail   // We don't use the plain definition.
      array [0]
            alternate_definition [half] plus
   setup 1x1 1x1 plus_eighth_rotation
      preds "Roll not permitted after previous call."
         if roll_is_cw  [CR0N]
         if roll_is_ccw [AL0W]
            alternate_definition [lasthalf] plus
   setup 1x1 1x1 plus_eighth_rotation
      preds "Roll not permitted after previous call."
         if roll_is_cw  [CR0N]
         if roll_is_ccw [AL0W]

call "roll @b times" dontshow tag roll_n
            neednumber
   seq roll [repeat_n]

call "@0 and roll" plus
            visible_fractions diamond_is_legal
            dont_use_in_resolve
   seq nullcall [mandatory_anycall inherit_diamond]
   seq roll []

call "@0 and the @6 roll" plus
            dont_use_in_resolve
   seq nullcall [mandatory_anycall]
   seq anyoneroll [seq_re_evaluate]

call "hinge" mainstream tag hinge
            left_means_mirror
   setup 1x2 1x2 rotate qualifier live wave_only
      array [CR0N AL0S]
   setup 1x2 1x2 rotate restriction forbidden levela1
      predscantdocallinsetup
         if 1x2_beau_or_miniwave [CR0N AL0S]
         if always               [0    AL1S]
            alternate_definition [fractal] c4
   setup 1x2 1x2 rotate restriction forbidden wave_only
      array [CR1S AL1N]
            alternate_definition [generous] c3
   setup 1x2 1x2 restriction forbidden wave_only
      array [CR1S AL0S]
            alternate_definition [stingy] c3
   setup 1x2 1x2 restriction forbidden wave_only
      array [ZM0N ZM1N]
            alternate_definition [half] mainstream
   setup 2x4 thar plus_eighth_rotation qualifier in live magic_only
      array [CR0N 0 0 AL2W 0 CR5N AL7W 0]
   setup 2x4 alamo plus_eighth_rotation qualifier out live magic_only
      array [0 AL7W CR0N 0 AL2W 0 0 CR5N]
   setup 1x2 1x2        plus_eighth_rotation qualifier right live wave_only
      array [CR0N 0]
   setup 1x2 1x2 rotate plus_eighth_rotation qualifier left live wave_only
      array [0 AL0S]

call "_hinge but ignore gensting if couple" dontshow tag hinge_ignore_gen_if_couple
            left_means_mirror
   setup 1x2 1x2 rotate qualifier live wave_only
      array [CR0N AL0S]
   setup 1x2 1x2 rotate restriction forbidden levela1
      predscantdocallinsetup
         if 1x2_beau_or_miniwave [CR0N AL0S]
         if always               [0    AL1S]
            alternate_definition [fractal] c4
   setup 1x2 1x2 rotate qualifier live wave_only
      array [CR1S AL1N]
   setup 1x2 1x2 rotate restriction forbidden levela1
      predscantdocallinsetup
         if 1x2_beau_or_miniwave [CR0N AL0S]
         if always               [0    AL1S]
            alternate_definition [generous] c3
   setup 1x2 1x2 qualifier live wave_only
      array [CR1S AL0S]
   setup 1x2 1x2 rotate restriction forbidden levela1
      predscantdocallinsetup
         if 1x2_beau_or_miniwave [CR0N AL0S]
         if always               [0    AL1S]
            alternate_definition [stingy] c3
   setup 1x2 1x2 qualifier live wave_only
      array [ZM0N ZM1N]
   setup 1x2 1x2 rotate restriction forbidden levela1
      predscantdocallinsetup
         if 1x2_beau_or_miniwave [CR0N AL0S]
         if always               [0    AL1S]

call "_couples hinge for short cycle" dontshow tag cplshinge_should_be_armturn
            left_means_mirror
   setup 1x4 1x4 rotate qualifier couples_only restriction controversial 2fl_only
      predscantdocallinsetup
         if 1x4_wheel_and_deal [CR0N CR1N AL0S AL1S]   // 2FL, or beau side of 1FL
         if always             [0    0    AL3S AL2S]   // belle side of 1FL

call "_arm turn, but hinge if needed" dontshow tag armturn_with_warn
            left_means_mirror
   setup 1x2 1x2 rotate restriction unusual miniwaves
      predscantdocallinsetup
         if 1x2_beau_miniwave_or_ok [CR0N AL0S]
         if always                  [0    AL1S]
            alternate_definition [fractal] c4
   setup 1x2 1x2 rotate restriction forbidden miniwaves  // If going 3/4, we require a miniwave.
      array [CR1S AL1N]
            alternate_definition [generous] c3
   setup 1x2 1x2 restriction forbidden miniwaves
      array [CR1S AL0S]
            alternate_definition [stingy] c3
   setup 1x2 1x2 restriction forbidden miniwaves
      array [ZM0N ZM1N]

call "hinge, opt for normal" dontshow tag hinge_with_warn
            left_means_mirror
            // Now need this for 12 matrix 3x3 contour the line in 2x6, cf. ng11
            12_16_matrix_means_split
   setup 1x2 1x2 rotate
      predscantdocallinsetup
         if 1x2_beau_miniwave_or_warn [CR0N AL0S]
         if always                    [0    AL1S]
            alternate_definition [fractal] c4
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [CR1S AL1N]
            alternate_definition [generous] c3
   setup 1x2 1x2 restriction forbidden miniwaves
      array [CR1S AL0S]
            alternate_definition [stingy] c3
   setup 1x2 1x2 restriction forbidden miniwaves
      array [ZM0N ZM1N]
            alternate_definition [interlocked] c3x  // For interlocked peel to diamond.
   setup 2x2 1x4 no_cutting_through rotate restriction wave_only
      array [CR0N AL0S AL1S CR1N]

call "hinge for breaker" dontshow tag hinge_for_breaker
            left_means_mirror
   setup 1x2 1x2 rotate
      predscantdocallinsetup
         if 1x2_beau_miniwave_for_breaker [CR0N AL0S]
         if always                        [0    AL1S]
            alternate_definition [fractal] c4
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [CR1S AL1N]
            alternate_definition [generous] c3
   setup 1x2 1x2 restriction forbidden miniwaves
      array [CR1S AL0S]
            alternate_definition [stingy] c3
   setup 1x2 1x2 restriction forbidden miniwaves
      array [ZM0N ZM1N]

/* The next 3 "couples" calls are explicitly permitted at Mainstream. */

call "couples hinge" mainstream
            mxn_is_inherited
   seq hinge [cpls_unless_single]   // Of course, "single" isn't allowed.

call "couples trade" mainstream
            take_right_hands_as_couples
   setup 1x4 1x4 qualifier couples_only restriction unusual 2fl_only
      array [CR2S CR3S AL0S AL1S]
            mxn_is_inherited
   seq trade [cpls_unless_single]   // Of course, "single" isn't allowed.

call "couples circulate" mainstream tag couples_circ
            take_right_hands_as_couples
   setup 2x4 2x4 qualifier couples_only restriction unusual 2fl_only
      array [CR3S CR2S AL1S AL0S ZM3N ZM2N ZM1N ZM0N]
            alternate_definition [3x3] c4
   setup 2x6 2x6 qualifier 3x3couples_only restriction unusual 3x3_2fl_only
      array [CR5S CR4S CR3S AL2S AL1S AL0S ZM5N ZM4N ZM3N ZM2N ZM1N ZM0N]
            alternate_definition [4x4] c4
   setup 2x8 2x8 qualifier 4x4couples_only restriction unusual 4x4_2fl_only
      array [CR7S CR6S CR5S CR4S AL3S AL2S AL1S AL0S
             ZM7N ZM6N ZM5N ZM4N ZM3N ZM2N ZM1N ZM0N]
            alternate_definition [half] mainstream
   setup 2x4 crosswave rotate qualifier couples_only restriction unusual 2fl_only
      array [CR0N CR1N AL1S AL0S ZM2W ZM3W ZM7W ZM6W]
            mxn_is_inherited
   seq circulate [cpls_unless_single]   // Of course, "single" isn't allowed.

call "shazam" c2
            visible_fractions diamond_is_legal fractal_is_inherited gen_sting_is_inherited rewind_is_inherited
   // Don't inherit rewind to subcalls -- they are self-rewinds anyway.
   seq armturn_n4 [allow_forced_mod inherit_diamond inherit_gensting inherit_fractal insert_number 1]
   seq uturnflow [allow_forced_mod inherit_diamond]

call "_hinge and then trade" dontshow tag hinge_then_trade
            left_means_mirror yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq hinge [inherit_left inherit_fractal]  /* This isn't right.  They go around 5/4. */
   /* Probably ought to take a number, fractalize, and use repetition on hinge. */
   seq trade [inherit_yoyo inherit_gensting]

call "_hinge and then cast @b" dontshow tag hinge_then_cast_n
            left_means_mirror neednumber
   seq hinge [inherit_left]
   seq cast_off_n4 []

call "_hinge and then trade for breaker" dontshow tag hinge_then_trade_for_breaker
            left_means_mirror fractal_is_inherited gen_sting_is_inherited
   seq hinge_for_breaker [inherit_left inherit_gensting inherit_fractal]
   seq trade []

call "snake" c4a
   setup 1x2 1x2 rotate
      array [C1N A1S]

call "patch the @6" c3a
            visible_fractions gen_sting_is_inherited diamond_is_legal dont_use_in_nice_resolve
   // Selector identities *do not* get re-evaluated between parts of this
   // call, which makes it work.  Compare wave the <anyone>. */
   // If it's a partner hinge, generous/stingy won't be permitted.
   seq hinge [seq_never_re_evaluate allow_forced_mod inherit_diamond inherit_gensting]
   seq some_utb_in_roll_dir [roll_transparent]

call "tap the @6" c4
            visible_fractions twisted_is_inherited
   seq passthru [inherit_twisted]
   seq some_utb_in_roll_dir [seq_re_evaluate]
   seq splitctrrot []
   seq roll []

call "tap the original @6" c4
            visible_fractions twisted_is_inherited
   seq passthru [seq_never_re_evaluate inherit_twisted]
   seq some_utb_in_roll_dir [seq_never_re_evaluate]
   seq splitctrrot []
   seq roll []

call "@6 bypass" c4
   // By giving a 2x2 def'n, we allow roll, since they know which way
   // to turn back.  Also, this allows T-bone boxes.
   setup 2x2 2x2
      predsnoselect
         if select [0 0 ZM1N ZM0N]
         if unselect [0 0 AL1S CR0S]
   setup 2x1 1x2
      predsnoselect
         if select [1N 0]
         if unselect [1S 0]

call "_the_wave" dontshow tag the_wave
   setup 2x4 2x4 rotate restriction forbidden wave_only
      array [ZM7W ZM7W ZM0W ZM0W ZM1W ZM1W ZM6W ZM6W]
            alternate_definition [single] c4
   setup 1x4 2x2 restriction forbidden wave_only
      array [ZM0N ZM0N ZM1N ZM1N]
            alternate_definition [3x3 12matrix] c4
   setup 3x4 2x6 rotate restriction forbidden wave_only
      array [ZM11W ZM11W ZM0W ZM0W ZM1W ZM1W ZM2W ZM2W ZM9W ZM9W ZM10W ZM10W]
            alternate_definition [4x4 16matrix] c4
   setup 4x4 2x8 rotate restriction forbidden wave_only
      array [ZM0W ZM1W ZM2W ZM1W ZM3W ZM3W ZM12W ZM2W ZM12W ZM13W ZM14W ZM13W ZM15W ZM15W ZM0W ZM14W]
            alternate_definition [3x1] c4
   setup 3x4 2x4 rotate qualifier occupied_as_h    restriction forbidden wave_only
      array [ZM7W 0 0 ZM0W ZM1W ZM0W ZM2W 0 0 ZM5W ZM6W ZM7W]
   setup 3x4 2x4 rotate qualifier occupied_as_qtag restriction forbidden wave_only
      array [0 ZM7W ZM0W 0 ZM0W ZM1W 0 ZM2W ZM5W 0 ZM7W ZM6W]
   setup qtag 2x4 rotate                           restriction forbidden wave_only
      array [ZM7W ZM0W ZM0W ZM1W ZM2W ZM5W ZM7W ZM6W]
            alternate_definition [1x3] c4    /* Same as 3x1. */
   setup 3x4 2x4 rotate qualifier occupied_as_h    restriction forbidden wave_only
      array [ZM7W 0 0 ZM0W ZM1W ZM0W ZM2W 0 0 ZM5W ZM6W ZM7W]
   setup 3x4 2x4 rotate qualifier occupied_as_qtag restriction forbidden wave_only
      array [0 ZM7W ZM0W 0 ZM0W ZM1W 0 ZM2W ZM5W 0 ZM7W ZM6W]
   setup qtag 2x4 rotate                           restriction forbidden wave_only
      array [ZM7W ZM0W ZM0W ZM1W ZM2W ZM5W ZM7W ZM6W]

call "@0 the wave" c4a
            single_is_inherited nxn_is_inherited
            bigmatrix_is_inherited
   seq the_wave [inherit_single inherit_nxn inherit_bigmatrix]
   seq nullcall [mandatory_anycall inherit_single inherit_nxn inherit_bigmatrix]

call "peel the wave" c4a
            single_is_inherited nxn_is_inherited
            bigmatrix_is_inherited
   seq the_wave [inherit_single inherit_nxn inherit_bigmatrix]
   seq peeloff [inherit_single inherit_nxn inherit_bigmatrix]

call "more or less peel the wave" c4
   seq the_wave []
   seq moreorlesspeeloff []

call "less or more peel the wave" c4
   seq the_wave []
   seq lessormorepeeloff []

call "trail the wave" c4a
            single_is_inherited nxn_is_inherited
            bigmatrix_is_inherited
   seq the_wave [inherit_single inherit_nxn inherit_bigmatrix]
   seq trailoff [inherit_single inherit_nxn inherit_bigmatrix]

call "more or less trail the wave" c4
   seq the_wave []
   seq moreorlesstrailoff []

call "peel and trail the wave" c4a
            single_is_inherited nxn_is_inherited
            bigmatrix_is_inherited
   seq the_wave [inherit_single inherit_nxn inherit_bigmatrix]
   seq peelntrail [inherit_single inherit_nxn inherit_bigmatrix]

call "trail and peel the wave" c4
            single_is_inherited nxn_is_inherited
            bigmatrix_is_inherited
   seq the_wave [inherit_single inherit_nxn inherit_bigmatrix]
   seq trailnpeel [inherit_single inherit_nxn inherit_bigmatrix]

call "clover the wave" c4
            cross_is_inherited single_is_inherited nxn_is_inherited mxn_is_inherited
            bigmatrix_is_inherited
   seq the_wave [inherit_single inherit_nxn inherit_mxn inherit_bigmatrix]
   seq cloverleaf [inherit_cross inherit_single inherit_nxn inherit_mxn inherit_bigmatrix]

call "trade or swing 1/2" dontshow tag trade_or_swing_half
            left_means_mirror split_large_setups
            // Need "left" for "half trade".
   setup 1x2 1x2 restriction unusual wave_unless_say_2faced
      array [CR1S AL0S]
   setup 1x4 1x4 restriction unusual wave_unless_say_2faced
      array [CR1S AL0S AL3S CR2S]
            alternate_definition [half] mainstream
   setup 1x2 1x2 rotate
      predscantdocallinsetup
         if 1x2_beau_or_miniwave [CR0N AL0S]
         if always [0 AL1S]
            alternate_definition [lasthalf] mainstream
   // We do this as an arm turn.  If that isn't right, sorry.
   setup 1x2 1x2 rotate restriction forbidden wave_only
      array [CR0N AL0S]
            alternate_definition [yoyo] c4
   setup 1x4 2x2 other_elongate restriction controversial miniwaves
      // Many people consider things like "yoyo turn the key"
      // with a pushy cast to be bogus.
      predscantdo
         if cast_normal  [CR3W AL3E AL2E CR2W]
         if cast_pushy   [AL0E AL3E CR1W CR2W]
         if always       [0    AL3E 0    CR2W]
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [CR1S AL1N]
            alternate_definition [twisted] c4
   setup 1x2 1x2 rotate qualifier miniwaves
      array [CR1S AL1N]
   setup 1x2 1x2 rotate qualifier couples_only
      array [CR1S L0S]
            alternate_definition [stingy] c3
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [CR0N AL0S]
            alternate_definition [generous] c3
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [CR1S AL1N]

call "_trade for 8-person call" dontshow tag trade_for_8_person_call
            left_means_mirror split_large_setups 12_16_matrix_means_split
            // Need "left" for "half trade".
   setup 1x2 1x2 restriction unusual wave_unless_say_2faced
      array [CR1S AL0S]
   setup 1x4 1x4 restriction unusual wave_unless_say_2faced
      array [CR1S AL0S AL3S CR2S]
   setup 1x8 1x8 restriction unusual wave_unless_say_2faced
      array [CR1S AL0S AL3S CR2S AL5S CR4S CR7S AL6S]
   setup 2x4 2x4 restriction unusual wave_unless_say_2faced
      array [CR1S AL0S CR3S AL2S AL5S CR4S AL7S CR6S]
            alternate_definition [stingy] c3
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [CR0N AL0S]
            alternate_definition [generous] c3
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [CR1S AL1N]
            alternate_definition [yoyo] c4
   setup 1x4 2x2 other_elongate restriction controversial miniwaves
      // Many people consider things like "yoyo turn the key"
      // with a pushy cast to be bogus.
      predscantdo
         if cast_normal  [CR3W AL3E AL2E CR2W]
         if cast_pushy   [AL0E AL3E CR1W CR2W]
         if always       [0    AL3E 0    CR2W]
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [CR1S AL1N]
            alternate_definition [twisted] c4
   setup 1x2 1x2 rotate qualifier miniwaves
      array [CR1S AL1N]
   setup 1x2 1x2 rotate qualifier couples_only
      array [CR1S L0S]
            alternate_definition [half] mainstream
   setup 1x2 1x2 rotate
      predscantdocallinsetup
         if 1x2_beau_or_miniwave [CR0N AL0S]
         if always [0 AL1S]
            alternate_definition [lasthalf] mainstream
   // We do this as an arm turn.  If that isn't right, sorry.
   setup 1x2 1x2 rotate restriction forbidden wave_only
      array [CR0N AL0S]
            alternate_definition [12matrix 3x3] c4
   setup 1x3 1x3
      array [0 0 0]    // No such call.
            alternate_definition [16matrix 4x4] c4
   setup 1x4 1x4
      array [0 0 0 0]    // No such call.

call "trade" mainstream tag trade
            left_means_mirror diamond_is_legal split_large_setups 12_16_matrix_means_split
            parallel_conc_end
            // Need "left" for "half trade".
   setup 1x2 1x2
      array [CR1S AL0S]
            alternate_definition [half] mainstream
   setup 1x2 1x2 rotate
      predscantdocallinsetup
         if 1x2_beau_or_miniwave [CR0N AL0S]
         if always [0 AL1S]
            alternate_definition [lasthalf] mainstream
   // We do this as an arm turn.  If that isn't right, sorry.
   setup 1x2 1x2 rotate restriction forbidden wave_only
      array [CR0N AL0S]
            alternate_definition [yoyo] c4
   setup 1x4 2x2 other_elongate restriction controversial miniwaves
      // Many people consider things like "yoyo turn the key"
      // with a pushy cast to be bogus.
      predscantdo
         if cast_normal  [CR3W AL3E AL2E CR2W]
         if cast_pushy   [AL0E AL3E CR1W CR2W]
         if always       [0    AL3E 0    CR2W]
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [CR1S AL1N]
            alternate_definition [stingy] c3
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [CR0N AL0S]
            alternate_definition [generous] c3
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [CR1S AL1N]
            alternate_definition [twisted] c4
   setup 1x2 1x2 rotate qualifier miniwaves
      array [CR1S AL1N]
   setup 1x2 1x2 rotate qualifier couples_only
      array [CR1S L0S]
            alternate_definition [diamond] c4
   setup dmd dmd
      array [CR2S 0 AL0S 0]
   setup pmd dmd
      array [0 CR3S 0 AL1S]
            alternate_definition [yoyo diamond] c4
   setup dmd dmd
      array [CR3W 0 AL3E 0]  // Not really right; need to address the "pushy" issue.
   setup pmd dmd
      array [0 CR0W 0 AL0E]
            alternate_definition [12matrix 3x3] c4
   setup 1x3 1x3
      array [0 0 0]    // No such call.
            alternate_definition [16matrix 4x4] c4
   setup 1x4 1x4
      array [0 0 0 0]    // No such call.

call "partner trade" mainstream
            left_means_mirror diamond_is_legal split_large_setups 12_16_matrix_means_split
            // Need "left" for "half trade".
   setup 1x2 1x2
      array [CR1S AL0S]
            alternate_definition [half] mainstream
   setup 1x2 1x2 rotate
      predscantdocallinsetup
         if 1x2_beau_or_miniwave [CR0N AL0S]
         if always [0 AL1S]
            alternate_definition [twisted] c4
   setup 1x2 1x2 rotate qualifier miniwaves
      array [CR1S AL1N]
   setup 1x2 1x2 rotate qualifier couples_only
      array [CR1S L0S]
            alternate_definition [12matrix 3x3] c4
   setup 1x3 1x3
      array [0 0 0]    // No such call.
            alternate_definition [16matrix 4x4] c4
   setup 1x4 1x4
      array [0 0 0 0]    // No such call.

call "_trade, allow t-bone" dontshow tag trade_w_tbone
            left_means_mirror diamond_is_legal 12_16_matrix_means_split
   // Need "left" for "half trade", and "parallel_conc_end" for "yoyo trade".
   setup 1x2 1x2
      array [CR1S AL0S]
   // We put in this next definition to allow it from T-boned boxes
   // (which would otherwise get the "People are not working with each other
   // in a consistent way" error).  The restriction will make it give a
   // "do your part" warning when used in this way.
   setup 2x2 2x2 restriction not_tboned
      array [CR1S AL0S AL3S CR2S]
            alternate_definition [funny] c2
   // This is so one can do a funny 6x2 acey deucey in which the funny applies to the outsides,
   // while the centers are just in the usual 1x2 setup.
   setup 1x2 1x2
      array [CR1S AL0S]
   // We say that "funny" means those who can trade with someone who can trade back with them
   // (that is, who are in a real couple or miniwave) can do the trade.  T-boned people cannot.
   setup 2x2 2x2
      preds "Can't do this with phantoms or T-boned people."
         if 2x2_miniwave [CR1S AL0S AL3S CR2S]   // Yes.
         if 2x2_couple   [CR1S AL0S AL3S CR2S]   // Yes.
         if always       [ZM0N ZM1N ZM2N ZM3N]   // No.
            alternate_definition [half] mainstream
   setup 1x2 1x2 rotate
      predscantdocallinsetup
         if 1x2_beau_miniwave_or_warn [CR0N AL0S]
         if always [0 AL1S]
            alternate_definition [half funny] c2
   setup 1x2 1x2 rotate
      predscantdocallinsetup
         if 1x2_beau_or_miniwave [CR0N AL0S]
         if always [0 AL1S]
            alternate_definition [twisted] c4
   setup 1x2 1x2 rotate qualifier miniwaves
      array [CR1S AL1N]
   setup 1x2 1x2 rotate qualifier couples_only
      array [CR1S L0S]
            alternate_definition [yoyo] c4
   setup 1x4 2x2 other_elongate restriction controversial miniwaves
      // Many people consider things like "yoyo turn the key"
      // with a pushy cast to be bogus.
      predscantdo
         if cast_normal  [CR3W AL3E AL2E CR2W]
         if cast_pushy   [AL0E AL3E CR1W CR2W]
         if always       [0    AL3E 0    CR2W]
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [CR1S AL1N]
            alternate_definition [diamond] c4
   setup dmd dmd
      array [CR2S 0 AL0S 0]
   setup pmd dmd
      array [0 CR3S 0 AL1S]
            alternate_definition [yoyo diamond] c4
   setup dmd dmd
      array [CR3W 0 AL3E 0]  // Not really right; need to address the "pushy" issue.
   setup pmd dmd
      array [0 CR0W 0 AL0E]
            alternate_definition [stingy] c3
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [CR0N AL0S]
            alternate_definition [generous] c3
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [CR1S AL1N]

call "_miniwave trade" dontshow tag miniwavetrade
            parallel_conc_end left_means_mirror
            // Need "left" for "half trade", and "parallel_conc_end" for "yoyo trade".
   setup 1x2 1x2 restriction unusual wave_only
      array [CR1S AL0S]
            alternate_definition [half] mainstream
   setup 1x2 1x2 rotate restriction forbidden wave_only
      array [CR0N AL0S]
            alternate_definition [yoyo] c4
   setup 1x2 1x2 rotate restriction forbidden wave_only
      array [CR1S AL1N]
            alternate_definition [stingy] c3
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [CR0N AL0S]
            alternate_definition [generous] c3
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [CR1S AL1N]

call "california twirl" mainstream
   setup 1x2 1x2 restriction forbidden couples_only
      preds "Unknown sex."
         if boyp [CR1S 0]
         if girlp [0 AL0S]
            alternate_definition [twisted] c4
   setup 1x2 1x2 rotate qualifier couples_only
      preds "Unknown sex."
         if boyp [CR1S 0]
         if girlp [0 L0S]

call "wheel around" mainstream
            reverse_means_mirror
   setup 1x2 1x2 restriction forbidden all_facing_same
      array [AL1S AL0S]
            alternate_definition [twisted] c4
   setup 1x2 1x2 rotate restriction forbidden all_facing_same
      array [AL0N AL1N]
            alternate_definition [single] c4
   setup 1x1 1x1
      array [AL0S]
            alternate_definition [3x3] c4
   setup 1x3 1x3 restriction forbidden all_facing_same
      array [AL2S AL1S AL0S]
            alternate_definition [4x4] c4
   setup 1x4 1x4 restriction forbidden all_facing_same
      array [AL2S AL3S AL0S AL1S]
            alternate_definition [half] mainstream
   setup 1x2 1x2 rotate restriction forbidden all_facing_same
      array [AL1S AL0S]
            alternate_definition [lasthalf] mainstream
   setup 1x2 1x2 rotate restriction forbidden all_facing_same
      array [AL1S AL0S]
            alternate_definition [half single] c4
   setup 1x1 1x1
      array [AL0W]
            alternate_definition [half 3x3] c4
   setup 1x3 1x3 rotate restriction forbidden all_facing_same
      array [AL2S AL1S AL0S]
            alternate_definition [half 4x4] c4
   setup 1x4 1x4 rotate restriction forbidden all_facing_same
      array [AL2S AL3S AL0S AL1S]

call "_maybe single trade" dontshow tag maybesingletrade
   setup 1x2 1x2
      array [CR1S AL0S]
            alternate_definition [single] a2
   setup 1x1 1x1
      array [0S]


call "@6 trade" mainstream
   matrix use_selector find_traders not_true_invader [AL16S 16 CR16S 16]
   // Some setups have natural holes, or unusual positions.
   // Use the old definition for those.

   setup 1x2 1x2
      preds "Can't find anyone to trade with."
         if select_near_select [CR1S AL0S]
         if select_near_select_or_phantom [CR1S AL0S]

   // The matrix mechanism can handle normal qtags correctly, but it can't handle
   // pqtags because the people are not in the same plane.
   setup pqtag qtag
      preds "Can't find anyone to trade with."
         if unselect                    [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
         if other_diamond_point_select  [CR5S CR4S    0    0 AL1S AL0S    0    0]
         if pair_person_select          [CR7S    0    0 CR4S AL3S    0    0 AL0S]
         if conc_from_select            [0    CR3S    0 AL1S    0 AL7S    0 CR5S]
   // But we have to keep the qtag definition around also in case a pqtag processing
   // as a matrix call fails, and there may be (inactive) qtag people.
   setup qtag qtag
      preds "Can't find anyone to trade with."
         if unselect                    [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
         if select_near_select          [CR1S AL0S AL3S CR2S AL5S CR4S CR7S AL6S]
         if grand_conc_from_select      [   0    0 AL6S AL7S    0    0 CR2S CR3S]

   setup hrglass hrglass
      preds "Can't find anyone to trade with."
         if unselect                    [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
         if select_near_select          [CR1S AL0S    0    0 AL5S CR4S    0    0]
         if grand_conc_from_select      [   0    0 AL6S    0    0    0 CR2S    0]
   setup phrglass hrglass
      preds "Can't find anyone to trade with."
         if unselect                    [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
         if other_diamond_point_select  [CR5S CR4S    0    0 AL1S AL0S    0    0]
         if grand_conc_from_select      [   0    0    0 CR7S    0    0    0 AL3S]

   // Need this because wings are too far away.
   setup rigger rigger
      preds "Can't find anyone to trade with."
         if unselect                    [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
         if select_near_select          [CR1S AL0S AL3S CR2S AL5S CR4S AL7S CR6S]
         if person_select_real_plus4    [   0    0 AL6S AL7S    0    0 CR2S CR3S]
   // Need this in case of inactive T-boned people.
   setup prigger rigger
      preds "Can't find anyone to trade with."
         if unselect                    [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
         if person_select_sum5          [CR5S CR4S    0    0 AL1S AL0S    0    0]

   setup short6 short6
      preds "Can't find anyone to trade with."
         if unselect           [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N]
         if person_select_sum8 [CR2S    0 AL0S AL5S    0 CR3S]
   setup pshort6 short6
      preds "Can't find anyone to trade with."
         if unselect           [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N]
         if person_select_sum5 [CR5S    0 CR3S AL2S    0 AL0S]


call "trade and roll" plus tag trade_and_roll
            dont_use_in_nice_resolve
            visible_fractions yoyo_is_inherited gen_sting_is_inherited
   seq trade [inherit_yoyo inherit_gensting]
   seq roll []

call "_trade and roll, allow t-bone" dontshow tag trade_and_roll_w_tbone
            visible_fractions yoyo_is_inherited gen_sting_is_inherited diamond_is_legal funny_is_inherited
   seq trade_w_tbone [inherit_yoyo inherit_gensting inherit_diamond inherit_funny]
   seq roll []

call "_trade, allow t-bone, but @m" dontshow tag trade_w_tbone_but
            visible_fractions yoyo_is_inherited gen_sting_is_inherited diamond_is_legal funny_is_inherited
   seq trade_w_tbone [inherit_yoyo inherit_gensting inherit_diamond inherit_funny]
   seq nullsecond [mandatory_secondary_call]

call "U-turn back" mainstream tag uturnback
            dont_use_in_nice_resolve one_person_call
   // This allows the ends to do it, no matter how they are facing,
   // and no matter how they are elongated.  If we didn't have this,
   // the 1x2 definition would be in danger of tripping us up on the
   // elongation warning before the 1x1 definition could save us.
   // We need the 1x2 definition in order to tell which way to turn.
   setup 2x2 2x2
      array [CR0S AL1S AL2S CR3S]
   setup 1x2 1x2
      array [CR0S AL1S]
   setup 2x1 1x2   // This makes sure that, in a T-boned 1x2, it doesn't get split
                   // into 1x1's, which would make it impossible for anyone to roll.
                   // By doing it this way, the person in couple-like orientation can roll.
      array [0S 1S]
   setup 1x1 1x1
      array [0S]
   setup star star
      array [CR0S 1S AL2S 3S]
   setup short6 short6
      array [CR0S 1S AL2S AL3S 4S CR5S]
   setup pshort6 short6
      array [CR0S CR1S CR2S AL3S AL4S AL5S]
   setup trngl trngl
      array [0S CR1S AL2S 3S AL4S CR5S]
   setup ptrngl trngl
      array [AL0S CR1S CR2S CR3S AL4S AL5S]
   setup 2x1dmd 2x1dmd
      array [CR0S AL1S 2S AL3S CR4S 5S]
   setup p2x1dmd 2x1dmd
      array [0S 1S CR2S 3S 4S AL5S]
   setup 3x1dmd 3x1dmd
      array [CR0S AL1S CR2S 3S AL4S CR5S AL6S 7S]
   setup p3x1dmd 3x1dmd
      array [0S 1S 2S CR3S 4S 5S 6S AL7S]
   setup 1x3dmd 1x3dmd
      array [CR0S AL1S CR2S 3S AL4S CR5S AL6S 7S]
   setup p1x3dmd 1x3dmd
      array [0S 1S 2S CR3S 4S 5S 6S AL7S]
   setup 2x7 2x7
      array [0S 1S 2S 3S 4S 5S 6S 7S 8S 9S 10S 11S 12S 13S]
   setup 7x2 2x7
      array [0S 1S 2S 3S 4S 5S 6S 7S 8S 9S 10S 11S 12S 13S]
   setup 2x9 2x9
      array [0S 1S 2S 3S 4S 5S 6S 7S 8S 9S 10S 11S 12S 13S 14S 15S 16S 17S]
   setup 9x2 2x9
      array [0S 1S 2S 3S 4S 5S 6S 7S 8S 9S 10S 11S 12S 13S 14S 15S 16S 17S]
   setup alamo alamo
      array [0S 1S 2S 3S 4S 5S 6S 7S]
   setup c1phan c1phan
      array [0S 1S 2S 3S 4S 5S 6S 7S 8S 9S 10S 11S 12S 13S 14S 15S]
   setup 3dmd 3dmd
      array [0S 1S 2S 3S 4S 5S 6S 7S 8S 9S 10S 11S]
   setup p3dmd 3dmd
      array [0S 1S 2S 3S 4S 5S 6S 7S 8S 9S 10S 11S]
   setup 3ptpd 3ptpd
      array [0S 1S 2S 3S 4S 5S 6S 7S 8S 9S 10S 11S]
   setup p3ptpd 3ptpd
      array [0S 1S 2S 3S 4S 5S 6S 7S 8S 9S 10S 11S]
   setup 4dmd 4dmd
      array [0S 1S 2S 3S 4S 5S 6S 7S 8S 9S 10S 11S 12S 13S 14S 15S]
   setup p4dmd 4dmd
      array [0S 1S 2S 3S 4S 5S 6S 7S 8S 9S 10S 11S 12S 13S 14S 15S]
   setup galaxy galaxy
      array [CR0S CR1S 2S AL3S AL4S AL5S 6S AL7S]
   setup hrglass hrglass
      array [CR0S AL1S AL2S 3S AL4S CR5S CR6S 7S]
   setup phrglass hrglass
      array [CR0S CR1S 2S CR3S AL4S AL5S 6S AL7S]
   setup wingedstar wingedstar
      array [CR0S AL1S CR2S 3S AL4S CR5S AL6S 7S]
   setup pwingedstar wingedstar
      array [0S 1S 2S CR3S 4S 5S 6S AL7S]
            alternate_definition [half] mainstream
   setup 1x2 1x2
      array [CR0E AL1W]
   setup 1x1 1x1
      array [0]    // So people in an elongated 1x2 will be able to do it.
   setup star star
      array [CR0E 0 AL2W 0]

call "@6 U-turn back" mainstream
            dont_use_in_resolve one_person_call
   // This is just the stuff from plain UTB, with predicates.
   setup 2x2 2x2
      predscantdo
         if select [CR0S AL1S AL2S CR3S]
         if always [ZM0N ZM1N ZM2N ZM3N]
   setup 1x2 1x2
      predscantdo
         if select [CR0S AL1S]
         if always [ZM0N ZM1N]
   setup 2x1 1x2
      predscantdo
         if select [0S 1S]
         if always [ZM0N ZM1N]
   setup 1x1 1x1
      predscantdo
         if select [0S]
         if always [ZM0N]
   setup c1phan c1phan
      predscantdo
         if select [0S 1S 2S 3S 4S 5S 6S 7S 8S 9S 10S 11S 12S 13S 14S 15S]
         if always [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N ZM10N ZM11N ZM12N ZM13N ZM14N ZM15N]
   setup 2x2dmd 2x2dmd
      predscantdo
         if select [0S 1S 2S 3S 4S 5S 6S 7S 8S 9S 10S 11S 12S 13S 14S 15S]
         if always [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N ZM10N ZM11N ZM12N ZM13N ZM14N ZM15N]
   setup p2x2dmd 2x2dmd
      predscantdo
         if select [0S 1S 2S 3S 4S 5S 6S 7S 8S 9S 10S 11S 12S 13S 14S 15S]
         if always [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N ZM10N ZM11N ZM12N ZM13N ZM14N ZM15N]

   // And if we can't find anything in the above, do it the matrix way, with no roll.
   matrix use_selector [16S 16 16S 16]

call "U-turn back in roll direction" mainstream tag uturnflow
            dont_use_in_resolve one_person_call
   setup 2x2 2x2
      predscantdo
         if roll_is_cw  [CR0S CR1S CR2S CR3S]
         if roll_is_ccw [AL0S AL1S AL2S AL3S]
         if always      [  0S   1S   2S   3S]
   setup 1x1 1x1
      predscantdo
         if roll_is_cw  [CR0S]
         if roll_is_ccw [AL0S]
         if always      [  0S]
            alternate_definition [half] mainstream
   setup 2x2 2x2
      predscantdo
         if roll_is_cw  [CR0E CR1E CR2E CR3E]
         if roll_is_ccw [AL0W AL1W AL2W AL3W]
         if always      [0 0 0 0]
   setup 1x1 1x1
      predscantdo
         if roll_is_cw  [CR0E]
         if roll_is_ccw [AL0W]
         if always      [0]

call "@6 U-turn back in roll direction" dontshow tag some_utb_in_roll_dir
            dont_use_in_resolve one_person_call
   setup 2x2 2x2
      predscantdo
         if select_and_roll_is_cw  [CR0S CR1S CR2S CR3S]
         if select_and_roll_is_ccw [AL0S AL1S AL2S AL3S]
         if select                 [CR0S AL1S AL2S CR3S]
         if always                 [ZM0N ZM1N ZM2N ZM3N]
   setup 1x2 1x2
      predscantdo
         if select_and_roll_is_cw  [CR0S CR1S]
         if select_and_roll_is_ccw [AL0S AL1S]
         if select                 [CR0S AL1S]
         if always                 [ZM0N ZM1N]
   setup 1x1 1x1
      predscantdo
         if select_and_roll_is_cw  [CR0S]
         if select_and_roll_is_ccw [AL0S]
         if select                 [0S]
         if always                 [ZM0N]
            alternate_definition [half] mainstream
   setup 2x2 2x2
      predscantdo
         if select_and_roll_is_cw  [CR0E CR1E CR2E CR3E]
         if select_and_roll_is_ccw [AL0W AL1W AL2W AL3W]
         if select                 [   0    0    0    0]
         if always                 [ZM0N ZM1N ZM2N ZM3N]
   setup 1x2 1x2
      predscantdo
         if select_and_roll_is_cw  [CR0E CR1E]
         if select_and_roll_is_ccw [AL0W AL1W]
         if select                 [   0    0]
         if always                 [ZM0N ZM1N]
   setup 1x1 1x1
      predscantdo
         if select_and_roll_is_cw  [CR0E]
         if select_and_roll_is_ccw [AL0W]
         if select                 [   0]
         if always                 [ZM0N]

call "U-turn away" dontshow tag uturnaway
            one_person_call
   setup 1x2 1x2
      array [AL0S CR1S]
   setup 1x1 1x1
      array [0S]
   setup star star
      array [AL0S 1S CR2S 3S]
            alternate_definition [half] mainstream
   setup 1x2 1x2
      array [AL0W CR1E]
   setup 1x1 1x1
      array [0]    // So people in an elongated 1x2 will be able to do it.
   setup star star
      array [AL0W 0 CR2E 0]

call "quarter @eright@f" dontshow tag quarter_right
            one_person_call left_means_mirror
   setup 1x1 1x1
      array [CR0E]
   setup short6 short6
      array [CR0E CR1E CR2E CR3E CR4E CR5E]
   setup pshort6 short6
      array [CR0E CR1E CR2E CR3E CR4E CR5E]
            alternate_definition [single] c4
   setup 1x1 1x1
      array [CR0E]
            alternate_definition [3x3] c4
   setup 1x1 1x1
      array [CR0E]
            alternate_definition [4x4] c4
   setup 1x1 1x1
      array [CR0E]

// This one doesn't allow "no direction".
call "quarter @h" dontshow tag inner_quarter_dir
            dont_use_in_nice_resolve one_person_call
   setup 2x2 2x2
      preds "Direction must be right, left, in, or out."
         if rightp [CR0E CR1E CR2E CR3E]
         if leftp [AL0W AL1W AL2W AL3W]
         if inp [CR0E AL1W AL2W CR3E]
         if outp [AL0W CR1E CR2E AL3W]
   setup 1x2 1x2
      preds "Direction must be right, left, in, or out."
         if rightp [CR0E CR1E]
         if leftp [AL0W AL1W]
         if inp [CR0E AL1W]
         if outp [AL0W CR1E]
   setup 1x1 1x1
      preds "Direction must be right or left."
         if rightp [CR0E]
         if leftp [AL0W]
   setup dmd dmd
      preds "Direction must be right, left, in, or out."
         if rightp [CR0E CR1E CR2E CR3E]
         if leftp [AL0W AL1W AL2W AL3W]
         if inp [CR0E 0 AL2W 0]
         if outp [AL0W 0 CR2E 0]
   setup pmd dmd
      preds "Direction must be right, left, in, or out."
         if rightp [CR0E CR1E CR2E CR3E]
         if leftp [AL0W AL1W AL2W AL3W]
         if inp [0 CR1E 0 AL3W]
         if outp [0 AL1W 0 CR3E]
   setup qtag qtag
      preds "Direction must be right, left, in, or out."
         if rightp [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp  [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp    [CR0E AL1W AL2W CR3E AL4W CR5E CR6E AL7W]
         if outp   [AL0W CR1E CR2E AL3W CR4E AL5W AL6W CR7E]
   setup pqtag qtag
      preds "Direction must be right, left, in, or out."
         if rightp [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp  [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp    [CR0E CR1E    0    0 AL4W AL5W    0    0]
         if outp   [AL0W AL1W    0    0 CR4E CR5E    0    0]
   setup star star
      preds "Direction must be right, left, in, or out."
         if rightp [CR0E CR1E CR2E CR3E]
         if leftp  [AL0W AL1W AL2W AL3W]
         if inp    [CR0E    0 AL2W    0]
         if outp   [AL0W    0 CR2E    0]
   setup galaxy galaxy
      preds "Direction must be right, left, in, or out."
         if rightp [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp  [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp    [CR0E CR1E    0 AL3W AL4W AL5W    0 CR7E]
         if outp   [AL0W AL1W    0 CR3E CR4E CR5E    0 AL7W]
   setup hrglass hrglass
      preds "Direction must be right, left, in, or out."
         if rightp [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp  [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp    [CR0E AL1W AL2W    0 AL4W CR5E CR6E 0]
         if outp   [AL0W CR1E CR2E    0 CR4E AL5W AL6W 0]
   setup phrglass hrglass
      preds "Direction must be right, left, in, or out."
         if rightp [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp  [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp    [CR0E CR1E    0 CR3E AL4W AL5W    0 AL7W]
         if outp   [AL0W AL1W    0 AL3W CR4E CR5E    0 CR7E]
   setup 3x1dmd 3x1dmd
      preds "Direction must be right, left, in, or out."
         if rightp [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp  [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp    [CR0E AL1W CR2E    0 AL4W CR5E AL6W    0]
         if outp   [AL0W CR1E AL2W    0 CR4E AL5W CR6E    0]
   setup p3x1dmd 3x1dmd
      preds "Direction must be right, left, in, or out."
         if rightp [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp  [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp    [   0    0    0 CR3E    0    0    0 AL7W]
         if outp   [   0    0    0 AL3W    0    0    0 CR7E]
   setup short6 short6
      preds "Direction must be right, left, in, or out."
         if rightp [CR0E CR1E CR2E CR3E CR4E CR5E]
         if leftp  [AL0W AL1W AL2W AL3W AL4W AL5W]
         if inp    [CR0E    0 AL2W AL3W    0 CR5E]
         if outp   [AL0W    0 CR2E CR3E    0 AL5W]
   setup pshort6 short6
      preds "Direction must be right, left, in, or out."
         if rightp [CR0E CR1E CR2E CR3E CR4E CR5E]
         if leftp  [AL0W AL1W AL2W AL3W AL4W AL5W]
         if inp    [CR0E CR1E CR2E AL3W AL4W AL5W]
         if outp   [AL0W AL1W AL2W CR3E CR4E CR5E]
            alternate_definition [half] mainstream
   setup 1x1 1x1 plus_eighth_rotation
      preds "Direction must be right or left."
         if rightp [CR0N]
         if leftp [AL0W]
            alternate_definition [lasthalf] mainstream
   setup 1x1 1x1 plus_eighth_rotation
      preds "Direction must be right or left."
         if rightp [CR0N]
         if leftp [AL0W]

call "1/4 @h" mainstream tag quarter_dir
            dont_use_in_nice_resolve one_person_call
            // We accept (and ignore) the "single" modifier, so that things
            // like "3x1 dodge [1/4 right]" will work.
            single_is_inherited
   seq inner_quarter_dir []

call "quarter @h" mainstream
   alias quarter_dir

call "@V 1/4 in" mainstream tag anyonequarterin
            dont_use_in_nice_resolve
   setup 2x2 2x2
      predsnoselect
         if select   [CR0E AL1W AL2W CR3E]
         if unselect [ZM0N ZM1N ZM2N ZM3N]
   setup 1x2 1x2
      predsnoselect
         if select   [CR0E AL1W]
         if unselect [ZM0N ZM1N]
   setup 2x1 1x2
      predsnoselect
         if select   [0    0]
         if unselect [ZM0N ZM1N]
   setup dmd dmd
      predsnoselect
         if select   [CR0E 0 AL2W 0]
         if unselect [ZM0N 0 ZM2N 0]
   setup pmd dmd
      predsnoselect
         if select   [0 CR1E 0 AL3W]
         if unselect [0 ZM1N 0 ZM3N]
   setup qtag qtag
      predsnoselect
         if select   [CR0E AL1W AL2W CR3E AL4W CR5E CR6E AL7W]
         if unselect [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup pqtag qtag
      predsnoselect
         if select   [CR0E CR1E    0    0 AL4W AL5W    0    0]
         if unselect [ZM0N ZM1N    0    0 ZM4N ZM5N    0    0]
   setup star star
      predsnoselect
         if select   [CR0E    0 AL2W    0]
         if unselect [ZM0N    0 ZM2N    0]
   setup galaxy galaxy
      predsnoselect
         if select   [CR0E CR1E    0 AL3W AL4W AL5W    0 CR7E]
         if unselect [ZM0N ZM1N    0 ZM3N ZM4N ZM5N    0 ZM7N]
   setup hrglass hrglass
      predsnoselect
         if select   [CR0E AL1W AL2W    0 AL4W CR5E CR6E 0]
         if unselect [ZM0N ZM1N ZM2N    0 ZM4N ZM5N ZM6N 0]
   setup phrglass hrglass
      predsnoselect
         if select   [CR0E CR1E    0 CR3E AL4W AL5W    0 AL7W]
         if unselect [ZM0N ZM1N    0 ZM3N ZM4N ZM5N    0 ZM7N]
   setup short6 short6
      predsnoselect
         if select   [CR0E    0 AL2W AL3W    0 CR5E]
         if unselect [ZM0N    0 ZM2N ZM3N    0 ZM5N]
   setup pshort6 short6
      predsnoselect
         if select   [CR0E CR1E CR2E AL3W AL4W AL5W]
         if unselect [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N]
   setup 3x1dmd 3x1dmd
      predsnoselect
         if select   [CR0E AL1W CR2E    0 AL4W CR5E AL6W    0]
         if unselect [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup p3x1dmd 3x1dmd
      predsnoselect
         if select   [   0    0    0 CR3E    0    0    0 AL7W]
         if unselect [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]

call "@V quarter in" mainstream
   alias anyonequarterin

call "@V 1/4 out" mainstream tag anyonequarterout
            dont_use_in_nice_resolve
   setup 2x2 2x2
      predsnoselect
         if select   [AL0W CR1E CR2E AL3W]
         if unselect [ZM0N ZM1N ZM2N ZM3N]
   setup 1x2 1x2
      predsnoselect
         if select   [AL0W CR1E]
         if unselect [ZM0N ZM1N]
   setup 2x1 1x2
      predsnoselect
         if select   [0    0]
         if unselect [ZM0N ZM1N]
   setup dmd dmd
      predsnoselect
         if select   [AL0W 0 CR2E 0]
         if unselect [ZM0N 0 ZM2N 0]
   setup pmd dmd
      predsnoselect
         if select   [0 AL1W 0 CR3E]
         if unselect [0 ZM1N 0 ZM3N]
   setup qtag qtag
      predsnoselect
         if select   [AL0W CR1E CR2E AL3W CR4E AL5W AL6W CR7E]
         if unselect [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup pqtag qtag
      predsnoselect
         if select   [AL0W AL1W    0    0 CR4E CR5E    0    0]
         if unselect [ZM0N ZM1N    0    0 ZM4N ZM5N    0    0]
   setup star star
      predsnoselect
         if select   [AL0W    0 CR2E    0]
         if unselect [ZM0N    0 ZM2N    0]
   setup galaxy galaxy
      predsnoselect
         if select   [AL0W AL1W    0 CR3E CR4E CR5E    0 AL7W]
         if unselect [ZM0N ZM1N    0 ZM3N ZM4N ZM5N    0 ZM7N]
   setup hrglass hrglass
      predsnoselect
         if select   [AL0W CR1E CR2E    0 CR4E AL5W AL6W 0]
         if unselect [ZM0N ZM1N ZM2N    0 ZM4N ZM5N ZM6N 0]
   setup phrglass hrglass
      predsnoselect
         if select   [AL0W AL1W    0 AL3W CR4E CR5E    0 CR7E]
         if unselect [ZM0N ZM1N    0 ZM3N ZM4N ZM5N    0 ZM7N]
   setup short6 short6
      predsnoselect
         if select   [AL0W    0 CR2E CR3E    0 AL5W]
         if unselect [ZM0N    0 ZM2N ZM3N    0 ZM5N]
   setup pshort6 short6
      predsnoselect
         if select   [AL0W AL1W AL2W CR3E CR4E CR5E]
         if unselect [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N]
   setup 3x1dmd 3x1dmd
      predsnoselect
         if select   [AL0W CR1E AL2W    0 CR4E AL5W CR6E    0]
         if unselect [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup p3x1dmd 3x1dmd
      predsnoselect
         if select   [   0    0    0 AL3W    0    0    0 CR7E]
         if unselect [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]

call "@V quarter out" mainstream
   alias anyonequarterout

call "1/8 @h" c1
            dont_use_in_nice_resolve one_person_call
   setup 1x1 1x1 plus_eighth_rotation
      preds "Direction must be right or left."
         if rightp [CR0N]
         if leftp [AL0W]
   setup 2x2 star plus_eighth_rotation
      preds "Direction must be right, left, in, or out."
         if rightp [CR0N CR1N CR2N CR3N]
         if leftp  [AL0W AL1W AL2W AL3W]
         if inp    [AL0W CR1N AL2W CR3N]
         if outp   [CR0N AL1W CR2N AL3W]

// This one allows "no direction".
call "_maybe quarter @h" dontshow tag quarter_maybe
            one_person_call
   setup 1x2 1x2
      preds "Direction must be right, left, in, or out."
         if rightp [CR0E CR1E]
         if leftp [AL0W AL1W]
         if inp [CR0E AL1W]
         if outp [AL0W CR1E]
         if no_dir_p [ZM0N ZM1N]
   setup dmd dmd    /* Need these for hinge and circulate. */
      preds "Direction must be right, left, in, or out."
         if rightp [CR0E CR1E CR2E CR3E]
         if leftp [AL0W AL1W AL2W AL3W]
         if inp [CR0E 0 AL2W 0]
         if outp [AL0W 0 CR2E 0]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N]
   setup pmd dmd
      preds "Direction must be right, left, in, or out."
         if rightp [CR0E CR1E CR2E CR3E]
         if leftp [AL0W AL1W AL2W AL3W]
         if inp [0 CR1E 0 AL3W]
         if outp [0 AL1W 0 CR3E]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N]
   setup 1x1 1x1
      preds "Direction must be right or left."
         if rightp [CR0E]
         if leftp [AL0W]
         if no_dir_p [ZM0N]
   setup star star
      preds "Illegal direction."
         if rightp [CR0E CR1E CR2E CR3E]
         if leftp  [AL0W AL1W AL2W AL3W]
         if inp    [CR0E    0 AL2W    0]
         if outp   [AL0W    0 CR2E    0]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N]
   setup galaxy galaxy
      preds "Illegal direction."
         if rightp [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp  [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp    [CR0E CR1E    0 AL3W AL4W AL5W    0 CR7E]
         if outp   [AL0W AL1W    0 CR3E CR4E CR5E    0 AL7W]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]

// This is the call to use after "tag the line".  It is also the second
//   part of "pass in/out".
// This one allows "no direction".  In many cases that's unesthetic, but it is needed
//   for "tunnel thru".
call "face @h" mainstream tag face_dir

   // Pick out cases of "in" or "out" and give them special matrix treatment.
            dont_use_in_nice_resolve
   matrix only_in lateral_mirror_if_right_of_center [CR16E 16 CR16E 16]
            dont_use_in_nice_resolve
   matrix only_out lateral_mirror_if_right_of_center [AL16W 16 AL16W 16]

   // Otherwise, use the old code.
            dont_use_in_nice_resolve one_person_call
   setup 2x2 2x2
      preds "Illegal direction."
         if rightp   [CR0E CR1E CR2E CR3E]
         if leftp    [AL0W AL1W AL2W AL3W]
         if inp      [CR0E AL1W AL2W CR3E]
         if outp     [AL0W CR1E CR2E AL3W]
         if zigzigp  [CR0E CR1E CR2E CR3E]
         if zagzagp  [AL0W AL1W AL2W AL3W]
         if zigzagp  [CR0E CR1E AL2W AL3W]
         if zagzigp  [AL0W AL1W CR2E CR3E]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N]
         if backp    [CR0S AL1S AL2S CR3S]
   setup 2x4 2x4
      preds "Illegal direction."
         if rightp   [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp    [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp      [CR0E CR1E AL2W AL3W AL4W AL5W CR6E CR7E]
         if outp     [AL0W AL1W CR2E CR3E CR4E CR5E AL6W AL7W]
         if zigzigp  [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if zagzagp  [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if zigzagp  [CR0E CR1E CR2E CR3E AL4W AL5W AL6W AL7W]
         if zagzigp  [AL0W AL1W AL2W AL3W CR4E CR5E CR6E CR7E]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
         if backp    [CR0S AL1S CR2S AL3S AL4S CR5S AL6S CR7S]
   setup 4x2 2x4
      preds "Illegal direction."
         if rightp   [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp    [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp      [CR0E CR1E CR2E CR3E AL4W AL5W AL6W AL7W]
         if outp     [AL0W AL1W AL2W AL3W CR4E CR5E CR6E CR7E]
         if zigzigp  [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if zagzagp  [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if zigzagp  [AL0W CR1E AL2W CR3E CR4E AL5W CR6E AL7W]
         if zagzigp  [CR0E AL1W CR2E AL3W AL4W CR5E AL6W CR7E]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
         if backp    [CR0S CR1S CR2S CR3S AL4S AL5S AL6S AL7S]
   setup 1x2 1x2
      preds "Direction must be right, left, in, or out."
         if rightp   [CR0E CR1E]
         if leftp    [AL0W AL1W]
         if inp      [CR0E AL1W]
         if outp     [AL0W CR1E]
         if no_dir_p [ZM0N ZM1N]
         if backp    [CR0S AL1S]
   setup 1x4 1x4
      preds "Direction must be right, left, in, or out."
         if rightp   [CR0E CR1E CR2E CR3E]
         if leftp    [AL0W AL1W AL2W AL3W]
         if inp      [CR0E CR1E AL2W AL3W]
         if outp     [AL0W AL1W CR2E CR3E]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N]
         if backp    [CR0S AL1S AL2S CR3S]
   setup dmd dmd
      preds "Direction must be right, left, in, or out."
         if rightp   [CR0E CR1E CR2E CR3E]
         if leftp    [AL0W AL1W AL2W AL3W]
         if inp      [CR0E    0 AL2W    0]
         if outp     [AL0W    0 CR2E    0]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N]
         if backp    [CR0S   1S AL2S   3S]
   setup pmd dmd
      preds "Direction must be right, left, in, or out."
         if rightp   [CR0E CR1E CR2E CR3E]
         if leftp    [AL0W AL1W AL2W AL3W]
         if inp      [   0 CR1E    0 AL3W]
         if outp     [   0 AL1W    0 CR3E]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N]
         if backp    [  0S CR1S   2S AL3S]
   setup dhrglass dhrglass
      preds "Direction must be right, left, in, or out."
         if rightp   [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp    [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp      [CR0E AL1W AL2W    0 AL4W CR5E CR6E    0]
         if outp     [AL0W CR1E CR2E    0 CR4E AL5W AL6W    0]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup pdhrglass dhrglass
      preds "Direction must be right, left, in, or out."
         if rightp   [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp    [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp      [CR0E CR1E    0 CR3E AL4W AL5W    0 AL7W]
         if outp     [AL0W AL1W    0 AL3W CR4E CR5E    0 CR7E]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup hrglass hrglass
      preds "Direction must be right, left, in, or out."
         if rightp   [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp    [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp      [CR0E AL1W AL2W    0 AL4W CR5E CR6E    0]
         if outp     [AL0W CR1E CR2E    0 CR4E AL5W AL6W    0]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup phrglass hrglass
      preds "Direction must be right, left, in, or out."
         if rightp   [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp    [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp      [CR0E CR1E    0 CR3E AL4W AL5W    0 AL7W]
         if outp     [AL0W AL1W    0 AL3W CR4E CR5E    0 CR7E]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup galaxy galaxy
      preds "Direction must be right, left, in, or out."
         if rightp   [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp    [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp      [CR0E CR1E    0 AL3W AL4W AL5W    0 CR7E]
         if outp     [AL0W AL1W    0 CR3E CR4E CR5E    0 AL7W]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup ptpd ptpd
      preds "Direction must be right, left, in, or out."
         if rightp   [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp    [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp      [CR0E CR1E CR2E CR3E AL4W AL5W AL6W AL7W]
         if outp     [AL0W AL1W AL2W AL3W CR4E CR5E CR6E CR7E]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup pptpd ptpd
      preds "Direction must be right, left, in, or out."
         if rightp   [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp    [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp      [   0 CR1E    0 AL3W    0 AL5W    0 CR7E]
         if outp     [   0 AL1W    0 CR3E    0 CR5E    0 AL7W]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 1x8 1x8
      preds "Direction must be right, left, in, or out."
         if rightp   [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E]
         if leftp    [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W]
         if inp      [CR0E CR1E CR2E CR3E AL4W AL5W AL6W AL7W]
         if outp     [AL0W AL1W AL2W AL3W CR4E CR5E CR6E CR7E]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 2x1 1x2
      preds "Illegal direction."
         if rightp   [CR0E CR1E]
         if leftp    [AL0W AL1W]
         if zigzigp  [CR0E CR1E]
         if zagzagp  [AL0W AL1W]
         if zigzagp  [AL0W CR1E]
         if zagzigp  [CR0E AL1W]
         if no_dir_p [ZM0N ZM1N]
         if backp    [  0S   1S]
   setup 1x1 1x1
      preds "Direction must be right or left."
         if rightp   [CR0E]
         if leftp    [AL0W]
         if no_dir_p [ZM0N]
         if backp    [  0S]
   setup 3x4 3x4
      preds "Direction must be right, left, in, or out."
         if rightp   [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E CR8E CR9E CR10E CR11E]
         if leftp    [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W AL8W AL9W AL10W AL11W]
         if inp      [CR0E CR1E AL2W AL3W AL4W AL5W AL6W AL7W CR8E CR9E CR10E CR11E]
         if outp     [AL0W AL1W CR2E CR3E CR4E CR5E CR6E CR7E AL8W AL9W AL10W AL11W]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N ZM10N ZM11N]
   setup 4x3 3x4
      preds "Direction must be right, left, in, or out."
         if rightp   [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E CR8E CR9E CR10E CR11E]
         if leftp    [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W AL8W AL9W AL10W AL11W]
         if inp      [CR0E CR1E CR2E CR3E    0    0 AL6W AL7W AL8W AL9W     0     0]
         if outp     [AL0W AL1W AL2W AL3W    0    0 CR6E CR7E CR8E CR9E     0     0]
         if no_dir_p [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N ZM10N ZM11N]
   // We don't allow "in" or "out" for setups like these.  Depending on how the setup
   // is populated, the interpretation could be problematical.
   setup 4x4 4x4
      preds "Direction must be right or left."
         if rightp   [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E
                     CR8E CR9E CR10E CR11E CR12E CR13E CR14E CR15E]
         if leftp    [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W
                     AL8W AL9W AL10W AL11W AL12W AL13W AL14W AL15W]
   setup 3dmd 3dmd
      preds "Direction must be right or left."
         if rightp   [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E CR8E CR9E CR10E CR11E]
         if leftp    [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W AL8W AL9W AL10W AL11W]
   setup p3dmd 3dmd
      preds "Direction must be right or left."
         if rightp   [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E CR8E CR9E CR10E CR11E]
         if leftp    [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W AL8W AL9W AL10W AL11W]
   setup 3ptpd 3ptpd
      preds "Direction must be right or left."
         if rightp   [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E CR8E CR9E CR10E CR11E]
         if leftp    [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W AL8W AL9W AL10W AL11W]
   setup p3ptpd 3ptpd
      preds "Direction must be right or left."
         if rightp   [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E CR8E CR9E CR10E CR11E]
         if leftp    [AL0W AL1W AL2W AL3W AL4W AL5W AL6W AL7W AL8W AL9W AL10W AL11W]

call "pass @h" a1
            visible_fractions twisted_is_inherited can_be_one_side_lateral
   seq passthru [inherit_twisted]
   seq face_dir []

call "_face in" dontshow tag face_in
   matrix lateral_mirror_if_right_of_center [CR16E 16 CR16E 16]

call "_face out" dontshow tag face_out
   matrix lateral_mirror_if_right_of_center [AL16W 16 AL16W 16]

call "pass in" dontshow tag pass_in
            left_means_mirror visible_fractions twisted_is_inherited
   seq passthru [inherit_left inherit_twisted]
   seq face_in []

call "_pass out" dontshow tag pass_out
            visible_fractions twisted_is_inherited
   seq passthru [inherit_twisted]
   seq face_out []

call "_quarter in" dontshow tag quarterin
   /* We put in a 2x2 definition here so that the ends can do it
      when they are in line-like elongation.  If we just had the
      1x2 version, the ends' 2x2 setup would be divided into 1x2's,
      and the elongation would be improper for this splitting, so
      an error would be raised.  By putting in the 2x2 version,
      we are saying that the ends really can quarter in, even though
      the person they are quartering toward is a long distance away.
      This makes the last part of "load the boat" work. */
   setup 2x2 2x2
      array [CR0E AL1W AL2W CR3E]
   setup qtag qtag
      array [CR0E AL1W AL2W CR3E AL4W CR5E CR6E AL7W]
   setup 1x2 1x2
      array [CR0E AL1W]
   setup dmd dmd
      array [CR0E 0 AL2W 0]
   setup pmd dmd
      array [0 CR1E 0 AL3W]
   setup star star
      array [CR0E 0 AL2W 0]

call "_quarter out" dontshow tag quarterout
   /* See above. */
   setup 2x2 2x2
      array [AL0W CR1E CR2E AL3W]
   setup 1x2 1x2
      array [AL0W CR1E]

call "half sashay" mainstream tag half_sashay
            reverse_means_mirror
   setup 1x2 1x2 restriction forbidden all_facing_same
      array [ZM1N ZM0N]
            alternate_definition [half] mainstream
   setup 1x2 1x2 rotate restriction forbidden all_facing_same
      array [ZM1W ZM0W]
            alternate_definition [lasthalf] mainstream
   setup 2x1 1x2 rotate restriction forbidden all_facing_same
      array [ZM1W ZM0W]
            alternate_definition [single] c4
   setup 1x1 1x1
      array [ZM0N]
            alternate_definition [3x3] c4
   setup 1x3 1x3 restriction forbidden all_facing_same
      array [ZM2N ZM1N ZM0N]
            alternate_definition [half 3x3] c4
   setup 1x3 1x3 rotate restriction forbidden all_facing_same
      array [ZM2W ZM1W ZM0W]
            alternate_definition [4x4] c4
   setup 1x4 1x4 restriction forbidden all_facing_same
      array [ZM2N ZM3N ZM0N ZM1N]
            alternate_definition [half 4x4] c4
   setup 1x4 1x4 rotate restriction forbidden all_facing_same
      array [ZM2W ZM3W ZM0W ZM1W]
            alternate_definition [twisted] c4
   setup 1x2 1x2 rotate restriction forbidden couples_only
      array [AM0S AM1S]
            alternate_definition [twisted 3x3] c4
   setup 1x3 1x3 rotate restriction forbidden all_facing_same
      array [AM0S AM1S AM2S]
            alternate_definition [twisted 4x4] c4
   setup 1x4 1x4 rotate restriction forbidden all_facing_same
      array [AM0S AM1S AM2S AM3S]

call "1/2 sashay" mainstream
   alias half_sashay

call "roll away" mainstream
            reverse_means_mirror
   setup 1x2 1x2 restriction forbidden couples_only
      array [ZM1N AL0N]
            alternate_definition [half] mainstream
   setup 1x2 1x2 rotate restriction forbidden couples_only
      array [ZM1W AL0E]
            alternate_definition [twisted] c4
   setup 1x2 1x2 rotate restriction forbidden couples_only
      array [AM0S AAL1S]

call "8 roll away with a half sashay" c4
            reverse_means_mirror yoyo_is_inherited gen_sting_is_inherited diamond_is_legal visible_fractions
   seq miniwavetrade [inherit_diamond inherit_yoyo inherit_gensting]
   seq uturnback [inherit_diamond]

call "put centers in" mainstream
   setup 4x2 2x4 rotate
      array [ZM7W 0 ZM1W ZM0W ZM3W ZM2W 0 ZM4W]
   setup 2x4 2x4 rotate
      array [ZM7W 0 0 ZM0W ZM3W 0 0 ZM4W]

call "centers in" mainstream
   setup 4x2 2x4 rotate
      array [ZM7W 0 ZM1W ZM0W ZM3W ZM2W 0 ZM4W]
   setup 2x4 2x4 rotate
      array [ZM7W 0 0 ZM0W ZM3W 0 0 ZM4W]

call "_centers in if needed" dontshow tag centersinifneeded
   setup 4x2 2x4 rotate qualifier ntbone none
      array [ZM7W 0 ZM1W ZM0W ZM3W ZM2W 0 ZM4W]
   setup 2x4 2x4 qualifier ntbone none
      array [ZM0N ZM1N ZM2N ZM3N ZM4N 0 0 ZM7N]

call "put centers out" c3x
   setup 4x2 2x4 rotate
      array [ZM6W 0 ZM0W ZM1W ZM2W ZM3W 0 ZM5W]
   setup 2x4 2x4 rotate
      array [ZM6W 0 0 ZM1W ZM2W 0 0 ZM5W]

call "put trailers out" c3x
   setup 4x2 2x4 rotate qualifier in 2fl_only
      array [ZM7W ZM6W 0 0 0 0 ZM5W ZM4W]

call "split the outsides, around 1 to a line" mainstream
   setup 4x2 2x4 rotate
      array [ZM6W 0 AL0E ZM1W ZM2W CR3E 0 ZM5W]

call "_start a separate" dontshow tag start_separate
   // If given without a selector, it is implicitly the centers if they
   // are facing out of the 2x4 ("Heads pass thru, separate, around N ....")
   // or the ends otherwise ("separate, around N ..." from a DPT.)
   // That's the best we can do.  If you want something else, use an explicit
   // selector, getting the call just below.
   setup 4x2 2x4 qualifier tbone none
      array [ZM1N    0    0 ZM2N ZM5N 0 0 ZM6N]
   setup 2x4 2x4 qualifier tbone none
      array [   0 AL0S CR3S    0    0 0 0    0]
   setup 4x2 2x4 rotate
      array [ZM7W ZM6W ZM1W AL0E CR3E ZM2W ZM5W ZM4W]
   setup 2x4 2x4 rotate
      array [   0 ZM6W ZM1W    0    0 ZM2W ZM5W    0]

call "_ @6 start a separate" dontshow tag anyone_start_separate
   setup 2x4 2x4 qualifier centers_sel
      array [ZM1N AL0S CR3S ZM2N ZM5N 0 0 ZM6N]
   setup 4x2 2x4 qualifier centers_sel
      array [ZM1N    0    0 ZM2N ZM5N 0 0 ZM6N]
   setup 2x4 2x4 rotate qualifier ends_sel
      array [   0 ZM6W ZM1W    0    0 ZM2W ZM5W    0]
   setup 4x2 2x4 rotate qualifier ends_sel
      array [ZM7W ZM6W ZM1W AL0E CR3E ZM2W ZM5W ZM4W]
   setup 4x4 4x4
      predscantdo
         if select   [  0    0    0 0 0 ZM2N  ZM9N 0  0     0     0 0 0 AL10S CR1S 0]
         if unselect [  0 ZM3N ZM7N 0 0 ZM7N ZM11N 0  0 ZM11N ZM15N 0 0 ZM15N ZM3N 0]

call "_ check a rigger" dontshow tag check_rigger
   setup prigger rigger
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup pqtag qtag restriction unusual alwaysfail
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]

call "_start left and right" dontshow tag goleftandright
   setup pqtag 2x4 rotate
      array [ZM6W ZM1W AL0E CR3E ZM2W ZM5W 0 0]
   setup qtag 2x4 rotate
      array [ZM6W ZM1W    0    0 ZM2W ZM5W 0 0]
   setup prigger 2x4 rotate
      array [ZM6W ZM1W AL0E CR3E ZM2W ZM5W 0 0]
   setup rigger 2x4 rotate
      array [ZM6W ZM1W    0    0 ZM2W ZM5W 0 0]

call "_start right and left" dontshow tag gorightandleft
   setup pqtag 2x4 rotate
      array [ZM6W ZM1W CR3E AL0E ZM2W ZM5W 0 0]
   setup qtag 2x4 rotate
      array [ZM6W ZM1W    0    0 ZM2W ZM5W 0 0]
   setup prigger 2x4 rotate
      array [ZM6W ZM1W CR3E AL0E ZM2W ZM5W 0 0]
   setup rigger 2x4 rotate
      array [ZM6W ZM1W    0    0 ZM2W ZM5W 0 0]

call "_go around @9 to a line" dontshow tag go_around_n
            neednumber

   // For odd numbers, they go around the Nth person and turn a sharp
   // corner, to become centers facing in, as if centers of lines,
   // squeezing the others out lateral to themselves.
   // (But the others' facing directions don't actually matter,
   // so it isn't necessarily lines.)

   // For even numbers, they go around the Nth person and hook onto the end,
   // as if ends of lines.  (But the others' facing directions don't
   // actually matter, so it isn't necessarily lines.)

   setup 2x4 2x4 rotate qualifier num 1 none
      array [   0 ZM7W ZM0W    0 AL2S ZM3W ZM4W CR5N]
   setup 4x2 2x4 rotate qualifier num 1 none
      array [   0 ZM7W ZM0W    0    0 ZM3W ZM4W    0]
   setup 2x4 2x4 rotate qualifier num 2 none
      array [   0 ZM6W ZM1W    0 AL0S ZM2W ZM5W CR7N]
   setup 4x2 2x4 rotate qualifier num 2 none
      array [   0 ZM6W ZM1W    0    0 ZM2W ZM5W    0]
   setup 2x4 2x4 rotate qualifier num 3 none
      array [   0 ZM7W ZM0W    0 AL6N ZM3W ZM4W CR1S]
   setup 4x2 2x4 rotate qualifier num 3 none
      array [   0 ZM7W ZM0W    0    0 ZM3W ZM4W    0]

call "_go around @9 and into the middle" dontshow tag go_around_n_into_middle
            neednumber
   // For this call, in all cases they turn the corner around the last person,
   // make a couple in the center of the 2x4, pushing the inactives out behind them,
   // and do the call.
   setup 2x4 2x4 qualifier num 1 none
      array [  0 ZM0N ZM3N   0   A5W ZM4N ZM7N C6E]
   setup 4x2 2x4 qualifier num 1 none
      array [  0 ZM0N ZM3N   0     0 ZM4N ZM7N   0]
   setup 2x4 2x4 qualifier num 2 none
      array [  0 ZM0N ZM3N   0   A2S ZM4N ZM7N C1S]
   setup 4x2 2x4 qualifier num 2 none
      array [  0 ZM0N ZM3N   0     0 ZM4N ZM7N   0]
   setup 2x4 2x4 qualifier num 3 none
      array [  0 ZM0N ZM3N   0   A1E ZM4N ZM7N C2W]
   setup 4x2 2x4 qualifier num 3 none
      array [  0 ZM0N ZM3N   0     0 ZM4N ZM7N   0]

call "separate, around @9 to a line" mainstream
            neednumber
   seq start_separate []
   seq go_around_n []

call "separate, around @9, into the middle for a @0" mainstream
            neednumber
   seq start_separate []
   seq go_around_n_into_middle []
   seq ctrsanything []

call "@6 separate, around @9 to a line" mainstream
            neednumber
   seq anyone_start_separate [normalize]
   seq go_around_n []

call "@6 separate, around @9, into the middle for a @0" mainstream
            neednumber
   seq anyone_start_separate [normalize]
   seq go_around_n_into_middle []
   seq ctrsanything []

call "first go left, next go right, around @9 to a line" mainstream
            neednumber
   seq goleftandright []
   seq go_around_n []

call "first go right, next go left, around @9 to a line" mainstream
            neednumber
   seq gorightandleft []
   seq go_around_n []

call "first go left, next go right, to ends of a line" mainstream
   seq check_rigger []
   seq goleftandright []

call "first go right, next go left, to ends of a line" mainstream
   seq check_rigger []
   seq gorightandleft []

call "centers split the outsides, first go left, next go right" mainstream
   setup bone 2x4 rotate
      array [ZM6W ZM1W 0 0 ZM2W ZM5W 0 0]
   setup pbone 2x4 rotate
      array [ZM6W ZM1W AL0E CR3E ZM2W ZM5W 0 0]

call "centers split the outsides, first go right, next go left" mainstream
   setup bone 2x4 rotate
      array [ZM6W ZM1W 0 0 ZM2W ZM5W 0 0]
   setup pbone 2x4 rotate
      array [ZM6W ZM1W CR3E AL0E ZM2W ZM5W 0 0]

call "@6 split the others, first go left, next go right" mainstream
   setup c1phan 2x6
      preds "People aren't designated consistently."
         if unselect         [ZM1N 0 ZM2N 0 0 ZM4N 0 ZM3N ZM7N 0 ZM8N 0 0 ZM10N 0 ZM9N]
         if conc_from_select [0 0 0 0 0 0 0 0 0 CR5S 0 AL2S CR3S 0 AL0S 0]

call "@6 split the others, first go right, next go left" mainstream
   setup c1phan 2x6
      preds "People aren't designated consistently."
         if unselect         [ZM1N 0 ZM2N 0 0 ZM4N 0 ZM3N ZM7N 0 ZM8N 0 0 ZM10N 0 ZM9N]
         if conc_from_select [0 0 0 0 0 0 0 0 0 AL2S 0 CR5S AL0S 0 CR3S 0]

call "pass thru" mainstream tag passthru
/* **** can't do rear_back if doing last half! */
            rear_back_from_r_wave left_means_mirror
            12_16_matrix_means_split
            funny_means_those_facing
   setup 2x1 1x2
      array [ZM1N 0]
   /* We put in this next definition to allow it from T-boned boxes
      (which would otherwise get the "People are not working with each other
      in a consistent way" error).  The restriction will make it give a
      "do your part" warning when used in this way. */
   setup 2x2 2x2 no_cutting_through
                 qualifier tbone in independent_in_or_out
                 restriction alwaysfail
      array [0 0 ZM1N ZM0N]
            alternate_definition [magic] c2
   setup 4x2 2x4 qualifier in in_or_out
      array [ZM6N 0 ZM4N 0 0 ZM3N 0 ZM1N]
            alternate_definition [half] mainstream
   setup 2x1 1x2 rotate
      array [ZM0W 0]
            alternate_definition [lasthalf] mainstream
   setup 1x2 1x2 rotate
      array [ZM0W 0]
            alternate_definition [twisted] c4
   setup 2x1 1x2 rotate
      array [CM1N 0]

call "_left pass thru" dontshow tag leftpassthru
            left_means_mirror
   setup 2x1 1x2
      array [ZM1N 0]
            alternate_definition [twisted] c4
   setup 2x1 1x2 rotate
      array [AM0S 0]

call "_start do-sa-do" dontshow tag dosodo1
            rear_back_from_r_wave left_means_mirror
   setup 2x1 1x2
      array [ZM1N 0]
            alternate_definition [half] mainstream
   setup 2x1 1x2 rotate
      array [ZM0W 0]
            alternate_definition [lasthalf] mainstream
   setup 1x2 1x2 rotate qualifier right wave_only
      array [ZM0W 0]
            alternate_definition [twisted] c4
   setup 2x1 1x2 rotate
      array [CM1N 0]

call "_finish do-sa-do" dontshow tag dosodo2
            left_means_mirror
   setup 2x1 1x2
      array [0 ZM0N]
            alternate_definition [half] mainstream
   setup 2x1 1x2 rotate
      array [0 ZM1W]
            alternate_definition [lasthalf] mainstream
   setup 1x2 1x2 rotate qualifier left wave_only
      array [0 ZM1W]

/* The way this is defined it would appear to have 2 parts.
   That is, of course, all wrong.  The call has fractions,
   but not parts.  Unfortunately, we have to do it this way
   in order to fractionalize it into fourths.  Would any caller
   use this with "random" or "interlace"?  We hope not. */
call "do-sa-do" mainstream
            visible_fractions twisted_is_inherited left_means_mirror
   seq dosodo1 [inherit_left inherit_twisted]
   seq dosodo2 [inherit_left]

call "touch" mainstream tag touch
            // The "rear back" property is required for square thru, etc.
            rear_back_from_r_wave left_means_mirror
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [ZM0W 0]
   // This is for handling things from a triangle-become-box.  Cf. t42t.
   setup 2x2 1x4 no_cutting_through qualifier in in_or_out
      array [0 0 ZM3N ZM0N]
            alternate_definition [twisted] c4
   // This really should be marked controversial,
   // but I'm too much of a wimp to do it.
   setup 2x1 1x2 qualifier in in_or_out
      array [CR1E 0]

call "step to a wave" mainstream
   alias touch

call "touch 1/4" dontshow tag touch_1_4
            rear_back_from_r_wave left_means_mirror
   setup 2x1 1x2 qualifier in in_or_out
      array [CR1E 0]
            alternate_definition [fractal] c4
   setup 2x1 1x2 qualifier in in_or_out
      array [CR0W 0]
            alternate_definition [generous] c3
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [CR1E 0]
            alternate_definition [stingy] c3
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [ZM0W 0]

call "left touch 1/4" dontshow tag left_touch_1_4
            left_means_mirror   // That is, it means RIGHT touch 1/4.
            reverse_means_mirror 12_16_matrix_means_split
   setup 2x1 1x2 qualifier in in_or_out
      array [AL1W 0]
            alternate_definition [fractal] c4
   setup 2x1 1x2 qualifier in in_or_out
      array [AL0E 0]
            alternate_definition [generous] c3
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [AL0E 0]
            alternate_definition [stingy] c3
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [ZM1W 0]

call "touch 3/4" dontshow tag touch_3_4
            rear_back_from_r_wave left_means_mirror
   setup 2x1 1x2 qualifier in in_or_out
      array [CR0W 0]
            alternate_definition [fractal] c4
   setup 2x1 1x2 qualifier in in_or_out
      array [CR1E 0]
            alternate_definition [generous] c3
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [CR0W 0]
            alternate_definition [stingy] c3
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [CR1E 0]

call "touch @b" mainstream tag touch_n_4
            visible_fractions rear_back_from_r_wave neednumber
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            twisted_is_inherited diamond_is_legal left_means_mirror
   seq touch [inherit_left inherit_diamond inherit_twisted]
   seq armturn_n4 [inherit_diamond inherit_yoyo inherit_fractal inherit_gensting]

call "touch @9/8" mainstream
            rear_back_from_r_wave neednumber
            left_means_mirror
   seq touch [inherit_left]
   seq armturn_n4 [force_half]

call "cast off @9/8" mainstream
            neednumber
   seq cast_off_n4 [force_half]

call "_leftable touch" dontshow tag lft_touch
            left_means_mirror 12_16_matrix_means_split
   setup 2x1 1x2 rotate
      array [ZM0W 0]
            alternate_definition [twisted] c4
   setup 2x1 1x2
      array [CR1E 0]

call "_righttable left touch" dontshow tag rightable_left_touch
            left_means_mirror
   setup 2x1 1x2 rotate
      array [ZM1W 0]

call "_leftable touch @b" dontshow tag lftble_touch_n_4
            neednumber left_means_mirror bigmatrix_is_inherited
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq lft_touch [inherit_left inherit_bigmatrix]
   seq armturn_n4 [inherit_bigmatrix inherit_yoyo inherit_fractal inherit_gensting]

call "_soft touch part 1" dontshow tag soft_touch1
            gen_sting_is_inherited
   singleconc hinge_with_warn [inherit_gensting] quarterin []

call "_soft @2touch@3 part 2" dontshow tag soft_touch2
   singlecrossconc touch [or_anycall] uturnaway []

call "_soft @0 part 2" dontshow tag soft_touch2_any
   seq soft_touch2_any1 []
   seq soft_touch2_any2 []

call "_soft any part 2.1" dontshow tag soft_touch2_any1
   singlecrossconc nullcall [] uturnaway []

call "_soft @0 part 2.2" dontshow tag soft_touch2_any2
   singleconc_together nullcall [mandatory_anycall] nullcall [conc_force_spots]

call "_soft touch @b part 2" dontshow tag soft_touch2_n_4
            neednumber gen_sting_is_inherited
   singlecrossconc touch_n_4 [inherit_gensting] uturnaway []

call "soft @2touch@3" c4a
            visible_fractions gen_sting_is_inherited
   seq soft_touch1 [inherit_gensting]
   seq soft_touch2 []

call "soft @0" c4a
            visible_fractions gen_sting_is_inherited
   seq soft_touch1 [inherit_gensting]
   seq soft_touch2_any []

call "soft touch @b" c4a
            visible_fractions neednumber gen_sting_is_inherited
   seq soft_touch1 [inherit_gensting]
   seq soft_touch2_n_4 [inherit_gensting]

// Beware!!!  This is a problematical and easily abused call.
call "box the gnat" mainstream
   setup 2x1 1x2 qualifier live in in_or_out
      predscantdocallinsetup
         if x12_boy_with_girl [CR1S 0]
         if x12_girl_with_boy [AL1S 0]
         if always [0 0]
   setup 2x1 1x2 qualifier in in_or_out
      predscantdocallinsetup
         if boyp [CR1S 0]     // Legal if facing a phantom.
         if girlp [AL1S 0]
         if always [0 0]
   setup 1x2 1x2 rotate qualifier live right wave_only
      predscantdocallinsetup
         if x12_boy_with_girl [CR0E 0]
         if x12_girl_with_boy [AL0E 0]
         if always [0 0]
   setup 1x2 1x2 rotate qualifier right wave_only
      predscantdocallinsetup
         if boyp [CR0E 0]
         if girlp [AL0E 0]
         if always [0 0]

// Beware!!!  This is a problematical and easily abused call.
call "swat the flea" c4
   setup 2x1 1x2 qualifier live in in_or_out
      predscantdocallinsetup
         if x12_boy_with_girl [AL1S 0]
         if x12_girl_with_boy [CR1S 0]
         if always [0 0]
   setup 2x1 1x2 qualifier in in_or_out
      predscantdocallinsetup
         if boyp [AL1S 0]     // Legal if facing a phantom.
         if girlp [CR1S 0]
         if always [0 0]
   setup 1x2 1x2 rotate qualifier live left wave_only
      predscantdocallinsetup
         if x12_boy_with_girl [0 AL0E]
         if x12_girl_with_boy [0 CR0E]
         if always [0 0]
   setup 1x2 1x2 rotate qualifier left wave_only
      predscantdocallinsetup
         if boyp [0 AL0E]
         if girlp [0 CR0E]
         if always [0 0]

call "single circle to a wave" plus
            reverse_means_mirror
            twisted_is_inherited singlefile_is_inherited visible_fractions
   seq circle4_n [inherit_reverse force_single inherit_twisted
                 inherit_singlefile insert_number 2]
   seq touch [inherit_left]

call "single circle @b to a wave" plus
            reverse_means_mirror neednumber
            twisted_is_inherited singlefile_is_inherited visible_fractions
   seq circle4_n [inherit_reverse force_single inherit_twisted
                 inherit_singlefile]
   seq touch [inherit_left]

call "circle to a 2-faced line" c4
            reverse_means_mirror
   setup 2x2 1x4 restriction not_tboned
      array [0 0 C3S C2S]
            alternate_definition [singlefile] c4
   setup 4x1 1x4 rotate
      array [C3E C2E 0 0]
            alternate_definition [2x1] c4
   setup trngl 1x3
      array [C2S 0 0 0 C1S C2S]
            alternate_definition [3x3] c4
   setup 2x3 1x6
      array [0 0 0 C5S C4S C3S]
            alternate_definition [4x4] c4
   setup 2x4 1x8
      array [0 0 0 0 C6S C7S C5S C4S]

call "single circle to a line" c4
            reverse_means_mirror
   setup 2x1 1x2 rotate
      preds "Unknown sex."
         if boyp [R1E 0]
         if girlp [R1W 0]

call "change the apex @b x @b" c4a
            left_means_mirror need_two_numbers
   seq start_first_change_apex [inherit_left]
   seq continue_change_apex [repeat_nm1]
   seq start_second_change_apex [inherit_left]
   seq continue_change_apex [repeat_nm1 shift_one_number]

call "_start first change apex" dontshow tag start_first_change_apex
            left_means_mirror
   setup trngl 1x3 rotate qualifier miniwaves
      array [0 CR0N AL0S 0 AL1S CR1N]
   setup trngl 1x3 rotate
      array [0 CR0N AL1S 0 AL2S CR1N]
   setup ptrngl 1x3 rotate
      array [ZM2W 0 0 ZM0W 0 0]

call "_start second change apex" dontshow tag start_second_change_apex
            left_means_mirror
   setup 1x3 trngl rotate
      predscantdocallinsetup
         if apex_test_3 [CR5N CR1N AL1S]
         if apex_test_2 [ZM0W AL5S ZM3W]
         if apex_test_1 [CR5N CR1N AL2S]
         if always      [ZM0W AL4S ZM3W]

call "_continue change apex" dontshow tag continue_change_apex
   setup trngl 1x3 rotate
      array [0 CR0N AL0S 0 AL1S CR1N]
   setup ptrngl 1x3 rotate
      array [ZM2W 0 0 ZM0W 0 0]
   setup 1x3 trngl rotate
      predscantdocallinsetup
         if apex_test_1 [ZM0W AL5S ZM3W]
         if always      [CR5N CR1N AL1S]

call "pitch @h" c4a
   setup 2x1 1x2
      preds "Direction must be right or left."
         if rightp   [CR1E CR0W]
         if leftp    [AL1W CR0W]
         if no_dir_p [ZM1N CR0W]
   setup 2x2 2x2
      preds "Direction must be given."
         if rightp   [CR3W CR2W CR1E CR0E]
         if leftp    [CR3W CR2W AL1W AL0W]
         if inp      [CR3W CR2W AL1W CR0E]
         if outp     [CR3W CR2W CR1E AL0W]
         if no_dir_p [CR3W CR2W ZM1N ZM0N]

call "left pitch @h" c4a
   setup 2x1 1x2
      preds "Direction must be right or left."
         if rightp   [CR1E AL0E]
         if leftp    [AL1W AL0E]
         if no_dir_p [ZM1N AL0E]
   setup 2x2 2x2
      preds "Direction must be given."
         if rightp   [AL3E AL2E CR1E CR0E]
         if leftp    [AL3E AL2E AL1W AL0W]
         if inp      [AL3E AL2E AL1W CR0E]
         if outp     [AL3E AL2E CR1E AL0W]
         if no_dir_p [AL3E AL2E ZM1N ZM0N]

// The consensus seems to be that the leaders can roll, because they did it
// as one smooth motion.  Or something.  I'm tired of hearing about that.
call "leads roll @eright@f to a wave" a1
            left_means_mirror
   setup 2x1 1x2 rotate qualifier all_facing_same
      array [ZM0W CR1E]
   setup 2x1 1x2 rotate
      array [0 CR1E]

call "roll @eright@f to a wave" a1
            left_means_mirror
   setup 2x1 1x2 rotate qualifier all_facing_same
      array [ZM0W CR1E]
   setup 2x1 1x2 rotate
      array [0 CR1E]

// The "official" spellings.
call "leads @eright@f roll to a wave" a1
            left_means_mirror
   setup 2x1 1x2 rotate qualifier all_facing_same
      array [ZM0W CR1E]
   setup 2x1 1x2 rotate
      array [0 CR1E]

call "@eright@f roll to a wave" a1
            left_means_mirror
   setup 2x1 1x2 rotate qualifier all_facing_same
      array [ZM0W CR1E]
   setup 2x1 1x2 rotate
      array [0 CR1E]

// Latch on is legal even if both people are facing.
call "permissive leads roll @eright@f to a wave" dontshow tag permissiveleadsrollright
            left_means_mirror
   setup 2x1 1x2 rotate
      array [ZM0W CR1E]

call "leads @e@f latch on" c3a
            left_means_mirror visible_fractions
   seq permissiveleadsrollright [inherit_left]
   seq hinge_with_warn []

call "leads @e@f latch on @b" c3a
            left_means_mirror visible_fractions neednumber
   seq permissiveleadsrollright [inherit_left]
   seq hinge_with_warn [repeat_n]

call "latch on" c3a
            left_means_mirror visible_fractions
   seq permissiveleadsrollright [inherit_left]
   seq hinge_with_warn []

call "latch on @b" c3a
            left_means_mirror visible_fractions neednumber
   seq permissiveleadsrollright [inherit_left]
   seq hinge_with_warn [repeat_n]

call "_like a slide thru" dontshow tag likeaslidethru
   setup 1x1 1x1
      preds "Unknown sex."
         if boyp [CR0E]
         if girlp [AL0W]
            alternate_definition [half] mainstream
   setup 1x1 1x1 plus_eighth_rotation
      preds "Unknown sex."
         if boyp  [CR0N]
         if girlp [AL0W]
   setup 2x2 star plus_eighth_rotation
      preds "Unknown sex."
         if boyp  [CR0N CR1N CR2N CR3N]
         if girlp [AL0W AL1W AL2W AL3W]
            alternate_definition [lasthalf] mainstream
   setup 1x1 1x1 plus_eighth_rotation
      preds "Unknown sex."
         if boyp  [CR0N]
         if girlp [AL0W]
   setup 2x2 star plus_eighth_rotation
      preds "Unknown sex."
         if boyp  [CR0N CR1N CR2N CR3N]
         if girlp [AL0W AL1W AL2W AL3W]

call "slide thru" mainstream tag slidethru
            rear_back_from_r_wave funny_means_those_facing
   setup 2x1 1x2 qualifier in in_or_out
      preds "Unknown sex."
         if boyp [CR1E 0]
         if girlp [AL1W 0]
            alternate_definition [twisted] c4
   setup 2x1 1x2 rotate qualifier in in_or_out
      preds "Unknown sex."
         if boyp [CR1E 0]
         if girlp [CAL1W 0]
            rear_back_from_r_wave visible_fractions twisted_is_inherited
   seq passthru [inherit_twisted]
   seq likeaslidethru []

call "slide thru in miniwave" dontshow tag slidethru_in_miniwave
   setup 1x2 1x2 rotate qualifier miniwaves
      preds "Unknown sex."
         if boyp_rh_slide_thru [CR0N CR0N]
         if girlp_rh_slide_thru [AL0S AL0S]

call "brace thru" a1 tag bracethru
            rear_back_from_r_wave visible_fractions twisted_is_inherited funny_is_inherited
   seq passthru [inherit_twisted inherit_funny]
   seq brace_yourself []

call "half breed thru" a1
   alias bracethru

call "brace yourself" c4 tag brace_yourself
   setup 1x2 1x2 qualifier left opposite_sex restriction forbidden couples_only
      array [AL1S AL0S]
   setup 1x2 1x2 qualifier right opposite_sex restriction forbidden couples_only
      array [CR0S AL1S]
            alternate_definition [half] mainstream
   setup 1x2 1x2 rotate qualifier left opposite_sex restriction forbidden couples_only
      array [AL1S AL0S]
   setup 1x2 1x2 qualifier right opposite_sex restriction forbidden couples_only
      array [CR0E AL1W]

call "with magnetism" c4
   setup 1x2 1x2
      preds "Unknown sex."
         if lateral_to_same_sex     [AL0W CR1E]
         if lateral_to_opposite_sex [CR0E AL1W]
   setup 2x2 2x2
      preds "Unknown sex."
         if lateral_to_same_sex     [AL0W CR1E CR2E AL3W]
         if lateral_to_opposite_sex [CR0E AL1W AL2W CR3E]

call "cross breed thru" c4
            rear_back_from_r_wave
   setup 2x2 2x2
      preds "Unknown sex."
         if boyp [0 0 R1E R1E]
         if girlp [0 0 L0W L0W]

call "star thru" mainstream tag star_thru
            funny_means_those_facing
   setup 2x1 1x2 restriction forbidden opposite_sex
      preds "Unknown sex."
         if boyp [CR1E 0]
         if girlp [AL1W 0]

/* Is this a real call these days? */
call "_left star thru" dontshow tag left_star_thru
   setup 2x1 1x2 restriction forbidden opposite_sex
      preds "Unknown sex."
         if boyp [AL1W 0]
         if girlp [CR1E 0]

call "double star thru" a1
            visible_fractions
   seq star_thru  []
   seq left_star_thru []

call "_first star thru" dontshow tag first_star_thru
   setup 4x2 2x4 qualifier ntbone in 2fl_only
      preds "Unknown sex."
         if boyp  [ZM0N CR2E 0 0 0 0    0 ZM7N]
         if girlp [ZM0N    0 0 0 0 0 AL5W ZM7N]
   setup 4x2 2x4 qualifier in independent_in_or_out
      preds "Unknown sex."
         if boyp  [CR1E 0 CR3E 0 0    0 0    0]
         if girlp [   0 0    0 0 0 AL4W 0 AL6W]
   setup 2x4 2x4 qualifier tbone in independent_in_or_out
      preds "Unknown sex."
         if boyp  [0 0 0 0    0 ZM5N    0 ZM7N]
         if girlp [0 0 0 0 ZM4N    0 ZM6N    0]

call "_second star thru" dontshow tag second_star_thru
   setup 4x2 2x4 qualifier tbone in conc_cpls_same
      preds "Unknown sex."
         if boyp  [ZM0N 0 0 0 0 0 0 ZM7N]
         if girlp [ZM0N 0 0 0 0 0 0 ZM7N]
   setup 2x4 2x4 qualifier tbone in conc_cpls_same
      preds "Unknown sex."
         if boyp  [0 0 0 0 0    0 AL1W 0]
         if girlp [0 0 0 0 0 CR2E    0 0]
   setup 2x4 2x4 qualifier live ntbone in in_or_out
      preds "Unknown sex."
         if boyp  [0 0 0 0    0 AL2W    0 AL0W]
         if girlp [0 0 0 0 CR3E    0 CR1E    0]
   setup 2x4 2x4 qualifier ntbone in in_or_out
      preds "Unknown sex."
         if boyp  [0 0 0 0 0 AL2W AL1W  0]
         if girlp [0 0 0 0 0 CR2E CR1E 0]

call "_third star thru" dontshow tag third_star_thru
   setup 4x2 2x4 qualifier out in_or_out
      preds "Unknown sex."
         if boyp  [0    0 0 ZM3N ZM4N 0 CR5E 0]
         if girlp [0 AL2W 0 ZM3N ZM4N 0    0 0]
   setup 4x2 2x4 qualifier in in_or_out
      preds "Unknown sex."
         if boyp  [   0 0    0 0 0 CR4E 0 CR6E]
         if girlp [AL1W 0 AL3W 0 0    0 0    0]

call "triple star thru" a1
            visible_fractions
   seq first_star_thru []
   seq second_star_thru [roll_transparent]
   seq third_star_thru [roll_transparent]

call "first couple go left, next go right" mainstream
   setup 4x2 2x4 rotate restriction forbidden 2fl_only
      array [0 0 CR3E AL1E AL0E CR2E 0 0]

call "first couple go right, next go left" mainstream
   setup 4x2 2x4 rotate restriction forbidden 2fl_only
      array [0 0 AL1E CR3E CR2E AL0E 0 0]

call "first couple go right, next go right, keep walking" mainstream
            imprecise_rotation
   setup 4x2 thar
      array [0 0 4E 6S 7S 5E 0 0]

call "first couple go left, next go left, keep walking" mainstream
            imprecise_rotation
   setup 4x2 thar
      array [0 0 5W 3S 2S 4W 0 0]

call "wheel and deal" mainstream tag wheelanddeal
            left_means_mirror
   setup 1x4 2x2 restriction forbidden couples_only
      predscantdocallinsetup
         if 1x4_wheel_and_deal [CR1S CR0S AL0S AL1S]   // 2FL, or beau side of 1FL
         if always             [0    0    AL3S AL2S]   // belle side of 1FL
   setup 1x3 trngl qualifier 1fl_only restriction unusual alwaysfail
      array [CR3S AL4S AL5S]       // We flag it as "unusual" in a line of 3,
                                   // unless the caller says "2x1".
            alternate_definition [single] a2
   setup 1x2 1x2 rotate
      predscantdocallinsetup
         if 1x2_beau_or_miniwave [CR0E AL0E]
         if always [0 AL1E]
            alternate_definition [3x3] c4
   setup 1x6 2x3 restriction forbidden 3x3couples_only
      predscantdocallinsetup
         if 1x6_wheel_and_deal [CR2S CR1S CR0S AL0S AL1S AL2S]   /* 2FL, or beau side of 1FL */
         if always             [0    0    0    AL5S AL4S AL3S]   /* belle side of 1FL */
            alternate_definition [4x4] c4
   setup 1x8 2x4 restriction forbidden 4x4couples_only
      predscantdocallinsetup
         /* 2FL, or beau side of 1FL */
         if 1x8_wheel_and_deal [CR3S CR2S CR0S CR1S AL0S AL1S AL3S AL2S]
         /* belle side of 1FL */
         if always             [0    0    0    0    AL7S AL6S AL4S AL5S]
            alternate_definition [6x6] c4
   setup 1x12 2x6 restriction forbidden 3x3couples_only
      array [CR5S CR4S CR3S CR2S CR1S CR0S AL0S AL1S AL2S AL3S AL4S AL5S]
            alternate_definition [8x8] c4
   setup 1x16 2x8 restriction forbidden 4x4couples_only
      array [CR7S CR6S CR5S CR4S CR3S CR2S CR1S CR0S AL0S AL1S AL2S AL3S AL4S AL5S AL6S AL7S]
            alternate_definition [straight] c4
   setup 2x4 2x4 rotate restriction 2fl_only
      array [CR0E CR7E AL0E AL7E ZM1W AL2E CR5E ZM6W]

call "two-faced wheel and deal" dontshow tag 2facedwheelanddeal
   setup 1x4 2x2 restriction forbidden couples_only
      array [CR1S CR0S AL0S AL1S]
            alternate_definition [single] a2
   setup 1x2 1x2 rotate
      array [CR0E AL0E]
            alternate_definition [3x3] c4
   setup 1x6 2x3 restriction forbidden 3x3couples_only
      array [CR2S CR1S CR0S AL0S AL1S AL2S]
            alternate_definition [4x4] c4
   setup 1x8 2x4 restriction forbidden 4x4couples_only
      array [CR3S CR2S CR0S CR1S AL0S AL1S AL3S AL2S]

call "turn and deal" a1 tag turnanddeal
            left_means_mirror
   setup 1x4 2x2 no_cutting_through restriction awkward_centers
      array [CR0S CR1S AL2S AL3S]
            alternate_definition [single] c3a
   setup 1x2 1x2 rotate restriction awkward_centers
      array [CR0E AL1E]
            alternate_definition [3x3] c4
   setup 1x6 2x3 qualifier 3x3couples_only restriction awkward_centers
      array [CR0S CR1S CR2S AL3S AL4S AL5S]
            alternate_definition [4x4] c4
   setup 1x8 2x4 qualifier 4x4couples_only restriction awkward_centers
      array [CR0S CR1S CR3S CR2S AL4S AL5S AL7S AL6S]

call "_natural turn and deal" dontshow tag natturnanddeal
            left_means_mirror
   setup 1x4 2x2 restriction forbidden couples_only
      predscantdocallinsetup
         if 1x4_wheel_and_deal [CR0S CR1S AL1S AL0S]   /* 2FL, or beau side of 1FL */
         if always             [0    0    AL2S AL3S]   /* belle side of 1FL */
            alternate_definition [single] c3x
   setup 1x2 1x2 rotate
      predscantdocallinsetup
         if 1x2_beau_or_miniwave [CR0E AL0E]
         if always [0 AL1E]

call "more or less turn and deal" c4
            left_means_mirror
   setup 2x4 2x4 rotate restriction awkward_centers
      array [CR7S CR0S AL6N AL1N AL3S AL4S CR2N CR5N]

call "less or more turn and deal" c4
            left_means_mirror
   setup 2x4 2x4 rotate restriction awkward_centers
      array [CR7N CR0N AL6S AL1S AL3N AL4N CR2S CR5S]

call "shuffle the deck" c4
            reverse_means_mirror left_means_mirror
   setup 1x4 2x2 restriction 1fl_only
      array [ZGM3N ZGM2N ZFM1N ZFM0N]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate restriction couples_only
      array [ZGM1W ZFM0W]
            alternate_definition [3x3] c4
   setup 1x6 2x3 restriction 1fl_only
      array [ZGM5N ZGM4N ZGM3N ZFM2N ZFM1N ZFM0N]
            alternate_definition [4x4] c4
   setup 1x8 2x4 restriction 1fl_only
      array [ZGM7N ZGM6N ZGM4N ZGM5N ZFM3N ZFM2N ZFM0N ZFM1N]
            alternate_definition [3x3 single] c4
   setup 1x3 1x3 rotate restriction couples_only
      array [ZGM2W ZM1W ZFM0W]
            alternate_definition [4x4 single] c4
   setup 1x4 1x4 rotate restriction couples_only
      array [ZGM2W ZFM3W ZFM0W ZGM1W]

call "single shuffle" c4 tag sglshuffle
            reverse_means_mirror
   setup 1x2 1x2 rotate restriction couples_only
      array [ZGM1W ZFM0W]
            alternate_definition [3x3] c4
   setup 1x3 1x3 rotate restriction couples_only
      array [ZGM2W ZM1W ZFM0W]
            alternate_definition [4x4] c4
   setup 1x4 1x4 rotate restriction couples_only
      array [ZGM2W ZGM3W ZFM0W ZFM1W]

call "shuffle and wheel" c4
            reverse_means_mirror left_means_mirror
   setup 1x4 2x2 restriction 1fl_only
      array [ZGM3N ZGM2N AL0S AL1S]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate restriction couples_only
      array [ZGM1W AL0E]
            alternate_definition [3x3] c4
   setup 1x6 2x3 restriction 1fl_only
      array [ZGM5N ZGM4N ZGM3N AL0S AL1S AL2S]
            alternate_definition [4x4] c4
   setup 1x8 2x4 restriction 1fl_only
      array [ZGM7N ZGM6N ZGM4N ZGM5N AL0S AL1S AL3S AL2S]
            alternate_definition [straight] c4
   setup 2x4 2x4 rotate
      array [0 0 0 0 ZFM1W AL2E ZGM3W ZGM4W]

call "_spread after wheel" dontshow tag spread_after_wheel
   setup 2x2 1x4 qualifier all_facing_same restriction controversial alwaysfail
      array [ZM0N ZM2N ZM3N ZM1N]
   setup trngl 1x3 qualifier 2fl_only
      array [ZM1N ZM0N ZM2N 0 0 0]
            alternate_definition [2x1] mainstream
   setup trngl 1x3 qualifier 2fl_only
      array [ZM1N ZM0N ZM2N 0 0 0]

call "_wheel before spread" dontshow tag wheel_before_spread
            left_means_mirror
   setup 1x4 2x2 restriction forbidden couples_only
      predscantdocallinsetup
         // If belle-side people can't tell, opt for a 1FL.
         if 1x4_wheel_and_deal_or_1fl [CR1S CR0S AL0S AL1S]   /* 2FL, or beau side of 1FL */
         if always             [0    0    AL3S AL2S]   /* belle side of 1FL */
   setup 1x3 trngl qualifier 1fl_only restriction unusual alwaysfail
      array [CR3S AL4S AL5S]       // We flag it as "unusual" in a line of 3,
                                   // unless the caller says "2x1".
            alternate_definition [3x3] c4
   setup 1x6 2x3 restriction forbidden 3x3couples_only
      predscantdocallinsetup
         if 1x6_wheel_and_deal [CR2S CR1S CR0S AL0S AL1S AL2S]   /* 2FL, or beau side of 1FL */
         if always             [0    0    0    AL5S AL4S AL3S]   /* belle side of 1FL */
            alternate_definition [4x4] c4
   setup 1x8 2x4 restriction forbidden 4x4couples_only
      predscantdocallinsetup
         /* 2FL, or beau side of 1FL */
         if 1x8_wheel_and_deal [CR3S CR2S CR0S CR1S AL0S AL1S AL3S AL2S]
         /* belle side of 1FL */
         if always             [0    0    0    0    AL7S AL6S AL4S AL5S]
            alternate_definition [6x6] c4
   setup 1x12 2x6 restriction forbidden 3x3couples_only
      array [CR5S CR4S CR3S CR2S CR1S CR0S AL0S AL1S AL2S AL3S AL4S AL5S]
            alternate_definition [8x8] c4
   setup 1x16 2x8 restriction forbidden 4x4couples_only
      array [CR7S CR6S CR5S CR4S CR3S CR2S CR1S CR0S AL0S AL1S AL2S AL3S AL4S AL5S AL6S AL7S]

call "wheel and spread" plus
            visible_fractions mxn_is_inherited left_means_mirror
   seq wheel_before_spread [inherit_mxn inherit_left]
   seq spread_after_wheel [inherit_mxn]

call "single wheel" a2 tag single_wheel
            left_means_mirror
   setup 1x2 1x2 rotate
      predscantdocallinsetup
         if 1x2_beau_or_miniwave [CR0E AL0E]
         if always [0 AL1E]

call "wheel to a line" c4 tag wheeltoline
            reverse_means_mirror
   setup 2x2 1x4 restriction couples_only
      array [CR2S CR3S AL0S AL1S]
            alternate_definition [single] c4a
   setup 2x1 1x2 rotate
      array [AL0E CR1E]
            alternate_definition [3x3] c4
   setup 2x3 1x6 restriction forbidden 1fl_only
      array [CR3S CR4S CR5S AL0S AL1S AL2S]
            alternate_definition [4x4] c4
   setup 2x4 1x8 restriction forbidden 1fl_only
      array [CR4S CR5S CR7S CR6S AL0S AL1S AL3S AL2S]

call "turn to a line" c2 tag turntoline
            reverse_means_mirror
   setup 2x2 1x4
      array [CR3S CR2S AL1S AL0S]
            alternate_definition [single] c3a
   setup 2x1 1x2 rotate
      array [AL0E CR1E]
            alternate_definition [3x3] c4
   setup 2x3 1x6
      array [CR5S CR4S CR3S AL2S AL1S AL0S]
            alternate_definition [4x4] c4
   setup 2x4 1x8
      array [CR6S CR7S CR5S CR4S AL2S AL3S AL1S AL0S]

call "triple wheel" c4
            reverse_means_mirror single_is_inherited nxn_is_inherited visible_fractions
   seq wheeltoline  [inherit_reverse inherit_single inherit_nxn]
   seq wheelanddeal [inherit_left    inherit_single inherit_nxn]
   seq wheeltoline  [inherit_reverse inherit_single inherit_nxn]

call "triple turn" c4
            reverse_means_mirror single_is_inherited nxn_is_inherited visible_fractions
   seq turntoline  [inherit_reverse inherit_single inherit_nxn]
   seq turnanddeal [inherit_left    inherit_single inherit_nxn]
   seq turntoline  [inherit_reverse inherit_single inherit_nxn]

call "zig zag" a2
   setup 2x2 2x2 qualifier tbone none
      array [CR0E CR1E AL2W AL3W]
   setup 2x1 1x2
      array [AL0W CR1E]

call "zag zig" a2
   setup 2x2 2x2 qualifier tbone none
      array [AL0W AL1W CR2E CR3E]
   setup 2x1 1x2
      array [CR0E AL1W]

call "zig zig" a2
   setup 2x2 2x2 qualifier tbone none
      array [CR0E CR1E CR2E CR3E]
   setup 2x1 1x2
      array [CR0E CR1E]

call "zag zag" a2
   setup 2x2 2x2 qualifier tbone none
      array [AL0W AL1W AL2W AL3W]
   setup 2x1 1x2
      array [AL0W AL1W]

call "zig" a2
   setup 2x2 2x2 qualifier tbone none
      array [CR0E CR1E ZM2N ZM3N]
   setup 2x1 1x2
      array [ZM0N CR1E]
   // Allow these from 3/4 tags.
   setup qtag qtag
      array [CR0E CR1E ZM2N ZM3N 0 0 ZM6N ZM7N]

call "zag" a2
   setup 2x2 2x2 qualifier tbone none
      array [AL0W AL1W ZM2N ZM3N]
   setup 2x1 1x2
      array [ZM0N AL1W]
   setup qtag qtag
      array [AL0W AL1W ZM2N ZM3N 0 0 ZM6N ZM7N]

call "double pass thru" mainstream tag dpt
            rear_back_from_qtag left_means_mirror
   setup 4x1 1x4
      array [ZM3N ZM2N 0 0]
            alternate_definition [half] mainstream
   setup 4x1 2x2
      array [ZM0N ZM1N 0 0]
            alternate_definition [lasthalf] mainstream
   setup 2x2 1x4 rotate
      array [ZM0W 0 0 ZM1W]
            alternate_definition [twisted] c4
   setup dmd 1x4
      array [0 0 0 CM2E]
   setup pmd 1x4
      array [ZM3N 0 0 0]
            alternate_definition [3x3] c4
   setup 6x1 1x6
      array [ZM5N ZM4N ZM3N 0 0 0]
            alternate_definition [4x4] c4
   setup 8x1 1x8
      array [ZM6N ZM7N ZM4N ZM5N 0 0 0 0]
            alternate_definition [reflect] c3
   setup 4x1 1x4 rotate
      array [CM3N CM2N 0 0]
            alternate_definition [3x3 reflect] c4
   setup 6x1 1x6 rotate
      array [CM5N CM4N CM3N 0 0 0]
            alternate_definition [4x4 reflect] c4
   setup 8x1 1x8 rotate
      array [CM6N CM7N CM4N CM5N 0 0 0 0]
            alternate_definition [revert] c3
   setup 4x2 2x4 rotate
      array [CM7S CM0S 0 0 0 0 CM1S CM6S]
            alternate_definition [3x3 revert] c4
   setup 6x2 3x4 rotate
      array [CM9S CM10S CM0S 0 0 0 0 0 0 CM1S CM11S CM8S]
            alternate_definition [4x4 revert] c4
   setup 8x2 4x4
      array [CM12W CM13W CM14W CM0W 0 0 0 0 0 0 0 0 CM1W CM3W CM15W CM10W]

call "quadruple pass thru" c1   // You're right!  It isn't on the list!
   setup 8x1 1x8
      array [ZM6N ZM7N ZM4N ZM5N 0 0 0 0]
            alternate_definition [reflect] c4
   setup 8x1 1x8 rotate
      array [CM6N CM7N CM4N CM5N 0 0 0 0]

call "strut right" c3
            rear_back_from_qtag
            single_is_inherited twisted_is_inherited
            bigmatrix_is_inherited nxn_is_inherited mxn_is_inherited
   seq ctrs_pass_thru [inherit_single inherit_twisted
                       inherit_bigmatrix inherit_nxn inherit_mxn]
   seq finish_strut_right [inherit_single inherit_nxn inherit_mxn]

call "strut left" c3
            rear_back_from_qtag
            single_is_inherited twisted_is_inherited
            bigmatrix_is_inherited nxn_is_inherited mxn_is_inherited
   seq ctrs_pass_thru [inherit_single inherit_twisted
                       inherit_bigmatrix inherit_nxn inherit_mxn]
   seq finish_strut_right [force_left inherit_single inherit_nxn inherit_mxn]

call "strut right and left" c3
            rear_back_from_qtag
            single_is_inherited twisted_is_inherited
            bigmatrix_is_inherited nxn_is_inherited mxn_is_inherited
   seq ctrs_pass_thru [inherit_single inherit_twisted
                       inherit_bigmatrix inherit_nxn inherit_mxn]
   seq finish_strut_right_and_left [inherit_single inherit_nxn inherit_mxn]

call "strut left and right" c3
            rear_back_from_qtag
            single_is_inherited twisted_is_inherited
            bigmatrix_is_inherited nxn_is_inherited mxn_is_inherited
   seq ctrs_pass_thru [inherit_single inherit_twisted
                       inherit_bigmatrix inherit_nxn inherit_mxn]
   seq finish_strut_right_and_left [force_left inherit_single inherit_nxn inherit_mxn]

call "_finish strut right" dontshow tag finish_strut_right
            left_means_mirror
   setup 4x2 1x8 rotate
      array [ZM6W 0 CR7E 0 0 CR4E 0 ZM5W]
            alternate_definition [single] c3
   setup 4x1 1x4 rotate
      array [ZM3W 0 0 CR2E]
   setup pmd dmd   // In a PU diamond, do your part.
      array [ZM3N 0 0 0]
   setup dmd dmd
      array [0 CR2S 0 0]
            alternate_definition [3x3] c4
   setup 4x3 1x12 rotate
      array [ZM11W 0 CR10E 0 0 CR8E 0 CR6E 0 ZM7W ZM9W 0]
            alternate_definition [4x4] c4
   setup 4x4 1x16
      array [0 CR8S 0 CR10S ZM9N ZM11N ZM13N 0 ZM15N 0 CR14S 0 0 0 0 CR12S]

call "_finish strut right and left" dontshow tag finish_strut_right_and_left
            left_means_mirror
   setup 4x2 1x8 rotate
      array [ZM1W 0 CR7E 0 0 CR4E 0 ZM2W]
            alternate_definition [single] c3
   setup 4x1 1x4 rotate
      array [ZM1W 0 0 CR2E]
   setup pmd dmd   // In a PU diamond, do your part.
      array [ZM1N 0 0 0]
   setup dmd dmd
      array [0 CR2S 0 0]
            alternate_definition [3x3] c4
   setup 4x3 1x12 rotate
      array [ZM1W 0 CR10E 0 0 CR8E 0 CR6E 0 ZM5W ZM3W 0]
            alternate_definition [4x4] c4
   setup 4x4 1x16
      array [0 CR8S 0 CR10S ZM7N ZM5N ZM3N 0 ZM1N 0 CR14S 0 0 0 0 CR12S]

call "ah so" c1 tag ahso
   setup 1x4 2x2 no_cutting_through qualifier wave_only
      array [CR1S AL3S AL0S CR2S]
   setup 1x4 2x2 no_cutting_through qualifier magic_only
      array [CR1S AL0S AL3S CR2S]
   // Yes, it's legal from 3&1 lines.  Callerlab C1 definitions, page 6.
   setup 1x4 2x2 no_cutting_through restriction unusual alwaysfail
      predscantdocallinsetup
         if miniwave_side_of_out_3n1_line [CR1S AL3S AL0S CR2S]
         if couple_side_of_out_3n1_line   [CR1S CR0S AL0S AL1S]
         if miniwave_side_of_in_3n1_line  [CR1S AL0S AL3S CR2S]
         if couple_side_of_in_3n1_line    [CR1S CR0S AL3S AL2S]
   // And even legal from 2FL or 1FL!
         if 1x4_wheel_and_deal [CR1S CR0S AL0S AL1S]   // 2FL, or beau side of 1FL
         if always             [0    0    AL3S AL2S]   // belle side of 1FL
            alternate_definition [straight] c4
   setup 2x4 2x4 rotate restriction wave_only
      array [CR0E AL6E CR1E AL7E ZM1W CR3E AL4E ZM6W]
            alternate_definition [3x3] c4
   setup 1x6 2x3 rotate qualifier wave_only
      array [CR0E AL3E CR1E AL5E CR2E AL4E]
            alternate_definition [4x4] c4
   setup 1x8 2x4 rotate qualifier wave_only
      array [CR0E AL4E AL5E CR1E AL7E CR3E CR2E AL6E]

call "_extend 1/2 to @a" dontshow tag extend_n
            neednumber split_large_setups
   split_to_box
   setup 2x2 1x4 rotate qualifier num 0 miniwaves restriction forbidden levelplus
      // Yikes!!  We gotta back way up!
      array [ZM3W ZM3W ZM2W ZM2W]
   setup 2x2 dmd rotate qualifier num 1 miniwaves
      // Yikes!!  We gotta back up!
      array [ZM3W ZM1W ZM2W ZM2W]
   setup 2x2 2x2 roll_transparent restriction wave_only qualifier num 2 none
      array [ZM0N ZM1N ZM2N ZM3N]
   setup 1x4 1x4 qualifier num 2 miniwaves
      array [ZM0N ZM1N ZM2N ZM3N]
   setup 2x2 dmd rotate qualifier num 3 miniwaves
      array [ZM0W ZM0W ZM1W ZM3W]
   setup 2x2 1x4 rotate qualifier num 4 miniwaves
      array [ZM0W ZM0W ZM1W ZM1W]
            alternate_definition [single] c4
   setup 1x2 1x2 qualifier num 2 miniwaves
      array [ZM0N ZM1N]
   setup 1x2 1x2 rotate qualifier num 4 miniwaves
      array [ZM0W ZM0W]
            alternate_definition [3x3] c3
   setup 3x2 2x3 qualifier num 2 wave_only
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N]
   setup 1x6 1x6 qualifier num 2 none
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N]
   setup 3x2 1x6 qualifier num 4 wave_only
      array [ZM5N ZM4N ZM3N ZM3N ZM4N ZM5N]
            alternate_definition [4x4] c3
   setup 4x2 2x4 qualifier num 2 wave_only
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 1x8 1x8 qualifier num 2 none
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 4x2 1x8 qualifier num 4 wave_only
      array [ZM6N ZM7N ZM5N ZM4N ZM4N ZM5N ZM7N ZM6N]
            alternate_definition [5x5] c3
   setup 5x2 2x5 qualifier num 2 wave_only
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N]
   setup 1x10 1x10 qualifier num 2 none
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N]
   setup 5x2 1x10 qualifier num 4 wave_only
      array [ZM9N ZM8N ZM7N ZM6N ZM5N ZM5N ZM6N ZM7N ZM8N ZM9N]

call "@a tag" mainstream
   // It's listed as "1/2 tag" in the Callerlab mainstream list.
   // We don't use the "@B" mechanism because we don't
   // have the right to change "1/2" to "half".
   // The user can legally say "1/2" and expect
   // it to appear that way on the transcript.
   // At least, that seems to be what I thought at one time.
            yield_if_ambiguous neednumber left_means_mirror
            nxn_is_inherited bigmatrix_is_inherited revert_is_inherited fractal_is_inherited
   seq half_tag [inherit_left inherit_nxn inherit_bigmatrix]
   seq revert_if_needed [inherit_revert inherit_fractal inherit_nxn]
   seq extend_n [inherit_nxn]

call "half tag" mainstream tag half_tag
     // If the user specifically says "half tag", we leave it that way.
     // Note that "1/2 tag" yielded to this.
            left_means_mirror
   setup 1x4 2x2 no_cutting_through restriction awkward_centers
      array [C0E C1E A2W A3W]
   // We allow the 3x3 version, at mainstream, even if user didn't ask for it.
   setup 1x6 2x3
      array [C0E C1E C2E A3W A4W A5W]
            alternate_definition [3x3] mainstream
   setup 1x6 2x3
      array [C0E C1E C2E A3W A4W A5W]
            alternate_definition [4x4] mainstream
   setup 1x8 2x4
      array [C0E C1E C3E C2E A4W A5W A7W A6W]

call "line of 6, @a tag" mainstream
            neednumber
   setup 1x6 2x3 qualifier num 2 none
      array [C0E C1E C2E A3W A4W A5W]

call "line of 6, tag the line" mainstream
   setup 1x6 1x6
      array [C5E C4E C3E A2W A1W A0W]

call "line of 8, @a tag" mainstream
            neednumber
   setup 1x8 2x4 qualifier num 2 none
      array [C0E C1E C3E C2E A4W A5W A7W A6W]

call "line of 8, tag the line" mainstream
   setup 1x8 1x8
      array [C6E C7E C4E C5E A2W A3W A0W A1W]

call "@a tag the line" plus tag tag_the_line_n_4
      // It's listed as "3/4 tag the line" in the Callerlab plus list.
      // This gets "1/2 tag the line" also.
            neednumber left_means_mirror
   setup 1x4 2x2 no_cutting_through qualifier num 2 none restriction awkward_centers
      array [C0E C1E A2W A3W]
   setup 1x4 dmd restriction awkward_centers qualifier num 3 none
      array [C1E C2E A3W A0W]
   // We allow the 3x3 version, at mainstream, even if user didn't ask for it.
   // But not 4x4--a line of 8 defaults to two end-to-end lines of 4--must say
   // "Line of 8 1/2 tag" to get that.
   setup 1x6 2x3 qualifier num 2 none
      array [C0E C1E C2E A3W A4W A5W]
            alternate_definition [3x3] mainstream
   setup 1x6 2x3 qualifier num 2 none
      array [C0E C1E C2E A3W A4W A5W]
            alternate_definition [4x4] mainstream
   setup 1x8 2x4 qualifier num 2 none
      array [C0E C1E C3E C2E A4W A5W A7W A6W]

// Special case, no backing up, so that tag the line 0/4 can roll.
call "tag the line 0/4" mainstream
            left_means_mirror
   setup 1x4 1x4
      array [CR0E CR1E AL2W AL3W]
            alternate_definition [single] c4
   setup 1x2 1x2
      array [CR0E AL1E]
            alternate_definition [3x3] c4
   setup 1x6 2x3
      array [CR0E CR1E CR2E AL3W AL4W AL5W]
            alternate_definition [4x4] c4
   setup 1x8 1x8
      array [CR0E CR1E CR2E CR3E AL4W AL5W AL6W AL7W]

// The following 2 calls (tagnullcall1) work with "flip", "tag", and "vertical tag".

call "@w the line @a" mainstream
            neednumber yield_if_ambiguous left_means_mirror single_is_inherited
            singlefile_is_inherited nxn_is_inherited mxn_is_inherited revert_is_inherited
            fractal_is_inherited
   seq tagnullcall1 [inherit_left inherit_single inherit_singlefile inherit_nxn inherit_mxn]
   seq revert_if_needed [inherit_revert inherit_fractal inherit_nxn]
   seq extend_n [inherit_single inherit_nxn inherit_mxn]

call "@w the line" mainstream
            left_means_mirror single_is_inherited singlefile_is_inherited
            nxn_is_inherited mxn_is_inherited revert_is_inherited fractal_is_inherited
   seq tagnullcall1 [inherit_left inherit_single inherit_singlefile inherit_nxn inherit_mxn]
   seq revert_if_needed [inherit_revert inherit_fractal inherit_nxn]
   seq extend_n [inherit_single inherit_nxn inherit_mxn insert_number 4]

// And the following 2 calls work with "tag the star", "snap the tag",
// "circle the tag", "loop and tag", "chase the tag", and "dixie tag".  Note that "chase" and
// "chase the tag" both exist.  So you can say either "chase your leader" or "chase the tag your leader".

call "@x @a" c3      // How's this for a call name?
            neednumber left_means_mirror single_is_inherited singlefile_is_inherited
            nxn_is_inherited bigmatrix_is_inherited revert_is_inherited fractal_is_inherited
   seq tagnullcall2 [inherit_left inherit_single inherit_nxn
                     inherit_bigmatrix inherit_singlefile]
   seq revert_if_needed [inherit_revert inherit_fractal inherit_nxn]
   seq extend_n [inherit_single inherit_nxn inherit_bigmatrix]

call "@x" c3         // Or this?
            left_means_mirror single_is_inherited singlefile_is_inherited
            nxn_is_inherited bigmatrix_is_inherited revert_is_inherited fractal_is_inherited
   seq tagnullcall2 [inherit_left inherit_single inherit_nxn inherit_bigmatrix inherit_singlefile]
   seq revert_if_needed [inherit_revert inherit_fractal inherit_nxn]
   seq extend_n [inherit_single inherit_nxn inherit_bigmatrix insert_number 4]

// And the following 2 calls work with "chase", "invert", and "double pass".

call "@y the tag @a" c2
            neednumber left_means_mirror singlefile_is_inherited
            nxn_is_inherited mxn_is_inherited revert_is_inherited fractal_is_inherited
   seq tagnullcall3 [inherit_left inherit_singlefile inherit_nxn inherit_mxn]
   seq revert_if_needed [inherit_revert inherit_fractal inherit_nxn]
   seq extend_n [inherit_nxn inherit_mxn]

call "@y the tag" c2
            left_means_mirror singlefile_is_inherited
            nxn_is_inherited mxn_is_inherited revert_is_inherited fractal_is_inherited
   seq tagnullcall3 [inherit_left inherit_singlefile inherit_nxn inherit_mxn]
   seq revert_if_needed [inherit_revert inherit_fractal inherit_nxn]
   seq extend_n [inherit_nxn inherit_mxn insert_number 4]

call "_tag the line" dontshow tag tagtheline
            left_means_mirror
   setup 1x4 1x4 restriction awkward_centers
      array [C3E C2E A1W A0W]
            alternate_definition [3x3] c4
   setup 1x6 1x6 qualifier 3x3_2fl_only
      array [C5E C4E C3E A2W A1W A0W]
            alternate_definition [4x4] c4
   setup 1x8 1x8 qualifier 4x4_2fl_only
      array [C6E C7E C4E C5E A2W A3W A0W A1W]

call "vertical 0 tag" dontshow tag vertical0tag
            left_means_mirror
   setup 2x2 1x4 rotate restriction not_tboned
      preds "Can't do this with phantoms or T-boned people."
         if vert1 [0E 1E 3W 2W]
         if vert2 [0 0E 0 3W]

call "vertical @0" c2
            dont_use_in_resolve visible_fractions left_means_mirror
   seq vertical0tag [inherit_left]
   seq nullcall [mandatory_anycall]

// The main <ATC> mechanism uses the word order "vertical tag the line N/4".
// We provide this for the other common word order "vertical N/4 tag".
call "vertical @a tag" c1
            neednumber left_means_mirror
            single_is_inherited singlefile_is_inherited nxn_is_inherited revert_is_inherited fractal_is_inherited
   seq vertical_half_tag [inherit_left inherit_single inherit_singlefile inherit_nxn]
   seq revert_if_needed [inherit_revert inherit_fractal inherit_nxn]
   seq extend_n [inherit_single inherit_nxn]

// And we allow this by itself.
call "vertical tag" c1 tag verticaltag
            left_means_mirror single_is_inherited singlefile_is_inherited
            nxn_is_inherited revert_is_inherited fractal_is_inherited
   seq vertical_half_tag [inherit_left inherit_single inherit_singlefile inherit_nxn]
   seq revert_if_needed [inherit_revert inherit_fractal inherit_nxn]
   seq extend_n [inherit_single inherit_nxn insert_number 4]

// We provide this for the other common word order "<anyone> start vertical N/4 tag".
// When this is done, we don't allow things like "left" or "revert", since they
// would have to be spoken before the "<anyone> start", which isn't natural.
call "@6 start vertical @a tag" c1
            neednumber
   seq anyone_start_vertical_half_tag []
   seq extend_n []

// And we allow this by itself.
call "@6 start vertical tag" c1
   seq anyone_start_vertical_half_tag []
   seq extend_n [insert_number 4]

/* This call does the "vertical" the normal way, and only
   does the half-tag part passing left shoulders.  It is
   not the same as "left vertical half tag", which is a complete
   mirror image call, and is available above.  We might like
   to have a call that does a "left vertical" followed by a
   right-shoulder pass, but the nomenclature is very murky.
   So we don't allow the "left" modifier on this
   call.  Furthermore, we mark it c2, since it is esoteric. */
call "vertical left @a tag" c2
            neednumber
            single_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq vertical_left_half_tag [inherit_single inherit_singlefile]
   seq revert_if_needed [inherit_revert inherit_fractal]
   seq extend_n [inherit_single]

call "vertical turn and deal" c4a
            left_means_mirror
   setup 2x2 2x2 restriction not_tboned
      preds "Can't do this with phantoms or T-boned people."
         if vert1 [CR1W AL2E ZM0N ZM3N]
         if vert2 [0 AL1E 0 ZM0N]

/* The main <ATC> mechanism uses the word order "chase the tag N/4".  We provide
   this for the other common word order "chase the N/4 tag". */

call "chase the @a tag" c3
            neednumber left_means_mirror singlefile_is_inherited
            single_is_inherited nxn_is_inherited bigmatrix_is_inherited revert_is_inherited fractal_is_inherited
   seq chase_the_half_tag [inherit_left inherit_singlefile
                           inherit_single inherit_nxn inherit_bigmatrix]
   seq revert_if_needed [inherit_revert inherit_fractal inherit_nxn]
   seq extend_n [inherit_nxn inherit_bigmatrix]

/* The main <ATC> mechanism uses the word order "snap the tag N/4".  We provide
   this for the other common word order "snap the N/4 tag". */

call "snap the @a tag" c4
            neednumber left_means_mirror revert_is_inherited fractal_is_inherited
   seq snap_the_half_tag [inherit_left]
   seq revert_if_needed [inherit_revert inherit_fractal]
   seq extend_n []

/* The main <ATC> mechanism uses the word order "tag the star N/4".  We provide
   this for star turn modifications. */

call "tag the star @a@S" c4a
            yield_if_ambiguous neednumber left_means_mirror
            singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq start_tagstar [inherit_left inherit_singlefile]
   seq turndmdn [insert_number 2]
   seq dropin []
   seq revert_if_needed [inherit_revert inherit_fractal]
   seq extend_n []

// The main <ATC> mechanism uses the word order "loop and tag N/4".  We provide
// this for the other common word order "loop and N/4 tag".

call "loop and @a tag" c3
            neednumber left_means_mirror split_large_setups
            cross_is_inherited single_is_inherited
            nxn_is_inherited bigmatrix_is_inherited revert_is_inherited fractal_is_inherited
   seq loop_and_half_tag [inherit_left inherit_cross inherit_single
                          inherit_nxn inherit_bigmatrix]
   seq revert_if_needed [inherit_revert inherit_fractal inherit_nxn]
   seq extend_n [inherit_single inherit_nxn inherit_bigmatrix]

/* This is the general "[magic][cross] invert the column N/4", including
   4/4, which prints as "full".  If you don't want to say "invert the
   column full", you can use the call below.
   The 1/2 versions of these are also tagging base calls, listed at
   the start of the database. */

call "invert the column @a" c2 tag invert_n_4
            neednumber
   setup 4x2 3x4 rotate restriction wave_only qualifier num 1 none
      array [ZM8W ZM11W ZM1W AL10E CR4E ZM2W ZM5W ZM7W]
   setup 4x2 2x4 rotate restriction wave_only qualifier num 2 none
      array [ZM6W ZM1W AL0E AM7E CM4E CR3E ZM2W ZM5W]
   setup 4x2 3x4 rotate restriction wave_only qualifier num 3 none
      array [ZM11W AL0E AM10E AM9E CM6E CM4E CR3E ZM5W]
   setup 4x2 2x4 restriction wave_only qualifier num 4 none
      array [AL3S AM2S AM1S AM0S CM7S CM6S CM5S CR4S]
            alternate_definition [cross] c2
   setup 4x2 3x4 rotate restriction wave_only qualifier num 1 none
      array [ZM8W ZM11W ZM1W CR4E AL10E ZM2W ZM5W ZM7W]
   setup 4x2 2x4 rotate restriction wave_only qualifier num 2 none
      array [ZM6W ZM1W CR3E CM4E AM7E AL0E ZM2W ZM5W]
   setup 4x2 3x4 rotate restriction wave_only qualifier num 3 none
      array [ZM11W CR3E CM4E CM6E AM9E AM10E AL0E ZM5W]
   setup 4x2 2x4 restriction wave_only qualifier num 4 none
      array [CR4S CM5S CM6S CM7S AM0S AM1S AM2S AL3S]
            alternate_definition [magic] c2
   setup 4x2 3x4 rotate restriction magic_only qualifier num 1 none
      array [ZM8W ZM11W ZM2W AL10E CR4E ZM1W ZM5W ZM7W]
   setup 4x2 2x4 rotate restriction magic_only qualifier num 2 none
      array [ZM5W ZM1W CR3E AM7E CM4E AL0E ZM2W ZM6W]
   setup 4x2 3x4 rotate restriction magic_only qualifier num 3 none
      array [ZM5W CR3E CM4E AM9E CM6E AM10E AL0E ZM11W]
   setup 4x2 2x4 restriction magic_only qualifier num 4 none
      array [AL3S CM5S CM6S AM0S CM7S AM1S AM2S CR4S]
            alternate_definition [magic cross] c2
   setup 4x2 3x4 rotate restriction magic_only qualifier num 1 none
      array [ZM8W ZM11W ZM2W CR4E AL10E ZM1W ZM5W ZM7W]
   setup 4x2 2x4 rotate restriction magic_only qualifier num 2 none
      array [ZM5W ZM1W AL0E CM4E AM7E CR3E ZM2W ZM6W]
   setup 4x2 3x4 rotate restriction magic_only qualifier num 3 none
      array [ZM5W AL0E AM10E CM6E AM9E CM4E CR3E ZM11W]
   setup 4x2 2x4 restriction magic_only qualifier num 4 none
      array [CR4S AM2S AM1S CM7S AM0S CM6S CM5S AL3S]
            alternate_definition [single] c4
   setup 2x2 1x4 restriction wave_only qualifier num 2 none
      array [AL0S CR2S ZM3N ZM1N]
   setup 2x2 2x2 restriction wave_only qualifier num 4 none
      array [AL3S CR2S CR1S AL0S]
            alternate_definition [3x3] c4
   setup 6x2 3x4 rotate restriction wave_only qualifier num 2 none
      array [ZM8W ZM11W ZM1W AL0E AM10E AM9E CM6E CM4E CR3E ZM2W ZM5W ZM7W]
   setup 6x2 2x6 restriction wave_only qualifier num 4 none
      array [AL5S AM4S AM3S AM2S AM1S AM0S CM11S CM10S CM9S CM8S CM7S CR6S]
            alternate_definition [4x4] c4
   setup 8x2 4x4 restriction wave_only qualifier num 2 none
      array [ZM10N ZM15N ZM3N ZM1N AL0S AM14S AM13S AM12S
             CM8S CM6S CM5S CR4S ZM2N ZM7N ZM11N ZM9N]
   setup 8x2 2x8 restriction wave_only qualifier num 4 none
      array [AL7S AM6S AM5S AM4S AM3S AM2S AM1S AM0S
             CM15S CM14S CM13S CM12S CM11S CM10S CM9S CR8S]
            alternate_definition [3x3 cross] c4
   setup 6x2 3x4 rotate restriction wave_only qualifier num 2 none
      array [ZM8W ZM11W ZM1W CR3E CM4E CM6E AM9E AM10E AL0E ZM2W ZM5W ZM7W]
   setup 6x2 2x6 restriction wave_only qualifier num 4 none
      array [CR6S CM7S CM8S CM9S CM10S CM11S AM0S AM1S AM2S AM3S AM4S AL5S]
            alternate_definition [4x4 cross] c4
   setup 8x2 4x4 restriction wave_only qualifier num 2 none
      array [ZM10N ZM15N ZM3N ZM1N CR4S CM5S CM6S CM8S
             AM12S AM13S AM14S AL0S ZM2N ZM7N ZM11N ZM9N]
   setup 8x2 2x8 restriction wave_only qualifier num 4 none
      array [CR8S CM9S CM10S CM11S CM12S CM13S CM14S CM15S
             AM0S AM1S AM2S AM3S AM4S AM5S AM6S AL7S]
            alternate_definition [rewind] c4
   setup 3x4 2x4 rotate restriction wave_only qualifier num 1 none
      array [0 ZM7W ZM0W 0 AL0E ZM1W 0 ZM2W ZM5W 0 CR7E ZM6W]
   setup qtag 2x4 rotate restriction wave_only qualifier num 1 none
      array [ZM7W ZM0W AL0E ZM1W ZM2W ZM5W CR7E ZM6W]
   setup 2x4 2x4 rotate restriction wave_only qualifier num 2 none
      array [CM6E ZM7W ZM0W AM1E AL0E ZM1W ZM6W CR7E]
   setup 3x4 2x4 rotate restriction wave_only qualifier num 3 none
      array [CM5E 0 0 AM2E AM1E ZM0W AL0E 0 0 CR7E CM6E ZM7W]
   setup 4x2 2x4 restriction wave_only qualifier num 4 none
      array [CR3S CM2S CM1S CM0S AM7S AM6S AM5S AL4S]

// This is just plain "invert the column" (all the way, of course).
// Unlike the above "N/4" stuff, we allow this from a 3x2.
// Fractionalized inverts from a 3x2 are below.  They have to be done
// specially, since we don't have support for general "N/3" numbers.

call "invert the column" c2
            dont_use_in_nice_resolve
            visible_fractions cross_is_inherited magic_is_inherited
   seq invert_n_4      [inherit_cross inherit_magic normalize insert_number 1]
   seq continue_invert [inherit_cross inherit_magic normalize]
   seq continue_invert [inherit_cross inherit_magic normalize]
   seq continue_invert [inherit_cross inherit_magic normalize]
   setup 4x2 2x4 restriction wave_only
      array [AL3S AM2S AM1S AM0S CM7S CM6S CM5S CR4S]
   setup 3x2 2x3 restriction wave_only
      array [L2S L1S L0S R5S R4S R3S]
            alternate_definition [cross] c2
   setup 4x2 2x4 restriction wave_only
      array [CR4S CM5S CM6S CM7S AM0S AM1S AM2S AL3S]
   setup 3x2 2x3 restriction wave_only
      array [R3S R4S R5S L0S L1S L2S]
/* **** need to put in 3x2 versions */
            alternate_definition [magic] c2
   setup 4x2 2x4 restriction magic_only
      array [AL3S CM5S CM6S AM0S CM7S AM1S AM2S CR4S]
            alternate_definition [magic cross] c2
   setup 4x2 2x4 restriction magic_only
      array [CR4S AM2S AM1S CM7S AM0S CM6S CM5S AL3S]
            alternate_definition [single] c4
   setup 2x2 2x2 restriction wave_only
      array [AL3S CR2S CR1S AL0S]
            alternate_definition [3x3] c4
   setup 6x2 2x6 restriction wave_only
      array [AL5S AM4S AM3S AM2S AM1S AM0S
             CM11S CM10S CM9S CM8S CM7S CR6S]
            alternate_definition [4x4] c4
   setup 8x2 2x8 restriction wave_only
      array [AL7S AM6S AM5S AM4S AM3S AM2S AM1S AM0S
             CM15S CM14S CM13S CM12S CM11S CM10S CM9S CR8S]
            alternate_definition [3x3 cross] c4
   setup 6x2 2x6 restriction wave_only
      array [CR6S CM7S CM8S CM9S CM10S CM11S
             AM0S AM1S AM2S AM3S AM4S AL5S]
            alternate_definition [4x4 cross] c4
   setup 8x2 2x8 restriction wave_only
      array [CR8S CM9S CM10S CM11S CM12S CM13S CM14S CM15S
             AM0S AM1S AM2S AM3S AM4S AM5S AM6S AL7S]
            alternate_definition [rewind] c4
   setup 4x2 2x4 restriction wave_only
      array [CR3S CM2S CM1S CM0S AM7S AM6S AM5S AL4S]

call "revert@M@C invert the column" c3x
            cross_is_inherited magic_is_inherited
   seq invert_the_tag_half [inherit_cross inherit_magic]
   seq revert_if_needed [force_revert]
   seq continue_invert_n [inherit_cross inherit_magic insert_number 2]

call "revert finish invert the column" c4
   seq continue_invert_n [insert_number 1]
   seq revert_if_needed [force_revert]
   seq continue_invert_n [insert_number 2]

// Here are the fractionalized inverts from columns of 6, as promised.

call "invert the column 1/3" c2
   setup 3x2 short6 restriction wave_only
      array [M0N M2N L1S R4S M3N M5N]
            alternate_definition [cross] c2
   setup 3x2 short6 restriction wave_only
      array [M0N M2N R4S L1S M3N M5N]

call "invert the column 2/3" c2 tag invert_2_3
   setup 3x2 bone6 rotate restriction wave_only
      array [ZM5W AL0E AM4E CM3E CR1E ZM2W]
            alternate_definition [cross] c2
   setup 3x2 bone6 rotate restriction wave_only
      array [ZM5W CR1E CM3E AM4E AL0E ZM2W]
            alternate_definition [magic] c2
   setup 3x2 bone6 rotate restriction magic_only
      array [ZM2W CR1E AM4E CM3E AL0E ZM5W]
            alternate_definition [rewind] c4
   setup bone6 2x3 rotate restriction wave_only
      array [CM4E AM1E ZM0W AL0E CR5E ZM5W]

/* The call "continue to invert" goes one step from 1/4 -> 1/2 -> 3/4 -> full.
   Note that the word "cross" goes into an interesting place in this.
   The 1/4 -> 1/2 version of this is also a tagging base call, listed at
   the start of the database. */

call "continue to@M@C invert another 1/4" dontshow tag continue_invert
            take_right_hands
   setup qtag 2x4 restriction wave_only       // 1/4 -> 1/2
      array [AL0S CR3S ZM3N ZM2N ZM5N ZM6N ZM0N ZM1N]
   setup 2x4 3x4 restriction wave_only        // 1/2 -> 3/4
      array [ZM0N AL0S CR3S ZM3N ZM4N ZM5N ZM11N ZM10N]
   setup 3x4 2x4 rotate restriction wave_only // 3/4 -> full
      array [ZM7W 0 0 ZM0W ZM1W CR0E ZM2W 0 0 ZM5W ZM6W AL7E]
            alternate_definition [cross] c4
   setup qtag 2x4 restriction 2fl_only        // 1/4 -> 1/2
      array [CR3S AL0S ZM3N ZM2N ZM5N ZM6N ZM0N ZM1N]
   setup 2x4 3x4 restriction 2fl_only         // 1/2 -> 3/4
      array [ZM0N CR3S AL0S ZM3N ZM4N ZM5N ZM11N ZM10N]
   setup 3x4 2x4 rotate restriction 2fl_only  // 3/4 -> full
      array [ZM7W 0 0 ZM0W ZM1W AL7E ZM2W 0 0 ZM5W ZM6W CR0E]
            alternate_definition [magic] c4
   setup qtag 2x4 restriction 2fl_only        // 1/4 -> 1/2
      array [AL0S CR3S ZM3N ZM2N ZM6N ZM5N ZM0N ZM1N]
   setup 2x4 3x4 restriction 2fl_only         // 1/2 -> 3/4
      array [ZM0N CR3S AL0S ZM3N ZM4N ZM5N ZM11N ZM10N]
   setup 3x4 2x4 rotate restriction 2fl_only  /* 3/4 -> full */
      array [ZM7W 0 0 ZM0W ZM1W AL7E ZM2W 0 0 ZM5W ZM6W CR0E]
            alternate_definition [magic cross] c4
   setup qtag 2x4 restriction wave_only       /* 1/4 -> 1/2 */
      array [CR3S AL0S ZM3N ZM2N ZM6N ZM5N ZM0N ZM1N]
   setup 2x4 3x4 restriction wave_only        /* 1/2 -> 3/4 */
      array [ZM0N AL0S CR3S ZM3N ZM4N ZM5N ZM11N ZM10N]
   setup 3x4 2x4 rotate restriction wave_only /* 3/4 -> full */
      array [ZM7W 0 0 ZM0W ZM1W CR0E ZM2W 0 0 ZM5W ZM6W AL7E]

call "continue to@M@C invert another @b" c4a tag continue_invert_n
            cross_is_inherited magic_is_inherited neednumber
   seq continue_invert [inherit_cross inherit_magic repeat_n]

call "track @9" c1
            left_means_mirror neednumber
            single_is_inherited nxn_is_inherited bigmatrix_is_inherited revert_is_inherited fractal_is_inherited
   seq track2 [inherit_left inherit_nxn inherit_single]
   seq revert_if_needed [inherit_revert inherit_fractal inherit_nxn inherit_single inherit_bigmatrix]
   seq extend_n [inherit_nxn inherit_single]

/* This one listed separately, because it is legal at plus. */
/* But we make the *other* one take precedence in the parse,
   so we get the nxn and reflected stuff. */
call "track 2" plus tag track2
            left_means_mirror yield_if_ambiguous
   setup 4x2 2x4 rotate
      array [0 0 C3E C4E A6E A1E 0 0]
            alternate_definition [single] c4
   setup 2x2 1x4
      array [C2S C1S 0 0]
            alternate_definition [3x3] c4
   setup 6x2 3x4 rotate
      array [0 0 0 C3E C4E C6E A8E A11E A1E 0 0 0]
            alternate_definition [4x4] c4
   setup 8x2 4x4
      array [0 0 0 0 C4S C5S C6S C8S A10S A15S A3S A1S 0 0 0 0]

call "@6@G ripple @9" c2
            neednumber
   setup 1x4 1x4 restriction unusual wave_only qualifier num 1 ripple_one_end
      preds "These people can't ripple."
         if select                 [CR1S    0 AL3S    0]
         if unselect_near_select   [ZM0N AL0S ZM2N CR2S]
         if unselect_near_unselect [ZM0N ZM1N ZM2N ZM3N]
   setup 1x4 1x4 restriction unusual wave_only qualifier num 2 ripple_one_end
      preds "These people can't ripple."
         if select                 [CCAL3N  0  AACR1N 0]
         if unselect_near_select   [ZM0N AL0S ZM2N CR2S]
         if unselect_near_unselect [ZM0N CR3S ZM2N AL1S]
   setup 1x4 1x4 restriction unusual wave_only qualifier num 3 ripple_one_end
      preds "These people can't ripple."
         if select                 [R2S 0 L0S 0]
         if unselect_near_select   [CR1S AL0S AL3S CR2S]
         if unselect_near_unselect [CR1S CR3S AL3S AL1S]

   setup 1x4 1x4 restriction unusual wave_only qualifier num 1 ripple_both_ends_1x4_only
         array                     [CR1S AL0S AL3S CR2S]
   setup 1x4 1x4 restriction unusual wave_only qualifier num 2 ripple_both_ends_1x4_only
         array                     [CCAL3N AL0S AACR1N CR2S]
   setup 1x4 1x4 restriction unusual wave_only qualifier num 3 ripple_both_ends_1x4_only
         array                     [R2S AL1N L0S CR3N]

   setup 1x4 1x4 restriction unusual wave_only qualifier num 1 ripple_any_centers
      predscantdocallinsetup   // Because of "always", error will never arise.
         if select                        [0    CR3S    0 AL1S]
         if unselect_once_rem_from_select [ZM0N    0 ZM2N    0]
         if always                        [ZM0N CR3S ZM2N AL1S]
   setup 1x4 1x4 restriction unusual wave_only qualifier num 2 ripple_any_centers
      predscantdocallinsetup
         if select                        [0    CCAL2N    0 AACR0N]
         if unselect_once_rem_from_select [CR1S      0 AL3S      0]
         if always                        [ZM0N   CR3S ZM2N   AL1S]

   setup 1x3 1x3 restriction unusual wave_only qualifier num 1 none
      preds "These people can't ripple."
         if select              [CR1S    0 AL1S]
         if person_select_plus1 [   0 CR2S ZM2N]
         if person_select_plus2 [ZM0N AL0S    0]
   setup 1x3 1x3 restriction unusual wave_only qualifier num 2 none
      preds "These people can't ripple."
         if select              [CCAL2N  0 AACR0N]
         if person_select_plus1 [   0 CR2S  AL0S]
         if person_select_plus2 [CR1S AL0S    0]

            alternate_definition [grand] c2
   setup 1x6 1x6 restriction unusual wave_only qualifier num 1 ripple_both_ends
         array [CR1S   AL0S ZM2N AL4S   CR3S ZM5N]
   setup 1x6 1x6 restriction unusual wave_only qualifier num 1 ripple_one_end
      predscantdocallinsetup
         if select              [CR1S   0    0    AL4S   0    0]
         if person_select_plus5 [0      AL0S 0    0      CR3S 0]
         if always              [ZM0N   ZM1N ZM2N ZM3N   ZM4N ZM5N]
   setup 1x6 1x6 restriction unusual wave_only qualifier num 2 ripple_both_ends
         array [CCAL2N AL0S AL1S AACR5N CR3S CR4S]
   setup 1x6 1x6 restriction unusual wave_only qualifier num 2 ripple_one_end
      predscantdocallinsetup
         if select              [CCAL2N 0    0    AACR5N 0    0]
         if person_select_plus5 [0      AL0S 0    0      CR3S 0]
         if person_select_plus4 [0      0    AL1S 0      0    CR4S]
         if always              [ZM0N   ZM1N ZM2N ZM3N   ZM4N ZM5N]
   setup 1x6 1x6 restriction unusual wave_only qualifier num 3 ripple_both_ends
         array [R5S    AL0S AL1S L2S    CR3S CR4S]
   setup 1x6 1x6 restriction unusual wave_only qualifier num 4 ripple_both_ends
         array [L4N    AL0S AL2N R1N    CR3S CR5N]
   setup 1x6 1x6 restriction unusual wave_only qualifier num 5 ripple_both_ends
         array [R3S    AL1N AL2N L0S    CR4N CR5N]

   setup 1x8 1x8 restriction unusual wave_only qualifier num 1 ripple_both_ends
         array [CR1S   AL0S ZM2N ZM3N AL5S   CR4S ZM6N ZM7N]
   setup 1x8 1x8 restriction unusual wave_only qualifier num 2 ripple_both_ends
         array [CCAL3N AL0S ZM2N AL1S AACR7N CR4S ZM6N CR5S]
   setup 1x8 1x8 restriction unusual wave_only qualifier num 3 ripple_both_ends
         array [R2S    AL0S AL3S AL1S L6S    CR4S CR7S CR5S]
   setup 1x8 1x8 restriction unusual wave_only qualifier num 4 ripple_both_ends
         array [L6N    AL0S AL3S AL1S R2N    CR4S CR7S CR5S]
   setup 1x8 1x8 restriction unusual wave_only qualifier num 5 ripple_both_ends
         array [R7S    AL0S AL2N AL1S L3S    CR4S CR6N CR5S]
   setup 1x8 1x8 restriction unusual wave_only qualifier num 6 ripple_both_ends
         array [L5N    AL0S AL2N AL3N R1N    CR4S CR6N CR7N]
   setup 1x8 1x8 restriction unusual wave_only qualifier num 7 ripple_both_ends
         array [R4S    AL1N AL2N AL3N L0S    CR5N CR6N CR7N]

call "@6 ripple @9-1/2" c2
            neednumber
   setup 1x4 dmd restriction unusual wave_only qualifier num 1 ripple_one_end
      preds "These people can't ripple."
         if select                 [CCAL3E    0 AACR3W    0]
         if unselect_near_select   [ZM0N AL0S ZM2N CR2S]
         if unselect_near_unselect [ZM0N CR1E ZM2N AL1W]
   setup 4x1 dmd restriction unusual alwaysfail qualifier num 1 ripple_one_end
      preds "These people can't ripple."
         if select                 [   0    0    0    0]
         if unselect_near_select   [ZM0N    0 ZM2N    0]
         if unselect_near_unselect [ZM0N    0 ZM2N    0]
   setup 1x4 2stars restriction unusual wave_only qualifier num 2 ripple_one_end
      preds "These people can't ripple."
         if select                 [R1E  0 L0W    0]
         if unselect_near_select   [0 AL6S   0 CR2S]
         if unselect_near_unselect [CR0E CR3S AL1W AL7S]

   setup 1x4 dmd restriction unusual wave_only qualifier num 1 ripple_both_ends_1x4_only
         array                     [CCAL3E AL0S AACR3W CR2S]
   setup 1x4 2x2 restriction unusual wave_only qualifier num 2 ripple_both_ends_1x4_only
         array                     [R1E AL3E L0W CR2W]

   setup 1x4 2stars restriction unusual wave_only qualifier num 1 ripple_any_centers
      preds "These people can't ripple."
         if select                        [0    CCAL4E    0 AACR5W]
         if unselect_once_rem_from_select [CR0E      0 AL1W      0]
         if always                        [ZM6N   CR3S ZM2N   AL7S]

call "@6 ripple the wave" c2
   setup 1x4 1x4 restriction unusual wave_only qualifier ripple_one_end
      preds "These people can't ripple."
         if select                 [R2S 0 L0S 0]
         if unselect_near_select   [CR1S AL0S AL3S CR2S]
         if unselect_near_unselect [CR1S CR3S AL3S AL1S]
   setup 1x4 1x4 restriction unusual wave_only qualifier ripple_both_ends_1x4_only
         array                     [R2S AL1N L0S CR3N]
   setup 1x4 1x4 restriction unusual wave_only qualifier ripple_any_centers
      preds "These people can't ripple."
         if select                        [0    CCAL2N    0 AACR0N]
         if unselect_once_rem_from_select [CR1S      0 AL3S      0]
         if always                        [ZM0N   CR3S ZM2N   AL1S]

call "@6 rolling ripple 2 x @9" c4
            neednumber
   setup 1x4 1x4 restriction unusual wave_only qualifier num 1 ripple_one_end
      preds "These people can't ripple."
         if select                 [CCAM3N      0 AACM1N      0]
         if unselect_near_select   [     0   AL1N      0   CR3N]
         if unselect_near_unselect [  ZM0N CCAL2N   ZM2N AACR0N]
   setup 1x4 1x4 restriction unusual wave_only qualifier num 2 ripple_one_end
      preds "These people can't ripple."
         if select                 [CCAL1S      0 AACR3S      0]
         if unselect_near_select   [     0    R3S      0    L1S]
         if unselect_near_unselect [  ZM0N CCAM2N   ZM2N AACM0N]
   setup 1x4 1x4 restriction unusual wave_only qualifier num 1 ripple_both_ends_1x4_only
         array                     [M2S AAL1N M0S CCR3N]
   setup 1x4 1x4 restriction unusual wave_only qualifier num 2 ripple_both_ends_1x4_only
         array                     [M2S R3S M0S L1S]
   setup 1x4 1x4 restriction unusual wave_only qualifier num 1 ripple_both_centers
         array                     [CCAL3N CCAM2N AACR1N AACM0N]
   setup 1x4 1x4 restriction unusual wave_only qualifier num 2 ripple_both_centers
         array                     [R2S CCAL3S L0S AACR1S]
   setup 1x4 1x4 restriction unusual wave_only qualifier num 1 ripple_any_centers
      preds "These people can't ripple."
         if select                 [     0 CCAL2N 0      AACR0N]
         if unselect_near_select   [  ZM0N      0   ZM2N      0]
         if unselect_near_unselect [CCAL3N  CCR1N AACR1N  AAL3N]
   setup 1x4 1x4 restriction unusual wave_only qualifier num 2 ripple_any_centers
      preds "These people can't ripple."
         if select                 [     0 CCAL3S 0      AACR1S]
         if unselect_near_select   [  ZM0N      0   ZM2N      0]
         if unselect_near_unselect [CCAL3N AACR1S AACR1N CCAL3S]

call "@6 rolling ripple 3 x @9" c4
            neednumber
   setup 1x4 1x4 restriction unusual wave_only qualifier num 1 ripple_one_end
      preds "These people can't ripple."
         if select                 [R2S       0  L0S      0]
         if unselect_near_select   [CR1S   AL1N AL3S   CR3N]
         if unselect_near_unselect [CR1S CCAL2N AL3S AACR0N]
   setup 1x4 1x4 restriction unusual wave_only qualifier num 2 ripple_one_end
      preds "These people can't ripple."
         if select                 [R2S           0    L0S        0]
         if unselect_near_select   [CCAL3N AAAACR3S AACR1N CCCCAL1S]
         if unselect_near_unselect [CCAL3N   CCAL2N AACR1N   AACR0N]
   setup 1x4 1x4 restriction unusual wave_only qualifier num 3 ripple_one_end
      preds "These people can't ripple."
         if select                 [R3N         0 L1N         0]
         if unselect_near_select   [CCAL3N    L2N AACR1N    R0N]
         if unselect_near_unselect [CCAL3N CCAL2N AACR1N AACR0N]

   setup 1x4 1x4 restriction unusual wave_only qualifier num 1 ripple_both_ends_1x4_only
         array                     [R3N AAL0S L1N CCR2S]
   setup 1x4 1x4 restriction unusual wave_only qualifier num 2 ripple_both_ends_1x4_only
         array                     [L1S AAL0S R3S CCR2S]
   setup 1x4 1x4 restriction unusual wave_only qualifier num 3 ripple_both_ends_1x4_only
         array                     [R0N AAL1N L2N CCR3N]

call "@6 rolling ripple 3 x @9-1/2" c4
            neednumber
   setup 1x4 dmd restriction unusual wave_only qualifier num 1 ripple_one_end
      preds "These people can't ripple."
         if select                 [R2S       0  L0S      0]
         if unselect_near_select   [CCAL3E AAAACR1E AACR3W CCCCAL1W]
         if unselect_near_unselect [CCAL3E CCCCAL2N AACR3W AAAACR0N]
   setup 1x4 2stars restriction unusual wave_only qualifier num 2 ripple_one_end
      preds "These people can't ripple."
         if select                 [R4W         0    L5E      0]
         if unselect_near_select   [CCAL3N    L4E AACR7N    R5W]
         if unselect_near_unselect [CCAL3N CCAL2N AACR7N AACR6N]

   setup 1x4 dmd restriction unusual wave_only qualifier num 1 ripple_both_ends_1x4_only
         array                     [L1W L0S R1E R2S]
   setup 1x4 2x2 restriction unusual wave_only qualifier num 2 ripple_both_ends_1x4_only
         array                     [R3W L3E L2E R2W]

call "@6 rolling ripple 3 x 2 x 1" c4
   setup 1x4 1x4 restriction unusual wave_only qualifier ripple_one_end
      preds "These people can't ripple."
         if select                 [R2S  0        L0S  0]
         if unselect_near_select   [0    AAAACR3S 0    CCCCAL1S]
         if unselect_near_unselect [CR2S CCAL3S   AL0S AACR1S]
   setup 1x4 1x4 restriction unusual wave_only qualifier ripple_both_ends_1x4_only
         array                     [R0N L1N L2N R3N]

call "peel the deal" c4
   setup 2x2 1x4 restriction peelable_box
      array [AL1E CR3W CR2W AL0E]
            alternate_definition [single] c4
   setup 1x2 1x2
      array [AL0E CR1W]
            alternate_definition [3x3] c4
   setup 3x2 1x6 rotate restriction peelable_box
      array [AL0N AL1N AL2N CR5S CR4S CR3S]
            alternate_definition [4x4] c4
   setup 4x2 1x8 rotate restriction peelable_box
      array [AL0N AL1N AL3N AL2N CR6S CR7S CR5S CR4S]

call "trail the deal" c4
   setup 2x2 1x4 restriction peelable_box
      array [CR3W AL1E AL0E CR2W]
            alternate_definition [single] c4
   setup 1x2 1x2
      array [CR1W AL0E]
            alternate_definition [3x3] c4
   setup 3x2 1x6 rotate restriction peelable_box
      array [CR3S CR4S CR5S AL2N AL1N AL0N]
            alternate_definition [4x4] c4
   setup 4x2 1x8 rotate restriction peelable_box
      array [CR4S CR5S CR7S CR6S AL2N AL3N AL1N AL0N]

call "peel and trail the deal" c4
   setup 2x2 1x4 restriction peelable_box
      array [AL1E CR3W AL0E CR2W]
            alternate_definition [1x2] c4
   setup 3x2 1x6 rotate restriction peelable_box
      array [CR3S CR4S AL2N CR5S AL1N AL0N]
            alternate_definition [2x1] c4
   setup 3x2 1x6 rotate restriction peelable_box
      array [CR3S AL1N AL2N CR5S CR4S AL0N]
            alternate_definition [1x3] c4
   setup 4x2 1x8 rotate restriction peelable_box
      array [CR4S CR5S CR7S AL2N CR6S AL3N AL1N AL0N]
            alternate_definition [3x1] c4
   setup 4x2 1x8 rotate restriction peelable_box
      array [CR4S AL1N AL3N AL2N CR6S CR7S CR5S AL0N]
            alternate_definition [2x2] c4
   setup 4x2 1x8 rotate restriction peelable_box
      array [CR4S CR5S AL3N AL2N CR6S CR7S AL1N AL0N]

call "trail and peel the deal" c4
   setup 2x2 1x4 restriction peelable_box
      array [CR3W AL1E CR2W AL0E]
            alternate_definition [1x2] c4
   setup 3x2 1x6 rotate restriction peelable_box
      array [AL0N AL1N CR5S AL2N CR4S CR3S]
            alternate_definition [2x1] c4
   setup 3x2 1x6 rotate restriction peelable_box
      array [AL0N CR4S CR5S AL2N AL1N CR3S]
            alternate_definition [1x3] c4
   setup 4x2 1x8 rotate restriction peelable_box
      array [AL0N AL1N AL3N CR6S AL2N CR7S CR5S CR4S]
            alternate_definition [3x1] c4
   setup 4x2 1x8 rotate restriction peelable_box
      array [AL0N CR5S CR7S CR6S AL2N AL3N AL1N CR4S]
            alternate_definition [2x2] c4
   setup 4x2 1x8 rotate restriction peelable_box
      array [AL0N AL1N CR7S CR6S AL2N AL3N CR5S CR4S]

call "_weird crossfire 1" dontshow tag weirdxfire1
   setup 2x4 2x4 rotate qualifier live ntbone none restriction unusual alwaysfail
      array [CR0E CR1E AL6E AL7E 0 AL5E CR2E 0]

call "_weird crossfire 2" dontshow tag weirdxfire2
   conc weirdxfire3 [] nullcall [conc_demand_columns conc_force_columns]

call "_weird crossfire 3" dontshow tag weirdxfire3
   setup 2x2 trngl4 rotate
      array [ZM7W ZM2W ZM5W ZM0W]

call "_weird crossfire 4" dontshow tag weirdxfire4
   setup 4x1 2x2
      array [Z0N 0 0 Z1N]
   setup pmd dmd
      array [Z0N ZM1N Z2N ZM3N]

// This call does *not* finish with an extend.  It finishes with "centers ...
// step straight forward".  Callerlab Plus definitions, page 2.  The ends do not
// participate in the step forward.  Therefore, they can roll.
call "crossfire" plus
            take_right_hands   // Just to handle the horrible case of a wave.
            parallel_conc_end
   setup 2x4 qtag qualifier live out in_or_out /* If facing in, clause below handles it. */
      array [CR1S CM2S AM7S AL0S 0 0 0 0]

   // Extremely strange ones.
   setup 2x4 bone rotate qualifier live tbone out centers_in_or_out
                         restriction unusual alwaysfail
      array [CR0E 0 0 AL5E 0 0 0 0]
   setup 4x2 bone rotate qualifier live tbone out centers_in_or_out
                         restriction unusual alwaysfail
      array [0 0 CM2E 0 0 AM7E 0 0]

   setup 2x4 4x4 qualifier live tbone in centers_in_or_out
                        restriction unusual alwaysfail
      array [CR14S 0 0 AL13S 0 0 0 0]
   setup 4x2 4x4 qualifier live tbone in centers_in_or_out
                        restriction unusual alwaysfail
      array [0 CM9S 0 0 0 0 AM10S 0]

   setup 1x4 2x2 qualifier couples_only        // Handles 1-faced or 2-faced lines.
      array [CR1S CM2S AL0S AM3S]
   setup 1x4 1p5x4 qualifier magic_only        // Handles inverted lines.
      array [CR3S CM4S AL1S AM6S]

   // Wave: this is the horrible Applications Review Committee thing.
   // "The definition allows for this application; however, the ending position
   // is extremely unusual and the Committee cautions its use."
   setup 1x4 2x2 qualifier wave_only restriction unusual alwaysfail
      array [CR1S CM2S AL0S AM3S]

   setup dmd 2x2
      array [CR1S 0 AL0S 0]
   setup pmd 2x2
      array [0 CM3S 0 AM0S]
            alternate_definition [yoyo] c4
   // Of course, when we start getting serious,
   // everyone steps forward, and rolling is problematical.
   setup 1x4 2x2 qualifier wave_only
      array [C1S C3W A0S A2E]
   setup dmd 2x2
      array [C1S 0 A0S 0]
   setup pmd 2x2
      array [0 C0W 0 A3E]
            alternate_definition [stingy] c4
   setup 1x4 2x2 qualifier wave_only
      array [C1S C1E A0S A0W]
   setup dmd 2x2
      array [C1S 0 A0S 0]
   setup pmd 2x2
      array [0 C2E 0 A1W]
            alternate_definition [generous] c4
   setup 1x4 2x2 qualifier wave_only
      array [C1S C3W A0S A2E]
   setup dmd 2x2
      array [C1S 0 A0S 0]
   setup pmd 2x2
      array [0 C0W 0 A3E]
            alternate_definition [straight] c4
   setup 2x4 2x4 rotate restriction 2fl_only
      array [CR0E CM1E AM6E AL7E ZM1W AM4E CM3E ZM6W]
   setup pqtag 2x4
      array [ZM2N CR4S 0 0 AL3S ZM5N 0 0]
   setup qtag 2x4
      array [0 0 AM5S CM4S 0 0 CM6S AM7S]
            alternate_definition [straight yoyo] c4
   setup 2x4 2x4 rotate restriction wave_only
      array [CR0E CM6S AM1N AL7E ZM1W AM3N CM4S ZM6W]
   setup pqtag 2x4 restriction nice_diamonds
      array [ZM2N CR4S 0 0 AL3S ZM5N 0 0]
   setup qtag 2x4 restriction nice_diamonds
      array [0 0 AM4E CM5W 0 0 CM7W AM6E]
            alternate_definition [3x3] c4
   setup 1x6 2x3 rotate restriction forbidden 3x3_2fl_only
      array [C0E C1E C2E A5E A4E A3E]
            alternate_definition [4x4] c4
   setup 1x8 2x4 rotate restriction forbidden 4x4_2fl_only
      array [C0E C1E C3E C2E A7E A6E A4E A5E]
            alternate_definition [6x6] c4
   setup 1x12 2x6 rotate restriction forbidden 3x3couples_only
      array [C0E C1E C2E C3E C4E C5E A11E A10E A9E A8E A7E A6E]
            alternate_definition [8x8] c4
   setup 1x16 2x8 rotate restriction forbidden 4x4couples_only
      array [C0E C1E C2E C3E C4E C5E C6E C7E A15E A14E A13E A12E A11E A10E A9E A8E]

   // Really weird one.
   seq weirdxfire1 []
   seq weirdxfire2 []
   seq weirdxfire4 []

call "cross sashay" c4a
   setup 1x4 2x2 restriction wave_only
      array [CR1S ZM1N AL0S ZM0N]
   setup dmd 2x2 restriction nice_diamonds
      array [CR1S 0 AL0S 0]
   setup pmd 2x2 restriction nice_diamonds
      array [0 ZM2N 0 ZM1N]
            alternate_definition [straight] c4
   setup 2x4 2x4 rotate restriction wave_only
      array [CR0E ZM0W ZM7W AL7E ZM1W ZM5W ZM2W ZM6W]
   setup pqtag 2x4 restriction nice_diamonds
      array [ZM2N CR4S 0 0 AL3S ZM5N 0 0]
   setup qtag 2x4 restriction nice_diamonds
      array [0 0 ZM2N ZM3N 0 0 ZM1N ZM0N]

call "chain down the line" mainstream
            parallel_conc_end
   setup 1x4 2x2
      array [AL0E CCAL1W AAL2W 0]
   setup 4x1 2x2
      array [AL0N 0 0 0]
            alternate_definition [yoyo] c4
   setup dmd 2x2
      array [AL0E 0 AAL2W 0]
   setup pmd 2x2
      array [0 CCCAL3N 0 0]
            alternate_definition [stingy] c3
   setup dmd 2x2
      array [AL0E 0 AAL2W 0]
   setup pmd 2x2
      array [0 CAL1S 0 0]
            alternate_definition [generous] c3
   setup dmd 2x2
      array [AL0E 0 AAL2W 0]
   setup pmd 2x2
      array [0 CCCAL3N 0 0]

call "finish chain down the line" mainstream
            parallel_conc_end
   setup 1x4 2x2
      array [AL0E AL3E AAL2W 0]
   setup 4x1 2x2
      array [AL0N 0 0 0]

// Callerlab says this is a no-no, Feb 2000, so we set it to c1.
call "3/4 chain down the line" c1
            parallel_conc_end
   setup dmd 2x2 restriction controversial alwaysfail
      array [AL0E 0 AAL2W 0]
   setup pmd 2x2
      array [0 CCCAL3N 0 0]

call "swap the wave" c2
            reverse_means_mirror
   setup 1x4 2x2 qualifier miniwaves restriction controversial wave_only
      array [CM2S CM2S ZM1N ZM1N]

call "wave recycle" dontshow tag waverecycle
            diamond_is_legal
   setup 1x4 2x2 no_cutting_through qualifier wave_only
      array [CR1S AL3N AL0S CR2N]
   setup 1x4 2x2 no_cutting_through qualifier magic_only
      array [CR1S AL0N AL3S CR2N]
            alternate_definition [cross] c3
   setup 1x4 2x2 restriction 2fl_only
      array [CR1S CR2N AL0S AL3N]
            alternate_definition [diamond] c4
   setup dmd 2x2
      array [CR1S 0 AL0S 0]
   setup pmd 2x2
      array [0 CR2W 0 AL1E]
    // Allow "outsides go 2/3, all 8 recycle".
            visible_fractions cross_is_inherited no_seq_if_no_frac
   seq ctrsfoldforrecycle [inherit_cross]
   seq splitctrrot []
   seq roll []

call "hammerlane" c4a tag hammerlane
            reverse_means_mirror
   setup 2x2 1x4
      array [0 0 ZM0N CR3S]
            alternate_definition [yoyo] c4
   setup 2x2 dmd
      array [0 0 ZM0N CR3W]
            alternate_definition [singlefile] c4
   setup 4x1 1x4 rotate
      array [ZM0W CR3E 0 0]
            alternate_definition [yoyo singlefile] c4
   setup 4x1 dmd rotate
      array [ZM0W CR3S 0 0]

call "split recycle" c1 tag splitrecycle
            reverse_means_mirror diamond_is_legal
   setup 2x2 1x4 restriction not_tboned
      preds "Can't do this with phantoms or T-boned people."
         if 2x2_miniwave [CR2S AL0S AL3S CR1S]
         if 2x2_couple   [0    0    ZM0N CR1S]
         if always       [CR2S 0    0    CR1S]
            alternate_definition [singlefile] c3a
   setup 4x1 1x4 rotate
      array [ZM0W CR1E 0 0]
            alternate_definition [3x3] c4
   setup 3x2 1x6 rotate restriction wave_only
      array [CR1E CR5E CR3E AL0E AL2E AL4E]
            alternate_definition [4x4] c4
   setup 4x2 1x8 rotate restriction wave_only
      array [CR1E CR2E CR7E CR4E AL0E AL3E AL6E AL5E]
            alternate_definition [cross] c3
   setup 2x2 1x4 restriction not_tboned
      preds "Can't do this with phantoms or T-boned people."
         if 2x2_miniwave [CR2S AL0S AL1S CR3S]
         if 2x2_couple   [0    0    ZM0N CR3S]
            alternate_definition [diamond] c4
   setup 2x2 dmd restriction not_tboned
      preds "Can't do this with phantoms or T-boned people."
         if 2x2_miniwave [CR2S AL0S AL1W CR1E]
         if 2x2_couple   [0    0    ZM0N CR1E]
         if always       [CR2S 0    0    CR1E]

call "box recycle" c1
   alias splitrecycle

call "centers fold" dontshow tag ctrsfoldforrecycle
            parallel_conc_end
   // Only for weird constructions, demand live to be sure that's what is wanted.
   setup 1x4 2x2 qualifier live 1fl_only restriction forbidden levelc1
      array [ZM3N AL0S ZM2N CR1S]
   setup 1x4 2x2 qualifier levelc1 restriction wave_only
      array [ZM0N AL0S ZM1N CR1S]
            alternate_definition [cross] c3
   setup 1x4 2x2 restriction 2fl_only
      array [ZM0N CR1S ZM1N AL0S]
   setup 1x4 2x2 restriction 1fl_only
      array [ZM3N AL1S ZM2N CR0S]
   setup 1x4 2x2 restriction magic_only
      array [ZM0N CR1S ZM1N AL0S]

// **** Actually, reverse is only appropriate for facing-couples version.  Sigh.
call "recycle" mainstream tag recycle
// We put the array definition first.  Recycle is actually a very
// complex call.  The array definition is able to give the program hints
// about lots of subtleties (e.g. where the phantoms go if you do it
// concentrically in split phantom tidal waves, see test ng01)
// that the sequential definition just isn't very smart about.
// Well, actually, that issue has been fixed, but there are others,
// like when we should complain about having the ends recycle.  See test t22.
            reverse_means_mirror
            diamond_is_legal
   setup 1x4 2x2 no_cutting_through qualifier wave_only
      array [CR1S AL3N AL0S CR2N]
   setup 1x4 2x2 no_cutting_through qualifier magic_only restriction controversial alwaysfail
      array [CR1S AL0N AL3S CR2N]
   setup 2x2 1x4 no_cutting_through qualifier in in_or_out restriction forbidden levela2
      array [0 0 ZM0N CR1S]
   setup 2x2 1x4 no_cutting_through restriction forbidden levelc1
      preds "Can't do this with phantoms or T-boned people."
         if 2x2_miniwave [CR2S AL0S AL3S CR1S]
         if 2x2_couple   [0    0    ZM0N CR1S]
         if always       [CR2S 0    0    CR1S]
            alternate_definition [straight] c4
   setup 2x4 2x4 rotate restriction wave_only
      array [CR0E AL6W CR1W AL7E ZM1W CR3W AL4W ZM6W]
            alternate_definition [singlefile] c3a
   setup 4x1 1x4 rotate
      array [ZM0W CR1E 0 0]
            alternate_definition [cross] c3
   setup 1x4 2x2 qualifier 2fl_only
      array [CR1S CR2N AL0S AL3N]
   setup 2x2 1x4 restriction not_tboned
      preds "Can't do this with phantoms or T-boned people."
         if 2x2_miniwave [CR2S AL0S AL1S CR3S]
         if 2x2_couple   [0    0    ZM0N CR3S]
         if always       [CR2S 0    0    CR3S]
            alternate_definition [single] c4
   setup 1x2 1x2 restriction forbidden wave_only
      array [CR1S AL0S]
            alternate_definition [3x3] c4
   setup 3x2 1x6 rotate restriction forbidden wave_only
      array [CR1E CR5E CR3E AL0E AL2E AL4E]
            alternate_definition [4x4] c4
   setup 4x2 1x8 rotate restriction forbidden wave_only
      array [CR1E CR2E CR7E CR4E AL0E AL3E AL6E AL5E]
            alternate_definition [diamond] c4a
   setup dmd 2x2
      array [CR1S 0 AL0S 0]
   setup pmd 2x2
      array [0 CR2W 0 AL1E]
   setup 2x2 dmd restriction not_tboned
      preds "Can't do this with phantoms or T-boned people."
         if 2x2_miniwave [CR2S AL0S AL1W CR1E]
         if 2x2_couple   [0    0    ZM0N CR1E]
         if always       [CR2S 0    0    CR1E]
            alternate_definition [singlefile diamond] c4
   setup 4x1 dmd rotate
      array [ZM0W CR1N 0 0]
            alternate_definition [straight diamond] c4
   setup qtag 2x4
      array [0 0 AL2E CR3W 0 0 CR1W AL0E]
   setup pqtag 2x4
      array [ZM2N CR4S 0 0 AL3S ZM5N 0 0]
            visible_fractions cross_is_inherited no_seq_if_no_frac
   // This doesn't get used unless some fractionalizing concept is in use.
   // Otherwise it could do recycle from lines facing out (centers fold, counter rotate, roll!)
   seq ctrsfoldforrecycle [inherit_cross]
   seq splitctrrot []
   seq roll []

call "more or less recycle" c4
   setup 2x4 2x4 rotate qualifier wave_only
      array [CR0S AL6S CR1N AL7N AL5S CR3S AL4N CR2N]

call "less or more recycle" c4
   setup 2x4 2x4 rotate qualifier wave_only
      array [CR0N AL6N CR1S AL7S AL5N CR3N AL4S CR2S]

// We leave this one around so that a comma won't appear in the name.
// The parser will prefer this one, of course.
call "2/3 recycle" c1 tag 23recycle
            visible_fractions cross_is_inherited
   seq ctrsfoldforrecycle [inherit_cross]
   seq splitctrrot []

call "all 8 recycle" c1
            reverse_means_mirror singlefile_is_inherited cross_is_inherited diamond_is_legal
   crossconc splitrecycle [conc_demand_columns inherit_reverse inherit_singlefile inherit_cross inherit_diamond]
             waverecycle [inherit_cross inherit_diamond suppress_elongation_warnings]
   // This is also legal in a thar, meaning the A2 "all 8" concept.
   // The "all 8" code knows how to handle it, of course, but the parser
   // will give this definition precedence.
            reverse_means_mirror
   setup thar 4x4 qualifier wave_only
      array [CR14S AL6N 0 0 AL13S CR5N 0 0]
            alternate_definition [cross] c3
   setup thar 4x4 qualifier 2fl_only
      array [CR14S CR5N 0 0 AL13S AL6N 0 0]

call "all 8 cross cycle" c3
            reverse_means_mirror singlefile_is_inherited diamond_is_legal
   crossconc splitrecycle [conc_demand_columns inherit_reverse inherit_singlefile force_cross inherit_diamond]
             waverecycle [force_cross inherit_diamond suppress_elongation_warnings]
   // This is also legal in a thar, meaning the A2 "all 8" concept.
   // The "all 8" code knows how to handle it, of course, but the parser
   // will give this definition precedence.
            reverse_means_mirror
   setup thar 4x4 qualifier 2fl_only
      array [CR14S CR5N 0 0 AL13S AL6N 0 0]

call "all 8 cycle and wheel" c1
            reverse_means_mirror singlefile_is_inherited cross_is_inherited diamond_is_legal
   crossconc splitrecycle [conc_demand_columns inherit_reverse inherit_singlefile
                          inherit_cross inherit_diamond]
             wheelanddeal [suppress_elongation_warnings]

call "all 8 cycle and turn and deal" c2
            reverse_means_mirror singlefile_is_inherited cross_is_inherited diamond_is_legal
   crossconc splitrecycle [conc_demand_columns inherit_reverse inherit_singlefile
                          inherit_cross inherit_diamond]
             turnanddeal [suppress_elongation_warnings]

call "_linear cycle pre 1" dontshow tag linear_cycle_pre_1
            overcast_transparent
   // If in a wave or inverted line, it's always OK.  This allows "initially once removed" from a 2FL.
   setup 1x4 1x4 qualifier miniwaves
      array [ZM0N ZM1N ZM2N ZM3N]
   // If in a miniwave, it's always OK.  This allows "initially once removed" from a 2FL.
   setup 1x2 1x2 qualifier wave_only
      array [ZM0N ZM1N]
   // Otherwise, it's not OK at plus.  But Callerlab doesn't tell us
   // the level at which it becomes legal.  The "partner hinge"
   // becomes legal at A1, so that's what we do.
   setup 1x4 1x4 restriction forbidden levela1
      array [ZM0N ZM1N ZM2N ZM3N]
            alternate_definition [cross] c4
   setup 1x4 1x4
      array [ZM0N ZM3N ZM2N ZM1N]

call "_natural vertical 1/2 tag" dontshow tag natural_vertical_half_tag
   setup 2x2 2x2 qualifier right wave_only
      array [CR1S 0 0 ZM0N]
   setup 2x2 2x2 qualifier left wave_only
      array [0 AL0S ZM1N 0]
   setup 2x2 2x2 restriction not_tboned
      predscantdocallinsetup
         if 2x2_antitandem          [CR1S AL1S ZM0N ZM0N]
         if 2x2_tandem_with_someone [CR1S AL0S ZM1N ZM0N]
         if always                  [CR1S    0    0 ZM0N]

call "1/3 linear cycle" plus tag linear_cycle_1
            left_means_mirror cross_is_inherited gen_sting_is_inherited
   seq linear_cycle_pre_1 [inherit_cross roll_transparent]
   seq hinge_with_warn [inherit_left inherit_gensting]

call "_finish linear cycle" dontshow tag fin_linear_cycle
   setup 2x2 2x2 qualifier right wave_only
      array [CR2N 0 0 CR1S]
   setup 2x2 2x2 qualifier left wave_only
      array [0 AL3N AL0S 0]
   // Maybe this next item should be marked "controversial".
   // I consider it really disgusting that dancers have to remember their
   // original miniwave handedness (for the final peel) after they have
   // done a right-shoulder double pass thru.  Even at C4, call definitions
   // usually take great pains not to require dancers to remember past
   // "state" after it has disappeared.  But this lowly Plus call
   // violates that.
   setup 2x2 2x2 restriction not_tboned
      array [CR2N AL3N AL0S CR1S]

call "linear cycle" plus
            first_part_visible left_means_mirror cross_is_inherited gen_sting_is_inherited
   seq linear_cycle_1 [inherit_left inherit_cross inherit_gensting]
   seq fin_linear_cycle []

call "2/3 linear cycle" plus
            left_means_mirror cross_is_inherited gen_sting_is_inherited
   seq linear_cycle_1 [inherit_left inherit_cross inherit_gensting]
   seq linear_cycle_2 []

// Can't do this and then do the peel; information has been lost.
// Must stop after doing this.  The is the DPT.
call "linear cycle 2nd part" dontshow tag linear_cycle_2
   setup 2x2 1x4 rotate qualifier miniwaves
      array [ZM3E ZM3E ZM0W ZM0W]

call "cycle and wheel" a1 tag cyclewheel
   setup 1x4 2x2
      predscantdocallinsetup
         if miniwave_side_of_in_3n1_line  [CR1S AL0N AL3S CR2N]
         if couple_side_of_in_3n1_line    [CR1S CR0S AL3S AL2S]
         if miniwave_side_of_out_3n1_line [CR1S AL3N AL0S CR2N]
         if couple_side_of_out_3n1_line   [CR1S CR0S AL0S AL1S]
         // These help with phantoms.
         if cycle_and_wheel_1 [CR1S CR0S 0    CR2N]
         if cycle_and_wheel_2 [0    AL3N AL3S AL2S]
         if always            [0    AL0N AL0S AL1S]
   setup 2x2 1x4 qualifier levelc1 restriction not_tboned
      preds "Can't do this with phantoms or T-boned people."
         if 2x2_miniwave_nocycle_wheel [CR2S AL0S AL3S CR1S]
         if 2x2_couple_nocycle_wheel   [0    0    ZM0N CR1S]
         if always                     [CR2S 0    0    CR1S]
   // Below C1, we allow only the facing-couples version.  And only at A2.
   // And it's fairly useless anyway without the concentric concept, which is C1.
   setup 2x2 1x4 qualifier ntbone in in_or_out restriction forbidden levela2
         array [0    0    ZM0N CR1S]
            alternate_definition [straight] c4
   setup 2x4 2x4 rotate
      predscantdocallinsetup
         if couple_side_of_in_3n1_line    [CR0E CR7E 0 0 0 0 CR5E ZM6W]
         if miniwave_side_of_in_3n1_line  [CR0E AL6W 0 0 0 0 AL4W ZM6W]
         if couple_side_of_out_3n1_line   [CR0E CR7E AL0E AL7E ZM1W AL2E CR5E ZM6W]
         if miniwave_side_of_out_3n1_line [CR0E AL6W CR1W AL7E ZM1W CR3W AL4W ZM6W]

call "cycle and turn and deal" c2
   setup 1x4 2x2 no_cutting_through qualifier wave_only
      array [CR1S AL3N AL0S CR2N]
   setup 1x4 2x2 no_cutting_through qualifier magic_only
      array [CR1S AL0N AL3S CR2N]
   setup 1x4 2x2 no_cutting_through qualifier 1fl_only
      array [CR0S CR1S AL2S AL3S]
   setup 1x4 2x2 no_cutting_through qualifier 2fl_only
      array [CR0S CR1S AL2S AL3S]
   setup 1x4 2x2
      predscantdocallinsetup
         if miniwave_side_of_in_3n1_line  [CR1S AL0N AL3S CR2N]
         if couple_side_of_in_3n1_line    [CR0S CR1S AL2S AL3S]
         if miniwave_side_of_out_3n1_line [CR1S AL0N AL3S CR2N]
         if couple_side_of_out_3n1_line   [CR0S CR1S AL2S AL3S]

call "cross cycle" c3
   setup 1x4 2x2 qualifier 2fl_only
      array [CR1S CR2N AL0S AL3N]
   setup 2x2 1x4 restriction not_tboned
      preds "Can't do this with phantoms or T-boned people."
         if 2x2_miniwave [CR2S AL0S AL1S CR3S]
         if 2x2_couple   [0    0    ZM0N CR3S]
         if always       [CR2S 0    0    CR3S]
            visible_fractions
   seq ctrsfoldforrecycle [force_cross]
   seq splitctrrot [seq_re_evaluate]
   seq roll []

call "2/3 cross cycle" c3
            visible_fractions
   seq ctrsfoldforrecycle [force_cross]
   seq splitctrrot [seq_re_evaluate]

call "explode" plus tag explode
            parallel_conc_end
            can_be_one_side_lateral
   // If they are consistent with miniwaves, do it that way, even if phantoms.
   // Not happy about it, but it seems to be the way people construe this call.
   setup 1x4 2x2 qualifier miniwaves
      array [CR0E CR0E AL1W AL1W]
   setup 1x4 2x2 restriction serious_violation explodable
      preds "Can't explode from this line."
         if lines_miniwave [CR0E CR0E AL1W AL1W]
         if lines_couple   [CR3E CR0E AL2W AL1W]
   // Allow people far apart to do it.
   setup 1x6 2x3 qualifier miniwaves
      array [CR0E CR0E 0 AL2W AL2W 0]
            alternate_definition [reverse] c1
   setup 1x4 2x2 qualifier miniwaves                      /* See above. */
      array [AL0W AL0W CR1E CR1E]
   setup 1x4 2x2 restriction serious_violation reverse_explodable
      preds "Can't explode from this line."
         if lines_miniwave [AL0W AL0W CR1E CR1E]
         if lines_couple   [AL0W AL3W CR1E CR2E]

call "explode the line" a1 tag explodeline
   setup 1x4 2x2 no_cutting_through qualifier miniwaves   /* See above. */
      array [CM1E CM1E AM0W AM0W]
   setup 1x4 2x2 no_cutting_through restriction serious_violation explodable
      preds "Can't explode from this line."
         if lines_miniwave [CM1E CM1E AM0W AM0W]
         if lines_couple   [C2E C1E A3W A0W]

call "explode the wave" plus
   setup 1x4 2x2 no_cutting_through restriction forbidden wave_only
      array [CM1E CM1E AM0W AM0W]

// We allow both wordings.
call "explode @0" plus
            dont_use_in_resolve visible_fractions
   seq explode []
   seq nullcall [mandatory_anycall]

call "explode and @0" plus
            dont_use_in_resolve visible_fractions
   seq explode []
   seq nullcall [mandatory_anycall]

call "explode the diamond" c3
   conc explodeline [] coupleup [conc_force_spots]

call "about" c4 tag about
            parallel_conc_end
   setup 1x4 2x2 restriction controversial wave_only
      array [CR0E CR0E AL1W AL1W]
   setup thar alamo restriction miniwaves
      array [CR7E CR7E 0 0 AL2W AL2W 0 0]

call "@0 about" c4
            dont_use_in_resolve visible_fractions
   seq nullcall [mandatory_anycall]
   seq about []

call "swing about" c4
            left_means_touch_or_check step_to_wave
            grand_is_inherited yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq swing [inherit_yoyo inherit_gensting]
   seq maybegrandslip [roll_transparent inherit_grand]
   seq about []

// Quarter about and three quarter about.

call "@D about" c4x
   /* This is a right-hand-unless-the-caller-says-left call.  Note its
      grammatical similarity to the other calls that have the same property:
      quarter thru, quarter cross, and quarter mix. */
            step_to_wave left_means_mirror grand_is_inherited neednumber visible_fractions
   seq odd_frac_by_right_for_about [inherit_left]
   seq maybegrandslip [roll_transparent inherit_grand]
   seq about []

call "_triple cast ends1" dontshow tag triplecastends1
            take_right_hands
   setup 1x4 2x2
      array [AL3E CM3W CR2W AM2E]
            alternate_definition [stingy] c3
   setup 1x4 2x2
      array [AL3E CM2S CR2W AM3S]
            alternate_definition [generous] c3
   setup 1x4 2x2
      array [AL3E CM0N CR2W AM1N]

call "triple cast" c4a
            fractal_is_inherited gen_sting_is_inherited
   cross_checkpoint cast_off_n4_with_warn [insert_number 3 inherit_fractal inherit_gensting conc_force_lines]
                    triplecastends1 [inherit_gensting suppress_elongation_warnings]

call "split cast" c4a
            left_means_mirror yoyo_is_inherited gen_sting_is_inherited
   conc2_4_or_normal
      cast_off_n4      [inherit_yoyo inherit_gensting insert_number 2]
      hinge_then_trade [conc_demand_columns conc_force_spots inherit_left inherit_yoyo inherit_gensting
                        suppress_elongation_warnings endscando]

call "split cast @b" c4a
            left_means_mirror neednumber
   conc2_4_or_normal
      cast_off_n4       []
      hinge_then_cast_n [conc_demand_columns conc_force_spots inherit_left suppress_elongation_warnings endscando]

call "_change the web 1" dontshow tag change_web_1
            fudge_to_q_tag
   // We don't support any stability for this.  How the ends turn
   // to make the stars, or whatever it is that they do, is too fudgy.
   setup hrglass qtag rotate qualifier ctr_pts_rh
      array [6N 0E  0 0 2S 4W 5W  0]
   setup hrglass qtag rotate qualifier ctr_pts_lh
      array [5E 6S 0W  0 1W 2N  0 0]
   setup phrglass qtag rotate qualifier ctr_pts_rh
      array [0 0 0 0 0 0 0 3W]
   setup phrglass qtag rotate qualifier ctr_pts_lh
      array [0 0 0 7W 0 0 0 0]

call "_change the web 3" dontshow tag change_web_3
   setup hrglass qtag rotate
      array [0 0 AL0S 0 0 0 CR5N 0]
   setup phrglass qtag rotate
      array [ZM6W CR0E 0 ZM7W AL1E ZM2W 0 ZM3W]
   setup qtag hrglass rotate
      array [0 0 AL0S ZM3W 0 0 CR5N ZM7W]
   setup pqtag hrglass rotate
      array [ZM6W CR0E 0 0 AL1E ZM2W 0 0]

call "change the web" c4
            fudge_to_q_tag step_to_qtag left_means_touch_or_check yoyo_is_inherited gen_sting_is_inherited
   seq ctrsswing [inherit_yoyo inherit_gensting]
   seq ctr2castoff_n [insert_number 3]
   seq change_web_1 []
   seq turnstarn_fudge [insert_number 5]
   seq ctr2castoff_n [insert_number 3]
   seq change_web_3 []

call "@9-@9-@9-@9 change the web" c4
            need_four_numbers fudge_to_q_tag step_to_qtag left_means_touch_or_check
   seq ctrscastoff_n []
   seq ctr2castoff_n [shift_one_number]
   seq change_web_1 []
   seq turnstarn_fudge [shift_two_numbers]
   seq ctr2castoff_n [shift_three_numbers]
   seq change_web_3 []

call "_spin the web 1" dontshow tag spin_web_1
            fudge_to_q_tag
   setup qtag dhrglass rotate qualifier right dmd_ctrs_mwv
      array [5W 0E  0 3E 1E 4W 6S  0]
   setup qtag dhrglass rotate qualifier left dmd_ctrs_mwv
      array [5E 0W 6N  0 1W 4E  0 7E]

call "_spin the web 2" dontshow tag spin_web_2
   conc2_6 nullcall [] turnstarn [allow_forced_mod insert_number 4]

call "_spin the web 3" dontshow tag spin_web_3
   setup dhrglass qtag rotate
      array [ 0  0 3N  0  0  0 3S  0]
   setup pdhrglass qtag rotate
      array [5W 0E  0 6W 1E 4W  0 2W]

call "spin the web" c4
            fudge_to_q_tag
   seq spin_web_1 []
   seq spin_web_2 []
   seq spin_web_3 []

call "centers trade" dontshow tag ctrstrade
            yoyo_is_inherited gen_sting_is_inherited bigmatrix_is_inherited
   maybematrix_conc trade [inherit_yoyo inherit_gensting] nullcall []

call "_finish trim the web" dontshow tag trim_web_2
   setup bone bone
      array [0 0 CR4W ZR3N 0 0 AL5E ZL7N]
   setup pbone bone qualifier ctr_pts_rh
      array [AL6W AL4S 0 0 AL2E AL0N 0 0]
   setup pbone bone qualifier ctr_pts_lh
      array [CR5N CR2W 0 0 CR1S CR6E 0 0]
   setup dhrglass dhrglass
      array [0 0 CR4W 0 0 0 AL5E 0]
   setup pdhrglass dhrglass qualifier ctr_pts_rh
      array [AL6W AL4S 0 ZL3N AL2E AL0N 0 ZR7N]
   setup pdhrglass dhrglass qualifier ctr_pts_lh
      array [CR5N CR2W 0 ZL3N CR1S CR6E 0 ZR7N]
   setup bone6 bone6
      array [0 0 CR3W 0 0 AL4E]
   setup pbone6 bone6 qualifier ctr_pts_rh
      array [L5W  L3S  0 AL2E AL0N 0]
   setup pbone6 bone6 qualifier ctr_pts_lh
      array [CR4N CR2W 0 R1S  R5E 0]

call "trim the web" c4
            sequence_starter left_means_mirror yoyo_is_inherited gen_sting_is_inherited step_to_wave visible_fractions
   seq ctrsswing [inherit_yoyo inherit_gensting]
   seq trim_web_2 [roll_transparent]

call "cross and divide" c4
            parallel_conc_end
   setup 1x4 2x2
      predscantdocallinsetup
         if x14_once_rem_miniwave [AL0W CR1E CR1E AL0W]
         if x14_once_rem_couple   [AL3W CR1E CR2E AL0W]
         if always                [   0 CR1E    0 AL0W]
            alternate_definition [single] c4
   setup 1x2 1x2 qualifier wave_only
     array [AL0W CR1E]
            alternate_definition [3x3] c4
   setup 1x6 2x3 rotate qualifier wave_only
     array [AL3S CR0N AL4S CR2N AL5S CR1N]
            alternate_definition [4x4] c4
   setup 1x8 2x4 rotate qualifier wave_only
     array [AL4S CR0N CR1N AL5S CR3N AL7S AL6S CR2N]

call "_Z axle part 1" dontshow tag zaxle1
            split_large_setups
            // Almost all calls marked "space invader" are that way because they are
            // matrix calls.  Z Axle needs to be that way because it is defined in terms
            // of Cross Cast Back, which is a matrix call.  But we're actually defining it
            // here as an array definition, so we need this flag.
   setup 3x2 1x4 rotate is_space_invader qualifier true_Z_cw
      array [0 ZM1W CR2E  0 ZM3W 0]
   setup 3x2 1x4 rotate is_space_invader qualifier true_Z_ccw
      array [0 ZM1W  0 AL0E ZM3W 0]
   setup 3x2 1x4 rotate is_space_invader
      array [0 ZM1W  0    0 ZM3W 0]
   setup qtag 1x4 qualifier true_Z_cw
      array [CR2S 0 0 ZM3N 0 0 0 ZM1N]
   setup qtag 1x4 qualifier true_Z_ccw
      array [0 AL0S 0 ZM3N 0 0 0 ZM1N]
   setup qtag 1x4
      array [0 0 0 ZM3N 0 0 0 ZM1N]


call "_Z pass thru" dontshow tag zpass
            preserve_z_stuff split_large_setups
            funny_means_those_facing
   setup 3x2 2x3 qualifier true_Z_cw
      array [0 ZM2N 0 0 0 ZM4N]
   setup 3x2 2x3 qualifier true_Z_ccw
      array [ZM1N 0 0 0 ZM3N 0]
   setup 3x2 2x3
      predscantdocallinsetup
         if columns_someone_in_front [ZM1N ZM2N 0 0 ZM3N ZM4N]
         if always                   [ZM1N ZM2N 0 0 ZM3N ZM4N]
   setup 2x1 1x2
      array [ZM1N 0]

call "Z axle" c3
            yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq zaxle1 []
   seq trade [inherit_yoyo inherit_gensting]
   seq any_hand_slip [inherit_yoyo inherit_gensting roll_transparent]

call "pass Z axle" c3
            yoyo_is_inherited gen_sting_is_inherited funny_is_inherited visible_fractions
   seq zpass [inherit_funny]
   seq zaxle1 [inherit_funny]  // You must say "initially funny".
   seq trade [inherit_yoyo inherit_gensting]
   seq any_hand_slip [inherit_yoyo inherit_gensting roll_transparent]

call "swing and cross" c4x          // Ugh!  - J.E.Brosius
            step_to_wave visible_fractions left_means_touch_or_check
            grand_is_inherited fractal_is_inherited gen_sting_is_inherited nxn_is_inherited
   seq armturn_n4 [insert_number 3 inherit_gensting inherit_fractal]
   seq and_cross [inherit_grand inherit_nxn roll_transparent]

call "split and cross" c4x
            visible_fractions
   seq box_circ []
   seq and_cross [roll_transparent]

call "step and@C fold" c1 tag stepnfold
            parallel_conc_end
   setup 1x4 2x2 restriction forbidden miniwaves
      array [CR0S ZM0N AL1S ZM1N]
   setup dmd 2x2 restriction forbidden diamond_like
      array [CR0S 0 AL1S 0]
   setup pmd 2x2 restriction forbidden diamond_like
      array [0 ZM1N 0 ZM2N]
            alternate_definition [6x2] c3
   setup qtag 2x4 qualifier dmd_ctrs_mwv restriction controversial alwaysfail
      array [0 0 AL2S ZM2N 0 0 CR1S ZM1N]
   setup pqtag 2x4
      array [0 CR3S 0 0 AL4S 0 0 0]
            alternate_definition [cross] c3
   setup 1x4 2x2 qualifier magic_only
      array [CR1S ZM0N AL0S ZM1N]
   setup 1x4 2x2 restriction forbidden 2fl_only
      array [CR1S ZM0N AL0S ZM1N]
   setup dmd 2x2 restriction forbidden diamond_like
      array [CR1S 0 AL0S 0]
   setup pmd 2x2 restriction forbidden diamond_like
      array [0 ZM1N 0 ZM2N]
            // Need this for interlocked little/plenty/rally/collapse.
            // Actually, interlocked rally uses the call below,
            // so that the level will be C3B, while interlocked
            // little and plenty are C3A.
            alternate_definition [interlocked] c3a
   setup 1x4 2x2 restriction unusual 2fl_only
      array [CR1S ZM0N AL0S ZM1N]
   setup dmd 2x2 restriction forbidden diamond_like
      array [CR1S 0 AL0S 0]
   setup pmd 2x2 restriction forbidden diamond_like
      array [0 ZM1N 0 ZM2N]
            alternate_definition [straight interlocked] c4
   setup 2x4 2x4 rotate restriction forbidden 2fl_only
      array [CR0E ZM7W ZM0W AL7E ZM1W ZM2W ZM5W ZM6W]
   setup qtag 2x4 restriction forbidden dmd_facing
      array [0 0 ZM3N ZM2N 0 0 ZM0N ZM1N]
   setup pqtag 2x4
      array [ZM2N CR4S 0 0 AL3S ZM5N 0 0]
            alternate_definition [rewind] c4
   setup 2x2 1x4 no_cutting_through restriction forbidden peelable_box
      array [AL0S CR2S ZM3N ZM1N]

call "_step and fold with c3b interlock" dontshow tag stepnfold_c3b_intlk
            parallel_conc_end
   setup 1x4 2x2 restriction forbidden miniwaves
      array [CR0S ZM0N AL1S ZM1N]
   setup dmd 2x2 restriction forbidden diamond_like
      array [CR0S 0 AL1S 0]
   setup pmd 2x2 restriction forbidden diamond_like
      array [0 ZM1N 0 ZM2N]
            alternate_definition [interlocked] c3
   setup 1x4 2x2 restriction unusual 2fl_only
      array [CR1S ZM0N AL0S ZM1N]
   setup dmd 2x2 restriction forbidden diamond_like
      array [CR1S 0 AL0S 0]
   setup pmd 2x2 restriction forbidden diamond_like
      array [0 ZM1N 0 ZM2N]

call "@v back to a wave" c1
            visible_fractions left_means_mirror
            singlefile_is_inherited single_is_inherited nxn_is_inherited
            bigmatrix_is_inherited revert_is_inherited fractal_is_inherited fast_is_inherited
   seq real_base_0_noflip [inherit_left inherit_singlefile inherit_single
                           inherit_nxn inherit_bigmatrix inherit_revert inherit_fractal]
   seq strictboxyscootback [inherit_single inherit_nxn inherit_fast]

call "@v back to a wave, centers to a wave" c1
            visible_fractions left_means_mirror
            singlefile_is_inherited
            revert_is_inherited fractal_is_inherited
   seq real_base_0_noflip [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq scootbacktowave []

// Same two calls, without "back to a wave".
call "@v back" c1
            yield_if_ambiguous visible_fractions left_means_mirror
            singlefile_is_inherited single_is_inherited nxn_is_inherited
            bigmatrix_is_inherited revert_is_inherited fractal_is_inherited fast_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_single
                    inherit_nxn inherit_bigmatrix inherit_revert inherit_fractal]
   seq strictboxyscootback [inherit_single inherit_nxn inherit_fast]

call "@v back, centers to a wave" c1
            yield_if_ambiguous visible_fractions left_means_mirror
            singlefile_is_inherited
            revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq scootbacktowave []

// We leave this one in because it is a genuine call without the "back to a wave" words.
// In fact, it could be argued that "flip back to a wave" is not only archaic, but it is
// a different call, since it is the "to a wave" variant of a scooting call.
call "flip back" c1
            visible_fractions cross_is_inherited
            revert_is_inherited fractal_is_inherited fast_is_inherited rewind_is_inherited
   seq flip_back_1 [inherit_cross inherit_revert inherit_fractal inherit_rewind]
   seq strictboxyscootback [inherit_fast]

// Be careful!
call "flip back, centers to a wave" c1
            visible_fractions cross_is_inherited revert_is_inherited fractal_is_inherited
   seq flip_back_1 [inherit_cross inherit_revert inherit_fractal]
   seq scootbacktowave []

call "@v back and dodge" c4a
            visible_fractions left_means_mirror singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq scootndodge []

call "@v and scatter" c3
            visible_fractions left_means_mirror singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq fudgyscatscoot []    /* Note that we refuse to pass "yoyo". */

call "@v back and scatter" c3     /* We allow both forms.  Sigh. */
            visible_fractions left_means_mirror singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq fudgyscatscoot []    /* Note that we refuse to pass "yoyo". */

call "@v chain thru" c3a
            first_part_visible left_means_mirror singlefile_is_inherited revert_is_inherited fractal_is_inherited
            fast_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq strictboxyscootback [inherit_fast]
   seq fixscootchainthru [inherit_fast]

call "@v chain thru to a wave" c3a
            first_part_visible left_means_mirror singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq scootchainthrutowave []

call "@v chain thru and dodge" c4
            first_part_visible left_means_mirror singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq scootchainthrundodge []

call "@v chain thru and scatter" c3
            first_part_visible left_means_mirror singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq scootchainthru [force_scatter]

call "snap back" c4
            left_means_mirror
   setup 1x4 2x2
      array [CM3W ACR0E ACM1E CR2W]

call "_touch by @b part 1 of 2" dontshow tag touch_by_first_of_two
            left_means_mirror neednumber
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   singlecrossconc nullcall [] lftble_touch_n_4 [inherit_left inherit_yoyo inherit_fractal inherit_gensting]

call "_touch by @b part 2 of 2" dontshow tag touch_by_second_of_two
            left_means_mirror neednumber
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   singleconc_together lftble_touch_n_4 [inherit_left inherit_yoyo inherit_fractal inherit_gensting] nullcall []

call "touch by @b X @b" c3a
            left_means_mirror visible_fractions need_two_numbers
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq touch_by_first_of_two [inherit_left inherit_yoyo inherit_fractal inherit_gensting]
   seq touch_by_second_of_two [inherit_left inherit_yoyo inherit_fractal inherit_gensting shift_one_number]

call "_touch by @b part 1 of 3" dontshow tag touch_by_first_of_three
            left_means_mirror neednumber
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   crossconc_touch_by_1_of_3 nullcall []
                             lftble_touch_n_4 [inherit_left inherit_yoyo inherit_fractal inherit_gensting conc_force_lines]

call "_touch by @b part 1 spiffy" dontshow tag touch_by_first_spiffy
            left_means_mirror neednumber
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   crossconc_innermost nullcall [] lftble_touch_n_4 [inherit_left conc_force_lines]

call "_touch by @b part 2 of 3" dontshow tag touch_by_second_of_three
            left_means_mirror neednumber
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc_touch_by_2_of_3 touch_by_first_spiffy [inherit_left inherit_yoyo inherit_fractal inherit_gensting]
                        nullcall []

call "_touch by @b final" dontshow tag touch_by_final
            left_means_mirror neednumber
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc_innermost lftble_touch_n_4 [inherit_left inherit_yoyo inherit_fractal inherit_gensting]
                  nullcall []

call "touch by @b X @b X @b" c3a
            left_means_mirror visible_fractions need_three_numbers
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq touch_by_first_of_three [inherit_left inherit_yoyo inherit_fractal inherit_gensting]
   seq touch_by_second_of_three [inherit_left inherit_yoyo inherit_fractal inherit_gensting shift_one_number]
   seq touch_by_final [inherit_left shift_two_numbers inherit_yoyo inherit_fractal inherit_gensting]

call "_touch by @b part 2 of 4" dontshow tag touch_by_second_of_four
            left_means_mirror neednumber
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc6_2_line touch_by_first_spiffy [inherit_left inherit_yoyo inherit_fractal inherit_gensting]
                nullcall []

call "_touch by @b part 3 of 4" dontshow tag touch_by_third_of_four
            left_means_mirror neednumber
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc_diamond_line touch_by_first_spiffy [inherit_left inherit_yoyo inherit_fractal inherit_gensting]
                     nullcall []

call "touch by @b X @b X @b X @b" c3a
            left_means_mirror visible_fractions need_four_numbers
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq touch_by_first_spiffy [inherit_left inherit_yoyo inherit_fractal inherit_gensting]
   seq touch_by_second_of_four [inherit_left inherit_yoyo inherit_fractal inherit_gensting shift_one_number]
   seq touch_by_third_of_four [inherit_left inherit_yoyo inherit_fractal inherit_gensting shift_two_numbers]
   seq touch_by_final [inherit_left inherit_yoyo inherit_fractal inherit_gensting shift_three_numbers]

call "touch by @b X @0" c3a
            left_means_mirror neednumber
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   singlecrossconc_together_if_odd nullcall [mandatory_anycall]
                                   lftble_touch_n_4 [inherit_left inherit_yoyo inherit_fractal inherit_gensting]

call "touch by @0 X @b" c3a
            left_means_mirror neednumber
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   singlecrossconc_together lftble_touch_n_4 [inherit_left inherit_yoyo inherit_fractal inherit_gensting]
                            nullcall [mandatory_anycall]

call "touch by @0 X @m" c3a
   singlecrossconc_together nullsecond [mandatory_secondary_call] nullcall [mandatory_anycall]

call "_hinge_who_can" dontshow tag hinge_who_can
   select_who_can hinge [] nullcall []

call "_hinge_who_did" dontshow tag hinge_who_did
   select_who_did hinge [] nullcall []

call "_hinge_who_didnt" dontshow tag hinge_who_didnt
   select_who_didnt hinge [] nullcall []

call "_first hinge by @b" dontshow tag firsthingeby
            neednumber
   seq hinge_who_can []
   seq hinge_who_did [repeat_nm1]

call "_later hinge by @b" dontshow tag latehingeby
            neednumber
   seq hinge_who_didnt []
   seq hinge_who_did [repeat_nm1]

call "hinge by @b X @b" c4a
            visible_fractions need_two_numbers
   seq firsthingeby []
   seq latehingeby [roll_transparent shift_one_number]

call "hinge by @b X @b X @b" c4a
            visible_fractions need_three_numbers
   seq firsthingeby []
   seq latehingeby [roll_transparent shift_one_number]
   seq latehingeby [roll_transparent shift_two_numbers]

call "switch to a@M@I diamond" a2 tag switch_to_diamond
            take_right_hands
   setup 1x4 dmd
      array [CR1E AL0S AL1W CR2S]
            alternate_definition [interlocked] c1
   setup 2x4 qtag rotate
      array [CR6N AL5E CR0E AL6S AL7S CR1E AL4E CR7N]
   setup 1x8 ptpd
      array [CR1E AL0S AL1W CR6S AL7W CR4S CR7E AL2S]
            alternate_definition [magic] c3
   setup 2x4 qtag rotate
      array [CR3N AL4E CR1E AL3S AL6S CR0E AL5E CR6N]
            alternate_definition [magic interlocked] c3
   setup 2x4 qtag rotate
      array [CR7N AL4E CR1E AL7S AL6S CR0E AL5E CR6N]

call "switch to a Z" c4
   setup 1x4 2x3 restriction unusual wave_only
      array [CR1E AL5E AL1W CR3W]

call "_run away part 1" dontshow tag runaway1
   setup 1x4 1x4
      array [CR1E AL0S AL3W CR2S]
   setup pshort6 bone6 rotate restriction unusual alwaysfail
      array [0 CR5N AL0E CR1E AL2S 0]
            alternate_definition [cross] c4a
   setup 1x4 1x4
      array [CR1E CR2S AL3W AL0S]

call "_run away part 2" dontshow tag runaway2
            gen_sting_is_inherited left_means_mirror
   conc2_4_or_single touch_n_4 [insert_number 2 inherit_left inherit_gensting] roll []

call "run away" c4a
            visible_fractions left_means_mirror cross_is_inherited gen_sting_is_inherited
   seq runaway1 [inherit_cross]
   seq runaway2 [inherit_gensting inherit_left]

call "ends go as you are,@C run away" c4
            left_means_mirror
   setup 1x4 dmd
      array [0 AL0E 0 CR2W]
   setup 4x1 dmd
      array [CR3S 0 0 0]
   setup pshort6 2x3 rotate restriction unusual alwaysfail
      array [0 0 AL0N CR2S 0 0]
   setup short6 2x3 rotate restriction unusual alwaysfail
      array [0 0 0 0 CR1E 0]
            alternate_definition [cross] c4
   setup 1x4 dmd
      array [0 CR2W 0 AL0E]
   setup 4x1 dmd
      array [CR3S 0 0 0]
   setup pshort6 2x3 rotate restriction unusual alwaysfail
      array [0 0 CR2S AL0N 0 0]
   setup short6 2x3 rotate restriction unusual alwaysfail
      array [0 0 0 0 CR1E 0]

call "isolate" dontshow tag isolate
            take_right_hands
   setup 1x2 1x2 rotate
      array [CR0N AL0S]

call "erase" c4
            ends_take_right_hands
   singleconc uturnback [] isolate []

/* Gotta do this right some day. */
call "grand erase" c4a
   setup 1x8 3x1dmd
      array [CR3E CR0S CR2S AL1S AL3W AL4S AL6S CR5S]

call "zip the top" c4a
            ends_take_right_hands
   setup 1x4 1x4 rotate no_cutting_through
      array [CR0N CR1S AL0S AL1N]
   setup dmd dmd rotate
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate
      array [0 CR1S 0 AL1N]
            alternate_definition [generous] c3
   setup 1x4 dmd rotate
      array [CR0N CR1W AL0S AL3W]
   setup dmd 1x4 rotate
      array [CR0N 0 AL0S 0]
   setup pmd 1x4 rotate
      array [0 CR3W 0 AL1W]
            alternate_definition [stingy] c3
   setup 1x4 dmd rotate
      array [CR0N CR3E AL0S AL1E]
   setup dmd 1x4 rotate
      array [CR0N 0 AL0S 0]
   setup pmd 1x4 rotate
      array [0 CR1E 0 AL1E]
            alternate_definition [fractal] c4
   setup 1x4 1x4 rotate no_cutting_through
      array [CR0N CR3N AL0S AL3S]
   setup dmd dmd rotate
      array [CR0N 0 AL0S 0]
   setup pmd dmd rotate
      array [0 CR3N 0 AL3S]

call "fan back" c4a tag fanback
            step_to_wave left_means_touch_or_check
            diamond_is_legal bigmatrix_is_inherited fractal_is_inherited gen_sting_is_inherited grand_is_inherited
   maybematrix_singleconc_together cast_off_n4_with_warn [insert_number 3 inherit_fractal inherit_gensting]
                                   uturnback [conc_force_spots]

call "spin back" c4a
            step_to_wave yoyo_is_inherited can_be_fan left_means_touch_or_check
            visible_fractions diamond_is_legal fractal_is_inherited gen_sting_is_inherited grand_is_inherited
   seq tradencheckline_unusual [inherit_yoyo inherit_gensting inherit_diamond]
   seq fanback [inherit_grand inherit_fractal inherit_gensting inherit_diamond]

call "short cycle" c4a
            visible_fractions
   seq shortcycle1 []
   seq cplshinge_should_be_armturn []

call "_short cycle 1" dontshow tag shortcycle1
   singleconc uturnaway [] nullcall []

call "_peel for peel the top" dontshow tag peelforpeelthetop
            split_large_setups can_do_in_z
   setup 2x2 1x4 restriction wave_only
      array [AL0S CR2S ZM3N ZM1N]

call "peel the top" plus
            visible_fractions fractal_is_inherited gen_sting_is_inherited
   seq peelforpeelthetop []
   seq fanthetop [inherit_gensting inherit_fractal]

call "trail the top" c4
            split_large_setups can_do_in_z
   setup 2x2 1x4 rotate restriction wave_only
      array [CR2S AL2N AL3N CR3S]
            alternate_definition [fractal] c4
   setup 2x2 1x4 rotate restriction wave_only
      array [CR2S AL2N AL1S CR1N]
            alternate_definition [generous] c3
   setup 2x2 dmd rotate restriction wave_only
      array [CR2S AL2N AL1W CR3W]
            alternate_definition [stingy] c3
   setup 2x2 dmd rotate restriction wave_only
      array [CR2S AL2N AL3E CR1E]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate restriction wave_only
      array [CR1S AL1N]
            alternate_definition [3x3] c4
   setup 3x2 1x6 restriction wave_only
      array [CR2W CR1W CR0W AL0E AL1E AL2E]
            alternate_definition [4x4] c4
   setup 4x2 1x8 restriction wave_only
      array [CR2W CR3W CR1W CR0W AL0E AL1E AL3E AL2E]

call "follow your neighbor" plus tag neighbor
   setup 2x2 1x4 rotate restriction wave_only
      array [CR0S AL0N AL3N CR3S]
   // When deciding whether to divide an 8-person qtag pair into two single qtags,
   // the left-right indicators won't be used, because the "miniwaves" qualifier
   // just demands miniwaves in the center line, which could be one right and one left.
   // But once it's been divided, "miniwaves" on a single 1/4 tag understands "left" and "right".
   setup pmd 1x4 qualifier right miniwaves restriction unusual alwaysfail
      array [CR0W CR3W 0 0]
   setup pmd 1x4 qualifier left miniwaves restriction unusual alwaysfail
      array [AL0E 0 0 AL3E]
            alternate_definition [grand] a1
   setup 3x2 1x6 restriction wave_only
      array [CR1W CR5W CR3W AL3E AL5E AL1E]
   setup 4x2 1x8 restriction wave_only
      array [CR1W CR2W CR7W CR4W AL4E AL7E AL2E AL1E]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate restriction wave_only
      array [CR0S AL0N]
            alternate_definition [3x3] c4
   setup 3x2 1x6 restriction wave_only
      array [CR1W CR5W CR3W AL3E AL5E AL1E]
            alternate_definition [4x4] c4
   setup 4x2 1x8 restriction wave_only
      array [CR1W CR2W CR7W CR4W AL4E AL7E AL2E AL1E]
            alternate_definition [fractal] c4
   setup 2x2 1x4 rotate restriction wave_only
      array [CR0S AL0N AL1S CR1N]
   setup pmd 1x4 qualifier right wave_only restriction unusual alwaysfail
      array [CR1E CR2E 0 0]
   setup pmd 1x4 qualifier left wave_only restriction unusual alwaysfail
      array [AL1W 0 0 AL2W]
            alternate_definition [fractal grand] c4
   setup 3x2 1x6 restriction wave_only
      array [CR2E CR4E CR3W AL3E AL4W AL2W]
   setup 4x2 1x8 restriction wave_only
      array [CR3E CR6E CR5E CR4W AL4E AL5W AL6W AL3W]
            alternate_definition [generous] c3
   setup 2x2 dmd rotate restriction wave_only
      array [CR0S AL0N AL1W CR3W]
   setup pmd 2x2 qualifier right wave_only restriction unusual alwaysfail
      array [CR0N CR1N 0 0]
   setup pmd 2x2 qualifier left wave_only restriction unusual alwaysfail
      array [AL3N 0 0 AL2N]
            alternate_definition [stingy] c3
   setup 2x2 dmd rotate restriction wave_only
      array [CR0S AL0N AL3E CR1E]
   setup pmd 2x2 qualifier right wave_only restriction unusual alwaysfail
      array [CR3S CR2S 0 0]
   setup pmd 2x2 qualifier left wave_only restriction unusual alwaysfail
      array [AL0S 0 0 AL1S]
            alternate_definition [rewind] c4
   setup 1x4 2x2 restriction wave_only
      array [AL3E CR3W CR2W AL2E]

call "cross your neighbor" c1 tag xneighbor
   setup 2x2 1x4 rotate restriction wave_only
      array [CR0S AL0N CR3S AL3N]
   setup pmd 1x4 qualifier right wave_only restriction unusual alwaysfail
      array [AL0E AL3E 0 0]
   setup pmd 1x4 qualifier left wave_only restriction unusual alwaysfail
      array [CR0W 0 0 CR3W]
            alternate_definition [grand] c3
   setup 3x2 1x6 restriction wave_only
      array [AL1E AL5E CR3W AL3E CR5W CR1W]
   setup 4x2 1x8 restriction wave_only
      array [AL1E AL2E AL7E CR4W AL4E CR7W CR2W CR1W]
            alternate_definition [fractal] c4
   setup 2x2 1x4 rotate restriction wave_only
      array [CR0S AL0N CR1N AL1S]
   setup pmd 1x4 qualifier right wave_only restriction unusual alwaysfail
      array [AL1W AL2W 0 0]
   setup pmd 1x4 qualifier left wave_only restriction unusual alwaysfail
      array [CR1E 0 0 CR2E]
            alternate_definition [fractal grand] c4
   setup 3x2 1x6 restriction wave_only
      array [AL2W AL4W CR3W AL3E CR4E CR2E]
   setup 4x2 1x8 restriction wave_only
      array [AL3W AL6W AL5W CR4W AL4E CR5E CR6E CR3E]
            alternate_definition [generous] c3
   setup 2x2 dmd rotate restriction wave_only
      array [CR0S AL0N CR3W AL1W]
   setup pmd 2x2 qualifier right wave_only restriction unusual alwaysfail
      array [AL3N AL2N 0 0]
   setup pmd 2x2 qualifier left wave_only restriction unusual alwaysfail
      array [CR0N 0 0 CR1N]
            alternate_definition [stingy] c3
   setup 2x2 dmd rotate restriction wave_only
      array [CR0S AL0N CR1E AL3E]
   setup pmd 2x2 qualifier right wave_only restriction unusual alwaysfail
      array [AL0S AL1S 0 0]
   setup pmd 2x2 qualifier left wave_only restriction unusual alwaysfail
      array [CR3S 0 0 CR2S]

call "criss cross your neighbor" c2 tag xxneighbor
   setup 2x2 1x4 rotate restriction wave_only
      array [CR3S AL3N CM2S AM2N]
            alternate_definition [fractal] c4
   setup 2x2 1x4 rotate restriction wave_only
      array [CR3S AL3N CM0N AM0S]
            alternate_definition [generous] c3
   setup 2x2 dmd restriction wave_only
      array [CR3W AL3E CM0N AM2N]
            alternate_definition [stingy] c3
   setup 2x2 dmd restriction wave_only
      array [CR3W AL3E CM2S AM0S]

call "_ends circulate" dontshow tag ends_circ
   conc nullcall [] circulate [conc_force_spots]

call "_lines slip thru" dontshow tag lines_slip_thru
            yoyo_is_inherited gen_sting_is_inherited
   conc any_hand_slip [inherit_yoyo inherit_gensting] circulate [conc_force_spots]

call "_trade your neighbor part 1" dontshow tag start_trade_neighbor
   setup 2x4 2x4 rotate restriction forbidden wave_only
      array [ZM7W ZM7W ZM0W ZM0W AL2N CR2S AL5N CR5S]
            alternate_definition [cross] c3x
   setup 2x4 2x4 rotate restriction forbidden wave_only
      array [ZM7W ZM7W ZM0W ZM0W CR2S AL2N CR5S AL5N]

call "_trade your neighbor right part 1" dontshow tag start_trade_neighbor_right
   setup 2x4 2x4 rotate qualifier wave_only restriction controversial alwaysfail
      array [CR7N AL7S CR0N AL0S AL2N CR2S AL5N CR5S]
            alternate_definition [cross] c4
   setup 2x4 2x4 rotate qualifier wave_only restriction controversial alwaysfail
      array [CR7N AL7S CR0N AL0S CR2S AL2N CR5S AL5N]

call "trade your neighbor @h" c4a
            cross_is_inherited
   seq start_trade_neighbor [inherit_cross]
   seq set_windmill_direction []
   seq ends_circ []

// With no direction, we go right, but the call is deprecated.
call "trade your neighbor" c4
            cross_is_inherited
   seq start_trade_neighbor_right [inherit_cross]
   seq ends_circ []

call "follow thru" c1 tag followthru
   setup 2x2 1x4 no_cutting_through rotate restriction wave_only
      array [CR0N AL0S AL1S CR1N]
   setup pmd 1x4
      predscantdocallinsetup
         if dmd_ctrs_rh [CR1E CR2E 0 0]
         if always      [AL1W 0    0 AL2W]
   setup trngl 1x3 rotate
      predscantdocallinsetup
         if dmd_ctrs_rh [CR1N CR0N 0 0 0 CR0N]
         if always      [AL1S 0 AL0S 0 AL0S 0]
   setup ptrngl 1x3
      array [AL2W CR1E CR2E CR2E AL2W AL1W]
            alternate_definition [generous] c3
   setup 2x2 dmd no_cutting_through rotate restriction wave_only
      array [CR0N AL0S AL3E CR1E]
   setup pmd 2x2
      predscantdocallinsetup
         if dmd_ctrs_rh [CR3S CR2S 0 0]
         if always      [AL0S 0    0 AL1S]
   setup trngl trngl
      predscantdocallinsetup
         if dmd_ctrs_rh [CR4S CR3E 0 0 0 CR2S]
         if always      [AL5S 0 AL3W 0 AL1S 0]
   setup ptrngl trngl rotate qualifier right tgl_tandbase
      array [0 CR4E CR3N CR2E 0 0]
   setup ptrngl trngl rotate qualifier left tgl_tandbase
      array [AL1E 0 0 0 AL3S AL5E]
            alternate_definition [stingy] c3
   setup 2x2 dmd no_cutting_through rotate restriction wave_only
      array [CR0N AL0S ZM1W ZM3W]
   setup pmd 2x2
      predscantdocallinsetup
         if dmd_ctrs_rh [ZM0N ZM1N 0 0]
         if always      [ZM3N 0    0 ZM2N]
   setup trngl trngl
      predscantdocallinsetup
         if dmd_ctrs_rh [ZM5N CR3E 0 0 0 ZM1N]
         if always      [ZM4N 0 AL3W 0 ZM2N 0]
   // Stingy follow thru is same as convert!
   setup ptrngl trngl rotate qualifier right tgl_tandbase
      array [0 ZM5W CR3N ZM1W 0 0]
   setup ptrngl trngl rotate qualifier left tgl_tandbase
      array [ZM2W 0 0 0 AL3S ZM4W]
            alternate_definition [grand] c2
   setup 3x2 1x6 restriction wave_only
      array [CR2E CR4E CR3E AL3W AL4W AL2W]
   setup 4x2 1x8 restriction wave_only
      array [CR3E CR6E CR5E CR4E AL4W AL5W AL6W AL3W]
   setup short6 1x6 rotate
      predscantdocallinsetup
         if dmd_ctrs_rh [CR0N 0    0    0    CR4N CR2N]
         if always      [0    0    AL0S AL2S AL4S 0]
   setup pspindle 1x8
      predscantdocallinsetup
         if dmd_ctrs_rh [CR2E CR7E CR4E 0   0    0    0    CR1E]
         if always      [0    0    0    0   AL4W AL7W AL2W AL1W]
            alternate_definition [grand generous] c3
   setup 4x2 spindle restriction wave_only
      array [CR6S CR5S CR4S CR3E AL3W AL2S AL1S AL0S]
            alternate_definition [grand stingy] c3
   setup 4x2 spindle restriction wave_only
      array [ZM0N ZM1N ZM2N CR3E AL3W ZM4N ZM5N ZM6N]
            alternate_definition [cross] c4a
   setup 2x2 1x4 rotate restriction wave_only
      array [CR0N AL0S CR1N AL1S]
   setup trngl 1x3 rotate
      predscantdocallinsetup
         if dmd_ctrs_rh [AL1S CR0N 0 0 0 AL0S]
         if always      [CR1N 0 AL0S 0 CR0N 0]
   setup pmd 1x4
      predscantdocallinsetup
         if dmd_ctrs_rh [AL1W AL2W 0 0]
         if always      [CR1E 0    0 CR2E]
            alternate_definition [cross generous] c4a
   setup 2x2 dmd no_cutting_through rotate restriction wave_only
      array [CR0N AL0S CR1E AL3E]
            alternate_definition [cross stingy] c4a
   setup 2x2 dmd no_cutting_through rotate restriction wave_only
      array [CR0N AL0S ZM3W ZM1W]
            alternate_definition [grand cross] c4a
   setup short6 1x6 rotate
      predscantdocallinsetup
         if dmd_ctrs_rh [AL0S 0 0    0    AL4S AL2S]
         if always      [0    0 CR0N CR2N CR4N 0]
            alternate_definition [3x3] c4a
   setup 3x2 1x6 restriction wave_only
      array [CR5E CR4E CR3E AL3W AL4W AL5W]
            alternate_definition [4x4] c4a
   setup 4x2 1x8 restriction wave_only
      array [CR6E CR7E CR5E CR4E AL4W AL5W AL7W AL6W]
            alternate_definition [3x1] c4
   setup 3x2 1x4 qualifier occupied_as_3x1tgl
      predscantdocallinsetup
         if zero_cw_people [   0 CR2E CR2E    0 AL2W AL1W]
         if one_cw_person  [   0 CR3E    0    0 AL3W    0]
         if always         [CR1E    0    0 AL2W    0    0]
   setup 4x2 1x8 restriction wave_only
      array [CR2E CR7E CR5E CR4E AL4W AL5W AL7W AL2W]
            alternate_definition [1x3] c4
   setup 3x2 1x4 qualifier occupied_as_3x1tgl
      predscantdocallinsetup
         if zero_cw_people [   0 CR2E CR2E    0 AL2W AL1W]
         if one_cw_person  [   0 CR3E    0    0 AL3W    0]
         if always         [CR1E    0    0 AL2W    0    0]
   setup 4x2 1x8 restriction wave_only
      array [CR1E CR3E CR2E CR4E AL4W AL2W AL3W AL1W]

call "pair the line" c4a
   setup 1x4 2x3 rotate
      array [CR5E CR4E AL0E AL1E]
   setup 4x1 2x3 rotate
      array [0 4E 0 1E]
   setup dmd bone6 rotate
      array [CR4E CR5E AL0E AL2E]
   setup pmd bone6 rotate
      array [   0 CR5E    0 AL2E]
   setup pshort6 2x4
      array [CR1S CR3S CR2S AL5S AL4S AL6S]
   setup short6 2x4
      array [CR1S    0 CR2S AL5S    0 AL6S]
            alternate_definition [3x3] c4
   setup 1x6 2x5 rotate restriction forbidden 1fl_only
      array [CR9E CR8E CR7E AL0E AL1E AL2E]
            alternate_definition [4x4] c4
   setup 1x8 2x4 rotate restriction forbidden 1fl_only
      array [CR7E CR6E CR4E CR5E AL0E AL1E AL3E AL2E]
            alternate_definition [3x3 cross] c4
   setup 1x6 2x5 rotate restriction forbidden 1fl_only
      array [CR0E CR1E CR2E AL9E AL8E AL7E]
            alternate_definition [4x4 cross] c4
   setup 1x8 2x4 rotate restriction forbidden 1fl_only
      array [CR0E CR1E CR3E CR2E AL7E AL6E AL4E AL5E]
            alternate_definition [cross] c4a
   setup 1x4 2x3 rotate
      array [CR0E CR1E AL5E AL4E]
   setup dmd bone6 rotate
      array [AL0E    0 CR4E    0]
   setup pmd bone6 rotate
      array [   0 CR2E    0 AL5E]
   setup pshort6 2x4
      array [CR6S CR4S CR5S AL2S AL3S AL1S]
   setup short6 2x4
      array [CR6S    0 CR5S AL2S    0 AL1S]
   setup 2x4 2x4 rotate qualifier tbone line_ends_looking_out
      array [CR0E CR1E AL6E AL7E 0 AL5E CR2E 0]
   setup 4x2 2x4 rotate
      array [   0 CR5E CR2E    0 0 AL1E AL6E 0]
            alternate_definition [straight] c4
   // "Straight" doesn't mean "go to your opposite's spot".
   // It means "matrix cross over circulate".
   setup 2x4 2x6 rotate qualifier wave_only   // Goes to Z's.
      array [CR11E CR10E AL1E AL0E ZM2W AL4E CR7E ZM9W]
   setup 2x4 2x6 rotate qualifier 2fl_only    // Goes to Z's.
      array [CR11E CR10E AL1E AL0E ZM2W AL4E CR7E ZM9W]
   setup 2x4 2x4 rotate     // Intended for lines out or something like that.
      array [0 CR7E AL0E 0 ZM1W AL3E CR4E ZM6W]
            alternate_definition [straight cross] c4
   setup 2x4 2x6 rotate qualifier wave_only   // Goes to Z's.
      array [CR0E CR1E AL10E AL11E ZM2W AL7E CR4E ZM9W]
   setup 2x4 2x6 rotate qualifier 2fl_only    // Goes to Z's.
      array [CR0E CR1E AL10E AL11E ZM2W AL7E CR4E ZM9W]
   setup 2x4 2x4 rotate     // Intended for lines out or something like that.
      array [0 CR0E AL7E 0 ZM1W AL4E CR3E ZM6W]
            alternate_definition [half] c4
   setup 1x4 2x3 rotate
      array [   0 CR4N    0 AL1S]    // Only the centers can do it.
            alternate_definition [cross half] c4
   setup 1x4 bone6 rotate qualifier dmd_ctrs_1f
      array [   0 CR5N    0 AL2S]    // Only the centers can do it.
   setup 1x4 bone6 rotate
      array [   0 CR5N    0 AL5S]
   setup 2x4 2x4 rotate qualifier tbone line_ends_looking_out
      array [   0 CR1E AL6E    0 0 AL5E CR2E 0]
   setup 4x2 2x4 rotate
      array [   0 CR5E CR2E    0 0 AL1E AL6E 0]

call "_ @6@C fold" dontshow tag full_fold
   setup 1x4 3x4
      preds "Can't tell who is designated."
         if select   [CR1S  AL0S  AL2S CR3S]
         if unselect [ZM10N ZM11N ZM4N ZM5N]
   setup 4x1 3x4
      preds "Can't tell who is designated."
         if unselect [0 ZM11N 0 ZM5N]
   setup bone qtag qualifier ends_sel restriction controversial alwaysfail
      array [CR0S AL1S ZM2N ZM3N 0    0 ZM6N ZM7N]
   setup pbone qtag qualifier ends_sel restriction controversial alwaysfail
      array [0    0    ZM2N ZM3N 0    0 ZM6N ZM7N]
   setup qtag bone qualifier ends_sel restriction controversial alwaysfail
      array [0    0    ZM2N ZM3N 0    0 ZM6N ZM7N]
   setup pqtag bone qualifier ends_sel restriction controversial alwaysfail
      array [0    CR1S ZM2N ZM3N AL4S 0 ZM6N ZM7N]
            alternate_definition [cross] mainstream
   setup 1x4 3x4
      preds "Can't tell who is designated."
         if select_once_rem_from_unselect [CR2S  CR3S  AL1S AL0S]
         if unselect_once_rem_from_select [ZM10N ZM11N ZM4N ZM5N]
   setup 4x1 3x4
      preds "Can't tell who is designated."
         if unselect_once_rem_from_select [0 ZM11N 0 ZM5N]
   setup bone qtag qualifier ends_sel restriction controversial alwaysfail
      array [CR1S AL0S ZM2N ZM3N 0    0 ZM6N ZM7N]
   setup pbone qtag qualifier ends_sel restriction controversial alwaysfail
      array [0    0    ZM2N ZM3N 0    0 ZM6N ZM7N]
   setup qtag bone qualifier ends_sel restriction controversial alwaysfail
      array [0    0    ZM2N ZM3N 0    0 ZM6N ZM7N]
   setup pqtag bone qualifier ends_sel restriction controversial alwaysfail
      array [0    CR4S ZM2N ZM3N AL1S 0 ZM6N ZM7N]

call "_fudge 1 after fold" dontshow tag fold_fudge1
            split_large_setups
   setup 2x2 2x2
      array [ZM0N ZM1N ZM2N ZM3N]
   setup trngl4 trngl4
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup ptrngl4 trngl4
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 1x4 1x4
      array [ZM0N ZM1N ZM2N ZM3N]
   setup 3x2 2x3
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N]
   setup 2x3 2x3
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N]
   setup 3x4 2x3 rotate qualifier lateral_columns_empty
      array [ZM5W ZM5W ZM0W ZM0W ZM1W ZM1W ZM2W ZM2W ZM3W ZM3W ZM4W ZM4W]
   setup 3x6 3x4 qualifier lateral_columns_empty
      array [ZM0N 0 ZM1N ZM2N 0 ZM3N ZM4N 0 ZM5N ZM6N 0 ZM7N ZM8N 0 ZM9N ZM10N 0 ZM11N]
   setup 4x4 2x4 rotate qualifier lateral_columns_empty
      array [ZM0W ZM1W ZM2W ZM1W ZM3W ZM3W ZM4W ZM2W ZM4W ZM5W ZM6W ZM5W ZM7W ZM7W ZM0W ZM6W]
   setup bone bone
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup pbone bone
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup qtag qtag
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup pqtag qtag
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]

call "_fudge 2 after fold" dontshow tag fold_fudge2
            split_large_setups
   setup 2x2 2x2
      array [ZM0N ZM1N ZM2N ZM3N]
   setup trngl4 trngl4
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup ptrngl4 trngl4
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 1x4 1x4
      array [ZM0N ZM1N ZM2N ZM3N]
   setup 2x3 2x2 qualifier true_Z_cw
      array [   0 ZM0N ZM1N    0 ZM2N ZM3N]
   setup 2x3 2x2 qualifier true_Z_ccw
      array [ZM0N ZM1N    0 ZM2N ZM3N    0]
   setup 3x2 2x2 qualifier true_Z_cw
      array [   0 ZM0N ZM1N    0 ZM2N ZM3N]
   setup 3x2 2x2 qualifier true_Z_ccw
      array [ZM0N ZM1N    0 ZM2N ZM3N    0]
   setup 3x2 2x2
      predscantdo
         if columns_someone_in_front [ZM0N ZM0N ZM1N ZM2N ZM3N ZM3N]
         if always                   [ZM0N ZM1N ZM1N ZM2N ZM2N ZM3N]
   setup bone bone
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup pbone bone
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup qtag qtag
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup pqtag qtag
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]

// This is the call that fudges the result back to a box instead of leaving
// a "Z".  This is what dancers below C1 or so will typically do.

call "@6@C fold (and adjust)" mainstream
            dont_use_in_nice_resolve cross_is_inherited
   seq full_fold [inherit_cross]
   seq fold_fudge1 [roll_transparent normalize]
   seq fold_fudge2 [roll_transparent normalize]

// This is the real one.  Beware.

call "@6@C fold" c1
            yield_if_ambiguous
   setup 1x4 3x4
      preds "Can't tell who is designated."
         if select_near_unselect [CR1S  AL0S  AL2S CR3S]
         if unselect             [ZM10N ZM11N ZM4N ZM5N]
   setup 4x1 3x4
      preds "Can't tell who is designated."
         if unselect_near_select [0 ZM11N 0 ZM5N]
   setup 2x2 2x4 rotate
      preds "Can't tell who is designated."
         if select_near_unselect [CR0E AL7E 0 0]
         if unselect_near_select [ZM6W ZM1W ZM2W ZM5W]
   setup 2x3 1x4 rotate
      preds "Can't tell who is designated."
         if select   [CR0E 0    AL0E 0 0    0]
         if unselect [0    ZM1W 0    0 ZM3W 0]
   setup bone qtag qualifier ends_sel restriction controversial alwaysfail
      array [CR0S AL1S ZM2N ZM3N 0    0 ZM6N ZM7N]
   setup pbone qtag qualifier ends_sel restriction controversial alwaysfail
      array [0    0    ZM2N ZM3N 0    0 ZM6N ZM7N]
   setup qtag bone qualifier ends_sel restriction controversial alwaysfail
      array [0    0    ZM2N ZM3N 0    0 ZM6N ZM7N]
   setup pqtag bone qualifier ends_sel restriction controversial alwaysfail
      array [0    CR1S ZM2N ZM3N AL4S 0 ZM6N ZM7N]
            alternate_definition [cross] c1
   setup 1x4 3x4
      preds "Can't tell who is designated."
         if select_once_rem_from_unselect [CR2S  CR3S  AL1S AL0S]
         if unselect                      [ZM10N ZM11N ZM4N ZM5N]
   setup 4x1 3x4
      preds "Can't tell who is designated."
         if unselect_once_rem_from_select [0 ZM11N 0 ZM5N]

   setup 2x6 4x6 qualifier true_PG_cw
      preds "Can't tell who is designated."
         if select_once_rem_from_unselect [0 0 CR4S CR5S AL2S AL3S 0 0 0 0 0 0]
         if unselect                      [0 0 ZM9N ZM8N ZM7N ZM6N 0 0 ZM21N ZM20N ZM19N ZM18N]
   setup 2x6 4x6 qualifier true_PG_ccw
      preds "Can't tell who is designated."
         if select_once_rem_from_unselect [CR2S CR3S AL0S AL1S 0 0 0 0 0 0 0 0]
         if unselect                      [ZM11N ZM10N ZM9N ZM8N 0 0 ZM23N ZM22N ZM21N ZM20N 0 0]
   setup 6x2 4x6 qualifier true_PG_cw
      preds "Can't tell who is designated."
         if unselect                      [0 0 ZM9N ZM8N ZM7N ZM6N 0 0 ZM21N ZM20N ZM19N ZM18N]
   setup 6x2 4x6 qualifier true_PG_ccw
      preds "Can't tell who is designated."
         if unselect                      [ZM11N ZM10N ZM9N ZM8N 0 0 ZM23N ZM22N ZM21N ZM20N 0 0]

   setup bone qtag qualifier ends_sel restriction controversial alwaysfail
      array [CR1S AL0S ZM2N ZM3N 0    0 ZM6N ZM7N]
   setup pbone qtag qualifier ends_sel restriction controversial alwaysfail
      array [0    0    ZM2N ZM3N 0    0 ZM6N ZM7N]
   setup qtag bone qualifier ends_sel restriction controversial alwaysfail
      array [0    0    ZM2N ZM3N 0    0 ZM6N ZM7N]
   setup pqtag bone qualifier ends_sel restriction controversial alwaysfail
      array [0    CR4S ZM2N ZM3N AL1S 0 ZM6N ZM7N]

call "loop the loop" c4x
   setup 1x4 2x3 rotate
      array [R5E R1E L0E L4E]
            alternate_definition [cross] c4
   setup 1x4 2x3 rotate
      array [R0E R1E L5E L4E]

call "_finish three square two and one" dontshow tag fin3s21
   setup 2x3 2x3
      array [ZM0N CM2E AM1W 0 0 0]

call "three square two and one" c4x
            rear_back_from_r_wave twisted_is_inherited
   seq passthru [inherit_twisted]
   seq fin3s21 [inherit_twisted]

call "rip the line" c4
   setup 1x4 2x3 rotate
      array [CR0E CR4E AL5E AL1E]
   setup 4x1 2x3 rotate
      array [0 4E 0 1E]
            alternate_definition [half] c4
   setup 1x4 2x3 rotate
      array [   0 CR4N    0 AL1S]    // Only centers can do it.

call "@6@C swivel" c4a
            yield_if_ambiguous
   setup 1x2 1x2 restriction forbidden couples_only
      preds "Can't have both people swivel"
         if select_near_unselect [C0N A1N]
         if unselect_near_select [A0S C1S]
         if unselect_near_unselect [ZM0N ZM1N]
            alternate_definition [cross] c4a
   setup 1x4 1x4 qualifier ends_sel
      preds "People must face the same way."
         if x14_once_rem_couple   [C3N A0S A1N C2S]
         if x14_once_rem_miniwave [0 0 0 0]         /* Catch live person facing wrong way. */
         if always                [C3N A0S A1N C2S] /* But allow a phantom. */
   setup 1x4 1x4 qualifier centers_sel
      preds "People must face the same way."
         if x14_once_rem_couple   [A0S C3N C2S A1N]
         if x14_once_rem_miniwave [0 0 0 0]
         if always                [A0S C3N C2S A1N]

call "centers@C swivel" c4a
   setup 1x4 1x4 restriction forbidden couples_only
      array [A0S A1N C2S C3N]
            alternate_definition [cross] c4a
   setup 1x4 1x4
      preds "People must face the same way."
         if x14_once_rem_couple   [A0S C3N C2S A1N]
         if x14_once_rem_miniwave [0 0 0 0]
         if always                [A0S C3N C2S A1N]

call "ends@C swivel" c4a
   setup 1x4 1x4 restriction forbidden couples_only
      array [C0N C1S A2N A3S]
            alternate_definition [cross] c4a
   setup 1x4 1x4
      preds "People must face the same way."
         if x14_once_rem_couple   [C3N A0S A1N C2S]
         if x14_once_rem_miniwave [0 0 0 0]
         if always                [C3N A0S A1N C2S]

call "curl thru" c4a
   setup 1x4 2x3 rotate
      array [CR0E CR1E AL5E AL4E]
            alternate_definition [straight] c4
   setup 2x4 2x6 rotate
      array [CR0E CR1E AL10E AL11E ZM2W AL7E CR4E ZM9W]

call "pass the ocean" mainstream tag pass_ocean
   /* Note that it is ILLEGAL to call this from a wave at Mainstream and
      Plus.  [Callerlab Basic & Mainstream definitions, 12/10/93, page 9,
      note use of the word "only".]  We assume that it might be considered
      legal at Advanced and Challenge, but we aren't sure.  We do not
      mark this as controversial, since it's too hard to get all that stuff
      right when some people are in a miniwave and some are facing.
      Callers are responsible for proper usage. */
            rear_back_from_r_wave visible_fractions twisted_is_inherited funny_is_inherited
   seq passthru [inherit_twisted inherit_funny]
   seq quarterin []
   // Of course, "twisted" won't normally apply here.
   seq touch [inherit_twisted]

call "cross the ocean" c4
   setup 2x2 1x4 rotate
      array [0 0 CR0N CAL1S]
            alternate_definition [singlefile] c4
   setup 4x1 1x4
      array [CAL3W CR2E 0 0]

call "@6 walk others dodge" mainstream
            yield_if_ambiguous
   setup 2x2 2x2
      preds "Can't tell who is designated."
         if select   [0    0    ZM1N ZM0N]
         if unselect [ZM1N ZM0N ZM3N ZM2N]
            alternate_definition [half] mainstream
   setup 2x2 dmd rotate no_cutting_through restriction wave_only
      preds "Can't tell who is designated."
         if select   [0    0    ZM1W ZM3W]
         if unselect [ZM0W ZM0W ZM2W ZM2W]

call "@6 scoot back others dodge" mainstream
   setup 2x2 2x2
      preds "Can't tell who is designated."
         if select   [0    0    AM3S CM2S]
         if unselect [ZM1N ZM0N ZM3N ZM2N]
            alternate_definition [half] mainstream
   setup 2x2 1x4 rotate no_cutting_through restriction wave_only
      preds "Can't tell who is designated."
         if select   [0    0    AL1S CR1N]
         if unselect [ZM0W ZM0W ZM2W ZM2W]

call "_start @6 hop" dontshow tag starthopping
            yield_if_ambiguous
   setup 4x2 2x4
      preds "Can't tell who is designated."
         if select   [ZM1N ZM2N ZM3N    0    0 ZM4N ZM5N ZM6N]
         if unselect [ZM7N ZM6N ZM5N ZM4N ZM3N ZM2N ZM1N ZM0N]
   setup 2x4 2x4
      preds "Can't tell who is designated."
         if select   [   0    0    0    0 ZM3N ZM2N ZM1N ZM0N]
         if unselect [ZM1N ZM0N ZM3N ZM2N ZM5N ZM4N ZM7N ZM6N]
   setup 3x2 2x3
      preds "Can't tell who is designated."
         if select   [ZM1N ZM2N    0    0 ZM3N ZM4N]
         if unselect [ZM5N ZM4N ZM3N ZM2N ZM1N ZM0N]
   setup 2x2 2x2
      preds "Can't tell who is designated."
         if select [0 0 ZM1N ZM0N]
         if unselect [ZM1N ZM0N ZM3N ZM2N]
            alternate_definition [cross] c4a
   setup 2x2 2x2
      preds "Can't tell who is designated."
         if select [0 0 ZM0N ZM1N]
         if unselect [ZM1N ZM0N ZM3N ZM2N]
            alternate_definition [magic] c4a
   setup 4x2 2x4
      preds "Can't tell who is designated."
         if select [ZM6N ZM2N ZM4N 0 0 ZM3N ZM5N ZM1N]
         if unselect [ZM7N ZM6N ZM5N ZM4N ZM3N ZM2N ZM1N ZM0N]

call "beaus walk others dodge" mainstream tag startbeauhopping
            dont_use_in_resolve
   setup 4x2 2x4
      array [ZM1N ZM2N ZM3N 0 ZM3N ZM2N ZM1N ZM0N]
   setup 2x4 2x4
      array [0 ZM0N 0 ZM2N ZM5N ZM2N ZM7N ZM0N]
   setup 2x2 2x2
      array [0 0 ZM3N ZM0N]
            alternate_definition [half] mainstream
   setup 2x2 dmd rotate no_cutting_through restriction wave_only
      array [0    0    ZM2W ZM3W]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [ZM0N ZM1N 0 0]
            alternate_definition [single] c4
   setup 2x1 1x2 rotate
      array [ZM0W 0]
            alternate_definition [3x3] c4
   setup 2x3 2x3 rotate
      array [0 0 0 ZM3W ZM4W ZM5W]
            alternate_definition [4x4] c4
   setup 2x4 2x4 rotate
      array [0 0 0 0 ZM4W ZM5W ZM6W ZM7W]
            alternate_definition [3x3 singlefile] c4
   setup 6x1 2x3
      array [ZM0N ZM1N ZM2N 0 0 0]
            alternate_definition [4x4 singlefile] c4
   setup 8x1 2x4
      array [ZM0N ZM1N ZM3N ZM2N 0 0 0 0]

call "belles walk others dodge" mainstream tag startbellhopping
            dont_use_in_resolve
   setup 4x2 2x4
      array [ZM7N ZM6N ZM5N ZM4N 0 ZM4N ZM5N ZM6N]
   setup 2x4 2x4
      array [ZM1N 0 ZM3N 0 ZM3N ZM4N ZM1N ZM6N]
   setup 2x2 2x2
      array [0 0 ZM1N ZM2N]
            alternate_definition [half] mainstream
   setup 2x2 dmd rotate no_cutting_through restriction wave_only
      array [0    0    ZM1W ZM2W]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [ZM3N ZM2N 0 0]
            alternate_definition [single] c4
   setup 2x1 1x2 rotate
      array [ZM1W 0]
            alternate_definition [3x3] c4
   setup 2x3 2x3 rotate
      array [0 0 0 ZM0W ZM1W ZM2W]
            alternate_definition [4x4] c4
   setup 2x4 2x4 rotate
      array [0 0 0 0 ZM0W ZM1W ZM2W ZM3W]
            alternate_definition [3x3 singlefile] c4
   setup 6x1 2x3
      array [ZM5N ZM4N ZM3N 0 0 0]
            alternate_definition [3x3 singlefile] c4
   setup 6x1 2x3
      array [ZM0N ZM1N ZM2N 0 0 0]
            alternate_definition [4x4 singlefile] c4
   setup 8x1 2x4
      array [ZM7N ZM6N ZM4N ZM5N 0 0 0 0]

call "@k hop" c3a
            visible_fractions cross_is_inherited
            fractal_is_inherited yield_if_ambiguous
   seq starthopping [inherit_cross]
   seq hinge [inherit_fractal]

call "_arm turn 1/4 for beau hop" dontshow tag specarmturn_14
   setup 1x2 1x2 rotate
      predscantdocallinsetup
         if 1x2_beau_miniwave_or_warn [CR0N AL0S]
         if always                    [0    AL1S]
            alternate_definition [fractal] c4
   setup 1x2 1x2 rotate qualifier miniwaves
      array [CR1S AL1N]
            alternate_definition [generous] c3
   setup 1x2 1x2 restriction forbidden wave_only
      array [CR1S AL0S]
            alternate_definition [stingy] c3
   setup 1x2 1x2 restriction forbidden wave_only
      array [ZM0N ZM1N]
            alternate_definition [3x3] c4
   setup 3x2 1x6 restriction forbidden wave_only
      array [CR1E CR5E CR3E AL3W AL5W AL1W]
            alternate_definition [4x4] c4
   setup 4x2 1x8 restriction forbidden wave_only
      array [CR1E CR2E CR7E CR4E AL4W AL7W AL2W AL1W]
            alternate_definition [3x1] c4
   setup 3x2 1x4 restriction forbidden wave_only
      array [CR0E CR3E CR2E AL2W AL3W AL0W]
   setup 4x2 1x8 restriction forbidden wave_only
      array [CR3E CR6E CR5E CR4E AL4W AL5W AL6W AL3W]
            alternate_definition [1x3] c4
   setup 3x2 1x4 restriction forbidden wave_only
      array [CR0E CR3E CR2E AL2W AL3W AL0W]
   setup 4x2 1x8 restriction forbidden wave_only
      array [CR0E CR3E CR2E CR5E AL5W AL2W AL3W AL0W]

call "beau hop" c3a
            visible_fractions bigmatrix_is_inherited nxn_is_inherited
            single_is_inherited fractal_is_inherited gen_sting_is_inherited singlefile_is_inherited
   seq startbeauhopping [inherit_single inherit_singlefile inherit_nxn inherit_bigmatrix]
   seq specarmturn_14   [inherit_nxn inherit_fractal inherit_gensting]

call "belle hop" c3a
            visible_fractions bigmatrix_is_inherited nxn_is_inherited
            single_is_inherited fractal_is_inherited gen_sting_is_inherited singlefile_is_inherited
   seq startbellhopping [inherit_single inherit_singlefile inherit_nxn inherit_bigmatrix]
   seq specarmturn_14   [inherit_nxn inherit_fractal inherit_gensting]

call "@k hop the@C lock" c3a
            visible_fractions cross_is_inherited
            fractal_is_inherited gen_sting_is_inherited yield_if_ambiguous
   seq starthopping []
   seq hinge [inherit_fractal inherit_gensting]
   seq lockit [inherit_cross inherit_fractal inherit_gensting]

call "beau hop the@C lock" c3a
            visible_fractions bigmatrix_is_inherited nxn_is_inherited
            cross_is_inherited fractal_is_inherited gen_sting_is_inherited singlefile_is_inherited
   seq startbeauhopping [inherit_singlefile inherit_nxn inherit_bigmatrix]
   seq specarmturn_14   [inherit_nxn inherit_fractal inherit_gensting]
   seq lockit [inherit_cross inherit_fractal inherit_gensting]

call "belle hop the@C lock" c3a
            visible_fractions bigmatrix_is_inherited nxn_is_inherited
            cross_is_inherited fractal_is_inherited gen_sting_is_inherited singlefile_is_inherited
   seq startbellhopping [inherit_singlefile inherit_nxn inherit_bigmatrix]
   seq specarmturn_14   [inherit_nxn inherit_fractal inherit_gensting]
   seq lockit [inherit_cross inherit_fractal inherit_gensting]

call "@k hop the top" c3a
            visible_fractions fractal_is_inherited gen_sting_is_inherited yield_if_ambiguous
   seq starthopping []
   seq hinge [inherit_fractal inherit_gensting]
   seq fanthetop [inherit_fractal inherit_gensting]

call "beau hop the@C top" c3a
            bigmatrix_is_inherited fractal_is_inherited gen_sting_is_inherited
            singlefile_is_inherited nxn_is_inherited visible_fractions
   seq startbeauhopping [inherit_singlefile inherit_nxn inherit_bigmatrix]
   seq specarmturn_14   [inherit_nxn inherit_fractal inherit_gensting]
   seq fanthetop [inherit_fractal inherit_gensting]

call "belle hop the@C top" c3a
            bigmatrix_is_inherited fractal_is_inherited gen_sting_is_inherited
            singlefile_is_inherited nxn_is_inherited visible_fractions
   seq startbellhopping [inherit_singlefile inherit_nxn inherit_bigmatrix]
   seq specarmturn_14   [inherit_nxn inherit_fractal inherit_gensting]
   seq fanthetop [inherit_fractal inherit_gensting]

call "derby" c4 tag derby
   setup 1x4 1x4
      array [C1S C2S A3S A0S]
   setup dmd dmd rotate
      array [C3E 0   A1E 0]
   setup pmd dmd rotate
      array [0   C2E 0   A0E]
            alternate_definition [grand] c3x
   setup 1x6 1x6
      array [C1S C5S A0S A4S A2S C3S]
   setup 1x8 1x8
      array [C1S C2S C7S A0S A5S A6S A3S C4S]
            alternate_definition [yoyo] c4
   setup 1x4 dmd rotate
      array [C3E C2S A1E A2N]
   setup dmd 1x4
      array [C1S 0   A3S 0]
   setup pmd 1x4
      array [0   C0W 0   A0E]
            alternate_definition [generous] c3
   setup 1x4 dmd rotate
      array [C3E C2S A1E A2N]
   setup dmd 1x4
      array [C1S 0   A3S 0]
   setup pmd 1x4
      array [0   C0W 0   A0E]
            alternate_definition [stingy] c3
   setup 1x4 dmd rotate
      array [C3E C0N A1E A0S]
   setup dmd 1x4
      array [C1S 0   A3S 0]
   setup pmd 1x4
      array [0   C2E 0   A2W]
            alternate_definition [3x3] c4
   setup 1x6 1x6 restriction forbidden 3x3_2fl_only
      array [C1S C5S C3S A4S A2S A0S]
            alternate_definition [4x4] c4
   setup 1x8 1x8 restriction forbidden 4x4_2fl_only
      array [C1S C2S C4S C7S A5S A6S A0S A3S]

call "_start dixie style" dontshow tag start_dixie
            left_means_mirror reverse_means_mirror no_elongation_allowed
            rear_back_from_qtag
   setup 2x2 1x4 rotate qualifier not_split_dixie
      array [0 0 ZM1W ZM2W]
   setup 2x2 2x2 qualifier split_dixie
      predscantdo
         if 2x2_antitandem     [0 0 AL1W CR0E]
         if always             [0 0 ZM2N ZM3N]
   // We now allow this without requiring the caller to say "single file" or "on a double track".
   // While Callerlab says that the caller must say something to disambiguate "single file" or
   // "centers", what we do here is consistent with the rest of SD.  We do not have an implicit
   // "centers" on this.  The caller must say so if that is the desired action.
   setup 4x1 1x4 qualifier in 2fl_only
      array [ZM0N ZM3N 0 0 ]
   setup trngl4 1x4 rotate qualifier ntbone not_split_dixie
      predscantdo
         if raise_some_sglfile [ZM2W ZM1W 0 0 0 0 ZM1W ZM2W]
   // This selects people in an "around the corner" DPT.
   setup alamo alamo qualifier 1fl_only
      array [0 0 AL1W ZM3N 0 0 ZM6N CR0E]
   // Same, in 4x4 "O" spots.
   setup 4x4 alamo qualifier 1fl_only
      array [0 AL1W ZM3N 0 0 0 0 0 0 ZM6N CR0E 0 0 0 0 0]
   // This selects people in a "straight ahead" DPT.
   setup alamo alamo plus_eighth_rotation qualifier miniwaves
      array [0 0 1W 1W 0 0 6N 6N]
   // Same, in 4x4 "O" spots.
   setup 4x4 alamo plus_eighth_rotation qualifier miniwaves
      array [0 1W 1W 0 0 0 0 0 0 6N 6N 0 0 0 0 0]
            alternate_definition [singlefile] mainstream
   setup 4x1 1x4 qualifier in 2fl_only
      array [ZM0N ZM3N 0 0 ]
            alternate_definition [3x3 singlefile] c4
   setup 6x1 1x6
      array [ZM0N ZM2N ZM4N 0 0 0 ]
            alternate_definition [4x4 singlefile] c4
   setup 8x1 1x8
      array [ZM0N ZM3N ZM5N ZM6N 0 0 0 0 ]
            alternate_definition [single] c4
   setup 2x1 1x2
      array [ZM0N 0 ]
            alternate_definition [3x3] c4
   setup 2x3 1x6 rotate
      array [0 0 0 ZM1W ZM5W ZM3W ]
            alternate_definition [4x4] c4
   setup 2x4 1x8 rotate
      array [0 0 0 0 ZM1W ZM2W ZM7W ZM4W ]
            alternate_definition [twisted] c4
   setup trngl4 2x2 qualifier split_dixie
      array [CAL2N 0 0 0 0 CR1S ZM2N ZM3N]
   setup dmd 1x4            // Whether you say "singlefile" or not.
      array [0 0 0 CM3E]
   setup pmd 1x4           // Whether you say "singlefile" or not.
      array [ZM0N 0 0 0]
            alternate_definition [twisted singlefile] c4
   setup dmd 1x4
      array [0 0 0 CM3E]
   setup pmd 1x4
      array [ZM0N 0 0 0]

   // If that fails, try again with this definition.  It's highly unusual to
   // have a second definition of the same type as the first, but here we are.
   //
   // This deals with situations that arise in two-couple calling in an "I" formation
   // in which a significant number of people are missing.  It attempts to resolve the
   // ambiguity in a manner consistent with what you probably want in the two-couple
   // context, but it still might be ambiguous.  Be sure your dancers resolve the
   // ambiguity the same way the computer does.
            left_means_mirror reverse_means_mirror no_elongation_allowed
            rear_back_from_qtag
   setup 2x4 2x4 qualifier split_dixie
      array [0 0 0 0 0 CR2E AL1W 0]
   setup 4x2 2x4 qualifier split_dixie
      array [ZM0N 0 0 0 0 0 0 ZM7N]

call "dixie style to a wave" mainstream tag full_dixie
            split_like_dixie_style visible_fractions
            single_is_inherited singlefile_is_inherited twisted_is_inherited gen_sting_is_inherited
            nxn_is_inherited mxn_is_inherited fractal_is_inherited
            left_means_mirror reverse_means_mirror
   seq start_dixie [inherit_left inherit_reverse inherit_singlefile
                    inherit_single inherit_nxn inherit_mxn inherit_twisted]
   seq left_touch_1_4 [inherit_left inherit_reverse inherit_fractal inherit_gensting inherit_mxn]

call "dixie diamond" c1
            visible_fractions split_like_dixie_style singlefile_is_inherited
            twisted_is_inherited magic_is_inherited fractal_is_inherited
            gen_sting_is_inherited left_means_mirror reverse_means_mirror
   seq full_dixie [inherit_left inherit_reverse inherit_singlefile
                  inherit_fractal inherit_magic inherit_gensting inherit_twisted]
   seq youall [inherit_fractal inherit_gensting]

call "dixie sashay" c1
            visible_fractions split_like_dixie_style singlefile_is_inherited
            twisted_is_inherited magic_is_inherited fractal_is_inherited
            gen_sting_is_inherited left_means_mirror reverse_means_mirror
            nxn_is_inherited mxn_is_inherited
   seq full_dixie [inherit_left inherit_reverse inherit_singlefile
                  inherit_nxn inherit_mxn inherit_fractal inherit_magic inherit_gensting inherit_twisted]
   seq slither [inherit_nxn inherit_mxn inherit_twisted]

call "dixie derby" c4
            visible_fractions split_like_dixie_style singlefile_is_inherited
            twisted_is_inherited nxn_is_inherited
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited left_means_mirror reverse_means_mirror
   seq full_dixie [inherit_left inherit_reverse inherit_singlefile
                  inherit_nxn inherit_fractal inherit_gensting inherit_twisted]
   seq derby [inherit_nxn inherit_yoyo inherit_gensting]

call "dixie spin" c4a
            visible_fractions split_like_dixie_style
            singlefile_is_inherited twisted_is_inherited gen_sting_is_inherited
            fractal_is_inherited left_means_mirror reverse_means_mirror
   seq full_dixie [inherit_left inherit_reverse inherit_singlefile
                  inherit_fractal inherit_gensting inherit_twisted]
   seq fanthetop [inherit_fractal inherit_gensting]

call "_ctrs pass thru" dontshow tag ctrs_pass_thru
            twisted_is_inherited single_is_inherited bigmatrix_is_inherited nxn_is_inherited
            left_means_mirror reverse_means_mirror
   maybematrix_singleconc_together
      passthru [inherit_twisted inherit_left inherit_reverse]
      nullcall [conc_force_spots]

call "dixie chain" c4
            visible_fractions split_like_dixie_style
            singlefile_is_inherited twisted_is_inherited
            left_means_mirror reverse_means_mirror
   seq start_dixie [inherit_left inherit_reverse inherit_singlefile inherit_twisted]
   seq leftpassthru [inherit_left inherit_twisted]
   seq ctrs_pass_thru [inherit_left inherit_reverse inherit_twisted]

call "dixie chain to a wave" c4x
            visible_fractions
            split_like_dixie_style
            singlefile_is_inherited twisted_is_inherited
            left_means_mirror reverse_means_mirror
   seq start_dixie [inherit_left inherit_reverse inherit_singlefile inherit_twisted]
   seq leftpassthru [inherit_left inherit_twisted]
   seq ctrs_pass_thru [force_half inherit_left inherit_reverse inherit_twisted]

call "dixie daisy" c4
            visible_fractions
            split_like_dixie_style
            singlefile_is_inherited twisted_is_inherited yoyo_is_inherited gen_sting_is_inherited
            left_means_mirror reverse_means_mirror
   seq start_dixie [inherit_left inherit_reverse inherit_singlefile inherit_twisted]
   seq leftturnthru [inherit_left inherit_reverse inherit_twisted inherit_yoyo inherit_gensting]
   seq ctrs_pass_thru [inherit_left inherit_reverse inherit_twisted]

call "dixie daisy to a wave" c4
            visible_fractions
            split_like_dixie_style
            singlefile_is_inherited twisted_is_inherited yoyo_is_inherited gen_sting_is_inherited
            left_means_mirror reverse_means_mirror
   seq start_dixie [inherit_left inherit_reverse inherit_singlefile inherit_twisted]
   seq leftturnthru [inherit_left inherit_reverse inherit_twisted inherit_yoyo inherit_gensting]
   seq ctrs_pass_thru [force_half inherit_left inherit_reverse inherit_twisted]

call "dixie grand" plus
            rear_back_from_wave_or_qtag left_means_mirror
   setup 4x2 alamo plus_eighth_rotation qualifier 2fl_only
      array [0N 2E 2E 4S 7E 1S 1S 3W]
   setup 4x2 alamo qualifier magic_only
      array [2E 2E 4S 4S 1S 1S 3W 3W]
   setup 4x2 alamo qualifier ntbone in in_or_out
      array [2E 0 4S 0 0 1S 0 3W]
   // The people doing the initial pull-by must be facing, so this isn't really right.
   setup 4x2 alamo plus_eighth_rotation qualifier ntbone out in_or_out restriction controversial alwaysfail
      array [0 2E 0 4S 7E 0 1S 0]
   setup 4x2 alamo plus_eighth_rotation qualifier tbone none
      array [0 2E 2E 0 0 1S 1S 0]
   setup 2x4 alamo plus_eighth_rotation qualifier tbone none
      array [0 0 0 0 7S 0 0 0E]
   // This selects people in an "around the corner" DPT.
   setup alamo alamo plus_eighth_rotation qualifier 1fl_only
      array [0 0 6S 0W 0 0 7N 1E]
   // Same, in 4x4 "O" spots.
   setup 4x4 alamo plus_eighth_rotation qualifier 1fl_only
      array [0 6S 0W 0 0 0 0 0 0 7N 1E 0 0 0 0 0]
   // This selects people in a "straight ahead" DPT.
   setup alamo alamo plus_eighth_rotation qualifier miniwaves
      array [0 0 7S 7S 0 0 0E 0E]
   // Same, in 4x4 "O" spots.
   setup 4x4 alamo plus_eighth_rotation qualifier miniwaves
      array [0 7S 7S 0 0 0 0 0 0 0E 0E 0 0 0 0 0]
   // This selects people in an 8-chain or trade by; everyone starts.
   setup alamo alamo plus_eighth_rotation qualifier in_or_out
      array [0 0 6S 7S 0 0 0E 1E]
   // Same, in 4x4 "O" spots.
   setup 4x4 alamo plus_eighth_rotation qualifier in_or_out
      array [0 6S 7S 0 0 0 0 0 0 0E 1E 0 0 0 0 0]

   setup hrglass alamo plus_eighth_rotation qualifier right magic_only
      array [0 0 0 0 0 0 0E 0]
   setup phrglass alamo plus_eighth_rotation qualifier right magic_only
      array [0 2E 0 0 7E 0 0 1S]
   setup hrglass alamo plus_eighth_rotation qualifier left magic_only
      array [0 0 7S 0 0 0 0 0]
   setup phrglass alamo plus_eighth_rotation qualifier left magic_only
      array [0 4S 0 2E 1S 0 0 0]
            alternate_definition [twisted] c4
   setup thar 4x4
      array [0 0 0 2S 0 0 1N 0]
   setup qtag 4x4
      array [0 0 0 0 1N 10N 0 0]
   setup pqtag 4x4
      array [0 0 0 6S 0 0 5N 0]
   setup 4x2 4x4 qualifier ntbone in in_or_out
      array [ 6N   0  5S   0   0 9W  0 2W]

call "dixie grand, but on the 3rd hand" plus
            dont_use_in_resolve rear_back_from_wave_or_qtag
            left_means_mirror
   setup 4x2 thar qualifier 2fl_only
      array [2N 4E  0  0  0  0 5W 7N]
   setup 4x2 thar plus_eighth_rotation qualifier magic_only
      array [2N 2N 4E 4E 3S 3S 5W 5W]
   setup 4x2 thar plus_eighth_rotation qualifier ntbone in in_or_out
      array [2N  0 4E  0  0 3S  0 5W]

call "pass the sea" a1
            rear_back_from_r_wave visible_fractions twisted_is_inherited funny_is_inherited
   seq passthru [inherit_twisted inherit_funny]
   seq quarterin []
   // Of course, "twisted" won't normally apply here.
   seq lft_touch [force_left inherit_twisted]

// It's just simpler to list these calls separately.  We could use the
// "@e...@f mechanism, and the "left_means_mirror" flag, and all that,
// and then typing in would be natural, but getting "veer left" from the
// menu would still require clicking on the "left" concept.  Since "veer
// left" is vastly more common than "veer right", that would be inconvenient.
// Better just to list both of them.
call "veer right" mainstream
   setup 2x2 1x4 qualifier in in_or_out
      array [0 0 ZGM2N ZGM3N]
   setup 1x4 2x2 qualifier right 2fl_only
      array [ZGM0N ZGM1N 0 0]
            alternate_definition [single] mainstream
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [ZGM1W 0]
   setup 1x2 1x2 rotate qualifier right miniwaves
      array [ZGM0W 0]
            alternate_definition [3x3] c4
   setup 2x3 1x6 qualifier in in_or_out
      array [0 0 0 ZGM3N ZGM4N ZGM5N]
   setup 1x6 2x3 qualifier right 3x3_2fl_only
      array [ZGM0N ZGM1N ZGM2N 0 0 0]
            alternate_definition [4x4] c4
   setup 2x4 1x8 qualifier in in_or_out
      array [0 0 0 0 ZGM4N ZGM5N ZGM7N ZGM6N]
   setup 1x8 2x4 qualifier right 4x4_2fl_only
      array [ZGM0N ZGM1N ZGM3N ZGM2N 0 0 0 0]

call "veer left" mainstream
   setup 2x2 1x4 qualifier in in_or_out
      array [0 0 ZFM1N ZFM0N]
   setup 1x4 2x2 qualifier left 2fl_only
      array [0 0 ZFM1N ZFM0N]
            alternate_definition [single] mainstream
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [ZFM0W 0]
   setup 1x2 1x2 rotate qualifier left miniwaves
      array [0 ZFM0W]
            alternate_definition [3x3] c4
   setup 2x3 1x6 qualifier in in_or_out
      array [0 0 0 ZFM2N ZFM1N ZFM0N]
   setup 1x6 2x3 qualifier left 3x3_2fl_only
      array [0 0 0 ZFM2N ZFM1N ZFM0N]
            alternate_definition [4x4] c4
   setup 2x4 1x8 qualifier in in_or_out
      array [0 0 0 0 ZFM2N ZFM3N ZFM1N ZFM0N]
   setup 1x8 2x4 qualifier left 4x4_2fl_only
      array [0 0 0 0 ZFM3N ZFM2N ZFM0N ZFM1N]

call "leftable veer left" dontshow tag lft_veer_left
            left_means_mirror
   setup 2x2 1x4 qualifier in in_or_out
      array [0 0 ZFM1N ZFM0N]
   setup 1x4 2x2 qualifier left 2fl_only
      array [0 0 ZFM1N ZFM0N]
            alternate_definition [single] c4
   setup 2x1 1x2 rotate
      array [ZFM0W 0]
   setup 1x2 1x2 rotate
      array [0 ZFM0W]
            alternate_definition [3x3] c4
   setup 2x3 1x6
      array [0 0 0 ZFM2N ZFM1N ZFM0N]
   setup 1x6 2x3
      array [0 0 0 ZFM2N ZFM1N ZFM0N]
            alternate_definition [4x4] c4
   setup 2x4 1x8
      array [0 0 0 0 ZFM2N ZFM3N ZFM1N ZFM0N]
   setup 1x8 2x4
      array [0 0 0 0 ZFM3N ZFM2N ZFM0N ZFM1N]

call "_sashay thru part 1" dontshow tag sashay_thru_1
            rear_back_from_r_wave left_means_mirror
   setup 2x1 1x2 rotate
      array [ZM1W 0]

call "sashay thru" c4
            visible_fractions rear_back_from_r_wave left_means_mirror twisted_is_inherited
   seq sashay_thru_1 [inherit_twisted]
   seq slither [inherit_twisted]
            rear_back_from_r_wave left_means_mirror
   setup 2x2 1x4
      array [0 0 ZM2N ZM3N]
            alternate_definition [single] c4
   setup 2x1 1x2 rotate
      array [ZM1W 0]
            alternate_definition [3x3] c4
   setup 2x3 1x6
      array [0 0 0 ZM3N ZM4N ZM5N]
            alternate_definition [4x4] c4
   setup 2x4 1x8
      array [0 0 0 0 ZM4N ZM5N ZM7N ZM6N]
            alternate_definition [6x6] c4
   setup 2x6 1x12
      array [0 0 0 0 0 0 ZM6N ZM7N ZM8N ZM9N ZM10N ZM11N]
            alternate_definition [8x8] c4
   setup 2x8 1x16
      array [0 0 0 0 0 0 0 0 ZM8N ZM9N ZM10N ZM11N ZM12N ZM13N ZM14N ZM15N]

call "reach out" c3a
   setup 2x2 1x4 restriction wave_only
      array [CM3S AM1S CR2S AL0S]
            alternate_definition [rewind] c4
   setup 1x4 2x2
      array [CR3S CR1S AL2S AL0S]
            alternate_definition [scatter] c4
   setup 2x4 1x8 qualifier ntbone none restriction wave_only
      array [CM5S CM7S AM3S AM1S CR4S AL6S CR2S AL0S]
   setup 2x4 qtag
      array [CM2S CM3S AM7S AM6S 0 0 0 0]
   setup 4x2 qtag
      array [AL0S 0 AL1S 0 0 CR4S 0 CR5S]

call "flare out to a line" c3a
   setup 2x4 1x8 restriction unusual 2fl_only
      array [AL0S AL1S CR5S CR4S ZM7N ZM6N ZM2N ZM3N]
   setup 4x2 rigger restriction unusual alwaysfail qualifier tbone siamese_in_quad
      array [ZM0N ZM1N 0 0 0 0 ZM4N ZM5N]
            alternate_definition [1x2] c4
   setup 2x3 1x6 qualifier ntbone none
      predscantdocallinsetup
         if miniwave_side_of_2n1_line [AL0S 0 CR3S    0 ZM5N    0]
         if couple_side_of_2n1_line   [   0 0    0 ZM4N ZM2N ZM1N]
   setup 2x3 short6 rotate qualifier tbone none
      array [AL4E 0 CR1E 0 0 0]
   setup 3x2 short6 rotate
      array [ZM5W ZM0W 0 0 ZM2W ZM3W]
            alternate_definition [single] c4a
   setup 2x2 1x4 no_cutting_through restriction wave_only
      array [AL0S CR2S ZM3N ZM1N]
            alternate_definition [3x3] c4
   setup 2x6 1x12 restriction 3x3_2fl_only
      array [AL0S AL1S AL2S CR8S CR7S CR6S
             ZM9N ZM10N ZM11N ZM5N ZM4N ZM3N]
   setup 6x2 rigger12 restriction unusual alwaysfail qualifier tbone siamese_in_quad
      array [ZM0N ZM1N ZM2N 0 0 0 0 0 0 ZM6N ZM7N ZM8N]
            alternate_definition [4x4] c4
   setup 2x8 1x16 restriction 4x4_2fl_only
      array [AL0S AL1S AL2S AL3S CR11S CR10S CR9S CR8S
             ZM12N ZM13N ZM14N ZM15N ZM7N ZM6N ZM5N ZM4N]
            alternate_definition [cross] c4
   setup 2x4 1x8 restriction 2fl_only
      array [CR5S CR4S AL0S AL1S ZM7N ZM6N ZM2N ZM3N]
            alternate_definition [cross single] c4
   setup 2x2 1x4 no_cutting_through restriction wave_only
      array [CR2S AL0S ZM3N ZM1N]

call "criss cross flare out to a line" c4
   setup 2x4 1x8 restriction 2fl_only
      array [CR5S CR4S AL0S AL1S ZM2N ZM3N ZM7N ZM6N]

call "scoot apart" c4
   setup 2x2 1x4 restriction wave_only
      array [CM3S AM1S AM0S CM2S]
            alternate_definition [rewind] c4
   setup 1x4 2x2 qualifier couples_only
      array [C2S C1S A3S A0S]
            alternate_definition [scatter] c4
   setup 2x4 1x8 qualifier ntbone none restriction wave_only
      array [CM5S CM7S AM3S AM1S AM6S CM4S AM0S CM2S]
   setup 2x4 qtag
      array [CM2S CM3S AM7S AM6S 0 0 0 0]
   setup 4x2 qtag
      array [CR5S 0 CR4S 0 0 AL1S 0 AL0S]
            alternate_definition [3x3] c4
   setup 3x2 1x6 rotate restriction peelable_box
      array [C3E C4E C5E A2E A1E A0E]
            alternate_definition [rewind 3x3] c4
   setup 1x6 2x3 rotate qualifier 3x3_2fl_only
      array [C2E C1E C0E A3E A4E A5E]
            alternate_definition [4x4] c4
   setup 4x2 1x8 rotate restriction peelable_box
      array [C4E C5E C7E C6E A2E A3E A1E A0E]
            alternate_definition [rewind 4x4] c4
   setup 1x8 2x4 rotate qualifier 4x4_2fl_only
      array [C3E C2E C0E C1E A4E A5E A7E A6E]
            alternate_definition [cross] c4
   setup 2x2 1x4 restriction wave_only
      array [CM3S AM1S CM2S AM0S]
            alternate_definition [yoyo] c4
   setup 2x2 dmd rotate restriction wave_only
      array [CM1E AM3E AM2N CM2S]
            alternate_definition [generous] c3
   setup 2x2 dmd rotate restriction wave_only
      array [CM1E AM3E AM2N CM2S]
            alternate_definition [stingy] c3
   setup 2x2 dmd rotate restriction wave_only
      array [CM1E AM3E AM0S CM0N]
            alternate_definition [yoyo scatter] c3
   // This is just scatter follow to a diamond.
   setup 2x4 qtag qualifier ntbone none restriction wave_only
      array [CM2S CM3S AM7S AM6S AM4E CM4W AM5E CM5W]
   setup 2x4 qtag
      array [CM2S CM3S AM7S AM6S AM4E CM4W AM5E CM5W]
   setup 4x2 1x8
      array [CM0W 0 CM6W 0 0 AM6E 0 AM0E]
            alternate_definition [generous scatter] c3
   setup 2x4 qtag
      array [CM2S CM3S AM7S AM6S AM4E CM4W AM5E CM5W]
   setup 4x2 1x8
      array [CM0W 0 CM6W 0 0 AM6E 0 AM0E]
            alternate_definition [stingy scatter] c3
   setup 2x4 qtag
      array [CM2S CM3S AM7S AM6S AM1W CM1E AM0W CM0E]
   setup 4x2 1x8
      array [CM2E 0 CM4E 0 0 AM4W 0 AM2W]
            alternate_definition [yoyo cross] c4
   setup 2x2 dmd rotate restriction wave_only
      array [CM1E AM3E CM2S AM2N]
            alternate_definition [generous cross] c3
   setup 2x2 dmd rotate restriction wave_only
      array [CM1E AM3E CM2S AM2N]
            alternate_definition [stingy cross] c3
   setup 2x2 dmd rotate restriction wave_only
      array [CM1E AM3E CM0N AM0S]

call "criss cross scoot apart" c4
   setup 2x2 1x4 restriction wave_only
      array [CM1S AM3S CM2S AM0S]
            alternate_definition [yoyo] c4
   setup 2x2 dmd rotate restriction wave_only
      array [CM3E AM1E CM2S AM2N]
            alternate_definition [generous] c3
   setup 2x2 dmd rotate restriction wave_only
      array [CM3E AM1E CM2S AM2N]
            alternate_definition [stingy] c3
   setup 2x2 dmd rotate restriction wave_only
      array [CM3E AM1E CM0N AM0S]

call "_peel for peel to a diamond" dontshow tag peelforpeeltoadiamond
            split_if_z can_do_in_z
   setup 2x2 1x4 no_cutting_through restriction resolve_ok peelable_box
      array [AL0S CR2S ZM3N ZM1N]

call "_trail for trail to a diamond" dontshow tag trailfortrailtodiamond
            split_if_z can_do_in_z
   setup 2x2 1x4 no_cutting_through restriction resolve_ok peelable_box
      array [CR2S AL0S ZM3N ZM1N]

call "peel to a@I diamond" c2
   setup 2x2 2x2 qualifier alwaysfail
      array [0 0 0 0]
            alternate_definition [rewind] c4
   setup dmd 2x2 qualifier dmd_pts_mwv
      array [CR0S 0 AL1S 0]
   setup pmd 2x2 qualifier dmd_pts_mwv
      array [0 CR2E 0 AL1W]
   setup dmd 2x2 qualifier dmd_pts_1f
      array [CR0S 0 AL1S 0]
   setup pmd 2x2 qualifier dmd_pts_1f
      predscantdocallinsetup
         if next_dmd_spot_is_facing [0 0 0 AM1W]
         if next_dmd_spot_is_normal [0 0 0 CM2E]
            intlk_is_inherited gen_sting_is_inherited
   seq peelforpeeltoadiamond []
   seq sglctrtogetherhinge [inherit_intlk inherit_gensting roll_transparent]

call "trail to a@I diamond" c2
   setup 2x2 2x2 qualifier alwaysfail
      array [0 0 0 0]
            alternate_definition [rewind] c4
   setup dmd 2x2 qualifier dmd_pts_mwv
      array [CR1S 0 AL0S 0]
   setup pmd 2x2 qualifier dmd_pts_mwv
      array [0 CR2E 0 AL1W]
   setup dmd 2x2 qualifier dmd_pts_1f
      array [CR1S 0 AL0S 0]
   setup pmd 2x2 qualifier dmd_pts_1f
      predscantdocallinsetup
         if next_dmd_spot_is_facing [0 0 0 AM1W]
         if next_dmd_spot_is_normal [0 0 0 CM2E]
            intlk_is_inherited gen_sting_is_inherited
   seq trailfortrailtodiamond []
   seq sglctrtogetherhinge [inherit_intlk inherit_gensting roll_transparent]

call "peel off" plus tag peeloff
            can_be_one_side_lateral split_if_z split_large_setups can_do_in_z
   setup 2x2 1x4 no_cutting_through restriction peelable_box
      array [AL0S CR2S CR3S AL1S]
            alternate_definition [rewind] c4
   setup 1x4 2x2 qualifier couples_only
      array [CR0S CR3S AL1S AL2S]
            alternate_definition [single] c4
   setup 1x2 1x2
      array [AL0S CR1S]
            alternate_definition [3x3] c4
   setup 3x2 1x6 rotate restriction peelable_box
      array [AL2E AL1E AL0E CR3E CR4E CR5E]
            alternate_definition [rewind 3x3] c4
   setup 1x6 2x3 rotate qualifier 3x3_2fl_only
      array [CR5E CR4E CR3E AL0E AL1E AL2E]
            alternate_definition [4x4] c4
   setup 4x2 1x8 rotate restriction peelable_box
      array [AL2E AL3E AL1E AL0E CR4E CR5E CR7E CR6E]
            alternate_definition [rewind 4x4] c4
   setup 1x8 2x4 rotate qualifier 4x4_2fl_only
      array [CR7E CR6E CR4E CR5E AL0E AL1E AL3E AL2E]

call "trail off" a2 tag trailoff
            split_if_z split_large_setups can_do_in_z
   setup 2x2 1x4 no_cutting_through restriction peelable_box
      array [CR2S AL0S AL1S CR3S]
            alternate_definition [yoyo] c4
   setup 2x2 dmd no_cutting_through restriction peelable_box
      array [CR2S AL0S AL3E CR3W]
            alternate_definition [rewind] c4
   setup 1x4 2x2 qualifier couples_only
      array [CR1S CR2S AL0S AL3S]
            alternate_definition [single] c4
   setup 1x2 1x2
      array [CR1S AL0S]
            alternate_definition [3x3] c4
   setup 3x2 1x6 rotate restriction peelable_box
      array [CR5E CR4E CR3E AL0E AL1E AL2E]
            alternate_definition [rewind 3x3] c4
   setup 1x6 2x3 rotate qualifier 3x3_2fl_only
      array [CR0E CR1E CR2E AL5E AL4E AL3E]
            alternate_definition [4x4] c4
   setup 4x2 1x8 rotate restriction peelable_box
      array [CR6E CR7E CR5E CR4E AL0E AL1E AL3E AL2E]
            alternate_definition [rewind 4x4] c4
   setup 1x8 2x4 rotate qualifier 4x4_2fl_only
      array [CR0E CR1E CR3E CR2E AL7E AL6E AL4E AL5E]

call "_crossable peel off" dontshow tag crossable_peeloff
   setup 2x2 1x4 restriction peelable_box
      array [AL0S CR2S CR3S AL1S]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate
      array [AL0S CR1S]
            alternate_definition [3x3] c4
   setup 3x2 1x6 rotate restriction peelable_box
      array [AL2E AL1E AL0E CR3E CR4E CR5E]
            alternate_definition [4x4] c4a
   setup 4x2 1x8 rotate restriction peelable_box
      array [AL2E AL3E AL1E AL0E CR4E CR5E CR7E CR6E]
            alternate_definition [cross] c4a
   setup 2x2 1x4 no_cutting_through restriction peelable_box
      array [CR2S AL0S AL1S CR3S]
            alternate_definition [cross single] c4
   setup 1x2 1x2
      array [CR1S AL0S]
            alternate_definition [cross 3x3] c4
   setup 3x2 1x6 rotate restriction peelable_box
      array [CR5E CR4E CR3E AL0E AL1E AL2E]
            alternate_definition [cross 4x4] c4
   setup 4x2 1x8 rotate restriction peelable_box
      array [CR6E CR7E CR5E CR4E AL0E AL1E AL3E AL2E]

call "peel and trail" a2 tag peelntrail
            split_if_z split_large_setups can_do_in_z
   setup 2x2 1x4 no_cutting_through restriction peelable_box
      array [AL0S CR2S AL1S CR3S]
            alternate_definition [generous] c3
   setup 2x2 dmd no_cutting_through restriction peelable_box
      array [AL0S CR2S AL3E CR3W]
            alternate_definition [stingy] c3
   setup 2x2 dmd no_cutting_through restriction peelable_box
      array [AL0S CR2S AL1W CR1E]
            alternate_definition [yoyo] c4
   setup 2x2 dmd no_cutting_through restriction peelable_box
      array [AL0S CR2S AL3E CR3W]
            alternate_definition [rewind] c4
   setup 1x4 2x2 qualifier wave_only
      array [CR0S CR2S AL1S AL3S]
   setup 1x4 2x2 qualifier 1fl_only
      array [CR0S CR2S AL1S AL3S]

call "trail and peel" c4 tag trailnpeel
            split_if_z split_large_setups
   setup 2x2 1x4 no_cutting_through restriction peelable_box
      array [CR2S AL0S CR3S AL1S]
            alternate_definition [rewind] c4
   setup 1x4 2x2 qualifier wave_only
      array [CR1S CR3S AL0S AL2S]
   setup 1x4 2x2 qualifier 1fl_only
      array [CR1S CR3S AL0S AL2S]

call "more or less peel off" c4 tag moreorlesspeeloff
            split_if_z can_do_in_z
   setup 2x2 1x4 no_cutting_through restriction peelable_box
      array [AL0E CR2W CR3E AL1W]

call "less or more peel off" c4 tag lessormorepeeloff
            split_if_z can_do_in_z
   setup 2x2 1x4 no_cutting_through restriction peelable_box
      array [AL0W CR2E CR3W AL1E]

call "more or less peel and trail" c4
   setup 2x2 dmd no_cutting_through qualifier 2fl_only
      array [AL0E CR2W AL1W CR3E]
   setup 2x2 dmd no_cutting_through restriction peelable_box
      array [AL0E CR2W AL1W CR1E]

call "more or less trail off" c4 tag moreorlesstrailoff
   setup 2x2 dmd no_cutting_through qualifier 2fl_only
      array [CR2W AL0E AL1W CR3E]
   setup 2x2 dmd no_cutting_through restriction peelable_box
      array [CR2W AL0E AL1W CR1E]

call "reset" c3
            dont_use_in_nice_resolve visible_fractions fractal_is_inherited gen_sting_is_inherited
   // We inherit gen/sting/fractal to the zooms to enforce saying "evenly generous reset".
   seq zoom [force_half]
   seq armturn_with_warn [inherit_gensting inherit_fractal]
   seq zoom [force_half]
   seq armturn_with_warn [inherit_gensting inherit_fractal]

// We allow either "3/4 reset" or "reset 3/4".
call "reset @a" c3
            neednumber visible_fractions distribute_repetitions fractal_is_inherited gen_sting_is_inherited
   // Note that "visible_fractions" is permitted for "seq_alternate"
   // calls ONLY if "distribute_repetitions" is also used.
   seq_alternate zoom [force_half repeat_n]
   seq armturn_with_warn [inherit_gensting inherit_fractal]

call "_eight chain part 1" dontshow tag eightchain1
            rear_back_from_r_wave left_means_mirror
   simple_funny
   setup 4x2 2x4
      array [ZM1N 0 ZM3N 0 0 ZM4N 0 ZM6N]
            alternate_definition [half] mainstream
   setup 4x2 2x4 rotate
      array [ZM7W 0 ZM0W 0 0 ZM2W 0 ZM5W]
            alternate_definition [lasthalf] mainstream
   setup 2x4 2x4 rotate
      array [ZM7W 0 ZM0W 0 0 ZM2W 0 ZM5W]
            alternate_definition [twisted] c4
   setup 4x2 2x4 rotate
      array [ZM6N 0 ZM1N 0 0 ZM3N 0 ZM4N]

call "_eight chain part 2" dontshow tag eightchain2
            left_means_mirror
   setup 4x2 2x4
      array [0 ZM2N 0 AL4S AL3S 0 ZM5N 0]
            alternate_definition [half] mainstream
   setup 4x2 crosswave
      array [0 ZM3N 0 AL5W AL4W 0 ZM6N 0]
            alternate_definition [lasthalf] mainstream
   setup crosswave 2x4
      array [0 0 0 0 AL3W AL4W 0 0]
   setup pcrosswave 2x4
      array [0 0 0 ZM2N 0 0 ZM5N 0]
            alternate_definition [twisted] c4
   setup 4x2 qtag rotate
      array [0 ZM6S 0 AL1E AL0E 0 ZM3S 0]

// If use an odd number with "centers to a wave", this will get called with HALF, and it will fail.
call "_eight chain part 1, centers to a wave" dontshow tag eightchain1_centers_to_wave
            rear_back_from_r_wave left_means_mirror
   simple_funny
   setup 4x2 2x4
      array [ZM1N 0 ZM3N 0 0 ZM4N 0 ZM6N]

call "_eight chain part 2, centers to a wave" dontshow tag eightchain2_centers_to_wave
            left_means_mirror
   setup 4x2 2x4
      array [0 ZM2N 0 AL4S AL3S 0 ZM5N 0]
            alternate_definition [half] mainstream
   setup 4x2 qtag rotate
      array [0 ZM7W 0 AL1E AL0E 0 ZM2W 0]

call "eight chain @9" mainstream
            rear_back_from_r_wave left_means_mirror twisted_is_inherited
            neednumber visible_fractions distribute_repetitions
   seq_alternate eightchain1 [inherit_left inherit_twisted repeat_n]
   seq eightchain2 [inherit_left inherit_twisted]

call "eight chain @9-1/2" mainstream
            rear_back_from_r_wave left_means_mirror twisted_is_inherited
            neednumber visible_fractions distribute_repetitions
   seq_alternate eightchain1 [inherit_left inherit_twisted repeat_n do_half_more]
   seq eightchain2 [inherit_left inherit_twisted]

call "eight chain @9, new centers to a wave" mainstream
            rear_back_from_r_wave left_means_mirror twisted_is_inherited
            neednumber visible_fractions distribute_repetitions
   seq_alternate eightchain1_centers_to_wave [inherit_left inherit_twisted repeat_nm1 do_half_more]
   seq           eightchain2_centers_to_wave [inherit_left inherit_twisted]

call "weave" c1 tag weave
            step_to_wave
   setup 2x2 1x4 rotate restriction wave_only
      array [CR0N AL0S CR1N AL1S]
            alternate_definition [stingy] c3
   setup 2x2 dmd rotate restriction wave_only
      array [CR0N AL0S ZM3W ZM1W]
            alternate_definition [generous] c3
   setup 2x2 dmd rotate restriction wave_only
      array [CR0N AL0S CR1E AL3E]

call "_natural 3/4 thru" dontshow tag nat34thru
   setup 2x2 1x4 rotate restriction wave_only
      array [CCCAL3N AAACR3S AL2N CR2S]
            alternate_definition [fractal] c4
   setup 2x2 1x4 rotate restriction wave_only
      array [CR0N AL0S ACR1N CAL1S]
            alternate_definition [generous] c3
   setup 1x4 1x4 restriction wave_only
      array [CR0N CR3S AL2N AL1S]
            alternate_definition [stingy] c3
   setup 1x4 1x4 restriction wave_only
      array [CCAL3N AL0S AACR1N CR2S]

call "_natural 3/4 and 3/4" dontshow tag nat34_34
   setup 2x2 dmd rotate restriction wave_only
      array [CCCAL1W AAACR3W AL2N CR2S]

call "_ @B by the right for swing fractions" dontshow tag odd_frac_by_right_for_swgfrac
            left_means_mirror neednumber split_large_setups fractional_numbers
            gen_sting_is_inherited fractal_is_inherited diamond_is_legal
   // We hate to do this kind of "subclass" overloading, and hope that it isn't
   // opening a huge can of worms.  Time will tell.
   setup 1x8 spindle qualifier num 1 left wave_only
      array [0 CR0E CR1E 0 ZM3N 0 0 CR2E]
   setup 1x8 spindle qualifier num 3 left wave_only
      array [0 CR6W CR5W 0 ZM3N 0 0 CR4W]
   // Need these to go to squared set instead of alamo.
   setup thar 4x4 qualifier num 1 right wave_only
      array [CR10E 0 0 0 0 CR1E 0 0]
   setup thar 4x4 qualifier num 3 right wave_only
      array [CR9W 0 0 0 0 CR2W 0 0]
   // The main "base class" definition.
            left_means_mirror neednumber split_large_setups fractional_numbers
            gen_sting_is_inherited fractal_is_inherited yoyo_fractal_numbers diamond_is_legal
   seq odd_frac_by_right [inherit_left inherit_diamond inherit_fractal
                          inherit_gensting roll_transparent]

call "_ @B by the right" dontshow tag odd_frac_by_right
            left_means_mirror neednumber split_large_setups fractional_numbers
            gen_sting_is_inherited fractal_is_inherited yoyo_fractal_numbers diamond_is_legal

   // Why do we allow the number to be 0? 2? 4?  So that one can do 8/9 remake or stingy/generous remake.
   // Stingy/generous preprocessing sometimes does the arithmetic for us.

   setup 1x2 1x2 qualifier num 0 right wave_only
      array [ZM0N 0]
   setup 1x2 1x2 rotate qualifier num 1 right wave_only
      array [CR0N 0]
   setup 1x2 1x2 qualifier num 2 right wave_only
      array [CR1S 0]
   setup 1x2 1x2 rotate qualifier num 3 right wave_only
      array [CR1S 0]
   setup 1x2 1x2 qualifier num 4 right wave_only
      array [ZM0N 0]

   setup c1phan c1phan qualifier num 0 none
      array [ZM0N 0 ZM2N 0     0 ZM5N 0 ZM7N     ZM8N 0 ZM10N 0     0 ZM13N 0 ZM15N]
   setup c1phan c1phan qualifier num 1 none
      predscantdo
         if can_swing_right [CR1E 0    0 0     0    0 0 CR4E        0 0 CR11E 0     0 CR14E 0     0]
         if always          [ZM0N 0 ZM2N 0     0 ZM5N 0 ZM7N     ZM8N 0 ZM10N 0     0 ZM13N 0 ZM15N]
   setup c1phan c1phan qualifier num 2 none
      predscantdo
         if can_swing_right [CR2S 0    0 0     0    0 0 CR5S        0 0 CR8S  0     0 CR15S 0     0]
         if always          [ZM0N 0 ZM2N 0     0 ZM5N 0 ZM7N     ZM8N 0 ZM10N 0     0 ZM13N 0 ZM15N]
   setup c1phan c1phan qualifier num 3 none
      predscantdo
         if can_swing_right [CR3W 0    0 0     0    0 0 CR6W        0 0 CR9W  0     0 CR12W 0     0]
         if always          [ZM0N 0 ZM2N 0     0 ZM5N 0 ZM7N     ZM8N 0 ZM10N 0     0 ZM13N 0 ZM15N]
   setup c1phan c1phan qualifier num 4 none
      array [ZM0N 0 ZM2N 0     0 ZM5N 0 ZM7N     ZM8N 0 ZM10N 0     0 ZM13N 0 ZM15N]

   setup 1x4 1x4 qualifier num 0 left wave_only
      array [0 ZM1N ZM2N 0]
   setup 1x4 dmd qualifier num 1 left wave_only
      array [0 CR1E ZM2N 0]
   setup 1x4 1x4 qualifier num 2 left wave_only
      array [0 CR3S ZM2N 0]
   setup 1x4 dmd qualifier num 3 left wave_only
      array [0 CR3W ZM2N 0]
   setup 1x4 1x4 qualifier num 4 left wave_only
      array [0 CR1N ZM2N 0]

   // We allow right-handed 2-faced lines, but we recognize that the dancers may be unhappy.
   setup 1x4 dmd qualifier num 1 live right 2fl_only restriction unusual alwaysfail
      array [ZM0N CR1E 0 0]
   setup 1x4 1x4 qualifier num 2 live right 2fl_only restriction unusual alwaysfail
      array [ZM0N CR3S 0 0]
   setup 1x4 dmd qualifier num 3 live right 2fl_only restriction unusual alwaysfail
      array [ZM0N CR3W 0 0]

   setup 2x4 qtag rotate qualifier num 1 left wave_only
      array [0 CR6N 0 ZM0W ZM1W 0 CR3N 0]
   setup 2x4 2x4         qualifier num 2 left wave_only
      array [0 CR2S 0 ZM3N ZM4N 0 CR3S 0]
   setup 2x4 qtag rotate qualifier num 3 left wave_only
      array [0 CR7S 0 ZM0W ZM1W 0 CR2S 0]

   setup qtag 3x1dmd rotate qualifier num 1 right qtag_mag_mwv
      array [CR0N 0 ZM3W 0 0 CR5N 0 CR2N]
   setup qtag qtag qualifier num 2 right qtag_mag_mwv
      array [CR1S 0 ZM2N 0 0 CR4S 0 CR3S]
   setup qtag 3x1dmd rotate qualifier num 3 right qtag_mag_mwv
      array [CR1S 0 ZM3W 0 0 CR4S 0 CR6S]

   // Pick out the case of outsides in right miniwave, and have everyone do it.
   setup qtag qtag rotate  qualifier live num 1 right qtag_mwv
      array [CR6N 0 0 CR0N 0 CR3N CR5N 0]
   // Otherwise, the outsides don't move.
   setup qtag 2x4 rotate  qualifier num 1 right wave_only
      array [ZM7W ZM0W 0 CR1N ZM3W ZM4W CR6N 0]
   setup pqtag 2x4 rotate qualifier num 1 right wave_only
      array [ZM7W ZM0W 0 0    ZM3W ZM4W 0    0]

   // Pick out the case of outsides in right miniwave, and have everyone do it.
   setup qtag qtag        qualifier live num 2 right qtag_mwv
      array [CR1S    0 0 CR2S    0 CR4S CR7S 0]
   // Otherwise, the outsides don't move.
   setup qtag qtag        qualifier num 2 right wave_only
      array [ZM0N ZM1N 0 CR2S ZM4N ZM5N CR7S 0]
   setup pqtag qtag       qualifier num 2 right wave_only
      array [ZM0N ZM1N 0    0 ZM4N ZM5N    0 0]

   // Pick out the case of outsides in right miniwave, and have everyone do it.
   setup qtag qtag rotate  qualifier live num 3 right qtag_mwv
      array [CR7S 0 0 CR1S 0 CR2S CR4S 0]
   // Otherwise, the outsides don't move.
   setup qtag 2x4 rotate  qualifier num 3 right wave_only
      array [ZM7W ZM0W 0 CR2S ZM3W ZM4W CR5S 0]
   setup pqtag 2x4 rotate qualifier num 3 right wave_only
      array [ZM7W ZM0W 0 0 ZM3W ZM4W 0 0]

   setup qtag qtag     qualifier num 0 left wave_only
      array [ZM0N ZM1N ZM2N 0 ZM4N ZM5N 0 ZM7N]
   setup pqtag qtag    qualifier num 0 left wave_only
      array [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]
   setup qtag hrglass  qualifier num 1 left wave_only
      array [ZM0N ZM1N ZM2N 0 ZM4N ZM5N 0 CR3E]
   setup pqtag hrglass qualifier num 1 left wave_only
      array [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]
   setup qtag qtag     qualifier num 2 left wave_only
      array [ZM0N ZM1N ZM2N 0 ZM4N ZM5N 0 CR3S]
   setup pqtag qtag    qualifier num 2 left wave_only
      array [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]
   setup qtag hrglass  qualifier num 3 left wave_only
      array [ZM0N ZM1N ZM2N 0 ZM4N ZM5N 0 CR7W]
   setup pqtag hrglass qualifier num 3 left wave_only
      array [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]
   setup qtag qtag     qualifier num 4 left wave_only
      array [ZM0N ZM1N ZM2N 0 ZM4N ZM5N 0 CR7N]
   setup pqtag qtag    qualifier num 4 left wave_only
      array [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]

   setup galaxy 3x1dmd rotate qualifier num 1 right wave_only
      array [ZM7W CR1N ZM0W 0 ZM3W 0 ZM4W CR6N]
   setup galaxy galaxy qualifier num 2 right wave_only
      array [ZM0N CR3S ZM2N 0 ZM4N 0 ZM6N CR5S]
   setup galaxy 3x1dmd rotate qualifier num 3 right wave_only
      array [ZM7W CR2S ZM0W 0 ZM3W 0 ZM4W CR5S]

   setup dmd 1x4 qualifier num 1 right wave_only
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4 qualifier num 1 right wave_only
      array [0 CR3E 0 0]
   setup dmd dmd qualifier num 2 right wave_only
      array [ZM0N 0 ZM2N 0]
   setup pmd dmd qualifier num 2 right wave_only
      array [0 CR3S 0 0]
   setup dmd 1x4 qualifier num 3 right wave_only
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4 qualifier num 3 right wave_only
      array [0 CR1W 0 0]

   setup bigdmd hsqtag qualifier num 1 right magic_only
      array [CR0E 0 0 0 CR9E 0 0 CR7E 0 0 0 CR2E]
   setup pbigdmd hsqtag qualifier num 1 right magic_only
      array [0 0 0 CR5E 0 0 0 0 ZM10N 0 0 0]
   setup bigdmd 2x6 qualifier num 1 left magic_only
      array [0 ZM1N 0 0 0 ZM5N ZM6N 0 0 0 ZM10N 0]
   setup pbigdmd 2x6 qualifier num 1 left magic_only
      array [0 0 CR3E 0 0 0 0 0 0 CR8E 0 0]

   setup bigdmd bigdmd qualifier num 2 right magic_only
      array [CR1S 0 0 0 CR5S 0 0 CR6S 0 0 0 CR10S]
   setup pbigdmd bigdmd qualifier num 2 right magic_only
      array [0 0 0 CR9S 0 0 0 0 ZM8N 0 0 0]
   setup bigdmd bigdmd qualifier num 2 left magic_only
      array [0 ZM1N 0 0 0 ZM5N ZM6N 0 0 0 ZM10N 0]
   setup pbigdmd bigdmd qualifier num 2 left magic_only
      array [0 0 CR3S 0 0 0 0 0 0 CR8S 0 0]

   setup bigdmd hsqtag qualifier num 3 right magic_only
      array [CR1W 0 0 0 CR8W 0 0 CR6W 0 0 0 CR3W]
   setup pbigdmd hsqtag qualifier num 3 right magic_only
      array [0 0 0 CR11W 0 0 0 0 ZM10N 0 0 0]
   setup bigdmd 2x6 qualifier num 3 left magic_only
      array [0 ZM1N 0 0 0 ZM5N ZM6N 0 0 0 ZM10N 0]
   setup pbigdmd 2x6 qualifier num 3 left magic_only
      array [0 0 CR2W 0 0 0 0 0 0 CR9W 0 0]

   setup short6 1x6  rotate qualifier num 1 right dmd_ctrs_mwv
      array [CR1N 0 0 0 0 CR5N]
   setup pshort6 1x6 rotate qualifier num 1 right dmd_ctrs_mwv
      array [0 ZM0W 0 0 ZM3W 0]
   setup short6 short6      qualifier num 2 right dmd_ctrs_mwv
      array [CR2S 0 0 0 0 CR3S]
   setup pshort6 short6     qualifier num 2 right dmd_ctrs_mwv
      array [0 ZM1N 0 0 ZM4N 0]
   setup short6 1x6 rotate  qualifier num 3 right dmd_ctrs_mwv
      array [CR2S 0 0 0 0 CR4S]
   setup pshort6 1x6 rotate qualifier num 3 right dmd_ctrs_mwv
      array [0 ZM0W 0 0 ZM3W 0]

   // If called from a parallelogram of left-handed 1x4 waves, we
   // want only the center 2 of each wave to move.  If the end of the
   // live wave next to a phantom moved, the result would be a mess.
   // By rejecting this, other code will figure out the parallelogram
   // and turn it into parallelogram diamonds.
   setup 1x6 short6 rotate qualifier live num 1 left wave_only
      array [0 CR5N 0 ZM1W 0 CR0N]
   setup 1x6 1x6           qualifier live num 2 left wave_only
      array [0 CR2S 0 ZM3N 0 CR4S]
   setup 1x6 short6 rotate qualifier live num 3 left wave_only
      array [0 CR3S 0 ZM1W 0 CR2S]

   setup spindle 1x8 qualifier num 1 right dmd_ctrs_mwv
      array [0 0 0 ZM4N 0 0 0 ZM0N]
   setup spindle spindle qualifier num 2 right dmd_ctrs_mwv
      array [0 0 0 ZM3N 0 0 0 ZM7N]
   setup spindle 1x8 qualifier num 3 right dmd_ctrs_mwv
      array [0 0 0 ZM4N 0 0 0 ZM0N]
   setup pspindle 1x8 qualifier num 1 right dmd_ctrs_mwv
      array [CR3E CR6E CR5E 0 0 0 0 0]
   setup pspindle spindle qualifier num 2 right dmd_ctrs_mwv
      array [CR6S CR5S CR4S 0 0 0 0 0]
   setup pspindle 1x8 qualifier num 3 right dmd_ctrs_mwv
      array [CR1W CR2W CR7W 0 0 0 0 0]

   setup 3x2 1x6 qualifier num 1 right wave_only
      array [CR1E CR5E CR3E 0 0 0]
   setup 3x2 2x3 qualifier num 2 right wave_only
      array [CR5S CR4S CR3S 0 0 0]
   setup 3x2 1x6 qualifier num 3 right wave_only
      array [CR0W CR2W CR4W 0 0 0]

   setup 4x2 1x8 qualifier num 1 right wave_only
      array [CR1E CR2E CR7E CR4E 0 0 0 0]
   setup 4x2 2x4 qualifier num 2 right wave_only
      array [CR7S CR6S CR5S CR4S 0 0 0 0]
   setup 4x2 1x8 qualifier num 3 right wave_only
      array [CR0W CR3W CR6W CR5W 0 0 0 0]

   setup 4x2 rigger qualifier num 1 right magic_only
      array [CR7E 0 0 CR2E 0 ZM4N ZM5N 0]
   setup 4x2 2x4    qualifier num 2 right magic_only
      array [CR7S 0 0 CR4S 0 ZM5N ZM6N 0]
   setup 4x2 rigger qualifier num 3 right magic_only
      array [CR6W 0 0 CR3W 0 ZM4N ZM5N 0]

   setup 4x2 bone qualifier num 1 left magic_only
      array [0 CR7E CR2E 0 ZM4N 0 0 ZM5N]
   setup 4x2 2x4  qualifier num 2 left magic_only
      array [0 CR6S CR5S 0 ZM4N 0 0 ZM7N]
   setup 4x2 bone qualifier num 3 left magic_only
      array [0 CR6W CR3W 0 ZM4N 0 0 ZM5N]

   // Still need to do generous/stingy stuff below this.

   setup 4x4 thar qualifier num 1 occupied_as_o
      array [0 0 0 0 0 0 CR7E 0 0 0 0 0 0 CR2E 0 0]
   setup 4x4 4x4 qualifier num 2 occupied_as_o
      array [0 0 0 0 0 0 CR5S 0 0 0 0 0 0 CR14S 0 0]
   setup 4x4 thar qualifier num 3 occupied_as_o
      array [0 0 0 0 0 0 CR6W 0 0 0 0 0 0 CR3W 0 0]

   setup alamo thar qualifier num 1 none
      array [CR2E 0 0 0 0 CR7E 0 0]
   setup alamo alamo qualifier num 2 none
      array [CR1S 0 0 0 0 CR4S 0 0]
   setup alamo thar qualifier num 3 none
      array [CR3W 0 0 0 0 CR6W 0 0]

   setup thar 4x4 qualifier num 1 right wave_only
      array [CR10E 0 0 0 0 CR1E 0 0]
   setup thar thar qualifier num 2 right wave_only
      array [CR1S 0 0 0 0 CR4S 0 0]
   setup thar 4x4 qualifier num 3 right wave_only
      array [CR9W 0 0 0 0 CR2W 0 0]

   setup thar thar qualifier num 1 left wave_only
      array [0 CR3E 0 0 ZM4N 0 0 0]
   setup thar thar qualifier num 2 left wave_only
      array [0 CR5S 0 0 ZM4N 0 0 0]
   setup thar thar qualifier num 3 left wave_only
      array [0 CR7W 0 0 ZM4N 0 0 0]

   setup crosswave hrglass  rotate qualifier num 1 right magic_only
      array [CR5N 0 0 0 0 CR0N 0 0]
   setup pcrosswave hrglass rotate qualifier num 1 right magic_only
      array [0 0 0 CR3N 0 0 ZM2W 0]
   setup crosswave crosswave       qualifier num 2 right magic_only
      array [CR1S 0 0 0 0 CR4S 0 0]
   setup pcrosswave crosswave      qualifier num 2 right magic_only
      array [0 0 0 CR7S 0 0 ZM6N 0]
   setup crosswave hrglass  rotate qualifier num 3 right magic_only
      array [CR4S 0 0 0 0 CR1S 0 0]
   setup pcrosswave hrglass rotate qualifier num 3 right magic_only
      array [0 0 0 CR7S 0 0 ZM2W 0]

   setup 3x1dmd qtag rotate  qualifier num 1 right wave_only
      array [CR5N 0 CR7N 0 0 CR0N 0 0]
   setup p3x1dmd qtag rotate qualifier num 1 none
      array [0 0 0 ZM6W 0 0 0 ZM2W]
   setup 3x1dmd 3x1dmd       qualifier num 2 right wave_only
      array [CR1S 0 CR6S 0 0 CR4S 0 0]
   setup p3x1dmd 3x1dmd      qualifier num 2 none
      array [0 0 0 ZM3N 0 0 0 ZM7N]
   setup 3x1dmd qtag rotate  qualifier num 3 right wave_only
      array [CR4S 0 CR3S 0 0 CR1S 0 0]
   setup p3x1dmd qtag rotate qualifier num 3 none
      array [0 0 0 ZM6W 0 0 0 ZM2W]

   // Still need to do num=2 stuff below this.

   setup 2x1dmd short6 qualifier num 1 right wave_only
      array [CR0E 0 0 0 CR2E 0]
   setup 2x1dmd short6 qualifier num 3 right wave_only
      array [CR5W 0 0 0 CR3W 0]
   setup p2x1dmd short6 qualifier num 1 right wave_only
      array [0 0 ZM1N 0 0 ZM4N]
   setup p2x1dmd short6 qualifier num 3 right wave_only
      array [0 0 ZM1N 0 0 ZM4N]
   setup 2x1dmd 2x1dmd rotate qualifier num 1 left wave_only
      array [ZM5W CR1N 0 CR2W 0 0]
   setup 2x1dmd 2x1dmd rotate qualifier num 3 left wave_only
      array [ZM5W CR4S 0 CR2W 0 0]
   setup p2x1dmd 2x1dmd rotate qualifier num 1 left wave_only
      array [0 0 ZM0W 0 0 ZM3W]
   setup p2x1dmd 2x1dmd rotate qualifier num 3 left wave_only
      array [0 0 ZM0W 0 0 ZM3W]

   setup hrglass qtag qualifier num 1 none
      array [ZM0N ZM1N ZM2N 0 ZM4N ZM5N ZM6N 0]
   setup hrglass qtag qualifier num 3 none
      array [ZM0N ZM1N ZM2N 0 ZM4N ZM5N ZM6N 0]
   setup phrglass qtag qualifier num 1 none
      array [ZM0N ZM1N ZM2N CR3E ZM4N ZM5N ZM6N 0]
   setup phrglass qtag qualifier num 3 none
      array [ZM0N ZM1N ZM2N CR7W ZM4N ZM5N ZM6N 0]

   setup pdhrglass 1x3dmd qualifier num 1 none
      array [CR1E CR4E 0 0 0 0 0 0]
   setup pdhrglass 1x3dmd qualifier num 3 none
      array [CR0W CR5W 0 0 0 0 0 0]

   setup wqtag 3x4 rotate qualifier num 1 right dmd_ctrs_mwv
      array [ZM9W ZM0W 0 CR1N 0 ZM3W ZM6W CR8N 0    CR11N]
   setup wqtag 3x4 rotate qualifier num 3 right dmd_ctrs_mwv
      array [ZM9W ZM0W 0 CR2S 0 ZM3W ZM6W CR7S 0    CR5S]
   setup pwqtag 3x4 rotate qualifier right dmd_ctrs_mwv
      array [ZM9W ZM0W 0 0    0 ZM3W ZM6W 0    0    0]
   setup wqtag deep2x1dmd rotate qualifier num 1 left dmd_ctrs_mwv
      array [ZM9W ZM0W ZM2W 0 CR1N ZM4W ZM5W 0    CR8N 0]
   setup wqtag deep2x1dmd rotate qualifier num 3 left dmd_ctrs_mwv
      array [ZM9W ZM0W ZM2W 0 CR3S ZM4W ZM5W 0    CR6S 0]
   setup pwqtag deep2x1dmd rotate qualifier left dmd_ctrs_mwv
      array [ZM9W ZM0W ZM2W 0 0    ZM4W ZM5W 0    0    0]

   setup deep2x1dmd wqtag rotate qualifier num 1 left dmd_ctrs_mwv
      array [0 CR8N 0 0 ZM0W ZM1W 0 0 CR4N 0]
   setup deep2x1dmd wqtag rotate qualifier num 3 left dmd_ctrs_mwv
      array [0 CR9S 0 0 ZM0W ZM1W 0 0 CR3S 0]
   setup pdeep2x1dmd wqtag rotate qualifier left dmd_ctrs_mwv
      array [0 0 ZM7W 0 0 0 0 ZM2W 0 0]

   setup trngl 1x3 rotate qualifier num 1 right dmd_ctrs_mwv
      array [0 CR0N 0 0 0 CR1N]
   setup trngl 1x3 rotate qualifier num 3 right dmd_ctrs_mwv
      array [0 CR1S 0 0 0 CR2S]
   setup ptrngl 1x3 rotate qualifier num 1 none
      array [ZM2W 0 0 0 0 0]
   setup ptrngl 1x3 rotate qualifier num 3 none
      array [ZM2W 0 0 0 0 0]

   // Require the "tail" people to be in a left miniwave.
   setup trngl4 1x4 rotate qualifier num 1 none
      array [0 0 CR0N 0 0 0 0 CR3N]
   setup trngl4 1x4 rotate qualifier num 3 none
      array [0 0 CR1S 0 0 0 0 CR2S]
   setup ptrngl4 1x4 rotate qualifier num 1 none
      array [ZM2W 0 0 0 0 ZM1W 0 0]
   setup ptrngl4 1x4 rotate qualifier num 3 none
      array [ZM2W 0 0 0 0 ZM1W 0 0]

            alternate_definition [half] c1
   setup 2x4 qtag plus_eighth_rotation qualifier num 1 right wave_only
      array [CR6N 0 CR0N 0 0 CR3N 0 CR5N]
   setup 2x4 qtag rotate plus_eighth_rotation qualifier num 3 right wave_only
      array [CR5N 0 CR6N 0 0 CR0N 0 CR3N]
   setup qtag 2x4 rotate plus_eighth_rotation qualifier num 3 right wave_only
      array [CR7N 0 0 CR0N 0 CR2N CR5N 0]
   setup qtag 2x4 plus_eighth_rotation qualifier num 1 right wave_only
      array [CR0N 0 0 CR2N 0 CR5N CR7N 0]

   setup c1phan thar plus_eighth_rotation qualifier num 1 none
      array [CR0N 0 CR1S 0 0 0 0 0 CR4S 0 CR5N 0 0 0 0 0]

            alternate_definition [lasthalf] c1
   setup 2x4 qtag plus_eighth_rotation qualifier num 1 right wave_only
      array [CR6N 0 CR0N 0 0 CR3N 0 CR5N]
   setup 2x4 qtag rotate plus_eighth_rotation qualifier num 3 right wave_only
      array [CR5N 0 CR6N 0 0 CR0N 0 CR3N]

   setup qtag 2x4 rotate plus_eighth_rotation qualifier num 3 right wave_only
      array [CR7N 0 0 CR0N 0 CR2N CR5N 0]
   setup qtag 2x4 plus_eighth_rotation qualifier num 1 right wave_only
      array [CR0N 0 0 CR2N 0 CR5N CR7N 0]

            alternate_definition [diamond] c3a
   setup dmd dmd restriction nice_diamonds qualifier num 1 none
      array [CR1E 0 0 0]
   setup dmd dmd restriction nice_diamonds qualifier num 3 none
      array [CR3W 0 0 0]
   setup pmd dmd qualifier num 1 none
      array [0 CR2E 0 0]
   setup pmd dmd qualifier num 3 none
      array [0 CR0W 0 0]

   setup qtag qtag restriction nice_diamonds qualifier num 1 none
      array [0 0 0 CR1E 0 0 CR0E 0]
   setup qtag qtag restriction nice_diamonds qualifier num 3 none
      array [0 0 0 CR4W 0 0 CR5W 0]
   setup pqtag qtag qualifier num 1 none
      array [CR7E CR2E 0 0 0 0 0 0]
   setup pqtag qtag qualifier num 3 none
      array [CR6W CR3W 0 0 0 0 0 0]
   setup dhrglass dhrglass qualifier num 1 none
      array [0 0 0 0 0 0 CR3E 0]
   setup dhrglass dhrglass qualifier num 3 none
      array [0 0 0 0 0 0 CR7W 0]
   setup pdhrglass dhrglass qualifier num 1 none
      array [0 0 0 CR2E 0 0 0 0]
   setup pdhrglass dhrglass qualifier num 3 none
      array [0 0 0 CR6W 0 0 0 0]
            alternate_definition [diamond grand] c3a
   setup dmd dmd restriction nice_diamonds qualifier num 1 none
      array [CR1E 0 0 0]
   setup dmd dmd restriction nice_diamonds qualifier num 3 none
      array [CR3W 0 0 0]
   setup pmd dmd qualifier num 1 none
      array [0 CR2E 0 0]
   setup pmd dmd qualifier num 3 none
      array [0 CR0W 0 0]

   setup qtag qtag restriction nice_diamonds qualifier num 1 none
      array [0 0 0 CR1E 0 0 CR0E 0]
   setup qtag qtag restriction nice_diamonds qualifier num 3 none
      array [0 0 0 CR4W 0 0 CR5W 0]
   setup pqtag qtag qualifier num 1 none
      array [CR7E CR2E 0 0 0 0 0 0]
   setup pqtag qtag qualifier num 3 none
      array [CR6W CR3W 0 0 0 0 0 0]
   setup dhrglass dhrglass qualifier num 1 none
      array [0 0 0 0 0 0 CR3E 0]
   setup dhrglass dhrglass qualifier num 3 none
      array [0 0 0 0 0 0 CR7W 0]
   setup pdhrglass dhrglass qualifier num 1 none
      array [0 0 0 CR2E 0 0 0 0]
   setup pdhrglass dhrglass qualifier num 3 none
      array [0 0 0 CR6W 0 0 0 0]
            alternate_definition [grand] a1
   // There's a lot of stuff in here, because "grand" now gets inherited to all parts,
   // which, on a normal 1/4 thru or remake, wouldn't be needed, since it's the "half
   // by the left" that "grand" generally applies to.  But it seems that, to do really
   // esoteric cases, the "1/4 by the right" needs to see that flag too.
   //
   // By the way, there was a time, long ago, when I would have been concerned about
   // having such a large calls database.  But nowadays, any computer that can run Windows
   // can load the database a thousand times over.

   // **** Really need a handedness qualifier for 1x3dmd.  As it is now, we only handle
   // the "left-handed" case.  That should be OK, since this only comes up in a grand remake
   // from facing point-to-point diamonds that will give the requisite handedness.

   setup 1x8 spindle qualifier num 1 left wave_only
      array [0 CR0E CR1E 0 ZM3N 0 0 CR2E]
   setup 1x8 spindle qualifier num 3 left wave_only
      array [0 CR6W CR5W 0 ZM3N 0 0 CR4W]

   setup 1x3dmd  ptpd qualifier num 3 none
      array [0 CR3W 0 0 ZM4N 0 CR5W 0]
   setup p1x3dmd ptpd qualifier num 3 none
      array [0 0 0 CR2W 0 0 0 0]

   setup 3x2 1x6 qualifier num 1 right wave_only
      array [CR1E CR5E CR3E 0 0 0]
   setup 3x2 2x3 qualifier num 2 right wave_only
      array [CR5S CR4S CR3S 0 0 0]
   setup 3x2 1x6 qualifier num 3 right wave_only
      array [CR0W CR2W CR4W 0 0 0]

   setup 4x2 1x8 qualifier num 1 right wave_only
      array [CR1E CR2E CR7E CR4E 0 0 0 0]
   setup 4x2 2x4 qualifier num 2 right wave_only
      array [CR7S CR6S CR5S CR4S 0 0 0 0]
   setup 4x2 1x8 qualifier num 3 right wave_only
      array [CR0W CR3W CR6W CR5W 0 0 0 0]

   setup 2x2 1x4 rotate qualifier num 1 right wave_only
      array [CR0N 0 0 CR3N]
   setup 2x2 2x2 qualifier num 2 right wave_only
      array [CR1S 0 0 CR2S]
   setup 2x2 1x4 rotate qualifier num 3 right wave_only
      array [CR1S 0 0 CR2S]

   setup spindle 1x8 qualifier num 1 right dmd_ctrs_mwv
      array [0 0 0 ZM4N 0 0 0 ZM0N]
   setup spindle spindle qualifier num 2 right dmd_ctrs_mwv
      array [0 0 0 ZM3N 0 0 0 ZM7N]
   setup spindle 1x8 qualifier num 3 right dmd_ctrs_mwv
      array [0 0 0 ZM4N 0 0 0 ZM0N]
   setup pspindle 1x8 qualifier num 1 right dmd_ctrs_mwv
      array [CR3E CR6E CR5E 0 0 0 0 0]
   setup pspindle spindle qualifier num 2 right dmd_ctrs_mwv
      array [CR6S CR5S CR4S 0 0 0 0 0]
   setup pspindle 1x8 qualifier num 3 right dmd_ctrs_mwv
      array [CR1W CR2W CR7W 0 0 0 0 0]
   setup 1x8 spindle qualifier num 1 left wave_only
      array [0 CR0E CR1E 0 ZM3N 0 0 CR2E]
   setup 1x8 spindle qualifier num 3 left wave_only
      array [0 CR6W CR5W 0 ZM3N 0 0 CR4W]

   setup ptpd 1x3dmd  qualifier num 1 left dmd_facing
      array [0 0 CR3E 0 ZM4N 0 0 0]
   setup pptpd 1x3dmd qualifier num 1 left dmd_facing
      array [0 CR2E 0 0 0 0 0 CR5E]
   setup ptpd ptpd    qualifier num 2 left dmd_facing
      array [0 0 CR6S 0 ZM4N 0 0 0]
   setup pptpd ptpd   qualifier num 2 left dmd_facing
      array [0 CR3S 0 0 0 0 0 CR5S]
   setup ptpd 1x3dmd  qualifier num 3 left dmd_facing
      array [0 0 CR7W 0 ZM4N 0 0 0]
   setup pptpd 1x3dmd qualifier num 3 left dmd_facing
      array [0 CR1W 0 0 0 0 0 CR6W]
   setup 1x8 1x8 qualifier num 2 left wave_only
      array [0 CR3S CR6S 0 ZM4N 0 0 CR5S]   // Cross the center line.

   // Still need to be able to do these when "grand" is given.


// try these ....
   setup dmd 1x4 qualifier num 1 right wave_only
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4 qualifier num 1 right wave_only
      array [0 CR3E 0 0]
   setup dmd dmd qualifier num 2 right wave_only
      array [ZM0N 0 ZM2N 0]
   setup pmd dmd qualifier num 2 right wave_only
      array [0 CR3S 0 0]
   setup dmd 1x4 qualifier num 3 right wave_only
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4 qualifier num 3 right wave_only
      array [0 CR1W 0 0]
   setup short6 1x6  rotate qualifier num 1 right dmd_ctrs_mwv
      array [CR1N 0 0 0 0 CR5N]
   setup pshort6 1x6 rotate qualifier num 1 right dmd_ctrs_mwv
      array [0 ZM0W 0 0 ZM3W 0]
   setup short6 short6      qualifier num 2 right dmd_ctrs_mwv
      array [CR2S 0 0 0 0 CR3S]
   setup pshort6 short6     qualifier num 2 right dmd_ctrs_mwv
      array [0 ZM1N 0 0 ZM4N 0]
   setup short6 1x6 rotate  qualifier num 3 right dmd_ctrs_mwv
      array [CR2S 0 0 0 0 CR4S]
   setup pshort6 1x6 rotate qualifier num 3 right dmd_ctrs_mwv
      array [0 ZM0W 0 0 ZM3W 0]

   setup 1x6 short6 rotate qualifier num 1 left wave_only
      array [0 CR5N 0 ZM1W 0 CR0N]
   setup 1x6 1x6           qualifier num 2 left wave_only
      array [0 CR2S 0 ZM3N 0 CR4S]
   setup 1x6 short6 rotate qualifier num 3 left wave_only
      array [0 CR3S 0 ZM1W 0 CR2S]

   setup 1x2 1x2 qualifier num 0 right wave_only
      array [ZM0N 0]
   setup 1x2 1x2 rotate qualifier num 1 right wave_only
      array [CR0N 0]
   setup 1x2 1x2 qualifier num 2 right wave_only
      array [CR1S 0]
   setup 1x2 1x2 rotate qualifier num 3 right wave_only
      array [CR1S 0]
   setup 1x2 1x2 qualifier num 4 right wave_only
      array [ZM0N 0]

call "_ @B by the right for about" dontshow tag odd_frac_by_right_for_about
            left_means_mirror neednumber
   setup 2x2 1x4 rotate restriction forbidden wave_only qualifier num 1 right wave_only
      array [CR0N 0 0 CR3N]
   setup 2x2 1x4 rotate restriction forbidden wave_only qualifier num 3 right wave_only
      array [CR1S 0 0 CR2S]

call "_ 1/8 by the right" dontshow tag 1_8_by_right
            left_means_mirror
   setup 1x2 1x2 plus_eighth_rotation restriction forbidden wave_only
      array [CR0N 0]

call "_turn by the right @9 eighths" dontshow tag turn_by_right_by_eighths
            neednumber visible_fractions distribute_repetitions left_means_mirror
   seq 1_8_by_right [inherit_left repeat_n]

call "_half by the right" dontshow tag 1_2_by_right
            left_means_mirror diamond_is_legal
   setup 1x3 1x3 restriction forbidden wave_only
      array [CR1S CR2S ZM2N]
   setup 1x2 1x2 restriction forbidden wave_only
      array [CR1S 0]
   setup 1x4 1x4 restriction forbidden wave_only
      array [CR1S CR3S ZM2N CR2S]
   setup 1x4 1x4 qualifier live right 2fl_only restriction unusual alwaysfail
      array [ZM0N CR3S 0 0]
   // This is here for the case of a 1/4 thru in triangles or swing thru in a wave of 6.
   // We need to be sure this part is done in each 1x3, not crossing the center.
   setup 1x6 1x6 qualifier wave_only restriction each_1x3 alwaysfail
      array [CR1S CR2S ZM2N ZM3N CR3S CR4S]
   setup qtag qtag qualifier left qtag_mag_mwv
      array [CR1S ZM1N ZM2N CR2S ZM4N CR4S CR7S CR3S]
   setup qtag qtag qualifier right qtag_mag_mwv
      array [CR1S ZM1N ZM2N CR2S ZM4N CR4S CR7S CR3S]
   // This one takes the case of diamonds.
   setup qtag qtag restriction forbidden wave_only
      array [0 0 ZM2N CR2S 0 0 CR7S CR3S]
   setup pqtag qtag
      array [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]

   setup 4x4 4x4 qualifier occupied_as_o
      array [0 0 0 0 0 CR2E CR5S 0 0 0 0 0 0 CR14S CR1W 0]

   setup 4x4 4x4
      predscantdo
         if can_swing_right [0     0    0    CR1S 0    CR4S CR5S CR2S CR6S CR11S CR15S CR7S  CR13S CR14S CR0S  CR3S]
         if always          [ZM0N  ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N  ZM10N ZM11N ZM12N ZM13N ZM14N ZM15N]

   // See the note below, addressing the same issue.  Search for "or other things of that ilk".

   setup 2x6 2x6 qualifier didnt_say_matrix
      predscantdo
         if can_swing_right [CR1S CR2S CR3S CR4S CR5S 0    0    CR6S CR7S CR8S CR9S  CR10S]
         if always          [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N ZM10N ZM11N]
   setup 2x8 2x8 qualifier didnt_say_matrix
      predscantdo
         if can_swing_right [CR1S CR2S CR3S CR4S CR5S CR6S CR7S 0    0     CR8S CR9S  CR10S CR11S CR12S CR13S CR14S]
         if always          [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N  ZM9N ZM10N ZM11N ZM12N ZM13N ZM14N ZM15N]

   setup alamo alamo
      array [CR1S CR2W 0 0 CR3E CR4S 0 0]
   setup thar thar restriction wave_only
      array [CR1S CR5S 0 0 ZM4N CR4S 0 0]
   setup bigdmd bigdmd qualifier right magic_only
      array [CR1S 0 0 0 CR5S 0 0 CR6S 0 0 0 CR10S]
   setup pbigdmd bigdmd qualifier right magic_only
      array [0 0 0 CR9S 0 0 0 0 ZM8N 0 0 0]
   setup bigdmd bigdmd qualifier left magic_only
      array [0 ZM1N 0 0 0 ZM5N ZM6N 0 0 0 ZM10N 0]
   setup pbigdmd bigdmd qualifier left magic_only
      array [0 0 CR3S 0 0 0 0 0 0 CR8S 0 0]
            alternate_definition [half] mainstream
   setup 1x4 2x2 qualifier right wave_only
      array [CR0E 0 0 CR1E]
   setup 2x2 1x4 rotate qualifier right wave_only
      array [CR0N 0 0 CR3N]
   setup 1x4 dmd qualifier left wave_only
      array [0 CR1E ZM2N 0]
   setup bone 2x4 qualifier left wave_only
      array [0 ZM3N 0 CR2E ZM4N 0 CR1E 0]
            alternate_definition [lasthalf] mainstream
   setup dmd 1x4 qualifier right wave_only
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4 qualifier right wave_only
      array [0 CR3E 0 0]
   setup 2x2 1x4 rotate qualifier right wave_only
      array [CR0N 0 0 CR3N]
   setup 1x4 2x2 qualifier right wave_only
      array [CR0E 0 0 CR1E]
   setup 1x4 dmd qualifier left wave_only
      array [0 CR1E ZM2N 0]
            alternate_definition [grand] plus
   setup 1x6 1x6 restriction wave_only
      array [CR1S CR2S CR5S ZM3N CR3S CR4S]
   setup 1x8 1x8 restriction wave_only
      array [CR1S CR3S CR6S CR2S ZM4N CR4S CR7S CR5S]
            alternate_definition [half grand] plus
   setup 1x6 2x3 qualifier right wave_only
      array [CR0E 0 CR1E 0 CR2E 0]
   setup 1x8 2x4 qualifier right wave_only
      array [CR0E 0 0 CR1E 0 CR3E CR2E 0]
   setup 1x6 short6 rotate qualifier left wave_only
      array [0 CR5N 0 ZM1W 0 CR0N]
   setup 1x8 spindle qualifier left wave_only
      array [0 CR0E CR1E 0 ZM3N 0 0 CR2E]
            alternate_definition [lasthalf grand] plus
   setup 1x6 2x3 qualifier right wave_only
      array [CR0E 0 CR1E 0 CR2E 0]
   setup 1x8 2x4 qualifier right wave_only
      array [CR0E 0 0 CR1E 0 CR3E CR2E 0]
   setup 1x6 short6 rotate qualifier left wave_only
      array [0 CR5N 0 ZM1W 0 CR0N]
   setup 1x8 spindle qualifier left wave_only
      array [0 CR0E CR1E 0 ZM3N 0 0 CR2E]
            alternate_definition [12matrix grand] c3a
   setup 1x12 1x12 restriction wave_only
      array [CR1S CR2S CR3S CR4S CR5S CR11S ZM6N CR6S CR7S CR8S CR9S CR10S]
   setup 2x6 2x6 restriction wave_only
      array [CR1S CR2S CR3S CR4S CR5S ZM5N ZM6N CR6S CR7S CR8S CR9S CR10S]
            alternate_definition [16matrix grand] c3a
   setup 1x16 1x16 restriction wave_only
      array [CR1S CR2S CR3S CR4S CR5S CR6S CR7S CR15S
             ZM8N CR8S CR9S CR10S CR11S CR12S CR13S CR14S]
   setup 2x8 2x8 restriction wave_only
      array [CR1S CR2S CR3S CR4S CR5S CR6S CR7S ZM7N
             ZM8N CR8S CR9S CR10S CR11S CR12S CR13S CR14S]
            alternate_definition [diamond] c3a
   setup qtag qtag restriction forbidden nice_diamonds
      array [0 0 ZM2N CR2S 0 0 CR7S CR3S]
   setup pqtag qtag restriction forbidden nice_diamonds
      array [CR5S CR4S 0 0 ZM4N ZM5N 0 0]
            alternate_definition [yoyo] c4
   setup 2x2 1x4 rotate qualifier right wave_only
      array [CR1S 0 0 CR2S]
   setup dmd 1x4 qualifier right wave_only
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4 qualifier right wave_only
      array [0 CR1W 0 0]
            alternate_definition [generous] c3
   setup 2x2 1x4 rotate qualifier right wave_only
      array [CR1S 0 0 CR2S]
   setup dmd 1x4 qualifier right wave_only
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4 qualifier right wave_only
      array [0 CR1W 0 0]
            alternate_definition [stingy] c3
   setup 2x2 1x4 rotate qualifier right wave_only
      array [CR0N 0 0 CR3N]
   setup 1x4 dmd qualifier left wave_only
      array [0 CR1E 0 ZM2N]
   setup dmd 1x4 qualifier right wave_only
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4 qualifier right wave_only
      array [0 CR3E 0 0]
            alternate_definition [grand yoyo] c4
   setup 3x2 1x6 qualifier right wave_only
      array [CR0W CR2W CR4W 0 0 0]
   setup 4x2 1x8 qualifier right wave_only
      array [CR0W CR3W CR6W CR5W 0 0 0 0]
            alternate_definition [grand generous] c3
   setup 3x2 1x6 qualifier right wave_only
      array [CR0W CR2W CR4W 0 0 0]
   setup 4x2 1x8 qualifier right wave_only
      array [CR0W CR3W CR6W CR5W 0 0 0 0]
            alternate_definition [grand stingy] c3
   setup 3x2 1x6 qualifier right wave_only
      array [CR1E CR3E CR5E 0 0 0]
   setup 4x2 1x8 qualifier right wave_only
      array [CR1E CR2E CR7E CR4E 0 0 0 0]

call "_half by the left with 12 matrix" dontshow tag 1_2_by_left_with_12_matrix
            left_means_mirror diamond_is_legal 12_16_matrix_means_split
   setup 1x4 1x4 qualifier wave_only
      preds "This person can't figure out whether to trade."
         if can_swing_left [ZM0N AL0S AL3S AL1S]
         if always         [ZM0N ZM1N ZM2N ZM3N]

call "_half by the left" dontshow tag 1_2_by_left
            left_means_mirror diamond_is_legal optional_special_number

   // These three clauses deal with the optional numeric argument.
   setup 1x2 1x2 rotate plus_eighth_rotation restriction forbidden wave_only qualifier num 1 none
      array [0 AL0S]
   setup 1x2 1x2 rotate                      restriction forbidden wave_only qualifier num 2 none
      array [0 AL0S]
   setup 1x2 1x2        plus_eighth_rotation restriction forbidden wave_only qualifier num 3 none
      array [0 AL0S]

   setup 1x3 1x3 restriction forbidden wave_only
      array [ZM0N AL0S AL1S]
   setup 1x2 1x2 restriction forbidden wave_only
      array [0 AL0S]
   setup 1x4 1x4 qualifier wave_only
      array [ZM0N AL0S AL3S AL1S]
   setup 1x4 1x4 qualifier live left 2fl_only restriction unusual alwaysfail
      array [0 0 ZM2N AL1S]
   setup 2x4 2x4 qualifier live tbone none restriction unusual alwaysfail
      array [ZM0N 0 0 0 0 0 0 ZM7N]
   setup 4x2 2x4 qualifier live tbone none restriction unusual alwaysfail
      array [0 0 0 0 0 AL2S AL1S 0]
   // This is here for the case of a 1/4 thru in triangles or swing thru in a wave of 6.
   // We need to be sure this part is done in each 1x3, not crossing the center.
   setup 1x6 1x6 qualifier wave_only restriction each_1x3 alwaysfail
      array [ZM0N AL0S AL1S AL4S AL5S ZM5N]
   setup qtag qtag qualifier right qtag_mag_mwv
      array [ZM0N AL0S AL3S AL7S AL5S ZM5N ZM6N AL6S]
   setup qtag qtag qualifier left qtag_mag_mwv
      array [ZM0N AL0S AL3S AL7S AL5S ZM5N ZM6N AL6S]
   // This one takes the case of diamonds.
   setup qtag qtag restriction forbidden wave_only
      array [0 0 AL3S AL7S 0 0 ZM6N AL6S]
   setup pqtag qtag
      array [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]

   setup 4x4 4x4 qualifier occupied_as_o
      array [0 0 0 0 0 AL6S AL9W 0 0 0 0 0 0 AL10E AL13S 0]

   setup 4x4 4x4
      predscantdo
         if can_swing_left [AL14S AL3S AL7S AL15S AL5S AL6S AL8S AL11S 0    0    0     AL9S  0     AL12S AL13S AL10S]
         if always         [ZM0N  ZM1N ZM2N ZM3N  ZM4N ZM5N ZM6N ZM7N  ZM8N ZM9N ZM10N ZM11N ZM12N ZM13N ZM14N ZM15N]

/* Just what "2x8 matrix swing thru" or "phantom waves of 8 swing thru" means is very complex.  See t13t and t61t.

   On the 2x8 matrix swing thru, CMD_MISC__PHANTOMS and CMD_MISC__EXPLICIT_MATRIX are on, and we want these clauses
   out, to satisfy t61t.

   So if user said some kind of "matrix" thing, as in "2x8 matrix swing thru" in a 2x8 (with phantoms of course),
   we are not doing the "find live people wherever they are and have them do it" operation.  We are doing a
   strict positional thing, including swinging right or left with phantoms.

   But if the user wants the 4th part of "swing the fractions" in traps in a 2x8, those bits are off,
   and we want these clauses *in*, to satisfy t13t.

   So if the user is doing some kind of esoteric "swing the fractions" (or other things of that ilk), we search
   for people who can trade with live people, wherever they are found, but don't trade with phantoms.

   Also see the note above, addressing the same issue.  Search for "or other things of that ilk".
*/

   setup 2x6 2x6 qualifier didnt_say_matrix
      predscantdo
         if can_swing_left [0    AL0S AL1S AL2S AL3S AL4S AL7S AL8S AL9S AL10S AL11S 0]
         if always         [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N  ZM9N ZM10N ZM11N]
   setup 2x8 2x8 qualifier didnt_say_matrix
      predscantdo
         if can_swing_left [0    AL0S AL1S AL2S AL3S AL4S AL5S AL6S AL9S AL10S AL11S AL12S AL13S AL14S AL15S 0]
         if always         [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N  ZM9N ZM10N ZM11N ZM12N ZM13N ZM14N ZM15N]

   setup 1x3dmd 1x3dmd
      predscantdo
         if can_swing_left [   0 AL0S AL1S 0 AL5S AL6S    0 0]
         if always         [ZM0N ZM1N ZM2N 0 ZM4N ZM5N ZM6N 0]
   setup p1x3dmd 1x3dmd
      predscantdo
         if can_swing_left [0 0 0    0 0 0 0 AL3S]
         if always         [0 0 0 ZM3N 0 0 0 ZM7N]
   setup 3x1dmd 3x1dmd qualifier wave_only
      array [ZM0N AL0S AL1S 0 AL5S AL6S AL2S 0]
   setup p3x1dmd 3x1dmd
      array [0 0 0 ZM3N 0 0 0 ZM7N]
   setup 2x1dmd 2x1dmd qualifier wave_only
      array [ZM0N AL0S 0 AL4S AL1S 0]
   setup p2x1dmd 2x1dmd
      array [0 0 ZM2N 0 0 ZM5N]
   setup deep2x1dmd deep2x1dmd
      preds "This person can't figure out whether to trade."
         if can_swing_left [0    AL0S 0    AL1S AL3S AL6S AL8S 0    AL9S 0]
         if always         [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N]
   setup pdeep2x1dmd deep2x1dmd
      preds "This person can't figure out whether to trade."
         if can_swing_left [0    0    ZM2N 0 0    AL4S AL3S ZM7N AL1S AL0S]
         if always         [ZM0N ZM1N ZM2N 0 ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N]
   setup wqtag wqtag
      preds "This person can't figure out whether to trade."
         if can_swing_left [ZM0N ZM1N AL3S AL4S AL9S ZM5N ZM6N ZM7N AL7S AL8S]
         if always         [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N]
   setup pwqtag wqtag
         array [ZM0N ZM1N ZM2N 0 ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N]
   setup alamo alamo
      array [AL7E AL0S 0 0 AL5S AL6W 0 0]
   setup thar thar restriction wave_only
      array [ZM0N AL0S 0 0 AL5S AL1S 0 0]
   setup bigdmd bigdmd qualifier right magic_only
      array [ZM0N 0 0 0 ZM4N 0 0 ZM7N 0 0 0 ZM11N]
   setup pbigdmd bigdmd qualifier right magic_only
      array [0 0 0 AL2S 0 0 0 0 AL9S 0 0 0]
   setup bigdmd bigdmd qualifier left magic_only
      array [0 AL0S 0 0 0 AL4S AL7S 0 0 0 AL11S 0]
   setup pbigdmd bigdmd qualifier left magic_only
      array [0 0 ZM2N 0 0 0 0 0 0 AL3S 0 0]

   setup 3dmd 3dmd
      predscantdo
         if can_swing_left [ZM0N ZM1N ZM2N AL4S AL5S AL11S ZM6N ZM7N ZM8N ZM9N AL9S  AL10S]
         if always         [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N  ZM6N ZM7N ZM8N ZM9N ZM10N ZM11N]
   setup p3dmd 3dmd
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N ZM10N ZM11N]

            alternate_definition [half] mainstream
   setup 1x4 2x2 qualifier left wave_only
      array [0 AL0W AL1W 0]
   setup 1x4 dmd qualifier right wave_only
      array [ZM0N 0 0 AL1W]
   setup 1x4 2stars qualifier magic_only
      array [ZM6N AL0W AL1W ZM3N]
   setup 2x2 1x4 rotate qualifier left wave_only
      array [0 AL0S AL3S 0]
   setup 2x4 2x4 qualifier live tbone none restriction unusual alwaysfail
      array [ZM0N 0 0 0 0 0 0 ZM7N]
   setup 4x2 bone qualifier live tbone none restriction unusual alwaysfail
      array [0 0 0 0 0 AL2W AL7W 0]
   setup qtag hrglass qualifier right dmd_ctrs_mwv
      array [0 0 0 AL3W 0 0 ZM6N 0]
   setup qtag 2x4 rotate qualifier left dmd_ctrs_mwv
      array [0 0 AL1S 0 0 0 0 AL6S]
   setup pqtag hrglass
      array [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]
            alternate_definition [lasthalf] mainstream
   setup dmd 1x4 qualifier left wave_only
      array [ZM0N 0 ZM2N 0]
   setup pmd 1x4 qualifier left wave_only
      array [0 0 0 AL3W]
   setup 2x4 2x4 qualifier live tbone none restriction unusual alwaysfail
      array [ZM0N 0 0 0 0 0 0 ZM7N]
   setup 4x2 bone qualifier live tbone none restriction unusual alwaysfail
      array [0 0 0 0 0 AL2W AL7W 0]
   setup 2x2 1x4 rotate qualifier left wave_only
      array [0 AL0S AL3S 0]
   setup 1x4 2x2 qualifier left wave_only
      array [0 AL0W AL1W 0]
   setup 1x4 dmd qualifier right wave_only
      array [ZM0N 0 0 AL1W]
   setup 1x4 2stars qualifier magic_only
      array [ZM6N AL0W AL1W ZM3N]
            alternate_definition [grand] plus

   // Yes, if "grand" is given, can still do this anywhere with left hands.
   // It's only when done from a right-hand tidal wave that things get special.
   setup 1x2 1x2 qualifier left wave_only
      array [0 AL0S]

   setup 1x6 1x6 qualifier wave_only
      array [ZM0N AL0S AL1S AL4S AL5S AL2S]
   setup 1x8 1x8 qualifier wave_only
      array [ZM0N AL0S AL3S AL1S AL5S AL7S AL2S AL6S]
   setup short6 short6
      array [ZM0N ZM1N AL0S AL5S ZM4N ZM5N]
   setup pshort6 short6
      array [0    ZM1N    0 AL2S ZM4N AL0S]
   setup dhrglass 1x3dmd
      array [0 0 0 0 0 0 AL1S 0]
   setup pdhrglass 1x3dmd
      array [0 0 0 ZM3N 0 0 0 0]
   setup 1x3dmd 1x3dmd
      preds "This person can't figure out whether to trade."
         if can_swing_left [   0 AL0S AL1S 0 AL5S AL6S    0 0]
         if always         [ZM0N ZM1N ZM2N 0 ZM4N ZM5N ZM6N 0]
   setup p1x3dmd 1x3dmd
      preds "This person can't figure out whether to trade."
         if can_swing_left [0 0 0    0 0 0 0 AL3S]
         if always         [0 0 0 ZM3N 0 0 0 ZM7N]
   setup 3x1dmd 3x1dmd qualifier wave_only
      array [ZM0N AL0S AL1S 0 AL5S AL6S AL2S 0]
   setup p3x1dmd 3x1dmd
      array [0 0 0 ZM3N 0 0 0 ZM7N]
   setup 2x1dmd 2x1dmd qualifier wave_only
      array [ZM0N AL0S 0 AL4S AL1S 0]
   setup p2x1dmd 2x1dmd
      array [0 0 ZM2N 0 0 ZM5N]
            alternate_definition [half grand] plus
   setup 1x6 2x3 qualifier left wave_only
      array [0 AL0W 0 AL2W 0 AL1W]
   setup 1x8 2x4 qualifier left wave_only
      array [0 AL0W AL1W 0 AL3W 0 0 AL2W]
   setup 1x6 short6 rotate qualifier right wave_only
      array [ZM4W 0 AL5S 0 AL0S 0]
   setup 1x8 spindle qualifier right wave_only
      array [ZM7N 0 0 AL0W 0 AL2W AL1W 0]
   setup 1x4 2x2 qualifier left wave_only
      array [0 AL0W AL1W 0]
   setup 1x4 dmd qualifier right wave_only
      array [AL0W 0 0 AL1W]
   setup 4x2 1x8 qualifier left wave_only
      array [0 0 0 0 AL4W AL7W AL2W AL1W]
   setup short6 1x6 rotate
      array [0    ZM0W AL1S AL5S ZM3W 0]
   setup pshort6 2x1dmd
      array [0    ZM2N 0    AL3W ZM5W AL1W]
            alternate_definition [lasthalf grand] plus
   setup 1x6 2x3 qualifier left wave_only
      array [0 AL0W 0 AL2W 0 AL1W]
   setup 1x8 2x4 qualifier left wave_only
      array [0 AL0W AL1W 0 AL3W 0 0 AL2W]
   setup 1x6 short6 rotate qualifier right wave_only
      array [ZM4W 0 AL5S 0 AL0S 0]
   setup 1x8 spindle qualifier right wave_only
      array [ZM7N 0 0 AL0W 0 AL2W AL1W 0]
   setup 1x4 2x2 qualifier left wave_only
      array [0 AL0W AL1W 0]
   setup 1x4 dmd qualifier right wave_only
      array [AL0W 0 0 AL1W]
   setup 4x2 1x8 qualifier left wave_only
      array [0 0 0 0 AL4W AL7W AL2W AL1W]
   setup short6 1x6 rotate
      array [0    ZM0W AL1S AL5S ZM3W 0]
   setup pshort6 2x1dmd
      array [0    ZM2N 0    AL3W ZM5W AL1W]
            alternate_definition [12matrix grand] c3a
   setup 1x12 1x12 restriction wave_only
      array [ZM0N AL0S AL1S AL2S AL3S AL4S AL7S AL8S AL9S AL10S AL11S AL5S]
   setup 2x6 2x6 restriction wave_only
      array [ZM0N AL0S AL1S AL2S AL3S AL4S AL7S AL8S AL9S AL10S AL11S ZM11N]
            alternate_definition [16matrix grand] c3a
   setup 1x16 1x16 restriction wave_only
      array [ZM0N AL0S AL1S AL2S AL3S AL4S AL5S AL6S
             AL9S AL10S AL11S AL12S AL13S AL14S AL15S AL7S]
   setup 2x8 2x8 restriction wave_only
      array [ZM0N AL0S AL1S AL2S AL3S AL4S AL5S AL6S
             AL9S AL10S AL11S AL12S AL13S AL14S AL15S ZM15N]
            alternate_definition [diamond] c3a
   setup qtag qtag restriction nice_diamonds
      array [0 0 AL3S AL7S 0 0 ZM6N AL6S]
   setup pqtag qtag
      array [ZM0N ZM1N 0 0 AL1S AL0S 0 0]
            alternate_definition [yoyo] c4
   setup 1x4 dmd qualifier right wave_only
      array [ZM0N 0 0 AL3E]
   setup 1x2 1x2 rotate qualifier left wave_only
      array [0 AL1N]
   setup 1x6 short6 rotate qualifier right wave_only
      array [ZM4W 0 AL3N 0 AL2N 0]
   setup 1x6 bone6 qualifier left wave_only
      array [0 AL4E 0 AL3E 0 ZM2N]
            alternate_definition [generous] c3
   setup 1x4 dmd qualifier right wave_only
      array [ZM0N 0 0 AL3E]
   setup 1x2 1x2 rotate qualifier left wave_only
      array [0 AL1N]
   setup 1x6 short6 rotate qualifier right wave_only
      array [ZM4W 0 AL3N 0 AL2N 0]
   setup 1x6 bone6 qualifier left wave_only
      array [0 AL4E 0 AL3E 0 ZM2N]
   setup qtag hrglass qualifier right dmd_ctrs_mwv
      array [0 0 0 AL7E 0 0 ZM6N 0]
   setup qtag 2x4 rotate qualifier left dmd_ctrs_mwv
      array [0 0 AL2N 0 0 0 0 AL5N]
   setup pqtag 2x4 rotate
      array [ZM7W ZM0W 0 0 ZM3W ZM4W 0 0]
            alternate_definition [stingy] c3
   setup 1x4 dmd qualifier right wave_only
      array [ZM0N 0 0 AL1W]
   setup 1x2 1x2 rotate qualifier left wave_only
      array [0 AL0S]
   setup 1x6 short6 rotate qualifier right wave_only
      array [ZM4W 0 AL5S 0 AL0S 0]
   setup 1x6 bone6 qualifier left wave_only
      array [0 AL0W 0 AL1W 0 ZM2N]
   setup qtag hrglass qualifier right dmd_ctrs_mwv
      array [0 0 0 AL3W 0 0 ZM6N 0]
   setup qtag 2x4 rotate qualifier left dmd_ctrs_mwv
      array [0 0 AL1S 0 0 0 0 AL6S]
   setup pqtag 2x4 rotate
      array [ZM7W ZM0W 0 0 ZM3W ZM4W 0 0]
            alternate_definition [grand yoyo] c4
   setup 1x6 short6 rotate qualifier right wave_only
      array [ZM4W 0 AL3N 0 AL2N 0]
   setup 1x6 2x3 qualifier left wave_only
      array [0 AL5E 0 AL3E 0 AL4E]
   setup 1x8 spindle qualifier right wave_only
      array [ZM7N 0 0 AL6E 0 AL4E AL5E 0]
   setup 1x8 2x4 qualifier left wave_only
      array [0 AL7E AL6E 0 AL4E 0 0 AL5E]
            alternate_definition [grand generous] c3
   setup 1x6 short6 rotate qualifier right wave_only
      array [ZM4W 0 AL3N 0 AL2N 0]
   setup 1x6 2x3 qualifier left wave_only
      array [0 AL5E 0 AL3E 0 AL4E]
   setup 1x8 spindle qualifier right wave_only
      array [ZM7N 0 0 AL6E 0 AL4E AL5E 0]
   setup 1x8 2x4 qualifier left wave_only
      array [0 AL7E AL6E 0 AL4E 0 0 AL5E]
            alternate_definition [grand stingy] c3
   setup 1x6 short6 rotate qualifier right wave_only
      array [ZM4W 0 AL5S 0 AL0S 0]
   setup 1x6 2x3 qualifier left wave_only
      array [0 AL0W 0 AL2W 0 AL1W]
   setup 1x8 spindle qualifier right wave_only
      array [ZM7N 0 0 AL0W 0 AL2W AL1W 0]
   setup 1x8 2x4 qualifier left wave_only
      array [0 AL0W AL1W 0 AL3W 0 0 AL2W]

call "@b of half by the left" dontshow tag n_4_of_half_left
            neednumber left_means_mirror
   setup 1x2 1x2 rotate plus_eighth_rotation restriction forbidden wave_only qualifier num 1 none
      array [0 AL0S]
   setup 1x2 1x2 rotate                      restriction forbidden wave_only qualifier num 2 none
      array [0 AL0S]
   setup 1x2 1x2        plus_eighth_rotation restriction forbidden wave_only qualifier num 3 none
      array [0 AL0S]

// This call is very special.  It can optionally be invoked with a numeric argument,
// which it interprets as a command to do N/4 of the call.  That is, to turn N/8 by the left.
call "_half by the left for swing the fractions" dontshow tag half_left_for_swing_fractions
            left_means_mirror diamond_is_legal optional_special_number

   // These three clauses deal with the optional numeric argument.
   setup 1x2 1x2 rotate plus_eighth_rotation restriction forbidden wave_only qualifier num 1 none
      array [0 AL0S]
   setup 1x2 1x2 rotate                      restriction forbidden wave_only qualifier num 2 none
      array [0 AL0S]
   setup 1x2 1x2        plus_eighth_rotation restriction forbidden wave_only qualifier num 3 none
      array [0 AL0S]

   // We have a few special definitions that have an implicit "grand" in them.
   setup 1x6 1x6 restriction wave_only
      array [ZM0N AL0S AL1S AL4S AL5S AL2S]
   setup 1x8 1x8 restriction wave_only
      array [ZM0N AL0S AL3S AL1S AL5S AL7S AL2S AL6S]
   setup dhrglass 1x3dmd
      array [0 0 0 0 0 0 AL1S 0]
   setup pdhrglass 1x3dmd
      array [0 0 0 ZM3N 0 0 0 0]
   setup 1x3dmd 1x3dmd
      array [ZM0N 0 0 0 0 AL6S 0 0]
   // Here's the "usual" definition.  Actually, we should demand that the
   // person trade with a live person for swing the fractions (though we
   // don't want that for 1/4 thru).  So we need lots of "can_swing_left"
   // stuff.
   // Can you say "inheritance"?
            left_means_mirror diamond_is_legal yoyo_is_inherited gen_sting_is_inherited
   seq 1_2_by_left [inherit_left inherit_yoyo inherit_gensting inherit_diamond]
   // And, if that fails, we tell it we have a 12 matrix.
   // On this one we will actually do the right thing with the "can_swing_left"
   // stuff.  See test vg14.
            left_means_mirror diamond_is_legal yoyo_is_inherited gen_sting_is_inherited
   seq 1_2_by_left_with_12_matrix [inherit_left inherit_yoyo inherit_gensting inherit_diamond force_12_matrix]

call "swing thru" mainstream
            step_to_wave left_means_mirror grand_is_inherited bigmatrix_is_inherited
            diamond_is_legal yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq 1_2_by_right [inherit_left inherit_grand inherit_bigmatrix
                    inherit_diamond inherit_yoyo inherit_gensting roll_transparent]
   seq 1_2_by_left  [inherit_left inherit_grand inherit_bigmatrix
                    inherit_diamond inherit_yoyo inherit_gensting roll_transparent]
            // Try again, allowing exquisite fractions.
            step_to_wave left_means_mirror grand_is_inherited bigmatrix_is_inherited
            yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq turn_by_right_by_eighths [inherit_left inherit_yoyo inherit_gensting insert_number 4]
   seq 1_2_by_left  [inherit_left inherit_grand inherit_bigmatrix
                    inherit_yoyo inherit_gensting roll_transparent]

call "any hand swing thru" mainstream
            dont_use_in_nice_resolve
            grand_is_inherited yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq swing [inherit_yoyo inherit_gensting]
   seq maybegrandslip_notc3 [inherit_grand inherit_yoyo inherit_gensting roll_transparent]

call "any hand grand swing thru" plus
            dont_use_in_nice_resolve
            yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq swing [inherit_yoyo inherit_gensting]
   seq maybegrandslip_notc3 [force_grand inherit_yoyo inherit_gensting roll_transparent]

// Quarter thru and three quarter thru.

call "@D thru" a1
            left_means_mirror neednumber visible_fractions
            grand_is_inherited yoyo_is_inherited gen_sting_is_inherited fractal_is_inherited diamond_is_legal
   seq odd_frac_by_right [inherit_left inherit_grand inherit_diamond inherit_gensting inherit_fractal]
   seq 1_2_by_left [inherit_left inherit_grand inherit_diamond inherit_yoyo inherit_gensting roll_transparent]

call "any hand @D thru" a1
            dont_use_in_nice_resolve
            neednumber yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   // Sorry; we can't fractionalize if in diamonds; it can't adequately remember what it
   // was doing.  We could add state information, and we actually did experiment with this,
   // but it's really not possible to handle things like complex cases of interlace,
   // as in test ng18t.  It would violate the "whatever that means" principle.
   setup qtag 2x4 rotate qualifier num 1 none
      predscantdo
         if lines_miniwave [0 0 ACR0N CAL0S 0 0 CAL7S ACR7N]
         if lines_couple   [0 0 CR3S  CAL0S 0 0 AL4N  ACR7N]
   setup qtag 2x4 rotate qualifier num 3 none
      predscantdo
         if lines_miniwave [0 0 AAACR3S CCCAL3N 0 0 CCCAL4N AAACR4S]
         if lines_couple   [0 0 CR0N    CCCAL3N 0 0 AL7S    AAACR4S]
   setup pqtag 2x4 rotate qualifier num 1 none
      array [CR6E CR1E 0 0 AL2E AL5E 0 0]
   setup pqtag 2x4 rotate qualifier num 3 none
      array [CR6E CR1E 0 0 AL2E AL5E 0 0]

   setup pmd 1x4 qualifier num 1 none
      predscantdo
         if lines_miniwave [0 CAL2W 0 ACR2E]
   setup pmd 1x4 qualifier num 3 none
      predscantdo
         if lines_miniwave [0 CCCAL0E 0 AAACR0W]
   setup dmd 1x4 qualifier num 1 none
      array [CR1S 0 AL3S 0]
   setup dmd 1x4 qualifier num 3 none
      array [CR1S 0 AL3S 0]


// ***** now do all the yoyo / fractal // gensting stuff


   // The main definition, not diamonds.
            dont_use_in_nice_resolve
            neednumber grand_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq cast_off_n4_odd [inherit_fractal inherit_gensting]
   seq maybegrandslip_notc3 [inherit_grand inherit_yoyo inherit_gensting roll_transparent]

call "any hand grand @D thru" a1
            dont_use_in_nice_resolve
            neednumber yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq cast_off_n4_odd [inherit_fractal inherit_gensting]
   seq maybegrandslip_notc3 [force_grand inherit_yoyo inherit_gensting roll_transparent]

call "remake" a2
            left_means_mirror grand_is_inherited diamond_is_legal visible_fractions
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq odd_frac_by_right [inherit_left inherit_grand inherit_diamond inherit_gensting inherit_fractal insert_number 1]
   seq 1_2_by_left [inherit_left inherit_grand inherit_diamond inherit_yoyo inherit_gensting]
   seq odd_frac_by_right [inherit_left inherit_grand inherit_diamond inherit_gensting inherit_fractal insert_number 3 roll_transparent]
            // Try again, allowing exquisite fractions (mostly.)
            left_means_mirror grand_is_inherited visible_fractions
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq turn_by_right_by_eighths [inherit_left inherit_grand inherit_yoyo inherit_gensting inherit_fractal insert_number 2]
   seq 1_2_by_left [inherit_left inherit_grand inherit_yoyo inherit_gensting]
   seq turn_by_right_by_eighths [inherit_left inherit_grand inherit_yoyo inherit_gensting inherit_fractal insert_number 6 roll_transparent]

call "remake the wave" a2
            // Actually, left should mean check, but "touch_or_check" isn't right.  Sigh.
            left_means_mirror grand_is_inherited visible_fractions
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq odd_frac_by_right [inherit_left inherit_gensting inherit_fractal insert_number 1]
   seq 1_2_by_left [inherit_left inherit_grand inherit_yoyo inherit_gensting]
   seq odd_frac_by_right [inherit_left inherit_gensting inherit_fractal insert_number 3 roll_transparent]
            // Try again, allowing exquisite fractions (mostly.)
            left_means_mirror grand_is_inherited visible_fractions
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq turn_by_right_by_eighths [inherit_left inherit_yoyo inherit_gensting inherit_fractal insert_number 2]
   seq 1_2_by_left [inherit_left inherit_grand inherit_yoyo inherit_gensting]
   seq turn_by_right_by_eighths [inherit_left inherit_yoyo inherit_gensting inherit_fractal insert_number 6]

call "remake the column" a2
            // Actually, left should mean check, but "touch_or_check" isn't right.  Sigh.
            grand_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            left_means_mirror visible_fractions
   seq armturn_n4 [inherit_fractal inherit_gensting insert_number 1]
   seq mustbegrandslip_notc3 [inherit_grand inherit_yoyo inherit_gensting]
   seq armturn_n4 [inherit_fractal inherit_gensting insert_number 3 roll_transparent]

call "any hand remake" a2
            dont_use_in_nice_resolve
   setup thar thar restriction forbidden miniwaves
      array [3W 2W 0 0 3E 2E 0 0]
   setup crosswave thar restriction forbidden miniwaves
      array [3W 2W 0 0 3E 2E 0 0]
   setup pcrosswave thar restriction forbidden miniwaves
      array [0 0 5W 4W 0 0 5E 4E]
            dont_use_in_nice_resolve
            grand_is_inherited yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq cast_off_n4_with_warn [inherit_gensting insert_number 1]
   seq maybegrandslip_notc3 [inherit_grand inherit_yoyo inherit_gensting]
   seq cast_off_n4_with_warn [inherit_gensting insert_number 3]

call "any hand grand remake" a2
            dont_use_in_nice_resolve
            yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq cast_off_n4_with_warn [inherit_gensting insert_number 1]
   seq maybegrandslip_notc3 [force_grand inherit_yoyo inherit_gensting]
   seq cast_off_n4_with_warn [inherit_gensting insert_number 3]

call "_any hand remake, start with turn @b" dontshow tag any_hand_remake_start_with_n
            // Actually, left should mean check, but "touch_or_check" isn't right.  Sigh.
            grand_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            left_means_mirror visible_fractions
   seq armturn_n4 [inherit_fractal inherit_gensting]
   seq maybegrandslip_notc3 [inherit_grand inherit_yoyo inherit_gensting]
   seq armturn_n4 [inherit_fractal inherit_gensting insert_number 3 roll_transparent]

call "_dmd ctrs arm turn @b" dontshow tag dmdctrsarmturn_n4
            neednumber yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited yoyo_fractal_numbers
   setup pmd dmd qualifier num 0 dmd_ctrs_mwv
      array [0 ZM1N 0 ZM3N]
   setup pmd 1x4 qualifier num 1 dmd_ctrs_mwv
      array [0 CR3E 0 AL3W]
   setup pmd dmd qualifier num 2 dmd_ctrs_mwv
      array [0 CR3S 0 AL1S]
   setup pmd 1x4 qualifier num 3 dmd_ctrs_mwv
      array [0 CR1W 0 AL1E]
   setup pmd dmd qualifier num 4 dmd_ctrs_mwv
      array [0 CR1N 0 AL3N]
   setup dmd 1x4
      array [ZM0N 0 ZM2N 0]

call "_dmd right ctrs arm turn @b" dontshow tag dmdrightctrsarmturn_n4
            left_means_mirror neednumber yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited yoyo_fractal_numbers
   setup pmd dmd qualifier num 0 dmd_ctrs_mwv
      array [0 ZM1N 0 0]
   setup pmd 1x4 qualifier num 1 dmd_ctrs_mwv
      array [0 CR3E 0 0]
   setup pmd dmd qualifier num 2 dmd_ctrs_mwv
      array [0 CR3S 0 0]
   setup pmd 1x4 qualifier num 3 dmd_ctrs_mwv
      array [0 CR1W 0 0]
   setup pmd dmd qualifier num 4 dmd_ctrs_mwv
      array [0 CR1N 0 0]
   setup dmd 1x4
      array [0 0 ZM2N 0]

call "_waves ctrs arm turn @b" dontshow tag wavectrsarmturn_n4
            neednumber yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited yoyo_fractal_numbers
   setup 1x4 1x4 qualifier num 0 wave_only
      array [ZM0N ZM1N ZM2N ZM3N]
   setup 1x4 dmd qualifier num 1 wave_only
      array [ZM0N CR1E ZM2N AL1W]
   setup 1x4 1x4 qualifier num 2 wave_only
      array [ZM0N CR3S ZM2N AL1S]
   setup 1x4 dmd qualifier num 3 wave_only
      array [ZM0N CR3W ZM2N AL3E]
   setup 1x4 1x4 qualifier num 4 wave_only
      array [ZM0N CR1N ZM2N AL3N]

call "_lines ctrs arm turn @b" dontshow tag linectrsarmturn_n4
            neednumber yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited yoyo_fractal_numbers
   setup 1x4 1x4 qualifier num 0 none
      array [ZM0N ZM1N ZM2N ZM3N]
   setup 1x4 dmd qualifier num 1 none
      array [ZM0N CR1E ZM2N AL1W]
   setup 1x4 1x4 qualifier num 2 none
      array [ZM0N CR3S ZM2N AL1S]
   setup 1x4 dmd qualifier num 3 none
      array [ZM0N CR3W ZM2N AL3E]
   setup 1x4 1x4 qualifier num 4 none
      array [ZM0N CR1N ZM2N AL3N]

call "remake the diamond" a2
            left_means_mirror visible_fractions yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq dmdrightctrsarmturn_n4 [inherit_left inherit_fractal inherit_gensting insert_number 1]
   seq 1_2_by_left [inherit_left inherit_yoyo inherit_gensting]
   seq odd_frac_by_right [inherit_left inherit_fractal inherit_gensting insert_number 3 roll_transparent]

call "any hand remake the diamond" a2
            visible_fractions fractal_is_inherited gen_sting_is_inherited
   seq dmdctrsarmturn_n4 [inherit_fractal inherit_gensting insert_number 1]
   seq trade []
   seq linectrsarmturn_n4 [inherit_fractal inherit_gensting insert_number 3 roll_transparent]

call "swing the fractions" c1
            left_means_mirror diamond_is_legal yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            visible_fractions
   seq odd_frac_by_right_for_swgfrac [inherit_left inherit_diamond
                                      inherit_gensting inherit_fractal insert_number 1]
   seq half_left_for_swing_fractions [inherit_left inherit_diamond
                                      inherit_yoyo inherit_gensting roll_transparent]
   seq odd_frac_by_right_for_swgfrac [inherit_left inherit_diamond
                                      inherit_gensting inherit_fractal insert_number 3 roll_transparent]
   seq half_left_for_swing_fractions [inherit_left inherit_diamond
                                      inherit_yoyo inherit_gensting roll_transparent]
   seq odd_frac_by_right_for_swgfrac [inherit_left inherit_diamond
                                      inherit_gensting inherit_fractal insert_number 1 roll_transparent]
            // Try again, allowing exquisite fractions (mostly.)
            left_means_mirror yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq turn_by_right_by_eighths [inherit_left inherit_yoyo inherit_gensting inherit_fractal insert_number 2]
   seq half_left_for_swing_fractions [inherit_left inherit_yoyo inherit_gensting roll_transparent]
   seq turn_by_right_by_eighths [inherit_left inherit_yoyo inherit_gensting inherit_fractal insert_number 6 roll_transparent]
   seq half_left_for_swing_fractions [inherit_left inherit_yoyo inherit_gensting roll_transparent]
   seq turn_by_right_by_eighths [inherit_left inherit_yoyo inherit_gensting inherit_fractal insert_number 2 roll_transparent]

call "swing the fractions 3/5" c1
            left_means_mirror diamond_is_legal yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            visible_fractions
   seq odd_frac_by_right [inherit_left inherit_diamond inherit_gensting inherit_fractal insert_number 1]
   seq half_left_for_swing_fractions [inherit_left inherit_yoyo inherit_gensting inherit_diamond roll_transparent]
   seq odd_frac_by_right [inherit_left inherit_diamond inherit_gensting inherit_fractal insert_number 3 roll_transparent]

call "swing the fractions 4/5" c1
            left_means_mirror diamond_is_legal yoyo_is_inherited gen_sting_is_inherited
            fractal_is_inherited visible_fractions
   seq odd_frac_by_right [inherit_left inherit_diamond inherit_gensting inherit_fractal insert_number 1]
   seq half_left_for_swing_fractions [inherit_left inherit_diamond inherit_yoyo inherit_gensting roll_transparent]
   seq odd_frac_by_right [inherit_left inherit_diamond inherit_gensting inherit_fractal insert_number 3 roll_transparent]
   seq half_left_for_swing_fractions [inherit_left inherit_diamond inherit_yoyo inherit_gensting roll_transparent]

call "any hand swing the fractions" c1
            dont_use_in_nice_resolve
   setup thar alamo qualifier miniwaves
      array [4S 0S 0 0 5S 1S 0 0]
            fractal_is_inherited visible_fractions
   seq cast_off_n4 [inherit_fractal insert_number 1]
   seq maybegrandslip_notc3 [roll_transparent]
   seq cast_off_n4 [inherit_fractal insert_number 3 roll_transparent]
   seq maybegrandslip_notc3 [roll_transparent]
   seq cast_off_n4 [inherit_fractal insert_number 1 roll_transparent]

// Quarter cross and three quarter cross.
// Quarter mix and three quarter mix.

call "@D cross" c4
            left_means_mirror neednumber grand_is_inherited bigmatrix_is_inherited visible_fractions
   seq odd_frac_by_right [inherit_left inherit_bigmatrix]
   seq ctrxrun_in_rw [inherit_left inherit_bigmatrix inherit_grand roll_transparent]

call "@D mix" c3a
            left_means_mirror neednumber visible_fractions
            grand_is_inherited bigmatrix_is_inherited yoyo_is_inherited gen_sting_is_inherited fractal_is_inherited
//   seq odd_frac_by_right_for_quartermix
   seq odd_frac_by_right [inherit_left inherit_grand inherit_gensting inherit_fractal]
   seq ctrrun [force_cross inherit_grand roll_transparent]
//   seq ctrxrun_in_rw [inherit_left inherit_bigmatrix inherit_grand roll_transparent]
   seq maybegrandslip_in_lw [inherit_left inherit_grand inherit_yoyo inherit_gensting roll_transparent]

call "any hand @D cross" c4a
            dont_use_in_nice_resolve neednumber grand_is_inherited
            fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq cast_off_n4_odd [inherit_fractal inherit_gensting]
   seq ctrrun [force_cross inherit_grand roll_transparent]

call "any hand @D mix" c3a
            dont_use_in_nice_resolve
            neednumber grand_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq cast_off_n4_odd [inherit_fractal inherit_gensting]
   seq ctrrun [force_cross inherit_grand roll_transparent roll_transparent]
   seq maybegrandslip [inherit_grand inherit_yoyo inherit_gensting roll_transparent]

call "any hand grand @D cross" c4a
            dont_use_in_nice_resolve neednumber fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq cast_off_n4_odd [inherit_fractal inherit_gensting]
   seq ctrrun [force_cross force_grand roll_transparent]

call "any hand grand @D mix" c3a
            dont_use_in_nice_resolve neednumber yoyo_is_inherited
            fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq cast_off_n4_odd [inherit_fractal inherit_gensting]
   seq ctrrun [force_cross force_grand roll_transparent]
   seq maybegrandslip [force_grand inherit_yoyo inherit_gensting roll_transparent]

call "_centers crossback/ends two o's" dontshow tag crossbackandtwoos
            magic_is_inherited rewind_is_inherited
   conc_o
      crossback [inherit_rewind]
      two_o_circs_for_frac [inherit_magic conc_force_otherway endscando]
            magic_is_inherited yoyo_is_inherited gen_sting_is_inherited rewind_is_inherited
   conc6p_or_normal
      crossback [inherit_rewind]
      two_o_circs [inherit_magic conc_force_otherway endscando]

call "_centers @m/ends two o's" dontshow tag anythingandtwoos
            magic_is_inherited
   conc_o nullsecond [mandatory_secondary_call]
          two_o_circs_for_frac [inherit_magic conc_force_otherway]

call "_start settle back" dontshow tag settle_back1
            fractal_is_inherited gen_sting_is_inherited rewind_is_inherited visible_fractions
   seq zoom [force_half inherit_rewind]
   seq hinge_with_warn [inherit_fractal inherit_gensting]

call "settle back" c4a
            fractal_is_inherited gen_sting_is_inherited rewind_is_inherited visible_fractions
   seq settle_back1 [inherit_fractal inherit_gensting inherit_rewind]
   seq crossbackandtwoos [inherit_rewind]

call "settle back but @m" c4a
            fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq settle_back1 [inherit_fractal inherit_gensting]
   seq anythingandtwoos []

call "short trip" c4a tag longtrip1
   setup 2x4 2x6
      preds "Don't know what to do."
         if lines_miniwave [M3S R3S L2S M2S M4N M6S M11S M1N]
         if lines_couple   [M3S M0S M5S M2S M4N M3N M2N  M1N]

call "_couple cross fold" dontshow tag weird_cross_fold
   // The people folding aren't the "ends" or "wings".  They are just
   // the only people who can fold and can't pass thru.  So we mark
   // it controversial.
   setup 2x4 4x4 qualifier couples_only restriction controversial alwaysfail
      array [CR14S CR0S AL12S AL13S 0 0 0 0]

call "finish a long trip" c4a tag longtrip2
   setup 2x6 2x4 rotate restriction couples_only
      array [CR7E CR0E 0 0 AL7E AL0E 0 0 ZM1W ZM6W 0 0]
   setup 6x2 2x4 rotate
      array [0 0 ZM1W 0 0 0 0 0 0 ZM2W 0 0]
   setup 2x4 2x4 rotate
      array [CR0E 0 0 AL7E 0 ZM1W ZM6W 0]
   setup 4x2 2x4 rotate
      array [0 ZM1W 0 0 0 0 ZM2W 0]
   setup 2x5 2x4 rotate
      array [CR7E CR0E 0 AL7E AL0E 0 0 0 0 0]
   setup 4x5 2x4 rotate
      array [0 0 0 0 0 AL0E AL7E 0 CR0E CR7E 0 0 0 0 0 0 0 0 0 0]
            alternate_definition [twisted] c4
   setup 2x6 qtag
      preds "Wings must be as a couple looking out."
         if lines_miniwave [   0    0 0 0    0    0 0 0 CR2E CR7E 0 0]
         if lines_couple   [CR0S CR1S 0 0 AL0S AL1S 0 0 CR2E CR7E 0 0]
   setup 6x2 qtag rotate
      array [0 0 CR7N 0 0 0 0 0 0 CR2N 0 0]
   setup 2x4 qtag
      array [CR1S 0 0 AL0S 0 CR2E CR7E 0]
   setup bigdmd 2x4 rotate
      array [CR7E CR0E 0 CR1N AL7E AL0E 0 0 CR2N 0 0 0]
   setup 4x5 2x4 rotate
      array [0 0 0 0 0 AL0E AL7E CR1N CR0E CR7E 0 0 CR2N 0 0 0 0 0 0 0]
   setup 4x2 bone rotate
      array [0 CR7N 0 0 0 0 CR2N 0]
            alternate_definition [single] c4
   setup 2x3 1x4 rotate
      array [CR0E 0 AL0E 0 ZM1W 0]
   // For very unusual setups, but we require some people in each group.
   select_those_facing_both_sets_live passthru [] weird_cross_fold []

call "long trip" c4a
            visible_fractions single_is_inherited twisted_is_inherited
   seq longtrip1 [inherit_single inherit_twisted normalize]   // The "single" and "twisted" are of course illegal here,
   seq longtrip2 [inherit_single inherit_twisted normalize]   // but legal here.

// This call is here because this particular case of "<atc> your neighbor" is
// legal at C1.  We put in all the singlefile/nxn decorations because, even at high
// levels, this call will be parsed in preference to the more general one.
call "chase your neighbor" c1
            visible_fractions left_means_mirror singlefile_is_inherited nxn_is_inherited
            bigmatrix_is_inherited revert_is_inherited
   seq chase_the_half_tag [inherit_left inherit_singlefile
                          inherit_nxn inherit_bigmatrix inherit_revert]
   seq neighbor [inherit_nxn]

call "_swap the top 1" dontshow tag swaptop1
            reverse_means_mirror left_means_mirror
   setup 2x2 dmd rotate
      array [0 0 ZM1W CR2S]
            alternate_definition [cross] c3
   setup 2x2 dmd rotate
      array [0 0 ZM3W CR2S]
            alternate_definition [singlefile] c4
   setup 4x1 dmd
      array [CR0W ZM3N 0 0]
            alternate_definition [singlefile cross] c4
   setup 4x1 dmd
      array [CR0W ZM1N 0 0]

call "swap the top" c3a
            reverse_means_mirror left_means_mirror singlefile_is_inherited cross_is_inherited
            fractal_is_inherited gen_sting_is_inherited
   seq swaptop1 [inherit_reverse inherit_left inherit_cross inherit_singlefile]
   seq ctrarmturn_n [force_single insert_number 3 inherit_gensting inherit_fractal]

call "star to a wave@S" c4a
             // Of course "reverse" means nothing of the kind.  It gets inherited to the 1st 2
             // parts, where it is illegal, and to the last part, where it means reverse flip
             // the diamond.  So you can say "finally reverse star to a wave".
             visible_fractions reverse_means_mirror left_means_mirror singlefile_is_inherited
   seq start_tagstar [inherit_reverse inherit_left inherit_singlefile]
   seq turndmdn [inherit_reverse or_secondary_call insert_number 2]
   seq flipdiamond [inherit_reverse]

call "travel thru" c3a
            rear_back_from_r_wave visible_fractions left_means_mirror
            single_is_inherited bigmatrix_is_inherited nxn_is_inherited
            twisted_is_inherited rewind_is_inherited funny_is_inherited
   seq passthru [inherit_left inherit_twisted inherit_bigmatrix inherit_funny]
   seq finishtravel [inherit_left inherit_single inherit_bigmatrix
                     inherit_rewind inherit_nxn inherit_funny]

call "_finish travel thru" dontshow tag finishtravel
            left_means_mirror
   setup 1x2 1x2 rotate restriction forbidden couples_only
      array [CR0N CR1N]
            alternate_definition [single] c4
   setup 1x1 1x1
      array [CR0E]
            alternate_definition [3x3] c4
   setup 1x3 1x3 rotate restriction forbidden 3x3couples_only
      array [CR0N CR1N CR2N]
            alternate_definition [4x4] c4
   setup 1x4 1x4 rotate restriction forbidden 4x4couples_only
      array [CR0N CR1N CR2N CR3N]
            alternate_definition [rewind] c4
   setup 1x2 1x2 rotate restriction forbidden all_facing_same
      array [AL1S AL0S]

call "revolve to a wave" c3
   setup 2x2 1x4 no_cutting_through
      array [CR2S CR3N ZM0N CR1S]
            alternate_definition [singlefile] c4
   setup 4x1 1x4 rotate
      array [ZM0W CR1E CR2E CR3W]

call "follow to a@I diamond" c3a
   setup 2x2 dmd really_want_diamond rotate restriction resolve_ok wave_only
      array [CM1E AM3E AM2N CM2S]
            alternate_definition [interlocked] c3
   setup 2x4 qtag restriction forbidden wave_only
      array [CM3S AM6S CM2S AM7S AM4E CM4W AM5E CM5W]
            alternate_definition [cross] c4
   setup 2x2 dmd really_want_diamond rotate restriction resolve_ok wave_only
      array [CM1E AM3E CM2S AM2N]
            alternate_definition [generous] c3
   setup 2x2 1x4 restriction resolve_ok wave_only
      array [AM3S CM1S AM2N CM0N]
            alternate_definition [stingy] c3
   setup 2x2 1x4 restriction resolve_ok wave_only
      array [AM3S CM1S AM0S CM2S]
            alternate_definition [interlocked scatter] c4
   setup 2x4 qtag restriction unusual wave_only
      array [CM2S CM7S AM3S AM6S AM4E CM4W AM5E CM5W]
            alternate_definition [scatter] c4
   setup 2x4 qtag qualifier ntbone none restriction forbidden wave_only
      array [CM2S CM3S AM7S AM6S AM4E CM4W AM5E CM5W]
   // If they are T-boned, we're a little more lenient.
   setup 2x4 qtag restriction unusual wave_only
      array [CM2S CM3S AM7S AM6S AM4E CM4W AM5E CM5W]
   setup 4x2 1x8
      array [CM0W 0 CM6W 0 0 AM6E 0 AM0E]
            alternate_definition [generous scatter] c4
   setup 2x4 1x8 qualifier ntbone none restriction forbidden wave_only
      array [CM5S CM7S AM3S AM1S AL4N CM6N AL2N CM0N]
   setup 2x4 qtag
      array [CM2S CM3S AM7S AM6S 0 0 0 0]
   setup 4x2 qtag
      array [CM0N 0 CM1N 0 0 AM4N 0 AM5N]
            alternate_definition [stingy scatter] c4
   setup 2x4 1x8 qualifier ntbone none restriction forbidden wave_only
      array [CM5S CM7S AM3S AM1S AL6S CM4S AL0S CM2S]
   setup 2x4 qtag
      array [CM2S CM3S AM7S AM6S 0 0 0 0]
   setup 4x2 qtag
      array [CM5S 0 CM4S 0 0 AM1S 0 AM0S]

call "criss cross follow to a diamond" c4
   setup 2x2 dmd really_want_diamond rotate restriction resolve_ok wave_only
      array [CM3E AM1E CM2S AM2N]

call "follow to an hourglass" c4a
   setup 2x4 hrglass restriction resolve_ok wave_only
      // I do not know what the turning action is for
      // the people who finish in the very center.
      // (I guess it's extend; quarter to handhold; hourglass circ?)
      // Setting it this way at least lets people do it 1/4 stable.
      array [C3E AM6S CM2S A3W AM4E CM4W AM5E CM5W]

call "@eright@f roll the" c4
            left_means_mirror
   setup 2x2 dmd rotate
      array [CR0N C1E 0 0]      // We say that the original belle can't roll.

call "_grand linear cycle but" dontshow tag gndlincyclebut
   setup 1x8 2x4
      array [M2E M6E L7E R7E M1W M5W R4W L4W]

call "_centers couple up" dontshow tag ctrscoupleup
   conc coupleup [or_anycall] nullcall []

call "grand linear cycle@7 but @8" c4a
   seq gndlincyclebut []
   seq ctrscoupleup []

call "trade/stepnfold" dontshow tag tradestpnfld
            visible_fractions
   seq trade [allow_forced_mod]
   seq stepnfold [allow_forced_mod]

call "roll the wave" c4
   setup 1x4 2x2
      predscantdo
         if lines_miniwave [AL3E AL3E CR2W CR2W]
         if lines_couple   [AL3E AL0E CR2W CR1W]
         if always         [AL3E 0    CR2W 0]
            alternate_definition [single] c4
   setup 1x2 1x2
      array [AL0E CR1W]
            alternate_definition [3x3] c4
   setup 1x6 2x3 rotate restriction forbidden 3x3couples_only
      array [AL3N AL4N AL5N CR2S CR1S CR0S]
            alternate_definition [4x4] c4
   setup 1x8 2x4 rotate restriction forbidden 4x4couples_only
      array [AL4N AL5N AL7N AL6N CR3S CR2S CR0S CR1S]

call "_relay the shadow part 2" dontshow tag relay_shadow_part_2
            step_to_wave left_means_touch_or_check fractal_is_inherited gen_sting_is_inherited
   checkpoint fanthetop [inherit_fractal inherit_gensting]
              cast_off_n4_with_warn [insert_number 3 inherit_fractal inherit_gensting conc_force_columns]

call "_relay the shadow part 3" dontshow tag relay_shadow_part_3
            fractal_is_inherited gen_sting_is_inherited
   crossconc numberbingo [inherit_fractal inherit_gensting insert_number 1]
             hinge_for_relay_shad [insert_number 1 inherit_fractal inherit_gensting conc_force_lines]

call "_finish relay the shadow, but the @6 criss cross it" dontshow tag fin_relay_shadow_but_xx
            step_to_wave left_means_touch_or_check
   setup 1x8 2x4 restriction wave_only
      predsnoselect
         if select   [   0 CCCAL5N       0 AAACM5S    0 AAACR6N       0 CCCAM6S]
         if unselect [CM3S       0 CCCAM7S       0 AM0S       0 AAACM4S       0]

call "relay the shadow" c1
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited can_be_fan
            left_means_touch_or_check first_part_visible
   seq trade_for_8_person_call [inherit_yoyo inherit_gensting]
   seq relay_shadow_part_2 [inherit_fractal inherit_gensting]
   seq relay_shadow_part_3 [inherit_fractal inherit_gensting]

call "relay the shadow but the @6 criss cross it" c2
            step_to_wave yoyo_is_inherited gen_sting_is_inherited can_be_fan
            left_means_touch_or_check first_part_visible
   seq trade_for_8_person_call [inherit_yoyo inherit_gensting]
   seq fin_relay_shadow_but_xx []

call "fan chain the line" c3
            step_to_wave left_means_touch_or_check first_part_visible
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq spinchainpart2 [inherit_fractal inherit_yoyo inherit_gensting]
   seq ctrs_cast_3_4_with_warn [inherit_fractal inherit_gensting]

call "fan chain the line but @m" c3
            step_to_wave left_means_touch_or_check first_part_visible
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq spinchainpart2 [inherit_fractal inherit_yoyo inherit_gensting]
   seq ctrs_cast_3_4_with_warnbut2nd [inherit_fractal inherit_gensting]

call "spin chain the line" c3a
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            can_be_fan left_means_touch_or_check first_part_visible
   seq trade_for_8_person_call [inherit_yoyo inherit_gensting]
                   /* If we use "swing" instead of "trade", it would give warning
                      "do your part" when done from 1-faced line, which dancers
                      might misconstrue during the cast off parts.  The behavior
                      "swing" needs to be changed so that it gives an error
                      unless the "two-faced" modifier is given. */
   seq spinchainpart2 [inherit_fractal inherit_yoyo inherit_gensting]
   seq ctrs_cast_3_4_with_warn [inherit_fractal inherit_gensting]

call "spin chain the line but @m" c3a
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            can_be_fan left_means_touch_or_check first_part_visible
   seq trade_for_8_person_call [inherit_yoyo inherit_gensting]
   seq spinchainpart2 [inherit_fractal inherit_yoyo inherit_gensting]
   seq ctrs_cast_3_4_with_warnbut2nd [inherit_fractal inherit_gensting]

call "_spin chain the line part 2" dontshow tag spinchainpart2
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   checkpoint_mystic_ok any_hand_slip [inherit_yoyo inherit_gensting]
                        cast_off_n4_with_warn [conc_force_otherway suppress_roll suppress_elongation_warnings
                                     insert_number 3 inherit_fractal inherit_gensting]

call "swing chain the line" c4
            step_to_wave yoyo_is_inherited gen_sting_is_inherited can_be_fan left_means_touch_or_check first_part_visible
   seq trade_for_8_person_call [inherit_yoyo inherit_gensting]
                   /* If we use "swing" instead of "trade", it would give warning
                      "do your part" when done from 1-faced line, which dancers
                      might misconstrue during the cast off parts.  The behavior
                      "swing" needs to be changed so that it gives an error
                      unless the "two-faced" modifier is given. */
   seq swingchainpart2 []
   seq swingchainpart3 []

call "_swing chain the line part 2" dontshow tag swingchainpart2
   checkpoint any_hand_slip [] cast_off_n4 [conc_force_lines insert_number 1 suppress_elongation_warnings]

call "_swing chain the line part 3" dontshow tag swingchainpart3
   conc cast_off_n4 [insert_number 1] nullcall []

call "divide the ocean @h" c3
       single_is_inherited
   seq divide_oceansea_1 [inherit_single]
   seq divide_ocean_2 [inherit_single]
   seq divide_oceansea_3d [inherit_single]

call "divide the sea @h" c3
       single_is_inherited
   seq divide_oceansea_1 [inherit_single]
   seq divide_sea_2 [inherit_single]
   seq divide_oceansea_3d [inherit_single]

call "divide the ocean @0" c3
       single_is_inherited
   seq divide_oceansea_1 [inherit_single]
   seq divide_ocean_2 [inherit_single]
   seq divide_oceansea_3c [inherit_single]

call "divide the sea @0" c3
       single_is_inherited
   seq divide_oceansea_1 [inherit_single]
   seq divide_sea_2 [inherit_single]
   seq divide_oceansea_3c [inherit_single]

call "_divide the ocean/sea, part 1" dontshow tag divide_oceansea_1
           single_is_inherited
   maybesinglecrossconc cast_off_n4 [inherit_single insert_number 3] hinge [conc_force_lines suppress_elongation_warnings]

call "_divide the ocean, part 2" dontshow tag divide_ocean_2
           single_is_inherited
   maybesingleconc vertical_half_tag [inherit_single]
                   partnertagbypairs [inherit_single conc_force_columns]

call "_divide the sea, part 2" dontshow tag divide_sea_2
           single_is_inherited
   maybesingleconc vertical_left_half_tag [inherit_single]
                   partnertagbypairs [inherit_single conc_force_columns]

call "_divide the ocean/sea @h, part 3" dontshow tag divide_oceansea_3d
            single_is_inherited
   maybesingleconc nullcall [] quarter_maybe [conc_force_spots]

call "_divide the ocean/sea @0, part 3" dontshow tag divide_oceansea_3c
            single_is_inherited
   maybesingleconc nullcall [] nullcall [mandatory_anycall]

call "along part 1" dontshow tag along1
            fractal_is_inherited gen_sting_is_inherited
   conc6_2_or_4_2 hinge_with_warn [inherit_gensting inherit_fractal] ctr_rot []

call "along part 2" dontshow tag along2
            magic_is_inherited
   conc6_2_or_4_2 colcirc [inherit_magic allow_forced_mod] nullcall []

call "along part 3" dontshow tag along3
            take_right_hands yoyo_is_inherited gen_sting_is_inherited
   setup qtag 2x4
      array [AL0S CR3S ZM3N AL1S AL6S CR5S ZM0N CR2S]
   setup pshort6 bone6 rotate  // For along in a line of 6.
      array [CR2E ZM0W AL0E CR1E ZM1W AL5E]
            alternate_definition [magic] c3
   setup qtag 2x4
      array [AL0S CR3S ZM3N CR2S AL6S CR5S ZM0N AL1S]
            alternate_definition [yoyo] c4
   setup qtag qtag rotate
      array [AL5E CR0E ZM0W AL7N AL2N CR2S ZM5W CR7S]
            alternate_definition [generous] c3
   setup qtag qtag rotate
      array [AL5E CR0E ZM0W AL7N AL2N CR2S ZM5W CR7S]
            alternate_definition [stingy] c3
   setup qtag qtag rotate
      array [AL5E CR0E ZM0W AL6S AL3S CR3N ZM5W CR6N]

call "along" c2 tag along
            magic_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            last_part_visible    // Not too happy with this, but it allows things like "finally stingy".
   seq along1 [inherit_gensting inherit_fractal]
   seq along2 [inherit_magic]
   seq along3 [inherit_magic inherit_yoyo inherit_gensting]

call "@2swing @3along" c2
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            left_means_touch_or_check visible_fractions
   seq swing [inherit_yoyo inherit_gensting or_anycall]
   seq along [inherit_yoyo inherit_gensting inherit_fractal]

call "@0 along" c2
            dont_use_in_resolve first_part_visible
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq nullcall [mandatory_anycall]
   seq along [inherit_yoyo inherit_gensting inherit_fractal]

call "_start an anchor" dontshow tag startananchor
   setup 1x8 qtag
      array [CR0E CR6S CR3S AL5E AL1W AL2S AL7S CR4W]
            alternate_definition [generous] c3
   setup spindle qtag
      array [0 0 0 AL1W 0 0 0 CR0E]
   setup pspindle qtag
      array [CR0N CR7W CR2W 0 AL2E AL7E AL5N 0]
            alternate_definition [stingy] c3
   setup spindle qtag
      array [0 0 0 AL1W 0 0 0 CR0E]
   setup pspindle qtag
      array [CR6E CR3E CR4S 0 AL1S AL3W AL6W 0]

call "centers swing/slip but" dontshow tag finalanchornormal
   /* We don't say "force_columns" or similar things for the pass in.  If it
      gets replaced, we want the people to do whatever they think is right. */
   conc swingslip [allow_plain_mod] pass_in [conc_demand_lines conc_force_spots allow_forced_mod]

call "centers swing/slip but @m" dontshow tag finalanchorbut
   conc nullsecond [mandatory_secondary_call] pass_in [conc_demand_lines conc_force_spots allow_forced_mod]

call "an anchor" c4a
            gen_sting_is_inherited
   seq startananchor [inherit_gensting]
   seq finalanchornormal []

call "an anchor but @m" c4a
            gen_sting_is_inherited
   seq startananchor [inherit_gensting]
   seq finalanchorbut []

call "@2swing @3an anchor" c4a
            step_to_wave yoyo_is_inherited gen_sting_is_inherited left_means_touch_or_check first_part_visible
   seq swing [or_anycall inherit_yoyo inherit_gensting]
   seq startananchor [inherit_gensting]
   seq finalanchornormal []

call "@2swing @3an anchor but @m" c4a
            step_to_wave yoyo_is_inherited gen_sting_is_inherited left_means_touch_or_check first_part_visible
   seq swing [or_anycall inherit_yoyo inherit_gensting]
   seq startananchor [inherit_gensting]
   seq finalanchorbut []

call "@2cast @3an anchor" c4a
            first_part_visible fractal_is_inherited gen_sting_is_inherited
   seq armturn_n4 [or_anycall insert_number 3 inherit_gensting inherit_fractal]
   seq startananchor [inherit_gensting]
   seq finalanchornormal []

call "@2cast @3an anchor but @m" c4a
            first_part_visible fractal_is_inherited gen_sting_is_inherited
   seq armturn_n4 [or_anycall insert_number 3 inherit_gensting inherit_fractal]
   seq startananchor [inherit_gensting]
   seq finalanchorbut []

call "@0 an anchor" c4a
            dont_use_in_resolve gen_sting_is_inherited first_part_visible
   seq nullcall [mandatory_anycall]
   seq startananchor [inherit_gensting]
   seq finalanchornormal []

call "@0 an anchor but @m" c4a
            dont_use_in_resolve gen_sting_is_inherited first_part_visible
   seq nullcall [mandatory_anycall]
   seq startananchor [inherit_gensting]
   seq finalanchorbut []

call "_relay your pleasure part 2a" dontshow tag relay_pleasure_2a
   setup 1x4 1x4 rotate
      array [CM1N CM2S AM1S AM2N]

call "_relay your pleasure part 2" dontshow tag relay_pleasure_2
            step_to_wave left_means_touch_or_check fractal_is_inherited gen_sting_is_inherited
   checkpoint relay_pleasure_2a []
              cast_off_n4_with_warn [insert_number 3 inherit_fractal inherit_gensting
                                     conc_force_columns suppress_elongation_warnings]

call "_relay your pleasure part 3" dontshow tag relay_pleasure_3
   conc nullcall [] fincoupleup []

call "relay your pleasure" c4a
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            can_be_fan left_means_touch_or_check first_part_visible
   seq trade [inherit_yoyo inherit_gensting]
   seq relay_pleasure_2 [inherit_fractal inherit_gensting]
   seq relay_pleasure_3 [roll_transparent]

call "shake and rattle" c3
            reverse_means_mirror
   setup 2x2 2x2
      array [CR1W CR2W AL3W AL0W]
            alternate_definition [single] c4
   setup 2x1 1x2 rotate
      array [AL0S CR1S]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [AL0W AL1W CR2W CR3W]
            alternate_definition [3x3] c4
   setup 2x3 2x3 rotate
      array [CR0S CR1S CR2S AL3S AL4S AL5S]
            alternate_definition [4x4] c4
   setup 2x4 2x4 rotate
      array [CR0S CR1S CR2S CR3S AL4S AL5S AL6S AL7S]
            alternate_definition [3x3 singlefile] c4
   setup 6x1 2x3
      array [A0W A1W A2W CR3W CR4W CR5W]
            alternate_definition [4x4 singlefile] c4
   setup 8x1 2x4
      array [A0W A1W A3W A2W CR4W CR5W CR7W CR6W]

call "catch @1@9" c2
            split_like_square_thru cross_is_inherited twisted_is_inherited diamond_is_legal
            yoyo_is_inherited gen_sting_is_inherited left_means_mirror neednumber visible_fractions
   seq square_thru_to_wave [inherit_left inherit_twisted inherit_diamond]
   seq slipforcatch [or_anycall inherit_diamond inherit_yoyo inherit_gensting]
   seq stepnfold [inherit_cross inherit_diamond]

call "catch @0 @9" c3a
            split_like_square_thru cross_is_inherited twisted_is_inherited diamond_is_legal
            left_means_mirror neednumber visible_fractions
   seq square_thru_to_wave [inherit_left inherit_twisted inherit_diamond]
   seq nullcall [mandatory_anycall inherit_diamond]
   seq stepnfold [inherit_cross inherit_diamond]

call "catch it @9 @0" c4
            split_like_square_thru cross_is_inherited twisted_is_inherited diamond_is_legal
            left_means_mirror neednumber visible_fractions
   seq square_thru_to_wave [inherit_left inherit_twisted inherit_diamond]
   seq nullcall [mandatory_anycall inherit_diamond]
   seq stepnfold [inherit_cross inherit_diamond]

call "catch lock @9" c3a
            split_like_square_thru twisted_is_inherited diamond_is_legal
            left_means_mirror neednumber visible_fractions
   seq square_thru_to_wave [inherit_left inherit_twisted inherit_diamond]
   seq lockit []
   seq stepnfold [inherit_diamond]

call "catch top @9" c3a
            split_like_square_thru twisted_is_inherited diamond_is_legal
            left_means_mirror neednumber visible_fractions
   seq square_thru_to_wave [inherit_left inherit_twisted inherit_diamond]
   seq fanthetop []
   seq stepnfold [inherit_diamond]

call "_centers step and fold" dontshow tag ctrsstepnfold
            cross_is_inherited
   conc stepnfold [inherit_cross] nullcall []

call "catch @0 @9, only the resulting centers finish" c3a
            split_like_square_thru cross_is_inherited twisted_is_inherited
            left_means_mirror neednumber
   seq touch [inherit_left inherit_twisted]
   seq crosslockit [repeat_nm1]
   seq nullcall [mandatory_anycall]
   seq ctrsstepnfold [inherit_cross]

call "@eright@f on @9" c4
            split_like_square_thru left_means_mirror neednumber twisted_is_inherited
            fractal_is_inherited gen_sting_is_inherited
   seq touch [inherit_left inherit_twisted]
   seq crosslockit [repeat_nm1]
   seq armturn_n4 [insert_number 3 inherit_gensting inherit_fractal]
   seq roll []

call "@eright@f on @9 and @b" c4
            split_like_square_thru dont_use_in_resolve left_means_mirror need_two_numbers twisted_is_inherited
            fractal_is_inherited gen_sting_is_inherited
   seq touch [inherit_left inherit_twisted]
   seq crosslockit [repeat_nm1]
   seq armturn_n4 [shift_one_number inherit_gensting inherit_fractal]
   seq roll []

call "_funny_right_on finish" dontshow tag funnyrightonfinish
            neednumber
   setup 2x2 2x2 qualifier num 1 none
      predscantdo
         if 2x2_facing_someone [0    0    1S   0S]
         if always             [ZM0N ZM1N ZM2N ZM3N]
   setup 2x2 2x2 qualifier num 3 none
      predscantdo
         if 2x2_facing_someone [0    0    2N   3N]
         if always             [ZM0N ZM1N ZM2N ZM3N]

call "funny @eright@f on @9" c4a
            dont_use_in_nice_resolve
            split_like_square_thru left_means_mirror neednumber
   seq funnysquaremain [inherit_left repeat_nm1]
   seq funnyrightonfinish [insert_number 3]

call "funny @eright@f on @9 and @b" c4a
            dont_use_in_resolve
            split_like_square_thru left_means_mirror need_two_numbers
   seq funnysquaremain [inherit_left repeat_nm1]
   seq funnyrightonfinish [shift_one_number]

call "square thru @9" mainstream tag square_thru_n
            split_like_square_thru left_means_mirror neednumber twisted_is_inherited
   seq touch [permit_touch_or_rear_back inherit_left inherit_twisted]
   seq crosslockit [repeat_nm1]
   seq natstepthru []

call "square thru, but on the @u hand, @0" mainstream
            split_like_square_thru left_means_mirror neednumber twisted_is_inherited
   seq touch [permit_touch_or_rear_back inherit_left inherit_twisted]
   seq crosslockit [repeat_nm1]
   seq nullcall [permit_touch_or_rear_back mandatory_anycall]

// Put in nearly-meaningless "diamond" modifier so
// it might be able to do interesting "catch".
call "square thru @9 to a wave" c1 tag square_thru_to_wave
            split_like_square_thru left_means_mirror neednumber
            twisted_is_inherited diamond_is_legal
   seq touch [permit_touch_or_rear_back inherit_left inherit_twisted inherit_diamond]
   // This "inherit_diamond" is illegal on cross lockit, so this
   // will be legal only if the number is 1.
   seq crosslockit [repeat_nm1 inherit_diamond]

call "square thru @9, @6 to a wave" c1
            split_like_square_thru left_means_mirror neednumber twisted_is_inherited
   seq touch [permit_touch_or_rear_back inherit_left inherit_twisted]
   seq crosslockit [repeat_nm1]
   seq somedontstepthru []

call "split square thru 2" dontshow tag splitsq2
            left_means_mirror
   setup 4x2 2x4
      array [0 0 ZM3N 0 0 ZM4N 0 0]
   setup 2x4 2x4
      array [0 0 0 0 AM2W 0 0 CM1E]

call "go an extra hand" dontshow tag extrahand
            left_means_mirror
   setup 2x2 2x2
      array [CM1E AM0W 0 0]

call "split square thru 2+@9" dontshow tag splitsq2plusn
            neednumber left_means_mirror
   seq splitsq2 [inherit_left]
   seq extrahand [inherit_left repeat_n]

call "_funny square thru rear" dontshow tag funnysquarerear
            left_means_mirror
   setup 2x2 2x2
      array [ZM0N ZM1N ZM2N ZM3N]
   setup trngl4 2x2
      array [0 0 ZM0N ZM1N 0 0 ZM2N ZM3N]
   setup ptrngl4 2x2
      array [0 ZM3N ZM0N ZM1N ZM0N 0 ZM2N ZM3N]

call "_funny square thru main" dontshow tag funnysquaremain
            left_means_mirror
   setup 2x2 2x2
      predscantdo
         if 2x2_facing_someone [0    0    AL1W CR0E]
         if always             [ZM0N ZM1N ZM2N ZM3N]

call "_funny square thru finish" dontshow tag funnysquarefinish
   setup 2x2 2x2
      predscantdo
         if 2x2_facing_someone [0    0    ZM1N ZM0N]
         if always             [ZM0N ZM1N ZM2N ZM3N]

call "_funny square turn thru finish" dontshow tag funnysquaretnfinish
   setup 2x2 2x2
      predscantdo
         if 2x2_facing_someone [0    0    C2S C3S]
         if always             [ZM0N ZM1N ZM2N ZM3N]

call "funny square thru @9" c2
            dont_use_in_nice_resolve neednumber left_means_mirror
   seq funnysquarerear [inherit_left]
   seq funnysquaremain [inherit_left repeat_nm1]
   seq funnysquarefinish []

call "square turn thru @9" c4a
            split_like_square_thru left_means_mirror yoyo_is_inherited gen_sting_is_inherited
            neednumber twisted_is_inherited
   seq touch [inherit_left inherit_twisted]
   seq crosslockit [repeat_nm1]
   seq natturnthru [inherit_yoyo inherit_gensting]

call "funny square turn thru @9" c4a
            dont_use_in_nice_resolve neednumber left_means_mirror yoyo_is_inherited gen_sting_is_inherited
   seq funnysquarerear [inherit_left]
   seq funnysquaremain [inherit_left repeat_nm1]
   seq funnysquaretnfinish [inherit_yoyo inherit_gensting]

call "square turn thru @9 to a wave" c4a
            neednumber split_like_square_thru left_means_mirror
            yoyo_is_inherited gen_sting_is_inherited twisted_is_inherited
   seq touch [inherit_left inherit_twisted]
   seq crosslockit [repeat_nm1]
   seq trade [inherit_yoyo inherit_gensting]

call "square turn thru @9, @6 to a wave" c4a
            split_like_square_thru left_means_mirror neednumber twisted_is_inherited
   seq touch [inherit_left inherit_twisted]
   seq crosslockit [repeat_nm1]
   seq somedontturnthru []

call "step thru" mainstream
            left_means_mirror
   setup 1x2 1x2 rotate qualifier right wave_only
      array [ZM0W 0]
   /* We can't say "qualifier left wave_only" here, because it could be done
      from an inverted line, and the splitting mechanism wouldn't handle it.
      We need "left_miniwave" and "right_miniwave" restrictions and
      qualifiers.  Next release. */
   setup 1x2 1x2 rotate restriction unusual alwaysfail
      array [ZM0W ZM0W]
            alternate_definition [twisted] c4
   setup 1x2 1x2 qualifier right wave_only // restriction serious_violation alwaysfail
      array [CR1E 0]

call "_natural step thru" dontshow tag natstepthru
   setup 1x2 1x2 rotate
      array [ZM0W ZM0W]
            alternate_definition [twisted] c4
   setup 1x2 1x2 qualifier wave_only
      array [CR1E AL0W]

call "_some dont step thru" dontshow tag somedontstepthru
   setup 1x2 1x2 rotate qualifier live none_sel
      array [ZM0W ZM0W]
   setup 1x2 1x2 qualifier live all_sel
      array [Z0N Z1N]

call "_trade, some dont step thru" dontshow tag somedontturnthru
   setup 1x2 1x2 rotate qualifier live none_sel
      array [CM1E AM1E]
   setup 1x2 1x2 qualifier live all_sel
      array [CR1S AL0S]
            alternate_definition [yoyo] c4
   setup 1x2 1x2 qualifier live none_sel restriction forbidden miniwaves
      array [CM0W AM1E]
   setup 1x2 1x2 rotate qualifier live all_sel restriction forbidden miniwaves
      array [CR1S AL1N]

call "turn thru" mainstream tag turnthru
            left_means_mirror
   // We do the "rear back" stuff explicitly here, so warnings won't be printed.
   split_to_box    // This means prefer the facing version rather than the miniwave one.
   setup 2x1 1x2 qualifier in in_or_out
      array [CM0S 0]
   setup 1x2 1x2 rotate qualifier right miniwaves
      array [CM1E 0]
            alternate_definition [yoyo] c4
   split_to_box
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [CM0S 0]
   setup 1x2 1x2 qualifier right miniwaves
      array [CM0W 0]
            alternate_definition [generous] c3
   split_to_box
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [CM0S 0]
   setup 1x2 1x2 qualifier right miniwaves
      array [CM0W 0]
            alternate_definition [stingy] c3
   split_to_box
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [CM1N 0]
   setup 1x2 1x2 qualifier right miniwaves
      array [CM1E 0]
            alternate_definition [half] mainstream
   split_to_box
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [CR1E 0]
   setup 1x2 1x2 qualifier right miniwaves
      array [CR1S 0]
            alternate_definition [lasthalf] mainstream
   split_to_box
   setup 1x2 1x2 rotate qualifier right miniwaves
      array [ZM0W 0]

call "left turn thru" dontshow tag leftturnthru
            left_means_mirror
   // We do the "rear back" stuff explicitly here, so warnings won't be printed.
   split_to_box    // This means prefer the facing version rather than the miniwave one.
   setup 2x1 1x2 qualifier in in_or_out
      array [AM0S 0]
   setup 1x2 1x2 rotate qualifier left miniwaves
      array [0 AM1E]
            alternate_definition [yoyo] c4
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [AM1N 0]
   setup 1x2 1x2 qualifier left miniwaves
      array [0 AM1E]
            alternate_definition [generous] c3
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [AM1N 0]
   setup 1x2 1x2 qualifier left miniwaves
      array [0 AM1E]
            alternate_definition [stingy] c3
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [AM0S 0]
   setup 1x2 1x2 qualifier left miniwaves
      array [0 AM0W]
            alternate_definition [half] mainstream
   split_to_box
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [AL1E 0]
   setup 1x2 1x2 qualifier left miniwaves
      array [0 AL0E]
            alternate_definition [lasthalf] mainstream
   split_to_box
   setup 1x2 1x2 rotate qualifier left miniwaves
      array [0 ZM0W]

call "left turn thru to a wave" dontshow tag leftturnthrutowave
            left_means_mirror
   setup 2x1 1x2 rotate
      array [AL0E 0]
            alternate_definition [yoyo] c4
   setup 2x1 1x2
      array [AL0E 0]
            alternate_definition [generous] c3
   setup 2x1 1x2
      array [AL0E 0]
            alternate_definition [stingy] c3
   setup 2x1 1x2
      array [AL1W 0]

call "any hand turn thru" mainstream tag natturnthru
   setup 1x2 1x2 rotate restriction forbidden wave_only
      array [CM1E AM1E]
            alternate_definition [yoyo] c4
   setup 1x2 1x2 restriction forbidden wave_only
      array [CM0W AM1E]
            alternate_definition [generous] c3
   setup 1x2 1x2 restriction forbidden wave_only
      array [CM0W AM1E]
            alternate_definition [stingy] c3
   setup 1x2 1x2 restriction forbidden wave_only
      array [CM1E AM0W]
            alternate_definition [half] mainstream
   split_to_box
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [CR1E 0]
   setup 1x2 1x2 restriction forbidden wave_only
      array [CR1S AL0S]
            alternate_definition [lasthalf] mainstream
   split_to_box
   setup 1x2 1x2 rotate qualifier right miniwaves
      array [ZM0W ZM0W]

call "pair off" a1
   setup 2x2 2x2
      array [0 0 CR2E AL3W]
   setup 2x4 2x4
      array [0 0 0 0 CR4E CR5E AL6W AL7W]

call "short and sweet" c4a tag short_n_sweet
            reverse_means_mirror
   setup 2x2 2x2
      array [CM1E CR2W AM3W CR0E]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [AM0W CR1E CM2E CR3W]

call "short cut" c4a
            reverse_means_mirror
   setup 2x2 2x2
      array [0 0 AM3W CR0E]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [AM0W CR1E 0 0]

call "nip and tuck" c4a
            left_means_mirror
   setup 2x2 2x2
      array [CR3W CR2W 0 0]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [0 0 CR0W CR3W]
            alternate_definition [single] c4
   setup 2x1 1x2
      array [0 CR0W]
            alternate_definition [3x3] c4
   setup 2x3 2x3
      array [CR5W CR4W CR3W 0 0 0]
            alternate_definition [4x4] c4
   setup 2x4 2x4
      array [CR7W CR6W CR5W CR4W 0 0 0 0]

call "fan thru" c4a
            rear_back_from_r_wave left_means_mirror no_elongation_allowed
   setup 2x2 2x2
      array [0 0 AM3S ZM0N]

call "fan thru to a wave" c4a
            rear_back_from_r_wave left_means_mirror
   setup 2x2 1x4
      array [0 0 AL1S ZM0N]

call "cross trail thru" a1 tag crosstrail
            visible_fractions no_elongation_allowed left_means_mirror
            twisted_is_inherited yoyo_is_inherited gen_sting_is_inherited single_is_inherited
            nxn_is_inherited funny_is_inherited
   seq passthru [inherit_funny inherit_twisted]
   seq half_sashay [inherit_left inherit_twisted inherit_single inherit_nxn]
            rear_back_from_r_wave
   setup 2x2 2x2 restriction not_tboned
      array [0 0 ZM0N ZM1N]
            alternate_definition [twisted] c4
   setup 4x1 2x2
      array [CM2E 0 0 CM3E]
            alternate_definition [3x3] c4
   setup 2x3 2x3
      array [0 0 0 ZM0N ZM1N ZM2N]
            alternate_definition [4x4] c4
   setup 2x4 2x4
      array [0 0 0 0 ZM0N ZM1N ZM2N ZM3N]

call "_turn and Q part 1" dontshow tag turn_and_q_1
            split_like_dixie_style rear_back_from_wave_or_qtag
            left_means_mirror
   setup 2x1 1x2 qualifier not_split_dixie   // This is turn thru, of course.
      array [C0S 0]
   setup 2x2 2x2 qualifier split_dixie
      predscantdo
         if 2x2_facing_someone [0 0 CR2S CR3S]
         if always             [0 0 ZM2N ZM3N]
            alternate_definition [twisted] c4
   setup 2x1 1x2 rotate qualifier not_split_dixie
      array [C0S 0]
   setup trngl4 2x2 qualifier split_dixie
      array [CR3W 0 0 0 0 CR0W ZM2N ZM3N]

call "_turn and Q part 2" dontshow tag turn_and_q_2
   setup 2x2 2x2
      /* If we are doing "split turn and Q", we need to be careful, so we place
         a 2x2 definition here that is sensitive to people being T-boned. */
      predscantdo
         if 2x2_facing_someone      [CR0E AL1W AL2W CR3E]
         if 2x2_tandem_with_someone [CR0E AL1W AL2W CR3E]  // This can happen also.
         if always                  [CR0E AL1W ZM2N ZM3N]
   setup 1x2 1x2        // This is quarter in, of course.
      array [CR0E AL1W]

call "turn and Q" c4a
            split_like_dixie_style visible_fractions
            left_means_mirror yoyo_is_inherited gen_sting_is_inherited twisted_is_inherited
   seq turn_and_q_1 [inherit_left inherit_yoyo inherit_gensting inherit_twisted]
   seq turn_and_q_2 [inherit_yoyo inherit_gensting]
   seq leftturnthru [inherit_left inherit_yoyo inherit_gensting]

call "turn and Q to a wave" c4a
            split_like_dixie_style visible_fractions
            left_means_mirror yoyo_is_inherited gen_sting_is_inherited twisted_is_inherited
   seq turn_and_q_1 [inherit_left inherit_yoyo inherit_gensting inherit_twisted]
   seq turn_and_q_2 [inherit_yoyo inherit_gensting]
   seq leftturnthrutowave [inherit_left inherit_yoyo inherit_gensting]

call "turn and Q, @6 to a wave" c4a
            split_like_dixie_style left_means_mirror twisted_is_inherited
   seq turn_and_q_1 [inherit_left inherit_twisted]
   seq turn_and_q_2 []
   seq leftturnthrutowave [inherit_left]
   seq somedontstepthru []

call "turn and flip" c4x
            left_means_mirror no_elongation_allowed
   setup 2x2 2x2 restriction not_tboned
      array [0 0 AL3S CM2S]
            alternate_definition [half] c4
   setup 2x2 1x4 rotate restriction not_tboned
      array [0 0 AL2S CR1N]

/* This is what gets used by other calls.  The use of courtesy turn
   in other calls is presumed to be "correct", so we don't complain
   if some concept or variation caused it not to be correct. */
call "_courtesy turn 1/2" dontshow tag courtesy
            reverse_means_mirror
   setup 1x2 1x2 restriction forbidden couples_only
      array [AL1S AL0S]
            alternate_definition [half] mainstream
   setup 1x2 1x2 rotate restriction forbidden couples_only
      array [AL1S AL0S]
            alternate_definition [lasthalf] mainstream
   setup 1x2 1x2 rotate restriction forbidden couples_only
      array [AL1S AL0S]
            alternate_definition [single] c4
   setup 1x1 1x1
      array [AL0S]
            alternate_definition [3x3] c4
   setup 1x3 1x3
      array [AL2S AL1S AL0S]
            alternate_definition [4x4] c4
   setup 1x4 1x4
      array [AL2S AL3S AL0S AL1S]
            alternate_definition [yoyo] c4
   setup 1x2 1x2 rotate restriction forbidden couples_only
      array [AL0N AL1N]
            alternate_definition [twisted] c4
   setup 1x2 1x2 rotate restriction forbidden couples_only
      array [AL0N AL1N]

call "courtesy turn" mainstream
            reverse_means_mirror
   // While we normally assume that this call turns 180 degrees, the Callerlab
   // definition says, "unless otherwise specified", to turn until you face
   // the center of the set or the center of the group you are working in.
   // From a 2-faced line, a 180 degree turn is therefore probably not right.
   // We print the "controversial" warning to remind the caller to specify
   // clearly what is wanted.
   setup 2x4 2x4 qualifier 2fl_only restriction controversial alwaysfail
      array [AL1S AL0S AL3S AL2S AL5S AL4S AL7S AL6S]
   // We pick out a few more such cases.  We don't raise a warning for a
   // trade-by setup, because this is presumably the second half of a right
   // and left thru, so they are turning toward the center of the group they
   // are working in.  It seems that the "splitseq" concept doesn't do the
   // right thing in this case.  That is, it doesn't do the right thing if
   // we want "twisted" to work.
   setup 2x2 2x2 qualifier in in_or_out restriction controversial alwaysfail
      array [AL1S AL0S AL3S AL2S]

   // Leftie box, girls looking out
   setup 2x2 2x2 qualifier left miniwaves
      predscantdo
         if boyp  [0 0 AL3N 0]
         if girlp [0 AL0S 0 0]

   // These next few things involve the doctrine of "Turn however far
   // (180 to 360 degrees, that is) until the couple is facing the direction
   // from which the woman appeared to come."  As such, they are gender-sensitive.

   // LH column, if girls are #1 and #2, go to a starting DPT.
   // Other arrangements are similarly tricky.
   setup 4x2 2x4 qualifier left wave_only
      predscantdo
         if boyp  [0 0 0 0 AL4S AL2N AL1N AL0N]
         if girlp [0 0 0 0 AL3S AL2S AL1S AL7N]

   // Starting DPT.  Go all the way around.
   setup 4x2 2x4 qualifier in 2fl_only restriction controversial alwaysfail
      array [AL0N AL1N    0    0    0    0 AL6N AL7N]

   // Eight chain.  The outsides go all the way around; centers go half.
   setup 4x2 2x4 qualifier in in_or_out restriction controversial alwaysfail
      array [AL0N    0 AL5S    0    0 AL2S    0 AL7N]

   setup 1x2 1x2 restriction forbidden couples_only
      array [AL1S AL0S]
            alternate_definition [half] mainstream
   setup 1x2 1x2 rotate restriction forbidden couples_only
      array [AL1S AL0S]
            alternate_definition [lasthalf] mainstream
   setup 1x2 1x2 rotate restriction forbidden couples_only
      array [AL1S AL0S]
            alternate_definition [single] c4
   setup 1x1 1x1
      array [AL0S]
            alternate_definition [3x3] c4
   setup 1x3 1x3
      array [AL2S AL1S AL0S]
            alternate_definition [4x4] c4
   setup 1x4 1x4
      array [AL2S AL3S AL0S AL1S]
            alternate_definition [yoyo] c4
   setup 1x2 1x2 rotate restriction forbidden couples_only
      array [AL0N AL1N]
            alternate_definition [twisted] c4
   setup 1x2 1x2 rotate restriction forbidden couples_only
      array [AL0N AL1N]
            reverse_means_mirror
   // LH wave, boys on the end.
   setup 1x4 2x2 qualifier left wave_only
      predscantdo
         if boyp  [0    0 AAL2W 0]
         if girlp [0 AL3E     0 0]

call "courtesy turn and roll" dontshow tag courtesy_and_roll
            dont_use_in_nice_resolve
            reverse_means_mirror yoyo_is_inherited single_is_inherited
            twisted_is_inherited nxn_is_inherited
   seq courtesy [inherit_reverse inherit_yoyo inherit_twisted inherit_single inherit_nxn]
   seq roll []

call "right and left thru" mainstream
            visible_fractions no_elongation_allowed left_means_mirror
            twisted_is_inherited yoyo_is_inherited single_is_inherited
            nxn_is_inherited funny_is_inherited
   seq passthru [inherit_funny inherit_twisted]
   seq courtesy [inherit_reverse inherit_yoyo inherit_twisted inherit_single inherit_nxn]

call "right and left roll" c4
            visible_fractions no_elongation_allowed left_means_mirror
            twisted_is_inherited yoyo_is_inherited single_is_inherited
            nxn_is_inherited funny_is_inherited
   seq passthru [inherit_funny inherit_twisted]
   seq courtesy [inherit_reverse inherit_yoyo inherit_twisted inherit_single inherit_nxn]
   seq roll []

call "left and right thru" c4
            visible_fractions no_elongation_allowed
            twisted_is_inherited yoyo_is_inherited single_is_inherited
            nxn_is_inherited funny_is_inherited
   seq passthru [force_left inherit_funny inherit_twisted]
   seq courtesy [force_reverse inherit_yoyo inherit_twisted inherit_single inherit_nxn]

call "left and right roll" c4
            visible_fractions no_elongation_allowed
            twisted_is_inherited yoyo_is_inherited single_is_inherited
            nxn_is_inherited funny_is_inherited
   seq passthru [force_left inherit_funny inherit_twisted]
   seq courtesy [force_reverse inherit_yoyo inherit_twisted inherit_single inherit_nxn]
   seq roll []

call "right and left by" c4
            first_part_visible rear_back_from_r_wave
            single_is_inherited nxn_is_inherited mxn_is_inherited
            no_elongation_allowed left_means_mirror twisted_is_inherited
   seq passthru [inherit_twisted]
   seq courtesy [inherit_reverse inherit_twisted inherit_single inherit_nxn inherit_mxn]
   seq quarter_more [inherit_single inherit_nxn inherit_mxn]
   seq slither [inherit_single inherit_nxn inherit_mxn]

call "right and left by by" c4
            first_part_visible rear_back_from_r_wave
            single_is_inherited nxn_is_inherited mxn_is_inherited
            no_elongation_allowed left_means_mirror twisted_is_inherited
   seq passthru [inherit_twisted]
   seq courtesy [inherit_reverse inherit_twisted inherit_single inherit_nxn inherit_mxn]
   seq quarter_more [inherit_single inherit_nxn inherit_mxn]
   seq slither [inherit_single inherit_nxn inherit_mxn]
   seq spread [inherit_single]

call "right and left by by by" c4
            first_part_visible rear_back_from_r_wave
            single_is_inherited nxn_is_inherited mxn_is_inherited
            no_elongation_allowed left_means_mirror twisted_is_inherited
   seq passthru [inherit_twisted]
   seq courtesy [inherit_reverse inherit_twisted inherit_single inherit_nxn inherit_mxn]
   seq quarter_more [inherit_single inherit_nxn inherit_mxn]
   seq slither [inherit_single inherit_nxn inherit_mxn]
   seq spread [inherit_single]
   seq slither [inherit_single inherit_nxn inherit_mxn]

call "turn and left thru" c4
            visible_fractions yoyo_is_inherited gen_sting_is_inherited twisted_is_inherited nxn_is_inherited
   seq turnthru [inherit_twisted inherit_yoyo inherit_gensting]
   seq courtesy [inherit_twisted inherit_nxn]

call "flutter wheel" mainstream
            rear_back_from_qtag reverse_means_mirror no_elongation_allowed
   setup 2x2 2x2 restriction not_tboned
      array [0 0 CR2N CR1S]
            alternate_definition [singlefile] mainstream
   setup 4x1 2x2
      array [CR2S CR3N 0 0]

call "ladies chain" mainstream
            rear_back_from_qtag no_elongation_allowed
   setup 2x2 2x2 restriction not_tboned
      preds "Must be normal couples."
         if boyp  [0 0 0 AL3N]
         if girlp [0 0 AL0S 0]
            alternate_definition [singlefile] mainstream
   setup 4x1 2x2
      array [AL0N AL1S 0 0]

call "all 4 ladies chain" mainstream
   setup 4x4 4x4 qualifier occupied_as_o
      preds "Must be normal couples."
         if boyp  [0 0 0 0 0 0  AL6N 0 0 0 0 0 0 0 0 0]
         if girlp [0 0 0 0 0 AL13S 0 0 0 0 0 0 0 0 0 0]
   setup 2x4 4x4
      preds "Must be normal couples."
         if boyp  [0 0 0 0 0 0  AL6N 0]
         if girlp [0 0 0 0 0 AL13S 0 0]
   setup 4x2 4x4
      preds "Must be normal couples."
         if boyp  [AL10N 0 0 0 0 0 0 0]
         if girlp [0 0 0 0 0 0 0 AL1S]
            alternate_definition [singlefile] mainstream
   setup thar 4x4
      preds "Girls must be in front."
         if boyp  [0 0 0 0 0 0 AL6N 0]
         if girlp [0 0 0 0 0 0 0 AL13S]

call "all 4 ladies chain @b" mainstream
            neednumber
   setup 4x4 4x4 qualifier num 1 occupied_as_o
      preds "Must be normal couples."
         if boyp  [0 0 0 0 0 0  AL6N 0 0 0 0 0 0 0 0 0]
         if girlp [0 0 0 0 0 AL9E  0 0 0 0 0 0 0 0 0 0]
   setup 2x4 4x4 qualifier num 1 none
      preds "Must be normal couples."
         if boyp  [0 0 0 0 0 0  AL6N 0]
         if girlp [0 0 0 0 0 AL9E  0 0]
   setup 4x2 4x4 qualifier num 1 none
      preds "Must be normal couples."
         if boyp  [AL10N 0 0 0 0 0  0 0]
         if girlp [0 0 0 0 0 0  0 AL13E]
   setup 4x4 4x4 qualifier num 2 occupied_as_o
      preds "Must be normal couples."
         if boyp  [0 0 0 0 0 0  AL6N 0 0 0 0 0 0 0 0 0]
         if girlp [0 0 0 0 0 AL13S 0 0 0 0 0 0 0 0 0 0]
   setup 2x4 4x4 qualifier num 2 none
      preds "Must be normal couples."
         if boyp  [0 0 0 0 0 0  AL6N 0]
         if girlp [0 0 0 0 0 AL13S 0 0]
   setup 4x2 4x4 qualifier num 2 none
      preds "Must be normal couples."
         if boyp  [AL10N 0 0 0 0 0 0 0]
         if girlp [0 0 0 0 0 0 0 AL1S]
   setup 4x4 4x4 qualifier num 3 occupied_as_o
      preds "Must be normal couples."
         if boyp  [0 0 0 0 0 0  AL6N 0 0 0 0 0 0 0 0 0]
         if girlp [0 0 0 0 0 AL1W  0 0 0 0 0 0 0 0 0 0]
   setup 2x4 4x4 qualifier num 3 none
      preds "Must be normal couples."
         if boyp  [0 0 0 0 0 0  AL6N 0]
         if girlp [0 0 0 0 0 AL1W 0 0]
   setup 4x2 4x4 qualifier num 3 none
      preds "Must be normal couples."
         if boyp  [AL10N 0 0 0 0 0 0 0]
         if girlp [0 0 0 0 0 0 0 AL5W]
            alternate_definition [singlefile] mainstream
   setup thar 4x4 qualifier num 1 none
      preds "Girls must be in front."
         if boyp  [0 0 0 0 0 0 AL6N 0]
         if girlp [0 0 0 0 0 0 0 AL9E]
   setup thar 4x4 qualifier num 2 none
      preds "Girls must be in front."
         if boyp  [0 0 0 0 0 0 AL6N 0]
         if girlp [0 0 0 0 0 0 0 AL13S]
   setup thar 4x4 qualifier num 3 none
      preds "Girls must be in front."
         if boyp  [0 0 0 0 0 0 AL6N 0]
         if girlp [0 0 0 0 0 0 0 AL1W]

call "ladies chain to the right" mainstream
            sequence_starter
   setup 4x2 4x4
      preds "Must be normal couples."
         if boyp  [L10N 0 0 0 0 0 0 0]
         if girlp [0 0 0 0 0 0 0 L13E]
   setup 2x4 4x4
      preds "Must be normal couples."
         if boyp  [0 0 0 0 0 0 L6N 0]
         if girlp [0 0 0 0 0 L1W 0 0]

call "ladies chain to the left" mainstream
            sequence_starter
   setup 4x2 4x4
      preds "Must be normal couples."
         if boyp  [L10N 0 0 0 0 0 0 0]
         if girlp [0 0 0 0 0 0 0 L5W]
   setup 2x4 4x4
      preds "Must be normal couples."
         if boyp  [0 0 0 0 0 0 L6N 0]
         if girlp [0 0 0 0 0 L9E 0 0]

call "@6 chain to the right" mainstream
            dont_use_in_resolve
   setup 4x4 4x4
      preds "Must give a girl number."
         if select               [0 0 0 0 0 L1W    0 0 0 0 0 0 0 0 0 0]
         if person_select_plus4  [0 0 0 0 0 L9E    0 0 0 0 0 0 0 0 0 0]
         if unselect             [0 0 0 0 0   0 ZM6N 0 0 0 0 0 0 0 0 0]

call "@6 chain to the left" mainstream
            dont_use_in_resolve
   setup 4x4 4x4
      preds "Must give a girl number."
         if select               [0 0 0 0 0 L9E    0 0 0 0 0 0 0 0 0 0]
         if person_select_plus4  [0 0 0 0 0 L1W    0 0 0 0 0 0 0 0 0 0]
         if unselect             [0 0 0 0 0   0 ZM6N 0 0 0 0 0 0 0 0 0]

call "who's on @u" c4 tag whos_on_nth
            dont_use_in_resolve neednumber
   setup 4x4 4x4
      preds "Must give a couple number."
         if base_is_here         [0 0 0 0 0 AL14S CR13S 0 0 0 0 0 0 0 0 0]
         if base_is_right        [0 0 0 0 0 AL2W  ZM5N  0 0 0 0 0 0 0 0 0]
         if base_is_across       [0 0 0 0 0 AL2W  CR9E  0 0 0 0 0 0 0 0 0]
         if base_is_left         [0 0 0 0 0 ZM6N  CR9E  0 0 0 0 0 0 0 0 0]
   setup alamo alamo
      preds "Must give a couple number."
         if base_is_here         [0 0 0 0 AL1S CR0S 0 0]
         if base_is_right        [0 0 0 0 AL3W ZM4N 0 0]
         if base_is_across       [0 0 0 0 AL3W CR6E 0 0]
         if base_is_left         [0 0 0 0 ZM5N CR6E 0 0]

call "who's at home" c4
   seq whos_on_nth [insert_number 4]

call "ladies chain 3/4" mainstream
            sequence_starter
   setup 2x4 spindle rotate
      preds "Must be normal couples."
         if boyp  [0 0 0 0 0 0  ZM3W 0]
         if girlp [0 0 0 0 0 AL1S 0 0]
   setup 4x2 spindle rotate
      preds "Must be normal couples."
         if boyp  [AL6W  0 0 0 0 0 0 0]
         if girlp [0 0 0 0 0 0 0  ZM4W]

call "flare the star" c4
            rear_back_from_qtag reverse_means_mirror no_elongation_allowed
   setup 2x2 2x2 restriction not_tboned
      array [0 0 L2N L1S]
            alternate_definition [singlefile] c4a
   setup 4x1 2x2
      array [L3N L2S 0 0]

call "bingo" c3
            no_elongation_allowed
   simple_funny
   setup 2x2 2x2 restriction wave_only
      array [AL0E CR1W AL0W CR1E]

call "stack the line" c2
            left_means_mirror
   setup 2x2 2x2 restriction controversial peelable_box
      array [CM1E AM3W AL2W CM0E]
            alternate_definition [reverse] c4
   setup 2x2 2x2 restriction controversial peelable_box
      array [CR0E AM2W AM3W CM1E]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate
      array [CM0N AM1S]
            alternate_definition [3x3] c4
   setup 3x2 2x3 rotate restriction forbidden peelable_box
      array [CM0N CM1N CM2N AM5S AM4S AM3S]
            alternate_definition [4x4] c4
   setup 4x2 2x4 rotate restriction forbidden peelable_box
      array [CM0N CM1N CM2N CM3N AM7S AM6S AM5S AM4S]
            alternate_definition [half] c2
   setup 2x2 2x2
      array [CR0E AL1W AL2W CR3E]

call "@6 finish the stack" c4
   setup 2x2 2x2
      predsnoselect
         if select [0 0 ZM0N ZM0N]
         if unselect [ZM1N ZM1N ZM3N ZM3N]

call "reverse the pass" c3
   setup 2x2 2x2 restriction all_facing_same
      array [CM2S AM3S AL0S CR1S]

call "1/3 reverse the pass" c3
   setup 2x2 2x2 restriction all_facing_same
      array [CR1S AL0S ZM2N ZM3N]

call "1/2 reverse the pass" c3
   setup 2x2 1x4 restriction all_facing_same
      array [CM2S AM1S ZM3N ZM0N]

call "2/3 reverse the pass" c3
   setup 2x2 2x2 restriction all_facing_same
      array [CM2S AM3S ZM1N ZM0N]

call "reverse the pass 2/3" c3
   setup 2x2 2x2 restriction all_facing_same
      array [CM2S AM3S ZM1N ZM0N]

call "1/6 reverse the pass" c3
   setup 2x2 trngl4 restriction all_facing_same
      array [CR4E AL5W ZM6N ZM7N]

call "5/6 reverse the pass" c3
   setup 2x2 trngl4 restriction all_facing_same
      array [CM6S AM7S AL5W CR4E]

call "zoom" mainstream tag zoom
            can_be_one_side_lateral
   setup 2x2 2x2 no_cutting_through qualifier ntbone none restriction controversial peelable_box
      array [AL3N CR2N ZM1N ZM0N]
   setup 2x1 1x2 restriction controversial alwaysfail
      array [ZM1N 0N]
            alternate_definition [half] mainstream
   setup 2x2 1x4 no_cutting_through restriction controversial peelable_box
      array [AL0S CR2S ZM3N ZM1N]
            alternate_definition [lasthalf] mainstream
   setup 1x4 2x2 restriction forbidden miniwaves
      array [CR0S ZM0N AL1S ZM1N]
   setup dmd 2x2 restriction forbidden diamond_like
      array [CR0S 0 AL1S 0]
   setup pmd 2x2 restriction forbidden diamond_like
      array [0 ZM1N 0 ZM2N]
            alternate_definition [twisted] c4
   setup 2x2 1x4 no_cutting_through restriction controversial peelable_box
      array [AAL1W CCR3E CM2E AM0W]
            alternate_definition [half rewind] c4
   setup 1x4 2x2 restriction forbidden miniwaves
      array [CR0S ZM0N AL1S ZM1N]

call "_zoom, ends OK" dontshow tag zoomok
            can_be_one_side_lateral
   setup 2x2 2x2 restriction forbidden peelable_box
      array [AL3N CR2N ZM1N ZM0N]
            alternate_definition [half] mainstream
   setup 2x2 1x4 restriction forbidden peelable_box
      array [AL0S CR2S ZM3N ZM1N]

call "zing" c1 tag zing
            can_be_one_side_lateral
   setup 2x2 2x2 restriction peelable_box
      array [AL3E CR2W AL1W CR0E]

call "1/2 split trade circulate" c2
            dont_use_in_resolve take_right_hands
   // We have to use the "forbidden" option, since this def'n
   // is slightly sleazy, and wouldn't do the right thing
   // from a leftie box.
   setup 2x2 dmd rotate restriction forbidden magic_only
      array [CR0N AL0S ZM1W ZM3W]

call "split trade circulate 1-1/2" c2
            dont_use_in_resolve take_right_hands
   // We have to use the "forbidden" option, since this def'n
   // is slightly sleazy, and wouldn't do the right thing
   // from a leftie box.
   setup 2x2 dmd rotate restriction forbidden magic_only
      array [CM1E AM3E CR0N AL0S]

call "_leads run" dontshow tag leadrun
   setup 2x2 2x2 restriction wave_only
      array [CR1S AL0S ZM3N ZM2N]
            alternate_definition [half] mainstream
   setup 2x2 1x4 rotate restriction wave_only
      array [CR0N AL0S ZM3W ZM3W]

call "_beaus run" dontshow tag beaurun
   setup 1x2 1x2
      array [CR1S ZM0N]
   setup 2x2 2x2  // To allow it from T-boned box.
      array [CR1S ZM0N ZM3N CR2S]
            alternate_definition [half] mainstream
   setup 1x2 1x2 rotate qualifier couples_only
      array [CR0N ZM1W]
   setup 1x2 1x2 rotate qualifier right wave_only
      array [CR0N ZM1W]

call "@6@C run" mainstream tag anyonerun
            yield_if_ambiguous split_large_setups
   lateral_to_selectees
   setup 1x2 1x2 restriction unusual not_all_sel
      preds "Can't have both people run."
         if select [CR1S AL0S]
         if unselect_near_select [ZM1N ZM0N]
         if unselect_near_unselect [ZM0N ZM1N]

   setup 2x1 1x2
      preds "Can't have both people run."
         if unselect_near_select [ZM1N ZM0N]
         if unselect_near_unselect [ZM0N ZM1N]

   setup qtag qtag restriction unusual not_all_sel
      preds "Can't have both people run."
         if select_near_unselect   [CR1S AL0S AL3S CR2S AL5S CR4S CR7S AL6S]
         if unselect_near_select   [ZM1N ZM0N ZM3N ZM2N ZM5N ZM4N ZM7N ZM6N]
         if unselect               [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup pqtag qtag restriction unusual not_all_sel
      preds "Can't have both people run."
         if select_near_unselect   [   0    0    0    0    0    0    0    0]
         if unselect_near_select   [ZM1N ZM0N ZM3N ZM2N ZM5N ZM4N ZM7N ZM6N]
         if unselect               [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]

   setup bone bone restriction unusual not_all_sel
      preds "Can't have both people run."
         if select                 [   0    0 AL3S CR2S    0    0 CR7S AL6S]
         if unselect_near_select   [ZM0N ZM1N ZM3N ZM2N ZM4N ZM5N ZM7N ZM6N]
         if unselect               [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup pbone bone restriction unusual not_all_sel
      preds "Can't have both people run."
         if select                 [CR5S CR4S    0    0 AL1S AL0S    0    0]
         if unselect_near_select   [ZM5N ZM4N ZM2N ZM3N ZM1N ZM0N ZM6N ZM7N]
         if unselect               [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]

            alternate_definition [half] mainstream
   lateral_to_selectees
   setup 1x2 1x2 rotate restriction unusual not_all_sel
      predscantdo
         if select [CR0N AL0S]
         if 1x2_selectee_is_linelike_facing_cw  [ZM0W ZM1W]
         if 1x2_selectee_is_linelike_facing_ccw [ZM1W ZM0W]
   setup 2x1 1x2 rotate restriction unusual not_all_sel
      predscantdo
         if select [0 0]
         if 1x2_selectee_is_linelike_facing_cw  [ZM0W ZM1W]
         if 1x2_selectee_is_linelike_facing_ccw [ZM1W ZM0W]

            alternate_definition [cross] mainstream
   setup 1x4 1x4
      preds "Can't have both people or neither person cross run."
         if select_once_rem_from_unselect   [CR3S CR2S AL1S AL0S]
         if unselect_once_rem_from_select   [ZM1N ZM0N ZM3N ZM2N]
   setup 4x1 1x4
      preds "Can't have both people or neither person cross run."
         if select_once_rem_from_unselect   [0 0 0 0]  // No one in a column can be active.
         if unselect_once_rem_from_select   [ZM1N ZM0N ZM3N ZM2N]
   setup qtag qtag restriction unusual not_all_sel
      preds "Can't have both people run."
         if select_near_unselect   [   0    0 AL7S AL6S    0    0 CR3S CR2S]
         if unselect_near_select   [   0    0 ZM3N ZM2N    0    0 ZM7N ZM6N]
         if unselect               [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup pqtag qtag restriction unusual not_all_sel
      preds "Can't have both people run."
         if select_near_unselect   [   0    0    0    0    0    0    0    0]
         if unselect_near_select   [   0    0 ZM3N ZM2N    0    0 ZM7N ZM6N]
         if unselect               [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]

            alternate_definition [cross half] mainstream
   setup 1x4 2x2
      predscantdo
         if select [CR1E CR1E AL0W AL0W]
         if 1x4_selectee_of_far_side_is_linelike_facing_cw  [ZM0N ZM0N ZM2N ZM2N]
         if 1x4_selectee_of_far_side_is_linelike_facing_ccw [ZM3N ZM3N ZM1N ZM1N]
   setup 4x1 2x2
      predscantdo
         if select [0 0 0 0]
         if 1x4_selectee_of_far_side_is_linelike_facing_cw  [ZM0N ZM0N ZM2N ZM2N]
         if 1x4_selectee_of_far_side_is_linelike_facing_ccw [ZM3N ZM3N ZM1N ZM1N]
            alternate_definition [twisted] c4
   lateral_to_selectees
   setup 1x2 1x2 qualifier live none_sel
      array [ZM0N ZM1N]
   setup 1x2 1x2 qualifier live all_sel
      array [0 0]    // "Can't have both people run."
   // At this point one person is running around the other.
   // We need to know the orbit direction.
   setup 1x2 1x2 rotate
      predscantdocallinsetup
         if select_near_unselect [CR1S AL1N]
         if 1x2_selectee_is_linelike_facing_cw  [CM1N CM0N]
         if 1x2_selectee_is_linelike_facing_ccw [AM0S AM1S]
   setup 2x1 1x2 rotate
      predscantdocallinsetup
         if select           [0 0]
         if 1x2_selectee_is_linelike_facing_cw  [CM1N CM0N]
         if 1x2_selectee_is_linelike_facing_ccw [AM0S AM1S]

call "@6 1/2@C run" mainstream
            yield_if_ambiguous split_large_setups
   lateral_to_selectees
   setup 1x2 1x2 rotate restriction unusual not_all_sel
      predscantdo
         if select [CR0N AL0S]
         if 1x2_selectee_is_linelike_facing_cw  [ZM0W ZM1W]
         if 1x2_selectee_is_linelike_facing_ccw [ZM1W ZM0W]
   setup 2x1 1x2 rotate restriction unusual not_all_sel
      predscantdo
         if select [0 0]
         if 1x2_selectee_is_linelike_facing_cw  [ZM0W ZM1W]
         if 1x2_selectee_is_linelike_facing_ccw [ZM1W ZM0W]
            alternate_definition [cross] mainstream
   setup 1x4 2x2
      predscantdo
         if select [CR1E CR1E AL0W AL0W]
         if 1x4_selectee_of_far_side_is_linelike_facing_cw  [ZM0N ZM0N ZM2N ZM2N]
         if 1x4_selectee_of_far_side_is_linelike_facing_ccw [ZM3N ZM3N ZM1N ZM1N]
   setup 4x1 2x2
      predscantdo
         if select [0 0 0 0]
         if 1x4_selectee_of_far_side_is_linelike_facing_cw  [ZM0N ZM0N ZM2N ZM2N]
         if 1x4_selectee_of_far_side_is_linelike_facing_ccw [ZM3N ZM3N ZM1N ZM1N]

call "centers@C run" mainstream tag ctrrun
   setup 1x4 1x4
      array [ZM1N AL0S ZM3N CR2S]
   setup 4x1 1x4
      array [ZM1N    0 ZM3N    0]
            alternate_definition [half] mainstream
   setup 1x4 2x2
      predscantdo
         if 1x4_center_of_this_side_is_linelike_facing_cw  [ZM3N AL0W ZM1N    0]
         if 1x4_center_of_this_side_is_linelike_facing_ccw [ZM0N    0 ZM2N CR1E]
   setup 4x1 2x2
      predscantdo
         if 1x4_center_of_this_side_is_linelike_facing_cw  [ZM3N    0 ZM1N    0]
         if 1x4_center_of_this_side_is_linelike_facing_ccw [ZM0N    0 ZM2N    0]
            alternate_definition [cross] mainstream
   setup 1x4 1x4
      array [ZM1N CR2S ZM3N AL0S]
   setup 4x1 1x4
      array [ZM1N    0 ZM3N    0]
            alternate_definition [cross half] mainstream
   setup 1x4 2x2
      predscantdo
         if 1x4_center_of_far_side_is_linelike_facing_cw  [ZM0N CR1E ZM2N AL0W]
         if 1x4_center_of_far_side_is_linelike_facing_ccw [ZM3N CR1E ZM1N AL0W]
   setup 4x1 2x2
      predscantdo
         if 1x4_center_of_far_side_is_linelike_facing_cw  [ZM0N 0 ZM2N 0]
         if 1x4_center_of_far_side_is_linelike_facing_ccw [ZM3N 0 ZM1N 0]
            alternate_definition [cross grand] c3a
   setup 1x6 1x6
      array [ZM1N CR5S AL0S ZM4N AL2S CR3S]
   setup 6x1 1x6
      array [ZM1N    0    0 ZM4N    0    0]
   setup 1x8 1x8
      array [ZM1N CR2S CR7S AL0S ZM5N AL6S AL3S CR4S]
   setup 8x1 1x8
      array [ZM1N    0    0    0 ZM5N    0    0    0]
            alternate_definition [cross grand half] c3a
   setup 1x6 2x3
      array [ZM5N CR1E AL0W ZM3N AL1W CR2E]
   setup 1x8 2x4
      array [ZM7N CR1E CR2E AL0W ZM4N AL2W AL1W CR3E]
            alternate_definition [twisted] c4
   setup 1x4 2x2
      predscantdo
         if 1x4_center_of_this_side_is_linelike_facing_cw  [AM0W AL3E AM2W    0]
         if 1x4_center_of_this_side_is_linelike_facing_ccw [CM3E    0 CM1E CR2W]
   setup 4x1 2x2
      predscantdo
         if 1x4_center_of_this_side_is_linelike_facing_cw  [AM0W    0 AM2W    0]
         if 1x4_center_of_this_side_is_linelike_facing_ccw [CM3E    0 CM1E    0]

call "centers 1/2@C run" mainstream
   setup 1x4 2x2
      predscantdo
         if 1x4_center_of_this_side_is_linelike_facing_cw  [ZM3N AL0W ZM1N    0]
         if 1x4_center_of_this_side_is_linelike_facing_ccw [ZM0N    0 ZM2N CR1E]
   setup 4x1 2x2
      predscantdo
         if 1x4_center_of_this_side_is_linelike_facing_cw  [ZM3N    0 ZM1N    0]
         if 1x4_center_of_this_side_is_linelike_facing_ccw [ZM0N    0 ZM2N    0]
            alternate_definition [cross] mainstream
   setup 1x4 2x2
      predscantdo
         if 1x4_center_of_far_side_is_linelike_facing_cw  [ZM0N CR1E ZM2N AL0W]
         if 1x4_center_of_far_side_is_linelike_facing_ccw [ZM3N CR1E ZM1N AL0W]
   setup 4x1 2x2
      predscantdo
         if 1x4_center_of_far_side_is_linelike_facing_cw  [ZM0N 0 ZM2N 0]
         if 1x4_center_of_far_side_is_linelike_facing_ccw [ZM3N 0 ZM1N 0]

call "ends@C run" mainstream
   setup 1x4 1x4
      array [CR1S ZM0N AL3S ZM2N]
   setup 4x1 1x4
      array [0    ZM0N 0    ZM2N]
            alternate_definition [half] mainstream
   setup 1x4 2x2
      predscantdo
         if 1x4_end_of_this_side_is_linelike_facing_cw  [CR0E ZM3N 0 ZM1N]
         if 1x4_end_of_this_side_is_linelike_facing_ccw [0 ZM0N AL1W ZM2N]
   setup 4x1 2x2
      predscantdo
         if 1x4_end_of_this_side_is_linelike_facing_cw  [0 ZM3N 0 ZM1N]
         if 1x4_end_of_this_side_is_linelike_facing_ccw [0 ZM0N 0 ZM2N]
            alternate_definition [cross] mainstream
   setup 1x4 1x4
      array [CR3S ZM0N AL1S ZM2N]
   setup 4x1 1x4
      array [0    ZM0N 0    ZM2N]
            alternate_definition [cross half] mainstream
   setup 1x4 2x2
      predscantdo
         if 1x4_end_of_far_side_is_linelike_facing_cw  [CR1E ZM0N AL0W ZM2N]
         if 1x4_end_of_far_side_is_linelike_facing_ccw [CR1E ZM3N AL0W ZM1N]
   setup 4x1 2x2
      predscantdo
         if 1x4_end_of_far_side_is_linelike_facing_cw  [0 ZM0N 0 ZM2N]
         if 1x4_end_of_far_side_is_linelike_facing_ccw [0 ZM3N 0 ZM1N]
            alternate_definition [twisted] c4
   setup 1x4 2x2
      predscantdo
         if 1x4_end_of_this_side_is_linelike_facing_cw  [CR3W AM0E    0 AM2E]
         if 1x4_end_of_this_side_is_linelike_facing_ccw [   0 CM3W AL2E CM1W]
   setup 4x1 2x2
      predscantdo
         if 1x4_end_of_this_side_is_linelike_facing_cw  [   0 CM0E    0 CM2E]
         if 1x4_end_of_this_side_is_linelike_facing_ccw [   0 AM3W    0 AM1W]

call "ends 1/2@C run" mainstream
   setup 1x4 2x2
      predscantdo
         if 1x4_end_of_this_side_is_linelike_facing_cw  [CR0E ZM3N 0 ZM1N]
         if 1x4_end_of_this_side_is_linelike_facing_ccw [0 ZM0N AL1W ZM2N]
   setup 4x1 2x2
      predscantdo
         if 1x4_end_of_this_side_is_linelike_facing_cw  [0 ZM3N 0 ZM1N]
         if 1x4_end_of_this_side_is_linelike_facing_ccw [0 ZM0N 0 ZM2N]
            alternate_definition [cross] mainstream
   setup 1x4 2x2
      predscantdo
         if 1x4_end_of_far_side_is_linelike_facing_cw  [CR1E ZM0N AL0W ZM2N]
         if 1x4_end_of_far_side_is_linelike_facing_ccw [CR1E ZM3N AL0W ZM1N]
   setup 4x1 2x2
      predscantdo
         if 1x4_end_of_far_side_is_linelike_facing_cw  [0 ZM0N 0 ZM2N]
         if 1x4_end_of_far_side_is_linelike_facing_ccw [0 ZM3N 0 ZM1N]

call "_centers cross run in right wave" dontshow tag ctrxrun_in_rw
            left_means_mirror
   setup 1x4 1x4
      array [ZM1N CR2S ZM3N AL0S]
   setup 4x1 1x4 restriction unusual alwaysfail
      array [ZM1N    0 ZM3N    0]
   setup qtag qtag qualifier right wave_only
      array [0 0 0 AL6S 0 0 ZM7N 0]
   setup pqtag qtag
      array [ZM0N ZM1N 0 0 ZM4N ZM5N 0 0]
            alternate_definition [half] c1
   setup 1x4 2x2
      array [ZM3N CR1E ZM2N AL0W]
   setup qtag 2x4 rotate qualifier right wave_only
      array [0 0 0 AL6S 0 0 ZM5W 0]
   setup pqtag 2x4 rotate
      array [ZM7W ZM0W 0 0 ZM3W ZM4W 0 0]
            alternate_definition [grand] c3a
   setup 1x6 1x6
      array [ZM1N CR5S AL0S ZM4N AL2S CR3S]
   setup 6x1 1x6 restriction unusual alwaysfail
      array [ZM1N    0    0 ZM4N    0    0]
   setup 1x8 1x8
      array [ZM1N CR2S CR7S AL0S ZM5N AL6S AL3S CR4S]
   setup 8x1 1x8 restriction unusual alwaysfail
      array [ZM1N    0    0    0 ZM5N    0    0    0]
            alternate_definition [12matrix grand] c4
   setup 1x12 1x12
      array [ZM1N CR3S AL0S CR5S AL2S CR10S ZM7N AL9S CR6S AL11S CR8S AL4S]
   setup 12x1 1x12 restriction unusual alwaysfail
      array [ZM1N    0    0    0    0     0 ZM5N    0    0     0    0    0]
            alternate_definition [16matrix grand] c4
   setup 1x16 1x16
      array [ZM1N  CR3S AL0S  CR5S  AL2S  CR7S  AL4S CR14S
             ZM9N AL11S CR8S AL13S CR10S AL15S CR12S  AL6S]
   setup 16x1 1x16 restriction unusual alwaysfail
      array [ZM1N     0    0     0     0     0     0     0
             ZM5N     0    0     0     0     0     0     0]
            alternate_definition [grand half] c3a
   setup 1x6 2x3
      array [ZM5N CR1E AL0W ZM3N AL1W CR2E]
   setup 1x8 2x4
      array [ZM7N CR1E CR2E AL0W ZM4N AL2W AL1W CR3E]

call "_grand centers cross run" dontshow tag grandgrossrun
   setup 1x8 1x8
      array [ZM1N ZM3N CR4S ZM2N ZM5N ZM7N AL0S ZM6N]
   setup 8x1 1x8
      array [ZM1N ZM3N    0 ZM2N ZM5N ZM7N    0 ZM6N]
   setup 1x6 1x6
      array [ZM1N ZM2N CR3S ZM4N ZM5N AL0S]
   setup 6x1 1x6
      array [ZM1N ZM2N    0 ZM4N ZM5N    0]
   setup 1x4 1x4
      array [ZM1N CR2S ZM3N AL0S]
   setup 4x1 1x4
      array [ZM1N    0 ZM3N    0]
   setup 3x4 3x4 qualifier occupied_as_h
      array [ZM1N 0 0 ZM2N ZM5N AL10S ZM7N 0 0 ZM8N ZM11N CR4S]
   setup bone ptpd
      array [ZM1N ZM7N ZM6N AL0S ZM5N ZM3N ZM2N CR4S]
   setup pbone ptpd
      array [ZM1N ZM7N ZM6N    0 ZM5N ZM3N ZM2N    0]
   setup ptpd rigger
      array [ZM7N ZM0N CR2S ZM5N ZM3N ZM4N AL6S ZM1N]
   setup pptpd rigger
      array [ZM7N ZM0N    0 ZM5N ZM3N ZM4N    0 ZM1N]
   setup nptrglcw nxtrglcw
      array [ZM0N CR3S ZM1N ZM2N ZM4N AL7S ZM5N ZM6N]
   setup pnptrglcw nxtrglcw
      array [ZM0N    0 ZM1N ZM2N ZM4N    0 ZM5N ZM6N]
   setup nptrglccw nxtrglccw
      array [ZM0N ZM1N CR3S ZM2N ZM4N ZM5N AL7S ZM6N]
   setup pnptrglccw nxtrglccw
      array [ZM0N ZM1N    0 ZM2N ZM4N ZM5N    0 ZM6N]

call "fly the coop" c4
            visible_fractions gen_sting_is_inherited
   seq grandgrossrun []
   seq trade [inherit_gensting]
   seq grandgrossrun []
   seq trade [inherit_gensting]

call "_leads kickoff" dontshow tag leadkick
   setup 2x2 2x2
      array [CR1W AL0E AM3W CM2E]

call "_beaus kickoff" dontshow tag beaukick
   setup 1x2 1x2
      array [CR1W AM0W]

call "_belles kickoff" dontshow tag bellkick
   setup 1x2 1x2
      array [CM1E AL0E]

call "@6@C kickoff" c2 tag designeeskick
            yield_if_ambiguous

   // We used to put the 1x2 and 2x1 versions in front of this, apparently in
   // an effort to make "anchor the <anyone>, <anyone> kickoff" will work.
   // We no longer believe that this is a problem.  Furthermore, putting the
   // 2-person version first would make "heads nothing; boys kickoff" incorrect.
   // That is, incorrectly legal.  It is illegal.
            yield_if_ambiguous
   setup 2x2 2x2
      preds "Can't tell who is kicking off."
         if select        [CR1W AL0E AL3E CR2W]
         if kicker_coming [CM1E AM0W AM3W CM2E]
         if always        [ZM0N ZM1N ZM2N ZM3N]
   setup 1x2 1x2
      preds "Can't tell who is kicking off."
         if select        [CR1W AL0E]
         if kicker_coming [CM1E AM0W]
         if always        [ZM0N ZM1N]
   setup 2x1 1x2
      preds "Can't tell who is kicking off."
         if unselect [ZM0N ZM1N]
   setup spindle spindle
      preds "Can't tell who is kicking off."
         if unselect      [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup pspindle spindle
      preds "Can't tell who is kicking off."
         if select        [CR6W CR5W CR4W 0    AL2E AL1E AL0E 0]
         if kicker_coming [CM6E CM5E CM4E 0    AM2W AM1W AM0W 0]
         if unselect      [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup qtag qtag
      preds "Can't tell who is kicking off."
         if select        [CR1W AL0E AL3E CR2W AL5E CR4W CR7W AL6E]
         if kicker_coming [CM1E AM0W AM3W CM2E AM5W CM4E CM7E AM6W]
         if unselect      [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup dmd dmd
      preds "Can't tell who is kicking off."
         if unselect [ZM0N ZM1N ZM2N ZM3N]
   setup pmd dmd
      preds "Can't tell who is kicking off."
         if select        [0    CR3W 0    AL1E]
         if kicker_coming [0    CM3E 0    AM1W]
         if unselect      [ZM0N ZM1N ZM2N ZM3N]
            alternate_definition [cross] c2
   setup 1x4 1x4 qualifier live none
      preds "Can't have both people or neither person cross kickoff."
         if select_once_rem_from_unselect   [CR3W CR2W AL1E AL0E]
         if unselect_once_rem_from_select   [CM1E AM0W AM3W CM2E]
         if select                          [0    CR2W 0    AL0E]
   // When phantoms are present, we may get this wrong.  The code here assumes
   // that the selector is equivalent to "centers" or "ends".  If not, (for
   // example, it is something "side girls" with lots of phantoms), a nondesignee
   // may have a hard time telling what to do.  We hope that the "do your part"
   // warning will cause the caller to look carefully and decide whether this
   // is really what is wanted.  Of course, if the selector is literally "centers"
   // or "ends", the special case code below will save the day.
   setup 1x4 1x4 restriction alwaysfail
      predscantdocallinsetup
         if select [CR3W CR2W AL1E AL0E]
         if always [CM1E AM0W AM3W CM2E]

// This is the "old" definition, so that "wave the <anyone>" will work.
call "@6@C classic kickoff" dontshow tag designeeskickclassic
            yield_if_ambiguous
   setup 1x2 1x2
      preds "Can't tell who is kicking off."
         if select   [CR1W AL0E]
         if unselect [CM1E AM0W]
            yield_if_ambiguous
   setup 2x2 2x2
      preds "Can't tell who is kicking off."
         if select   [CR1W AL0E AL3E CR2W]
         if unselect [CM1E AM0W AM3W CM2E]

call "centers@C kickoff" c2 tag centerskick
   setup 1x4 1x4
      array [CM1E AL0E AM3W CR2W]
            alternate_definition [cross] c2
   setup 1x4 1x4
      array [CM1E CR2W AM3W AL0E]

call "ends@C kickoff" c2 tag endskick
   setup 1x4 1x4
      array [CR1W AM0W AL3E CM2E]
            alternate_definition [cross] c2
   setup 1x4 1x4
      array [CR3W AM0W AL1E CM2E]

call "@6@C kick off" c2
   alias designeeskick

call "centers@C kick off" c2
   alias centerskick

call "ends@C kick off" c2
   alias endskick

call "@6@C run by @9" c4x
            neednumber
   // It would be nice to have better selectors to catch
   // errors if both ends, or neither, are selected.
   setup 1x4 1x4 qualifier num 1 none
      preds "Can't tell who is running."
         if select_near_unselect   [CR1S 0    AL3S 0  ]
         if unselect_near_select   [ZM0N ZM0N ZM2N ZM2N]
         if unselect_near_unselect [ZM0N ZM1N ZM2N ZM3N]
   setup 1x4 1x4 qualifier num 2 none
      preds "Can't tell who is running."
         if select_near_unselect   [CR3S 0    AL1S 0  ]
         if unselect_near_select   [ZM0N ZM0N ZM2N ZM2N]
         if unselect_near_unselect [ZM0N ZM3N ZM2N ZM1N]
   setup 1x4 1x4 qualifier num 3 none
      preds "Can't tell who is running."
         if select_near_unselect   [CR2S 0    AL0S 0  ]
         if unselect_near_select   [ZM1N ZM0N ZM3N ZM2N]
         if unselect_near_unselect [ZM1N ZM3N ZM3N ZM1N]
   setup 1x6 1x6 qualifier num 1 none
      preds "Can't tell who is running."
         if select   [0    0    AL1S 0    0    CR4S]
         if unselect [ZM0N ZM2N 0    ZM3N ZM5N 0   ]
   setup 1x6 1x6 qualifier num 2 none
      preds "Can't tell who is running."
         if select   [0    0    AL0S 0    0    CR3S]
         if unselect [ZM1N ZM2N 0    ZM4N ZM5N 0   ]
   setup 1x8 1x8 qualifier num 1 none
      preds "Can't tell who is running."
         if select                 [CR1S 0    0    0    AL5S 0    0    0]
         if unselect_near_unselect [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
         if unselect_near_select   [ZM0N ZM0N ZM2N ZM3N ZM4N ZM4N ZM6N ZM7N]
         if always                 [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 1x8 1x8 qualifier num 2 none
      preds "Can't tell who is running."
         if select              [CR3S 0    0    0    AL7S 0    0    0]
         if person_select_plus5 [ZM0N ZM1N ZM2N ZM1N ZM4N ZM5N ZM6N ZM5N]
         if person_select_plus7 [ZM0N ZM0N ZM2N ZM3N ZM4N ZM4N ZM6N ZM7N]
         if always              [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 1x8 1x8 qualifier num 3 none
      preds "Can't tell who is running."
         if select              [CR2S 0    0    0    AL6S 0    0    0]
         if person_select_plus5 [ZM0N ZM1N ZM2N ZM1N ZM4N ZM5N ZM6N ZM5N]
         if person_select_plus6 [ZM0N ZM1N ZM3N ZM3N ZM4N ZM5N ZM7N ZM7N]
         if person_select_plus7 [ZM0N ZM0N ZM2N ZM3N ZM4N ZM4N ZM6N ZM7N]
         if always              [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 1x8 1x8 qualifier num 4 none    // This one should be just one end (unsymmetrical).
      preds "Can't tell who is running."
         if select              [CR6S 0    0    0    AL2S 0    0    0]
         if person_select_plus5 [ZM0N ZM1N ZM2N ZM1N ZM4N ZM5N ZM6N ZM5N]
         if person_select_plus6 [ZM0N ZM1N ZM3N ZM3N ZM4N ZM5N ZM7N ZM7N]
         if person_select_plus7 [ZM0N ZM0N ZM2N ZM3N ZM4N ZM4N ZM6N ZM7N]
         if person_select_plus2 [ZM0N ZM1N ZM6N ZM3N ZM4N ZM5N ZM2N ZM7N]
         if always              [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 1x8 1x8 qualifier num 5 none    // This one should be just one end (unsymmetrical).
      preds "Can't tell who is running."
         if select              [CR7S 0    0    0    AL3S 0    0    0]
         if person_select_plus5 [ZM0N ZM1N ZM2N ZM1N ZM4N ZM5N ZM6N ZM5N]
         if person_select_plus6 [ZM0N ZM1N ZM3N ZM3N ZM4N ZM5N ZM7N ZM7N]
         if person_select_plus7 [ZM0N ZM0N ZM2N ZM3N ZM4N ZM4N ZM6N ZM7N]
         if person_select_plus2 [ZM0N ZM1N ZM6N ZM3N ZM4N ZM5N ZM2N ZM7N]
         if person_select_plus1 [ZM0N ZM1N ZM2N ZM2N ZM4N ZM5N ZM6N ZM6N]
         if always              [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 1x8 1x8 qualifier num 6 none    // This one should be just one end (unsymmetrical).
      preds "Can't tell who is running."
         if select              [CR5S 0    0    0    AL1S 0    0    0]
         if person_select_plus5 [ZM0N ZM1N ZM2N ZM1N ZM4N ZM5N ZM6N ZM5N]
         if person_select_plus6 [ZM0N ZM1N ZM3N ZM3N ZM4N ZM5N ZM7N ZM7N]
         if person_select_plus7 [ZM0N ZM0N ZM2N ZM3N ZM4N ZM4N ZM6N ZM7N]
         if person_select_plus2 [ZM0N ZM1N ZM6N ZM3N ZM4N ZM5N ZM2N ZM7N]
         if person_select_plus1 [ZM0N ZM1N ZM2N ZM2N ZM4N ZM5N ZM6N ZM6N]
         if person_select_plus3 [ZM0N ZM3N ZM2N ZM3N ZM4N ZM7N ZM6N ZM7N]
         if always              [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 1x8 1x8 qualifier num 7 none    // This one should be just one end (unsymmetrical).
      preds "Can't tell who is running."
         if select              [CR4S 0    0    0    AL0S 0    0    0]
         if person_select_plus1 [0    0    0    ZM2N 0    0    0    ZM6N]
         if person_select_plus2 [0    0    ZM6N 0    0    0    ZM2N 0]
         if person_select_plus3 [0    ZM3N 0    0    0    ZM7N 0    0]
         if person_select_plus4 [ZM1N 0    0    0    ZM5N 0    0    0]
         if person_select_plus5 [0    0    0    ZM1N 0    0    0    ZM5N]
         if person_select_plus6 [0    0    ZM3N 0    0    0    ZM7N 0]
         if person_select_plus7 [0    ZM0N 0    0    0    ZM4N 0    0]
            alternate_definition [cross] c3
   setup 1x8 1x8 qualifier num 1 none
      preds "Can't tell who is running."
         if select   [0    0    CR7S 0    0    0    AL3S 0   ]
         if unselect [ZM0N ZM1N 0    ZM2N ZM4N ZM5N 0    ZM6N]
   setup 1x8 1x8 qualifier num 2 none
      preds "Can't tell who is running."
         if select   [0    0    CR5S 0    0    0    AL1S 0   ]
         if unselect [ZM0N ZM3N 0    ZM2N ZM4N ZM7N 0    ZM6N]
   setup 1x8 1x8 qualifier num 3 none
      preds "Can't tell who is running."
         if select   [0    0    CR4S 0    0    0    AL0S 0   ]
         if unselect [ZM1N ZM3N 0    ZM2N ZM5N ZM7N 0    ZM6N]
   setup 1x6 1x6 qualifier num 1 none
      preds "Can't tell who is running."
         if select   [0    0    CR4S 0    0    AL1S]
         if unselect [ZM0N ZM2N 0    ZM3N ZM5N 0   ]
   setup 1x6 1x6 qualifier num 2 none
      preds "Can't tell who is running."
         if select   [0    0    CR3S 0    0    AL0S]
         if unselect [ZM1N ZM2N 0    ZM4N ZM5N 0   ]

call "@6@C kick by @9" c4
            neednumber
   // It would be nice to have better selectors to catch
   // errors if both ends, or neither, are selected.
   setup 1x4 1x4 qualifier num 1 none
      preds "Can't tell who is kicking."
         if select_near_unselect   [CR1W 0    AL3E 0  ]
         if unselect_near_select   [ZM0N AM0W ZM2N CM2E]
         if unselect_near_unselect [ZM0N ZM1N ZM2N ZM3N]
   setup 1x4 1x4 qualifier num 2 none
      preds "Can't tell who is kicking."
         if select_near_unselect   [CR3W 0    AL1E 0  ]
         if unselect_near_select   [ZM0N AM0W ZM2N CM2E]
         if unselect_near_unselect [ZM0N CM3E ZM2N AM1W]
   setup 1x4 1x4 qualifier num 3 none
      preds "Can't tell who is kicking."
         if select_near_unselect   [CR2W 0    AL0E 0  ]
         if unselect_near_select   [CM1E AM0W AM3W CM2E]
         if unselect_near_unselect [CM1E CM3E AM3W AM1W]
   setup 1x6 1x6 qualifier num 1 none
      preds "Can't tell who is kicking."
         if select   [0    0    AL1E 0    0    CR4W]
         if unselect [ZM0N CM2E 0    ZM3N AM5W 0   ]
   setup 1x6 1x6 qualifier num 2 none
      preds "Can't tell who is kicking."
         if select   [0    0    AL0E 0    0    CR3W]
         if unselect [CM1E CM2E 0    AM4W AM5W 0   ]
            alternate_definition [cross] c3
   setup 1x8 1x8 qualifier num 1 none
      preds "Can't tell who is kicking."
         if select   [0    0    CR7W 0    0    0    AL3E 0   ]
         if unselect [ZM0N ZM1N 0    CM2E ZM4N ZM5N 0    AM6W]
   setup 1x8 1x8 qualifier num 2 none
      preds "Can't tell who is kicking."
         if select   [0    0    CR5W 0    0    0    AL1E 0   ]
         if unselect [ZM0N CM3E 0    CM2E ZM4N AM7W 0    AM6W]
   setup 1x8 1x8 qualifier num 3 none
      preds "Can't tell who is kicking."
         if select   [0    0    CR4W 0    0    0    AL0E 0   ]
         if unselect [CM1E CM3E 0    CM2E AM5W AM7W 0    AM6W]
   setup 1x6 1x6 qualifier num 1 none
      preds "Can't tell who is kicking."
         if select   [0    0    CR4W 0    0    AL1E]
         if unselect [ZM0N CM2E 0    ZM3N AM5W 0   ]
   setup 1x6 1x6 qualifier num 2 none
      preds "Can't tell who is kicking."
         if select   [0    0    CR3W 0    0    AL0E]
         if unselect [CM1E CM2E 0    AM4W AM5W 0   ]

call "_bounce the @6 part 1" dontshow tag bounce1
   // We set up roll info, even though no one turns.
   // This is slightly bogus, but moderately glorious.
   setup 1x4 2x2 restriction forbidden 2fl_only
      array [ZR0N ZR1N ZL1N ZL0N]
            alternate_definition [single] c2
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [ZR0W ZL0W]
            alternate_definition [3x3] c3
   setup 1x6 2x3 restriction forbidden 3x3couples_only
      array [ZR0N ZR1N ZR2N ZL2N ZL1N ZL0N]
            alternate_definition [4x4] c3
   setup 1x8 2x4 restriction forbidden 4x4couples_only
      array [ZR0N ZR1N ZR3N ZR2N ZL3N ZL2N ZL0N ZL1N]

call "_bounce part 2" dontshow tag bounce2
   setup 1x1 1x1
      preds "Can't tell who is designated."
         if select_and_roll_is_cw  [CR0S]
         if select_and_roll_is_ccw [AL0S]
         if select   [0S]    // Someone is screwing around with interruptions -- just turn around blindly.
         if unselect [ZM0N]
            alternate_definition [half] c2
   setup 1x1 1x1
      preds "Can't tell who is designated."
         if select_and_roll_is_cw  [CR0E]
         if select_and_roll_is_ccw [AL0W]
         if select   [0]
         if unselect [ZM0N]

call "_bounce beaus part 2" dontshow tag bouncebo2
   setup 1x2 1x2
      preds "Can't tell who is designated."
         if roll_is_cw  [CR0S ZM1N]
         if roll_is_ccw [AL0S ZM1N]
         if always      [  0S ZM1N]  // This person, if a beau, just turns around blindly.
            alternate_definition [half] c2
   setup 1x2 1x2
      preds "Can't tell who is designated."
         if roll_is_cw  [CR0E ZM1N]
         if roll_is_ccw [AL0W ZM1N]
         if always      [   0 ZM1N]  // This person, if a beau, loses

call "_bounce belles part 2" dontshow tag bouncebel2
   setup 1x2 1x2
      preds "Can't tell who is designated."
         if roll_is_cw  [ZM0N CR1S]
         if roll_is_ccw [ZM0N AL1S]
         if always      [ZM0N   1S]  // This person, if a belle, just turns around blindly.
            alternate_definition [half] c2
   setup 1x2 1x2
      preds "Can't tell who is designated."
         if roll_is_cw  [ZM0N CR1E]
         if roll_is_ccw [ZM0N AL1W]
         if always      [ZM1N    0]  // This person, if a belle, loses

call "bounce the beaus" c2
            visible_fractions diamond_is_legal
   // We do this so that "single" or "3x3" or "4x4" will be illegal.
   seq bounce1 [inherit_diamond]
   seq bouncebo2 [inherit_diamond]

call "bounce the belles" c2
            visible_fractions diamond_is_legal
   // We do this so that "single" or "3x3" or "4x4" will be illegal.
   seq bounce1 [inherit_diamond]
   seq bouncebel2 [inherit_diamond]

call "bounce the @6" c2
            visible_fractions yield_if_ambiguous
            single_is_inherited nxn_is_inherited diamond_is_legal
   // Selector identities do *not* get re-evaluated between parts of a
   // sequential call, which makes this work.  Compare wave the <anyone>.
   seq bounce1 [seq_never_re_evaluate inherit_single inherit_nxn inherit_diamond]
   seq bounce2 [inherit_diamond]

call "more or less bounce the @6" c4
            single_is_inherited nxn_is_inherited
   setup 2x4 2x4 rotate restriction forbidden 2fl_only
      preds "Can't tell who is designated."
         if select   [CR7S CR0S AL7N AL0N AL2S AL5S CR2N CR5N]
         if unselect [ZM7W ZM0W ZM7W ZM0W ZM2W ZM5W ZM2W ZM5W]
            alternate_definition [single] c2
   setup 2x2 1x4 rotate restriction forbidden wave_only
      preds "Can't tell who is designated."
         if select   [CR0S AL0N AL3S CR3N]
         if unselect [ZM0W ZM0W ZM3W ZM3W]
            alternate_definition [3x3] c3
   setup 2x6 3x4 rotate restriction forbidden 3x3couples_only
      preds "Can't tell who is designated."
         if select   [CR9S CR10S CR0S AL9N AL10N AL0N AL2S AL5S AL7S CR2N CR5N CR7N]
         if unselect [ZM9W ZM10W ZM0W ZM9W ZM10W ZM0W ZM2W ZM5W ZM7W ZM2W ZM5W ZM7W]
            alternate_definition [4x4] c3
   setup 2x8 4x4 restriction forbidden 4x4couples_only
      preds "Can't tell who is designated."
         if select   [CR12W CR13W CR14W CR0W AL12E AL13E AL14E AL0E AL2W AL7W AL11W AL9W CR2E CR7E CR11E CR9E]
         if unselect [ZM12N ZM13N ZM14N ZM0N ZM12N ZM13N ZM14N ZM0N ZM2N ZM7N ZM11N ZM9N ZM2N ZM7N ZM11N ZM9N]

call "less or more bounce the @6" c4
            single_is_inherited nxn_is_inherited
   setup 2x4 2x4 rotate restriction forbidden 2fl_only
      preds "Can't tell who is designated."
         if select   [CR7N CR0N AL7S AL0S AL2N AL5N CR2S CR5S]
         if unselect [ZM7W ZM0W ZM7W ZM0W ZM2W ZM5W ZM2W ZM5W]
            alternate_definition [single] c2
   setup 2x2 1x4 rotate restriction forbidden wave_only
      preds "Can't tell who is designated."
         if select   [CR0N AL0S AL3N CR3S]
         if unselect [ZM0W ZM0W ZM3W ZM3W]
            alternate_definition [3x3] c3
   setup 2x6 3x4 rotate restriction forbidden 3x3couples_only
      preds "Can't tell who is designated."
         if select   [CR9N CR10N CR0N AL9S AL10S AL0S AL2N AL5N AL7N CR2S CR5S CR7S]
         if unselect [ZM9W ZM10W ZM0W ZM9W ZM10W ZM0W ZM2W ZM5W ZM7W ZM2W ZM5W ZM7W]
            alternate_definition [4x4] c3
   setup 2x8 4x4 restriction forbidden 4x4couples_only
      preds "Can't tell who is designated."
         if select   [CR12E CR13E CR14E CR0E AL12W AL13W AL14W AL0W AL2E AL7E AL11E AL9E CR2W CR7W CR11W CR9W]
         if unselect [ZM12N ZM13N ZM14N ZM0N ZM12N ZM13N ZM14N ZM0N ZM2N ZM7N ZM11N ZM9N ZM2N ZM7N ZM11N ZM9N]

call "bounce" c2
            single_is_inherited nxn_is_inherited
   setup 1x4 2x2 restriction forbidden 2fl_only
      array [ZM0N ZM1N ZM1N ZM0N]
            alternate_definition [single] c2
   setup 1x2 1x2 rotate restriction forbidden miniwaves
      array [ZM0W ZM0W]
            alternate_definition [3x3] c3
   setup 1x6 2x3 restriction forbidden 3x3couples_only
      array [ZM0N ZM1N ZM2N ZM2N ZM1N ZM0N]
            alternate_definition [4x4] c3
   setup 1x8 2x4 restriction forbidden 4x4couples_only
      array [ZM0N ZM1N ZM3N ZM2N ZM3N ZM2N ZM0N ZM1N]

call "_mark time part 1" dontshow tag marktime1
   setup 4x2 2x4 restriction wave_only
      array [CM7E CM6E CR5S CR4S AL3S AL2S AM1W AM0W]
            alternate_definition [single] c4a
   setup 2x2 2x2 restriction wave_only
      array [CR1S AL0S AM3W CM2E]
            alternate_definition [3x3] c4
   setup 6x2 2x6 restriction wave_only
      array [CM11E CM10E CM9E CR8S CR7S CR6S AL5S AL4S AL3S AM2W AM1W AM0W]
            alternate_definition [4x4] c4
   setup 8x2 2x8 restriction wave_only
      array [CM15E CM14E CM13E CM12E CR11S CR10S CR9S CR8S
            AL7S AL6S AL5S AL4S AM3W AM2W AM1W AM0W]

call "_mark time part 2" dontshow tag marktime2
   setup 2x4 2x4 rotate
      array [CR0E CR7E AL0E AL7E 0 0 0 0]
   setup 4x2 2x4 rotate
      array [CR5S CR2S 0 0 0 0 AL1N AL6N]
            alternate_definition [single] c4a
   setup 2x2 dmd rotate
      array [CR0E AL0E AL3N CR1S]
            alternate_definition [3x3] c4
   setup 2x6 3x4 rotate
      array [CR0E CR10E CR9E AL0E AL10E AL9E 0 0 0 0 0 0]
   setup 6x2 3x4 rotate
      array [CR7S CR5S CR2S 0 0 0 0 0 0 AL1N AL11N AL8N]
            alternate_definition [4x4] c4
   setup 2x8 4x4
      array [CR0S CR14S CR13S CR12S AL0S AL14S AL13S AL12S 0 0 0 0 0 0 0 0]
   setup 8x2 4x4
      array [CR9W CR11W CR7W CR2W 0 0 0 0 0 0 0 0 AL1E AL3E AL15E AL10E]

call "mark time" c4a
            first_part_visible single_is_inherited bigmatrix_is_inherited nxn_is_inherited
   seq marktime1 [inherit_single inherit_bigmatrix inherit_nxn]
   seq marktime2 [inherit_single inherit_bigmatrix inherit_nxn]

call "@6 mark time" c4a
   setup 4x2 2x4 rotate
      preds "Selected people are improper."
         if select_near_select_or_phantom [    0     0 CCR6N CCR1N AAL2S AAL5S     0     0]
         if unselect_near_unselect        [CAL3S CAL4S  CR3S  CR4S  AL7N  AL0N ACR7N ACR0N]
            alternate_definition [single] c4a
   setup 2x2 1x4
      predsnoselect
         if select   [CCR1E AAL3W     0     0]
         if unselect [ CR2W  AL0E ACR0E CAL2W]

call "box counter rotate" a2 tag boxctrrot
   simple_funny
   setup 2x2 2x2
      array [CR1E AL0W AL1W CR0E]
            alternate_definition [half] a2
   setup 2x2 2x2 plus_eighth_rotation
      array [CR0N AL0W AL1W CR3N]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate
      array [CR0N AL0S]
            alternate_definition [3x3] c4
   setup 3x2 2x3 rotate restriction controversial 3x3couples_only
      array [CR0N CR1N CR2N AL0S AL1S AL2S]
            alternate_definition [4x4] c4
   setup 4x2 2x4 rotate restriction controversial 4x4couples_only
      array [CR0N CR1N CR2N CR3N AL0S AL1S AL2S AL3S]
            alternate_definition [magic] c2
   setup 2x2 2x2 qualifier magic_only restriction unusual alwaysfail
      array [CR1E AL0W CR0E AL1W]

call "_circulate and quarter in" dontshow tag circ_and_quarter_in
            visible_fractions
   seq box_circulate_maybe_diamond []
   seq quarterin []

call "rotate @b" c2 tag rotn
           reverse_means_mirror neednumber
   setup 4x2 1x8        restriction forbidden levelc3 qualifier num 0 couples_only
      array [CR1E CR2E AL6W AL5W AL4W AL7W CR3E CR0E]
   setup 4x2 1x8 rotate restriction forbidden levelc3 qualifier num 1 couples_only
      array [CAL5W CAL6W AL2E AL1E AL0E AL3E CAL7W CAL4W]
   setup 4x2 1x8        restriction forbidden levelc3 qualifier num 2 couples_only
      array [CAL5W CAL6W AL2E AL1E AL0E AL3E CAL7W CAL4W]
   setup 4x2 1x8 rotate restriction forbidden levelc3 qualifier num 3 couples_only
      array [CAL1E CAL2E AL6W AL5W AL4W AL7W CAL3E CAL0E]
   // These are only active when there are T-boned people.  See tests lh05, zh03.
   setup 2x4 2x4 rotate qualifier tbone num 0 couples_only
      array [AL6S AL7S AL1S AL0S CR3N CR2N CR4N CR5N]
   setup 2x4 1x8        qualifier tbone num 1 couples_only
      array [AL1S AL0S AL7S AL6S CAL4N CAL5N CAL2N CAL3N]
   setup 2x4 2x4 rotate qualifier tbone num 2 couples_only
      array [AL5N AL4N AL2N AL3N CAL0S CAL1S CAL7S CAL6S]
   setup 2x4 1x8        qualifier tbone num 3 couples_only
      array [AL3N AL2N AL5N AL4N CAL6S CAL7S CAL0S CAL1S]
   setup 2x2 1x4 rotate qualifier num 0 couples_only
      array [AL1S AL0S CR2N CR3N]
   setup 2x2 1x4        qualifier num 1 couples_only
      array [AL1S AL0S CAL2N CAL3N]
   setup 2x2 1x4 rotate qualifier num 2 couples_only
      array [AL3N AL2N CAL0S CAL1S]
   setup 2x2 1x4        qualifier num 3 couples_only
      array [AL3N AL2N CAL0S CAL1S]

            /* This variant of the call is only C1, even though the call "rotate"
               itself is C2.  This makes it possible to do a
               squared-set single rotate at C1.  The squared-set rotate,
               legal at C1, invokes this.  Level-checking is not done on
               invocation, but it is done on alternate definitions of invoked
               calls.  Declaring the single version of this call to be C1
               when the call itself is C2 therefore makes this legal from a
               squared set.  Direct use of single rotate at C1 is not legal,
               because it won't get past the C2 level in the call header. */

            alternate_definition [single] c1
   setup 4x2 2x4        restriction forbidden levelc3 qualifier num 0 none
      array [CR0E CR1E AL2W AL3W AL4W AL5W CR6E CR7E]
   setup 4x2 2x4 rotate restriction forbidden levelc3 qualifier num 1 none
      array [CAL4W CAL5W AL6E AL7E AL0E AL1E CAL2W CAL3W]
   setup 4x2 2x4        restriction forbidden levelc3 qualifier num 2 none
      array [CAL4W CAL5W AL6E AL7E AL0E AL1E CAL2W CAL3W]
   setup 4x2 2x4 rotate restriction forbidden levelc3 qualifier num 3 none
      array [CAL0E CAL1E AL2W AL3W AL4W AL5W CAL6E CAL7E]
   setup pqtag qtag        restriction forbidden levelc3 qualifier num 0 none
      array [CR0E AL1W AL2W AL3W AL4W CR5E CR6E CR7E]
   setup pqtag qtag rotate restriction forbidden levelc3 qualifier num 1 none
      array [CAL4W AL5E AL6E AL7E AL0E CAL1W CAL2W CAL3W]
   setup pqtag qtag        restriction forbidden levelc3 qualifier num 2 none
      array [CAL4W AL5E AL6E AL7E AL0E CAL1W CAL2W CAL3W]
   setup pqtag qtag rotate restriction forbidden levelc3 qualifier num 3 none
      array [CAL0E AL1W AL2W AL3W AL4W CAL5E CAL6E CAL7E]

   // These are only active when there are T-boned people.  See tests lh05, zh03.
   setup 2x4 2x4        qualifier tbone num 0 none
      array [AL0W AL1W AL2W AL3W CR4E CR5E CR6E CR7E]
   setup 2x4 2x4        qualifier tbone num 1 none
      array [AL7S AL0S AL5S AL2S CAL3N CAL4N CAL1N CAL6N]
   setup 2x4 2x4        qualifier tbone num 2 none
      array [AL6E AL7E AL4E AL5E CAL2W CAL3W CAL0W CAL1W]
   setup 2x4 2x4        qualifier tbone num 3 none
      array [AL1N AL6N AL3N AL4N CAL5S CAL2S CAL7S CAL0S]
   setup 2x2 2x2                qualifier num 0 none
      array [AL0W AL1W CR2E CR3E]
   setup 2x2 2x2 other_elongate qualifier num 1 none
      array [AL3S AL0S CAL1N CAL2N]
   setup 2x2 2x2                qualifier num 2 none
      array [AL2E AL3E CAL0W CAL1W]
   setup 2x2 2x2 other_elongate qualifier num 3 none
      array [AL1N AL2N CAL3S CAL0S]

   setup trngl4 trngl4 restriction forbidden levelc3 qualifier num 2 none
      array [CAL4W CAL5W AL6E AL7E AL0E AL1E CAL2W CAL3W]
   setup ptrngl4 trngl4 restriction forbidden levelc3 qualifier num 2 none
      array [    0     0 AL6W AL7E    0    0 CAL2E CAL3W]

   setup 2x1 1x2        restriction forbidden levelc3 qualifier num 0 none
      array [CR0E AL1W]
   setup 2x1 1x2 rotate restriction forbidden levelc3 qualifier num 1 none
      array [CAL1W AL0E]
   setup 2x1 1x2        restriction forbidden levelc3 qualifier num 2 none
      array [CAL1W AL0E]
   setup 2x1 1x2 rotate restriction forbidden levelc3 qualifier num 3 none
      array [CAL0E AL1W]
   setup 4x1 1x4        restriction forbidden levelc3 qualifier num 0 none
      array [CR0E CR1E AL2W AL3W]
   setup 4x1 1x4 rotate restriction forbidden levelc3 qualifier num 1 none
      array [CAL2W CAL3W AL0E AL1E]
   setup 4x1 1x4        restriction forbidden levelc3 qualifier num 2 none
      array [CAL2W CAL3W AL0E AL1E]
   setup 4x1 1x4 rotate restriction forbidden levelc3 qualifier num 3 none
      array [CAL0E CAL1E AL2W AL3W]
   setup 6x1 1x6        restriction forbidden levelc3 qualifier num 0 none
      array [CR0E CR1E CR2E AL3W AL4W AL5W]
   setup 6x1 1x6 rotate restriction forbidden levelc3 qualifier num 1 none
      array [CAL3W CAL4W CAL5W AL0E AL1E AL2E]
   setup 6x1 1x6        restriction forbidden levelc3 qualifier num 2 none
      array [CAL3W CAL4W CAL5W AL0E AL1E AL2E]
   setup 6x1 1x6 rotate restriction forbidden levelc3 qualifier num 3 none
      array [CAL0E CAL1E CAL2E AL3W AL4W AL5W]
   setup 8x1 1x8        restriction forbidden levelc3 qualifier num 0 none
      array [CR0E CR1E CR2E CR3E AL4W AL5W AL6W AL7W]
   setup 8x1 1x8 rotate restriction forbidden levelc3 qualifier num 1 none
      array [CAL4W CAL5W CAL6W CAL7W AL0E AL1E AL2E AL3E]
   setup 8x1 1x8        restriction forbidden levelc3 qualifier num 2 none
      array [CAL4W CAL5W CAL6W CAL7W AL0E AL1E AL2E AL3E]
   setup 8x1 1x8 rotate restriction forbidden levelc3 qualifier num 3 none
      array [CAL0E CAL1E CAL2E CAL3E AL4W AL5W AL6W AL7W]
   setup pptpd ptpd        restriction forbidden levelc3 qualifier num 0 none
      array [CR0E CR1E CR2E CR3E AL4W AL5W AL6W AL7W]
   setup pptpd ptpd rotate restriction forbidden levelc3 qualifier num 1 none
      array [CAL4W CAL5W CAL6W CAL7W AL0E AL1E AL2E AL3E]
   setup pptpd ptpd        restriction forbidden levelc3 qualifier num 2 none
      array [CAL4W CAL5W CAL6W CAL7W AL0E AL1E AL2E AL3E]
   setup pptpd ptpd rotate restriction forbidden levelc3 qualifier num 3 none
      array [CAL0E CAL1E CAL2E CAL3E AL4W AL5W AL6W AL7W]
            alternate_definition [3x3] c4
   setup 2x3 1x6 rotate restriction forbidden 3x3couples_only qualifier num 0 none
      array [AL2S AL1S AL0S CR3N CR4N CR5N]
   setup 2x3 1x6        restriction forbidden 3x3couples_only qualifier num 1 none
      array [AL2S AL1S AL0S CAL3N CAL4N CAL5N]
   setup 2x3 1x6 rotate restriction forbidden 3x3couples_only qualifier num 2 none
      array [AL5N AL4N AL3N CAL0S CAL1S CAL2S]
   setup 2x3 1x6        restriction forbidden 3x3couples_only qualifier num 3 none
      array [AL5N AL4N AL3N CAL0S CAL1S CAL2S]
   setup 4x3 1x12        restriction forbidden 3x3couples_only qualifier num 0 none
      array [CR2E CR5E AL11W AL8W AL7W AL10W AL6W AL9W CR3E CR0E CR1E CR4E]
   setup 4x3 1x12 rotate restriction forbidden 3x3couples_only qualifier num 1 none
      array [CAL8W CAL11W AL5E AL2E AL1E AL4E AL0E AL3E CAL9W CAL6W CAL7W CAL10W]
   setup 4x3 1x12        restriction forbidden 3x3couples_only qualifier num 2 none
      array [CAL8W CAL11W AL5E AL2E AL1E AL4E AL0E AL3E CAL9W CAL6W CAL7W CAL10W]
   setup 4x3 1x12 rotate restriction forbidden 3x3couples_only qualifier num 3 none
      array [CAL2E CAL5E AL11W AL8W AL7W AL10W AL6W AL9W CAL3E CAL0E CAL1E CAL4E]
            alternate_definition [4x4] c4
   setup 2x4 1x8 rotate restriction forbidden 4x4couples_only qualifier num 0 none
      array [AL2S AL3S AL1S AL0S CR4N CR5N CR7N CR6N]
   setup 2x4 1x8        restriction forbidden 4x4couples_only qualifier num 1 none
      array [AL2S AL3S AL1S AL0S CAL4N CAL5N CAL7N CAL6N]
   setup 2x4 1x8 rotate restriction forbidden 4x4couples_only qualifier num 2 none
      array [AL6N AL7N AL5N AL4N CAL0S CAL1S CAL3S CAL2S]
   setup 2x4 1x8        restriction forbidden 4x4couples_only qualifier num 3 none
      array [AL6N AL7N AL5N AL4N CAL0S CAL1S CAL3S CAL2S]
   setup 4x4 1x16 rotate restriction forbidden 4x4couples_only qualifier num 0 none
      array [AL0S AL4S CR12N AL5S CR8N CR9N CR10N CR13N CR11N CR15N AL7S CR14N AL3S AL2S AL1S AL6S]
   setup 4x4 1x16        restriction forbidden 4x4couples_only qualifier num 1 none
      array [AL0S AL4S CAL12N AL5S CAL8N CAL9N CAL10N CAL13N CAL11N CAL15N AL7S CAL14N AL3S AL2S AL1S AL6S]
   setup 4x4 1x16 rotate restriction forbidden 4x4couples_only qualifier num 2 none
      array [AL8N AL12N CAL4S AL13N CAL0S CAL1S CAL2S CAL5S CAL3S CAL7S AL15N CAL6S AL11N AL10N AL9N AL14N]
   setup 4x4 1x16        restriction forbidden 4x4couples_only qualifier num 3 none
      array [AL8N AL12N CAL4S AL13N CAL0S CAL1S CAL2S CAL5S CAL3S CAL7S AL15N CAL6S AL11N AL10N AL9N AL14N]
            alternate_definition [3x3 single] c4
   setup 2x3 2x3        restriction controversial 3x3couples_only qualifier num 0 none
      array [AL0W AL1W AL2W CR3E CR4E CR5E]
   setup 2x3 2x3 rotate restriction controversial 3x3couples_only qualifier num 1 none
      array [AL3E AL4E AL5E CAL0W CAL1W CAL2W]
   setup 2x3 2x3        restriction controversial 3x3couples_only qualifier num 2 none
      array [AL3E AL4E AL5E CAL0W CAL1W CAL2W]
   setup 2x3 2x3 rotate restriction controversial 3x3couples_only qualifier num 3 none
      array [AL0W AL1W AL2W CAL3E CAL4E CAL5E]
   setup 4x3 3x4        restriction controversial 3x3couples_only qualifier num 0 none
      array [CR0E CR1E AL2W AL3W AL4W AL5W AL6W AL7W CR8E CR9E CR10E CR11E]
   setup 4x3 3x4 rotate restriction controversial 3x3couples_only qualifier num 1 none
      array [CAL6W CAL7W AL8E AL9E AL10E AL11E AL0E AL1E CAL2W CAL3W CAL4W CAL5W]
   setup 4x3 3x4        restriction controversial 3x3couples_only qualifier num 2 none
      array [CAL6W CAL7W AL8E AL9E AL10E AL11E AL0E AL1E CAL2W CAL3W CAL4W CAL5W]
   setup 4x3 3x4 rotate restriction controversial 3x3couples_only qualifier num 3 none
      array [CAL0E CAL1E AL2W AL3W AL4W AL5W AL6W AL7W CAL8E CAL9E CAL10E CAL11E]
            alternate_definition [4x4 single] c4
   setup 2x4 2x4        restriction controversial 4x4couples_only qualifier num 0 none
      array [AL0W AL1W AL2W AL3W CR4E CR5E CR6E CR7E]
   setup 2x4 2x4 rotate restriction controversial 4x4couples_only qualifier num 1 none
      array [AL4E AL5E AL6E AL7E CAL0W CAL1W CAL2W CAL3W]
   setup 2x4 2x4        restriction controversial 4x4couples_only qualifier num 2 none
      array [AL4E AL5E AL6E AL7E CAL0W CAL1W CAL2W CAL3W]
   setup 2x4 2x4 rotate restriction controversial 4x4couples_only qualifier num 3 none
      array [AL0W AL1W AL2W AL3W CAL4E CAL5E CAL6E CAL7E]
   setup 4x4 4x4        restriction controversial 4x4couples_only qualifier num 0 none
      array [AL0W AL1W CR2E AL3W CR4E CR5E CR6E CR7E CR8E CR9E AL10W CR11E AL12W AL13W AL14W AL15W]
   setup 4x4 4x4        restriction controversial 4x4couples_only qualifier num 1 none
      array [AL12S AL13S CAL14N AL15S CAL0N CAL1N CAL2N CAL3N CAL4N CAL5N AL6S CAL7N AL8S AL9S AL10S AL11S]
   setup 4x4 4x4        restriction controversial 4x4couples_only qualifier num 2 none
      array [AL8E AL9E CAL10W AL11E CAL12W CAL13W CAL14W CAL15W CAL0W CAL1W AL2E CAL3W AL4E AL5E AL6E AL7E]
   setup 4x4 4x4        restriction controversial 4x4couples_only qualifier num 3 none
      array [AL4N AL5N CAL6S AL7N CAL8S CAL9S CAL10S CAL11S CAL12S CAL13S AL14N CAL15S AL0N AL1N AL2N AL3N]
            alternate_definition [singlefile] c4
   setup 4x1 1x4 rotate qualifier num 1 none
      array [CAL2W CAL3W AL0E AL1E]
   setup 4x1 1x4        qualifier num 2 none
      array [CAL2W CAL3W AL0E AL1E]

call "trixie" c4 tag trixie
   setup 2x2 2x2
      array [CR0E AL1W CR2E AL3W]

call "trixie spin" c4
            visible_fractions fractal_is_inherited gen_sting_is_inherited
   seq trixie []
   seq cast_off_n4_with_warn [insert_number 3 inherit_gensting inherit_fractal]
   seq ctrrun [force_cross]

call "swap around" a1
            reverse_means_mirror
   setup 2x2 2x2 restriction not_tboned
      array [0 0 ZM1N CR2S]
   setup 3x2 2x3 qualifier live none restriction controversial alwaysfail
      array [CR5S 0 0 0 ZM3N ZM4N]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [CR3S ZM2N 0 0]
            alternate_definition [half] c1
   setup 2x2 dmd rotate restriction not_tboned
      array [0 0 ZM1W CR2N]
            alternate_definition [lasthalf] c1
   setup dmd 2x2
      array [0 0 CR1E 0]
   setup pmd 2x2
      array [0 0 0 ZM2N]

call "circle 4 clockwise" dontshow tag circle4
            reverse_means_mirror parallel_conc_end
   setup 2x2 2x2 restriction not_tboned
      array [0 0 CR3E CR0E]
            alternate_definition [single] plus
   setup 2x1 1x2 rotate
      array [CR0N 0]
            alternate_definition [single twisted] c4
   setup 2x1 1x2
      array [CR1S 0]
            alternate_definition [3x3] c4
   setup 2x3 2x3 rotate
      array [0 0 0 CR3N CR4N CR5N]
            alternate_definition [4x4] c4
   setup 2x4 2x4 rotate
      array [0 0 0 0 CR4N CR5N CR6N CR7N]
            alternate_definition [6x6] c4
   setup 2x6 2x6 rotate
      array [0 0 0 0 0 0 CR6N CR7N CR8N CR9N CR10N CR11N]
            alternate_definition [8x8] c4
   setup 2x8 2x8 rotate
      array [0 0 0 0 0 0 0 0 CR8N CR9N CR10N CR11N CR12N CR13N CR14N CR15N]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [CR0E CR1E 0 0]
            alternate_definition [3x3 singlefile] c4
   setup 6x1 2x3
      array [CR0E CR1E CR2E 0 0 0]
            alternate_definition [4x4 singlefile] c4
   setup 8x1 2x4
      array [CR0E CR1E CR3E CR2E 0 0 0 0]
            alternate_definition [6x6 singlefile] c4
   setup 12x1 2x6
      array [CR0E CR1E CR2E CR3E CR4E CR5E 0 0 0 0 0 0]
            alternate_definition [8x8 singlefile] c4
   setup 16x1 2x8
      array [CR0E CR1E CR2E CR3E CR4E CR5E CR6E CR7E 0 0 0 0 0 0 0 0]

call "circle 4 @b" dontshow tag circle4_n
            neednumber reverse_means_mirror single_is_inherited
            singlefile_is_inherited nxn_is_inherited bigmatrix_is_inherited twisted_is_inherited
   // Only the first one gets "singlefile".
   seq circle4 [inherit_reverse inherit_single inherit_twisted
               inherit_singlefile inherit_nxn inherit_bigmatrix]
   seq circle4 [inherit_reverse inherit_single inherit_twisted
               inherit_nxn inherit_bigmatrix repeat_nm1]

call "circle 4 with bogus flow" dontshow tag circle4flow
/* This is, of course, a complete kludge.  Doing these calls correctly
   requires careful work.  It is just a coincidence that the roll
   direction does the right thing for the few instances of the
   preceding call that are popular.  So we use the roll direction,
   but we mark it not to be used by the resolver, since the resolver
   doesn't know which popular calls happen to work correctly with this. */
   setup 2x2 2x2
      preds "Can't determine sweep direction"
         if slide_or_roll_is_cw  [0 0 CR3E CR0E]
         if slide_or_roll_is_ccw [0 0 AL1W AL2W]
            alternate_definition [single] c4a
   setup 2x1 1x2 rotate
      preds "Can't determine sweep direction"
         if slide_or_roll_is_cw  [CR0N 0]
         if slide_or_roll_is_ccw [AL1S 0]

call "sweep @9/8" mainstream tag sweep_n8
            neednumber
   setup 2x2 2x2 plus_eighth_rotation qualifier num 1 none
      preds "Can't determine sweep direction"
         if slide_or_roll_is_cw  [0 0 CR2N CR3N]
         if slide_or_roll_is_ccw [0 0 AL1W AL2W]
   setup 2x2 2x2 plus_eighth_rotation qualifier num 3 none
      preds "Can't determine sweep direction"
         if slide_or_roll_is_cw  [0 0 CR3E CR0E]
         if slide_or_roll_is_ccw [0 0 AL0S AL1S]
   setup 2x2 2x2 plus_eighth_rotation qualifier num 5 none
      preds "Can't determine sweep direction"
         if slide_or_roll_is_cw  [0 0 CR0S CR1S]
         if slide_or_roll_is_ccw [0 0 AL3E AL0E]
   setup 2x2 2x2 plus_eighth_rotation qualifier num 7 none
      preds "Can't determine sweep direction"
         if slide_or_roll_is_cw  [0 0 CR1W CR2W]
         if slide_or_roll_is_ccw [0 0 AL2N AL3N]

call "@0 and sweep @9/8" mainstream
            visible_fractions
            dont_use_in_resolve neednumber
   seq nullcall [mandatory_anycall]
   seq sweep_n8 []

call "circle @b and touch" dontshow tag circle4touch
            reverse_means_mirror neednumber
            single_is_inherited singlefile_is_inherited twisted_is_inherited
            nxn_is_inherited bigmatrix_is_inherited
   seq circle4_n [inherit_reverse inherit_single inherit_singlefile inherit_twisted
                inherit_nxn inherit_bigmatrix]
   seq lft_touch [inherit_left inherit_bigmatrix]

call "circle by @b X @b" c1
            visible_fractions reverse_means_mirror need_two_numbers
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            single_is_inherited singlefile_is_inherited twisted_is_inherited
            nxn_is_inherited bigmatrix_is_inherited
   seq circle4touch [inherit_reverse inherit_single inherit_singlefile inherit_twisted inherit_nxn inherit_bigmatrix]
   seq armturn_n4 [inherit_yoyo inherit_fractal inherit_gensting inherit_bigmatrix shift_one_number]

call "circle by @b X @0" c1
            visible_fractions reverse_means_mirror neednumber single_is_inherited singlefile_is_inherited
   seq circle4touch [inherit_reverse inherit_single inherit_singlefile]
   seq nullcall [mandatory_anycall]

call "_touch tone 0 X 0" dontshow tag touchtone00
            left_means_mirror
   setup 2x4 1x8
      array [AL1S AL1S CR4S CR4S ZM7N ZM6N ZM2N ZM3N]

call "_finish touch tone @b X @b" dontshow tag fintouchtone
            need_two_numbers yoyo_is_inherited gen_sting_is_inherited
   conc armturn_n4_yoyo_optional [inherit_yoyo inherit_gensting]
        armturn_n4_yoyo_optional [inherit_yoyo inherit_gensting suppress_elongation_warnings shift_one_number]

call "_finish touch tone @0 X @b" dontshow tag fintouchtone_any
            neednumber yoyo_is_inherited gen_sting_is_inherited
   conc nullcall [mandatory_anycall] armturn_n4 [inherit_yoyo inherit_gensting suppress_elongation_warnings]

call "_finish touch tone @b X @0" dontshow tag fintouchtone_numany
            neednumber yoyo_is_inherited gen_sting_is_inherited
   conc armturn_n4 [inherit_yoyo inherit_gensting] nullcall [mandatory_anycall suppress_elongation_warnings]

call "_finish touch tone @0 X @m" dontshow tag fintouchtone_any_any
   conc nullcall [mandatory_anycall] nullsecond [mandatory_secondary_call suppress_elongation_warnings]

call "touch tone @b X @b" c4
            left_means_mirror need_two_numbers yoyo_is_inherited gen_sting_is_inherited
   seq touchtone00 [inherit_left]
   seq fintouchtone [inherit_yoyo inherit_gensting]

call "touch tone @0 X @b" c4
            left_means_mirror neednumber yoyo_is_inherited gen_sting_is_inherited
   seq touchtone00 [inherit_left]
   seq fintouchtone_any [inherit_yoyo inherit_gensting]

call "touch tone @b X @0" c4
            left_means_mirror neednumber yoyo_is_inherited gen_sting_is_inherited
   seq touchtone00 [inherit_left]
   seq fintouchtone_numany [inherit_yoyo inherit_gensting]

call "touch tone @0 X @m" c4
            left_means_mirror
   seq touchtone00 [inherit_left]
   seq fintouchtone_any_any []

call "sweep @b" mainstream tag sweep_n4
   // See "circle 4 with bogus flow" above.
            dont_use_in_resolve neednumber single_is_inherited
   seq circle4flow [inherit_single repeat_n]

call "@0 and sweep @b" mainstream
            visible_fractions
            dont_use_in_resolve neednumber single_is_inherited
   seq nullcall [mandatory_anycall]
   seq sweep_n4 [inherit_single]

call "by golly" c4a tag by_golly
   // See "circle 4 with bogus flow" above.
            dont_use_in_resolve
   setup 2x2 2x2
      preds "Can't determine flow direction"
         if slide_or_roll_is_cw  [0 0 CR1E CR0E]
         if slide_or_roll_is_ccw [0 0 AL1W AL0W]
            alternate_definition [single] c4a
   setup 2x1 1x2
      preds "Can't determine flow direction"
         if slide_or_roll_is_cw  [CR1E 0]
         if slide_or_roll_is_ccw [AL1W 0]
            alternate_definition [3x3] c4
   setup 2x3 2x3
      preds "Can't determine flow direction"
         if slide_or_roll_is_cw  [0 0 0 CR2E CR1E CR0E]
         if slide_or_roll_is_ccw [0 0 0 AL2W AL1W AL0W]
            alternate_definition [4x4] c4
   setup 2x4 2x4
      preds "Can't determine flow direction"
         if slide_or_roll_is_cw  [0 0 0 0 CR3E CR2E CR1E CR0E]
         if slide_or_roll_is_ccw [0 0 0 0 AL3W AL2W AL1W AL0W]

call "@0 by golly" c4a
            visible_fractions
            dont_use_in_resolve bigmatrix_is_inherited
            single_is_inherited nxn_is_inherited
   seq nullcall [mandatory_anycall inherit_single inherit_bigmatrix inherit_nxn]
   seq by_golly [inherit_single inherit_bigmatrix inherit_nxn]

call "_veer and turn zero" dontshow tag veer_and_turn
            dont_use_in_resolve
   setup 2x2 1x4
      preds "Can't determine veer direction"
         if slide_or_roll_is_cw  [0 0 ZR1N ZR0N]
         if slide_or_roll_is_ccw [0 0 ZL2N ZL3N]

call "veer and turn @b X @b" c4a
   // See "circle 4 with bogus flow" above.
            dont_use_in_resolve need_two_numbers gen_sting_is_inherited
   seq veer_and_turn []
   seq ctrarmturn_n_ends_roll_n [inherit_gensting]

call "clean sweep @b" c4a
            reverse_means_mirror neednumber singlefile_is_inherited visible_fractions
            nxn_is_inherited bigmatrix_is_inherited
   seq circle4_n [allow_forced_mod inherit_reverse inherit_singlefile
                 inherit_nxn inherit_bigmatrix]
   seq lft_veer_left [allow_forced_mod inherit_left inherit_nxn inherit_bigmatrix]
   seq tagtheline [allow_forced_mod inherit_left inherit_nxn inherit_bigmatrix]
   seq permissiveleadsrollright [allow_forced_mod inherit_left inherit_nxn inherit_bigmatrix]

/* This is grammatically similar to "finish advance to a column".  Since we are not
   doing the part that needs a number, the number is absent. */
call "finish clean sweep" c4a
            reverse_means_mirror singlefile_is_inherited visible_fractions
            nxn_is_inherited bigmatrix_is_inherited
   seq lft_veer_left [allow_forced_mod inherit_left inherit_nxn inherit_bigmatrix]
   seq tagtheline [allow_forced_mod inherit_left inherit_nxn inherit_bigmatrix]
   seq permissiveleadsrollright [allow_forced_mod inherit_left inherit_nxn inherit_bigmatrix]

call "reflected clean sweep @b" c4
            reverse_means_mirror neednumber singlefile_is_inherited visible_fractions
   seq circle4_n [allow_forced_mod inherit_reverse inherit_singlefile]
   seq lft_veer_left [allow_forced_mod inherit_left]
   seq tag_the_line_n_4 [allow_forced_mod inherit_left insert_number 2]
   seq revert_if_needed [force_reflect]
   seq extend_n [insert_number 4]
   seq permissiveleadsrollright [allow_forced_mod inherit_left]

call "walk and dodge" mainstream tag walkndodge
   setup 2x2 2x2 no_cutting_through restriction unusual wave_only
      array [ZM1N ZM0N ZM1N ZM0N]
   // The "qualifier live" stuff makes sure that, in offset waves
   // in a 12 matrix, it can disambiguate the definitions and know
   // that you want the 2x2 version in each live box.
   setup 3x2 2x3 qualifier live none restriction forbidden wave_only
      array [ZM1N ZM2N ZM3N ZM2N ZM3N ZM4N]
   // This lets the outer 6 do it in suitable 1/4-tag-like setups.
   setup pshort6 short6 qualifier ntbone didnt_say_triangle
      array [ZM1N ZM2N ZM3N ZM2N ZM3N ZM4N]
            alternate_definition [half] mainstream
   setup 2x2 dmd rotate no_cutting_through restriction wave_only
      array [ZM0W ZM0W ZM1W ZM3W]
            alternate_definition [cross] c4a
   simple_funny
   setup 2x2 2x2 restriction unusual magic_only
      array [ZM1N ZM0N ZM0N ZM1N]
            alternate_definition [magic] c1
   // "Magic walk and dodge" isn't a call.  We allow it, but it's controversial.
   setup 2x2 2x2 qualifier magic_only restriction controversial alwaysfail
      array [ZM1N ZM0N ZM0N ZM1N]
            alternate_definition [grand] c4x
   // This is an incredibly obscure and obsolete usage!
   setup 4x2 2x4 restriction unusual wave_only
      array [ZM2N ZM5N ZM3N ZM4N ZM3N ZM4N ZM2N ZM5N]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate restriction forbidden wave_only
      array [ZM0W ZM0W]
            alternate_definition [1x2] c3
   setup 2x3 2x3
      predscantdocallinsetup
         if inroller_is_cw_2x3 [ZM1N ZM2N    0    0 0 ZM0N]
         if always             [   0 ZM0N ZM1N ZM2N 0 0  ]
            alternate_definition [2x1] c3
   setup 3x2 2x3 restriction forbidden wave_only
      array [ZM1N ZM2N ZM3N ZM2N ZM3N ZM4N]
            alternate_definition [3x3] c4
   setup 3x2 2x3 rotate restriction forbidden wave_only
      array [ZM0W ZM1W ZM2W ZM0W ZM1W ZM2W]
            alternate_definition [4x4] c4
   setup 4x2 2x4 rotate restriction forbidden wave_only
      array [ZM0W ZM1W ZM2W ZM3W ZM0W ZM1W ZM2W ZM3W]

call "with the flow" c1 tag withflow
   // See "circle 4 with bogus flow" above.
            dont_use_in_resolve
   setup 2x2 2x2
      preds "Can't determine flow direction"
         if slide_or_roll_is_cw  [0 0 ZM3N ZM0N]
         if slide_or_roll_is_ccw [0 0 ZM1N ZM2N]
            alternate_definition [single] c4
   setup 2x1 1x2 rotate
      preds "Can't determine flow direction"
         if slide_or_roll_is_cw  [ZM0W 0]
         if slide_or_roll_is_ccw [ZM1W 0]
            alternate_definition [3x3] c4
   setup 2x3 2x3 rotate
      preds "Can't determine flow direction"
         if slide_or_roll_is_cw  [0 0 0 ZM3W ZM4W ZM5W]
         if slide_or_roll_is_ccw [0 0 0 ZM0W ZM1W ZM2W]
            alternate_definition [4x4] c4
   setup 2x4 2x4 rotate
      preds "Can't determine flow direction"
         if slide_or_roll_is_cw  [0 0 0 0 ZM4W ZM5W ZM6W ZM7W]
         if slide_or_roll_is_ccw [0 0 0 0 ZM0W ZM1W ZM2W ZM3W]
            alternate_definition [6x6] c4
   setup 2x6 2x6 rotate
      preds "Can't determine flow direction"
         if slide_or_roll_is_cw  [0 0 0 0 0 0 ZM6W ZM7W ZM8W ZM9W ZM10W ZM11W]
         if slide_or_roll_is_ccw [0 0 0 0 0 0 ZM0W ZM1W ZM2W ZM3W  ZM4W  ZM5W]
            alternate_definition [8x8] c4
   setup 2x8 2x8 rotate
      preds "Can't determine flow direction"
         if slide_or_roll_is_cw  [0 0 0 0 0 0 0 0 ZM8W ZM9W ZM10W ZM11W ZM12W ZM13W ZM14W ZM15W]
         if slide_or_roll_is_ccw [0 0 0 0 0 0 0 0 ZM0W ZM1W ZM2W   ZM3W  ZM4W  ZM5W  ZM6W  ZM7W]
            alternate_definition [half] c2
   setup 2x2 dmd rotate
      preds "Can't determine flow direction"
         if slide_or_roll_is_cw  [0 0 ZM2W ZM3W]
         if slide_or_roll_is_ccw [0 0 ZM1W ZM2W]

call "@0 with the flow" c1
            visible_fractions
            dont_use_in_resolve bigmatrix_is_inherited
            single_is_inherited nxn_is_inherited
   seq nullcall [mandatory_anycall inherit_single inherit_bigmatrix inherit_nxn]
   seq withflow [inherit_single inherit_bigmatrix inherit_nxn]

call "and a quarter more" mainstream tag quarter_more
   // See "circle 4 with bogus flow" above.
            dont_use_in_resolve
   setup 1x2 1x2 rotate restriction forbidden couples_only
      preds "Can't determine flow direction"
         if roll_is_cw  [CR0N CR1N]
         if roll_is_ccw [AL1S AL0S]
            alternate_definition [single] c4
   setup 1x1 1x1
      preds "Can't determine flow direction"
         if roll_is_cw  [CR0E]
         if roll_is_ccw [AL0W]
            alternate_definition [3x3] c4
   setup 1x3 1x3 rotate restriction forbidden 3x3couples_only
      preds "Can't determine flow direction"
         if roll_is_cw  [CR0N CR1N CR2N]
         if roll_is_ccw [AL2S AL1S AL0S]
            alternate_definition [4x4] c4
   setup 1x4 1x4 rotate restriction forbidden 4x4couples_only
      preds "Can't determine flow direction"
         if roll_is_cw  [CR0N CR1N CR2N CR3N]
         if roll_is_ccw [AL2S AL3S AL0S AL1S]

call "@0 and a quarter more" mainstream
            dont_use_in_resolve
            single_is_inherited nxn_is_inherited mxn_is_inherited
   seq nullcall [mandatory_anycall inherit_nxn inherit_mxn]
   seq quarter_more [inherit_single inherit_nxn inherit_mxn]

call "@0 by" c4
            first_part_visible dont_use_in_resolve
            single_is_inherited nxn_is_inherited mxn_is_inherited
   seq nullcall [mandatory_anycall]
   seq quarter_more [inherit_single inherit_nxn inherit_mxn]
   seq slither [inherit_single inherit_nxn inherit_mxn]

call "@0 by by" c4
            first_part_visible dont_use_in_resolve
            single_is_inherited nxn_is_inherited mxn_is_inherited
   seq nullcall [mandatory_anycall]
   seq quarter_more [inherit_single inherit_nxn inherit_mxn]
   seq slither [inherit_single inherit_nxn inherit_mxn]
   seq spread [inherit_single]

call "@0 by by by" c4
            first_part_visible dont_use_in_resolve
            single_is_inherited nxn_is_inherited mxn_is_inherited
   seq nullcall [mandatory_anycall]
   seq quarter_more [inherit_single inherit_nxn inherit_mxn]
   seq slither [inherit_single inherit_nxn inherit_mxn]
   seq spread [inherit_single]
   seq slither [inherit_single inherit_nxn inherit_mxn]

call "and @b more" mainstream tag N_4_more
   // See "circle 4 with bogus flow" above.
            dont_use_in_resolve neednumber
   setup 1x2 1x2 rotate restriction forbidden couples_only qualifier num 1 none
      preds "Can't determine flow direction"
         if roll_is_cw  [CR0N CR1N]
         if roll_is_ccw [AL1S AL0S]
   setup 1x2 1x2 restriction forbidden couples_only qualifier num 2 none
      preds "Can't determine flow direction"
         if roll_is_cw  [CR1S CR0S]
         if roll_is_ccw [AL1S AL0S]
            alternate_definition [3x3] c4
   setup 1x3 1x3 rotate restriction forbidden 3x3couples_only qualifier num 1 none
      preds "Can't determine flow direction"
         if roll_is_cw  [CR0N CR1N CR2N]
         if roll_is_ccw [AL2S AL1S AL0S]
   setup 1x3 1x3 restriction forbidden 3x3couples_only qualifier num 2 none
      preds "Can't determine flow direction"
         if roll_is_cw  [CR2S CR1S CR0S]
         if roll_is_ccw [AL2S AL1S AL0S]
            alternate_definition [4x4] c4
   setup 1x4 1x4 rotate restriction forbidden 4x4couples_only qualifier num 1 none
      preds "Can't determine flow direction"
         if roll_is_cw  [CR0N CR1N CR2N CR3N]
         if roll_is_ccw [AL2S AL3S AL0S AL1S]
   setup 1x4 1x4 restriction forbidden 4x4couples_only qualifier num 2 none
      preds "Can't determine flow direction"
         if roll_is_cw  [CR2N CR3N CR0N CR1N]
         if roll_is_ccw [AL2S AL3S AL0S AL1S]

call "@0 and @b more" mainstream
            dont_use_in_resolve neednumber nxn_is_inherited mxn_is_inherited
   seq nullcall [mandatory_anycall inherit_nxn inherit_mxn]
   seq N_4_more [inherit_nxn inherit_mxn]

call "_finish couple up" dontshow tag fincoupleup
   setup 2x2 2x2
      array [CR0S AL1S ZM2N ZM3N]
   setup 2x1 1x2
      array [ZM0N 1S]
            alternate_definition [half] c3a
   setup 2x2 2x2
      array [CR0E AL1W ZM2N ZM3N]

call "couple up" c3a tag coupleup
   setup 2x2 2x2 no_cutting_through
      array [CR1S AL0S AL1S CR0S]
            alternate_definition [3x3] c4
   setup 3x2 2x3 rotate restriction forbidden wave_only
      array [CR0E CR1E CR2E AL0E AL1E AL2E]
            alternate_definition [4x4] c4
   setup 4x2 2x4 rotate restriction forbidden wave_only
      array [CR0E CR1E CR2E CR3E AL0E AL1E AL2E AL3E]
            alternate_definition [funny] c2
   setup 2x2 2x2 no_cutting_through
      array [CR1S AL0S ZM2N ZM3N]
            dont_use_in_nice_resolve visible_fractions funny_is_inherited
   seq box_circ [inherit_funny or_anycall]
   seq fincoupleup [roll_transparent]

call "@N couple up" c3a
            visible_fractions funny_is_inherited
   seq circnullcall [inherit_funny or_anycall]
   seq fincoupleup [roll_transparent]

call "@0 like a couple up" c3a
            visible_fractions
   seq nullcall [mandatory_anycall]
   seq fincoupleup [roll_transparent]

call "_divide and move along" dontshow tag div_move_along
   setup 2x2 2x2 other_elongate
      array [AL0S CR1S CAL2N ACR3N]

call "_real leads divide and move along" dontshow tag real_leads_div_move_along
            parallel_conc_end
   setup 2x2 2x2 restriction forbidden leads_only
      array [AL0S CR1S 0 0]
            alternate_definition [cross] c2
   setup 2x2 2x2 restriction forbidden leads_only
      array [CR1S AL0S 0 0]

// This is used for "ramble" and "counter", in which we say that it is
// "unusual" for an end to be facing in, but we allow it.
call "_leads divide and move along" dontshow tag leads_div_move_along
            parallel_conc_end
   setup 2x2 2x2 restriction unusual leads_only
      array [AL0S CR1S CAL2N ACR3N]
            alternate_definition [cross] c2
   setup 2x2 2x2 restriction forbidden leads_only
      // But we don't allow "cross ramble" if people are facing in -- too yucky.
      array [CR1S AL0S 0 0]

call "split swap" c2
            reverse_means_mirror
   setup 2x2 2x2
      array [0 0 CR1E CR2E]   // Definition changed, Feb. '00.  Beau can roll.
            alternate_definition [single] c4
   setup 2x1 1x2 rotate
      array [C1N 0]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [C3E C2E 0 0]
            alternate_definition [3x3] c4
   setup 2x3 2x3 rotate
      array [0 0 0 CR0N CR1N CR2N]
            alternate_definition [4x4] c4
   setup 2x4 2x4 rotate
      array [0 0 0 0 CR0N CR1N CR2N CR3N]
            alternate_definition [3x3 singlefile] c4
   setup 6x1 2x3
      array [C5E C4E C3E 0 0 0]
            alternate_definition [4x4 singlefile] c4
   setup 8x1 2x4
      array [C7E C6E C4E C5E 0 0 0 0]

call "arky star thru" c4a
   setup 2x2 2x2
      array [0 0 L1W R0E]

call "mesh" c4
            reverse_means_mirror
   setup 2x1 1x2 rotate
      predscantdocallinsetup
         if columns_tandem [M1W M0W]
         if always         [M1W 0]
            alternate_definition [3x3] c4
   setup 3x1 1x3 rotate restriction forbidden all_facing_same
      array [M2W M1W M0W]
            alternate_definition [4x4] c4
   setup 4x1 1x4 rotate restriction forbidden all_facing_same
      array [M2W M3W M0W M1W]

call "curlique" c4 tag curlique
            rear_back_from_r_wave left_means_mirror
   setup 2x1 1x2 restriction forbidden opposite_sex
      preds "Unknown sex."
         if boyp  [CR1E 0]
         if girlp [AL1E 0]

call "curli-cross" c4
            rear_back_from_r_wave left_means_mirror grand_is_inherited visible_fractions
   seq curlique [inherit_left allow_forced_mod]
   seq and_cross [inherit_grand roll_transparent]

call "_finish curli-wheel" dontshow tag fincurliwheel
   setup 2x2 2x2 restriction unusual wave_only
      array [CR1S AL0S AM1S CM0S]

call "curli-wheel" c4
            rear_back_from_r_wave left_means_mirror first_part_visible
   seq curlique [inherit_left allow_forced_mod]
   seq fincurliwheel []

call "_those in lines curlique" dontshow tag lines_curlique
            rear_back_from_r_wave left_means_mirror
   setup 2x4 2x4
      preds "Must be facing opposite sex."
         if x22_boy_facing_girl [0 0 0 0 CR3E CR2E CR1E CR0E]
         if x22_girl_facing_boy [0 0 0 0 AL3E AL2E AL1E AL0E]
   setup 4x2 2x4
      array [ZM0N 0 0 ZM3N ZM4N 0 0 ZM7N]
   setup 2x1 1x2 restriction forbidden opposite_sex
      preds "Unknown sex."
         if boyp  [CR1E 0]
         if girlp [AL1E 0]

call "_those in lines touch 1/4" dontshow tag lines_touch_1_4
            rear_back_from_r_wave left_means_mirror
   setup 2x4 2x4
      array [0 0 0 0 CR3E CR2E CR1E CR0E]
   setup 4x2 2x4
      array [ZM0N 0 0 ZM3N ZM4N 0 0 ZM7N]
   setup 2x1 1x2
      array [CR1E 0]

call "_finish curli-pass" dontshow tag fin_curli_pass
   setup 2x1 1x2 qualifier in in_or_out
      array [ZM1N 0]
   setup 2x1 1x2
      array [ZM0N ZM1N]

call "curli-pass" c4
            sequence_starter rear_back_from_r_wave left_means_mirror visible_fractions
   seq lines_curlique [inherit_left allow_forced_mod]
   seq fin_curli_pass []

call "touchy-pass" c4x
            sequence_starter rear_back_from_r_wave left_means_mirror visible_fractions
   seq lines_touch_1_4 [inherit_left allow_forced_mod]
   seq fin_curli_pass []

call "curli-cross the top" c4
            rear_back_from_r_wave grand_is_inherited fractal_is_inherited gen_sting_is_inherited
            left_means_mirror first_part_visible
   seq curlique [inherit_left allow_forced_mod]
   seq armturn_n4 [insert_number 1 inherit_fractal inherit_gensting]
   seq fanthetop [inherit_grand inherit_fractal inherit_gensting]

call "cross and turn" c1
            reverse_means_mirror
   simple_funny
   setup 2x2 2x2
      array [0 0 AL2S Z1N]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [AL3S Z2N 0 0]
            alternate_definition [half] c1
   setup 2x2 2x3 rotate
      array [0 0 AL2S ZM4W]

call "circle to a wave" c2
            reverse_means_mirror singlefile_is_inherited nxn_is_inherited
            bigmatrix_is_inherited visible_fractions
   seq circle4 [inherit_reverse inherit_singlefile inherit_nxn inherit_bigmatrix]
   seq withflow [inherit_nxn inherit_bigmatrix]

call "circle @b to a wave" c2
            visible_fractions neednumber
            reverse_means_mirror singlefile_is_inherited nxn_is_inherited
   seq circle4_n [inherit_reverse inherit_singlefile inherit_nxn]
   seq withflow [inherit_nxn]

call "cross back" c2 tag crossback
   simple_funny
   setup 2x2 2x2 restriction wave_only
      array [CR0S AL1S ZM0N ZM1N]
            alternate_definition [grand] c2
   setup 3x2 2x3 restriction wave_only
      array [ZM4N ZM3N CR2S AL3S ZM2N ZM1N]
   setup 4x2 2x4 restriction wave_only
      array [ZM6N ZM5N ZM4N CR3S AL4S ZM3N ZM2N ZM1N]
            alternate_definition [half] c2
   setup 2x2 2x3 rotate restriction wave_only
      array [CR5N AL0S ZM4W ZM1W]
            alternate_definition [half grand] c2
   setup 4x2 2x5 restriction wave_only
      array [ZM8N ZM7N ZM6N CR4E AL5W ZM3N ZM2N ZM1N]
            alternate_definition [rewind] c4
   setup 2x2 2x2 restriction wave_only
      array [AL0S CR1S ZM0N ZM1N]

call "shakedown" c1 tag shakedown
            left_means_mirror
   setup 2x2 2x2
      array [CR1W CR2W 0 0]
            alternate_definition [single] c3a
   setup 2x1 1x2 rotate
      array [0 CR1S]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [0 0 CR2W CR3W]
            alternate_definition [3x3] c4
   setup 2x3 2x3 rotate
      array [CR0S CR1S CR2S 0 0 0]
            alternate_definition [4x4] c4
   setup 2x4 2x4 rotate
      array [CR0S CR1S CR2S CR3S 0 0 0 0]
            alternate_definition [6x6] c4
   setup 2x6 2x6 rotate
      array [CR0S CR1S CR2S CR3S CR4S CR5S 0 0 0 0 0 0]
            alternate_definition [8x8] c4
   setup 2x8 2x8 rotate
      array [CR0S CR1S CR2S CR3S CR4S CR5S CR6S CR7S 0 0 0 0 0 0 0 0]
            alternate_definition [3x3 singlefile] c4
   setup 6x1 2x3
      array [0 0 0 CR3W CR4W CR5W]
            alternate_definition [4x4 singlefile] c4
   setup 8x1 2x4
      array [0 0 0 0 CR4W CR5W CR7W CR6W]

call "wheel thru" a1
            left_means_mirror no_elongation_allowed
   setup 2x2 2x2
      array [0 0 CR2E CR1E]
            alternate_definition [3x3] c4
   setup 2x3 2x3 rotate
      array [0 0 0 CR2N CR1N CR0N]
            alternate_definition [4x4] c4
   setup 2x4 2x4 rotate
      array [0 0 0 0 CR3N CR2N CR1N CR0N]
            alternate_definition [6x6] c4
   setup 2x6 2x6 rotate
      array [0 0 0 0 0 0 CR5N CR4N CR3N CR2N CR1N CR0N]
            alternate_definition [8x8] c4
   setup 2x8 2x8 rotate
      array [0 0 0 0 0 0 0 0 CR7N CR6N CR5N CR4N CR3N CR2N CR1N CR0N]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [CR3E CR2E 0 0]
            alternate_definition [half] a1
   setup 2x2 1x4 plus_eighth_rotation qualifier in live in_or_out
      array [0 0 CR2N CR1N]

call "lead @eright@f" mainstream
            left_means_mirror no_elongation_allowed
   setup 2x2 2x2
      array [0 0 CR2E CR1E]
            alternate_definition [half] mainstream
   setup 2x2 1x4 plus_eighth_rotation qualifier in live in_or_out
      array [0 0 CR2N CR3N]

call "wheel fan thru" c1
            left_means_mirror
   setup 2x2 2x2
      array [0 0 CR2E CR3W]
            alternate_definition [half] c1
   setup 2x2 dmd plus_eighth_rotation qualifier in live in_or_out
      array [0 0 CR2N CR1E]

call "wheel fan and cross thru" c4a
            left_means_mirror
   setup 2x2 2x2
      array [0 0 C1E C0W]

// This is the spelling appearing in Baker's list, which is
// a very careful compilation from original sources.  It also appears
// this way in a number of sloppy compilations.
call "ripoff" c3 tag ripoff
            reverse_means_mirror
   setup 2x2 2x2
      array [CR1S CR2N ZM3N ZM0N]
            alternate_definition [half] c3
   setup 2x2 crosswave rotate
      array [CR0N CR2E ZM5W ZM7W]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [ZM0N ZM1N CR2S CR3N]

// This is the spelling in Ceder's list, which is a very careful compilation,
// but perhaps not so faithful to original sources.  It is also the spelling
// in the official C3 list, a rather careless document.  It also appears
// this way in a number of sloppy compilations.
call "rip off" c3
   alias ripoff

call "boomerang" c3
   setup 2x2 2x2 restriction forbidden peelable_box qualifier 2fl_only
      array [AL3N CR2N AL0S CR1S]
   // Otherwise, do the "boxy" version.  This includes T-bones.
   setup 2x2 2x2 restriction wave_only
      array [AL3N CR2N AM3S CM2S]
            alternate_definition [half] c3
   setup 2x2 dmd restriction forbidden peelable_box qualifier wave_only
      array [AL0S CR2S AL1W CR1E]

call "_leads wheel" dontshow tag leadswheel
            reverse_means_mirror
   setup 2x2 2x2 restriction all_facing_same
      array [AL1S AL0S ZM2N ZM3N]
            alternate_definition [funny] c2
   setup 2x2 2x2
      predscantdocallinsetup
         // This way, if someone is looking out and is next to a phantom, they wheel.
         if 2x2_miniwave [ZM0N ZM1N ZM2N ZM3N]
         if always       [AL1S AL0S ZM2N ZM3N]
            alternate_definition [single] c4
   setup 2x1 1x2 restriction all_facing_same
      array [ZM0N AL1S]
            alternate_definition [3x3] c4
   setup 2x3 2x3 restriction all_facing_same
      array [AL2S AL1S AL0S ZM3N ZM4N ZM5N]
            alternate_definition [4x4] c4
   setup 2x4 2x4 restriction all_facing_same
      array [AL3S AL2S AL1S AL0S ZM4N ZM5N ZM6N ZM7N]

call "_everyone wheel" dontshow tag everyonewheel
            reverse_means_mirror
   setup 2x2 2x2 qualifier couples_only
      array [AL1S AL0S 0 0]
   // We allow this for pathological cases, but give a warning.
   setup 1x2 1x2 qualifier couples_only restriction unusual alwaysfail
      array [AL1S AL0S]
            alternate_definition [rewind] c4
   setup 2x2 2x2 qualifier couples_only
      array [CR1S CR0S 0 0]
   setup 1x2 1x2 qualifier couples_only restriction unusual alwaysfail
      array [CR1S CR0S]
            alternate_definition [grand] c4
   // Only legal if say "ends start grand wheel the ocean".
   setup 4x2 2x4 qualifier couples_only
      array [0 0 0 AL4S AL3S 0 0 0]
            alternate_definition [single] c4
   setup 2x1 1x2
      array [0 AL1S]
            alternate_definition [3x3] c4
   setup 2x3 2x3
      array [AL2S AL1S AL0S 0 0 0]
            alternate_definition [rewind 3x3] c4
   setup 1x3 1x3 restriction forbidden all_facing_same
      array [CR2S CR1S CR0S]
            alternate_definition [4x4] c4
   setup 2x4 2x4
      array [AL3S AL2S AL1S AL0S 0 0 0 0]
            alternate_definition [rewind 4x4] c4
   setup 1x4 1x4 restriction forbidden all_facing_same
      array [CR2S CR3S CR0S CR1S]

call "_ @B wheel" dontshow tag oddfracwheel
            reverse_means_mirror neednumber parallel_conc_end
   setup 1x2 1x2 rotate restriction forbidden couples_only qualifier num 1 none
      array [AL1S AL0S]
   setup 1x2 1x2 rotate restriction forbidden couples_only qualifier num 3 none
      array [AL0N AL1N]
            alternate_definition [rewind] c4
   setup 1x2 1x2 rotate restriction forbidden couples_only qualifier num 1 none
      array [CR0N CR1N]
   setup 1x2 1x2 rotate restriction forbidden couples_only qualifier num 3 none
      array [CR1S CR0S]
            alternate_definition [grand] c4
   // Only legal if say "ends start grand 1/4 wheel the ocean".
   setup rigger 2x4 qualifier num 1 none
      array [0 0 AL3W AL4W 0 0 0 0]
   setup 1x8 2x4 qualifier num 1 none
      array [0 0 0 0 AL3W AL4W 0 0]
   setup rigger 2x4 qualifier num 3 none
      array [0 0 0 0 0 0 AL0E AL7E]
   setup 1x8 2x4 qualifier num 3 none
      array [AL0E AL7E 0 0 0 0 0 0]
            alternate_definition [single] c4
   setup 1x1 1x1 qualifier num 1 none
      array [AL0W]
   setup 1x1 1x1 qualifier num 3 none
      array [AL0E]
            alternate_definition [3x3] c4
   setup 1x3 1x3 rotate restriction forbidden 3x3couples_only qualifier num 1 none
      array [AL2S AL1S AL0S]
   setup 1x3 1x3 rotate restriction forbidden 3x3couples_only qualifier num 3 none
      array [AL0N AL1N AL2N]
            alternate_definition [rewind 3x3] c4
   setup 1x3 1x3 rotate restriction forbidden 3x3couples_only qualifier num 1 none
      array [CR0N CR1N CR2N]
   setup 1x3 1x3 rotate restriction forbidden 3x3couples_only qualifier num 3 none
      array [CR2S CR1S CR0S]
            alternate_definition [4x4] c4
   setup 1x4 1x4 rotate restriction forbidden 4x4couples_only qualifier num 1 none
      array [AL2S AL3S AL0S AL1S]
   setup 1x4 1x4 rotate restriction forbidden 4x4couples_only qualifier num 3 none
      array [AL0N AL1N AL2N AL3N]
            alternate_definition [rewind 4x4] c4
   setup 1x4 1x4 rotate restriction forbidden 4x4couples_only qualifier num 1 none
      array [CR0N CR1N CR2N CR3N]
   setup 1x4 1x4 rotate restriction forbidden 4x4couples_only qualifier num 3 none
      array [CR2S CR3S CR0S CR1S]

call "_finish wheel the ocean" dontshow tag finwheelocean
            reverse_means_mirror split_large_setups anyone_who_moves_cant_roll
   setup 2x2 2x2 no_cutting_through
      // Note that we allow left miniwaves, so we can have
      // so-and-so start a wheel the ocean.
      array [0 ZM1N ZM0N ZM3N]
   // Is this really legitimate?  I think people have called it.
   setup 3x2 2x3 qualifier live none
      array [ZM0N 0 0 0 ZM2N ZM1N]
            alternate_definition [rewind] c4
   setup 2x2 2x2 restriction forbidden wave_only
      array [0 ZM1N ZM0N 0]
            alternate_definition [grand] c4
   setup 4x2 2x4
      array [ZM0N 0 0 0 ZM4N ZM3N ZM2N ZM1N]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [ZM0N ZM1N 0 0]
            alternate_definition [single] c4
   setup 2x1 1x2 rotate
      array [ZM0W 0]
            alternate_definition [3x3] c4
   setup 2x3 2x3 rotate
      array [0 0 0 ZM5W ZM4W ZM3W]
            alternate_definition [rewind 3x3] c4
   setup 3x2 2x3 rotate restriction forbidden wave_only
      array [0 0 0 ZM2W ZM1W ZM0W]
            alternate_definition [4x4] c4
   setup 2x4 2x4 rotate
      array [0 0 0 0 ZM7W ZM6W ZM5W ZM4W]
            alternate_definition [rewind 4x4] c4
   setup 4x2 2x4 rotate restriction forbidden wave_only
      array [0 0 0 0 ZM3W ZM2W ZM1W ZM0W]

call "_finish wheel the sea" dontshow tag finwheelsea
            reverse_means_mirror split_large_setups anyone_who_moves_cant_roll
   setup 2x2 2x2 no_cutting_through
      array [0 0 ZM1N ZM2N]
   // Is this really legitimate?  I think people have called it.
   setup 3x2 2x3 qualifier live none
      array [ZM5N 0 0 0 ZM3N ZM4N]
            alternate_definition [rewind] c4
   setup 2x2 2x2 restriction forbidden wave_only
      array [ZM1N 0 0 ZM0N]
            alternate_definition [grand] c4
   setup 4x2 2x4
      array [ZM7N 0 0 0 0 ZM4N ZM5N ZM6N]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [ZM3N ZM2N 0 0]
            alternate_definition [single] c4
   setup 2x1 1x2 rotate
      array [ZM1W 0]
            alternate_definition [3x3] c4
   setup 2x3 2x3 rotate
      array [0 0 0 ZM0W ZM1W ZM2W]
            alternate_definition [rewind 3x3] c4
   setup 3x2 2x3 rotate restriction forbidden wave_only
      array [ZM0W ZM1W ZM2W 0 0 0]
            alternate_definition [4x4] c4
   setup 2x4 2x4 rotate
      array [0 0 0 0 ZM0W ZM1W ZM2W ZM3W]
            alternate_definition [rewind 4x4] c4
   setup 4x2 2x4 rotate restriction forbidden wave_only
      array [ZM0W ZM1W ZM2W ZM3W 0 0 0 0]

call "_finish wheel to a diamond" dontshow tag finwheeltodiamond
            reverse_means_mirror
   setup 2x2 dmd rotate
      array [0 0 ACR3W AL2S]
            alternate_definition [interlocked] c3
   setup 2x4 qtag
      array [0 0 0 0 ACR7N AL4W ACR6N AL5W]

call "_finish wheel to an hourglass" dontshow tag finwheeltohrglass
            reverse_means_mirror
   setup 2x4 hrglass
      array [0 0 0 0 A7W AL4W ACR6N AL5W]

call "leads wheel the ocean" c2
            reverse_means_mirror single_is_inherited funny_is_inherited
            nxn_is_inherited mxn_is_inherited bigmatrix_is_inherited visible_fractions
   seq leadswheel [inherit_reverse inherit_single inherit_funny
                   inherit_nxn inherit_mxn inherit_bigmatrix]
   // The second part is implicitly funny anyway.
   seq finwheelocean [inherit_reverse inherit_single inherit_nxn inherit_mxn inherit_bigmatrix roll_transparent]

call "leads wheel the sea" c2
            reverse_means_mirror single_is_inherited funny_is_inherited
            nxn_is_inherited mxn_is_inherited bigmatrix_is_inherited visible_fractions
   seq leadswheel [inherit_reverse inherit_single inherit_funny
                   inherit_nxn inherit_mxn inherit_bigmatrix]
   // The second part is implicitly funny anyway.
   seq finwheelsea [inherit_reverse inherit_single inherit_nxn inherit_mxn inherit_bigmatrix roll_transparent]

call "leads wheel to a@I diamond" c4
            reverse_means_mirror intlk_is_inherited visible_fractions
   seq leadswheel [inherit_reverse]
   seq finwheeltodiamond [inherit_reverse inherit_intlk]

call "leads wheel to an hourglass" c4a
            reverse_means_mirror visible_fractions
   seq leadswheel [inherit_reverse]
   seq finwheeltohrglass [inherit_reverse]

call "wheel the ocean" c2
            reverse_means_mirror grand_is_inherited single_is_inherited
            nxn_is_inherited mxn_is_inherited
            bigmatrix_is_inherited rewind_is_inherited visible_fractions
   seq everyonewheel [inherit_reverse inherit_grand inherit_single
                      inherit_nxn inherit_mxn inherit_bigmatrix inherit_rewind]
   seq finwheelocean [inherit_reverse inherit_grand inherit_single roll_transparent
                      inherit_nxn inherit_mxn inherit_bigmatrix inherit_rewind]

call "wheel the sea" c2
            reverse_means_mirror grand_is_inherited single_is_inherited
            nxn_is_inherited mxn_is_inherited
            bigmatrix_is_inherited rewind_is_inherited visible_fractions
   seq everyonewheel [inherit_reverse inherit_grand inherit_single
                      inherit_nxn inherit_mxn inherit_bigmatrix inherit_rewind]
   seq finwheelsea   [inherit_reverse inherit_grand inherit_single roll_transparent
                      inherit_nxn inherit_mxn inherit_bigmatrix inherit_rewind]

call "wheel to a@I diamond" c4
            reverse_means_mirror intlk_is_inherited visible_fractions
   seq everyonewheel [inherit_reverse]
   seq finwheeltodiamond [inherit_reverse inherit_intlk]

call "wheel to an hourglass" c4a
            reverse_means_mirror visible_fractions
   seq everyonewheel [inherit_reverse]
   seq finwheeltohrglass [inherit_reverse]

call "@D wheel the ocean" c3a
            reverse_means_mirror grand_is_inherited neednumber singlefile_is_inherited
            single_is_inherited nxn_is_inherited mxn_is_inherited
            bigmatrix_is_inherited rewind_is_inherited visible_fractions
   seq oddfracwheel [inherit_reverse inherit_grand inherit_single inherit_singlefile
                     inherit_nxn inherit_mxn inherit_bigmatrix inherit_rewind]
   seq finwheelocean [inherit_reverse inherit_grand inherit_single inherit_singlefile roll_transparent
                      inherit_nxn inherit_mxn inherit_bigmatrix inherit_rewind]

call "@D wheel the sea" c3a
            reverse_means_mirror grand_is_inherited neednumber singlefile_is_inherited
            single_is_inherited nxn_is_inherited mxn_is_inherited
            bigmatrix_is_inherited rewind_is_inherited visible_fractions
   seq oddfracwheel [inherit_reverse inherit_grand inherit_single inherit_singlefile
                     inherit_nxn inherit_mxn inherit_bigmatrix inherit_rewind]
   seq finwheelsea [inherit_reverse inherit_grand inherit_single inherit_singlefile roll_transparent
                    inherit_nxn inherit_mxn inherit_bigmatrix inherit_rewind]

call "@D wheel to a@I diamond" c4a
            reverse_means_mirror neednumber intlk_is_inherited single_is_inherited
            nxn_is_inherited mxn_is_inherited
            visible_fractions
   seq oddfracwheel [inherit_reverse inherit_single
                     inherit_nxn inherit_mxn]
   seq finwheeltodiamond [inherit_reverse inherit_intlk inherit_single
      inherit_nxn inherit_mxn]

call "@D wheel to an hourglass" c4a
            reverse_means_mirror neednumber single_is_inherited
            nxn_is_inherited mxn_is_inherited
            visible_fractions
   seq oddfracwheel [inherit_reverse inherit_single
                     inherit_nxn inherit_mxn]
   seq finwheeltohrglass [inherit_reverse inherit_single
      inherit_nxn inherit_mxn]

call "chase @eright@f" plus tag chase_right
            left_means_mirror no_elongation_allowed
   setup 2x2 2x2
      // The original beau cannot roll.  It is box circulate two positions.
      // Callerlab plus definitions, page 1.
      array [CM2S CR3N 0 0]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [0 0 CM3S CR0N]
            alternate_definition [2x2] c4
   setup 2x4 2x4
      array [CM5S CM4S CR6N CR7N 0 0 0 0]
            alternate_definition [3x3] c4
   setup 2x6 2x6
      array [CM8S CM7S CM6S CR9N CR10N CR11N 0 0 0 0 0 0]
            alternate_definition [4x4] c4
   setup 2x8 2x8
      array [CM11S CM10S CM9S CM8S CR12N CR13N CR14N CR15N 0 0 0 0 0 0 0 0]

call "left chase" plus
            no_elongation_allowed
   seq chase_right [force_left]

call "mini chase" c3a
            left_means_mirror
   setup 2x2 2x2
      array [CM1E CR2W 0 0]
            alternate_definition [singlefile] c4
   setup 4x1 2x2
      array [0 0 CM2E CR3W]

call "fan and cross thru" c4a
            rear_back_from_r_wave left_means_mirror
   setup 2x2 2x2
      array [0 0 AM2S ZM1N]

call "square chain thru" a1
            split_like_square_thru left_means_mirror visible_fractions
            yoyo_is_inherited gen_sting_is_inherited grand_is_inherited twisted_is_inherited
   seq passthru [permit_touch_or_rear_back inherit_left inherit_twisted]
   seq quarterin []
   seq rightable_left_swing_thru [inherit_left inherit_yoyo inherit_gensting inherit_grand]
   seq natturnthru [inherit_yoyo inherit_gensting]

call "square chain thru to a wave" c1
            split_like_square_thru left_means_mirror yoyo_is_inherited gen_sting_is_inherited grand_is_inherited
            twisted_is_inherited visible_fractions
   seq passthru [permit_touch_or_rear_back inherit_left inherit_twisted]
   seq quarterin []
   seq rightable_left_swing_thru [inherit_left inherit_yoyo inherit_gensting inherit_grand]
   seq trade [inherit_yoyo inherit_gensting]

call "square chain thru, @6 to a wave" c1
            split_like_square_thru left_means_mirror yoyo_is_inherited gen_sting_is_inherited
            grand_is_inherited twisted_is_inherited visible_fractions
   seq passthru [permit_touch_or_rear_back inherit_left inherit_twisted]
   seq quarterin []
   seq rightable_left_swing_thru [inherit_left inherit_yoyo inherit_gensting inherit_grand]
   seq somedontturnthru [inherit_yoyo inherit_gensting]

call "square chain@C the top" c1
            split_like_square_thru left_means_mirror yoyo_is_inherited gen_sting_is_inherited cross_is_inherited
            fractal_is_inherited twisted_is_inherited visible_fractions
   seq passthru [permit_touch_or_rear_back inherit_left inherit_twisted]
   seq quarterin []
   seq rightable_left_spinthetop [inherit_left inherit_yoyo inherit_gensting inherit_fractal inherit_cross]
   seq natturnthru [inherit_yoyo inherit_gensting]

call "square chain@C the top to a wave" c1
            split_like_square_thru left_means_mirror yoyo_is_inherited gen_sting_is_inherited cross_is_inherited
            fractal_is_inherited twisted_is_inherited visible_fractions
   seq passthru [permit_touch_or_rear_back inherit_left inherit_twisted]
   seq quarterin []
   seq rightable_left_spinthetop [inherit_left inherit_yoyo inherit_gensting inherit_fractal inherit_cross]
   seq trade [inherit_yoyo inherit_gensting]

call "square chain@C the top, @6 to a wave" c1
            split_like_square_thru left_means_mirror yoyo_is_inherited gen_sting_is_inherited cross_is_inherited
            fractal_is_inherited twisted_is_inherited visible_fractions
   seq passthru [permit_touch_or_rear_back inherit_left inherit_twisted]
   seq quarterin []
   seq rightable_left_spinthetop [inherit_left inherit_yoyo inherit_gensting inherit_fractal inherit_cross]
   seq somedontturnthru [inherit_yoyo inherit_gensting]

call "@1@7 like a @8recoil" c3a tag recoil
            reverse_means_mirror cross_is_inherited
   setup 2x2 2x2 restriction not_tboned
      preds "Can't do this with phantoms or T-boned people."
         if 2x2_miniwave [CR2N AL3N AM2S CM3S]
         if 2x2_couple   [0    0    CR0S CM3S]
         if always       [CR2N 0    0    CM3S]
            alternate_definition [cross] c3a
   setup 2x2 2x2 restriction forbidden not_tboned
      array [0 0 C1S C2S]
            alternate_definition [singlefile] c3a
   setup 4x1 2x2
      array [C1S C0S 0 0]
            alternate_definition [singlefile cross] c3a
   setup 4x1 2x2
      array [C2S C3S 0 0]
            alternate_definition [single] c4
   setup 2x1 1x2
      array [CR0E 0]
            alternate_definition [single cross] c4
   setup 2x1 1x2
      array [CR1E 0]
            alternate_definition [3x3] c4
   setup 2x3 2x3 rotate
      array [0 0 0 C5E C4E C3E]
            alternate_definition [3x3 cross] c4
   setup 2x3 2x3 rotate
      array [0 0 0 C0E C1E C2E]
            alternate_definition [3x3 singlefile] c4
   setup 6x1 2x3
      array [C2S C1S C0S 0 0 0]
            alternate_definition [4x4] c4
   setup 2x4 2x4 rotate
      array [0 0 0 0 C7E C6E C5E C4E]
            alternate_definition [4x4 cross] c4
   setup 2x4 2x4 rotate
      array [0 0 0 0 C0E C1E C2E C3E]
            alternate_definition [4x4 singlefile] c4
   setup 8x1 2x4
      array [C3S C2S C0S C1S 0 0 0 0]
            reverse_means_mirror singlefile_is_inherited diamond_is_legal
            cross_is_inherited visible_fractions
   seq splitrecycle [or_anycall inherit_reverse
                    inherit_singlefile inherit_diamond inherit_cross]
   seq stepnfold [inherit_cross]

call "@0 like a recoil" c3a
            visible_fractions
   seq nullcall [mandatory_anycall]
   seq stepnfold []

call "follow your leader" c3a tag leader
   setup 2x4 2x4 restriction forbidden wave_only
      array [C4W A6E C5W A7E AM4E CM6W AM5E CM7W]
            alternate_definition [single] c4
   setup 2x2 2x2 restriction forbidden wave_only
      array [CR2W AL3E AM2E CM3W]
            alternate_definition [fractal] c4
   setup 2x4 2x4 restriction forbidden wave_only
      array [CR4W A6E C5W AL7E AM1W CM3E AM0W CM2E]
            alternate_definition [3x3 12matrix] c4   // Same as 12 matrix
   setup 2x6 2x6 restriction wave_only
      array [6W 9E 7W 10E 8W 11E 6E 9W 7E 10W 8E 11W]
            alternate_definition [4x4 16matrix] c4   // Same as 16 matrix
   setup 2x8 2x8 restriction wave_only
      array [8W 12E 9W 13E 10W 14E 11W 15E 8E 12W 9E 13W 10E 14W 11E 15W]
            alternate_definition [3x3] c4            // Same as 12 matrix
   setup 2x6 2x6 restriction wave_only
      array [6W 9E 7W 10E 8W 11E 6E 9W 7E 10W 8E 11W]
            alternate_definition [4x4] c4            // Same as 16 matrix
   setup 2x8 2x8 restriction wave_only
      array [8W 12E 9W 13E 10W 14E 11W 15E 8E 12W 9E 13W 10E 14W 11E 15W]
            alternate_definition [12matrix] c4
   setup 2x6 2x6 restriction wave_only
      array [6W 9E 7W 10E 8W 11E 6E 9W 7E 10W 8E 11W]
            alternate_definition [16matrix] c4
   setup 2x8 2x8 restriction wave_only
      array [8W 12E 9W 13E 10W 14E 11W 15E 8E 12W 9E 13W 10E 14W 11E 15W]

call "ends go as you are, finish your leader" c3a tag finleader
   setup qtag 2x4 restriction serious_violation wave_only
      array [0 0 AM4E CM6W 0 0 CM7W AM5E]
   setup pqtag 2x4
      array [CR4S C5S 0 0 A2S AL3S 0 0]

call "switch your leader" c3a
            visible_fractions
   seq switch_to_diamond []
   seq finleader []

call "gee whiz" c3
   setup 2x4 2x4 rotate qualifier 2fl_only
         array                            [CR0E CR1E AL6E AL7E ZM0W ZM1W ZM7W ZM6W]
   setup 2x4 2x4 rotate qualifier 1fl_only
         array                            [CR0E CR1E AL6E AL7E    0    0    0    0]
   setup 2x4 2x4 rotate
      predscantdocallinsetup
         if miniwave_side_of_out_3n1_line [   0 AM5E CM2E    0 ZM0W    0    0 ZM7W]
         if miniwave_side_of_in_3n1_line  [CM5E    0    0 AM2E    0 ZM0W ZM7W    0]
         if lines_miniwave                [CM5E AM5E CM2E AM2E ZM0W ZM0W ZM7W ZM7W]
         if lines_couple                  [CR0E CR1E AL6E AL7E    0    0    0    0]
            alternate_definition [single] c4
   setup 2x2 2x2 qualifier wave_only
      array [CR1S AL0S ZM1N ZM0N]
   setup 2x2 2x2 qualifier out in_or_out
      array [CR1S AL0S ZM1N ZM0N]
            alternate_definition [1x2] c4
   setup 2x3 2x3 rotate
      predscantdocallinsetup
         if miniwave_side_of_2n1_line [CR0E 0 AL5E    0 ZM1W    0]
         if couple_side_of_2n1_line   [   0 0    0 ZM0W ZM5W ZM4W]
            alternate_definition [3x3] c4
   setup 2x6 2x6 rotate qualifier 3x3couples_only
         array [CR0E CR1E CR2E AL9E AL10E AL11E ZM0W ZM1W ZM2W ZM11W ZM10W ZM9W]
            alternate_definition [4x4] c4
   setup 2x8 2x8 rotate qualifier 4x4couples_only
         array [CR0E CR1E CR2E CR3E AL12E AL13E AL14E AL15E ZM0W ZM1W ZM2W ZM3W ZM15W ZM14W ZM13W ZM12W]

call "right gee whiz" c3
   setup 2x4 2x4 rotate qualifier 1fl_only
         array                            [CM5E AM4E AL6E AL7E    0    0    0    0]

call "left gee whiz" c3
   setup 2x4 2x4 rotate qualifier 1fl_only
         array                            [CR0E CR1E CM2E AM3E    0    0    0    0]

call "straight fire" c4
            take_right_hands
   setup 2x4 2x4 rotate restriction 2fl_only
      array [CR0E CM1E AM6E AL7E ZM1W AM4E CM3E ZM6W]
   setup pqtag 2x4
      array [ZM2N CR4S 0 0 AL3S ZM5N 0 0]
   setup qtag 2x4
      array [0 0 AM5S CM4S 0 0 CM6S AM7S]
            alternate_definition [yoyo] c4
   setup 2x4 2x4 rotate restriction wave_only
      array [CR0E CM6S AM1N AL7E ZM1W AM3N CM4S ZM6W]
   setup pqtag 2x4 restriction nice_diamonds
      array [ZM2N CR4S 0 0 AL3S ZM5N 0 0]
   setup qtag 2x4 restriction nice_diamonds
      array [0 0 AM4E CM5W 0 0 CM7W AM6E]

call "straight connect" c4
   /* Copied from "straight" modifier of "connect the diamond", of course. */
   setup qtag 2x4 restriction controversial nice_diamonds qualifier right dmd_ctrs_mwv
      array [0   0    AM2W CM3E  0   0  CM1E AM0W]
   setup pqtag 2x4 restriction controversial nice_diamonds qualifier right dmd_ctrs_mwv
      array [ZM2N CR4S  0   0  AL4S ZM2N 0 0]
   setup qtag 2x4 restriction controversial nice_diamonds qualifier left dmd_ctrs_mwv
      array [0   0    AM2W CM3E  0   0  CM1E AM0W]
   setup pqtag 2x4 restriction controversial nice_diamonds qualifier left dmd_ctrs_mwv
      array [ZM5N CR3S  0   0  AL3S ZM5N 0 0]
   /* Fall back on these if handedness of centers can't be determined. */
   setup qtag 2x4 restriction controversial nice_diamonds
      array [0   0    AM2W CM3E  0   0  CM1E AM0W]
   setup pqtag 2x4 restriction controversial nice_diamonds
      array [ZM2N CR4S  0   0  AL3S ZM5N 0 0]

call "fiddle around" c4
   setup 2x4 2x4 rotate restriction 2fl_only
      array [R0E R1W L6W L7E M1W L4W R3W M6W]

call "lead the class" c4a
   setup 2x4 2x4 restriction wave_only
      array [CR4W AL6E CR5W AL7E AL0E CCR6E AAL5W CR3W]

call "go first class" c4a
   simple_funny
   setup 2x4 2x4 restriction wave_only
      array [CR2S AL0S CR3S AL1S ZM3N ZM1N ZM2N ZM0N]
   setup 4x2 2x4
      array [ZM1N ZM5N 0 0 0 0 ZM2N ZM6N]
            alternate_definition [12matrix] c4
   setup 3x4 3x4 restriction wave_only
      array [CR2S AL0S CR3S AL1S ZM3N ZM1N ZM4N ZM11N ZM5N ZM10N ZM0N ZM2N]
            alternate_definition [16matrix] c4
   setup 4x4 4x4 restriction wave_only
      array [AL13S ZM0N ZM1N ZM13N ZM2N ZM11N ZM7N ZM15N
            ZM9N ZM10N ZM12N ZM3N CR14S AL12S CR0S ZM14N]
            alternate_definition [3x3 12matrix] c4
   setup 2x6 2x6 restriction wave_only
      array [CR3S AL0S CR4S AL1S CR5S AL2S ZM5N ZM2N ZM4N ZM1N ZM3N ZM0N]
            alternate_definition [4x4 16matrix] c4
   setup 2x8 2x8 restriction wave_only
      array [CR4S AL0S CR5S AL1S CR6S AL2S CR7S AL3S
             ZM7N ZM3N ZM6N ZM2N ZM5N ZM1N ZM4N ZM0N]
            alternate_definition [rewind] c4
   setup 2x4 2x4 qualifier 2fl_only
      array [CR1S CR3S AL0S AL2S ZM3N ZM1N ZM2N ZM0N]

call "with a touch of class" c4a tag touchofclass
   setup 2x4 2x4 restriction forbidden wave_only
      array [CM5S AM7S CM4S AM6S AM0S CM6N AM5N CM3S]
            alternate_definition [rewind] c4
   setup 2x4 2x4 qualifier 2fl_only
      array [CM4S CM2N AM1N AM7S AL2S AL0S CR3S CR1S]

call "touch of class" c4a
   alias touchofclass

call "link up" c3a
   setup 2x4 2x4 restriction 2fl_only
      array [AM7S AM0S CM3S CM4S AL1S AM6S CM5S CR2S]
            alternate_definition [single] c4
   setup 2x2 1x4 restriction peelable_box
      array [A0S C2S A1S C3S]
            alternate_definition [3x3] c4
   setup 2x6 3x4 restriction 3x3_2fl_only
      array [A9S A10S A0S C3S C4S C6S A1S A11S A8S C7S C5S C2S]
            alternate_definition [4x4] c4
   setup 2x8 4x4 restriction 4x4_2fl_only
      array [A8S A9S A10S A12S C0S C1S C2S C4S A13S A15S A11S A6S C5S C7S C3S C14S]
            alternate_definition [1x2] c4
   setup 2x3 short6 rotate
      predscantdocallinsetup
         if miniwave_side_of_2n1_line [A4E   0 C1E   0 A3E   0]
         if couple_side_of_2n1_line   [  0   0   0 A5E C2E C0E]
            alternate_definition [2x1] c4
   setup 2x3 bone6
      predscantdocallinsetup
         if miniwave_side_of_2n1_line [  0 A0S   0 A5S   0 C2S]
         if couple_side_of_2n1_line   [A4S C1S C3S   0   0   0]

call "and anything" c4 tag anything   /* **** not right, need to allow for pushy cast */
   setup 2x4 2x4
   array [0S 2S 1S 3S 4S 6S 5S 7S]

call "@0 and anything" c4
            dont_use_in_resolve
   seq nullcall [mandatory_anycall]
   seq anything []

call "_finish set back" dontshow tag finish_set_back
            funny_is_inherited
   conc crossback [inherit_funny]
        circulate [conc_demand_lines conc_force_lines endscando inherit_funny]

call "set back" c4a
            funny_is_inherited visible_fractions
   seq trade []
   seq finish_set_back [inherit_funny]

call "trade the diamond" c3
            left_means_mirror visible_fractions funny_is_inherited
   // Do the usualy thing--inherit "funny" to all parts, even those for which it is illegal,
   // to require that the user say "thirdly funny".
   seq trade_duck [inherit_funny]
   seq sglctrtogetherhinge [inherit_left inherit_funny]  // Can't modify -- dancers wouldn't
                                                         // know whether we meant this one
   seq diamondcirc [inherit_funny allow_forced_mod]
   seq sglctrtogetherhinge [inherit_left inherit_funny]  // or this one.

call "trade the diamond but @0" c3
            left_means_mirror visible_fractions funny_is_inherited
   seq trade_duck [inherit_funny]
   seq sglctrtogetherhinge [inherit_left inherit_funny]
   seq diamondcirc [inherit_funny allow_forced_mod]
   seq sglctrtogetheranything [inherit_funny]

call "you all" c4a tag youall
            left_means_mirror grand_is_inherited fractal_is_inherited gen_sting_is_inherited
   maybe6x2singleconc_together hinge [inherit_left inherit_fractal inherit_gensting] uturnback []

call "6X2 you all" c4
            fudge_to_q_tag left_means_mirror fractal_is_inherited gen_sting_is_inherited
   conc2_6 hinge [or_anycall inherit_left inherit_fractal inherit_gensting] uturnback []

call "reverse the diamond" c4
   conc_or_diamond_line tradethewave [] uturnback []

call "beep beep" c4a
            visible_fractions left_means_mirror diamond_is_legal fractal_is_inherited gen_sting_is_inherited
   seq hinge [allow_forced_mod inherit_left inherit_diamond inherit_fractal inherit_gensting]
   seq youall [inherit_left inherit_diamond inherit_fractal inherit_gensting]   // The "diamond" is of course illegal.

call "ends cut in" c4a
   setup 2x4 2x4
      array [CR2S AL0S CR3S AL1S ZM2N CR4S AL7S ZM1N]
   setup 4x2 2x4 rotate
      array [ZM5W AL7E AL0E 0 0 CR3E CR4E ZM6W]
   setup qtag ptpd
      array [0 0 CR4S AL6S 0 0 AL0S CR2S]
   setup pqtag ptpd
      array [ZM7N CR5S 0 0 AL7S ZM5N 0 0]
   setup thar thar
      array [CR3E AL0S 0 0 AL3W CR4S 0 0]
            alternate_definition [12matrix] c4a
   setup 3x4 3x4
      array [CR2S AL0S CR3S AL1S ZM2N CR4S ZM5N CR6S AL9S ZM11N ZM1N AL10S]
            alternate_definition [16matrix] c4a
   setup 4x4 4x4
      array [AL13S ZM14N ZM3N CR1S ZM7N CR4S AL8S CR2S
             ZM11N ZM15N ZM13N AL9S CR14S AL12S CR0S AL10S]

call "centers cut out" c4a
   setup 2x4 2x4
      array [CR1S CR3S AL0S AL2S AL5S ZM3N ZM0N CR6S]
            alternate_definition [12matrix] c4a
   setup 3x4 3x4
      array [CR1S CR3S AL0S AL2S AL5S ZM3N AL7S ZM4N ZM10N CR8S CR11S ZM0N]
            alternate_definition [16matrix] c4a
   setup 4x4 4x4
      array [AL14S AL3S AL7S ZM0N AL5S ZM2N ZM9N ZM1N
             CR6S CR11S CR15S ZM10N CR13S CR0S AL12S ZM12N]

call "relay the diamond" c4a
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            can_be_fan left_means_touch_or_check bigmatrix_is_inherited first_part_visible
   seq trade [inherit_yoyo inherit_gensting inherit_bigmatrix]
   seq startchcircin [insert_number 3 inherit_bigmatrix inherit_fractal inherit_gensting]
   seq ctrs_slip [inherit_bigmatrix]
   seq ctrstrade [inherit_bigmatrix]
   seq diamondcirc [inherit_bigmatrix]
   seq ctrs_cast_3_4_withplainmod [inherit_bigmatrix inherit_fractal inherit_gensting]

call "relay the diamond but @m" c4a
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            can_be_fan left_means_touch_or_check bigmatrix_is_inherited first_part_visible
   seq trade [inherit_yoyo inherit_gensting inherit_bigmatrix]
   seq startchcircin [insert_number 3 inherit_bigmatrix inherit_fractal inherit_gensting]
   seq ctrs_slip [inherit_bigmatrix]
   seq ctrstrade [inherit_bigmatrix]
   seq diamondcirc [inherit_bigmatrix]
   seq ctrs_mandatory_2ndcall [inherit_bigmatrix]

call "_gamut inner part 2" dontshow tag gamutinner2
   seq any_hand_slip []
   seq tradethewave [allow_forced_mod]

call "_gamut part 1" dontshow tag gamut1
            fractal_is_inherited gen_sting_is_inherited
   conc armturn_n4 [insert_number 3 inherit_fractal inherit_gensting]
        circulate [conc_demand_lines conc_force_spots]

call "_gamut part 2" dontshow tag gamut2
   conc gamutinner2 [] circulate [conc_demand_lines conc_force_spots]

call "gamut" c3a
            dont_use_in_resolve last_part_visible
            fractal_is_inherited gen_sting_is_inherited
   seq gamut1 [inherit_gensting inherit_fractal]
   seq gamut2 []
   seq cutdiamond [allow_forced_mod]

call "the gamut" c3a
            last_part_visible
            fractal_is_inherited gen_sting_is_inherited
   seq gamut1 [inherit_gensting inherit_fractal]
   seq gamut2 []
   seq cutdiamond [allow_forced_mod]

call "the gamut but @m" c3a
            dont_use_in_resolve last_part_visible
            fractal_is_inherited gen_sting_is_inherited
   seq gamut1 [inherit_gensting inherit_fractal]
   seq gamut2 []
   seq nullsecond [mandatory_secondary_call]

call "swing the gamut" c3a
            step_to_wave first_part_visible   // Should be first_and_last_parts_visible
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq swing [inherit_yoyo inherit_gensting]
   seq gamut1 [inherit_gensting inherit_fractal]
   seq gamut2 []
   seq cutdiamond [allow_forced_mod]

call "swing the gamut but @m" c3a
            dont_use_in_resolve step_to_wave first_part_visible   // Should be first_and_last_parts_visible
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq swing [inherit_yoyo inherit_gensting]
   seq gamut1 [inherit_gensting inherit_fractal]
   seq gamut2 []
   seq nullsecond [mandatory_secondary_call]

call "@0 the gamut" c3a
            dont_use_in_resolve first_part_visible   // Should be first_and_last_parts_visible
            fractal_is_inherited gen_sting_is_inherited
   seq nullcall [mandatory_anycall]
   seq gamut1 [inherit_gensting inherit_fractal]
   seq gamut2 []
   seq cutdiamond [allow_forced_mod]

call "@0 the gamut but @m" c3a
            dont_use_in_resolve first_part_visible   // Should be first_and_last_parts_visible
            fractal_is_inherited gen_sting_is_inherited
   seq nullcall [mandatory_anycall]
   seq gamut1 [inherit_gensting inherit_fractal]
   seq gamut2 []
   seq nullsecond [mandatory_secondary_call]

call "mayday in" c4x
            left_means_mirror
   setup 2x4 2x4
      array [3S 1N 4S 6S 0 0 0 0]   /* We think trying to roll after this call is silly. */

call "mayday out" c4x
            left_means_mirror
   setup 2x4 2x4
      array [3N 1N 4S 6S 0 0 0 0]

call "mayday" c4x
            left_means_mirror
   setup 2x4 2x4
      array [3E 1N 4S 6S 0 0 0 0]

call "detach" c4x
            dont_use_in_resolve
   conc ctr_rot_roll [] zing [conc_demand_lines conc_force_otherway endscando]

call "_start trap it @b" dontshow tag trap_1_4
            neednumber
   setup 4x2 bone qualifier num 1 none
      array [CR7E ZM2E ZM1N CR4S AL1S ZM4N ZM2W AL7W]
   setup 4x2 hrglass rotate qualifier num 2 none
      array [CR7N ZM2E ZM0W CR1E AL0E ZM1W ZM6E AL7S]

call "_trap it @b part 2" dontshow tag trap_2
            neednumber
   conc nullcall [] armturn_n4 [suppress_elongation_warnings]

call "_trap it @0 part 2" dontshow tag trap_2_any
   conc nullcall [] nullcall [mandatory_anycall suppress_elongation_warnings]

call "trap it @b X @b" c4x
            need_two_numbers
   seq trap_1_4 []
   seq trap_2 [shift_one_number]

call "trap it @b X @0" c4x
            neednumber
   seq trap_1_4 []
   seq trap_2_any []

call "mini shake" c4x
            dont_use_in_resolve left_means_mirror
   setup 2x2 2x2
      array [CR1W CR2W AL1W CR0E]

call "divide and pair" c4x
   setup 4x2 2x4 rotate
      array [ACR0N AL6S AL1S AL7N CR4S CR2N CR5N CAL3S]
   setup 2x4 2x4
      array [0 AL1W CR2E 0 0 CR5E AL6W 0]

call "_centers bail out" dontshow tag ctrs_bail_out
            visible_fractions singlefile_is_inherited
   seq short_n_sweet [allow_plain_mod inherit_singlefile]
   seq splitctrrot [allow_plain_mod]

call "_centers bail out but @0" dontshow tag ctrs_bail_out_but
            visible_fractions singlefile_is_inherited
   seq short_n_sweet [allow_plain_mod inherit_singlefile]
   seq nullcall [mandatory_anycall]

call "bail out" c4
            visible_fractions singlefile_is_inherited
   // The "force columns" makes the hingers stay together.
   conc ctrs_bail_out [inherit_singlefile] half_circ_and_hinge [conc_force_columns endscando]

call "bail out but @0" c4
            visible_fractions singlefile_is_inherited
   conc ctrs_bail_out_but [inherit_singlefile] half_circ_and_hinge [conc_force_columns endscando]

call "_ends shape up @h" dontshow tag endsshape
   seq partnertag []
   seq sortofendsbend []
   seq passthru []
   seq face_dir []

call "shape up @h" c4x
   conc tickle [] endsshape [conc_demand_columns conc_force_otherway endscando]

call "ease off" c3a
   conc circ_and_quarter_in [] zing [conc_demand_lines conc_force_spots endscando]

call "_line of 4 trade / change ends" dontshow tag fourtrade_change_ends
            yoyo_is_inherited gen_sting_is_inherited
     conc_diamond_line trade [inherit_yoyo inherit_gensting] diamondcirc []

call "relay the deucey" plus
            step_to_wave yoyo_is_inherited gen_sting_is_inherited can_be_fan
            left_means_touch_or_check first_and_last_parts_visible
            fractal_is_inherited
   seq tradencheckparwaves [inherit_yoyo inherit_gensting]
   seq motivate2 [inherit_fractal]
   seq ctrlineof6trade [inherit_yoyo inherit_gensting]         // six!
   seq fourtrade_change_ends [inherit_yoyo inherit_gensting]   // four!
   seq ctrlineof6trade [inherit_yoyo inherit_gensting]         // six!
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "relay the deucey but @m" c1
            step_to_wave yoyo_is_inherited gen_sting_is_inherited can_be_fan
            left_means_touch_or_check first_and_last_parts_visible
            fractal_is_inherited
   seq tradencheckparwaves [inherit_yoyo inherit_gensting]
   seq motivate2 [inherit_fractal]
   seq ctrlineof6trade [inherit_yoyo inherit_gensting]         // six!
   seq fourtrade_change_ends [inherit_yoyo inherit_gensting]   // four!
   seq ctrlineof6trade [inherit_yoyo inherit_gensting]         // six!
   seq finishwithmodbut2nd []

call "barrel of fun" c4a
   setup 2x4 2x4
      array [L2N R4S L1S R3S 0 R0N L5N 0]

call "roll em" c4a
            left_means_mirror
   setup 2x4 2x4
      array [CR1S CR2S CR3S CR4N AL5S AL6S AL7S 0]
   setup 2x3 2x3
      array [CR1S CR2S CR3N AL4S AL5S 0]
            alternate_definition [12matrix] c4a
   setup 2x6 2x6
      array [CR1S CR2S CR3S CR4S CR5S CR6N AL7S AL8S AL9S AL10S AL11S 0]
            alternate_definition [16matrix] c4a
   setup 2x8 2x8
      array [CR1S CR2S CR3S CR4S CR5S CR6S CR7S CR8N AL9S AL10S AL11S AL12S AL13S AL14S AL15S 0]

call "roll out the barrel" c4a
            left_means_mirror
   setup 2x4 2x4
      array [CM1N CR6N CR7N CM0N 0 0 0 0]
            alternate_definition [single] c4
   setup 2x2 1x4
      array [C1N C0N 0 0]
            alternate_definition [3x3] c4
   setup 2x6 3x4
      array [C1N C11N C8N C9N C10N C0N 0 0 0 0 0 0]
            alternate_definition [4x4] c4
   setup 2x8 4x4
      array [C13N C15N C11N C6N C8N C9N C10N C12N 0 0 0 0 0 0 0 0]

call "_line to line part 1" dontshow tag line_line_1
   conc turnthru [] pass_in [conc_demand_lines conc_force_columns]

call "_line to line part 2" dontshow tag line_line_2
   crossconc passthru [conc_demand_columns] clover [conc_demand_lines conc_force_columns]

call "line to line" c4a
            visible_fractions twisted_is_inherited
   seq line_line_1 [inherit_twisted]   // We put "inherit_twisted" on these to
   seq line_line_2 [inherit_twisted]   // force caller to say "finally twisted".
   seq pass_in [allow_plain_mod inherit_twisted]

call "line to line but @0" c4a
            visible_fractions
   seq line_line_1 []
   seq line_line_2 []
   seq nullcall [mandatory_anycall]

call "_centers plan ahead" dontshow tag plan_ctrtoend
            rear_back_from_r_wave left_means_mirror
   setup 2x2 2x2
      array [0 0 CCR0E CAL1W]
            alternate_definition [generous] c3
   setup 4x1 2x2
      array [CCR2S 0 0 CCAL3N]
            alternate_definition [stingy] c3
   setup 4x1 2x2
      array [AL1S 0 0 CR0N]

call "_ends plan ahead" dontshow tag plan_endtoctr
            left_means_mirror
   setup 2x2 2x2
      array [CR3N AACR0S ACR1W CR2W]

call "plan ahead" c3a
            left_means_mirror gen_sting_is_inherited
   crossconc plan_endtoctr [conc_demand_lines inherit_left]
             plan_ctrtoend [conc_force_columns inherit_left inherit_gensting]

call "take @9" c3
            left_means_mirror neednumber
   setup 2x4 2x4 qualifier num 0 none
      array [CR0E CR1E CR2E CR3E 0 0 0 0]
   setup 2x4 spindle qualifier num 1 none
      array [CM0E CM1E CM2E CR3W 0 0 0 0]
   setup 2x4 2x4 qualifier num 2 none
      array [CM1E CM2E CR3W CR4W 0 0 0 0]
   setup 4x2 qtag qualifier num 2 none restriction controversial alwaysfail
      array [0 0 CM3E CM2E 0 0 0 0]
   setup c1phan hyperglass qualifier num 2 none restriction controversial alwaysfail
      array [0 CM3E 0 CM4E 0 CR8W 0 CR5W 0 0 0 0 0 0 0 0]
   setup 2x4 3dmd rotate qualifier num 3 none
      array [CM11N CR0S CR1S CR2S 0 0 0 0]
   setup 2x4 2x4 rotate qualifier num 4 none
      array [CR0S CR1S CR2S CR3S 0 0 0 0]
   setup 2x3 2x3 qualifier num 0 none
      array [CR0E CR1E CR2E 0 0 0]
   setup 2x3 short6 rotate qualifier num 1 none
      array [CM5N CM0N CR1S 0 0 0]
   setup 2x3 2x3 qualifier num 2 none
      array [CM1E CR2W CR3W 0 0 0]
   setup 2x3 2x3 rotate qualifier num 3 none
      array [CR0S CR1S CR2S 0 0 0]
   setup 2x2 2x2 qualifier num 0 none
      array [CR0E CR1E 0 0]
   setup 2x2 dmd qualifier num 1 none
      array [CM1E CR2W 0 0]
   setup 2x2 2x2 qualifier num 2 none
      array [CR1W CR2W 0 0]
            alternate_definition [12matrix] c4
   setup 2x6 2x6 qualifier num 0 none
      array [CM0E CM1E CM2E CM3E CM4E CM5E 0 0 0 0 0 0]
   setup 2x6 d4x5 qualifier num 1 none
      array [CM5E CM6E CM7E CM8E CM9E CR12W 0 0 0 0 0 0]
   setup 2x6 2x6 qualifier num 2 none
      array [CM1E CM2E CM3E CM4E CR5W CR6W 0 0 0 0 0 0]
   setup 2x6 d3x4 qualifier num 3 none
      array [CM1E CM2E CM3E CR4W CR5W CR6W 0 0 0 0 0 0]
   setup 2x6 4x4 qualifier num 4 none
      array [CM15E CM3E CR0W CR1W CR2W CR4W 0 0 0 0 0 0]
   setup 2x6 5x25 rotate qualifier num 5 none
      array [CM11N CR0S CR1S CR2S CR3S CR4S 0 0 0 0 0 0]
   setup 2x6 2x6 rotate qualifier num 6 none
      array [CR0S CR1S CR2S CR3S CR4S CR5S 0 0 0 0 0 0]
            alternate_definition [16matrix] c4
   setup 2x8 2x8 qualifier num 0 none
      array [CM0E CM1E CM2E CM3E CM4E CM5E CM6E CM7E 0 0 0 0 0 0 0 0]
   setup 2x8 2x8 qualifier num 2 none
      array [CM1E CM2E CM3E CM4E CM5E CM6E CR7W CR8W 0 0 0 0 0 0 0 0]
   setup 2x8 d4x5 qualifier num 3 none
      array [CM5E CM6E CM7E CM8E CM9E CR13W CR12W CR11W 0 0 0 0 0 0 0 0]
   setup 2x8 4x6 qualifier num 4 none
      array [CM10E CM9E CM8E CM7E CR5W CR6W CR23W CR12W 0 0 0 0 0 0 0 0]
   setup 2x8 4x6 rotate qualifier num 6 none
      array [CM20N CM9N CR0S CR1S CR2S CR3S CR4S CR5S 0 0 0 0 0 0 0 0]
   setup 2x8 2x8 rotate qualifier num 8 none
      array [CR0S CR1S CR2S CR3S CR4S CR5S CR6S CR7S 0 0 0 0 0 0 0 0]
            alternate_definition [3x3] c4
   setup 2x6 2x6 qualifier num 0 none
      array [CM0E CM1E CM2E CM3E CM4E CM5E 0 0 0 0 0 0]
   setup 2x6 d3x4 qualifier num 2 none
      array [CM1E CM2E CM3E CR4W CR5W CR6W 0 0 0 0 0 0]
   setup 2x6 2x6 rotate qualifier num 4 none
      array [CR0S CR1S CR2S CR3S CR4S CR5S 0 0 0 0 0 0]
            alternate_definition [4x4] c4
   setup 2x8 2x8 qualifier num 0 none
      array [CM0E CM1E CM2E CM3E CM4E CM5E CM6E CM7E 0 0 0 0 0 0 0 0]
   setup 2x8 4x6 qualifier num 2 none
      array [CM10E CM9E CM8E CM7E CR5W CR6W CR23W CR12W 0 0 0 0 0 0 0 0]
   setup 2x8 2x8 rotate qualifier num 4 none
      array [CR0S CR1S CR2S CR3S CR4S CR5S CR6S CR7S 0 0 0 0 0 0 0 0]
            alternate_definition [single] c4
   setup 2x2 dmd qualifier num 2 none
      array [CM1E CR2W 0 0]

call "split take @9" c4a
            left_means_mirror neednumber
   setup 2x2 2x2 qualifier num 0 none
      array [CM0E CM0E 0 0]
   setup 2x2 dmd qualifier num 1 none
      array [CM1E CR2W 0 0]
   setup 2x2 2x2 qualifier num 2 none
      array [CR1W CR2W 0 0]

call "hang loose" c4a
   setup 2x4 2x4 rotate restriction wave_only
      array [AAAACR7N CR1S AL6N CCCCAL0S AACR2S CCAL0S AACR7N CCAL5N]

/* The next few items make clear how useful "criss cross" as a heritable
   modifier will be. */

call "@9 steps at a time" c3
            neednumber
   setup 4x2 2x4 restriction wave_only qualifier num 0 none
      array [CR7W CR6W CR5W CR4W AL3E AL2E AL1E AL0E]
   setup 4x2 3x4 rotate restriction wave_only qualifier num 1 none
      array [CR7S CR5S CR2S AL10N CR4S AL1N AL11N AL8N]
   setup 4x2 2x4 rotate restriction wave_only qualifier num 2 none
      array [CR5S CR2S AL0N AL7N CR4S CR3S AL1N AL6N]
   setup 2x4 qtag qualifier num 2 none
      array [0 0 0 0 AL3E CR2W AL6E CR7W]
   setup 4x2 3x4 rotate restriction wave_only qualifier num 3 none
      array [CR5S AL0N AL10N AL9N CR6S CR4S CR3S AL11N]
   setup 4x2 2x4 restriction wave_only qualifier num 4 none
      array [AL3E AL2E AL1E AL0E CR7W CR6W CR5W CR4W]
   setup 3x2 2x3 restriction wave_only qualifier num 0 none
      array [CR5W CR4W CR3W AL2E AL1E AL0E]
   setup 3x2 short6 restriction wave_only qualifier num 1 none
      array [CR5W CR3W AL1E CR4W AL2E AL0E]
   setup 3x2 bone6 rotate restriction wave_only qualifier num 2 none
      array [CR2S AL0N AL4N CR3S CR1S AL5N]
   setup 3x2 2x3 restriction wave_only qualifier num 3 none
      array [AL2E AL1E AL0E CR5W CR4W CR3W]
   setup 2x2 2x2 restriction wave_only qualifier num 0 none
      array [CR1W AL0E AL3E CR2W]
   setup 2x2 1x4 restriction wave_only qualifier num 1 none
      array [AL0E CR2W AL1E CR3W]
   setup 2x2 2x2 restriction wave_only qualifier num 2 none
      array [AL3E CR2W CR1W AL0E]
            alternate_definition [cross] c3
   setup 4x2 3x4 rotate restriction wave_only qualifier num 1 none
      array [CR7S CR5S CR2S CR4S AL10N AL1N AL11N AL8N]
   setup 4x2 2x4 rotate restriction wave_only qualifier num 2 none
      array [CR5S CR2S CR3S CR4S AL7N AL0N AL1N AL6N]
   setup 2x4 qtag qualifier num 2 none
      array [0 0 0 0 AL3E CR2W AL6E CR7W]
   setup 4x2 3x4 rotate restriction wave_only qualifier num 3 none
      array [CR5S CR3S CR4S CR6S AL9N AL10N AL0N AL11N]
   setup 4x2 2x4 restriction wave_only qualifier num 4 none
      array [CR4W CR5W CR6W CR7W AL0E AL1E AL2E AL3E]
   setup 3x2 short6 restriction wave_only qualifier num 1 none
      array [CR5W CR3W CR4W AL1E AL2E AL0E]
   setup 3x2 bone6 rotate restriction wave_only qualifier num 2 none
      array [CR2S CR1S CR3S AL4N AL0N AL5N]
   setup 3x2 2x3 restriction wave_only qualifier num 3 none
      array [CR3W CR4W CR5W AL0E AL1E AL2E]
   setup 2x2 1x4 restriction wave_only qualifier num 1 none
      array [CR2W AL0E AL1E CR3W]
   setup 2x2 2x2 restriction wave_only qualifier num 2 none
      array [CR2W AL3E AL0E CR1W]
            alternate_definition [magic] c4a
   setup 4x2 2x4 rotate restriction magic_only qualifier num 2 none
      array [AL6N CR2S CR3S AL7N CR4S AL0N AL1N CR5S]
            alternate_definition [magic cross] c4a
   setup 4x2 2x4 rotate restriction magic_only qualifier num 2 none
      array [AL6N CR2S AL0N CR4S AL7N CR3S AL1N CR5S]
            alternate_definition [single] c4
   setup 2x2 2x2 restriction wave_only qualifier num 0 none
      array [CR1W AL0E AL3E CR2W]
   setup 2x2 1x4 restriction wave_only qualifier num 2 none
      array [AL0E CR2W AL1E CR3W]
   setup 2x2 2x2 restriction wave_only qualifier num 4 none
      array [AL3E CR2W CR1W AL0E]
            alternate_definition [single cross] c4
   setup 2x2 1x4 restriction wave_only qualifier num 2 none
      array [CR2W AL0E AL1E CR3W]
   setup 2x2 2x2 restriction wave_only qualifier num 4 none
      array [CR2W AL3E AL0E CR1W]

call "criss cross @9 steps at a time" c4a
            neednumber
   setup 4x2 3x4 rotate restriction wave_only qualifier num 1 none
      array [AL8N AL11N AL1N CR4S AL10N CR2S CR5S CR7S]
   setup 4x2 2x4 rotate restriction wave_only qualifier num 2 none
      array [AL6N AL1N CR3S CR4S AL7N AL0N CR2S CR5S]
   setup 4x2 3x4 rotate restriction wave_only qualifier num 3 none
      array [AL11N CR3S CR4S CR6S AL9N AL10N AL0N CR5S]

call "barge thru" c4a
            visible_fractions split_like_square_thru twisted_is_inherited
   seq square_thru_n [allow_forced_mod inherit_twisted insert_number 2]
   seq trade_by [allow_forced_mod]

call "square the barge" c4a
            visible_fractions split_like_square_thru twisted_is_inherited
   seq square_thru_n [allow_forced_mod inherit_twisted insert_number 4]
   seq trade_by [allow_forced_mod]

call "square the barge 3/4" c4a
            visible_fractions split_like_square_thru twisted_is_inherited
   seq square_thru_n [allow_forced_mod inherit_twisted insert_number 3]
   seq trade_by [allow_forced_mod]

call "wipe out" c4a
   setup 2x4 2x4
      array [CCAL2N CM3S AM0S AACR1N AACR6N AM7S CM4S CCAL5N]
   setup 4x2 2x4 rotate
      array [0 CM4E CM3E 0 0 AM0E AM7E 0]
   setup 4x4 4x4
      array [AACR13N 0 0 AM10S AACR6N 0 0 AM9S CCAL5N 0 0 CM2S CCAL14N 0 0 CM1S]
            alternate_definition [yoyo] c4
   setup 2x4 qtag rotate
      // Only the ends can do it yoyo, so you must say "ends work yoyo, wipe out".
      array [CCAL6S 0 0 AACR6N AACR3N 0 0 CCAL3S]
            alternate_definition [generous] c3
   setup 2x4 qtag rotate
      array [CCAL6S 0 0 AACR6N AACR3N 0 0 CCAL3S]
            alternate_definition [stingy] c3
   setup 2x4 qtag rotate
      array [CCAL7N 0 0 AACR7S AACR2S 0 0 CCAL2N]
            alternate_definition [single] c4
   setup 1x4 1x4
      array [CCAL3N CM2S AACR1N AM0S]
   setup dmd dmd rotate
      array [CCAL1W 0 AACR3W 0]
   setup pmd dmd rotate
      array [0 CM2E 0 AM0E]

call "_wipe out but nothing" dontshow tag wipe_out_but_nothing
   setup 2x4 2x4
      array [CR1S CM3S AM0S AL2S AL5S AM7S CM4S CR6S]
   setup 4x2 2x4 rotate
      array [0 CM4E CM3E 0 0 AM0E AM7E 0]

call "wipe out but @m" c4a
   seq wipe_out_but_nothing []
   seq ctrs_mandatory_2ndcall []

call "_ends stroll down the lane part 1" dontshow tag endsstrolldown1
            reverse_means_mirror
   setup 2x2 2x2
   array [0 0 CCR2N CR1S]

// There doesn't appear to be a commonly accepted and useful
// notion of what "1/3 stroll down the lane" means.
call "2/3 stroll down the lane" c4 tag newstrolldown1
            reverse_means_mirror singlefile_is_inherited
   // By inheriting singlefile to both parts, of which the second is illegal,
   // we make it necessary to say "centers work single file".
   conc hammerlane [inherit_singlefile]
        endsstrolldown1 [inherit_singlefile conc_demand_lines conc_force_columns]

call "_stroll down the lane part 2" dontshow tag newstrolldown2
            reverse_means_mirror
   setup qtag 2x4 restriction forbidden 2fl_only
      array [0 0 0 0 ZM6N ZM7N ZM0N ZM1N]

call "stroll down the lane" c4a
            reverse_means_mirror singlefile_is_inherited
   seq newstrolldown1 [inherit_singlefile]
   seq newstrolldown2 []

call "chuck-a-luck part 1" dontshow tag chuckaluck1
   setup 1x4 1x4
      array [CM1E AL0S AM3W CR2S]
            alternate_definition [cross] c3
   setup 1x4 1x4
      array [CM1E CR2S AM3W AL0S]

call "chuck-a-luck part 2" dontshow tag chuckaluck2
            cross_is_inherited
   conc chuckaluck2ctr [inherit_cross]
        pass_in []

call "chuck-a-luck part 2, ctr" dontshow tag chuckaluck2ctr
   setup 2x1 1x2
      array [ZM1N 0]
            alternate_definition [cross] c3
   setup 2x2 2x2
      array [0 0 ZM0N ZM1N]

call "chuck-a-luck" c3
   setup 2x4 2x4
      array [CM2E AL7E CR4W AM1W AM6W 0 0 CM5E]
            alternate_definition [cross] c3
   setup 2x4 2x4
      array [CM5E CR4W AL7E AM6W AM1W 0 0 CM2E]
            visible_fractions
            cross_is_inherited
   seq chuckaluck1 [inherit_cross]
   seq chuckaluck2 [inherit_cross]

call "mix the line" c4
            left_means_mirror
   setup 2x4 2x4
      array [0 0 0 0 CR4E CR3E AL1W AL6W]
            alternate_definition [single] c4
   setup 2x2 1x4
      array [0 0 CR2E AL1W]

call "bend the line" mainstream tag bendtheline
            parallel_conc_end
   setup 1x4 2x2 restriction forbidden couples_only
      array [CR0E CR3E AL1W AL2W]
            alternate_definition [single] c4
   setup 1x2 1x2
      array [CR0E AL1W]
            alternate_definition [3x3] mainstream
   setup 1x6 2x3 rotate restriction forbidden 3x3couples_only
      array [CR5N CR4N CR3N AL0S AL1S AL2S]
            alternate_definition [4x4] mainstream
   setup 1x8 2x4 rotate restriction forbidden 4x4couples_only
      array [CR7N CR6N CR4N CR5N AL0S AL1S AL3S AL2S]
            alternate_definition [6x6] c4
   setup 1x12 2x6 rotate restriction forbidden 3x3couples_only
      array [CR11N CR10N CR9N CR8N CR7N CR6N AL0S AL1S AL2S AL3S AL4S AL5S]
            alternate_definition [8x8] c4
   setup 1x16 2x8 rotate restriction forbidden 4x4couples_only
      array [CR15N CR14N CR13N CR12N CR11N CR10N CR9N CR8N
            AL0S AL1S AL2S AL3S AL4S AL5S AL6S AL7S]
            alternate_definition [half] mainstream
   setup 2x4 qtag rotate qualifier left 2fl_only plus_eighth_rotation
      array [0 0 AL7S AL6S AL0S AL1S 0 0]
   setup 2x4 qtag qualifier right 2fl_only plus_eighth_rotation
      array [CR6N CR7N 0 0 0 0 CR4N CR5N]
   setup 2x4 alamo qualifier in 1fl_only plus_eighth_rotation
      array [0 0 0 0 AL2W AL3W CR4N CR5N]
   setup 2x4 thar qualifier out 1fl_only plus_eighth_rotation
      array [CR0N CR1N AL3W AL2W 0 0 0 0]

call "retreat the line" c4
            parallel_conc_end
   setup 1x4 2x2 restriction forbidden couples_only
      array [AL3W AL0W CR2E CR1E]
            alternate_definition [single] c4
   setup 1x2 1x2
      array [AL0W CR1E]
            alternate_definition [3x3] c4
   setup 1x6 2x3 rotate restriction forbidden 3x3couples_only
      array [AL3S AL4S AL5S CR2N CR1N CR0N]
            alternate_definition [4x4] c4
   setup 1x8 2x4 rotate restriction forbidden 4x4couples_only
      array [AL4S AL5S AL7S AL6S CR3N CR2N CR0N CR1N]
            alternate_definition [half] mainstream
   setup 2x4 qtag rotate qualifier right 2fl_only plus_eighth_rotation
      array [AL4S AL5S 0 0 0 0 AL3S AL2S]
   setup 2x4 qtag qualifier left 2fl_only plus_eighth_rotation
      array [0 0 CR0N CR1N CR2N CR3N 0 0]
   setup 2x4 alamo qualifier out 1fl_only plus_eighth_rotation
      array [AL6W AL7W CR0N CR1N 0 0 0 0]
   setup 2x4 thar qualifier in 1fl_only plus_eighth_rotation
      array [0 0 0 0 CR4N CR5N AL7W AL6W]

call "ends bend" a1 tag endsbend
   setup 2x4 2x4 rotate qualifier line_ends_looking_out
      array [R7N M6W M1W L0S 0 M2W M5W 0]
   setup 4x2 2x4 rotate qualifier line_ends_looking_out
      array [0 M6W M1W 0 0 M2W M5W 0]
   setup 1x4 2x3 rotate restriction unusual alwaysfail
      array [CR5N ZM4W AL0S ZM1W]
   setup 4x1 2x3 rotate restriction unusual alwaysfail
      array [0 ZM4W 0 ZM1W]

call "_square the bases part 1" dontshow tag sqbases1
            left_means_mirror twisted_is_inherited
   conc square_thru_n [inherit_left allow_forced_mod inherit_twisted insert_number 3]
        pass_in [inherit_left conc_demand_lines conc_force_otherway
                inherit_twisted suppress_elongation_warnings]

// Actually, we want "last_2_parts_visible".
call "square the bases" c1
            left_means_mirror twisted_is_inherited visible_fractions
   seq sqbases1 [inherit_left inherit_twisted]
   seq splitsq2 [inherit_left allow_forced_mod]
   seq trade_by [inherit_left allow_forced_mod]

call "square the bases, new centers to a wave" c1
            left_means_mirror twisted_is_inherited visible_fractions
   seq sqbases1 [inherit_left inherit_twisted]
   seq splitsq2 [inherit_left allow_forced_mod]
   seq trade_by_to_wave [inherit_left]

call "square the bases but @m" c2
            left_means_mirror twisted_is_inherited visible_fractions
   seq sqbases1 [inherit_left inherit_twisted]
   seq splitsq2 [inherit_left allow_forced_mod]
   seq trade_by_but []

// Actually, we want "last_2_parts_visible".
call "square the bases plus @9" c4
            neednumber left_means_mirror twisted_is_inherited visible_fractions
   seq sqbases1 [inherit_left inherit_twisted]
   seq splitsq2plusn [inherit_left allow_forced_mod]
   seq trade_by [inherit_left allow_forced_mod]

// This is just 1/4 out in the box, hoping that people are leads.
call "_ends regroup 1" dontshow tag eregroup1
   setup 1x2 1x2
      array [AL0W CR1E]
   setup 2x2 2x2 qualifier out in_or_out
      array [AL0W CR1E 0 0]
   setup 2x2 2x2 restriction unusual alwaysfail
      array [AL0W CR1E CR2E AL3W]

call "_ends regroup" dontshow tag eregroup
            visible_fractions
   seq eregroup1 []
   seq trade []
   seq nullcall_other_elong []

call "regroup" c1
            visible_fractions diamond_is_legal funny_is_inherited
   conc trade_and_roll_w_tbone [inherit_diamond inherit_funny]
        eregroup [inherit_diamond inherit_funny conc_demand_lines endscando]

call "regroup but @m" c3
            visible_fractions diamond_is_legal funny_is_inherited
   conc trade_w_tbone_but [inherit_diamond inherit_funny]
        eregroup [inherit_diamond inherit_funny conc_demand_lines endscando]

call "_trade, must be leads" dontshow tag trade_demand_leads
   setup 2x2 2x2
      array [CR1S AL0S 0 0]

call "_trip the set part 1" dontshow tag tripset1
   conc quarterout [] trade_demand_leads [conc_demand_lines conc_force_otherway endscando]

call "_trip the set part 2" dontshow tag tripset2
            diamond_is_legal funny_is_inherited
   conc trade_w_tbone [inherit_diamond inherit_funny] roll [inherit_funny conc_force_spots endscando]

call "_trip the set part 2 but @m" dontshow tag tripset2but
   conc nullsecond [mandatory_secondary_call] roll [conc_force_spots endscando]

call "trip the set" c3a
            visible_fractions diamond_is_legal
   seq tripset1 []
   seq tripset2 [inherit_diamond]

call "trip the set but @m" c3a
            visible_fractions
   seq tripset1 []
   seq tripset2but []

call "siamese breakdown" c4a
   setup 1x2 1x2 rotate
      predscantdocallinsetup
         if 1x2_beau_or_miniwave [CR0E AL0E]
         if always [0 AL1E]
   setup 2x1 1x2 rotate
      array [AL0E CR1E]

call "_cross to dmd part 1" dontshow tag cross_to_dmd_1
   setup 2x4 2x4
      array [ZM1N CR3S AL0S ZM2N ZM5N ZM3N ZM0N ZM6N]
   setup ptpd qtag
      array [ZM6N 0 ZM7N 0 ZM2N 0 ZM3N 0]
   setup pptpd qtag
      array [0 ZM1N 0 ZM4N 0 AL1S 0 CR4S]

call "_hinge with interlock" dontshow tag hinge_w_intlk
            left_means_mirror
   setup 1x2 1x2 rotate
      predscantdocallinsetup
         if 1x2_beau_or_miniwave [CR0N AL0S]
         if always               [0    AL1S]
            alternate_definition [fractal] c4
   setup 1x2 1x2 rotate restriction forbidden wave_only
      array [CR1S AL1N]
            alternate_definition [generous] c3
   setup 1x2 1x2 restriction forbidden wave_only
      array [CR1S AL0S]
            alternate_definition [stingy] c3
   setup 1x2 1x2 restriction forbidden wave_only
      array [ZM0N ZM1N]
            alternate_definition [interlocked] c4a
   setup 2x2 1x4 rotate restriction forbidden not_tboned
      predscantdocallinsetup
         if 1x2_beau_or_miniwave [CR0N AL0S AL1S CR1N]
         if always               [   0 AL3S AL2S    0]

call "_hinge and centers snake" dontshow tag hinge_n_snake
            left_means_mirror
   setup 2x2 dmd rotate restriction forbidden not_tboned
      predscantdocallinsetup
         if 1x2_beau_or_miniwave [CR0N AL0S ZM1W ZM3W]
         if always               [   0 AL1E AL2S    0]

call "_cross to dmd part 2" dontshow tag cross_to_dmd_2
            left_means_mirror intlk_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc hinge_w_intlk [inherit_left inherit_intlk inherit_fractal inherit_gensting] nullcall []

call "_cross to hrglass part 2" dontshow tag cross_to_hrg_2
            left_means_mirror
   conc hinge_n_snake [inherit_left] nullcall []

call "cross to a@I diamond" c4
            left_means_mirror intlk_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq cross_to_dmd_1 []
   seq cross_to_dmd_2 [roll_transparent inherit_left inherit_intlk inherit_fractal inherit_gensting]

call "cross to an hourglass" c4
            left_means_mirror
   seq cross_to_dmd_1 []
   seq cross_to_hrg_2 [roll_transparent inherit_left]

call "_cross to wv part 2" dontshow tag cross_to_wv_2
   setup 2x4 2x4
      array [CR2S ZM0N ZM3N AL1S ZM2N ZM4N ZM7N ZM1N]
   setup 4x2 2x4 rotate
      array [ZM5W ZM7W ZM0W 0 0 ZM3W ZM4W ZM6W]
   setup qtag ptpd
      array [0 0 ZM4N ZM6N 0 0 ZM0N ZM2N]
   setup pqtag ptpd
      array [ZM7N CR5S 0 0 AL7S ZM5N 0 0]

call "cross to a wave" c4
            left_means_mirror fractal_is_inherited gen_sting_is_inherited
   seq ctrhinge [inherit_left inherit_fractal inherit_gensting]
   seq cross_to_wv_2 []

call "presto" c4a
            take_right_hands
      // The roll info is questionable except for the centers, who clearly
      // can't roll, so it's just not worth putting in.
   setup 2x4 2x4 rotate restriction 2fl_only
      array [C1E C2E A5E A6E A7E A4E C3E C0E]
   setup 4x2 2x4 restriction unusual alwaysfail
      array [0 C7S C6S 0 0 C1S C0S 0]
            alternate_definition [single] c4
   setup 1x4 2x2 restriction 2fl_only
      array [C1S C2S A0S A3S]
            alternate_definition [3x3] c4
   setup 3x4 2x6 rotate restriction 2fl_only
      array [C2E C3E A8E A9E A10E A7E A11E A6E C5E C0E C1E C4E]
            alternate_definition [4x4] c4
   setup 4x4 2x8 rotate restriction 2fl_only
      array [A12E A13E A14E A10E A15E A8E C7E A9E
             C0E C1E C2E C6E C3E C4E A11E C5E]

call "_finish follow and cross" dontshow tag rfinfollx
   // This is just acey-deucey, but we take no chances with weird setups.
   conc trade [] circulate [conc_demand_lines conc_force_lines]

call "follow the deucey" c4x tag finfollx
            cross_is_inherited
   seq followthru [inherit_cross]
   seq rfinfollx []

call "cross the deucey" c4x
   seq followthru [force_cross]
   seq rfinfollx []

call "follow and cross" c4a
            visible_fractions scatter_is_inherited
   seq plainboxyscootback [inherit_scatter]
   seq finfollx []

call "follow and criss cross" c4a
            visible_fractions scatter_is_inherited
   seq plainboxyscootback [inherit_scatter]
   seq finfollx [force_cross]

call "_lines walk nowhere" dontshow tag lines_walk_nowhere
   setup 2x4 2x4 rotate
      array [0 ZM6W ZM1W 0 ZM0W ZM2W ZM5W ZM7W]
   setup 4x2 2x4 rotate
      array [0 ZM6W ZM1W 0 0 ZM2W ZM5W 0]
   setup hrglass dhrglass
      array [   0 0 ZM2N ZM3N 0    0 ZM6N ZM7N]
   setup phrglass dhrglass
      array [ZM1N 0 ZM2N ZM3N 0 ZM4N ZM6N ZM7N]
   setup dhrglass hrglass
      array [0 0 ZM2N ZM3N ZM1N ZM0N ZM6N ZM7N]
   setup pdhrglass hrglass
      array [0 0 ZM2N ZM3N    0    0 ZM6N ZM7N]

call "lines walk @h" c4
   seq lines_walk_nowhere []
   seq face_dir []

call "_sort of ends bend" dontshow tag sortofendsbend
   setup 2x2 2x2 other_elongate
      array [R0E L1W 0 0]

call "_centers scramble" dontshow tag cscramble
            visible_fractions twisted_is_inherited
   seq quarterin [inherit_twisted]  // Must say "finally twisted".
   seq crosstrail [inherit_twisted]

call "_ends scramble" dontshow tag escramble
            visible_fractions yoyo_is_inherited gen_sting_is_inherited
   seq sortofendsbend []
   seq turnthru [inherit_yoyo inherit_gensting]

call "scramble" c3
            visible_fractions yoyo_is_inherited gen_sting_is_inherited twisted_is_inherited
   conc cscramble [inherit_twisted]
        escramble [inherit_yoyo inherit_gensting conc_demand_lines conc_force_lines endscando]

call "ferris wheel" mainstream
   setup 2x4 2x4 rotate qualifier couples_only restriction unusual 2fl_only
      array [CR0E CR7E AL0E AL7E AL6E AL1E CR6E CR1E]
            alternate_definition [single] c3a
   split_to_box
   // If it can be split into a non-T-boned box, do so.
   setup 2x2 1x4 rotate qualifier ntbone wave_only
      array [CR0E AL0E AL1E CR1E]
   // If the box is T-boned, use that, but raise a DYP warning.
   setup 2x2 1x4 rotate qualifier tbone none restriction resolve_ok wave_only
      array [CR0E AL0E AL1E CR1E]
   // Otherwise, it's the line kind.  Pointless, but legal.
   setup 1x4 2x2 qualifier 2fl_only
      array [CR1S CR0S AL0S AL1S]
            alternate_definition [3x3] c4
   setup 2x6 3x4 rotate restriction forbidden 3x3couples_only
      array [CR0E CR10E CR9E AL0E AL10E AL9E AL8E AL11E AL1E CR8E CR11E CR1E]
   setup 3x4 2x6 rotate restriction forbidden 2fl_only
      array [CR0E CR11E AL0E AL11E AL10E AL1E AL9E AL2E CR9E CR2E CR1E CR10E]
            alternate_definition [4x4] c4
   setup 2x8 4x4 restriction forbidden 4x4couples_only
      array [CR0S CR14S CR13S CR12S AL0S AL14S AL13S AL12S AL10S AL15S AL3S AL1S CR10S CR15S CR3S CR1S]
   setup 4x4 2x8 rotate restriction unusual 2fl_only   // T-bone?  What the heck.
      array [AL15E AL14E AL13E AL1E AL12E AL3E CR12E AL2E CR3E CR2E CR1E CR13E CR0E CR15E AL0E CR14E]
            alternate_definition [1x2] c4
   setup 2x3 short6
      preds "Not in correct kind of lines."
         if miniwave_side_of_2n1_line [CR1S 0 AL1S    0 AL2S    0]
         if couple_side_of_2n1_line   [   0 0    0 AL0S CR0S CR2S]
            alternate_definition [2x1] c4
   setup 2x3 bone6 rotate
      preds "Not in correct kind of lines."
         if miniwave_side_of_2n1_line [   0 CR4E    0 AL5E 0 CR5E]
         if couple_side_of_2n1_line   [CR0E AL0E AL4E    0 0    0]
            alternate_definition [3x3 single] c4
   setup 3x2 1x6 restriction forbidden wave_only
      array [CR5S CR4S CR3S AL3S AL4S AL5S]
   setup 1x6 2x3 restriction forbidden 3x3couples_only
      array [CR2S CR1S CR0S AL0S AL1S AL2S]
            alternate_definition [4x4 single] c4
   setup 4x2 1x8 restriction forbidden wave_only
      array [CR6S CR7S CR5S CR4S AL4S AL5S AL7S AL6S]
   setup 1x8 2x4 restriction forbidden 4x4couples_only
      array [CR3S CR2S CR0S CR1S AL0S AL1S AL3S AL2S]
            alternate_definition [6x6 single] c4
   setup 6x2 1x12 restriction forbidden wave_only
      array [CR11S CR10S CR9S CR8S CR7S CR6S
            AL6S AL7S AL8S AL9S AL10S AL11S]
   setup 1x12 2x6
      array [CR5S CR4S CR3S CR2S CR1S CR0S
            AL0S AL1S AL2S AL3S AL4S AL5S]
            alternate_definition [8x8 single] c4
   setup 8x2 1x16 restriction forbidden wave_only
      array [CR15S CR14S CR13S CR12S CR11S CR10S CR9S CR8S
            AL8S AL9S AL10S AL11S AL12S AL13S AL14S AL15S]
   setup 1x16 2x8
      array [CR7S CR6S CR5S CR4S CR3S CR2S CR1S CR0S
            AL0S AL1S AL2S AL3S AL4S AL5S AL6S AL7S]

call "finish ferris wheel" mainstream
            split_large_setups
   setup 3x4 2x4 rotate qualifier couples_only restriction resolve_ok 2fl_only
      array [CR0E CR7E AL0E AL7E AL6E AL1E 0 0 0 0 CR1E CR6E]
            alternate_definition [single] c3a
   setup 3x2 1x4 restriction resolve_ok wave_only
      array [0 CR3S CR2S AL2S AL3S 0]

call "ferris trade and wheel" c4
   setup 2x4 2x4 rotate restriction forbidden 2fl_only
      array [CR0E CR7E AL0E AL7E AL6E AL5W CR2W CR1E]

call "step lively" c4a
            visible_fractions funny_is_inherited
   seq detour [inherit_funny]
   seq slimdown [inherit_funny]
   seq circulate [inherit_funny]

call "recount" c4a
   setup 2x4 2x4 rotate qualifier wave_only
      array [CR0N AL6S CR1N AL7S AL1S CR3S AL4N CR6N]
   setup 2x4 2x4 rotate
      preds "Not in correct kind of lines."
         if miniwave_side_of_out_3n1_line [CR0N    0    0 AL7S    0 CR3S AL4N    0]
         if couple_side_of_out_3n1_line   [   0    0    0    0 AL1S AL2S CR5N CR6N]

call "ferris to a column" c4
   setup 2x4 2x4 rotate restriction 2fl_only
      array [C1E C0E A7E A6E Z0W A5E C2E Z7W]

call "_rip saw part 1" dontshow tag ripsaw1
   conc partnertag [] trade_demand_leads [conc_demand_lines conc_force_otherway endscando]

call "_rip saw part 2" dontshow tag ripsaw2
   crossconc passthru [conc_demand_columns] cloverleaf [force_single conc_demand_lines conc_force_spots endscando]

call "_rip saw part 2 but @0" dontshow tag ripsaw2but
   crossconc nullcall [mandatory_anycall conc_demand_columns]
             cloverleaf [force_single conc_demand_lines conc_force_spots endscando]

call "rip saw" c4a tag ripsaw
            visible_fractions
   seq ripsaw1 []
   seq ripsaw2 []

call "ripsaw" c4a
   alias ripsaw

call "rip saw but @0" c4
            visible_fractions
   seq ripsaw1 []
   seq ripsaw2but []

call "_ends cast a shadow" dontshow tag endscastshad
   setup 2x2 2x2 restriction forbidden peelable_box
      array [AAM0W CCM1E CM2W AM3E]
            alternate_definition [fractal] c4
   setup 2x2 2x2 restriction forbidden peelable_box
      array [AM3E CM2W CM1E AM0W]

call "_ctrs cast shadow but turn @b" dontshow tag numberbingo
            neednumber fractal_is_inherited yoyo_fractal_numbers no_elongation_allowed
   setup 2x2 2x2 restriction wave_only qualifier num 1 none
      array [AL0E CR1W AM0W CM1E]
   setup 2x2 2x2 restriction wave_only qualifier num 3 none
      array [AL0E CR1W AM2E CM3W]

call "cast a shadow" a1
            fractal_is_inherited
   conc numberbingo [inherit_fractal insert_number 1]
        endscastshad [inherit_fractal conc_demand_lines conc_force_otherway endscando]

call "cast a shadow, very centers cast 3/4" a1
   conc numberbingo [insert_number 3]
        endscastshad [conc_demand_lines conc_force_otherway]

call "_ends criss cross the shadow" dontshow tag endsxxshad
   setup 2x2 2x2 restriction forbidden peelable_box
      array [AACM0E CCAM1W AM2E CM3W]
            alternate_definition [fractal] c4
   setup 2x2 2x2 restriction forbidden peelable_box
      array [AACM3W CCAM2E AM1W CM0E]

call "_ctrs criss cross shadow" dontshow tag ctrxxshad
            fractal_is_inherited
   setup 2x2 2x2 restriction wave_only
      array [AL3E CR2W CM1E AM0W]
            alternate_definition [fractal] c4
   setup 2x2 2x2 restriction wave_only
      array [AL3E CR2W CM3W AM2E]

call "criss cross the shadow" c2
            fractal_is_inherited
   conc ctrxxshad [inherit_fractal]
        endsxxshad [inherit_fractal conc_demand_lines conc_force_otherway endscando]

call "shadow to a diamond" c4a
            fractal_is_inherited
   conc peelntrail []
        endscastshad [inherit_fractal conc_demand_lines conc_force_otherway]

call "criss cross shadow to a diamond" c4
   setup 2x4 qtag restriction forbidden ends_are_peelable
      array [AACM0E AL6S CR2S CCAM1W AM4E CR3S AL7S CM5W]

call "shadow the column" c4a
   setup 4x2 2x4
      array [C5E A0E AL2E AA3W CC4E CR5W C7W A2W]

call "criss cross shadow the column" c4a
   setup 4x2 2x4
      array [A2W C0W AL1E AAC3E CCA4W CR6W A7E C5E]

call "continue to shadow the column" c4
   setup qtag 2x4 rotate
      array [AL6N CR1S AM3N CM3S AM6S CM1N CM4S AM4N]

call "pinwheel" c4
   setup 2x4 2x4 restriction forbidden 2fl_only
      array [AL0E AL7E CR4W CR3W AL2W AL5W CR6E CR1E]

call "ends pinwheel" c4
           single_is_inherited
   maybesingleconc wheelanddeal [inherit_single] cast_off_n4 [inherit_single insert_number 3]

call "centers pinwheel" c4
           single_is_inherited
   conc cast_off_n4 [inherit_single insert_number 3] wheelanddeal [inherit_single]

call "mix and mingle" c4x
   setup 2x4 2x4 restriction forbidden 2fl_only
      array [CR1E CR6E AL5W AL2W AL3W AL4W CR7E CR0E]

call "_chisel1" dontshow tag chisel1
            twisted_is_inherited
   conc pass_in [inherit_twisted] pass_in [conc_demand_lines conc_force_otherway suppress_elongation_warnings endscando inherit_twisted]

call "_chisel2" dontshow tag chisel2
            visible_fractions
   conc pass_out [] pass_in [conc_demand_lines conc_force_spots endscando]

call "chisel thru" c2
            visible_fractions twisted_is_inherited
   seq chisel1 [inherit_twisted]
   seq chisel2 [inherit_twisted]
   seq pass_in [allow_plain_mod inherit_twisted]

call "chisel thru but @0" c2
            visible_fractions twisted_is_inherited
   seq chisel1 [inherit_twisted]
   seq chisel2 [inherit_twisted]
   seq nullcall [mandatory_anycall]

call "_pass one person" dontshow tag passoneperson
            rear_back_from_r_wave left_means_mirror
   setup 2x2 2x2 qualifier in in_or_out
      array [0 0 ZM1N ZM0N]
   setup 2x2 2x2 other_elongate qualifier out in_or_out
      array [CM1E AM0W 0 0]
   setup star 2x2 qualifier dmd_facing plus_eighth_rotation
      array [CR0N 0 AL0W 0]
   setup dmd 2x2 other_elongate qualifier right dmd_facing plus_eighth_rotation
      array [CR0N 0 AL0W 0]
   setup pmd 2x2 other_elongate qualifier right dmd_facing plus_eighth_rotation
      array [0 ZM1N 0 ZM1W]
   setup dmd 2x2 qualifier left dmd_facing plus_eighth_rotation
      array [CR0N 0 AL0W 0]
   setup pmd 2x2 qualifier left dmd_facing plus_eighth_rotation
      array [0 ZM1N 0 ZM1W]
            alternate_definition [half] plus
   setup 2x2 1x4 qualifier in in_or_out
      array [0 0 ZM3N ZM0N]
   setup 2x2 1x4 rotate qualifier out in_or_out
      array [CM0N AM1S 0 0]
            alternate_definition [lasthalf] plus
   setup 1x4 2x2 other_elongate
      array [ZM0N 0 0 ZM1N]
            alternate_definition [twisted] c4
   setup 4x1 2x2 other_elongate
      array [CM3E 0 0 CM2E]

call "do the centers part of load the boat" plus tag cloadboat
            visible_fractions twisted_is_inherited
   seq passthru [inherit_twisted]
   seq quarterout [inherit_twisted]  // Of course, twisted will expire before we get here.
   seq trade_w_tbone [inherit_twisted]
   seq passthru [inherit_twisted]

call "_centers load the boat but @m" dontshow tag cloadboatbut
            visible_fractions twisted_is_inherited
   seq passthru [inherit_twisted]
   seq quarterout [inherit_twisted]
   seq trade_w_tbone [inherit_twisted]
   seq nullsecond [inherit_twisted mandatory_secondary_call]

call "_centers load the boat 7/8" dontshow tag cloadboat78
            visible_fractions twisted_is_inherited
   seq passthru [inherit_twisted]
   seq quarterout [inherit_twisted]
   seq trade_w_tbone [inherit_twisted]
   seq passthru [force_half]

call "_ends load the boat" dontshow tag eloadboat
            visible_fractions twisted_is_inherited
   seq passoneperson [inherit_twisted]
   seq passoneperson [inherit_twisted]
   seq passoneperson [inherit_twisted]
   seq quarterin [inherit_twisted]

call "_the boat 2" dontshow tag boat2
   conc quarterout [] passoneperson [conc_demand_lines suppress_elongation_warnings]

call "_the boat 3" dontshow tag boat3
   conc trade_w_tbone [] passoneperson []

call "_the boat 4" dontshow tag boat4
   conc passthru [] quarterin []

call "_the boat 4 but @m" dontshow tag boat4but
   conc nullsecond [mandatory_secondary_call] quarterin []

call "load the boat" plus
   setup 2x4 2x4 qualifier in 1fl_only
      array [0 0 0 0 0 0 0 0]   // Always fail; array def is only for 3x3 etc.
            alternate_definition [4x4 16matrix] c4
   setup 2x8 2x8 qualifier in 1fl_only
      array [0 0 0 0 0 0 0 0 AM15E CM14W AM13E CM12W AM11E CM10W AM9E CM8W]
            alternate_definition [3x3 12matrix] c4
   setup 2x6 2x6 qualifier in 1fl_only
      array [0 0 0 0 0 0 AM11E CM10W AM9E CM8W AM7E CM6W]
            alternate_definition [single] c4
   setup 2x2 2x2 qualifier in in_or_out
      array [0 0 AM3E CM2W]
            visible_fractions twisted_is_inherited
   conc cloadboat [inherit_twisted]
        eloadboat [endscando inherit_twisted conc_demand_lines suppress_elongation_warnings]
            // See test bi01t.
            visible_fractions twisted_is_inherited
   seq passthru [inherit_twisted]
   seq boat2 [inherit_twisted]  // Of course, twisted will expire before we get here.
   seq boat3 [inherit_twisted]
   seq boat4 [inherit_twisted]

// Of course you can call this below C1 by saying something like "centers work 7/8".
call "load the boat, centers to a wave" c1
            visible_fractions
   conc cloadboat78 []
        eloadboat [endscando conc_demand_lines suppress_elongation_warnings]

call "@0 the boat" plus
            visible_fractions
   seq nullcall [mandatory_anycall]
   seq boat2 []
   seq boat3 []
   seq boat4 []

call "load the boat but @m" c1
            visible_fractions twisted_is_inherited
   conc cloadboatbut [inherit_twisted]
        eloadboat [endscando inherit_twisted conc_demand_lines suppress_elongation_warnings]

call "@0 the boat but @m" plus
            visible_fractions
   seq nullcall [mandatory_anycall]
   seq boat2 []
   seq boat3 []
   seq boat4but []

call "_confidence 1" dontshow tag confidence_1
            left_means_mirror yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc hinge_with_warn [inherit_left inherit_yoyo inherit_fractal inherit_gensting]
        circulate [force_half]

call "_confidence 2" dontshow tag confidence_2
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc2_6 hinge_with_warn [inherit_yoyo inherit_fractal inherit_gensting] nullcall []

call "_confidence 3" dontshow tag confidence_3
   setup crosswave 2x4 qualifier ctrwv_end2fl
      array [ZM0N ZM1N 0 0 ZM3N ZM2N 0 0]
   setup pcrosswave 2x4 qualifier ctrwv_end2fl
      array [0 0 CR3E AL1E 0 0 AL4W CR6W]
   setup crosswave 2x4 rotate qualifier ctr2fl_endwv
      array [CR7N AL5N 0 0 AL0S CR2S 0 0]
   setup pcrosswave 2x4 rotate qualifier ctr2fl_endwv
      array [0 0 ZM0W ZM1W 0 0 ZM3W ZM2W]
   setup thar c1phan
      preds "Can't figure out what to do."
         if lines_couple   [ZM0N  ZM2N 0 0 ZM5N  ZM7N 0 0]
         if lines_miniwave [CR1E AL14E 0 0 AL4W CR11W 0 0]

call "with confidence" c3
            visible_fractions left_means_mirror yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq confidence_1 [inherit_left inherit_yoyo inherit_gensting inherit_fractal]
   seq confidence_2 [inherit_yoyo inherit_gensting inherit_fractal]
   seq confidence_3 []

call "criss cross the deucey" c3 tag xxduck
   setup 2x4 2x4 rotate qualifier ntbone none restriction forbidden wave_only
      array [CM1N AL5N CR2S AM6S CM3S AM3N CM4S AM4N]
   setup 2x4 ptpd qualifier tbone none
      array [CM7E AL3E CR5W AM1W 0 0 0 0]
   setup 4x2 ptpd qualifier tbone none
      array [AM0E 0 AM6E 0 0 CM6W 0 CM0W]

call "criss cross the diamond" c4
            visible_fractions
   seq xxduck []
   seq sglctrtogetherhinge []  // Can't modify -- dancers wouldn't know
                               // whether we meant this one
   seq diamondcirc [allow_forced_mod]
   seq sglctrtogetherhinge []  // or this one.

call "criss cross the diamond but @0" c4
            visible_fractions
   seq xxduck []
   seq sglctrtogetherhinge []
   seq diamondcirc [allow_forced_mod]
   seq sglctrtogetheranything []

call "easy does it" c4a
   setup 2x4 2x4 rotate restriction peelable_box
      array [AL4N AL5N CR2S CR3S AL0S AL1S CR6N CR7N]
            alternate_definition [single] c4
   setup 2x2 2x2 restriction peelable_box
      array [AL3E CR2W AL1W CR0E]
            alternate_definition [3x3 12matrix] c4
   setup 2x6 2x6 rotate restriction forbidden 3x3couples_only
      array [AL6N AL7N AL8N CR3S CR4S CR5S AL0S AL1S AL2S CR9N CR10N CR11N]
            alternate_definition [4x4 16matrix] c4
   setup 2x8 2x8 rotate restriction forbidden 4x4couples_only
      array [AL8N AL9N AL10N AL11N CR4S CR5S CR6S CR7S
            AL0S AL1S AL2S AL3S CR12N CR13N CR14N CR15N]
   conc zing [] zing [conc_demand_lines conc_force_otherway endscando]

call "_lazy half circ for quarterdeucey" dontshow tag half_circ_for_qd
   setup 2x2 2x3 rotate restriction forbidden wave_only
      array [ZM5W ZM0W ZM1W ZM4W]
            alternate_definition [12matrix] c4
   setup 3x2 2x4 restriction forbidden wave_only
      array [ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N]
            alternate_definition [16matrix] c4
   setup 4x2 2x5 restriction forbidden wave_only
      array [ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N]

call "_centers @b / ends half-circ" dontshow tag qd2in
            neednumber bigmatrix_is_inherited
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   maybematrix_conc_star armturn_n4 [inherit_yoyo inherit_gensting inherit_fractal]
                         circulate [force_half conc_demand_lines]

call "_centers @b / move into star" dontshow tag newqd2in
            neednumber bigmatrix_is_inherited
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   maybematrix_conc_bar armturn_n4 [inherit_yoyo inherit_gensting inherit_fractal]
                        half_circ_for_qd [inherit_bigmatrix conc_demand_lines]

call "_check line, centers @b / ends half-circ" dontshow tag quarterdeucey2
            neednumber bigmatrix_is_inherited
   seq checkline [inherit_bigmatrix]
   seq qd2in [inherit_bigmatrix]

call "_centers @b / ends move up" dontshow tag quarterdeucey4
            neednumber bigmatrix_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc_diamond_line armturn_n4 [inherit_yoyo inherit_gensting inherit_fractal]
                     spec_drop_in [inherit_bigmatrix suppress_elongation_warnings]

call "check line, centers @b / move into star" dontshow tag newquarterdeucey2
            neednumber bigmatrix_is_inherited
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq checkline [roll_transparent inherit_bigmatrix]
   seq newqd2in [inherit_bigmatrix inherit_yoyo inherit_gensting inherit_fractal]

call "_finish quarterdeucey" dontshow tag ends_finish_qd
            take_right_hands
   setup 3x2 2x2 restriction unusual wave_only
      array [0 ZM1N CR2S AL1S ZM2N 0]
            alternate_definition [12matrix] c4
   setup 4x2 2x3
      array [0 ZM1N ZM2N CR3S AL2S ZM3N ZM4N 0]
            alternate_definition [16matrix] c4
   setup 5x2 2x4
      array [0 ZM1N ZM2N ZM3N CR4S AL3S ZM4N ZM5N ZM6N 0]

call "_centers @b / ends move up or circ" dontshow tag newquarterdeucey4
            neednumber bigmatrix_is_inherited
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc_diamond_line cast_off_n4_with_warn [inherit_yoyo inherit_gensting inherit_fractal]
                     ends_finish_qd [inherit_bigmatrix suppress_elongation_warnings]

call "@B the deucey@S" c3a
            step_to_wave left_means_touch_or_check visible_fractions neednumber bigmatrix_is_inherited
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq armturn_n4 [inherit_bigmatrix inherit_yoyo inherit_gensting inherit_fractal]
   seq newquarterdeucey2 [inherit_bigmatrix inherit_yoyo inherit_gensting inherit_fractal]
   seq newturnstarn_endsnothing [inherit_bigmatrix]
   seq newquarterdeucey4 [inherit_bigmatrix inherit_yoyo inherit_gensting inherit_fractal]

call "@9-@9-@9-@9 quarter the deucey" c4a
            step_to_wave left_means_touch_or_check visible_fractions need_four_numbers bigmatrix_is_inherited
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq armturn_n4 [inherit_bigmatrix inherit_yoyo inherit_gensting inherit_fractal]
   seq newquarterdeucey2 [inherit_bigmatrix shift_one_number]
   seq newturnstarn_endsnothing [inherit_bigmatrix shift_two_numbers]
   seq newquarterdeucey4 [inherit_bigmatrix shift_three_numbers]

call "fan chain the star@S" c4a
            last_part_visible step_to_wave left_means_touch_or_check
            bigmatrix_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq checkline_unusual []
   seq motivate2 [inherit_bigmatrix inherit_fractal]
   seq turnstarn_endsnothing [inherit_bigmatrix insert_number 2]
   seq finishwithplainmod [inherit_bigmatrix inherit_fractal inherit_gensting]

call "fan chain the star@S but @m" c4a
            last_part_visible step_to_wave left_means_touch_or_check
            bigmatrix_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq checkline_unusual []
   seq motivate2 [inherit_bigmatrix inherit_fractal]
   seq turnstarn_endsnothing [inherit_bigmatrix insert_number 2]
   seq finishwithmodbut2nd [inherit_bigmatrix inherit_fractal inherit_gensting]

call "spin chain the star@S" c4a
            step_to_wave can_be_fan left_means_touch_or_check visible_fractions
            bigmatrix_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq trade [inherit_yoyo inherit_gensting]
   seq motivate2 [inherit_bigmatrix inherit_fractal]
   seq turnstarn_endsnothing [inherit_bigmatrix insert_number 2]
   seq finishwithplainmod [inherit_bigmatrix inherit_fractal inherit_gensting]

call "spin chain the star@S but @m" c4a
            step_to_wave can_be_fan left_means_touch_or_check visible_fractions
            bigmatrix_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq trade [inherit_yoyo inherit_gensting]
   seq motivate2 [inherit_bigmatrix inherit_fractal]
   seq turnstarn_endsnothing [inherit_bigmatrix insert_number 2]
   seq finishwithmodbut2nd [inherit_bigmatrix inherit_fractal inherit_gensting]

call "swing chain the star@S" c4
            step_to_wave yoyo_is_inherited gen_sting_is_inherited can_be_fan
            left_means_touch_or_check first_part_visible bigmatrix_is_inherited
   seq trade [inherit_yoyo inherit_gensting]
   seq newquarterdeucey2 [inherit_bigmatrix insert_number 1]
   seq newturnstarn_endsnothing [inherit_bigmatrix insert_number 2]
   seq newquarterdeucey4 [inherit_bigmatrix inherit_gensting insert_number 1]

call "_finish linear flow" dontshow tag fin_lin_flow
   setup 2x4 2x4
      array [CCAL5N A7S C4S AACR6N AACR1N C3S A0S CCAL2N]
            alternate_definition [yoyo] c4
   setup 2x4 qtag rotate
      array [CCAL3S A4E C1E AACR3N AACR6N C0E A5E CCAL6S]
            alternate_definition [single] c4
   setup 1x4 1x4
      array [CCAL3N A0S AACR1N C2S]
            alternate_definition [3x3] c4
   setup 3x4 3x4
      array [CCAL7N A9S C6S AACR8N AACR11N C4S AACR1N C3S A0S CCAL2N CCAL5N A10S]

call "_finish linear flow but cross it" dontshow tag fin_xlin_flow
   setup 2x4 2x4
      array [CCAL5N C4S A7S AACR6N AACR1N A0S C3S CCAL2N]
            alternate_definition [yoyo] c4
   setup 2x4 qtag rotate
      array [CCAL3S C1E A4E AACR3N AACR6N A5E C0E CCAL6S]
            alternate_definition [single] c4
   setup 1x4 1x4
      array [CCAL3N C2S AACR1N A0S]
            alternate_definition [3x3] c4
   setup 3x4 3x4
      array [CCAL7N C6S A9S AACR8N AACR11N A10S AACR1N A0S C3S CCAL2N CCAL5N C4S]

call "_finish linear flow but criss cross it" dontshow tag fin_xxlin_flow
   setup 2x4 2x4
      array [CR6N C4S A7S AL5N AL2N A0S C3S CR1N]
            alternate_definition [yoyo] c4
   setup 2x4 qtag rotate
      array [CCR3N C1E A4E AAL3S AAL6S A5E C0E CCR6N]
            alternate_definition [single] c4
   setup 1x4 1x4
      array [CR1N C2S AL3N A0S]
            alternate_definition [3x3] c4
   setup 3x4 3x4
      array [CR8N C6S A9S AL7N AL5N A10S AL2N A0S C3S CR1N CR11N C4S]

call "linear flow" c4a
            yoyo_is_inherited gen_sting_is_inherited
   seq hinge_with_warn []
   seq natural_vertical_half_tag []
   seq fin_lin_flow [inherit_yoyo inherit_gensting]

call "linear flow but cross it" c4a
            yoyo_is_inherited gen_sting_is_inherited
   seq hinge_with_warn []
   seq natural_vertical_half_tag []
   seq fin_xlin_flow [inherit_yoyo inherit_gensting]

call "linear flow but criss cross it" c4a
            yoyo_is_inherited gen_sting_is_inherited
   seq hinge_with_warn []
   seq natural_vertical_half_tag []
   seq fin_xxlin_flow [inherit_yoyo inherit_gensting]

call "@v er's flow" c4a
            first_part_visible left_means_mirror
            singlefile_is_inherited single_is_inherited mxn_is_inherited
            yoyo_is_inherited gen_sting_is_inherited cross_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_cross inherit_singlefile inherit_single
                    inherit_mxn inherit_revert inherit_fractal]
   seq fin_lin_flow [inherit_single inherit_mxn inherit_yoyo inherit_gensting]

call "@v er's flow but cross it" c4a
            first_part_visible left_means_mirror
            singlefile_is_inherited single_is_inherited mxn_is_inherited
            yoyo_is_inherited gen_sting_is_inherited cross_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_cross inherit_singlefile inherit_single
                    inherit_mxn inherit_revert inherit_fractal]
   seq fin_xlin_flow [inherit_single inherit_mxn inherit_yoyo inherit_gensting]

call "@v er's flow but criss cross it" c4a
            first_part_visible left_means_mirror
            singlefile_is_inherited single_is_inherited mxn_is_inherited
            yoyo_is_inherited gen_sting_is_inherited cross_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_cross inherit_singlefile inherit_single
                    inherit_mxn inherit_revert inherit_fractal]
   seq fin_xxlin_flow [inherit_single inherit_mxn inherit_yoyo inherit_gensting]

call "eroo" c4
            fractal_is_inherited gen_sting_is_inherited
   // This is inconsistent with similar suffixes like delight or dream --
   // the ends are considered to have already quartered to handhold direction,
   // whereas the other calls assume that they have stepped straight ahead.
   // But if you use the call "extend eroo", the right thing will happen.
   conc cast_off_n4_with_warn [insert_number 3 inherit_fractal inherit_gensting]
        circulate [conc_demand_lines conc_force_spots]

call "eroo but @m" c4
            fractal_is_inherited gen_sting_is_inherited
   conc nullsecond [mandatory_secondary_call]
        circulate [conc_demand_lines conc_force_spots]

call "_eroo" dontshow tag eroo
            fractal_is_inherited gen_sting_is_inherited
   // We really want the "cast off 3/4" in the ATC-eroo calls to be
   // an arm turn, to prevent printing annoying warnings.
   conc armturn_n4 [insert_number 3 inherit_gensting inherit_fractal]
        circulate [conc_demand_lines conc_force_spots]

call "_eroo but @m" dontshow tag eroobut2nd
   conc nullsecond [mandatory_secondary_call]
        circulate [conc_demand_lines conc_force_spots]

call "_ends delight" dontshow tag elight
   setup 2x2 2x2 restriction unusual leads_only
      array [CL2W CM3W CAM0W CAL1W]

call "_ends dilemma" dontshow tag elemma
   setup 2x2 2x2 restriction unusual leads_only
      array [AM2E AL3E ACR0E ACM1E]

call "_ends dream" dontshow tag edream
   setup 2x2 2x2 restriction unusual leads_only
      array [CM1E CR2W CAL1W CM2E]

call "_ends nightmare" dontshow tag enight
   setup 2x2 2x2 restriction unusual leads_only
      array [AL3E AM0W AM3W ACR0E]

call "swing slip slide thru" dontshow tag swingslipslidethru
            visible_fractions yoyo_is_inherited gen_sting_is_inherited step_to_wave diamond_is_legal
   seq swing [inherit_yoyo inherit_gensting inherit_diamond]
   seq any_hand_slip [roll_transparent inherit_diamond]
   seq slidethru_in_miniwave [inherit_diamond]

call "swing slip slide thru but @m" dontshow tag swingslipslidethrubut2nd
            visible_fractions yoyo_is_inherited gen_sting_is_inherited step_to_wave
   seq swing [inherit_yoyo inherit_gensting]
   seq any_hand_slip [roll_transparent]
   seq nullsecond [mandatory_secondary_call]

call "swing back the windmill" dontshow tag swingbackwindmill
            visible_fractions yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited diamond_is_legal
   seq swing [inherit_yoyo inherit_gensting allow_forced_mod inherit_diamond]
   seq any_hand_slip [roll_transparent inherit_diamond]
   seq any_hand_slip [roll_transparent inherit_diamond]
   seq cast_off_n4_with_warn [insert_number 3 inherit_fractal inherit_gensting allow_forced_mod inherit_diamond]

call "swing back the windmill but @m" dontshow tag swingbackwindmillbut2nd
            visible_fractions yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq swing [inherit_yoyo inherit_gensting allow_forced_mod]
   seq any_hand_slip [roll_transparent]
   seq any_hand_slip [roll_transparent]
   seq nullsecond [mandatory_secondary_call]

call "delight" c3a tag delight
            step_to_qtag yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited diamond_is_legal
   conc swingbackwindmill [inherit_yoyo inherit_gensting inherit_fractal allow_forced_mod inherit_diamond]
        elight [conc_demand_columns conc_force_spots inherit_diamond]

call "delight but @m" c3a tag delightbut
            step_to_qtag yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc swingbackwindmillbut2nd [inherit_yoyo inherit_gensting inherit_fractal]
        elight [conc_demand_columns conc_force_spots]

call "dilemma" c3a tag dilemma
            step_to_qtag yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited diamond_is_legal
   conc swingbackwindmill [inherit_yoyo inherit_gensting inherit_fractal allow_forced_mod inherit_diamond]
        elemma [conc_demand_columns conc_force_spots inherit_diamond]

call "dilemma but @m" c3a tag dilemmabut
            step_to_qtag yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc swingbackwindmillbut2nd [inherit_yoyo inherit_gensting inherit_fractal]
        elemma [conc_demand_columns conc_force_spots]

call "dream" c4a tag dream
            yoyo_is_inherited gen_sting_is_inherited diamond_is_legal
   conc swingslipslidethru [inherit_yoyo inherit_gensting inherit_diamond]
        edream [conc_demand_columns conc_force_spots inherit_diamond]

call "dream but @m" c4a
            yoyo_is_inherited gen_sting_is_inherited
   conc swingslipslidethrubut2nd [inherit_yoyo inherit_gensting] edream [conc_demand_columns conc_force_spots]

call "nightmare" c4a tag nightmare
            yoyo_is_inherited gen_sting_is_inherited diamond_is_legal
   conc swingslipslidethru [inherit_yoyo inherit_gensting inherit_diamond]
        enight [conc_demand_columns conc_force_spots inherit_diamond]

call "nightmare but @m" c4a
            yoyo_is_inherited gen_sting_is_inherited
   conc swingslipslidethrubut2nd [inherit_yoyo inherit_gensting] enight [conc_demand_columns conc_force_spots]

call "_and trade" dontshow tag tagntrade
   conc_or_diamond_line tradethewave [] trade []

// Same def'n as lead the class, obviously.
call "_the class" dontshow tag class
   setup 2x4 2x4 restriction forbidden wave_only
      array [CR4W AL6E CR5W AL7E AL0E CCR6E AAL5W CR3W]

// Same as 1/2 box circulate.
call "_to a@I diamond" dontshow tag toadiamond
   setup 2x2 dmd rotate
      array [CR0N AL0S ZM1W ZM3W]
            alternate_definition [interlocked] c4a
   setup 2x4 qtag
      array [CR0E AL0W CR1E AL1W ZM2N ZM7N ZM3N ZM6N ]

call "_to an hourglass" dontshow tag toanhourglass
   setup 2x4 hrglass
      array [CR0E AL0W CR1E AL1W ZM2N AL7W CR7E ZM6N]

call "@v your neighbor" c2
            visible_fractions left_means_mirror singlefile_is_inherited nxn_is_inherited
            bigmatrix_is_inherited revert_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_nxn inherit_bigmatrix inherit_revert inherit_fractal]
   seq neighbor [inherit_nxn inherit_gensting inherit_fractal]

call "@v your cross neighbor" c2
            visible_fractions left_means_mirror singlefile_is_inherited
            revert_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq xneighbor [inherit_gensting inherit_fractal]

call "@v your criss cross neighbor" c2
            visible_fractions left_means_mirror singlefile_is_inherited
            revert_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq xxneighbor [inherit_gensting inherit_fractal]

call "@v eroo" c4
            first_part_visible left_means_mirror singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq halfboxcirc_miniwaves []
   seq eroo [inherit_fractal]

call "@v eroo but @m" c4
            first_part_visible left_means_mirror singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq halfboxcirc_miniwaves []
   seq eroobut2nd []

call "extend eroo" c4
            fractal_is_inherited
   seq halfboxcirc_miniwaves []
   seq eroo [inherit_fractal]

call "extend eroo but @m" c4
   seq halfboxcirc_miniwaves []
   seq eroobut2nd []

call "switcheroo" c4
            fractal_is_inherited
   seq switch_to_diamond []
   seq eroo [inherit_fractal]

call "switcheroo but @m" c4
   seq switch_to_diamond []
   seq eroobut2nd []

call "_finish tag the top" dontshow tag fintagthetop
   conc spinthetop [allow_forced_mod] miniwavetrade []

call "@v the top" c3
            first_part_visible left_means_mirror
            singlefile_is_inherited magic_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_magic inherit_revert inherit_fractal]
   seq checkparlines []
   seq circulate [force_half]
   seq fintagthetop [inherit_magic]  /* To be sure we say "initially magic". */

call "jay walk and trade" c4
            visible_fractions
   seq jaywalk []
   seq tagntrade []

// This is an interesting problem.  We allow "track" as a base_tag_call_0 type
// tagging call, which means it can operate only with "@v" suffixes, that is,
// one can say "track back to a wave", and so on.  One of the "@v" suffixes is
// "3/4 <ATC> and trade", meaning ATC to the 3/4 spot, ends trade while centers
// trade the wave.  So one can say "3/4 track and trade" (track 3 and do all that stuff.)
// But there is also a call "track and trade" that has nothing to do with ATC suffixes.
// Fortunately, you can't fractionalize it.
call "track and trade" c4
   setup 4x2 2x4 rotate
      // We say you can only do it in a right-hand column.
      array [CR5E CR2E CM3E CM4E 0 0 0 0]
            alternate_definition [generous] c3
   setup 4x2 qtag
      array [CR6W CR3W CM4S CM5s 0 0 0 0]
            alternate_definition [stingy] c3
   setup 4x2 qtag
      array [CR7E CR2E CM4S CM5s 0 0 0 0]
            alternate_definition [3x3] c4
   setup 6x2 3x4 rotate
      array [CR7E CR5E CR2E CM3E CM4E CM6E 0 0 0 0 0 0]
            alternate_definition [4x4] c4
   setup 8x2 4x4
      array [CR9S CR11S CR7S CR2S CM4S CM5S CM6S CM8S 0 0 0 0 0 0 0 0]

call "track and nothing" dontshow tag trackandnothing
            equalize
   setup 4x2 2x4 rotate
      // We say you can only do it in a right-hand column.
      array [ZM6W ZM1W CM3E CM4E 0 0 0 0]
   setup 2x4 qtag restriction unusual siamese_in_quad
      array [0 0 0 0 ZM2N ZM3N ZM7N ZM6N]
            alternate_definition [magic] c4
   setup 4x2 2x4 rotate
      array [ZM5W 0 0 CM4E 0 CM3E ZM2W 0]

call "track and @0" c4
            dont_use_in_resolve magic_is_inherited
   seq trackandnothing [inherit_magic]
   seq centers_mandatory_call []

call "3/4 @v and trade" c4
            first_part_visible left_means_mirror singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq extend []
   seq tagntrade []

call "@v er's delight" c3a
            first_part_visible left_means_mirror
            singlefile_is_inherited fractal_is_inherited revert_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq extend []
   seq delight [inherit_fractal]

call "@v er's delight but @m" c3a
            first_part_visible left_means_mirror
            singlefile_is_inherited fractal_is_inherited revert_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq extend []
   seq delightbut [inherit_fractal]

call "@v er's dilemma" c3a
            first_part_visible left_means_mirror
            singlefile_is_inherited fractal_is_inherited revert_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq extend []
   seq dilemma [inherit_fractal]

call "@v er's dilemma but @m" c3a
            first_part_visible left_means_mirror
            singlefile_is_inherited fractal_is_inherited revert_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq extend []
   seq dilemmabut [inherit_fractal]

call "@v er's dream" c4a
            first_part_visible singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_singlefile inherit_revert inherit_fractal]
   seq extend []
   seq dream []

call "@v er's nightmare" c4a
            first_part_visible singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_singlefile inherit_revert inherit_fractal]
   seq extend []
   seq nightmare []

call "@v er's motion" c4
            visible_fractions singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_singlefile inherit_revert inherit_fractal]
   seq extend_n [insert_number 4]
   seq turntoline [force_reverse force_single]

call "@v your leader" c3a
            first_part_visible left_means_mirror singlefile_is_inherited
            nxn_is_inherited bigmatrix_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile
                    inherit_nxn inherit_bigmatrix inherit_revert inherit_fractal]
   seq leader [inherit_nxn inherit_bigmatrix inherit_fractal]

call "@v the class" c4
            first_part_visible left_means_mirror singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq class []

call "@v to a@I diamond" c4a
            visible_fractions left_means_mirror singlefile_is_inherited
            revert_is_inherited fractal_is_inherited intlk_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq toadiamond [inherit_intlk]

call "@v to an hourglass" c4
            visible_fractions left_means_mirror singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq toanhourglass []

call "very center 2 trade" dontshow tag veryctr2trade
            yoyo_is_inherited gen_sting_is_inherited
   conc2_6 trade [inherit_yoyo inherit_gensting] nullcall []

call "center line of 6 trade" dontshow tag ctrlineof6trade
            yoyo_is_inherited gen_sting_is_inherited
   conc6_2_line trade [inherit_yoyo inherit_gensting] nullcall []

call "double the wave" c4a
            step_to_wave left_means_touch_or_check fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq fanthetop [allow_forced_mod inherit_gensting inherit_fractal]
   seq veryctr2trade [allow_forced_mod inherit_gensting]

call "hot foot spin" c4a
            step_to_wave left_means_touch_or_check fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq fanthetop [allow_forced_mod inherit_fractal inherit_gensting]
   seq veryctr2trade [allow_forced_mod inherit_gensting]
   seq spinthetop [allow_forced_mod inherit_fractal inherit_gensting]

call "_finish cast a net" dontshow tag fincastanet
   setup crosswave 1x8
      array [C2S A1S 0 0 A6S C5S 0 0]
   setup pcrosswave 1x8
      array [0 0 C4E C3W 0 0 A4W A3E]
            alternate_definition [yoyo] c4
   setup qtag 1x8 rotate
      array [C2S A2N A0S A7N A5N C5S C0N C7S]

call "cast a net" c4a
            first_part_visible yoyo_is_inherited gen_sting_is_inherited
   seq circulate [force_half allow_forced_mod]
   seq fincastanet [inherit_yoyo inherit_gensting]

call "_check facing couples, no roll" dontshow tag checkfacing_noroll
   setup 2x2 2x2 qualifier ntbone in in_or_out
      array [0 0 ZM2N ZM3N]

call "_pass the top 1" dontshow tag passtop1
            left_means_mirror yoyo_is_inherited gen_sting_is_inherited
   conc spinthetop [inherit_left inherit_yoyo inherit_gensting] pass_in [inherit_left conc_demand_lines conc_force_otherway]

call "_pass the top 2" dontshow tag passtop2
   conc explode [] pass_in [conc_demand_lines conc_force_spots]

call "_pass the top 3" dontshow tag passtop3
   crossconc checkfacing_noroll [conc_demand_columns] checkfacing_noroll [conc_force_lines]

call "pass the top" c4a
   // The array definition is the one that will succeed if the centers
   // are absent.  In that case, the sequential definition would fail,
   // because the resulting shape would depend on the facing directions
   // of the absent centers.  But the array definition will make it do
   // the "normal" thing, effectively assuming facing lines.
   // So the array definition must be first.  The test is lh06t.
            rear_back_from_r_wave left_means_mirror
   setup 2x4 2x4
   array [0 0 0 0 AM1S CM7N CCAM0S CM2S]
            left_means_mirror yoyo_is_inherited gen_sting_is_inherited
   // Fractions aren't visible, because there is no consensus that this
   // call can be fractionalized.
   seq passtop1 [inherit_left inherit_yoyo inherit_gensting]
   seq passtop2 []
   seq passtop3 []

call "sock it to me" c2
   setup 1x4 1x4
      preds "Can't find an unambiguous socker."
         if socker_is_left  [CR2S AL0S AL3S AL1S]
         if socker_is_right [0    CR3S 0    CR2S]
   setup 1x3 1x3
      preds "Can't find an unambiguous socker."
         if socker_is_left  [CR2S AL0S AL1S]
         if socker_is_right [0    CR2S 0]
   setup 1x5 1x5
      preds "Can't find an unambiguous socker."
         if socker_is_left  [CR3S AL0S AL1S AL4S AL2S]
         if socker_is_right [0    CR2S CR4S 0    CR3S]
            alternate_definition [12matrix] c3
   setup 1x6 1x6
      preds "Can't find an unambiguous socker."
         if socker_is_left  [CR3S AL0S AL1S AL4S AL5S AL2S]
         if socker_is_right [0    CR2S CR5S 0    CR3S CR4S]
            alternate_definition [16matrix] c3
   setup 1x8 1x8
      preds "Can't find an unambiguous socker."
         if socker_is_left  [CR4S AL0S AL3S AL1S AL5S AL7S AL2S AL6S]
         if socker_is_right [0    CR3S CR6S CR2S 0    CR4S CR7S CR5S]
            alternate_definition [half] c2
   setup 1x4 3x3
      preds "Can't find an unambiguous socker."
         if socker_is_left  [CR1E AL7W AL3W AL8W]
         if socker_is_right [0    CR8E 0    CR3E]
   setup 1x3 trngl
      preds "Can't find an unambiguous socker."
         if socker_is_left  [CR3E AL5W AL4W]
         if socker_is_right [0    CR2E 0]

call "here comes the judge" c2
   setup 1x4 1x4
      preds "Can't find an unambiguous judge."
         if judge_is_right [CR1S CR3S AL0S CR2S]
         if judge_is_left  [0    AL0S 0    AL1S]
   setup 1x3 1x3
      preds "Can't find an unambiguous judge."
         if judge_is_right [CR1S CR2S AL0S]
         if judge_is_left  [0    AL0S 0]
   setup 1x5 1x5
      preds "Can't find an unambiguous judge."
         if judge_is_right [CR1S CR2S CR4S AL0S CR3S]
         if judge_is_left  [0    AL0S AL1S 0    AL2S]
            alternate_definition [12matrix] c3
   setup 1x6 1x6
      preds "Can't find an unambiguous judge."
         if judge_is_right [CR1S CR2S CR5S AL0S CR3S CR4S]
         if judge_is_left  [0    AL0S AL1S 0    AL5S AL2S]
            alternate_definition [16matrix] c3
   setup 1x8 1x8
      preds "Can't find an unambiguous judge."
         if judge_is_right [CR1S CR3S CR6S CR2S AL0S CR4S CR7S CR5S]
         if judge_is_left  [0    AL0S AL3S AL1S 0    AL7S AL2S AL6S]
            alternate_definition [half] c2
   setup 1x4 3x3
      preds "Can't find an unambiguous judge."
         if judge_is_right [CR7E CR8E AL1W CR3E]
         if judge_is_left  [0    AL7W 0    AL8W]
   setup 1x3 trngl
      preds "Can't find an unambiguous judge."
         if judge_is_right [CR5E CR4E AL3W]
         if judge_is_left  [0    AL1W 0]

call "_finish in roll to a wave" dontshow tag fin_inroll
            dont_raise_overcast
   // This is just "in roll circulate" with the centers stable.
   // This is called with the "roll_transparent_if_z" flag, which means
   // That people marked Z slide over and are transparent, people marked
   // R or L force that roll information, and people not marked (that is,
   // undefined), are forced to be "Z" and *not* subject to transparency.
   setup 2x4 2x4 qualifier inroller_is_cw
      array [CR1S ZM2N ZM3N    0    0 ZM6N ZM7N Z0N]
   setup 2x4 2x4 qualifier inroller_is_ccw
      array [   0 ZM0N ZM1N AL2S Z3N  ZM4N ZM5N   0]
   setup pqtag c1phan qualifier inroller_is_cw
      array [Z4N CR6S ZM8N ZM10N 0 0 ZM0N ZM2N]
   setup qtag c1phan qualifier inroller_is_cw
      array [    0   0 ZM8N ZM10N 0 0 ZM0N ZM2N]
   setup pqtag c1phan qualifier inroller_is_ccw
      array [0 0 ZM5N ZM7N AL11S Z9N ZM13N ZM15N]
   setup qtag c1phan qualifier inroller_is_ccw
      array [0 0 ZM5N ZM7N     0    0 ZM13N ZM15N]
   // Catch the hard cases.
   setup 2x4 2x4
      predscantdocallinsetup
         if inroller_is_cw [CR1S ZM2N ZM3N    0    0 ZM6N ZM7N Z0N]
         if always         [   0 ZM0N ZM1N AL2S  Z3N ZM4N ZM5N   0]
            alternate_definition [magic] c3
   setup 2x4 2x4
      predscantdocallinsetup
         if magic_inroller_is_cw [CR6S ZM7N ZM1N    0    0 ZM3N ZM5N Z0N]
         if always               [   0 ZM2N ZM4N AL5S  Z3N ZM6N ZM0N   0]

call "_finish out roll to a wave" dontshow tag fin_outroll
            dont_raise_overcast
   // This is just "out roll circulate" with the centers stable.
   setup 2x4 2x4 qualifier outroller_is_cw
      array [   0 ZM2N ZM3N AL0S AL5S ZM6N ZM7N    0]
   setup 2x4 2x4 qualifier outroller_is_ccw
      array [CR3S ZM0N ZM1N    0    0 ZM4N ZM5N CR6S]
   setup pqtag c1phan qualifier outroller_is_cw
      array [0 0 ZM8N ZM10N AL4S AL14S ZM0N ZM2N]
   setup qtag c1phan qualifier outroller_is_cw
      array [0 0 ZM8N ZM10N    0     0 ZM0N ZM2N]
   setup pqtag c1phan qualifier outroller_is_ccw
      array [CR3S CR9S ZM5N ZM7N 0 0 ZM13N ZM15N]
   setup qtag c1phan qualifier outroller_is_ccw
      array [   0    0 ZM5N ZM7N 0 0 ZM13N ZM15N]
   // Catch the hard cases.
   setup 2x4 2x4
      predscantdocallinsetup
         if outroller_is_cw [   0 ZM2N ZM3N AL0S AL5S ZM6N ZM7N    0]
         if always          [CR3S ZM0N ZM1N    0    0 ZM4N ZM5N CR6S]
            alternate_definition [magic] c3
   setup 2x4 2x4
      predscantdocallinsetup
         if magic_outroller_is_cw [   0 ZM7N ZM1N AL0S AL2S ZM3N ZM5N    0]
         if always                [CR3S ZM2N ZM4N    0    0 ZM6N ZM0N CR1S]

call "_finish zoom roll to a wave" dontshow tag fin_zoomroll
            dont_raise_overcast
   // This is just "zoom roll circulate" with the centers stable.
   setup 2x4 2x4 qualifier outroller_is_cw
      array [   0 ZM2N ZM3N CR4N AL5S ZM6N ZM7N    0]
   setup 2x4 2x4 qualifier outroller_is_ccw
      array [AL7N ZM0N ZM1N    0    0 ZM4N ZM5N CR6S]
   setup pqtag c1phan qualifier outroller_is_cw
      array [0 0 ZM8N ZM10N CR12N AL14S ZM0N ZM2N]
   setup qtag c1phan qualifier outroller_is_cw
      array [0 0 ZM8N ZM10N    0     0 ZM0N ZM2N]
   setup pqtag c1phan qualifier outroller_is_ccw
      array [CR3S AL1N ZM5N ZM7N 0 0 ZM13N ZM15N]
   setup qtag c1phan qualifier outroller_is_ccw
      array [   0    0 ZM5N ZM7N 0 0 ZM13N ZM15N]
   // Catch the hard cases.
   setup 2x4 2x4
      predscantdocallinsetup
         if outroller_is_cw [   0 ZM2N ZM3N CR4N AL5S ZM6N ZM7N    0]
         if always          [AL7N ZM0N ZM1N    0    0 ZM4N ZM5N CR6S]
            alternate_definition [magic] c4
   setup 2x4 2x4
      predscantdocallinsetup
         if magic_outroller_is_cw [   0 ZM7N ZM1N CR4N AL2S ZM3N ZM5N    0]
         if always                [AL7N ZM2N ZM4N    0    0 ZM6N ZM0N CR1S]

call "_finish sock it to the wave" dontshow tag fin_sockit
            dont_raise_overcast
   // This is just "sock it to me" with the centers stable.
   setup 2x4 2x4 qualifier socker_is_cw
      array [0 ZM2N ZM3N 0 AL5S ZM6N ZM7N CR4S]
   setup 2x4 2x4 qualifier socker_is_ccw
      array [CR3S ZM0N ZM1N AL2S 0 ZM4N ZM5N 0]
   setup pqtag c1phan qualifier socker_is_cw
      array [CR12S 0 ZM8N ZM10N 0 AL14S ZM0N ZM2N]
   setup qtag c1phan qualifier socker_is_cw
      array [    0 0 ZM8N ZM10N 0     0 ZM0N ZM2N]
   setup pqtag c1phan // qualifier socker_is_ccw
      array [0 CR9S ZM5N ZM7N AL11S 0 ZM13N ZM15N]
   setup qtag c1phan  //qualifier socker_is_ccw
      array [0    0 ZM5N ZM7N     0 0 ZM13N ZM15N]
   // Catch the hard cases.
   setup 1x4 1x4
      preds "Can't find an unambiguous socker."
         if socker_is_left  [CR2S ZM0N AL3S ZM1N]
         if socker_is_right [0    ZM3N 0    ZM2N]

call "_finish here comes the wave" dontshow tag fin_judge
            dont_raise_overcast
   // This is just "here comes the judge" with the centers stable.
   setup 2x4 2x4 qualifier judge_is_cw
      array [CR1S ZM2N ZM3N AL0S 0 ZM6N ZM7N 0]
   setup 2x4 2x4 qualifier judge_is_ccw
      array [0 ZM0N ZM1N 0 AL7S ZM4N ZM5N CR6S]
   setup pqtag c1phan qualifier judge_is_cw
      array [0 CR6S ZM8N ZM10N AL4S 0 ZM0N ZM2N]
   setup qtag c1phan qualifier judge_is_cw
      array [0    0 ZM8N ZM10N    0 0 ZM0N ZM2N]
   setup pqtag c1phan qualifier judge_is_ccw
      array [CR3S 0 ZM5N ZM7N 0 AL1S ZM13N ZM15N]
   setup qtag c1phan qualifier judge_is_ccw
      array [   0 0 ZM5N ZM7N 0    0 ZM13N ZM15N]
   // Catch the hard cases.
   setup 1x4 1x4
      preds "Can't find an unambiguous judge."
         if judge_is_right [CR1S ZM3N AL0S ZM2N]
         if judge_is_left  [0    ZM0N 0    ZM1N]

call "_start in roll to a diamond" dontshow tag start_inroll
            dont_raise_overcast
   // This is just "in roll circulate" with those *going into the center* stable.
   setup 2x4 2x4 qualifier inroller_is_cw
      array [ZM1N ZM2N CR3S    0    0 ZM6N AL7S ZM0N]
   setup 2x4 2x4 qualifier inroller_is_ccw
      array [   0 AL0S ZM1N ZM2N ZM3N CR4S ZM5N    0]
   // Catch the hard cases.
   setup 2x4 2x4
      predscantdocallinsetup
         if inroller_is_cw [ZM1N ZM2N CR3S    0    0 ZM6N AL7S ZM0N]
         if always         [   0 AL0S ZM1N ZM2N ZM3N CR4S ZM5N    0]

call "_start out roll to a diamond" dontshow tag start_outroll
            dont_raise_overcast
   // This is just "out roll circulate" with those *going into the center* stable.
   setup 2x4 2x4 qualifier outroller_is_cw
      array [   0 ZM2N CR3S AL0S ZM5N ZM6N AL7S    0]
   setup 2x4 2x4 qualifier outroller_is_ccw
      array [CR3S AL0S ZM1N    0    0 CR4S ZM5N ZM6N]
   // Catch the hard cases.
   setup 2x4 2x4
      predscantdocallinsetup
         if outroller_is_cw [   0 ZM2N CR3S AL0S ZM5N ZM6N AL7S    0]
         if always          [CR3S AL0S ZM1N    0    0 CR4S ZM5N ZM6N]

call "_start zoom roll to a diamond" dontshow tag start_zoomroll
            dont_raise_overcast
   // This is just "zoom roll circulate" with those *going into the center* stable.
   setup 2x4 2x4 qualifier outroller_is_cw
      array [   0 ZM2N CR3S CR4N ZM5N ZM6N AL7S    0]
   setup 2x4 2x4 qualifier outroller_is_ccw
      array [AL7N AL0S ZM1N    0    0 CR4S ZM5N ZM6N]
   // Catch the hard cases.
   setup 2x4 2x4
      predscantdocallinsetup
         if outroller_is_cw [   0 ZM2N CR3S CR4N ZM5N ZM6N AL7S    0]
         if always          [AL7N AL0S ZM1N    0    0 CR4S ZM5N ZM6N]

call "_start here comes the diamond" dontshow tag start_judge
            dont_raise_overcast
   // This is just "here comes the judge" with those *going into the center* stable.
   setup 2x4 2x4 qualifier judge_is_cw
      array [ZM1N ZM2N CR3S AL0S 0 ZM6N AL7S 0]
   setup 2x4 2x4 qualifier judge_is_ccw
      array [0 AL0S ZM1N 0 AL7S CR4S ZM5N ZM6N]
   setup rigger ptpd restriction controversial alwaysfail
      array [ZM1N ZM7N AL6S CR4S ZM5N ZM3N 0 AL0S]
   setup prigger ptpd restriction controversial alwaysfail
      array [ZM1N ZM7N    0    0 ZM5N ZM3N 0    0]
   setup bone ptpd restriction controversial alwaysfail
      array [ZM1N ZM7N AL6S 0 ZM5N ZM3N CR2S AL0S]
   setup pbone ptpd restriction controversial alwaysfail
      array [ZM1N ZM7N    0    0 ZM5N ZM3N 0    0]
   setup 1x4 1x4
      preds "Can't find an unambiguous judge."
         if judge_is_right [ZM1N ZM3N AL0S CR2S]
         if judge_is_left  [0    AL0S 0    ZM1N]

call "_start sock it to the diamond" dontshow tag start_sockit
            dont_raise_overcast
   // This is just "sock it to me" with those *going into the center* stable.
   setup 2x4 2x4 qualifier socker_is_cw
      array [0 ZM2N CR3S 0 ZM5N ZM6N AL7S CR4S]
   setup 2x4 2x4 qualifier socker_is_ccw
      array [CR3S AL0S ZM1N ZM2N 0 CR4S ZM5N 0]
   setup rigger ptpd restriction controversial alwaysfail
      array [ZM1N ZM7N 0 CR4S ZM5N ZM3N CR2S AL0S]
   setup prigger ptpd restriction controversial alwaysfail
      array [ZM1N ZM7N 0    0 ZM5N ZM3N    0    0]
   setup bone ptpd restriction controversial alwaysfail
      array [ZM1N ZM7N AL6S CR4S ZM5N ZM3N CR2S 0]
   setup pbone ptpd restriction controversial alwaysfail
      array [ZM1N ZM7N 0    0 ZM5N ZM3N    0    0]
   setup 1x4 1x4
      preds "Can't find an unambiguous socker."
         if socker_is_left  [CR2S AL0S ZM3N ZM1N]
         if socker_is_right [0    ZM3N 0    CR2S]

call "in roll to a wave" c4 tag inrolltowave
            dont_use_in_resolve magic_is_inherited dont_raise_overcast
   seq sglctrhinge []
   seq fin_inroll [roll_transparent_if_z inherit_magic]

call "out roll to a wave" c4 tag outrolltowave
            dont_use_in_resolve magic_is_inherited dont_raise_overcast
   seq sglctrhinge []
   seq fin_outroll [roll_transparent inherit_magic]

call "inroll to a wave" c4
   alias inrolltowave

call "outroll to a wave" c4
   alias outrolltowave

call "zoom roll to a wave" c4
            dont_use_in_resolve magic_is_inherited dont_raise_overcast
   seq sglctrhinge []
   seq fin_zoomroll [roll_transparent inherit_magic]

call "here comes the wave" c4
            dont_use_in_resolve dont_raise_overcast
   seq sglctrhinge []
   seq fin_judge []

call "sock it to the wave" c4
            dont_use_in_resolve dont_raise_overcast
   seq sglctrhinge []
   seq fin_sockit []

call "in roll to a diamond" c4 tag inrolltodmd
            dont_use_in_resolve dont_raise_overcast
   seq start_inroll []
   seq sglctrhinge []

call "out roll to a diamond" c4 tag outrolltodmd
            dont_use_in_resolve dont_raise_overcast
   seq start_outroll []
   seq sglctrhinge []

call "inroll to a diamond" c4
   alias inrolltodmd

call "outroll to a diamond" c4
   alias outrolltodmd

call "zoom roll to a diamond" c4
            dont_use_in_resolve dont_raise_overcast
   seq start_zoomroll []
   seq sglctrhinge []

call "here comes the diamond" c4
            dont_use_in_resolve dont_raise_overcast
   seq start_judge []
   seq sglctrhinge []

call "sock it to the diamond" c4
            dont_use_in_resolve dont_raise_overcast
   seq start_sockit []
   seq sglctrhinge []

call "_outpost part 1" dontshow tag outpost1
            left_means_mirror
   setup 2x4 qtag rotate
      preds "Can't determine outpost direction."
         if outposter_is_cw  [CR5N CR7N CR0N AL6S AL1S AL3S AL4S    0]
         if outposter_is_ccw [CR6N AL5S AL7S AL0S    0 CR1N CR3N CR4N]
   setup 2x3 short6
      preds "Can't determine outpost direction."
         if outposter_is_cw  [CR0E CR2E AL1W AL3W AL5W    0]
         if outposter_is_ccw [CR1E AL0W AL2W    0 CR3E CR5E]

call "_outpost part 3" dontshow tag outpost3
            visible_fractions
   conc_o ahso [] two_o_circs_for_frac [conc_force_otherway endscando]

call "_outpost part 3 but @0" dontshow tag outpost3but
   conc nullcall [mandatory_anycall] two_o_circs [conc_force_otherway endscando]

call "_center 6 or 4 trade" dontshow tag ctr6or4trade
            yoyo_is_inherited gen_sting_is_inherited
   conc6_2_or_4_2_line trade [inherit_yoyo inherit_gensting] nullcall []

call "outpost" c4a
            left_means_mirror visible_fractions yoyo_is_inherited gen_sting_is_inherited
   seq outpost1 [inherit_left inherit_yoyo inherit_gensting]  // "yoyo" is illegal, of course.
   seq ctr6or4trade [inherit_yoyo inherit_gensting]
   seq outpost3 [inherit_yoyo inherit_gensting]

call "outpost but @0" c4a
            left_means_mirror visible_fractions yoyo_is_inherited gen_sting_is_inherited
   seq outpost1 [inherit_left inherit_yoyo inherit_gensting]  // "yoyo" is illegal, of course.
   seq ctr6or4trade [inherit_yoyo inherit_gensting]
   seq outpost3but [inherit_yoyo inherit_gensting]

call "chip off" c4a
            left_means_mirror
   setup 2x4 2x4
      preds "Can't determine direction to go."
         if outposter_is_cw [ZM1N CR2S CR3S C4S  ZM5N AL6S    0    0]
         if outposter_is_ccw [A7S AL0S AL1S ZM2N    0    0 CR5S ZM6N]
         // We do the best we can.
         if lines_miniwave  [ZM1N CR2S CR3S ZM2N ZM5N AL6S CR5S ZM6N]
   setup 4x2 2x4
      preds "Can't determine direction to go."
         if outposter_is_cw [ZM1N 0 0 0 ZM5N 0 0 0]
         if outposter_is_ccw [0 0 0 ZM2N 0 0 0 ZM6N]

call "ship ahoy" c4
   setup 2x4 2x4 rotate
      predscantdocallinsetup
         if outroller_is_cw [   0 CR1E AL0E AL7E ZM2W AL5E AL4W    0]
         if always          [CR0E CR7E AL6E    0    0 CR3W CR2E ZM5W]
   // Depending on how much of a purist one is about what "1x2"
   // really means, one might consider this questionable.
            alternate_definition [1x2] c4
   setup 2x3 short6
      predscantdocallinsetup
         if outroller_is_cw_2x3 [   0 CR2S AL1S ZM3N AL5S    0]
         if always              [CR1S AL0S    0    0 CR3S ZM5N]

call "_extend 1/4 to 1/2" dontshow tag extend_1_to_2
   setup pmd 2x2 qualifier in qtag_like
      predscantdocallinsetup
         if dmd_ctrs_rh [ZM0N ZM1N 0 0]
         if always      [ZM3N 0 0 ZM2N]
            alternate_definition [cross] c1
   setup pmd 2x2 qualifier in qtag_like
      predscantdocallinsetup
         if dmd_ctrs_rh [ZM3N ZM2N 0 0]
         if always      [ZM0N 0 0 ZM1N]

call "extend" mainstream tag extend
   // 0/4 tag to 1/4 tag
   setup 4x1 dmd qualifier in 2fl_only restriction unusual levelplus
      array [ZM0N ZM1N 0 0]
   // 1/2 tag to 3/4 tag
   setup 2x2 dmd rotate qualifier miniwaves restriction unusual levelplus
      array [ZM0W ZM0W ZM1W ZM3W]

   // 3/4 tag to 4/4 tag -- test is not definitive, cf. test lg01t.
   // Baloney!  It's definitive now!  And lg01t works!
   setup pmd 1x4 qualifier live out qtag_like restriction unusual levelplus
      array [0 ZM3N ZM2N ZM3N]
   // 1/4 tag to 1/2 tag.
   setup pmd 2x2 qualifier in qtag_like
      predscantdocallinsetup
         if dmd_ctrs_rh [ZM0N ZM1N 0 0]
         if always      [ZM3N 0 0 ZM2N]
   setup star 2x2 qualifier live ntbone right dmd_ctrs_mwv
      array [ZM0N 0 0 ZM3N]
   setup star 2x2 qualifier live ntbone left dmd_ctrs_mwv
      array [0 0 ZM1N ZM2N]

   // Bogus usage, with both points facing the same wall.
   setup pmd trngl4 rotate qualifier live qtag_like_anisotropic restriction serious_violation alwaysfail
      predscantdocallinsetup
         if next_qtag_spot_faces_me   [ZM7W ZM2W ZM4W ZM3W]
         if next_qtag_spot_faces_away [ZM6W ZM5W ZM4W ZM5W]

   // People facing: touch (rather bogus).
   setup 2x1 1x2 rotate restriction controversial alwaysfail
      array [ZM0W 0]
   // Lone miniwave: step thru (rather bogus).
   setup 1x2 1x2 rotate qualifier miniwaves restriction controversial alwaysfail
      array [ZM0W ZM0W]
   // The following three are rather bogus.  Cf. test si03t.
   // 1/2 tag to 3/4 tag
   setup 2x2 dmd rotate qualifier live regular_tbone restriction controversial alwaysfail
      array [ZM0W ZM0W ZM1W ZM3W]
   // 3/4 tag to 4/4 tag
   setup 1x4 dmd qualifier live out regular_tbone restriction controversial alwaysfail
      array [0 ZM1N 0 ZM1N]
   setup 4x1 dmd qualifier live out regular_tbone restriction controversial alwaysfail
      array [0 0 ZM2N 0]
            alternate_definition [interlocked] c3a
   // starting DPT to 1/4 line.
   setup 4x2 qtag rotate qualifier in 2fl_only
      array [ZM5W ZM6W 0 0 0 0 ZM7W ZM4W]
   // 1/4 line to waves.  Yes, waves.
   setup qtag 2x4 qualifier live in qline_like_r
      array [0 0 0 0 ZM5N ZM7N ZM0N ZM2N]
   setup qtag 2x4 qualifier live in qline_like_l
      array [0 0 ZM3N ZM1N ZM4N ZM6N 0 0]
   // waves to 3/4 line.
   setup 2x4 qtag qualifier wave_only
      array [ZM0N ZM0N ZM1N ZM1N ZM2N ZM7N ZM3N ZM6N]
   // 3/4 line to CDPT.
   setup qtag 2x4 rotate qualifier out qline_like_l
      array [ZM7W ZM0W ZM1W ZM6W 0 0 ZM6W ZM1W]
   setup qtag 2x4 rotate qualifier out qline_like_r
      array [ZM7W ZM0W ZM1W ZM6W 0 0 ZM6W ZM1W]  // same
            alternate_definition [cross] c1
   // 1/4 tag to 1/2 tag -- we do not demand a definitive test to distinguish
   // a 1/4 tag from a 3/4 tag, because cross extend is meaningless in a 3/4 tag.
   setup pmd 2x2 qualifier in qtag_like
      predscantdocallinsetup
         if dmd_ctrs_rh [ZM3N ZM2N 0 0]
         if always      [ZM0N 0 0 ZM1N]
   setup 2x2 dmd rotate qualifier miniwaves
      array [ZM0W ZM0W ZM3W ZM1W]
            alternate_definition [grand] c1
   // 6-person versions.
   setup 6x1 1x2dmd
      array [ZM0N ZM1N ZM2N    0    0    0]
   setup p1x2dmd short6 rotate qualifier in extend_inroutl
      array [ZM4W ZM5W ZM0W    0    0    0]
   setup p1x2dmd short6 rotate qualifier in extend_inloutr
      array [ZM4W ZM3W    0    0    0 ZM2W]
   setup short6 2x3 rotate qualifier in extend_inroutl
      array [ZM5W    0    0    0 ZM3W ZM4W]
   setup short6 2x3 rotate qualifier in extend_inloutr
      array [   0    0 ZM0W ZM1W ZM2W    0]
   setup 3x2 short6 rotate qualifier wave_only
      array [ZM5W ZM0W ZM1W ZM1W ZM2W ZM3W]
   setup short6 1x2dmd rotate qualifier out extend_inloutr
      array [ZM1W ZM0W    0    0    0 ZM5W]
   setup short6 1x2dmd rotate qualifier out extend_inroutl
      array [   0 ZM0W ZM1W ZM2W    0    0]
   setup p1x2dmd 1x6 qualifier out extend_inloutr
      array [   0    0 ZM5N ZM3N ZM4N    0]
   setup p1x2dmd 1x6 qualifier out extend_inroutl
      array [   0    0    0 ZM3N ZM4N ZM5N]
   // 8-person versions.
   setup 8x1 1x3dmd
      array [ZM0N ZM1N ZM3N ZM2N    0    0    0    0]
   setup p1x3dmd rigger qualifier in extend_inroutl
      array [ZM6N ZM7N ZM0N ZM1N    0    0    0    0]
   setup p1x3dmd rigger qualifier in extend_inloutr
      array [ZM6N ZM7N ZM5N    0    0    0    0 ZM4N]
   setup prigger spindle qualifier in extend_inroutl
      array [ZM1N ZM2N    0    0    0    0 ZM7N ZM0N]
   setup prigger spindle qualifier in extend_inloutr
      array [   0    0    0    0 ZM4N ZM5N ZM7N ZM6N]
   setup pspindle 2x4 qualifier in extend_inroutl
      array [ZM1N ZM2N ZM3N 0    0    0    0 ZM0N]
   setup pspindle 2x4 qualifier in extend_inloutr
      array [   0    0    0 0 ZM4N ZM5N ZM6N ZM7N]
   setup 4x2 spindle qualifier wave_only
      array [ZM0N ZM1N ZM2N ZM3N ZM3N ZM4N ZM5N ZM6N]
   setup pspindle rigger qualifier out extend_inloutr
      array [ZM0N ZM1N ZM3N ZM2N    0    0    0    0]
   setup pspindle rigger qualifier out extend_inroutl
      array [   0    0    0 ZM2N ZM3N ZM4N ZM5N    0]
   setup prigger 1x3dmd qualifier out extend_inloutr
      array [ZM3N ZM6N ZM4N ZM5N    0    0    0    0]
   setup prigger 1x3dmd qualifier out extend_inroutl
      array [   0    0 ZM4N ZM5N ZM6N ZM7N    0    0]
   setup p1x3dmd 1x8 qualifier out extend_inloutr
      array [   0    0    0 ZM6N ZM4N ZM5N ZM7N    0]
   setup p1x3dmd 1x8 qualifier out extend_inroutl
      array [   0    0    0    0 ZM4N ZM5N ZM7N ZM6N]

call "cross town roll" c4
            fudge_to_q_tag
   setup 2x2 dmd rotate restriction forbidden wave_only
      array [CR1E AL3E AL2E CR2E]
   setup pmd 2x2
      predscantdocallinsetup
         if dmd_ctrs_rh [ZM0N CR3S ZM2N 0]
         if always      [ZM3N 0    ZM1N AL0S]
   setup dmd 2x2
      predscantdocallinsetup
         if dmd_ctrs_rh [ZM0N 0 ZM2N 0]
         if always      [ZM3N 0 ZM1N 0]
            alternate_definition [grand] c4a
   setup 4x2 spindle restriction forbidden wave_only
      array [CR7S CR6S CR5S CR4S AL2S AL1S AL0S AL7S]
   setup pspindle 2x4 qualifier right dmd_ctrs_mwv
      array [CR7S CR6S CR5S 0 0 0 0 ZM0N]
   setup pspindle 2x4 qualifier left dmd_ctrs_mwv
      array [0 0 0 0 AL2S AL1S AL0S ZM7N]

call "inlet" c2
            diamond_is_legal
   setup 2x4 qtag qualifier wave_only
      array [CR1S AL6S CR2S AL0S AL3S CR4N AL5N CR7S]
   setup 2x4 qtag qualifier magic_only restriction unusual alwaysfail
      array [   0 AL6S CR2S    0 AL3S    0    0 CR7S]
   setup 2x4 qtag
      preds "Must be in 3&1 line."
         if miniwave_side_of_out_3n1_line [CR1S    0    0    0    0 CR4N    0    0]
         if couple_side_of_out_3n1_line   [   0    0    0    0    0    0 ZM6N CR7S]
            alternate_definition [diamond] c4a
   setup 2x4 qtag qualifier wave_only
      array [CR1E AL6S CR2S AL0W AL3S CR4W AL5E CR7S]
   setup 2x4 qtag qualifier magic_only restriction unusual alwaysfail
      array [   0 AL6S CR2S    0 AL3S    0    0 CR7S]
   setup 2x4 qtag
      preds "Must be in 3&1 line."
         if miniwave_side_of_out_3n1_line [CR1E    0    0    0    0 CR4W    0    0]
         if couple_side_of_out_3n1_line   [   0    0    0    0    0    0 ZM6N CR7S]

call "hourglass inlet" c4
   setup 2x4 hrglass qualifier wave_only
      array [CR1E AL6S CR2S AL0W AL3W CR4W AL5E CR3E]

call "outlet" c2
            diamond_is_legal left_means_mirror
   setup qtag 2x4 qualifier right dmd_ctrs_mwv
      array [CR3S 0 0 CR4S ZM7N CR6S CR1S 0]
   setup qtag 2x4 qualifier left dmd_ctrs_mwv
      array [0 AL0S AL2S    0 AL5S ZM4N 0 AL7S]
   setup qtag 2x4
      array [CR3S 0 0 CR4S ZM7N CR6S CR1S ZM0N]
            alternate_definition [diamond] c4a
   setup qtag 2x4 restriction unusual wave_only
      preds "Must be in diamonds."
         if q_tag_front  [0 0 AL2S CR4S 0 0 CR1S AL7S]
         if q_tag_back   [0 0 AL2S CR4S 0 0 CR1S AL7S]
         if q_line_front [0 0 0    0    0 0 CR1S ZM0N]
         if q_line_back  [0 0 0    0    0 0 CR1S ZM0N]
   setup pqtag 2x4 restriction unusual wave_only
      preds "Must be in diamonds."
         if q_tag_front  [CR3E 0    0 0 0    AL4W 0 0]
         if q_tag_back   [0    CR2W 0 0 AL5E 0    0 0]
         if q_line_front [CR3E 0    0 0 0    0    0 0]
         if q_line_back  [0    CR2W 0 0 0    0    0 0]

call "hourglass outlet" c4
            left_means_mirror
   setup hrglass 2x4
      array  [0 0 AL2S 0 0 0 CR1S 0]
   setup phrglass 2x4 qualifier ctr_pts_rh
      array [CR3E CR2W 0 CR4E AL5E AL4W 0 0]
   setup phrglass 2x4 qualifier ctr_pts_lh
      array [CR3E CR2W 0    0 AL5E AL4W 0 AL3W]

call "_start splash" dontshow tag startsplash
   setup 2x4 2x4 rotate
      preds "Can't do this call in this formation."
         if lines_miniwave [CM0N AM5E CM2E AM7S ZM0W AM5S CM2N ZM7W]
         if lines_couple   [CM1N CM0N AM7S AM6S ZM0W ZM1W ZM7W ZM6W]
            alternate_definition [1x2] c4
   setup 2x3 2x3 rotate
      preds "Can't do this call in this formation."
         if miniwave_side_of_2n1_line [CM0N 0 AM5S    0 ZM1W    0]
         if couple_side_of_2n1_line   [   0 0    0 ZM0W ZM5W ZM4W]
            alternate_definition [3x1] c4
   setup 2x4 2x4 rotate
      preds "Can't do this call in this formation."
         if miniwave_side_of_out_3n1_line [0    AM7S CM0N 0    ZM0W 0    0    ZM7W]
         if couple_side_of_out_3n1_line   [CM2N CM1N AM6S AM5S 0    0    0    0]
            alternate_definition [1x3] c4
   setup 2x4 2x4 rotate
      preds "Can't do this call in this formation."
         if miniwave_side_of_out_3n1_line [CM0N 0    0 AM7S 0    ZM7W ZM2W 0]
         if couple_side_of_out_3n1_line   [0    0    0 0    ZM0W ZM1W ZM6W ZM5W]

call "_finish splash @h" dontshow tag finsplashdir
   setup 2x4 2x4
      array [ZM0N ZM1N ZM2N ZM3N 0 0 0 0]
   setup 4x2 2x4
      preds "Illegal direction."
         if rightp   [0 0 CR2E CR3E CR4E CR5E 0 0]
         if leftp    [0 0 AL2W AL3W AL4W AL5W 0 0]
         if inp      [0 0 CR2E CR3E AL4W AL5W 0 0]
         if outp     [0 0 AL2W AL3W CR4E CR5E 0 0]
         if zigzigp  [0 0 CR2E CR3E CR4E CR5E 0 0]
         if zagzagp  [0 0 AL2W AL3W AL4W AL5W 0 0]
         if zigzagp  [0 0 AL2W CR3E CR4E AL5W 0 0]
         if zagzigp  [0 0 CR2E AL3W AL4W CR5E 0 0]
         if no_dir_p [0 0 ZM2N ZM3N ZM4N ZM5N 0 0]
         if backp    [0 0   2S   3S   4S   5S 0 0]
            alternate_definition [1x2] c4
   setup 2x3 2x3
      array [ZM0N ZM1N ZM2N 0 0 0]
   setup 3x2 2x3
      preds "Illegal direction."
         if rightp   [0 CR1E CR2E CR3E CR4E 0]
         if leftp    [0 AL1W AL2W AL3W AL4W 0]
         if inp      [0 CR1E CR2E AL3W AL4W 0]
         if outp     [0 AL1W AL2W CR3E CR4E 0]
         if zigzigp  [0 CR1E CR2E CR3E CR4E 0]
         if zagzagp  [0 AL1W AL2W AL3W AL4W 0]
         if zigzagp  [0 AL1W CR2E CR3E AL4W 0]
         if zagzigp  [0 CR1E AL2W AL3W CR4E 0]
         if no_dir_p [0 ZM1N ZM2N ZM3N ZM4N 0]
         if backp    [0   1S   2S   3S   4S 0]
            alternate_definition [3x1] c4
   setup 2x4 2x4
      array [ZM0N ZM1N ZM2N ZM3N 0 0 0 0]
   setup 4x2 2x4
      preds "Illegal direction."
         if rightp   [0 0 0 CR3E CR4E 0 0 0]
         if leftp    [0 0 0 AL3W AL4W 0 0 0]
         if inp      [0 0 0 CR3E AL4W 0 0 0]
         if outp     [0 0 0 AL3W CR4E 0 0 0]
         if no_dir_p [0 0 0 ZM3N ZM4N 0 0 0]
         if backp    [0 0 0   3S   4S 0 0 0]
            alternate_definition [1x3] c4
   setup 2x4 2x4
      array [ZM0N ZM1N ZM2N ZM3N 0 0 0 0]
   setup 4x2 2x4
      preds "Illegal direction."
         if rightp   [0 CR1E CR2E CR3E CR4E CR5E CR6E 0]
         if leftp    [0 AL1W AL2W AL3W AL4W AL5W AL6W 0]
         if inp      [0 CR1E CR2E CR3E AL4W AL5W AL6W 0]
         if outp     [0 AL1W AL2W AL3W CR4E CR5E CR6E 0]
         if no_dir_p [0 ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N 0]
         if backp    [0   1S   2S   3S   4S   5S   6S 0]

call "_finish splash @0" dontshow tag finsplashcall
   select_sideliners nullcall [mandatory_anycall] nullcall []

call "splash @h" c4a
            mxn_is_inherited
   seq startsplash [inherit_mxn]
   seq finsplashdir [inherit_mxn roll_transparent]

call "splash @0" c4a
            mxn_is_inherited
   seq startsplash [inherit_mxn]
   seq finsplashcall [roll_transparent]

call "_sets in motion 1" dontshow tag setnmotion1
            left_means_mirror yoyo_is_inherited gen_sting_is_inherited
   conc hingentrade [force_single inherit_left inherit_yoyo inherit_gensting]
        box_circ_15 [conc_demand_lines inherit_left]

call "_sets in motion 2" dontshow tag setnmotion2
   setup 3x1dmd 3x1dmd
      array [CR0E 0 0 0 AL4W 0 0 0]
   setup p3x1dmd 3x1dmd
      array [0 ZM1N ZM2N ZM3N 0 ZM5N ZM6N ZM7N]
   setup 1x8 1x8
      array [CR0E CR1E 0 0 AL4W AL5W 0 0]
   setup 8x1 1x8
      array [0 0 ZM2N ZM3N 0 0 ZM6N ZM7N]
   setup crosswave crosswave
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]

call "_sets in motion 3" dontshow tag setnmotion3
            left_means_mirror
   setup p3x1dmd qtag rotate
      array [ZM7W CR1E AL0E ZM6W 0 0 0 ZM2W]
   setup 8x1 2x4 qualifier people_1_and_5_real
      array [ZM1N ZM2N AL3S CR4S 0 0 0 0]
   setup 8x1 qtag rotate
      array [ZM7W 0 AL0E CR1E 0 0 0 0]
   setup crosswave rigger
      array [ZM6N ZM7N 0 0 ZM2N ZM3N CR1S AL0S]

call "_sets in motion 3 plus @9" dontshow tag setnmotion3plusn
            left_means_mirror neednumber
   setup p3x1dmd spindle rotate qualifier num 1 none
      array [AL1E CR2E AL0E ZM7W 0 0 0 ZM3W]
   setup 8x1 3dmd rotate qualifier num 1 none
      array [ZM11W AL1E AL0E CR2E 0 0 0 0]
   setup 8x1 2x4 rotate qualifier num 2 none
      array [CR2E AL1E AL0E CR3E 0 0 0 0]

call "sets in motion but hold the column" c2 tag setnmotionpart1
            left_means_mirror yoyo_is_inherited gen_sting_is_inherited
   seq setnmotion1 [inherit_left inherit_yoyo inherit_gensting]
   seq setnmotion2 []

call "_centers sets in motion" dontshow tag setnmotion_ctrtoend
   setup 2x2 2x2 qualifier miniwaves
      array [CR3N AR3N ACL2N CAL2N]
   setup 2x2 2x2 qualifier out in_or_out
      array [CR3N AL0S     0     0]
            alternate_definition [generous] c3
   setup 1x4 2x2 qualifier wave_only
      array [CCAL3E CCR2W AAL1W CCR0E]

call "_ends sets in motion" dontshow tag setnmotion_endtoctr
   setup 2x2 1x4
      array [CM2S AM0S AM3S CM3S]

call "sets in motion" c2
   // Stingy sets in motion (from diamonds) won't work because someone can't roll after not hinging.
            visible_fractions left_means_mirror yoyo_is_inherited gen_sting_is_inherited
   seq setnmotionpart1 [inherit_left inherit_yoyo inherit_gensting]
   seq setnmotion3 [inherit_left]
   // This allows "central sets in motion", sort of.  Being cross-concentrically
   // defined, it is only legal in 2-couple material, where the extra space will be empty.
            left_means_mirror yoyo_is_inherited gen_sting_is_inherited
   crossconc setnmotion_endtoctr [conc_demand_lines inherit_left]
             setnmotion_ctrtoend [conc_force_columns inherit_left inherit_gensting]

call "sets in motion plus @9" c4
            visible_fractions left_means_mirror yoyo_is_inherited gen_sting_is_inherited neednumber
   seq setnmotionpart1 [inherit_left inherit_yoyo inherit_gensting]
   seq setnmotion3plusn [inherit_left]

call "trade by" mainstream tag trade_by
            visible_fractions left_means_mirror
            single_is_inherited grand_is_inherited twisted_is_inherited funny_is_inherited
   // We are somewhat in violation of the Callerlab vanilla Mainstream rules:
   // the centers must be couples facing each other; single file is not allowed.
   maybespecialtradeby
      passthru [inherit_left inherit_twisted inherit_funny]
      // By inheriting funny to this part, we make it illegal.  You must say "centers are funny".
      leads_trade_for_trade_by [conc_demand_columns conc_force_spots inherit_left inherit_single inherit_funny endscando]

call "_trade by, centers to a wave" dontshow tag trade_by_to_wave
            visible_fractions left_means_mirror
   conc touch [inherit_left]
        leads_trade_for_trade_by [conc_demand_columns conc_force_spots inherit_left endscando]

call "trade by but @m" dontshow tag trade_by_but
            visible_fractions left_means_mirror
   conc nullsecond [mandatory_secondary_call]
        leads_trade_for_trade_by [conc_demand_columns conc_force_spots inherit_left endscando]

call "roll out to a column" c4a
            left_means_mirror take_right_hands
   setup 4x2 2x4 restriction unusual 2fl_only
      array [0 CA5N C6S C4S C5S C7S CA4N 0]
            alternate_definition [single] c4
   // From a trade-by, this is ambiguous, resolved only by people
   // crashing and wondering whether they should take right hands
   // or go back and do the call the other way.  We're going to make
   // it do the 2x2 version and complain.  Of course, if you say "split"
   // or "each box", we don't complain.
   setup 4x2 2x4 qualifier out in_or_out restriction controversial alwaysfail
      array [0 C6S 0 C4S C5S 0 C7S 0]
   setup 4x1 2x2 restriction unusual 2fl_only
      array [0 CA2N C2S C3S]
   setup 2x2 2x2
      array [C1S C2S 0 0]
            alternate_definition [3x3 12matrix] c4
   setup 4x3 2x6
      // We assume the third part has to be "circulate 1-1/2".
      array [0 CA8N C9S C6S C7S C10S C8S C11S CA6N 0 0 CA7N]
   setup 6x2 2x6
      array [0 0 0 C10S C8S C6S C7S C9S C11S 0 0 0]
            alternate_definition [4x4 16matrix] c4
      // We assume the third part has to be "circulate 2".
   setup 4x4 2x8 rotate
      array [C3E C7E CA0W C6E 0 0 0 CA1W 0 CA3W C4E CA2W C0E C1E C2E C5E]
   setup 8x2 2x8
      array [0 0 0 0 C14S C12S C10S C8S C9S C11S C13S C15S 0 0 0 0]

call "1/3 roll out to a column" c4a
            left_means_mirror
   setup 4x2 2x6
      array [0 CR2E CR3E CR6E CR7E CR8E CR9E 0]
   setup 2x4 2x6
      array [0 CR2E CR3E 0    0    CR8E CR9E 0]

call "2/3 roll out to a column" c4a
            left_means_mirror
   setup 4x2 2x6
      array [0 CAL9N CR8S CR6S CR7S CR9S CAL8N 0]
   setup 2x4 2x6
      array [0 CR3S CR8S 0    0    CAL3N CAL8N 0]
            alternate_definition [3x3 12matrix] c4
   setup 4x3 2x9
      array [0 CAL14N CR12S CR9S CR10S CR13S CR11S CR14S CAL12N 0 0 CAL13N]
            alternate_definition [4x4 16matrix] c4
   setup 4x4 2x12 rotate
      array [CR3E CR7E CAL4W CR6E 0 0 0 CAL5W 0 CAL7W CR4E CAL6W CR0E CR1E CR2E CR5E]

call "hit the wall" c4a
            visible_fractions
   conc6p_or_normal pass_out [suppress_elongation_warnings] partnertag [conc_demand_columns conc_force_spots endscando]

call "column circulate for advance" dontshow tag circ_for_advance
   /* Used in advance to a column.  The restriction will make it get unhappy if
      we call so-and-so advance to a column for inappropriate
      designees or in an inappropriate setup for them. */
   setup 4x2 2x4 restriction unusual wave_only
      array [ZM1N ZM2N ZM3N CR4S AL3S ZM4N ZM5N ZM6N]
            alternate_definition [single] c4
   setup 2x2 dmd rotate no_cutting_through
      array [CR0N AL0S ZM1W ZM3W]
   setup dmd 2x2 restriction unusual diamond_like
      array [CR0E 0 AL1W 0]
   setup pmd 2x2 restriction unusual diamond_like
      array [0 ZM1N 0 ZM2N]
            alternate_definition [magic] c4a
   setup 4x2 2x4 restriction magic_only
      array [ZM6N ZM2N ZM4N CR4S AL3S ZM3N ZM5N ZM1N]

call "centers trade for advance" dontshow tag ctrstrade_for_advance
   setup 4x2 2x4 restriction wave_only
      array [ZM0N CR6S CR5S ZM3N ZM4N AL2S AL1S ZM7N]
            alternate_definition [single] c4
   setup dmd dmd
      array [ZM0N 0 ZM2N 0]
   setup pmd dmd
      array [0 CR3S 0 AL1S]
            alternate_definition [magic] c4a
   setup 4x2 2x4 restriction magic_only
      array [ZM0N CR6S CR5S ZM3N ZM4N AL2S AL1S ZM7N]

call "@6 advance to a column" c4a
            visible_fractions yield_if_ambiguous magic_is_inherited
   seq starthopping [inherit_magic]
   // Q: Why use this special circulate, which is only for columns,
   //    instead of just "circulate"?  Wouldn't it be more general and
   //    creative to allow any circulate?
   // A: It would be way too general.  It would have no defense against
   //    "beaus advance to a column" from facing lines.
   // Also, when we do a "single advance to a column", we need this.
   seq circ_for_advance [inherit_magic]
   seq ctrstrade_for_advance [inherit_magic roll_transparent]
   seq circ_for_advance [inherit_magic]

call "beaus advance to a column" c4a
            visible_fractions singlefile_is_inherited single_is_inherited
            nxn_is_inherited bigmatrix_is_inherited
   seq startbeauhopping [inherit_singlefile inherit_single inherit_nxn inherit_bigmatrix]
   // The "inherit_nxn" is here to raise an error
   // if we don't say "initially".
   seq circ_for_advance [inherit_single inherit_nxn]
   seq ctrstrade_for_advance [inherit_single roll_transparent]
   seq circ_for_advance [inherit_single]
            first_part_visible singlefile_is_inherited single_is_inherited
            nxn_is_inherited bigmatrix_is_inherited
   seq startbeauhopping [inherit_singlefile inherit_single inherit_nxn inherit_bigmatrix]
   seq finadv [inherit_single inherit_nxn]

call "belles advance to a column" c4a
            visible_fractions singlefile_is_inherited single_is_inherited
            nxn_is_inherited bigmatrix_is_inherited
   seq startbellhopping [inherit_singlefile inherit_single inherit_nxn inherit_bigmatrix]
   // The "inherit_nxn" is here to raise an error
   // if we don't say "initially".
   seq circ_for_advance [inherit_single inherit_nxn]
   seq ctrstrade_for_advance [inherit_single roll_transparent]
   seq circ_for_advance [inherit_single]
            first_part_visible singlefile_is_inherited single_is_inherited
            nxn_is_inherited bigmatrix_is_inherited
   seq startbellhopping [inherit_singlefile inherit_single inherit_nxn inherit_bigmatrix]
   seq finadv [inherit_single inherit_nxn]

// We make this a separate call because "finish beaus advance to a column"
// is really stupid, and this is the way people call it.
call "finish advance to a column" c4a tag finadv
   setup 4x2 2x4
      array [CM7S CM6S CR4S CM5S AM2S AL3S AM1S AM0S]
            alternate_definition [single] c4
   setup 2x2 2x2
      array [C1S A0S AM3S CM2S]
            alternate_definition [3x3] c4
   setup 6x2 2x6
      array [CM11S CM10S CM9S C6S C7S C8S A3S A4S A5S AM2S AM1S AM0S]
            alternate_definition [4x4] c4
   setup 8x2 2x8
      array [CM15S CM14S CM13S CM12S C8S C9S C10S C11S
            A4S A5S A6S A7S AM3S AM2S AM1S AM0S]
            visible_fractions single_is_inherited magic_is_inherited
   seq circ_for_advance [inherit_single inherit_magic]
   seq ctrstrade_for_advance [inherit_single inherit_magic roll_transparent]
   seq circ_for_advance [inherit_single inherit_magic]

call "_swing to a column centers part 1" dontshow tag touch_1_2_and_roll
            step_to_wave left_means_mirror single_is_inherited
   seq trade []
   seq roll []

call "_swing to a column part 1" dontshow tag swingtocol1
            left_means_mirror mxn_is_inherited
   maybe_nxn_1331_cols_conc touch_1_2_and_roll [inherit_left]
                            div_move_along [conc_demand_columns conc_force_otherway]

call "_swing to a column part 2" dontshow tag swingtocol2
            left_means_mirror
   setup bone 2x4
      array [0 0 0 0 CR4W CM1E 0 0]
   setup pbone 2x4
      array [0 0 0 ZM3N 0 0 ZM2N 0]
   setup pqtag 2x4
      array [0 0 0 ZM3N 0 0 ZM2N 0]
            alternate_definition [2x1] c4
   setup bone6 2x3
      array [0 0 0 CR3W CM1E 0]
   setup pbone6 2x3
      array [0 0 0 0 0 ZM2N]
            alternate_definition [1x2] c4
   setup bone6 2x3
      array [0 0 0 CR3W CM1E 0]
   setup pbone6 2x3
      array [0 0 0 0 0 ZM2N]

call "swing to a column" c4a
            left_means_mirror mxn_is_inherited
   seq swingtocol1 [inherit_left inherit_mxn]
   seq swingtocol2 [inherit_left inherit_mxn]

call "_grand chain 8 part 1" dontshow tag gc8p1
            rear_back_from_wave_or_qtag left_means_mirror
            funny_means_those_facing
   setup 2x1 1x2
      array [ZM1N 0]
   setup 2x4 2x4 qualifier not_split_dixie
      array [0 0 0 0 ZM3N ZM2N ZM1N ZM0N]
   // A starting DPT is the default if only the ends are present.
   // This seems to be what people generally expect.
   // However, if there are phantoms, we give a warning about this.
   setup 4x2 2x4 qualifier live in 2fl_only
      array [ZM0N ZM2N ZM3N 0 0 ZM4N ZM5N ZM7N]
   setup 4x2 2x4 qualifier in 2fl_only restriction assume_dpt alwaysfail
      array [ZM0N ZM2N ZM3N 0 0 ZM4N ZM5N ZM7N]
   setup 4x2 2x4 qualifier in in_or_out
      array [ZM1N 0    ZM3N 0 0 ZM4N 0    ZM6N]
   setup qtag 2x4 rotate qualifier in qtag_like
      array [0 0 ZM1W ZM1W ZM3W ZM4W ZM6W ZM6W]
   setup 2x2 2x2 qualifier split_dixie
      predscantdo
         if 2x2_antitandem     [0 0 AL1W CR0E]
         if always             [0 0 ZM2N ZM3N]
            alternate_definition [single] c4
   setup 2x1 1x2
      array [ZM1N 0]
            alternate_definition [twisted] c4
   setup 2x1 1x2 rotate
      array [CM1N 0]
   setup 8x1 2x4 qualifier not_split_dixie
      array [CM7E 0 0 CM6E 0 CM4E CM5E 0]
   setup 4x2 2x4 rotate
      array [CM6N 0 CM1N 0 0 CM3N 0 CM4N]
   setup pqtag 2x4 rotate
      array [0 0 0 CM2N 0 0 CM5N 0]
   setup qtag 2x4 rotate
      array [0 0 0 0 ZM3W ZM4W 0 0]
   setup trngl4 2x2 qualifier split_dixie
      array [CAL2N 0 0 0 0 CR1S CAL2N AL3N]
            alternate_definition [3x3 12matrix] c4
   setup 6x2 2x6
      array [ZM0N ZM2N ZM4N 0 0 0 0 0 0 ZM7N ZM9N ZM11N]
            alternate_definition [4x4 16matrix] c4
   setup 8x2 2x8
      array [ZM0N ZM2N ZM4N ZM6N 0 0 0 0 0 0 0 0 ZM9N ZM11N ZM13N ZM15N]

call "_finish grand chain 8" dontshow tag gc8p2
            left_means_mirror
   setup 2x2 2x2
      array [0 0 AL1W AL0E]
   setup 2x4 2x4 rotate qualifier ntbone out in_or_out
      array [L0E L1W L6W L7E 0 0 0 0]
   setup 4x2 2x4 qualifier ntbone in in_or_out
      array [AL1E    0 AL3E    0    0 CAL4W     0 CAL6W]
   setup 4x2 2x4 qualifier ntbone out in_or_out
      array [   0 AL2E    0 AL4S AL3S     0 CAL5W     0]
            alternate_definition [single] c4
   // Only the ends can do this.
   setup 4x2 2x4 qualifier ntbone out in_or_out
      array [0 0 0 AL3S AL4S 0 0 0]
            alternate_definition [3x3 12matrix] c4
   setup 6x2 2x6
      array [AL1E 0 AL3E 0 AL5E 0 0 CAL6W 0 CAL8W 0 CAL10W]
            alternate_definition [4x4 16matrix] c4
   setup 8x2 2x8
      array [AL1E 0 AL3E 0 AL5E 0 AL7E 0 0 CAL8W 0 CAL10W 0 CAL12W 0 CAL14W]

call "_centers finish grand chain 8" dontshow tag ctrfingc8
   setup 2x2 2x2
      array [L1N L0N 0 0]

call "_centers grand chain 8" dontshow tag ctrgc8
            first_part_visible left_means_mirror twisted_is_inherited
   seq passthru [inherit_twisted]
   seq ctrfingc8 [inherit_left]

call "_ends finish grand chain 8" dontshow tag endfingc8
   setup 2x2 2x2
      array [L1S L0S 0 0]

call "_ends grand chain 8" dontshow tag endgc8
            first_part_visible left_means_mirror twisted_is_inherited
   seq passthru [inherit_twisted]
   seq endfingc8 [inherit_left]

call "grand chain 8" c2
            first_part_visible left_means_mirror twisted_is_inherited split_like_dixie_style
            nxn_is_inherited bigmatrix_is_inherited single_is_inherited funny_is_inherited
   seq gc8p1 [inherit_left inherit_single inherit_twisted
              inherit_nxn inherit_bigmatrix inherit_funny]
   seq gc8p2 [inherit_left inherit_single
              inherit_nxn inherit_bigmatrix inherit_funny]
            first_part_visible left_means_mirror twisted_is_inherited
   conc ctrgc8 [inherit_left inherit_twisted]
        endgc8 [inherit_left inherit_twisted conc_demand_lines conc_force_otherway endscando]

call "_finish chain the square" dontshow tag fin_chain_square
            left_means_mirror
   setup 4x2 2x4 rotate
      array [0 A0W 0 A3E A2E 0 CA5E 0]
   setup 2x4 2x4
      array [0 0 0 0 0 CA5S A0N 0]
            alternate_definition [12matrix] c3a
   setup 6x2 3x4 rotate
      array [0 A10W 0 A0W 0 A3E A2E 0 CA5E 0 CA7E 0]
            alternate_definition [16matrix] c3a
   setup 8x2 4x4
      array [0 A13N 0 A14N 0 A0N 0 A4S A2S 0 CA7S 0 CA11S 0 CA9S 0]

call "chain the square" c2
            left_means_mirror first_part_visible bigmatrix_is_inherited
            twisted_is_inherited magic_is_inherited funny_is_inherited
   seq passthru [inherit_left inherit_twisted inherit_magic inherit_funny inherit_bigmatrix]
   // We do the usual "funny" trick -- inherit it to everything so
   // it will only be legal if you say "initially funny".
   seq fin_chain_square [inherit_left inherit_funny inherit_bigmatrix]

call "turn away" c4a
            left_means_mirror
   setup 4x2 2x4 rotate
      array [CR5E CR4E CR2E CR3E CM4E CM5E CR7W CR6W]
            alternate_definition [single] c4
   setup 2x2 2x2 qualifier wave_only  /* We have to exclude 1-faced boxes. */
      array [CR1S CM2S CR3N CR2S]
   setup 2x2 2x2 qualifier in_or_out
      array [CR1S CM2S CR3N CR2S]
   setup 4x1 1x4 rotate qualifier out 2fl_only
      array [0 0 C2E C3E]
            alternate_definition [3x3] c4
   setup 6x2 2x6 rotate
      array [CR8E CR7E CR6E CR3E CR4E CR5E CM6E CM7E CM8E CR11W CR10W CR9W]
            alternate_definition [4x4] c4
   setup 8x2 2x8 rotate
      array [CR11E CR10E CR9E CR8E CR4E CR5E CR6E CR7E CM8E CM9E CM10E CM11E CR15W CR14W CR13W CR12W]

call "hang a @eright@f" c4a
            left_means_mirror
   setup 4x2 2x4 rotate
      array [0 0 CR3E CM4E CM5E CR2E 0 0]
            alternate_definition [single] c4
   setup 4x1 2x2
      array [0 0 CM3S CR2S]
   setup 2x2 1x4
      array [C2S C3S 0 0]
            alternate_definition [3x3 single] c4
   setup 6x1 2x3
      array [0 0 0 C5S C4S C3S]
            alternate_definition [4x4 single] c4
   setup 8x1 2x4
      array [0 0 0 0 C7S C6S C4S C5S]

call "_the axle part 1" dontshow tag axle1
            rear_back_from_qtag
   setup 4x2 2x4 rotate
      array [0 ZM1W ZM1W CR3E AL0E ZM2W ZM2W 0]
   setup 2x4 2x4 rotate
      array [0 ZM6W ZM1W 0 0 ZM1W ZM6W 0]

call "the axle" c1
            visible_fractions yoyo_is_inherited gen_sting_is_inherited
   seq axle1 []
   seq cast_off_n4_with_warn [allow_forced_mod inherit_yoyo inherit_gensting insert_number 2]
   seq ctrstrade [allow_forced_mod roll_transparent]

call "the axle but @m" c2
            visible_fractions yoyo_is_inherited gen_sting_is_inherited
   seq axle1 []
   seq cast_off_n4_with_warn [allow_forced_mod inherit_yoyo inherit_gensting insert_number 2]
   seq ctrs_mandatory_2ndcall [roll_transparent]

call "the axle, cast off @b" c1
            visible_fractions neednumber
   seq axle1 []
   seq cast_off_n4_with_warn []
   seq ctrstrade [allow_forced_mod roll_transparent]

call "@2pass @3the axle" c1
            visible_fractions twisted_is_inherited funny_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq passthru [or_anycall inherit_twisted inherit_funny]
   seq axle1 []
   seq cast_off_n4_with_warn [allow_forced_mod inherit_yoyo inherit_gensting insert_number 2]
   seq ctrstrade [allow_forced_mod roll_transparent]

call "@2pass @3the axle but @m" c2
            visible_fractions twisted_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq passthru [or_anycall inherit_twisted]
   seq axle1 []
   seq cast_off_n4_with_warn [allow_forced_mod inherit_yoyo inherit_gensting insert_number 2]
   seq ctrs_mandatory_2ndcall [roll_transparent]

call "@2pass @3the axle, cast off @b" c1
            visible_fractions neednumber twisted_is_inherited
   seq passthru [or_anycall inherit_twisted]
   seq axle1 []
   seq cast_off_n4_with_warn []
   seq ctrstrade [allow_forced_mod roll_transparent]

call "@0 the axle" c1
            dont_use_in_resolve yoyo_is_inherited gen_sting_is_inherited
   seq nullcall [mandatory_anycall]
   seq axle1 []
   seq cast_off_n4_with_warn [allow_forced_mod inherit_yoyo inherit_gensting insert_number 2]
   seq ctrstrade [allow_forced_mod roll_transparent]

call "@0 the axle but @m" c2
            dont_use_in_resolve yoyo_is_inherited gen_sting_is_inherited
   seq nullcall [mandatory_anycall]
   seq axle1 []
   seq cast_off_n4_with_warn [allow_forced_mod inherit_yoyo inherit_gensting insert_number 2]
   seq ctrs_mandatory_2ndcall [roll_transparent]

call "@0 the axle, cast off @b" c1
            dont_use_in_resolve neednumber gen_sting_is_inherited
   seq nullcall [mandatory_anycall]
   seq axle1 []
   seq cast_off_n4_with_warn [inherit_gensting]
   seq ctrstrade [allow_forced_mod roll_transparent]

// This has a special interpretation of "grand single" -- center 6 do the call in three pairs.
call "_centers do @0" dontshow tag centers_mandatory_call
            single_is_inherited grand_is_inherited
   maybespecialsingleconc nullcall [mandatory_anycall permit_touch_or_rear_back] nullcall []

call "_rotary nothing" dontshow tag rotary
            left_means_mirror
   setup 4x2 qtag rotate
      array [0 ZM7W 0 AL1N AL0N 0 ZM2W 0]
   setup 2x4 bone
      array [0 0 0 0 0 ZM2N ZM7N 0]
   setup rigger 1x8
      array [0 0 AL5E AL4E ZM7N ZM2N AL1E AL0E]
            alternate_definition [single] c3a
   setup 4x1 dmd
      array [0 ZM3N AL2E 0]
            alternate_definition [grand single] c4a
   setup 8x1 spindle
      array [0 ZM6N ZM5N 0 AL3E 0 0 ZM4N]
   setup 6x1 short6 rotate
      array [0 ZM3W 0 AL1N 0 ZM2W]
            alternate_definition [4x4 single] c4
   setup 8x1 spindle
      array [0 ZM6N ZM5N 0 AL3E 0 0 ZM4N]
            alternate_definition [3x3 single] c4
   setup 6x1 short6 rotate
      array [0 ZM3W 0 AL1N 0 ZM2W]
            alternate_definition [4x4 16matrix] c4
   setup 4x4 4dmd
      array [AL0E 0 ZM4N 0 0 0 0 ZM6N 0 ZM13N 0 ZM15N AL3E AL2E AL1E 0]
            alternate_definition [3x3 12matrix] c4
   setup 4x3 3dmd rotate
      array [0 ZM10W 0 AL2N AL1N 0 AL0N 0 ZM3W 0 0 ZM5W]
            alternate_definition [straight] c2
   // This doesn't have anything to do with straight.  The call "rotary spin the windmill"
   // turns this on, so that the warning will be raised.
   setup 4x2 qtag rotate restriction controversial alwaysfail
      array [0 ZM7W 0 AL1N AL0N 0 ZM2W 0]
   setup 2x4 bone restriction controversial alwaysfail
      array [0 0 0 0 0 ZM2N ZM7N 0]

call "_finish rotary @2spin@3" dontshow tag fin_rot_spin
            left_means_mirror single_is_inherited grand_is_inherited gen_sting_is_inherited
            nxn_is_inherited bigmatrix_is_inherited
   seq rotary [inherit_left inherit_single inherit_nxn inherit_bigmatrix inherit_grand]
   seq ctrmaybearmturn3 [inherit_single inherit_nxn inherit_bigmatrix inherit_grand inherit_gensting]

call "_finish rotary @0" dontshow tag fin_rot_anything
            left_means_mirror single_is_inherited grand_is_inherited
   seq rotary [inherit_left inherit_single inherit_grand]
   seq centers_mandatory_call [inherit_single inherit_grand permit_touch_or_rear_back]

call "rotary @2spin@3" c1
            visible_fractions left_means_mirror twisted_is_inherited gen_sting_is_inherited
            magic_is_inherited funny_is_inherited single_is_inherited
            grand_is_inherited nxn_is_inherited bigmatrix_is_inherited
   seq passthru [inherit_left inherit_twisted inherit_magic inherit_funny inherit_bigmatrix]
   // We do the usual "funny" trick -- inherit it to everything so
   // it will only be legal if you say "initially funny".
   seq fin_rot_spin [inherit_left inherit_funny inherit_single inherit_gensting
                     inherit_nxn inherit_bigmatrix inherit_grand]

call "rotary @0" c2
            visible_fractions left_means_mirror twisted_is_inherited
            magic_is_inherited funny_is_inherited single_is_inherited grand_is_inherited
   seq passthru [inherit_left inherit_magic inherit_twisted]
   seq fin_rot_anything [inherit_left inherit_single inherit_funny inherit_grand]

call "the plank" c4a tag plank
            visible_fractions
   conc walkndodge [] leadrun [conc_demand_columns conc_force_spots endscando]

call "@2walk @3the plank" c4a
   setup 4x2 2x4 restriction wave_only
      array [ZM2N ZM5N CR4S CM3S AM4S AL3S ZM2N ZM5N]
            alternate_definition [single] c4
   setup 2x2 1x4 rotate restriction wave_only
      array [C0E A0E ZM1W ZM1W]
            alternate_definition [3x3 12matrix] c4
   setup 6x2 3x4 restriction wave_only
      array [ZM2N ZM5N ZM7N C6S C4S C3S A6S A4S A3S ZM2N ZM5N ZM7N]
            alternate_definition [4x4 16matrix] c4
   setup 8x2 4x4 restriction wave_only
      array [ZM14N ZM3N ZM7N ZM5N C4S C2S C1S C0S
            A4S A2S A1S A0S ZM14N ZM3N ZM7N ZM5N]
            visible_fractions magic_is_inherited funny_is_inherited
   seq colcirc [or_anycall inherit_magic inherit_funny]
   seq plank []

call "@0 the plank" c4a
            visible_fractions
   seq nullcall [mandatory_anycall]
   seq plank []

call "cut across" c4a
   setup 4x2 2x4
      array [M0W L5W M2W R7W L0E M5E R2E M7E]
   setup 2x4 2x4
      array [R4W R5W L6E L7E M4E M5E M6W M7W]

call "_pass and roll 2" dontshow tag passnroll_2
            left_means_mirror
   setup 4x1 1x4
      array [0 CM1S CR2S 0]
            alternate_definition [grand] c3
   setup 6x1 1x6
      array [0 CM1S 0 CR3S 0 CM5S]
   setup 8x1 1x8
      array [0 CM1S CM2S 0 CR4S 0 0 CM7S]
            alternate_definition [generous] c3
   setup 4x1 dmd
      array [0 CM1W CR2S 0]
   setup dmd 1x4
      array [0 0 0 CM1W]
   setup pmd 1x4
      array [0 0 CR2S 0]
            alternate_definition [stingy] c3
   setup 4x1 dmd
      array [0 CM3E CR2S 0]
   setup dmd 1x4
      array [0 0 0 CM3E]
   setup pmd 1x4
      array [0 0 CR2S 0]

call "_funny pass and roll 1" dontshow tag passnroll_1_funny
   setup 2x1 1x2 qualifier in in_or_out
      array [ZM1N 0]
   setup 2x1 1x2
      array [ZM0N ZM1N]

call "_funny pass and roll 2" dontshow tag passnroll_2_funny
            left_means_mirror
   setup 4x1 1x4
      array [ZM0N CM1S CR2S 0]

call "_pass and roll 4" dontshow tag passnroll_4
            left_means_mirror
   setup 4x1 2x2
      array [0 ZM1N CR2S 0]
            alternate_definition [half] a2
   setup 4x1 dmd
      array [0 ZM1N CR2E 0]
            alternate_definition [grand] c3
   setup 6x1 2x3
      array [0 ZM1N 0 CR3S 0 ZM2N]
   setup 8x1 2x4
      array [0 ZM1N ZM2N 0 CR4S 0 0 ZM3N]

call "pass and roll" a2
            rear_back_from_r_wave visible_fractions
            left_means_mirror twisted_is_inherited gen_sting_is_inherited
            magic_is_inherited grand_is_inherited
   seq passthru [inherit_left inherit_magic inherit_twisted]
   seq passnroll_2 [inherit_left inherit_grand inherit_gensting]
   seq passthru [inherit_left inherit_magic inherit_twisted]
   seq passnroll_4 [inherit_left inherit_grand]

call "funny pass and roll" c3
            visible_fractions left_means_mirror
   seq passnroll_1_funny []
   seq passnroll_2_funny []
   seq passthru [inherit_left]
   seq passnroll_4 [inherit_left]

call "_finish pass and roll something" dontshow tag fin_passnroll_something
            left_means_mirror
   setup 4x1 2x2
      array [0 C3S C2S 0]
            alternate_definition [generous] c3
   setup dmd 2x2
      array [0 0 0 C3W]
   setup pmd 2x2
      array [0 0 C2S 0]
            alternate_definition [stingy] c3
   setup dmd 2x2
      array [0 0 0 C1E]
   setup pmd 2x2
      array [0 0 C2S 0]

call "pass and roll your neighbor" a2
            rear_back_from_r_wave first_part_visible
            left_means_mirror twisted_is_inherited gen_sting_is_inherited magic_is_inherited
   seq passthru [inherit_left inherit_magic inherit_twisted]
   seq fin_passnroll_something [inherit_left inherit_gensting]
   seq neighbor []

call "pass and roll your cross neighbor" c1
            rear_back_from_r_wave first_part_visible
            left_means_mirror twisted_is_inherited gen_sting_is_inherited magic_is_inherited
   seq passthru [inherit_left inherit_magic inherit_twisted]
   seq fin_passnroll_something [inherit_left inherit_gensting]
   seq xneighbor []

call "pass and roll your criss cross neighbor" c2
            rear_back_from_r_wave first_part_visible
            left_means_mirror twisted_is_inherited gen_sting_is_inherited magic_is_inherited
   seq passthru [inherit_left inherit_magic inherit_twisted]
   seq fin_passnroll_something [inherit_left inherit_gensting]
   seq xxneighbor []

call "pass and roll the axle" c4
            rear_back_from_r_wave first_part_visible
            left_means_mirror twisted_is_inherited magic_is_inherited gen_sting_is_inherited
   seq passthru [inherit_left inherit_magic inherit_twisted]
   seq fin_passnroll_something [inherit_left]
   seq natstepthru []
   seq axle1 []
   seq cast_off_n4_with_warn [allow_forced_mod insert_number 2 inherit_gensting]
   seq ctrstrade [allow_forced_mod roll_transparent]

call "pass and roll your leader" c3a
            rear_back_from_r_wave first_part_visible
            left_means_mirror twisted_is_inherited magic_is_inherited fractal_is_inherited
   seq passthru [inherit_left inherit_magic inherit_twisted]
   seq fin_passnroll_something [inherit_left]
   seq leader [inherit_fractal]

call "double your pleasure" c4a
            dont_raise_overcast
   setup 4x2 2x4 rotate restriction forbidden wave_only
      array [L4W R6W R1W M7E M4E L2W L5W R7W]
   setup 3x2 bone6 rotate restriction forbidden wave_only
      array [L3W R5W M4E M3E L2W R4W]
            alternate_definition [magic] c4a
   setup 4x2 2x4 rotate restriction forbidden magic_only
      array [4W 5W 2W 7E 4E 1W 6W 7W]
            alternate_definition [cross] c4a
   setup 4x2 2x4 rotate restriction forbidden wave_only
      array [R7W R6W R1W M4E M7E L2W L5W L4W]
   setup 3x2 bone6 rotate restriction forbidden wave_only
      array [R4W R5W M3E M4E L2W L3W]

call "criss cross double your pleasure" c4a
            take_right_hands
   setup 4x2 2x4 rotate restriction forbidden wave_only
      array [L4W R6W R1W M4E M7E L2W L5W R7W]

call "mini pleasure" c4a
   setup 4x2 qtag rotate restriction forbidden wave_only
      array [CR4W CM2E CR1E AM7E CM3E AL0E AM6E AL5W]
            alternate_definition [cross] c4a
   setup 4x2 qtag rotate
      array [CR4W CM2E CR1E CM3E AM7E AL0E AM6E AL5W]
            alternate_definition [magic] c4
   setup 4x2 qtag rotate restriction forbidden magic_only
      array [CR4W CM2E AL0E AM7E CM3E CR1E AM6E AL5W]
            alternate_definition [magic cross] c4
   setup 4x2 qtag rotate restriction forbidden magic_only
      array [CR4W CM2E AL0E CM3E AM7E CR1E AM6E AL5W]
            alternate_definition [yoyo] c4
   setup 6x2 qtag rotate
      array [0 0 0 0 0 AM7E CM3E 0 0 0 0 0]
   setup 2x6 qtag rotate
      array [0 0 0 0 0 0 AAL1S CR1S AM2N CM2S AL4N CCR4N]

call "cheerio" c4
   setup 4x2 2x4 rotate
      predscantdocallinsetup
         if columns_miniwave [ZM5W CCA4W CM3E CM2E AM1E AM0E AAC7W ZM6W]
         if columns_couple   [ZM6W CCA4W CM3E CM2E AM1E AM0E AAC7W ZM5W]
         if always           [0    CCA4W CM3E CM2E AM1E AM0E AAC7W 0]
   setup 2x4 2x4
      array [0 C3S A0S 0 0 AC7N CA4N 0]
            alternate_definition [3x3] c4
   setup 6x2 2x6 rotate qualifier couples_only
      array [0 0 0 CM5E CM4E CM3E AM2E AM1E AM0E 0 0 0]
            alternate_definition [4x4] c4
   setup 8x2 2x8 rotate qualifier couples_only
      array [0 0 0 0 CM7E CM6E CM5E CM4E AM3E AM2E AM1E AM0E 0 0 0 0]
            alternate_definition [yoyo] c4
   setup bone 2x4 rotate qualifier miniwaves
      array [0 0 AAAC3S C3S 0 0 CCCA4N A4N]
   setup pbone 2x4 rotate
      predscantdocallinsetup
         if columns_miniwave [ZM5W CM2E 0 0 AM1E ZM6W 0 0]
         if columns_couple   [ZM6W CM2E 0 0 AM1E ZM5W 0 0]
         if always           [0    CM2E 0 0 AM1E 0    0 0]

call "something new" c3a
   setup 4x2 qtag rotate
      array [ZM6W CR7E CR0E CR1E AL0E AL1E AL3E ZM2W]
            alternate_definition [magic] c3
   setup 4x2 qtag rotate
      array [ZM2W CR7E AL1E CR1E AL0E CR0E AL3E ZM6W]

call "_jam thru part 2" dontshow tag jam_thru_2
   setup 4x2 2x4 rotate
      array [0 CM2N 0 CR3S AL0N 0 AM1S 0]

call "jam thru" c4a
   // "visible_fractions" is of course not really right, because the original
   // ends have 4 parts.  We just hope no one calls "invert snag jam thru"
   // until the selective part distribution stuff is finished.  However,
   // "snag jam thru" has been called, so we need this.  Sigh.
            visible_fractions twisted_is_inherited
   seq passthru [inherit_twisted]
   seq jam_thru_2 []

call "_ride the tide part 2" dontshow tag ridetide2
   conc square_thru_n [insert_number 2] clover [conc_force_otherway conc_demand_columns]

call "ride the tide" c4a
            twisted_is_inherited visible_fractions
   seq crosstrail [allow_forced_mod inherit_twisted]
   seq ridetide2 []
   seq slidethru [allow_forced_mod inherit_twisted]

call "change-O" c4a
   setup 4x2 2x4
      array [ZM6N ZM5N ZM3N CR4S AL3S ZM4N ZM2N ZM1N]
            alternate_definition [reverse] c4a
   setup 4x2 2x4
      array [ZM1N ZM5N ZM4N CR4S AL3S ZM3N ZM2N ZM6N]

call "quick step part 1" dontshow tag quickstep1
            fudge_to_q_tag    // Which means fudge to a 2x3 in this case.
   setup 4x2 4x4 qualifier right quarterbox
      array [ZM15N ZM3N ZM0N    0    0    0    0  ZM9N]
   setup 4x2 4x4 qualifier left quarterbox
      array [ZM10N    0    0    0    0 ZM4N ZM7N ZM11N]
   setup 4x2 4x4 qualifier right threequarterbox
      array [    0 ZM3N ZM0N ZM1N ZM2N    0    0     0]
   setup 4x2 4x4 qualifier left threequarterbox
      array [    0    0    0 ZM1N ZM2N ZM4N ZM7N     0]
   setup 4x2 4x4 restriction forbidden quarterbox_or_col
      preds "Must be in quarter box setup."
         if columns_tandem     [ZM15N ZM3N ZM0N ZM1N ZM2N ZM4N ZM7N ZM11N]
         if columns_antitandem [ZM10N ZM3N ZM0N    0    0 ZM4N ZM7N ZM9N]
         if always             [ZM15N ZM3N ZM0N    0    0 ZM4N ZM7N ZM11N]
   setup 2x4 qtag qualifier not_tboned_in_quad
      array [0 0 0 0 ZM2N ZM3N ZM7N ZM6N]
   setup 2x4 2x4
      array [0 0 0 0 0 ZM2N ZM1N 0]
   setup 3x2 3x4 rotate restriction forbidden quarterbox_or_col
      preds "Must be in quarter box setup."
         if columns_tandem     [ZM11W ZM0W ZM1W ZM2W ZM3W ZM5W]
         if columns_antitandem [ZM8W  ZM0W    0    0 ZM3W ZM7W]
         if always             [   0  ZM0W    0    0 ZM3W    0]
            alternate_definition [magic] c3a
   setup 4x2 4x4 restriction forbidden quarterbox_or_magic_col
      preds "Must be in quarter box setup."
         if columns_magic_tandem     [ZM11N ZM3N ZM4N ZM1N ZM2N ZM0N ZM7N ZM15N]
         if columns_magic_antitandem [ZM10N ZM3N ZM4N    0    0 ZM0N ZM7N ZM9N]
         if always                   [   0  ZM3N ZM4N    0    0 ZM0N ZM7N    0]
   setup 3x2 3x4 rotate restriction forbidden quarterbox_or_magic_col
      preds "Must be in quarter box setup."
         if columns_magic_tandem     [ZM5W ZM3W ZM1W ZM2W ZM0W ZM11W]
         if columns_magic_antitandem [ZM8W ZM3W    0    0 ZM0W ZM7W]
         if always                   [   0 ZM3W    0    0 ZM0W    0]

call "quick step part 2" dontshow tag quickstep2
            fudge_to_q_tag    // Which means fudge *OUT OF* a qtag in this case.
   in_out_triple_squash ahso [or_anycall] nullcall []

call "quick anything 2 with @0" dontshow tag quickany2
            fudge_to_q_tag    // Which means fudge *OUT OF* a qtag in this case.
   in_out_triple_squash nullcall [mandatory_anycall] nullcall []

call "quick @2step@3" c3a
            magic_is_inherited
   seq quickstep1 [inherit_magic]
   seq quickstep2 []

call "quick @0" c3a
            magic_is_inherited
   seq quickstep1 [inherit_magic]
   seq quickany2 []

call "make magic" c1
   // If anyone is in lines, these restrictions will behave improperly.
   setup 4x2 2x4 qualifier right quarterbox
         array [ZM0N ZM5N ZM3N 0 0 0 0 ZM6N]
   setup 4x2 2x4 qualifier left quarterbox
         array [ZM1N 0 0 0 0 ZM4N ZM2N ZM7N]
   setup 4x2 2x4 qualifier right threequarterbox
         array [0 ZM5N ZM2N ZM3N ZM4N 0 0 0]
   setup 4x2 2x4 qualifier left threequarterbox
         array [0 0 0 ZM3N ZM4N ZM5N ZM2N 0]
   setup 4x2 2x4 restriction unusual quarterbox_or_magic_col
      predscantdocallinsetup
         if columns_antitandem       [ZM1N ZM5N ZM3N ZM3N ZM4N ZM4N ZM2N ZM6N]
         if columns_someone_in_front [ZM0N ZM5N ZM2N ZM3N ZM4N ZM5N ZM2N ZM7N]
         // This could happen if lots of phantoms.
         if always                   [   0 ZM5N    0 ZM3N ZM4N    0 ZM2N    0]
   // But it doesn't matter, because this next restriction
   // will be sure the warning is raised.
   setup 2x4 2x4 restriction unusual alwaysfail
      array [ZM0N ZM1N ZM2N ZM3N 0 ZM1N ZM2N 0]
            alternate_definition [half] c4a
   setup 4x2 2x3232 restriction unusual quarterbox_or_magic_col
      preds "Can't figure out what to do."
         if columns_antitandem       [ZM0N ZM9N ZM1N ZM4N ZM8N ZM5N ZM3N ZM11N]
         if columns_someone_in_front [ZM2N ZM9N    0 ZM4N ZM8N    0 ZM3N ZM10N]

call "open up the column" c3a tag openup
   setup 4x2 2x4 restriction forbidden wave_only
      array [CM0W CM2W AL3E CR5W AL2E CR4W AM5E AM7E]
            alternate_definition [magic] c3a
   setup 4x2 2x4 restriction forbidden magic_only
      array [AM7E CM2W CR5W CR4W AL3E AL2E AM5E CM0W]

call "_open up and part 1" dontshow tag opnup1
            equalize
   setup 4x2 2x4 rotate restriction unusual siamese_in_quad
      array [ZM6W ZM1W AL0N CR3S AL0N CR3S ZM2W ZM5W]
   setup 2x4 qtag restriction unusual siamese_in_quad
      array [0 0 0 0 ZM2N ZM3N ZM7N ZM6N]
   setup c1phan bone qualifier ntbone none restriction forbidden siamese_in_quad
      array [0 CR1W 0 AL0E AL0E 0 CR1W 0 ZM2N 0 ZM3N 0 0 ZM6N 0 ZM7N]
   setup c1phan 4x4 qualifier tbone none restriction forbidden siamese_in_quad
      array [0 CR1W 0 AL10E AL10E 0 CR1W 0 0 ZM7N 0 ZM3N ZM11N 0 ZM15N 0]
            alternate_definition [magic] c1
   setup 4x2 2x4 rotate
      array [ZM5W ZM1W CR3S CR3S AL0N AL0N ZM2W ZM6W]
   setup 2x4 qtag
      array [0 0 0 0 ZM2N ZM3N ZM7N ZM6N]

call "open up and @0" c3a
            magic_is_inherited
   seq opnup1 [inherit_magic normalize]
   seq transf2 []

call "open ups @0" c4a
            visible_fractions magic_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq opnup1 [inherit_magic normalize]
   seq ctrs_cast_3_4_with_warn [inherit_fractal inherit_gensting]
   seq nullcall [mandatory_anycall]

call "_fudgy replace the column 1" dontshow tag replacecolfudge1
   // This is just invert the column 1/2.
   setup 4x2 2x4 rotate restriction unusual wave_only
      array [ZM6W ZM1W AL0E AM7E CM4E CR3E ZM2W ZM5W]
            alternate_definition [cross] c4a
   setup 4x2 2x4 rotate restriction unusual wave_only
      array [ZM6W ZM1W CR3E CM4E AM7E AL0E ZM2W ZM5W]
            alternate_definition [magic] c4
   setup 4x2 2x4 rotate restriction unusual magic_only
      array [ZM5W ZM1W CR3E AM7E CM4E AL0E ZM2W ZM6W]
            alternate_definition [magic cross] c4
   setup 4x2 2x4 rotate restriction unusual magic_only
      array [ZM5W ZM1W AL0E CM4E AM7E CR3E ZM2W ZM6W]
            alternate_definition [single] c4
   setup 2x2 1x4 restriction wave_only
      array [AL0S CR2S ZM3N ZM1N]
            alternate_definition [1x3] c4
   setup 4x2 3x4 rotate restriction wave_only
      array [ZM8W ZM11W ZM1W AL10E CR4E ZM2W ZM5W ZM7W]
            alternate_definition [3x1] c4
   setup 4x2 3x4 rotate restriction wave_only
      array [ZM11W AL0E AM10E AM9E CM6E CM4E CR3E ZM5W]
            alternate_definition [3x3 12matrix] c4
   setup 6x2 3x4 rotate restriction wave_only
      array [ZM8W ZM11W ZM1W AL0E AM10E AM9E CM6E CM4E CR3E ZM2W ZM5W ZM7W]
            alternate_definition [4x4 16matrix] c4
   setup 8x2 4x4 restriction wave_only
      array [ZM10N ZM15N ZM3N ZM1N AL0S AM14S AM13S AM12S
            CM8S CM6S CM5S CR4S ZM2N ZM7N ZM11N ZM9N]

call "_replace the column 1" dontshow tag replacecol1but
   // We do all but that 2/3 recycle.  This is so that
   // "replace the column but <...>" will work.
   setup 4x2 bone rotate restriction unusual wave_only
      array [ZM7W AM6E AL0E AL5E CR4E CR1E CM2E ZM3W]
            alternate_definition [cross] c4a
   setup 4x2 bone rotate restriction unusual wave_only
      array [ZM7W CM2E CR1E CR4E AL5E AL0E AM6E ZM3W]
            alternate_definition [magic] c4
   setup 4x2 bone rotate restriction unusual magic_only
      array [ZM3W CM2E CR1E AL5E CR4E AL0E AM6E ZM7W]
            alternate_definition [magic cross] c4
   setup 4x2 bone rotate restriction unusual magic_only
      array [ZM3W AM6E AL0E CR4E AL5E CR1E CM2E ZM7W]

call "_replace the column 2, ends" dontshow tag replacecol2ends
   setup 2x2 2x2
      array [CR1E AL0W AL1W CR0E]
   setup 1x2 1x2 rotate
      array [CR0N AL0S]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate
      array [CR0N AL0S]
            alternate_definition [3x3] c4
   setup 3x2 2x3 rotate restriction controversial wave_only
      array [CR0N CR1N CR2N AL0S AL1S AL2S]
            alternate_definition [4x4] c4
   setup 4x2 2x4 rotate restriction controversial wave_only
      array [CR0N CR1N CR2N CR3N AL0S AL1S AL2S AL3S]

call "_replace the column 2, centers" dontshow tag replacecol2centers
   setup 2x2 2x2
      array [AL2E CR3W CR2W AL3E]
            alternate_definition [cross] c4a
   setup 2x2 2x2
      array [CR3W AL2E AL3E CR2W]
   // The "magic" and "magic cross" modifiers are problematical and somewhere
   // between controversial and bogus.  We're not aware that anyone actually
   // uses them.  We do a 2/3 cross cycle for magic and 2/3 recycle for
   // cross magic.  This is rather peculiar.  But we allow it anyway.
            alternate_definition [magic] c4a
   setup 2x2 2x2 restriction controversial alwaysfail
      array [CR3W AL2E AL3E CR2W]
            alternate_definition [magic cross] c4a
   setup 2x2 2x2 restriction controversial alwaysfail
      array [AL2E CR3W CR2W AL3E]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate restriction forbidden wave_only
      array [AL1N CR1S]
            alternate_definition [3x3] c4
   setup 3x2 2x3 rotate restriction forbidden wave_only
      array [AL5N AL4N AL3N CR5S CR4S CR3S]
            alternate_definition [4x4] c4
   setup 4x2 2x4 rotate restriction forbidden wave_only
      array [AL7N AL6N AL5N AL4N CR7S CR6S CR5S CR4S]

call "_replace the column 2" dontshow tag replacecol2nobut
            cross_is_inherited magic_is_inherited single_is_inherited
            mxn_is_inherited nxn_is_inherited bigmatrix_is_inherited
   maybe_nxn_1331_cols_conc
      replacecol2centers [inherit_cross inherit_magic inherit_single inherit_nxn]
      replacecol2ends [conc_force_otherway inherit_single inherit_nxn]

call "_replace the column 2 but @0" dontshow tag replacecol2but
   conc nullcall [mandatory_anycall] ctr_rot [conc_force_otherway]

call "replace the column" c4a
            cross_is_inherited magic_is_inherited single_is_inherited mxn_is_inherited
               nxn_is_inherited bigmatrix_is_inherited
   seq replacecolfudge1 [inherit_cross inherit_magic inherit_single inherit_mxn
               inherit_nxn inherit_bigmatrix]
   seq replacecol2nobut [inherit_cross inherit_magic inherit_single inherit_mxn
               inherit_nxn inherit_bigmatrix]

call "replace the column but @0" c4a
            cross_is_inherited magic_is_inherited
   seq replacecol1but [inherit_cross inherit_magic]
   seq replacecol2but []

call "_continue to@M@C invert to 3/4" dontshow tag continue_invert_to_3_4
   setup qtag 3x4 restriction wave_only       /* 1/4 -> 3/4 */
      array [AM10S CM4S ZM3N CR3S ZM5N ZM11N ZM0N AL0S]
   setup 2x4 3x4 restriction wave_only        /* 1/2 -> 3/4 */
      array [ZM0N AL0S CR3S ZM3N ZM4N ZM5N ZM11N ZM10N]
            alternate_definition [cross] c4
   setup qtag 3x4 restriction 2fl_only        /* 1/4 -> 3/4 */
      array [CM4S AM10S ZM3N AL0S ZM5N ZM11N ZM0N CR3S]
   setup 2x4 3x4 restriction 2fl_only         /* 1/2 -> 3/4 */
      array [ZM0N CR3S AL0S ZM3N ZM4N ZM5N ZM11N ZM10N]
            alternate_definition [magic] c4
   setup qtag 3x4 restriction 2fl_only        /* 1/4 -> 3/4 */
      array [AM10S CM4S ZM3N AL0S ZM11N ZM5N ZM0N CR3S]
   setup 2x4 3x4 restriction 2fl_only         /* 1/2 -> 3/4 */
      array [ZM0N CR3S AL0S ZM3N ZM4N ZM5N ZM11N ZM10N]
            alternate_definition [magic cross] c4
   setup qtag 3x4 restriction 2fl_only        /* 1/4 -> 3/4 */
      array [CM4S AM10S ZM3N CR3S ZM11N ZM5N ZM0N AL0S]
   setup 2x4 3x4 restriction wave_only        /* 1/2 -> 3/4 */
      array [ZM0N AL0S CR3S ZM3N ZM4N ZM5N ZM11N ZM10N]

call "_continue to replace the column 2" dontshow tag contin_replacecol2
   setup 3x4 bone
      array [ZM0N 0 0 ZM1N ZM4N ZM3N ZM2N 0 0 ZM6N ZM5N ZM7N]

call "_continue to replace the column 3" dontshow tag contin_replacecol3
            cross_is_inherited
   conc 23recycle [inherit_cross] ctr_rot [conc_force_otherway]

/* This used to have a non-functional "magic" modifier. */
call "continue to@C replace the column" c4
            cross_is_inherited
   seq continue_invert_to_3_4 [inherit_cross]
   seq contin_replacecol2 []
   seq contin_replacecol3 [inherit_cross]

/* Is this a correct use of "finish", even though there are finer
   fractionalizations of the earlier parts?  Who knows?  But it gets called. */
call "finish@C replace the column" c4
            cross_is_inherited
   seq contin_replacecol2 []
   seq contin_replacecol3 [inherit_cross]

call "continue to@C replace the column but @0" c4
            cross_is_inherited
   seq continue_invert_to_3_4 [inherit_cross]
   seq contin_replacecol2 []
   seq replacecol2but []

call "quick wrap" c4a
   setup 4x2 2x4 restriction wave_only
      array [AL2W AL1E CR3E CR4E AL3W AL4W CR6W CR5E]
            alternate_definition [magic] c4a
   setup 4x2 2x4 restriction magic_only
      array [CR5E AL1E AL4W CR4E AL3W CR3E CR6W AL2W]
            alternate_definition [1x2] c4a
   setup 3x2 short6 rotate restriction wave_only
      array [AL0S AL5N CR1N AL1S CR3S CR2N]
            alternate_definition [magic 1x2] c4a
   setup 3x2 short6 rotate restriction magic_only
      array [CR2N AL5N CR1N AL1S CR3S AL0S]

call "dive thru" mainstream
   setup 4x2 2x4
      predscantdo
         if boyp   [ZM1N 0 CR4S 0 0    0 0 ZM6N]
         if girlp  [ZM1N 0    0 0 0 AL3S 0 ZM6N]
         if always [ZM1N 0    0 0 0    0 0 ZM6N]

call "_ends trade" dontshow tag ends_trade
            left_means_mirror
   conc nullcall []
        trade [inherit_left conc_demand_columns conc_force_spots]

call "pass to the center" mainstream
            rear_back_from_r_wave
   setup 4x2 2x4
      array [ZM1N 0 CR4S 0 0 AL3S 0 ZM6N]
   // Shouldn't need to say 2x1 or 1x2; dancers will know what to do.
   setup short6 bone6 rotate
      array [CR0E 0 AL4E 0 ZM2W 0]
            alternate_definition [2x1] c4a
   setup short6 bone6 rotate
      array [CR0E 0 AL4E 0 ZM2W 0]
            alternate_definition [1x2] c4a
   setup short6 bone6 rotate
      array [CR0E 0 AL4E 0 ZM2W 0]
            alternate_definition [twisted] c4
   setup 4x2 2x4 rotate
      array [CM6N 0 CM1N 0 0 CR4S 0 CAL3S]
            left_means_mirror twisted_is_inherited visible_fractions
   // This doesn't get used unless some fractionalizing concept is in use.
   seq passthru [inherit_left inherit_twisted]
   seq ends_trade [inherit_left]

call "pass to the outside" c4a
            rear_back_from_r_wave
   setup 4x2 2x4
      array [CR6S 0 ZM3N 0 0 ZM4N 0 AL1S]
            alternate_definition [2x1] c4a
   setup pbone6 short6 rotate
      array [CR3E 0 ZM1W 0 AL5E 0]
            alternate_definition [1x2] c4a
   setup pbone6 short6 rotate
      array [CR3E 0 ZM1W 0 AL5E 0]

// This is a left trade by.
call "_square out stuff" dontshow tag square_out_stuff
            left_means_mirror
   setup 4x2 2x4
      array [0 ZM2N 0 CR4S AL3S 0 ZM5N 0]
            alternate_definition [half] c4a
   setup 4x2 crosswave
      array [0 ZM3N 0 CR5E AL4W 0 ZM6N 0]
            alternate_definition [lasthalf] c4a
   setup crosswave 2x4
      array [CR0E CR0E 0 0 AL3W AL3W 0 0]
   setup pcrosswave 2x4
      array [0 0 ZM2N ZM2N 0 0 ZM5N ZM5N]

call "square out" c4a
            // Actually, only the 1st, 2nd, and last parts should be visible.
            left_means_mirror twisted_is_inherited visible_fractions
   seq passthru [inherit_left inherit_twisted]
   seq square_out_stuff [inherit_left inherit_twisted]
   seq touch [inherit_left inherit_twisted]
   seq crosslockit []
   seq natstepthru [inherit_twisted]

call "square out to a wave" c4a
            left_means_mirror twisted_is_inherited first_two_parts_visible
   seq passthru [inherit_left inherit_twisted]
   seq square_out_stuff [inherit_left inherit_twisted]
   seq touch [inherit_left inherit_twisted]
   seq crosslockit []

call "square out, @6 to a wave" c4a
            left_means_mirror twisted_is_inherited first_two_parts_visible
   seq passthru [inherit_left inherit_twisted]
   seq square_out_stuff [inherit_left inherit_twisted]
   seq touch [inherit_left inherit_twisted]
   seq crosslockit []
   seq somedontstepthru []

call "square out, but on the 3rd hand, @0" c4a
            left_means_mirror twisted_is_inherited first_two_parts_visible
   seq passthru [inherit_left inherit_twisted]
   seq square_out_stuff [inherit_left inherit_twisted]
   seq touch [inherit_left inherit_twisted]
   seq nullcall [mandatory_anycall]

call "square out, but on the 4th hand, @0" c4a
            left_means_mirror twisted_is_inherited first_two_parts_visible
   seq passthru [inherit_left inherit_twisted]
   seq square_out_stuff [inherit_left inherit_twisted]
   seq touch [inherit_left inherit_twisted]
   seq crosslockit []
   seq nullcall [mandatory_anycall]


call "_square around 1" dontshow tag square_around_1
            left_means_mirror
   setup 4x2 2x4
      array [ZM1N 0 CR3E 0 0 AL4W 0 ZM6N]

call "_square around 2" dontshow tag square_around_2
            left_means_mirror
   setup 2x4 2x4 rotate
      array [0 0 0 0 AL0S 0 0 CR7N]
   setup 4x2 2x4 rotate
      array [0 CR1N 0 0 0 0 AL2S 0]

call "_square around 3" dontshow tag square_around_3
            left_means_mirror
   setup 2x4 2x4
      array [0 0 0 0 AL3W 0 0 CR0E]
   setup 4x2 2x4
      array [0 ZM2N 0 0 0 0 ZM5N 0]
            alternate_definition [half] mainstream
   setup 2x4 qtag rotate
      array [0 0 0 0 ZM0W 0 0 ZM5W]
   setup 4x2 qtag rotate
      array [0 ZM6W 0 0 0 0 ZM3W 0]

call "_square around 4" dontshow tag square_around_4
            left_means_mirror
   setup 4x2 2x4
      array [CR1E 0 CR3E 0 0 AL4W 0 AL6W]

call "square around" c4
            left_means_mirror twisted_is_inherited visible_fractions
   seq square_around_1 [inherit_twisted]
   seq square_around_2 []
   seq square_around_3 []
   seq square_around_4 []
   seq passthru [inherit_twisted]

// This is courtesy turn.
call "_finish cross chain and roll ends" dontshow tag finxchthruends
            left_means_mirror
   setup 2x2 2x2
      array [AL1S AL0S 0 0]
            alternate_definition [single] c4
   setup 2x1 1x2
      array [0 AL1S]
            alternate_definition [3x3] c4
   setup 2x3 2x3 qualifier num 2 none
      array [AL2S AL1S AL0S 0 0 0]
            alternate_definition [4x4] c4
   setup 2x4 2x4 qualifier num 2 none
      array [AL3S AL2S AL1S AL0S 0 0 0 0]

// This is courtesy turn and roll.
call "_finish cross chain and roll ends" dontshow tag finxchrollends
            left_means_mirror
   setup 2x2 2x2
      array [AL1E AL0E 0 0]
            alternate_definition [single] c4
   setup 2x1 1x2
      array [0 AL1E]
            alternate_definition [3x3] c4
   setup 2x3 2x3 qualifier num 2 none
      array [AL2E AL1E AL0E 0 0 0]
            alternate_definition [4x4] c4
   setup 2x4 2x4 qualifier num 2 none
      array [AL3E AL2E AL1E AL0E 0 0 0 0]

call "_finish cross chain thru @b@S" dontshow tag fin_x_chain_thru
            left_means_mirror neednumber single_is_inherited
            nxn_is_inherited bigmatrix_is_inherited
   maybe_nxn_lines_conc
      turnstarn_xchthru [inherit_left inherit_single inherit_nxn]
      finxchthruends [inherit_left inherit_single inherit_nxn
                      conc_demand_columns conc_force_spots]

call "_finish cross chain and roll @b@S" dontshow tag fin_x_chain_roll
            left_means_mirror neednumber single_is_inherited
            nxn_is_inherited bigmatrix_is_inherited
   maybe_nxn_lines_conc
      turnstarn_xchroll [inherit_left inherit_single inherit_nxn]
      finxchrollends [inherit_single inherit_left inherit_nxn
                      conc_demand_columns conc_force_spots]

call "cross chain thru@S" c1
            visible_fractions left_means_mirror twisted_is_inherited
            magic_is_inherited funny_is_inherited single_is_inherited
            nxn_is_inherited bigmatrix_is_inherited
   seq passthru [inherit_left inherit_twisted inherit_magic inherit_funny inherit_bigmatrix]
   // We do the usual "funny" trick -- inherit it to everything so it will
   // only be legal if you say "initially funny".
   seq fin_x_chain_thru [inherit_left inherit_funny inherit_single
                         inherit_nxn inherit_bigmatrix insert_number 2]

call "cross chain and roll@S" c1
            visible_fractions left_means_mirror twisted_is_inherited
            magic_is_inherited funny_is_inherited single_is_inherited
            nxn_is_inherited bigmatrix_is_inherited
   seq passthru [inherit_left inherit_twisted inherit_magic inherit_funny inherit_bigmatrix]
   // We do the usual "funny" trick -- inherit it to everything so it will
   // only be legal if you say "initially funny".
   seq fin_x_chain_roll [inherit_left inherit_funny inherit_single
                         inherit_nxn inherit_bigmatrix insert_number 2]

call "checkover" c1
   setup 4x2 2x4 restriction controversial wave_only
      array [CM0W CM1W CR6W CR7W AL0E AL1E AM6E AM7E]
            alternate_definition [single] c4
   setup 2x2 2x2 restriction forbidden wave_only
      array [CR2W AL3E AM2E CM3W]
            alternate_definition [3x3] c4
   setup 6x2 2x6 restriction controversial wave_only
      array [CM0W CM1W CM2W CR9W CR10W CR11W AL0E AL1E AL2E AM9E AM10E AM11E]
            alternate_definition [4x4] c4
   setup 8x2 2x8 restriction controversial wave_only
      array [CM0W CM1W CM2W CM3W CR12W CR13W CR14W CR15W
             AL0E AL1E AL2E AL3E AM12E AM13E AM14E AM15E]

call "turnover" c4a
            visible_fractions diamond_is_legal twisted_is_inherited
            grand_is_inherited nxn_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq boxy_cast_off_34 [inherit_diamond inherit_gensting inherit_fractal inherit_twisted]
   seq maybegrandslither [roll_transparent inherit_grand inherit_diamond
                          inherit_twisted inherit_nxn]

call "turn by" c4 tag turnby
   // Do we actually allow this from a single 8-chain?  Isn't it the equivalent of a trade by,
   // and hence usable only from a single trade-by setup?  Perhaps, but the fact is that
   // things like "turn by, go once and a half" do get called in situations in which
   // it is expected that the call be treated as either a pass thru or a single trade by.
   // In fact, we are now using the definition "pass thru if you can, otherwise UTB
   // to the right".  Well, actually, we do something a little more sleazy than that --
   // we do a press ahead without looking at whether someone is facing us.
   setup 4x1 1x4
      array [ZM1N ZM3N CR2S ZM2N]
            alternate_definition [twisted] c4
   setup 4x1 dmd
      array [0 CM3E CR2S 0]
            alternate_definition [grand] c4
   setup 8x1 1x8
      array [ZM1N ZM3N ZM6N ZM2N CR4S ZM4N ZM7N ZM5N]
            alternate_definition [half grand] c4
   setup 8x1 spindle
      array [0 ZM0N ZM1N 0 CR3E 0 0 ZM2N]
            alternate_definition [half] c4
   setup 4x1 2x2 qualifier ntbone in in_or_out
      array [ZM0N 0 0 ZM1N]
   setup 4x1 dmd qualifier ntbone out in_or_out
      array [0 ZM1N CR2E 0]

call "turn by 1-1/2" c4
   seq turnby []
   seq turnby [force_half]

call "triple play" c3a tag tripleplay
   setup 4x2 2x4 restriction forbidden wave_only
      array [CC1E C0W C2W C7W A0E A5E A7E AA6W]
            alternate_definition [magic] c3a
   setup 4x2 2x4 restriction forbidden magic_only
      array [CC1E CCA7E A5E C7W A0E C2W AAC0W AA6W]

call "triple play to a wave" c3a
            magic_is_inherited
   seq tripleplay [inherit_magic]
   seq backemup []

call "double play" c3
   setup 3x2 2x3 restriction forbidden wave_only
      array [CC0E C1W C5W A0E A4E AA5W]
            alternate_definition [magic] c3x
   setup 3x2 2x3 restriction forbidden magic_only
      array [CC0E A4E C5W A0E C1W AA5W]

/* We do not allow the 2x2 (box/split transfer) to be called "transfer the
   column".  It just looks stupid to have a card say "transfer the column"
   when in waves.  So the 2x2 version can be called "split transfer",
   or "box transfer", but not "transfer the column".  All others are
   "transfer the column". */

call "transfer the column" a1 tag transfer
   setup 4x2 2x4 qualifier wave_only
      array [CM0W CM2W CM5W CM7W AM0E AM2E AM5E AM7E]
   setup 4x2 2x4 restriction wave_only
      array [   0    0 CM5W CM7W AM0E AM2E    0    0]
            alternate_definition [fractal] c4
   setup 4x2 2x4 qualifier wave_only
      array [CM6E CM4E CM5W CM7W AM0E AM2E AM3W AM1W]
   setup 4x2 2x4 restriction wave_only
      array [   0    0 CM5W CM7W AM0E AM2E    0    0]
            alternate_definition [magic] c1
   setup 4x2 2x4 qualifier magic_only
      array [AM7E CM2W AM3E CM6W AM1E CM4W AM5E CM0W]
   setup 4x2 2x4 restriction magic_only
      array [0 0 AM3E CM6W AM1E CM4W 0 0]
            alternate_definition [2x1] c4
   setup 3x2 2x3 qualifier wave_only
      array [CM1W CM3W CM5W AM0E AM2E AM4E]
            alternate_definition [1x2] c4
   setup 3x2 2x3 qualifier wave_only
      array [CM0W CM2W CM4W AM1E AM3E AM5E]
            alternate_definition [magic 1x2] c4
   setup 3x2 2x3 restriction forbidden magic_only
      array [M0W M3E M4W M1E M2W M5E]
            alternate_definition [magic 2x1] c4
   setup 3x2 2x3 restriction forbidden magic_only
      array [M4E M2E M5W M0E M3W M1W]
            alternate_definition [3x1] c2
   setup 4x2 2x4 qualifier wave_only
      array [CM1W CM4W CM6W CM7W AM0E AM1E AM3E AM6E]
            alternate_definition [1x3] c3   // Sorry, this isn't C2.  Making it C3.
   setup 4x2 2x4 qualifier wave_only
      array [CM0W CM1W CM3W CM6W AM1E AM4E AM6E AM7E]
            alternate_definition [magic 3x1] c3
   setup 4x2 2x4 restriction forbidden magic_only
      array [M6E M3E M2E M7W M0E M5W M4W M1W]
            alternate_definition [magic 1x3] c3
   setup 4x2 2x4 restriction forbidden magic_only
      array [M7E M1W M3W M5W M2E M4E M6E M0W]
            alternate_definition [12matrix] c4
   setup 6x2 2x6 restriction forbidden wave_only
      array [M0W M2W M4W M7W M9W M11W M0E M2E M4E M7E M9E M11E]
            alternate_definition [16matrix] c4
   setup 8x2 2x8 restriction forbidden wave_only
      array [M0W M2W M4W M6W M9W M11W M13W M15W M0E M2E M4E M6E M9E M11E M13E M15E]
            alternate_definition [3x3 12matrix] c4   /* same as 12 matrix */
   setup 6x2 2x6 restriction forbidden wave_only
      array [M0W M2W M4W M7W M9W M11W M0E M2E M4E M7E M9E M11E]
            alternate_definition [4x4 16matrix] c4   /* same as 16 matrix */
   setup 8x2 2x8 restriction forbidden wave_only
      array [M0W M2W M4W M6W M9W M11W M13W M15W M0E M2E M4E M6E M9E M11E M13E M15E]
            alternate_definition [single] c4
   setup 2x2 2x2 restriction wave_only
      array [CM2W AM3E AM2E CM3W]
            alternate_definition [3x3 single] c4
   setup 3x2 2x3 rotate restriction forbidden wave_only
      array [C5S C4S C3S A5N A4N A3N]
            alternate_definition [4x4 single] c4
   setup 4x2 2x4 rotate restriction forbidden wave_only
      array [C7S C6S C5S C4S A7N A6N A5N A4N]
            visible_fractions magic_is_inherited
            nxn_is_inherited mxn_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq transf1 [inherit_magic inherit_nxn inherit_mxn normalize]
   seq ctrs_cast_3_4_with_warn [inherit_fractal inherit_gensting inherit_nxn inherit_mxn]
   seq extend [inherit_nxn inherit_mxn]

call "box transfer" a2
            dont_use_in_resolve
   setup 2x2 2x2 qualifier miniwaves
      array [CM2W AM3E AM2E CM3W]
   // We (grudgingly) allow it from couples back-to-back.
   setup 2x2 2x2 qualifier out in_or_out restriction alwaysfail
      array [CM2W AM3E 0 0]
            alternate_definition [3x3] c4
   setup 3x2 2x3 rotate restriction forbidden wave_only
      array [C5S C4S C3S A5N A4N A3N]
            alternate_definition [4x4] c4
   setup 4x2 2x4 rotate restriction forbidden wave_only
      array [C7S C6S C5S C4S A7N A6N A5N A4N]

// Both "split" and "box" are legal on Callerlab lists.
call "split transfer" a2
   setup 2x2 2x2 qualifier miniwaves
      array [CM2W AM3E AM2E CM3W]
   // We (grudgingly) allow it from couples back-to-back.
   setup 2x2 2x2 qualifier out in_or_out restriction alwaysfail
      array [CM2W AM3E 0 0]
            alternate_definition [3x3] c4
   setup 3x2 2x3 rotate restriction forbidden wave_only
      array [C5S C4S C3S A5N A4N A3N]
            alternate_definition [4x4] c4
   setup 4x2 2x4 rotate restriction forbidden wave_only
      array [C7S C6S C5S C4S A7N A6N A5N A4N]

call "_transfer and part 1" dontshow tag transf1
            equalize     // Hi, Linda!
   setup 4x2 2x4 rotate restriction unusual siamese_in_quad
      array [ZM6W ZM1W CR3S CR4S AL7N AL0N ZM2W ZM5W]
   setup 2x4 qtag restriction unusual siamese_in_quad
      array [0 0 0 0 ZM2N ZM3N ZM7N ZM6N]
   setup 3x4 bone
      array [0 CR4W AL5E 0 0 AL0E ZM2N ZM3N ZM7N ZM6N 0 CR1W]
   setup c1phan bone qualifier ntbone none restriction forbidden siamese_in_quad
      array [0 CR4W 0 CR1W AL5E 0 AL0E 0 ZM2N 0 ZM3N 0 0 ZM6N 0 ZM7N]
   setup c1phan 4x4 qualifier tbone none restriction forbidden siamese_in_quad
      array [0 CR2W 0 CR1W AL9E 0 AL10E 0 0 ZM7N 0 ZM3N ZM11N 0 ZM15N 0]
   setup p5x45 qtag
      array [0 0 0 CR4W CR5W ZM2N ZM3N AL0E AL1E 0 0 0 ZM6N ZM7N]
            alternate_definition [1x3] c2
   setup 4x2 qtag rotate
      array [ZM5W ZM7W ZM0W CR2S AL6N ZM1W ZM3W ZM4W]
            alternate_definition [3x1] c2
   setup 4x2 3x4 rotate
      array [ZM11W CR3S CR4S CR6S AL9N AL10N AL0N ZM5W]
            alternate_definition [1x2] c4
   setup 3x2 short6
      array [ZM0N ZM2N CR4W AL1E ZM3N ZM5N]
            alternate_definition [2x1] c4
   setup 3x2 bone6 rotate
      array [ZM5W CR1S CR3S AL4N AL0N ZM2W]
            alternate_definition [magic] c1
   setup 4x2 2x4 rotate
      array [ZM5W ZM1W AL0N CR4S AL7N CR3S ZM2W ZM6W]
   setup 2x4 qtag
      array [0 0 0 0 ZM2N ZM3N ZM7N ZM6N]

call "_transfer and @0 part 2" dontshow tag transf2
            nxn_is_inherited mxn_is_inherited
   maybe_nxn_cols_conc
      nullcall [mandatory_anycall]
      nullcall [conc_demand_columns conc_force_spots]

call "transfer and @0" a2
            magic_is_inherited nxn_is_inherited mxn_is_inherited
   seq transf1 [inherit_magic inherit_nxn inherit_mxn normalize]
   seq transf2 [inherit_nxn inherit_mxn]

call "trans @0" c4a
            visible_fractions magic_is_inherited
            nxn_is_inherited mxn_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq transf1 [inherit_magic inherit_nxn inherit_mxn normalize]
   seq ctrs_cast_3_4_with_warn [inherit_fractal inherit_gensting]
   seq nullcall [mandatory_anycall]

// See nomenclatural comment above for transfer the column.

call "checkmate the column" a2
            take_right_hands
   setup 4x2 2x4 restriction wave_only
      array [CM5E CM4E CR6W CR7W AL0E AL1E AM3W AM2W]
            alternate_definition [2x1] c4
   setup 3x2 2x3 restriction wave_only
      array [CM3E CR4W CR5W AL0E AL1E AM2W]
            alternate_definition [1x2] c4
   setup 3x2 2x3 restriction wave_only
      array [CM4E CM3E CR5W AL0E AM2W AM1W]
            alternate_definition [3x3 12matrix] c2
   setup 6x2 2x6 restriction wave_only
      array [CM8E CM7E CM6E CR9W CR10W CR11W AL0E AL1E AL2E AM5W AM4W AM3W]
            alternate_definition [4x4 16matrix] c2
   setup 8x2 2x8 restriction wave_only
      array [CM11E CM10E CM9E CM8E CR12W CR13W CR14W CR15W
             AL0E AL1E AL2E AL3E AM7W AM6W AM5W AM4W]
            alternate_definition [5x3 16matrix] c4
   setup 8x2 2x8 restriction wave_only
      array [CM10E CM9E CM8E CR11W CR12W CR13W CR14W CR15W
             AL0E AL1E AL2E AL3E AL4E AM7W AM6W AM5W]
            alternate_definition [3x5 16matrix] c4
   setup 8x2 2x8 restriction wave_only
      array [CM12E CM11E CM10E CM9E CM8E CR13W CR14W CR15W
             AL0E AL1E AL2E AM7W AM6W AM5W AM4W AM3W]
            alternate_definition [single] c4
   setup 2x2 2x2 restriction wave_only
      array [CR2W AL3E AM0W CM1E]

   // In a benign world, we wouldn't need these 3x1 and 1x3 clauses --
   // the usual mechanism for handling 3x1/1x3 in terms of 3x3 would
   // just work.  But, alas, checkmate the column is usually called from
   // normal columns but is also sometimes called from a starting DPT
   // or completed DPT.  This means that 3x1 or 1x3 checkmate the column
   // is legal from a 1/4 box or 3/4 box, and we have to apply all the
   // standard rules.  So what's the problem?  These calls are sometimes
   // used with phantoms.  For example, in a butterfly, one can do
   // "quadruple columns working right 3x1 checkmate the column".
   // In this situation one can't disambiguate the various cases.
   // (In fact the mechanism for handling 3x1/1x3 in terms of 3x3 requires
   // that there be no phantoms.  Attempts to loosen this have been less
   // than successful, particularly when it comes time to compress the
   // 12-person setup back to 8.)
   //
   // So we default to the "normal columns" version if there are phantoms.
   // This seems to be consistent with common usage.
   // Regression tests are nf17, ng26, rf01, rh08, le03, vi02, and hi02.

            alternate_definition [3x1] c2
   // Pick out anything consistent with normal columns.
   setup 4x2 2x4 qualifier wave_only
      array [CM4E CR5W CR6W CR7W AL0E AL1E AL2E AM3W]
   // Not in normal columns, the restriction will raise a warning.
   // Also, we can't deal with phantoms.
   setup 4x2 2x4 qualifier live none restriction unusual wave_only
      preds "Can't figure out what to do."
         if antitandem_side_of_out_3n1_col [CM4E CR5W CM4E CR7W AL0E AM3W AL2E AM3W]
         if tandem_side_of_out_3n1_col     [CM6E CM5E CR6W CR7W AL0E AL1E AM2W AM1W]
            alternate_definition [1x3] c3   // Sorry, this isn't C2.  Making it C3.
   setup 4x2 2x4 qualifier wave_only
      array [CM6E CM5E CM4E CR7W AL0E AM3W AM2W AM1W]
   setup 4x2 2x4 qualifier live none restriction unusual wave_only
      preds "Can't figure out what to do."
         if antitandem_side_of_out_3n1_col [CM4E CR5W CM4E CR7W AL0E AM3W AL2E AM3W]
         if tandem_side_of_out_3n1_col     [CM6E CM5E CR6W CR7W AL0E AL1E AM2W AM1W]

call "box checkmate" c3a tag boxcheckmate
   setup 2x2 2x2 restriction wave_only
      array [CR2W AL3E AM0W CM1E]

call "split checkmate" c3a
   alias boxcheckmate

call "single checkmate" c3a
   alias boxcheckmate

/* We're not completely happy with this.  We would like fractionalization,
   and "finish" to work properly, and be compatible with "mystic". */
call "_centers push off" dontshow tag ctrs_pushoff
            left_means_mirror fractal_is_inherited
   seq startzip []
   seq touch_n_4 [inherit_left insert_number 3 inherit_fractal]

call "_as you are, centers push off" dontshow tag ctrs_pushoff_as_are
            left_means_mirror fractal_is_inherited
   seq startzipasyouare []
   seq touch_n_4 [inherit_left insert_number 3 inherit_fractal]

call "_ends push off" dontshow tag ends_pushoff
            left_means_mirror fractal_is_inherited
   seq fanthetop [allow_forced_mod inherit_left inherit_fractal]
   seq hinge [allow_forced_mod inherit_left inherit_fractal]

call "_ends push off but @0" dontshow tag ends_pushoff_but
            left_means_mirror fractal_is_inherited
   seq fanthetop [allow_forced_mod inherit_left inherit_fractal]
   seq nullcall [mandatory_anycall]

call "push off" c4a
            left_means_mirror fractal_is_inherited
   crossconc ends_pushoff [inherit_left inherit_fractal]
             ctrs_pushoff [conc_demand_columns conc_force_columns conc_force_spots inherit_fractal]

call "push off but @0" c4a
            left_means_mirror fractal_is_inherited
   crossconc ends_pushoff_but [inherit_left inherit_fractal]
             ctrs_pushoff [conc_demand_columns conc_force_columns conc_force_spots inherit_fractal]

call "centers go as you are, push off" c4a
            left_means_mirror fractal_is_inherited
   crossconc ends_pushoff [inherit_left inherit_fractal]
             ctrs_pushoff_as_are [conc_demand_lines conc_force_columns conc_force_spots inherit_fractal]

call "central finish push off" c4a
            left_means_mirror fractal_is_inherited
   seq fanthetop [allow_forced_mod inherit_left inherit_fractal]
   seq hinge [allow_forced_mod inherit_left inherit_fractal]

call "countershake part 1" dontshow tag countershake_1
            left_means_mirror single_is_inherited
            mxn_is_inherited nxn_is_inherited bigmatrix_is_inherited
   maybe_nxn_1331_lines_conc
      shakedown [inherit_left inherit_single inherit_nxn]
      quarter_right [inherit_left conc_force_spots]

call "countershake part 2" dontshow tag countershake_2
            left_means_mirror single_is_inherited mxn_is_inherited nxn_is_inherited bigmatrix_is_inherited
   maybe_nxn_1331_lines_conc
      lft_veer_left [inherit_left inherit_single inherit_nxn]
      ctr_rot [conc_force_otherway]

call "countershake part 3" dontshow tag countershake_3
            left_means_mirror
   setup qtag 2x4
      array [0 0 0 0 0 0 ZM0N ZM1N]
   setup pqtag 2x4
      array [CR2E CR3E 0 0 0 0 0 0]
   setup bone 2x4
      array [0 0 0 0 0 0 ZM0N ZM1N]
   setup bone 2x4 rotate
      array [CR7N 0 0 0 0 CR6N 0 0]
            alternate_definition [single] c4
   setup dmd 2x2
      array [CR0E 0 0 0]
   setup pmd 2x2
      array [0 ZM1N 0 0]
            alternate_definition [3x3 12matrix] c4
   setup 3dmd 2x6
      array [0 0 0 0 0 0 0 0 0 ZM0N ZM1N ZM2N]
   setup p3dmd 2x6
      array [CR3E CR4E CR5E 0 0 0 0 0 0 0 0 0]
            alternate_definition [4x4 16matrix] c4
   setup 4dmd 2x8
      array [0 0 0 0 0 0 0 0 0 0 0 0 ZM0N ZM1N ZM2N ZM3N]
   setup p4dmd 2x8
      array [CR4E CR5E CR6E CR7E 0 0 0 0 0 0 0 0 0 0 0 0]
            alternate_definition [1x3] c4
   setup 3x1dmd 2x4
      array [ZM0N ZM1N ZM2N 0 0 0 0 0]
   setup p3x1dmd 2x4
      array [0 0 0 CR3E 0 0 0 0]
   setup 3dmd 2x4   /* No longer used. */
      array [0 0 0 0 0 0 0 0 0 0 0 ZM0N]
   setup p3dmd 2x4  /* No longer used. */
      array [CR1E CR2E CR3E 0 0 0 0 0 0 0 0 0]
   setup 3x23 2x4   /* The real stuff. */
      array [0 0 0 0 0 0 0 ZM0N]
   setup p3x23 2x4
      array [CR1E CR2E CR3E 0 0 0 0 0]
            alternate_definition [3x1] c4    /* Same as 1x3. */
   setup 3x1dmd 2x4
      array [ZM0N ZM1N ZM2N 0 0 0 0 0]
   setup p3x1dmd 2x4
      array [0 0 0 CR3E 0 0 0 0]
   setup 3dmd 2x4   /* No longer used. */
      array [0 0 0 0 0 0 0 0 0 0 0 ZM0N]
   setup p3dmd 2x4  /* No longer used. */
      array [CR1E CR2E CR3E 0 0 0 0 0 0 0 0 0]
   setup 3x23 2x4
      array [0 0 0 0 0 0 0 ZM0N]
   setup p3x23 2x4
      array [CR1E CR2E CR3E 0 0 0 0 0]

call "countershake" c4
            left_means_mirror
   setup 4x2 2x4
      array [0 0 C1W C6W C7W C0W 0 0]
            alternate_definition [single] c4
   setup 4x1 2x2 qualifier out 2fl_only
      array [0 0 C3W C0W]
   setup 2x2 1x4 rotate qualifier out in_or_out
      array [C3S C2S 0 0]
            alternate_definition [3x3 12matrix] c4
   setup 4x3 2x6
      array [0 0 C2W C9W C10W C1W C11W C0W 0 0 0 0]
   setup 6x2 3x4
      array [0 0 0 C1W C11W C8W C9W C10W C0W 0 0 0]
            alternate_definition [4x4 16matrix] c4
   setup 4x4 2x8 rotate
      array [C7S C8S 0 C9S 0 0 0 0 0 0 C11S 0 C4S C5S C6S C10S]
   setup 8x2 4x4
      array [0 0 0 0 C13W C15W C11W C6W C8W C9W C10W C12W 0 0 0 0]
            alternate_definition [3x1] c4
   setup 4x2 3x4
      array [0 0 0 C11W C9W C10W C0W 0]
            alternate_definition [1x3] c4
   setup 4x2 3x4
      array [0 C1W C11W C8W C10W 0 0 0]
            alternate_definition [3x3 single] c4
   setup 6x1 2x3 rotate
      array [0 0 0 C3S C4S C5S]
            alternate_definition [4x4 single] c4
   setup 8x1 2x4 rotate
      array [0 0 0 0 C4S C5S C7S C6S]
            alternate_definition [rewind] c4
   setup 2x4 2x4
      array [0 0 A7E A0E A1E A6E 0 0]
            visible_fractions left_means_mirror single_is_inherited
            nxn_is_inherited mxn_is_inherited bigmatrix_is_inherited
   seq countershake_1 [inherit_left inherit_single inherit_nxn inherit_mxn inherit_bigmatrix]
   seq countershake_2 [inherit_left inherit_single inherit_nxn inherit_mxn inherit_bigmatrix]
   seq countershake_3 [inherit_left inherit_single inherit_nxn inherit_mxn inherit_bigmatrix]

call "triple scoot" a1 tag triple_scoot
   setup 4x2 2x4 restriction forbidden wave_only
      array [CM7S CM6S CM5S CR4S AL3S AM2S AM1S AM0S]
            alternate_definition [3x3] c4
   setup 6x2 2x6
      array [C11S C10S C9S C8S C7S C6S A5S A4S A3S A2S A1S A0S]
            alternate_definition [4x4] c4
   setup 8x2 2x8 restriction forbidden wave_only
      array [C15S C14S C13S C12S C11S C10S C9S C8S A7S A6S A5S A4S A3S A2S A1S A0S]
            alternate_definition [yoyo] c4
   setup 4x2 2x4 restriction forbidden wave_only
      array [CM0W CM1W CM2W CR4S AL3S AM5E AM6E AM7E]
            alternate_definition [half] a1
   setup 4x2 1x8 restriction wave_only
      array [CR3E CR6E CR5E CR4E AL4W AL5W AL6W AL3W]
            alternate_definition [lasthalf] a1
   setup 1x8 2x4
      array [CR0E CR1E CR2E AL0W AL3W AL2W AL1W CR3E]

call "triple cross" a1 tag triplecross
   // Check for the cases in which we can definitively
   // deduce the handedness of the center box.
   setup 4x2 2x4 qualifier right quarterbox
         array [ZM6N ZM5N ZM4N ZM3N ZM4N    0    0 ZM7N]
   setup 4x2 2x4 qualifier left quarterbox
         array [ZM0N    0    0 ZM3N ZM4N ZM3N ZM2N ZM1N]
   setup 4x2 2x4 restriction quarterbox_or_col qualifier live right gen_qbox
         array [ZM6N ZM5N ZM4N ZM3N ZM4N    0    0 ZM7N]
   setup 4x2 2x4 restriction quarterbox_or_col qualifier live left gen_qbox
         array [ZM0N    0    0 ZM3N ZM4N ZM3N ZM2N ZM1N]
   setup 4x2 2x4 restriction quarterbox_or_col
      preds "Don't know whether to cross."
         if columns_magic_tandem     [ZM0N ZM5N ZM2N ZM3N ZM4N ZM5N ZM2N ZM7N]
         if columns_magic_antitandem [ZM6N ZM5N ZM4N ZM3N ZM4N ZM3N ZM2N ZM1N]
         if columns_antitandem       [ZM0N ZM5N ZM4N ZM3N ZM4N ZM3N ZM2N ZM7N]
         if columns_tandem           [ZM6N ZM5N ZM4N ZM3N ZM4N ZM3N ZM2N ZM1N]
         if always                   [   0 ZM5N ZM4N ZM3N ZM4N ZM3N ZM2N    0]
   setup 2x4 2x4
      // Center of a line looking in can jay walk across the center,
      // as long as there are no ends looking in to tempt them to go the other way.
      array [ZM0N ZM1N ZM2N ZM3N 0 ZM1N ZM2N 0]
   // We can do it from certain parallelograms.
   setup 6x2 2x6 qualifier true_PG_cw
         array [0 0 0 0 0 0 0 0 ZM4N ZM3N ZM2N ZM11N]
   setup 6x2 2x6 qualifier true_PG_ccw
         array [ZM0N ZM9N ZM8N ZM7N 0 0 0 0 0 0 0 0]
            alternate_definition [single] c4
   setup pmd 2x2 qualifier right miniwaves
         array [ZM3N ZM2N 0 0]
   setup pmd 2x2 qualifier left miniwaves
         array [ZM0N 0 0 ZM1N]

call "double cross" a1
   setup 3x2 2x3
      preds "Don't know whether to cross."
         if columns_magic_tandem     [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N]
         if columns_magic_antitandem [ZM4N ZM3N ZM2N ZM3N ZM2N ZM1N]
         if always                   [   0    0 ZM2N ZM3N    0    0]

call "fancy" c3a tag fancy
   setup 4x2 2x4 restriction unusual wave_only
      array [CR2S CR5S CR3S CR4S AL3S AL4S AL2S AL5S]
            alternate_definition [magic] c3a
   setup 4x2 2x4 restriction unusual magic_only
      array [AL5S CR5S AL4S CR4S AL3S CR3S AL2S CR2S]
            alternate_definition [3x3] c4
   // Ambiguous!!!!!
   setup 6x2 3x4 restriction serious_violation alwaysfail
      array [CR2S CR5S CR7S CR3S CR4S CR6S AL3S AL4S AL6S AL2S AL5S AL7S]
            alternate_definition [4x4] c4
   setup 8x2 4x4 restriction serious_violation alwaysfail
      array [CR14S CR3S CR7S CR5S CR0S CR1S CR2S CR4S AL0S AL1S AL2S AL4S AL14S AL3S AL7S AL5S]
            alternate_definition [1x3] c4
   setup 4x2 qtag restriction serious_violation alwaysfail
      array [CR1S CR3S CR4S CR2S AL2S AL1S AL3S AL4S]
            alternate_definition [3x1] c4
   setup 4x2 3x4 restriction serious_violation alwaysfail
      array [CR5S CR3S CR4S CR6S AL3S AL4S AL6S AL5S]

call "_fancy but nothing" dontshow tag fancybut
   setup 4x2 qtag rotate restriction unusual wave_only
      array [ZM6W ZM7W CR0E CR1E AL0E AL1E ZM3W ZM2W]
            alternate_definition [magic] c3a
   setup 4x2 qtag rotate restriction unusual magic_only
      array [ZM2W ZM7W AL1E CR1E AL0E CR0E ZM3W ZM6W]

call "fancy but @0" c3a
            magic_is_inherited
   seq fancybut [inherit_magic]
   seq centers_mandatory_call []

call "scoot and fancy" c3a
            first_part_visible nxn_is_inherited bigmatrix_is_inherited
   seq triple_scoot [inherit_nxn inherit_bigmatrix]
   seq fancy [inherit_nxn inherit_bigmatrix]

call "_@k tie part 2" dontshow tag anyone_tie_2
   setup 2x4 c1phan
      preds "People must be selected/deselected together."
         if select_near_select_or_phantom [CR5S CR7S AL2S AL0S ZM5N  ZM7N ZM2N  ZM0N]
         if unselect_near_unselect        [CR1E CR3E AL6W AL4W AL11W AL9W CR12E CR14E]
   setup 1x4 2x2
      predscantdo
         if unselect [CR0E CR3E AL1W AL2W]
         if always   [0 0 0 0]

call "_@k tie part 3" dontshow tag anyone_tie_3
   setup c1phan c1phan
      predsnoselect
         if select   [CR1E 0 CR3E 0 0 AL4W 0 AL6W AL11W 0 AL9W 0 0 CR14E 0 CR12E]
         if unselect [CR5S 0 CR7S 0 0 AL0S 0 AL2S ZM5N  0 ZM7N 0 0 ZM0N  0 ZM2N]
   setup 2x4 c1phan
      preds "People must be selected/deselected together."
         if select_near_select_or_phantom [CR1E CR3E AL6W AL4W AL11W AL9W CR12E CR14E]
         if unselect_near_unselect        [CR5S CR7S AL2S AL0S ZM5N  ZM7N ZM2N  ZM0N]
   setup 2x2 2x2
      predscantdo
         if unselect [0 0 ZM1N ZM0N]
         if always   [0 0 0 0]

call "@k tie" c4a
// We put the array definition first.  See comments at recycle.
// This is needed for tests ne13 and ne18.
            yield_if_ambiguous
   setup 4x2 2x4
      preds "Tandems must be selected/deselected together."
         if select_near_select_or_phantom [AAL7W AAL6W AL1E AL0E CR7W CR6W CCR1E CCR0E]
         if unselect_near_unselect        [AM6E  AM7E  AM4E AM5E CM2W CM3W CM0W  CM1W]
   setup 2x2 2x2
      predscantdo
         if unselect [AM2E CM3W CM0W AM1E]
         if always   [0 0 0 0]
            alternate_definition [3x3] c4
   setup 6x2 2x6
      preds "Tandems must be selected/deselected together."
         if select_near_select_or_phantom [AAL11W AAL10W AAL9W AL2E  AL1E  AL0E
                                           CR11W  CR10W  CR9W  CCR2E CCR1E CCR0E]
         if unselect_near_unselect        [AM9E AM10E AM11E AM6E AM7E AM8E
                                           CM3W CM4W  CM5W  CM0W CM1W CM2W]
            alternate_definition [4x4] c4
   setup 8x2 2x8
      preds "Tandems must be selected/deselected together."
         if select_near_select_or_phantom [AAL15W AAL14W AAL13W AAL12W AL3E  AL2E  AL1E  AL0E
                                           CR15W  CR14W  CR13W  CR12W  CCR3E CCR2E CCR1E CCR0E]
         if unselect_near_unselect        [AM12E AM13E AM14E AM15E AM8E AM9E AM10E AM11E
                                           CM4W  CM5W  CM6W  CM7W  CM0W CM1W CM2W  CM3W]
            alternate_definition [cross] c4a
   setup 4x2 2x4
      preds "Tandems must be selected/deselected together."
         if select_near_select_or_phantom [CCR0E CCR1E CR6W CR7W AL0E AL1E AAL6W AAL7W]
         if unselect_near_unselect        [CM1W  CM0W  CM3W CM2W AM5E AM4E AM7E  AM6E]
   setup 2x2 2x2
      predscantdo
         if unselect [CM3W AM2E AM1E CM0W]
         if always   [0 0 0 0]
            alternate_definition [single] c4
   setup 2x2 2x2
      predscantdo
         if select [AL3E CR2W CR3E AL2W]
         if always [AM1E CM0W CM3W AM2E]
            alternate_definition [single cross] c4
   setup 2x2 2x2
      predscantdo
         if select [CR2W AL3E AL2W CR3E]
         if always [CM0W AM1E AM2E CM3W]
            dont_use_in_nice_resolve
            yield_if_ambiguous visible_fractions
            cross_is_inherited
   seq crossable_peeloff [seq_never_re_evaluate inherit_cross]
   seq anyone_tie_2 [seq_never_re_evaluate]
   seq anyone_tie_3 []

call "no one tie" c4a
            visible_fractions
            cross_is_inherited single_is_inherited nxn_is_inherited
   seq crossable_peeloff [inherit_cross inherit_single inherit_nxn]
   seq bendtheline       [inherit_single inherit_nxn]
   seq circulate         [inherit_single inherit_nxn]

call "everyone tie" c4a
            visible_fractions
            cross_is_inherited single_is_inherited nxn_is_inherited
   seq crossable_peeloff [inherit_cross inherit_single inherit_nxn]
   seq circulate         [inherit_single inherit_nxn]
   seq bendtheline       [inherit_single inherit_nxn]

call "circle four right 1/4" dontshow tag circle4right
            reverse_means_mirror
   setup 2x2 2x2
      array [0 0 AL1W AL2W]

call "circle two right 1/4" dontshow tag circle2right
            reverse_means_mirror
   setup 2x1 1x2 rotate
      array [AL1S 0]

call "circle 4 @eright@f @b" mainstream
            neednumber left_means_mirror
   seq circle4right [inherit_reverse repeat_n]

call "single circle @eright@f @b" mainstream
            neednumber left_means_mirror
   seq circle2right [inherit_reverse repeat_n]

call "circle to a line" mainstream
            reverse_means_mirror
   setup 4x2 2x4 rotate
      array [CR5W 0 CM3E 0 0 CM2E 0 CCAL4W]

call "expand the column" c3a
   setup 4x2 2x4 rotate
      array [ZM1W AL7E AL0E CM2E AM1E CR3E CR4E ZM2W]
   setup 2x4 2x4
      array [0 AL0S CR3S 0 0 CR4S AL7S 0]
            alternate_definition [magic] c3a
   setup 4x2 2x4 rotate
      array [ZM2W AL7E AL0E CM1E AM2E CR3E CR4E ZM1W]
            alternate_definition [single] c3
   setup pmd dmd rotate
      array [ZM1W AL0E 0 CR2E]
            alternate_definition [3x3] c3
   setup d4x3 d3x4 rotate
      array [ZM1W AL10E AL11E AL0E 0 0 0 CR4E CR5E CR6E ZM3W ZM2W]
            alternate_definition [4x4] c3
   setup 6x4 4x6 rotate
      array [ZM10W 0 0 0 0 0 0 AL0E AL11E AL18E AL17E ZM9W
            0 0 0 0 0 ZM7W ZM8W CR12E CR23E CR6E CR5E 0]

call "file to a line" c2
   setup 4x2 2x4 rotate
      array [ZM7W ZM1W CR2E ZM0W ZM3W AL1E ZM2W ZM4W]
            alternate_definition [magic] c2
   setup 4x2 2x4 rotate
      array [ZM7W ZM2W AL1E ZM0W ZM3W CR2E ZM1W ZM4W]

call "walk out to a wave" c2
   setup 4x2 2x4 rotate restriction wave_only
      array [ZM0W CR1E CM3E CR2W AL1W AM0E AL2E ZM3W]
            alternate_definition [magic] c2
   setup 4x2 2x4 rotate restriction magic_only
      array [ZM0W AL2E AM0E CR2W AL1W CM3E CR1E ZM3W]

call "walk out to a column" c4a
   setup 2x4 2x4 rotate restriction wave_only
      array [CM6E CM1E AM5E AM2E AL0E ZM0W ZM7W CR7E]
            alternate_definition [magic] c4a
   setup 2x4 2x4 rotate restriction wave_only
      array [CM6E CM1E AM5E AM2E AL7E ZM7W ZM0W CR0E]

call "_flip away for disband" dontshow tag disband2_ctr_to_end
   setup 2x2 2x2      // This is legal in a 2x2, of course,
      array [AL0S CR1S CR2S AL3S]
   setup 1x2 1x2      // and in a 1x2, in case we do a disband from a bone6,
      array [AL0S CR1S]
   setup 1x4 1x4      // but NOT in a 1x4.
      array [0 0 0 0]

call "_ends start disband" dontshow tag ends_disbp1
            fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq zoomok [force_half]
   seq armturn_n4 [insert_number 1 inherit_fractal inherit_gensting]

call "_disband part 1" dontshow tag disband1
   // By not putting a "conc_demand_columns" or "conc_demand_lines"
   // on this, we allow the call to be done from either setup.
            fractal_is_inherited gen_sting_is_inherited
   conc6p_or_normal splitctrrot [] ends_disbp1 [inherit_fractal inherit_gensting conc_force_columns endscando]

call "_disband part 2" dontshow tag disband2
   crossconc6p_or_normal disband_new_centers [] disband2_ctr_to_end [conc_force_lines]

call "_disperse part 2" dontshow tag disperse2
   crossconc6p_or_normal disband_new_centers [] trade [conc_force_lines]

call "_new centers disband" dontshow tag disband_new_centers
   setup 2x2 2x2 qualifier wave_only
      array [CM1S AM0S ZM1N ZM0N]
   setup 2x2 2x2 restriction unusual alwaysfail
      array [C1S A0S Z1N Z0N]
            alternate_definition [magic] c3
   simple_funny
   setup 2x2 2x2 restriction wave_only
      array [C0S A1S Z0N Z1N]

call "disband" c3
   setup 1x4 1x4
      array [0 0 0 0]
   // These are enormous crocks.  3x3 and 4x4 versions
   // of these calls can't follow the definition.
            alternate_definition [3x3] c4
   setup 3x4 3x4 rotate    // Need to put in restrictions, if anyone cares.
      array [AM2N CAL0S ACR9N CM7S CM5S ACR10N CM2S ACR0N CAL9S AM7N AM5N CAL10S]
            alternate_definition [4x4] c4
   setup 4x4 4x4 rotate    // Need to put in restrictions, if anyone cares.
      array [CM9W CM11W CM7W ACR13E CM2W ACR0E CAL12W ACR14E
             AM9E AM11E AM7E CAL13W AM2E CAL0W ACR12E CAL14W]
            fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq disband1 [inherit_fractal inherit_gensting]  // Generous/stingy won't actually work.
   seq disband2 []

call "disperse" c4x
            fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq disband1 [inherit_fractal inherit_gensting]
   seq disperse2 []   // We're just not going to deal with fractal/generous/stingy.

call "_start wind the bobbin" dontshow tag startstreaking
   setup 2x2 1x4 restriction unusual wave_only
      array [AL0S CR2S ZM3N ZM1N]
            alternate_definition [cross] c4a
   setup 2x2 1x4 restriction unusual wave_only
      array [CR2S AL0S ZM3N ZM1N]

call "_start criss cross wind the bobbin" dontshow tag startxxstreaking
   setup 2x2 1x4 restriction unusual wave_only
      array [CR2S AL0S ZM1N ZM3N]

// This is awfully close to ctrs_fanchainthru.  But we probably really
// do want to enforce a miniwave arm turn at the start.
call "_yoyo central spin the windmill" dontshow tag yoyoctrwindmill
            fractal_is_inherited gen_sting_is_inherited
   seq armturn_n4 [insert_number 3 inherit_fractal inherit_gensting]
   seq any_hand_slip [roll_transparent inherit_gensting]
   seq cast_off_n4_with_warn [insert_number 3 inherit_fractal inherit_gensting]

call "_yoyo central spin the windmill" dontshow tag yoyoctrwindmillbut
            fractal_is_inherited gen_sting_is_inherited
   seq armturn_n4 [insert_number 3 inherit_fractal inherit_gensting]
   seq any_hand_slip [roll_transparent inherit_gensting]
   seq nullcall [mandatory_anycall]

call "_finish wind the bobbin" dontshow tag finstreaking
            fractal_is_inherited gen_sting_is_inherited
   conc yoyoctrwindmill [inherit_fractal inherit_gensting]
        circ_n_times    [conc_demand_lines conc_force_spots insert_number 2]

call "_finish wind the bobbin but @0" dontshow tag finstreakingbut
            fractal_is_inherited gen_sting_is_inherited
   conc yoyoctrwindmillbut [inherit_fractal inherit_gensting]
        circ_n_times       [conc_demand_lines conc_force_spots insert_number 2]

call "wind the bobbin" c3a
            first_part_visible cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq startstreaking [inherit_cross]
   seq finstreaking [inherit_fractal inherit_gensting]

call "criss cross wind the bobbin" c4a
            first_part_visible fractal_is_inherited gen_sting_is_inherited
   seq startxxstreaking []
   seq finstreaking [inherit_fractal inherit_gensting]

call "wind the bobbin but @0" c3a
            first_part_visible cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq startstreaking [inherit_cross]
   seq finstreakingbut [inherit_fractal inherit_gensting]

call "criss cross wind the bobbin but @0" c4a
            first_part_visible fractal_is_inherited gen_sting_is_inherited
   seq startxxstreaking []
   seq finstreakingbut [inherit_fractal inherit_gensting]

call "REWIND wind the bobbin" c4
   setup 2x4 2x4 rotate
   array [3W 5W 2W 4W 6W 4E 3E 1W]

call "REWIND track 2" c4
   setup 2x4 2x4 rotate
   array [0 C1E 0 C6E C7E 0 C0E 0]

call "explosion" c4a
   setup 4x2 2x4 rotate restriction wave_only
      array [ZM0W CM5E CR3E CR2E AL1E AL0E AM6E ZM3W]

call "explode the@C clover" c4
            cross_is_inherited
   conc trade_and_roll [] clover [inherit_cross conc_demand_columns conc_force_columns endscando]

call "press for time" c4a
   setup 4x2 2x4 rotate restriction wave_only
      array [ZM7W ZM0W C5E C2E A1E A6E ZM3W ZM4W]
            alternate_definition [single] c4
   setup 2x2 1x4 restriction wave_only
      array [C3S A1S ZM2N ZM0N]
            alternate_definition [3x3] c4
   setup 6x2 3x4 rotate restriction wave_only
      array [ZM9W ZM10W ZM0W C7E C5E C2E A1E A11E A8E ZM3W ZM4W ZM6W]
            alternate_definition [4x4] c4
   setup 8x2 4x4 restriction wave_only
      array [ZM12N ZM13N ZM14N ZM0N C9S C11S C7S C2S A1S A3S A15S A10S ZM4N ZM5N ZM6N ZM8N]

call "_horseshoe centers" dontshow tag partnertag_w_cross
   setup 1x2 1x2           /* This is partner tag, of course. */
      array [CM1E AM0W]
            alternate_definition [funny] c2
   setup 2x2 2x2
      predscantdocallinsetup
         if 2x2_miniwave [CM1E AM0W AM3W CM2E]
         if 2x2_couple   [CM1E AM0W AM3W CM2E]
         if always       [ZM0N ZM1N ZM2N ZM3N]
            alternate_definition [cross] c4
   setup 2x2 2x2
      array [C2E A3W A0W C1E]
            alternate_definition [3x3] c4
   setup 2x6 2x6
      array [CM1E AM0W CM3E AM2W CM5E AM4W AM7W CM6E AM9W CM8E AM11W CM10E]
            alternate_definition [4x4] c4
   setup 2x8 2x8
      array [CM1E AM0W CM3E AM2W CM5E AM4W CM7E AM6W AM9W CM8E AM11W CM10E AM13W CM12E AM15W CM14E]
            alternate_definition [1x3] c4
   setup 1x4 1x4
      predscantdo
         if miniwave_side_of_in_3n1_line [AM0W CM2E CM2E AM0W]
         if couple_side_of_in_3n1_line   [CM1E CM3E AM3W AM1W]
            alternate_definition [3x1] c4    // Same as 1x3.
   setup 1x4 1x4
      predscantdo
         if miniwave_side_of_in_3n1_line [AM0W CM2E CM2E AM0W]
         if couple_side_of_in_3n1_line   [CM1E CM3E AM3W AM1W]

call "horseshoe turn" a1
            cross_is_inherited
   conc partnertag_w_cross [inherit_cross]
        clover             [inherit_cross conc_demand_columns conc_force_columns endscando]

call "with finesse" c4a
   setup 4x2 1x8
      array [0W 7E 1E 6W 6E 1W 7W 0E]
   setup 3x2 1x6
      array [0W 1E 5W 5E 1W 0E]

call "polly wally" c3a
            reverse_means_mirror
   setup 4x2 2x4 rotate
      array [CR5E CAM2W AM7E AL0E AL1E AM6E CAM3W CR4E]
            alternate_definition [single] c3a
   setup 4x1 2x2
      array [CR3S CAM2N AL1S AM0S]
            alternate_definition [grand single] c4
   setup 8x1 2x4
      array [CR7S CAM6N CAM5N AM0S AL3S AM2S AM1S CAM4N]
   setup 6x1 2x3
      array [CR5S CAM4N AM0S AL2S AM1S CAM3N]
            alternate_definition [3x3] c4
   setup 4x3 2x6 rotate
      array [CR8E CAM3W AM11E AL0E AL1E AM10E AL2E AM9E CAM5W CR6E CR7E CAM4W]
   setup 6x2 3x4 rotate
      array [0 0 0 A9E A10E A0E A1E A11E A8E 0 0 0]
            alternate_definition [4x4] c4
   setup 4x4 2x8
      array [AL3S AM12S CAM7N AM13S CR8S CR9S CR10S CAM6N
             CR11S CAM4N AM15S CAM5N AL0S AL1S AL2S AM14S]
   setup 8x2 4x4
      array [0 0 0 0 A12S A13S A14S A0S
             A1S A3S A15S A10S 0 0 0 0]
            alternate_definition [3x3 single] c4
   setup 6x1 2x3
      array [0 0 0 A2S A1S A0S]
            alternate_definition [4x4 single] c4
   setup 8x1 2x4
      array [0 0 0 0 A3S A2S A0S A1S]
            alternate_definition [1x2 single] c4
   setup 6x1 2x3 no_cutting_through
      predscantdo
         if antitandem_side_of_2n1_col [0   0 A0S A2S A1S 0]
         if tandem_side_of_2n1_col     [0 A0S A1S A2S   0 0]
   setup 3x2 short6 qualifier left dmd_ctrs_mwv
      array [0   0 A1S A3S A5S 0]
   setup 3x2 bone6 rotate qualifier right dmd_ctrs_mwv
      array [0 A4E A0E A2E   0 0]
            alternate_definition [2x1 single] c4   // Same as 1x2.
   setup 6x1 2x3 no_cutting_through
      predscantdo
         if antitandem_side_of_2n1_col [0   0 A0S A2S A1S 0]
         if tandem_side_of_2n1_col     [0 A0S A1S A2S   0 0]
   setup 3x2 short6 qualifier left dmd_ctrs_mwv
      array [0   0 A1S A3S A5S 0]
   setup 3x2 bone6 rotate qualifier right dmd_ctrs_mwv
      array [0 A4E A0E A2E   0 0]

call "_sidetrack part 1" dontshow tag sidetrack1
            reverse_means_mirror
   /* We put this in to give the "unusual" warning if called from lines. */
   setup 2x4 2x4 restriction unusual alwaysfail
      array [CR0E CR1E CR2E CR3E AL4W AL5W AL6W AL7W]
   /* Having done that, we need this (without the warning) to
      keep things happy in a T-boned 2x4. */
   setup 4x2 2x4
      array [AL0W CR1E AL2W CR3E CR4E AL5W CR6E AL7W]
   setup 4x1 1x4        /* This is just zig zag, of course. */
      array [AL0W CR1E CR2E AL3W]
   setup 2x2 2x2        /* This is just zig zag, of course. */
      array [CR0E CR1E AL2W AL3W]
   setup 2x1 1x2        /* This is just zig zag, of course. */
      array [AL0W CR1E]
   setup crosswave crosswave
      array [0 0 CR2E AL3W 0 0 AL6W CR7E]
   setup pcrosswave crosswave
      array [AL0W CR1E 0 0 CR4E AL5W 0 0]
   setup thar thar
      array [0 0 CR2E AL3W 0 0 AL6W CR7E]
            alternate_definition [single] c3
   setup 4x1 1x4        /* This is just zig zag, of course. */
      array [AL0W CR1E CR2E AL3W]
            alternate_definition [3x3] c4
   setup 4x3 3x4
      array [AL0W CR1E AL2W CR3E CR4E AL5W CR6E AL7W CR8E AL9W AL10W CR11E]
            alternate_definition [4x4] c4
   setup 4x4 4x4
      array [CR0E AL1W CR2E  AL3W  AL4W  AL5W  AL6W  CR7E
             AL8W CR9E AL10W CR11E CR12E CR13E CR14E AL15W]

call "_split sidetrack part 1" dontshow tag splitsidetrack1
            reverse_means_mirror
   setup 2x2 2x2
      array [CR0E CR1E AL2W AL3W]
   setup 4x1 1x4
      array [AL0W CR1E CR2E AL3W]
   setup 2x1 1x2
      array [AL0W CR1E]
            alternate_definition [single] c3
   setup 2x1 1x2
      array [AL0W CR1E]
            alternate_definition [3x3] c4
   setup 2x3 2x3 restriction forbidden 3x3couples_only
      array [CR0E CR1E CR2E AL3W AL4W AL5W]
            alternate_definition [4x4] c4
   setup 2x4 2x4 restriction forbidden 4x4couples_only
      array [CR0E CR1E CR2E CR3E AL4W AL5W AL6W AL7W]

call "sidetrack" c3
            reverse_means_mirror single_is_inherited
            nxn_is_inherited mxn_is_inherited bigmatrix_is_inherited visible_fractions
   seq sidetrack1 [inherit_reverse inherit_single inherit_nxn inherit_mxn]
   seq ctr_rot_for_sidetrack [inherit_single inherit_nxn inherit_mxn inherit_bigmatrix]
   seq roll []

call "split sidetrack" c3
            reverse_means_mirror single_is_inherited
            nxn_is_inherited mxn_is_inherited bigmatrix_is_inherited visible_fractions
   splitseq splitsidetrack1 [inherit_reverse inherit_single inherit_nxn inherit_mxn inherit_bigmatrix]
   seq ctr_rot_for_splitsidetrack [inherit_single inherit_nxn inherit_mxn inherit_bigmatrix]
   seq roll []

call "more or less sidetrack" c4
            reverse_means_mirror
   setup 4x2 2x4 rotate
      array [ACR0W CAL5E AL6E CR3W CR4W AL1E CAL2E ACR7W]

call "less or more sidetrack" c4
            reverse_means_mirror
   setup 4x2 2x4 rotate
      array [ACR0E CAL5W AL6W CR3E CR4E AL1W CAL2W ACR7E]

call "more or less split sidetrack" c4
            reverse_means_mirror
   setup 2x2 2x2
      array [CR1N CR2N ACR3N ACR0N]

call "less or more split sidetrack" c4
            reverse_means_mirror
   setup 2x2 2x2
      array [CR1S CR2S ACR3S ACR0S]

call "_roll twice" dontshow tag rolltwice
   setup 1x1 1x1
      preds "Can't determine roll direction"
         if roll_is_cw  [CR0S]
         if roll_is_ccw [AL0S]

call "_more or less roll twice" dontshow tag morelessrolltwice
   select_leads rolltwice [] nullcall []

call "_less or more roll twice" dontshow tag lessmorerolltwice
   select_leads nullcall [] rolltwice []

call "more or less stack the wheel" c4
            visible_fractions single_is_inherited nxn_is_inherited mxn_is_inherited
   seq hinge [cpls_unless_single seq_never_re_evaluate]
   seq morelessrolltwice []

call "less or more stack the wheel" c4
            visible_fractions single_is_inherited nxn_is_inherited mxn_is_inherited
   seq hinge [cpls_unless_single seq_never_re_evaluate]
   seq lessmorerolltwice []

call "slim down" c4a tag slimdown
   setup 2x4 2x4 rotate
      array [ZM6W ZM7W ZM0W ZM1W ZM2W ZM3W ZM4W ZM5W]
   setup 4x2 2x4 rotate
      array [ZM6W ZM7W ZM0W ZM1W ZM2W ZM3W ZM4W ZM5W]
   setup 4x4 4x4
      predscantdocallinsetup
         if quad_person_cw  [0 ZM3N ZM7N ZM14N 0 ZM7N ZM11N ZM2N 0 ZM11N ZM15N ZM6N 0 ZM15N ZM3N ZM10N]
         if quad_person_ccw [0 ZM3N ZM7N ZM1N  0 ZM7N ZM11N ZM5N 0 ZM11N ZM15N ZM9N 0 ZM15N ZM3N ZM13N]
         if always          [0 ZM3N ZM7N    0  0 ZM7N ZM11N    0 0 ZM11N ZM15N    0 0 ZM15N ZM3N     0]
            alternate_definition [single] c4
   setup dmd dmd rotate
      array [ZM3W ZM0W ZM1W ZM2W]
   setup pmd dmd rotate
      array [ZM3W ZM0W ZM1W ZM2W]
            alternate_definition [3x3] c4
   setup 2x6 2x6 rotate
      array [ZM9W ZM10W ZM11W ZM0W ZM1W ZM2W ZM3W ZM4W ZM5W ZM6W ZM7W ZM8W]
   setup 6x2 2x6 rotate
      array [ZM9W ZM10W ZM11W ZM0W ZM1W ZM2W ZM3W ZM4W ZM5W ZM6W ZM7W ZM8W]
            alternate_definition [4x4] c4
   setup 2x8 2x8 rotate
      array [ZM12W ZM13W ZM14W ZM15W ZM0W ZM1W ZM2W  ZM3W
             ZM4W  ZM5W  ZM6W  ZM7W  ZM8W ZM9W ZM10W ZM11W]
   setup 8x2 2x8 rotate
      array [ZM12W ZM13W ZM14W ZM15W ZM0W ZM1W ZM2W  ZM3W
             ZM4W  ZM5W  ZM6W  ZM7W  ZM8W ZM9W ZM10W ZM11W]

call "substitute" c1
            dont_use_in_nice_resolve
   setup 4x2 2x4
      array [ZM1N ZM0N ZM3N ZM2N ZM5N ZM4N ZM7N ZM6N]
   setup ptrngl trngl
      array [ZM3N ZM5N ZM4N ZM0N ZM2N ZM1N]
   setup trngl trngl
      array [ZM3N ZM5N ZM4N ZM0N ZM2N ZM1N]
            alternate_definition [half] c1
   setup 4x2 2x4 rotate
      array [ZM6W ZM7W ZM1W ZM0W ZM3W ZM2W ZM4W ZM5W]
   setup ptrngl 1x3
      array [ZM1N ZM0N ZM2N ZM1N ZM2N ZM0N]
   setup trngl 1x3
      array [ZM1N ZM0N ZM2N ZM1N ZM2N ZM0N]
            alternate_definition [twisted] c4
   setup 4x2 2x4 rotate
      array [AM7S AM6S CM1N CM0N AM3S AM2S CM5N CM4N]

call "lateral substitute" c2
            dont_use_in_nice_resolve
   setup 2x4 2x4
      array [ZM1N ZM0N ZM3N ZM2N ZM5N ZM4N ZM7N ZM6N]
   setup 4x2 2x4
      array [ZM1N    0    0 ZM2N ZM5N    0    0 ZM6N]
   setup ptrngl trngl
      array [ZM3N ZM5N ZM4N ZM0N ZM2N ZM1N]
   setup trngl trngl
      array [   0 ZM5N ZM4N    0 ZM2N ZM1N]
   setup rigger bone
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup bone rigger
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
            alternate_definition [half] c2
   setup ptrngl 1x3
      array [ZM1N ZM0N ZM2N ZM1N ZM2N ZM0N]
   setup trngl 1x3
      array [   0 ZM0N ZM2N    0 ZM2N ZM0N]
   setup 2x4 2x4 rotate
      array [ZM6W ZM7W ZM0W ZM1W ZM2W ZM3W ZM4W ZM5W]
   setup 4x2 2x4 rotate
      array [ZM6W    0    0 ZM1W ZM2W    0    0 ZM5W]
            alternate_definition [twisted] c4
   setup 2x4 2x4 rotate
      array [AM7S AM6S CM1N CM0N AM3S AM2S CM5N CM4N]
   setup 4x2 2x4 rotate
      array [AM7S    0    0 CM0N AM3S    0    0 CM4N]

call "triangle substitute" c1
            dont_use_in_nice_resolve
   setup ptrngl trngl
      array [ZM3N ZM5N ZM4N ZM0N ZM2N ZM1N]
   setup trngl trngl
      array [ZM3N ZM5N ZM4N ZM0N ZM2N ZM1N]
            alternate_definition [half] c2
   setup ptrngl 1x3
      array [ZM1N ZM0N ZM2N ZM1N ZM2N ZM0N]
   setup trngl 1x3
      array [ZM1N ZM0N ZM2N ZM1N ZM2N ZM0N]

call "step and slide" a1
   setup 1x4 2x3 rotate
      array [ZM4W ZM5W ZM1W ZM0W]
   setup 1x3 trngl
      array [ZM5N ZM3N ZM4N]
   setup pqtag rigger
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N 0 0]
            alternate_definition [3x3] c4
   // We can't handle the esoteric aspects of these.
   setup 1x6 2x3 rotate qualifier all_facing_same
      array [ZM3W ZM4W ZM5W ZM2W ZM1W ZM0W]
            alternate_definition [4x4] c4
   setup 1x8 2x4 rotate qualifier all_facing_same
      array [ZM4W ZM5W ZM7W ZM6W ZM3W ZM2W ZM0W ZM1W]

call "REWIND step and slide" c4
            split_large_setups
   setup 4x2 2x4 rotate
      array [ZM6W ZM7W ZM0W 0 0 ZM3W ZM4W ZM5W]
   setup 3x2 1x4 rotate qualifier true_Z_cw
      array [0    ZM0W 0 0 ZM2W ZM3W]
   setup 3x2 1x4 rotate qualifier true_Z_ccw
      array [ZM1W ZM0W 0 0 ZM2W 0]

call "step and flip" c1
   setup 1x4 2x3 rotate
      array [CR4E ZM5W AL1E ZM0W]
   // This is weird, but it occurs in test ng03t.
   setup 1x3 1x2 rotate qualifier wave_only restriction unusual alwaysfail
      array [CR0E ZM0W AL0E]

call "step and squeeze" c2
   setup 1x4 2x3 rotate
      array [CR1E ZM5W AL4E ZM0W]

call "lickety split" c3
   simple_funny
   setup 2x4 2x4
      array [CR1S AL0W CR3E AL2S ZM3N CR2E AL1W ZM0N]
   setup 4x2 2x4
      array [ZM1N CR6E CR3E CR4S AL3S AL4W AL1W ZM6N]

call "INVERT lickety split" c4
   simple_funny
   setup 2x4 2x4
      array [CR1E AL0S CR3S AL2W AL3W ZM2N ZM1N CR0E]
   setup 4x2 2x4
      array [CR1E CR6S ZM3N CR4E AL3W ZM4N AL1S AL6W]

call "_half circ prefer real box" dontshow tag half_circ_real_box
            take_right_hands left_means_mirror
   simple_funny
   setup 2x2 dmd rotate no_cutting_through really_want_diamond
      array [CR0N AL0S ZM1W ZM3W]
   setup 4x2 spindle qualifier wave_only
      array [ZM0N ZM1N ZM2N CR3E AL3W ZM4N ZM5N ZM6N]
   setup 4x2 spindle
      array [ZM0N ZM1N ZM2N CR3E AL3W ZM4N ZM5N ZM6N]
   setup 3x2 short6 rotate no_cutting_through
      array [ZM5W ZM0W CR1N AL1S ZM2W ZM3W]

call "circulate" mainstream tag circulate
            take_right_hands left_means_mirror diamond_is_legal
   simple_funny
   setup 2x4 2x4
      array [CR3S CR2S AL1S AL0S ZM3N ZM2N ZM1N ZM0N]
   setup 4x2 2x4
      array [ZM1N ZM2N ZM3N CR4S AL3S ZM4N ZM5N ZM6N]
   setup 2x3 2x3 no_cutting_through
      array [CR2S 0 AL0S ZM2N ZM1N ZM0N]
   setup 3x2 2x3 no_cutting_through
      array [ZM1N ZM2N CR3S AL2S ZM3N ZM4N]
   setup 2x2 2x2 no_cutting_through
      array [CR1S AL0S ZM1N ZM0N]
   setup 2x1 1x2
      array [ZM1N 0]
   setup 3x1 1x3
      array [ZM1N ZM2N 0]
   // Unfortunately, this will allow "circulate" to work from parallel
   // stars.  But we need to be able to say "ends circulate" in a galaxy.
   setup star star
      array [CR1E 0 AL1W 0]
   setup short6 short6 qualifier didnt_say_triangle
      array [CR1E 0 AL1W ZM2N 0 ZM0N]
   setup pshort6 short6 qualifier didnt_say_triangle
      predscantdocallinsetup
         if next62spot_is_tboned [ZM1N CR2E CR3S AL2S AL3W ZM4N]
         if always               [ZM1N ZM2N CR3S AL2S ZM3N ZM4N]
   setup trngl trngl qualifier said_triangle
      array [0 CR2S AL1S 0 AL3W CR3E]
   setup ptrngl trngl qualifier said_triangle
      predscantdocallinsetup
         if nexttrnglspot_is_tboned [AL2W ZM2N CR0S CR4E AL3S ZM4N]
         if always                  [AL2S ZM2N CR0S CR4S AL3S ZM4N]
   setup spindle spindle qualifier didnt_say_triangle
      array [0 0 0 AL2W 0 0 0 CR0E]
   setup pspindle spindle qualifier didnt_say_triangle
      array [ZM1N ZM2N CR3E 0 AL3W ZM4N ZM5N 0]
   setup galaxy galaxy qualifier said_galaxy
      predscantdocallinsetup
         if next_galaxyspot_is_tboned [R1E R2E 0 L2W L3W M4N 0 M0N]
         if always [M1N R2E 0 L2W M3N M4N 0 M0N]

   setup beehive beehive
      array [CR1E 0 AL1W ZM2N ZM0N ZM9N 0 ZM8N CR9S AL8S]
   setup pbeehive beehive
      array [0 CR2E 0 0 0 0 AL5W 0 0 0]
   setup vee vee restriction controversial alwaysfail
      array [ZM1N CR2E 0 AL2W ZM3N AL9S ZM5N 0 ZM9N CR5S]
   setup pvee vee restriction controversial alwaysfail
      array [0 0 CR3E 0 0 0 0 AL6W 0 0]

   /* These are for Clark. */
   /*   Sorry.  Breaks t34t, t37t,
   setup 1x4 1x4 restriction controversial alwaysfail
      array [CR2S CR3S AL0S AL1S]
   setup 1x8 1x8 restriction controversial alwaysfail
      array [CR4S CR5S CR6S CR7S AL0S AL1S AL2S AL3S]
   setup 1x2 1x2 restriction controversial alwaysfail
      array [CR1S AL0S]
   */
   // We allow these if the caller said something like "triple diamonds".
   setup dmd dmd qualifier said_diamond restriction forbidden diamond_like
      array [CR1E 0 AL1W 0]
   setup pmd dmd qualifier said_diamond restriction forbidden diamond_like
      array [0 CR2E 0 AL2W]
            alternate_definition [diamond] plus
   // Or if the "diamond" concept was given explicitly, though we expect callers
   // to use the call "diamond circulate" and make this unnecessary.
   setup dmd dmd restriction forbidden diamond_like
      array [CR1E 0 AL1W 0]
   setup pmd dmd restriction forbidden diamond_like
      array [0 CR2E 0 AL2W]
            alternate_definition [magic] c1
   simple_funny
   setup 4x2 2x4
      array [ZM6N ZM2N ZM4N CR4S AL3S ZM3N ZM5N ZM1N]
   setup 3x2 2x3 no_cutting_through
      array [ZM4N ZM3N CR3S AL2S ZM2N ZM1N]
   setup pshort6 short6 qualifier didnt_say_triangle
      predscantdocallinsetup
         if next_magic62spot_is_tboned [ZM4N ZM3N CR3S AL2S ZM2N ZM1N]
         if always [ZM4N ZM3N CR3S AL2S ZM2N ZM1N]
   setup spindle spindle qualifier didnt_say_triangle
      array [0 0 0 AL2W 0 0 0 CR0E]
   setup pspindle spindle qualifier didnt_say_triangle
      array [ZM5N ZM4N CR3E 0 AL3W ZM2N ZM1N 0]
            alternate_definition [12matrix] c3a
   simple_funny
   setup 3x4 3x4
      array [CR3S CR2S AL1S AL0S ZM3N ZM2N ZM4N ZM5N ZM11N ZM10N ZM0N ZM1N]
   setup 2x6 2x6
      array [CR5S CR4S CR3S AL2S AL1S AL0S ZM5N ZM4N ZM3N ZM2N ZM1N ZM0N]
   setup 6x2 2x6
      array [ZM1N ZM2N ZM3N ZM4N ZM5N CR6S AL5S ZM6N ZM7N ZM8N ZM9N ZM10N]
            alternate_definition [12matrix half] c3a
   setup 2x6 1x8 rotate
      array [CR0N CR1N CR3N AL3S AL1S AL0S 0 0 0 0 0 0]
   setup 6x2 1x8 rotate
      array [0 0 ZM2W 0 0 0 0 0 0 ZM6W 0 0]
   setup 3x4 deepxwv rotate
      array [CR0N CR1N AL1S AL0S ZM2W ZM3W ZM11W ZM10W ZM9W ZM8W ZM5W ZM4W]
            alternate_definition [16matrix] c3a
   simple_funny
   setup 4x4 4x4
      array [AL12S ZM0N ZM1N ZM14N ZM2N ZM7N ZM11N ZM3N
             ZM9N ZM10N ZM12N ZM15N CR0S CR14S AL13S ZM13N]
   setup 2x8 2x8
      array [CR7S CR6S CR5S CR4S AL3S AL2S AL1S AL0S
             ZM7N ZM6N ZM5N ZM4N ZM3N ZM2N ZM1N ZM0N]
   setup 8x2 2x8
      array [ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N CR8S
             AL7S ZM8N ZM9N ZM10N ZM11N ZM12N ZM13N ZM14N]
            alternate_definition [half] mainstream
   simple_funny
   // If user said "assume facing lines" or
   // "assume back-to-back lines", use these:
   setup 2x4 1x8 rotate qualifier explicit out in_or_out
      array [CR0N CR3N AL2S AL1S 0 0 0 0]
   setup 2x4 1x8 qualifier explicit in in_or_out
      array [0 0 0 0 ZM5N ZM6N ZM3N ZM0N]
   // Otherwise, use the usual interpretation.
   setup 2x4 crosswave rotate
      array [CR0N CR1N AL1S AL0S ZM2W ZM3W ZM7W ZM6W]
   // Handle similar things for 2x2 facing in or out.
   setup 2x2 1x4 qualifier explicit in in_or_out no_cutting_through
      array [0 0 ZM3N ZM0N]
   setup 2x2 1x4 rotate qualifier explicit out in_or_out
      array [CR0N AL1S 0 0]
   // Otherwise, use the usual interpretation.
   setup 2x2 dmd rotate no_cutting_through
      array [CR0N AL0S ZM1W ZM3W]
   setup 2x1 1x2 rotate
      array [ZM0W 0]
   // If the setup is an actual trade by (or, more significantly,
   // has been declared as such by an "assume" operation), the
   // collision stuff might not work in the presence of phantoms,
   // so people won't take right hands.  So we take matters into
   // our own hands, and define it going to a right-handed crossed
   // wave.  But, before we do that, we present the old definition
   // qualified for normal columns.  So we only do the trade-by-only
   // definition if the setup can't be normal columns, and can be
   // a trade by.
   setup 4x2 spindle qualifier wave_only
      array [ZM0N ZM1N ZM2N CR3E AL3W ZM4N ZM5N ZM6N]
   setup 4x2 crosswave qualifier ntbone out in_or_out
      array [0 ZM2N 0 CR4E AL5W 0 ZM7N 0]
   setup 4x2 2x4 rotate qualifier ntbone in in_or_out
      array [ZM7W 0 ZM0W 0 0 ZM2W 0 ZM5W]
   setup 4x2 spindle
      array [ZM0N ZM1N ZM2N CR3E AL3W ZM4N ZM5N ZM6N]
   setup c1phan crosswave rotate
      array [CR0N 0 CR1N 0 0 AL0S 0 AL1S ZM2W 0 ZM3W 0 0 ZM6W 0 ZM7W]
   setup 2x3 1x3 qualifier in in_or_out
      array [0 0 0 ZM2N ZM1N ZM0N]
   setup 2x3 1x2dmd rotate qualifier right wave_only
      array [CR0N 0 AL1S 0 ZM5W 0]
   setup 2x3 2x1dmd
      array [CR2E 0 AL2W ZM3N ZM1N ZM0N]
   setup 3x2 short6 rotate no_cutting_through
      array [ZM5W ZM0W CR1N AL1S ZM2W ZM3W]
   setup pshort6 short6 other_elongate rotate
      array [ZM5W ZM0W CR1N AL1S ZM2W ZM3W]
   setup short6 1x2 qualifier didnt_say_triangle
      array [0 0 0 ZM1N 0 ZM0N]
   /* These are for Clark. */
   setup 1x2 1x2 rotate qualifier miniwaves restriction controversial alwaysfail
      array [CR0N AL0S]
   setup 1x4 1x4 rotate restriction controversial alwaysfail
      array [CR0N CR1N AL0S AL1S]
   setup 1x6 1x6 rotate restriction controversial alwaysfail
      array [CR0N CR1N CR2N AL0S AL1S AL2S]
   setup 1x8 1x8 rotate restriction controversial alwaysfail
      array [CR0N CR1N CR2N CR3N AL0S AL1S AL2S AL3S]
            alternate_definition [lasthalf] mainstream
   setup pspindle 2x4
      array [ZM1N ZM2N ZM3N 0 ZM4N ZM5N ZM6N 0]
   setup spindle 2x4
      array [0 0 0 AL3W 0 0 0 CR0E]
            alternate_definition [twisted half] c4
   simple_funny
   setup 2x4 crosswave rotate
      array [CR0N CR1N AL1S AL0S ZM2W ZM3W ZM7W ZM6W]
   setup 2x2 dmd rotate no_cutting_through
      array [CR0N AL0S ZM1W ZM3W]
   setup 2x1 1x2 rotate
      array [ZM0W 0]
   setup 4x2 spindle
      array [ZM0N ZM1N ZM2N CR3E AL3W ZM4N ZM5N ZM6N]
   setup 3x2 short6 rotate no_cutting_through
      array [ZM5W ZM0W CR1N AL1S ZM2W ZM3W]
   setup pshort6 short6 other_elongate rotate
      array [ZM5W ZM0W CR1N AL1S ZM2W ZM3W]
   /* These are for Clark. */
   setup 1x2 1x2 rotate qualifier miniwaves restriction controversial alwaysfail
      array [CR0N AL0S]
   setup 1x4 1x4 rotate restriction controversial alwaysfail
      array [CR0N CR1N AL0S AL1S]
   setup 1x6 1x6 rotate restriction controversial alwaysfail
      array [CR0N CR1N CR2N AL0S AL1S AL2S]
   setup 1x8 1x8 rotate restriction controversial alwaysfail
      array [CR0N CR1N CR2N CR3N AL0S AL1S AL2S AL3S]
            alternate_definition [magic half] c1
   simple_funny
   setup 4x2 spindle
      array [ZM0N ZM1N ZM4N CR3E AL3W ZM2N ZM5N ZM6N]
   setup 3x2 short6 rotate no_cutting_through
      array [ZM5W ZM2W CR1N AL1S ZM0W ZM3W]
            alternate_definition [twisted] c4
   setup 2x1 1x2 rotate
      array [CM1N 0]
            alternate_definition [inroll] a2
   setup 2x4 2x4 qualifier inroller_is_cw
      array [CR1S CR2S CR3S    0    0 AL6S AL7S ZM0N]
   setup 2x4 2x4 qualifier inroller_is_ccw
      array [   0 AL0S AL1S AL2S ZM3N CR4S CR5S    0]
   // Catch the hard cases.
   setup 2x4 2x4
      predscantdocallinsetup
         if inroller_is_cw [CR1S CR2S CR3S    0    0 AL6S AL7S ZM0N]
         if always         [   0 AL0S AL1S AL2S ZM3N CR4S CR5S    0]
   setup 2x3 2x3
      predscantdocallinsetup
         if inroller_is_cw_2x3 [CR1S CR2S    0    0 AL5S ZM0N]
         if always             [   0 AL0S AL1S ZM2N CR3S    0]
            alternate_definition [outroll] a2
   setup 2x4 2x4 qualifier outroller_is_cw
      array [   0 CR2S CR3S AL0S AL5S AL6S AL7S    0]
   setup 2x4 2x4 qualifier outroller_is_ccw
      array [CR3S AL0S AL1S    0    0 CR4S CR5S CR6S]
   // Catch the hard cases.
   setup 2x4 2x4
      predscantdocallinsetup
         if outroller_is_cw [   0 CR2S CR3S AL0S AL5S AL6S AL7S    0]
         if always          [CR3S AL0S AL1S    0    0 CR4S CR5S CR6S]
   setup 2x3 2x3
      predscantdocallinsetup
         if outroller_is_cw_2x3 [   0 CR2S AL0S AL4S AL5S    0]
         if always              [CR2S AL0S    0    0 CR3S CR4S]
            alternate_definition [splittrade] c2
   simple_funny
   setup 2x2 2x2 restriction magic_only
      array [CR1S AL0S ZM0N ZM1N]
            alternate_definition [bias] c3a
   setup 2x4 2x4 restriction unusual wave_only
      array [CR3S CR2S AL1S AL0S ZM1N ZM0N ZM3N ZM2N]
   setup 4x2 2x4 restriction unusual alwaysfail
      array [   0 ZM2N    0 CR4S AL3S    0 ZM5N    0]
            alternate_definition [biastrade] c4
   setup 2x4 2x4 restriction wave_only
      array [CR2S CR3S AL0S AL1S ZM0N ZM1N ZM2N ZM3N]
            alternate_definition [orbit] c4
   setup 2x4 2x4 restriction wave_only
      array [CR2S CR3S CR4N CR5N ZM2N ZM3N ZM0N ZM1N]
            alternate_definition [crossover] a1
   setup 2x4 2x4
      array [CR2S CR3S AL0S AL1S ZM2N ZM3N ZM0N ZM1N]
   setup 4x2 2x4
      array [6N 5N 4N 0 0 3N 2N 1N]
            alternate_definition [twinorbit] c4
   setup 2x4 2x4 restriction wave_only
      array [AL6N AL7N CR4N CR5N ZM2N ZM3N ZM0N ZM1N]
            alternate_definition [rotary] c4a
   setup 2x4 2x4 restriction wave_only
      array [CR5N AL4N CR7N AL6N AM1N CM0N AM3N CM2N]
            alternate_definition [scatter] c3a
   setup 2x4 2x4 restriction 2fl_only
      array [CR1S CR3S AL0S AL2S ZM3N ZM1N ZM2N ZM0N]
   setup 4x2 2x4
      array [ZM1N ZM5N ZM4N CR4S AL3S ZM3N ZM2N ZM6N]
            alternate_definition [zoomroll] c4
   setup 2x4 2x4 qualifier outroller_is_cw
      array [   0 CR2S CR3S CR4N AL5S AL6S AL7S    0]
   setup 2x4 2x4 qualifier outroller_is_ccw
      array [AL7N AL0S AL1S    0    0 CR4S CR5S CR6S]
   // Catch the hard cases.
   setup 2x4 2x4
      predscantdocallinsetup
         if outroller_is_cw [   0 CR2S CR3S CR4N AL5S AL6S AL7S    0]
         if always          [AL7N AL0S AL1S    0    0 CR4S CR5S CR6S]
   setup 2x3 2x3
      predscantdocallinsetup
         if outroller_is_cw_2x3 [   0 CR2S CR3N AL4S AL5S    0]
         if always              [AL5N AL0S    0    0 CR3S CR4S]
            alternate_definition [12matrix] c3
   setup 2x6 2x6
      predscantdocallinsetup
         if outroller_is_cw_2x6 [    0 CR2S CR3S  CR4S  CR5S  CR6N
                                  AL7S AL8S AL9S AL10S AL11S     0]
         if always              [AL11N AL0S AL1S  AL2S  AL3S     0
                                     0 CR6S CR7S  CR8S  CR9S CR10S]



call "circulate for tally ho" dontshow tag circulate_for_tally_ho
            take_right_hands left_means_mirror
   // The obvious mechanism of making this call have the "half" built in doesn't
   // handle "left tally ho" correctly.  Not sure why.  Maybe there is a fundamental
   // problem.  But no time to investigate just now.  So the full version exists and
   // is illegal, and only the half versions exist.
   simple_funny
   setup 2x4 2x4
      array [0 0 0 0 0 0 0 0]
            alternate_definition [half] mainstream
   simple_funny
   // This stuff is tested in t15 and t51.
   // If user said "assume facing lines" or
   // "assume back-to-back lines", use these:
   setup 2x4 1x8 qualifier explicit in in_or_out
      array [0 0 0 0 ZM5N ZM6N ZM3N ZM0N]
   setup 2x4 1x8 rotate qualifier explicit out in_or_out
      array [CR0N CR3N AL2S AL1S 0 0 0 0]
   // Things get very tricky here.  The problem is that, from facing lines,
   // or anything that reasonably looks like facing lines, we want the half
   // circulate to collide in a tidal wave.  Similarly for back-to-back lines.
   //
   // But if one line is phantoms, as in split phantom lines tally ho from
   // back-to-back lines, the code would be tempted to use the clauses below,
   // intended for waves or 2-faced lines, and go into a crosswave.  Once the
   // phantoms are stipped, the live people have effectively done a 1/2 press
   // ahead, so they are all centers, and they do the hinge/half circulate/finish
   // operation.
   //
   // So we use the 1fl_only qualifier to force the 1x8 result.  But now
   // there's another problem:  If the setup is C1 phantoms with everyone as
   // a couple, the call is done in a 2x4 consisting of a belle-side or beau-side
   // couple facing in or out.  In such a case we want the old 2-faced line
   // interpretation, going to a crosswave.
   //
   // So we only do the special tidal wave trick if the setup is consistent
   // with 1-faced lines and *not* consistent with 2-faced lines.  We do this
   // by putting a 2fl_only qualifier first, going to the old behavior.
   setup 2x4 crosswave rotate qualifier 2fl_only
      array [CR0N CR1N AL1S AL0S ZM2W ZM3W ZM7W ZM6W]
   // Followed by 1fl_only qualifiers for the colliding behavior.
   setup 2x4 1x8 qualifier in 1fl_only
      array [0 0 0 0 ZM5N ZM6N ZM3N ZM0N]
   // For tally ho from 5&3 lines.  Or whatever.
   setup 2x6 1x6 qualifier in 1fl_only
      array [0 0 0 0 0 0 ZM3N ZM4N ZM5N ZM2N ZM1N ZM0N]
   setup 2x6 1x6 rotate qualifier out 1fl_only
      array [CR0N CR1N CR2N AL2S AL1S AL0S 0 0 0 0 0 0]
   // The usual interpretation if waves.
   setup 2x4 crosswave rotate qualifier wave_only
      array [CR0N CR1N AL1S AL0S ZM2W ZM3W ZM7W ZM6W]
   // But if back-to-back and not recognizable as waves, do this.
   setup 2x4 1x8 rotate qualifier out 1fl_only
      array [CR0N CR3N AL2S AL1S 0 0 0 0]
   // The usual interpretation.
   setup 2x4 crosswave rotate
      array [CR0N CR1N AL1S AL0S ZM2W ZM3W ZM7W ZM6W]
   // Handle similar things for 2x2 facing in or out.
   setup 2x2 1x4 qualifier explicit in in_or_out no_cutting_through
      array [0 0 ZM3N ZM0N]
   setup 2x2 1x4 rotate qualifier explicit out in_or_out
      array [CR0N AL1S 0 0]
   // Otherwise, use the usual interpretation.
   setup 2x2 dmd rotate no_cutting_through
      array [CR0N AL0S ZM1W ZM3W]
   setup 2x1 1x2 rotate
      array [ZM0W 0]
   setup 4x2 spindle qualifier wave_only
      array [ZM0N ZM1N ZM2N CR3E AL3W ZM4N ZM5N ZM6N]
   setup 4x2 crosswave qualifier ntbone out in_or_out
      array [0 ZM2N 0 CR4E AL5W 0 ZM7N 0]
   setup 4x2 2x4 rotate qualifier ntbone in in_or_out
      array [ZM7W 0 ZM0W 0 0 ZM2W 0 ZM5W]
   setup 4x2 spindle
      array [ZM0N ZM1N ZM2N CR3E AL3W ZM4N ZM5N ZM6N]
   setup c1phan crosswave rotate
      array [CR0N 0 CR1N 0 0 AL0S 0 AL1S ZM2W 0 ZM3W 0 0 ZM6W 0 ZM7W]
            alternate_definition [12matrix half] c3a
   setup 2x6 1x8 rotate
      array [CR0N CR1N CR3N AL3S AL1S AL0S 0 0 0 0 0 0]
   setup 6x2 1x8 rotate
      array [0 0 ZM2W 0 0 0 0 0 0 ZM6W 0 0]
   setup 3x4 deepxwv rotate
      array [CR0N CR1N AL1S AL0S ZM2W ZM3W ZM11W ZM10W ZM9W ZM8W ZM5W ZM4W]

call "circulate for acey deucey" dontshow tag circulateforacey
            take_right_hands left_means_mirror diamond_is_legal
   simple_funny
   setup 2x2 2x2 no_cutting_through
      array [CR1S AL0S ZM1N ZM0N]
   setup star star
      array [CR1E 0 AL1W 0]
   setup short6 short6 qualifier didnt_say_triangle
      array [CR1E 0 AL1W ZM2N 0 ZM0N]
   setup pshort6 short6 qualifier didnt_say_triangle
      predscantdocallinsetup
         if next62spot_is_tboned [ZM1N CR2E CR3S AL2S AL3W ZM4N]
         if always               [ZM1N ZM2N CR3S AL2S ZM3N ZM4N]
            alternate_definition [6x2] a1
   simple_funny
   setup 2x3 2x3 no_cutting_through
      array [CR2S 0 AL0S ZM2N ZM1N ZM0N]
   setup 3x2 2x3 no_cutting_through
      array [ZM1N ZM2N CR3S AL2S ZM3N ZM4N]
   setup short6 short6 qualifier didnt_say_triangle
      array [CR1E 0 AL1W ZM2N 0 ZM0N]
   setup pshort6 short6 qualifier didnt_say_triangle
      predscantdocallinsetup
         if next62spot_is_tboned [ZM1N CR2E CR3S AL2S AL3W ZM4N]
         if always               [ZM1N ZM2N CR3S AL2S ZM3N ZM4N]
            alternate_definition [magic 6x2] c1
   simple_funny
   setup 3x2 2x3 no_cutting_through
      array [ZM4N ZM3N CR3S AL2S ZM2N ZM1N]
   setup pshort6 short6 qualifier didnt_say_triangle
      predscantdocallinsetup
         if next_magic62spot_is_tboned [ZM4N ZM3N CR3S AL2S ZM2N ZM1N]
         if always [ZM4N ZM3N CR3S AL2S ZM2N ZM1N]
            alternate_definition [3x2] c1
   simple_funny
   setup trngl trngl // qualifier said_triangle
      array [0 CR2S AL1S 0 AL3W CR3E]
   setup ptrngl trngl // qualifier said_triangle
      predscantdocallinsetup
         if nexttrnglspot_is_tboned [AL2W ZM2N CR0S CR4E AL3S ZM4N]
         if always                  [AL2S ZM2N CR0S CR4S AL3S ZM4N]
            alternate_definition [half] mainstream
   simple_funny
   setup 2x2 1x4 qualifier explicit in in_or_out no_cutting_through
      array [0 0 ZM3N ZM0N]
   setup 2x2 1x4 rotate qualifier explicit out in_or_out
      array [CR0N AL1S 0 0]
   setup 2x2 dmd rotate no_cutting_through really_want_diamond
      array [CR0N AL0S ZM1W ZM3W]
   setup pshort6 short6 other_elongate rotate
      array [ZM5W ZM0W CR1N AL1S ZM2W ZM3W]
   setup short6 1x2 qualifier didnt_say_triangle
      array [0 0 0 ZM1N 0 ZM0N]
            alternate_definition [half 6x2] a1
   setup 3x2 short6 rotate no_cutting_through
      array [ZM5W ZM0W CR1N AL1S ZM2W ZM3W]
   setup pshort6 short6 other_elongate rotate
      array [ZM5W ZM0W CR1N AL1S ZM2W ZM3W]
   setup short6 1x2 qualifier didnt_say_triangle
      array [0 0 0 ZM1N 0 ZM0N]

call "concentric circulate" dontshow tag conccirculate
            visible_fractions
   conc in_or_out_circ [] in_or_out_circ [conc_force_spots]

call "in or out circulate" dontshow tag in_or_out_circ
            take_right_hands
   /* People do things like "central finish percolate" in T-boned boxes, such
      that what they are doing is not the centers part of a percolate.  That is,
      if those 4 people had been in the center of an 8 person setup and "percolate"
      had been called, they would have gone out of the center.  Telling people
      to pretend that they are centers and do a call is actually an extremely
      tricky thing.  There is just no way to do all this precisely.  We mark it
      as "controversial" when the formation is such that, had they been in the
      center of a 2x4, they might not have stayed there. */
   setup 2x2 2x2 no_cutting_through no_facing_ends restriction controversial in_or_out
      array [CR1S AL0S ZM1N ZM0N]
            alternate_definition [half] mainstream
   setup 2x2 dmd rotate no_cutting_through no_facing_ends restriction controversial in_or_out
      array [CR0N AL0S ZM1W ZM3W]
   setup 2x1 1x2 rotate restriction controversial in_or_out
      array [ZM0W 0]

call "concentric half circulate with centers facing" dontshow tag conchalfcirculate_ctrsin_endsout
   conc half_in_circ [] half_out_circ [conc_force_otherway]

call "half circulate, facing in" dontshow tag half_in_circ
            take_right_hands
   setup 2x2 1x4 no_cutting_through
      array [0 0 ZM3N ZM0N]
   setup 2x1 1x2 rotate
      array [ZM0W 0]

call "half circulate, facing out" dontshow tag half_out_circ
            take_right_hands
   setup 2x2 2x2 no_cutting_through
      array [CR0E AL1W 0 0]

call "circulate @9 times" mainstream
            neednumber visible_fractions distribute_repetitions
   seq circulate [repeat_n]

call "_box circulate, maybe diamond" dontshow tag box_circulate_maybe_diamond
            take_right_hands fudge_to_q_tag
   simple_funny
   setup 2x2 2x2 no_cutting_through
      array [CR1S AL0S ZM1N ZM0N]
   setup 2x1 1x2
      array [ZM1N 0]
   setup star star
      array [CR1E 0 AL1W 0]
   setup dmd dmd restriction forbidden diamond_like
      array [CR1E 0 AL1W 0]
   setup pmd dmd restriction forbidden diamond_like
      array [0 CR2E 0 AL2W]
            alternate_definition [half] mainstream
   simple_funny
   setup 2x2 dmd rotate no_cutting_through
      array [CR0N AL0S ZM1W ZM3W]
   setup 2x1 1x2 rotate
      array [ZM0W 0]
            alternate_definition [twisted] c4
   setup 2x2 1x4 no_cutting_through
      array [0 0 CM2E CM1E]

call "column circulate" mainstream tag colcirc
            take_right_hands
   // This is for compound calls that start with circulate, and
   // are expected to be in columns, such as "walk the plank".
   // We allow line or box versions, but make them "unusual".
   simple_funny
   setup 4x2 2x4
      array [ZM1N ZM2N ZM3N CR4S AL3S ZM4N ZM5N ZM6N]
   setup 3x2 2x3
      array [ZM1N ZM2N CR3S AL2S ZM3N ZM4N]
   setup 2x4 2x4 restriction unusual alwaysfail
      array [CR3S CR2S AL1S AL0S ZM3N ZM2N ZM1N ZM0N]
   setup 2x2 2x2 no_cutting_through restriction unusual alwaysfail
      array [CR1S AL0S ZM1N ZM0N]
            alternate_definition [magic] c1
   simple_funny
   setup 4x2 2x4 restriction magic_only
      array [ZM6N ZM2N ZM4N CR4S AL3S ZM3N ZM5N ZM1N]
   setup 3x2 2x3
      array [ZM4N ZM3N CR3S AL2S ZM2N ZM1N]
            alternate_definition [12matrix] c3a
   simple_funny
   setup 6x2 2x6
      array [ZM1N ZM2N ZM3N ZM4N ZM5N CR6S AL5S ZM6N ZM7N ZM8N ZM9N ZM10N]
            alternate_definition [16matrix] c3a
   simple_funny
   setup 8x2 2x8
      array [ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N CR8S
             AL7S ZM8N ZM9N ZM10N ZM11N ZM12N ZM13N ZM14N]
            alternate_definition [half] mainstream
   simple_funny
   setup 4x2 spindle
      array [ZM0N ZM1N ZM2N CR3E AL3W ZM4N ZM5N ZM6N]
   setup 3x2 short6 rotate
      array [ZM5W ZM0W CR1N AL1S ZM2W ZM3W]
            alternate_definition [lasthalf] mainstream
   setup pspindle 2x4
      array [ZM1N ZM2N ZM3N 0 ZM4N ZM5N ZM6N 0]
   setup spindle 2x4
      array [0 0 0 AL3W 0 0 0 CR0E]
            alternate_definition [magic half] c1
   simple_funny
   setup 4x2 spindle
      array [ZM0N ZM1N ZM4N CR3E AL3W ZM2N ZM5N ZM6N]
   setup 3x2 short6 rotate no_cutting_through
      array [ZM5W ZM2W CR1N AL1S ZM0W ZM3W]
            alternate_definition [half rewind] c4
   setup pspindle 2x4
      array [ZM1N ZM2N ZM3N 0 ZM4N ZM5N ZM6N 0]
   setup spindle 2x4
      array [0 0 0 AL3W 0 0 0 CR0E]

call "circulate for coordinate" dontshow tag circ_for_coord
// This exists just to give the warnings if the circulates indicate that the coordinate itself is unusual.
            take_right_hands
   setup 2x4 2x4 restriction unusual alwaysfail
      array [CR3S CR2S AL1S AL0S ZM3N ZM2N ZM1N ZM0N]
   setup 4x2 2x4 restriction unusual wave_only
      array [ZM1N ZM2N ZM3N CR4S AL3S ZM4N ZM5N ZM6N]
   setup 3x2 2x3 restriction unusual wave_only
      array [ZM1N ZM2N CR3S AL2S ZM3N ZM4N]
            alternate_definition [magic] c1
   setup 4x2 2x4 restriction unusual magic_only
      array [ZM6N ZM2N ZM4N CR4S AL3S ZM3N ZM5N ZM1N]
   setup 3x2 2x3
      array [ZM4N ZM3N CR3S AL2S ZM2N ZM1N]
            alternate_definition [half] mainstream
   setup 2x4 crosswave rotate restriction unusual alwaysfail
      array [CR0N CR1N AL1S AL0S ZM2W ZM3W ZM7W ZM6W]
   setup 4x2 spindle restriction unusual wave_only
      array [ZM0N ZM1N ZM2N CR3E AL3W ZM4N ZM5N ZM6N]
   setup 3x2 short6 rotate no_cutting_through
      array [ZM5W ZM0W CR1N AL1S ZM2W ZM3W]
            alternate_definition [magic half] c1
   simple_funny
   setup 4x2 spindle
      array [ZM0N ZM1N ZM4N CR3E AL3W ZM2N ZM5N ZM6N]
   setup 3x2 short6 rotate no_cutting_through
      array [ZM5W ZM2W CR1N AL1S ZM0W ZM3W]
            alternate_definition [twisted] c4
   setup 2x1 1x2 rotate restriction unusual alwaysfail
      array [CM1N 0]
            alternate_definition [half rewind] c4
   setup pspindle 2x4
      array [ZM1N ZM2N ZM3N 0 ZM4N ZM5N ZM6N 0]
   setup spindle 2x4
      array [0 0 0 AL3W 0 0 0 CR0E]

call "1/2 circulate" mainstream   // This is here to make it not show a comma.
            bigmatrix_is_inherited
   seq circulate [force_half inherit_bigmatrix]

call "circulate 1-1/2" mainstream
            take_right_hands
   setup 2x4 crosswave rotate
      array [CM2E CM3E ZM7E AM6E AL0S AL1S CR1N CR0N]
   setup 2x2 dmd rotate no_cutting_through
      array [CM1E AM3E AL0S CR0N]
   setup 4x2 spindle
      array [ZM1N ZM2N CR3E CM4S AM2S AL3W ZM4N ZM5N]
   setup 3x2 short6 rotate no_cutting_through
      array [ZM0W CR1N CM2E AM0E AL1S ZM2W]
            alternate_definition [magic] c1
   setup 4x2 spindle
      array [ZM5N ZM4N AL3W CM4S AM2S CR3E ZM2N ZM1N]
   setup 3x2 short6 rotate no_cutting_through
      array [ZM0W AL1S CM2E AM0E CR1N ZM2W]

call "tag circulate" c4a
   setup 2x4 2x4 restriction 2fl_only
      array [CR2S CR3S ACR0N ACR1N ZM3N ZM2N ZM1N ZM0N]
            alternate_definition [single] c4
   setup 2x2 2x2 restriction wave_only
      array [CR1S ACR0N ZM1N ZM0N]
            alternate_definition [3x3] c4
   setup 2x6 2x6 restriction 3x3couples_only
      array [CR3S CR4S CR5S ACR0N ACR1N ACR2N ZM5N ZM4N ZM3N ZM2N ZM1N ZM0N]
            alternate_definition [4x4] c4
   setup 2x8 2x8 restriction 4x4couples_only
      array [CR4S CR5S CR6S CR7S ACR0N ACR1N ACR2N ACR3N ZM7N ZM6N ZM5N ZM4N ZM3N ZM2N ZM1N ZM0N]
            alternate_definition [3x1] c4
   setup 2x4 2x4
      predscantdo
         if miniwave_side_of_out_3n1_line [   0 ACR0N CR3S      0 ZM3N 0 0 ZM0N]
         if couple_side_of_out_3n1_line   [CR1S  CR2S ACR1N ACR2N    0 0 0    0]
            alternate_definition [1x3] c4
   setup 2x4 2x4
      predscantdo
         if miniwave_side_of_out_3n1_line [CR3S 0 0 ACR0N    0 ZM2N ZM1N    0]
         if couple_side_of_out_3n1_line   [   0 0 0     0 ZM3N ZM2N ZM1N ZM0N]

call "box circulate" mainstream tag box_circ
            dont_use_in_resolve take_right_hands
   simple_funny
   setup 2x2 2x2 no_cutting_through
      array [CR1S AL0S ZM1N ZM0N]
            alternate_definition [half] mainstream
   setup 2x2 dmd rotate no_cutting_through
      array [CR0N AL0S ZM1W ZM3W]
   setup 2x1 1x2 rotate
      array [ZM0W 0]
            alternate_definition [lasthalf] mainstream
   setup dmd 2x2 restriction forbidden diamond_like qualifier right dmd_ctrs_mwv
      array [CR0E 0 0 0]
   setup dmd 2x2 restriction forbidden diamond_like qualifier left dmd_ctrs_mwv
      array [0 0 AL1W 0]
   setup pmd 2x2 restriction forbidden diamond_like
      array [0 ZM1N 0 ZM2N]

call "box circulate #1 with 3x3" dontshow tag box_circ_1_w_3x3
   setup 2x2 2x2 no_cutting_through
      array [CR1S AL0S ZM1N ZM0N]
            alternate_definition [grand] c4
   setup 3x2 2x3 restriction unusual wave_only
      array [ZM1N ZM2N CR3S AL2S ZM3N ZM4N]
            // These things are really awful.  Anyone who fractionalizes these
            // variations of contour the line is in for some controversy.
            alternate_definition [single] c4
   setup 1x2 1x2 rotate restriction forbidden wave_only
      array [CR0N AL0S]
            alternate_definition [magic] c4
   setup 2x2 2x2 qualifier magic_only
      array [CR1S AL0S ZM0N ZM1N]
            alternate_definition [3x3] c4
   setup 3x2 short6 rotate restriction forbidden wave_only
      array [ZM0W CR1N CR2E AL0E AL1S ZM2W]
            alternate_definition [4x4] c4
   setup 4x2 2x4 restriction forbidden wave_only
      array [ZM2N ZM3N CR4S CM5S AM2S AL3S ZM4N ZM5N]

call "box circulate #2 with 3x3" dontshow tag box_circ_2_w_3x3
   setup 2x2 2x2 no_cutting_through
      array [CR1S AL0S ZM1N ZM0N]
            alternate_definition [grand] c4
   setup 3x2 2x3 restriction unusual wave_only
      array [ZM1N ZM2N CR3S AL2S ZM3N ZM4N]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate restriction forbidden wave_only
      array [CR0N AL0S]
            alternate_definition [magic] c4
   setup 2x2 2x2 qualifier magic_only
      array [CR1S AL0S ZM0N ZM1N]
            alternate_definition [3x3] c4
   setup short6 2x3 rotate
      array [CR0E 0 AL5E ZM0W 0 ZM5W]
   setup pshort6 2x3 rotate
      array [0 CM1N 0 0 AM1S 0]
            alternate_definition [4x4] c4
   setup 4x2 2x4 restriction forbidden wave_only
      array [ZM2N ZM3N CR4S CM5S AM2S AL3S ZM4N ZM5N]

call "box circulate 1-1/2" mainstream tag box_circ_15
            dont_use_in_resolve take_right_hands
   setup 2x2 dmd really_want_diamond rotate
      array [ZM1E ZM3E AL0S CR0N]

call "split circulate 1-1/2" mainstream /* Same as box circ 1.5. */
            dont_use_in_resolve take_right_hands
   setup 2x2 dmd rotate no_cutting_through restriction wave_only
      array [ZM1E ZM3E AL0S CR0N]

call "_1/2 box circulate in miniwaves" dontshow tag halfboxcirc_miniwaves
            take_right_hands
   setup 2x4 qtag qualifier in magic_only
      array [CR0E AL0W CR1E AL1W 0 ZM3N ZM6N 0]
   setup 2x2 dmd rotate restriction unusual miniwaves
      array [CR0N AL0S ZM1W ZM3W]

call "double down" c4a
            take_right_hands
   setup 2x4 2x4
      preds "Can't tell which way my adjacent end is facing."
         if inner_active_lines [0    AM7S CM4S 0    AL2S CR3S AL0S CR1S]
         if outer_active_lines [CR3S CR2S AL1S AL0S 0    ZM2N ZM1N 0]
   setup 4x2 2x4
      preds "Can't tell which way my adjacent end is facing."
         if column_double_down [CR6S ZM2N ZM3N CM5S AM2S ZM4N ZM5N AL1S]
            alternate_definition [cross] c4
   setup 2x4 2x4
      preds "Can't tell which way my adjacent end is facing."
         if inner_active_lines [0    AM7S CM4S 0    AL2S CR3S AL0S CR1S]
         if outer_active_lines [CR2S CR3S AL0S AL1S 0    ZM3N ZM0N 0]
   setup 4x2 2x4
      preds "Can't tell which way my adjacent end is facing."
         if column_double_down [CR6S ZM5N ZM4N CM5S AM2S ZM3N ZM2N AL1S]
            alternate_definition [half] c4
   setup 2x4 hyperglass
      preds "Can't tell which way my adjacent end is facing."
         if inner_active_lines [0    AL2S CR5S 0    ZM5N 0    0    ZM2N]
         if outer_active_lines [CR3E CR4E AL4W AL3W 0    ZM7N ZM1N 0]

call "_finish clear out" dontshow tag finclearout
   setup 2x4 2x4
      array [CR0S CR2S AL1S AL3S ZM4N AL2S CR1S ZM7N]
   setup 4x2 2x4
      array [ZM0N CR2S CR5S CR3S AL4S AL2S AL5S ZM7N]

call "@1clear out" c4a
            first_part_visible magic_is_inherited funny_is_inherited
   seq circulate [or_anycall inherit_magic inherit_funny]
   seq finclearout [roll_transparent]

call "@T clear out" c4a
            first_part_visible
   seq circulate [mandatory_anycall]
   seq finclearout [roll_transparent]

call "@N clear out" c4a
            first_part_visible magic_is_inherited funny_is_inherited
   seq circnullcall [or_anycall inherit_funny inherit_magic]
   seq finclearout [roll_transparent]

call "_lift off but" dontshow tag liftoffbut
            reverse_means_mirror
   // While an extremely strict reading of Vic Ceder's C3 definition (and the
   // accepted definition before that) says that the center belle's last motion
   // was slightly forward and hence it should be CM2S, in practice this person
   // is still going around the corner.  So we mark it as unsupported for roll.
   setup 2x4 2x4 rotate
      array [0 CM0N C2S 0 0 0 0 0]
   setup 4x2 2x4 rotate
      array [ZM7W 0 0 0 0 0 0 ZM1W]
   setup 4x4 4x6
      array [0 0 0 0 0 ZM9N ZM19N 0 0 0 0 0 0 CM3E C21W 0]

call "lift off" c3
            reverse_means_mirror last_part_visible
   seq liftoffbut [inherit_reverse]
   seq couples_circ [allow_plain_mod]

call "lift off but @0" c3
            reverse_means_mirror last_part_visible
   seq liftoffbut [inherit_reverse]
   seq nullcall [mandatory_anycall]

call "step and step" c3 tag startwave
   // This is just a press ahead (approximately).
   setup 2x4 4x4
      array [ZM12N ZM13N ZM14N ZM0N ZM1N ZM3N ZM15N ZM10N]
   setup 4x2 4x4
      array [ZM15N ZM3N ZM1N 0 0 ZM2N ZM7N ZM11N]
   setup 6x2 2x4
      array [ZM0N ZM1N ZM2N ZM3N 0 0 0 0 ZM4N ZM5N ZM6N ZM7N]
   setup pshort6 2x3   // In case the others are single;  Cf. nf36t.
      array [0 0 ZM2N ZM3N 0 0]
   setup pqtag rigger
      array [0 0 ZM2N ZM3N 0 0 0 0]
   setup qtag rigger
      array [0 0 0 0 ZM4N ZM5N 0 0]
            alternate_definition [single] c4
   setup short6 2x3
      array [0 0 0 0 ZM4N 0]
            alternate_definition [half] c3
   setup 3x2 2x4
      array [ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N]

call "finish wave the @6" dontshow tag finishwave
            yield_if_ambiguous
   // Selector identities *do* get re-evaluated for the new centers and ends,
   // which makes this work.  Compare patch the <anyone>. */
   conc starthopping []
        designeeskickclassic [conc_demand_columns conc_force_lines]

call "finish wave the beaus" dontshow tag finishwavebo
            single_is_inherited
   conc startbeauhopping [inherit_single]
        beaukick [inherit_single conc_demand_columns conc_force_spots]

call "finish wave the belles" dontshow tag finishwavebel
            single_is_inherited
   conc startbellhopping [inherit_single]
        bellkick [inherit_single conc_demand_columns conc_force_spots]

call "wave the @6" c3
            visible_fractions yield_if_ambiguous
   seq startwave []
   seq finishwave []

call "wave the beaus" c3
            visible_fractions single_is_inherited
   seq startwave [inherit_single]
   seq finishwavebo [inherit_single]

call "wave the belles" c3
            visible_fractions single_is_inherited
   seq startwave [inherit_single]
   seq finishwavebel [inherit_single]

call "_spin the pulley but" dontshow tag spinpulleypart1
            left_means_mirror single_is_inherited fractal_is_inherited gen_sting_is_inherited
   singleconc_together touch_3_4 [inherit_left inherit_gensting inherit_fractal]
                       nullcall [conc_force_spots]

call "_ @0 the pulley but" dontshow tag anythingpulleypart1
            left_means_mirror
   // Just the centers do it ....
   conc nullcall [mandatory_anycall] nullcall [conc_demand_columns conc_force_spots]
            left_means_mirror
   // ... or everyone do it.
   seq nullcall [mandatory_anycall]

call "spin the pulley" c3a
            sequence_starter visible_fractions left_means_mirror
            single_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq spinpulleypart1 [inherit_single inherit_left inherit_gensting inherit_fractal]
   seq triplecross [inherit_single]
   seq peeloff [allow_plain_mod inherit_single]

call "@0 the pulley" c3a
            sequence_starter visible_fractions dont_use_in_resolve
   seq anythingpulleypart1 [inherit_left]
   seq triplecross []
   seq peeloff [allow_plain_mod]

call "the pulley" c3a
            visible_fractions
   seq triplecross []
   seq peeloff [allow_plain_mod]

call "spin the pulley but @0" c3a
            sequence_starter visible_fractions left_means_mirror fractal_is_inherited gen_sting_is_inherited
            dont_use_in_resolve
   seq spinpulleypart1 [inherit_left inherit_gensting inherit_fractal]
   seq triplecross []
   seq nullcall [mandatory_anycall]

call "@0 the pulley but @m" c3a
            sequence_starter visible_fractions left_means_mirror dont_use_in_resolve
   seq anythingpulleypart1 [inherit_left]
   seq triplecross []
   seq nullsecond [mandatory_secondary_call]

call "the pulley but @0" c3a
            dont_use_in_resolve
   seq triplecross []
   seq nullcall [mandatory_anycall]

call "_mixed up and nothing" dontshow tag mixedup
            rear_back_from_r_wave
   setup 4x2 2x4
      array [CR1E 0 CM4E 0 0 AM3W 0 AL6W]
   setup 2x4 2x4
      array [0 0 0 0 AL2S CM4S AL7S CR1S]

call "_split mixed up and nothing" dontshow tag splmixedup
            sequence_starter rear_back_from_r_wave
   setup 2x4 2x4
      array [0 0 0 0 0 CM4S AM7S 0]
   setup 4x2 2x4
      array [CR1E 0 0 0 0 0 0 AL6W]

call "mixed up square thru, new ctrs @0" c4x
            sequence_starter dont_use_in_resolve
   seq mixedup []
   seq centers_mandatory_call []

call "split mixed up square thru, new ctrs @0" c4x
            sequence_starter dont_use_in_resolve
   seq splmixedup []
   seq centers_mandatory_call []

call "hocus pocus" c2
// We put this one first because (1) it has better roll info for the ends,
// and (2) it can fractionalize.

// if 6p / 2O is first, ni02 fails because of roll info
// if O / 2Ofrac first, t13 fails because phantoms don't obey the "2 O circs" theorem.

// OK, it now knows the "2 O circs" theorem.  So O / 2Ofrac is first, and the tests
// pass.  In fact, it's possible that the second clause can be removed completely.
// Not so!  See t41.

            visible_fractions magic_is_inherited yoyo_is_inherited gen_sting_is_inherited funny_is_inherited
   conc_o trade_w_tbone [inherit_yoyo inherit_gensting inherit_funny]
          two_o_circs_for_frac [inherit_magic conc_force_otherway endscando]
            visible_fractions magic_is_inherited yoyo_is_inherited gen_sting_is_inherited funny_is_inherited
   conc6p_or_normal trade_w_tbone [inherit_yoyo inherit_gensting inherit_funny]
                    // Setting both "conc_demand_columns" and "conc_demand_lines" makes it forbid doing this
                    // in a butterfly.  It would go to an outer 2x2 elongated in both directions, which
                    // is forbidden when both of these flags are present together.
                    two_o_circs [inherit_magic conc_force_otherway conc_demand_columns conc_demand_lines endscando]

call "_wheel and" dontshow tag wheel
            reverse_means_mirror
   setup 2x2 2x2
      array [AL0E AL3E 0 0]

call "_8by" dontshow tag 8by
            visible_fractions left_means_mirror twisted_is_inherited
   seq passthru [inherit_left inherit_twisted]
   seq courtesy_and_roll [inherit_reverse inherit_twisted]

call "_final wheel and @0" dontshow tag final_wheel_and_anything
            dont_use_in_resolve reverse_means_mirror
   conc nullcall [mandatory_anycall]
        wheel [inherit_reverse conc_demand_columns conc_force_columns]

call "wheel and @0" c1
            dont_use_in_resolve reverse_means_mirror
   seq prepare_to_clover_no_sel [normalize]
   seq final_wheel_and_anything [inherit_reverse]


// This is sort of a counter rotate and roll, and sort of a couple up.
// But the actual definition involvescross fold, or circulate and fold.
// And we need to honor "single", which has no counterpart in the official
// definition.  So we have to be careful. "Half" means trailers just circulate,
// while the leads can't do it.
call "_ends buckle" dontshow tag ends_buckle
            single_is_inherited
   setup 2x2 2x2
      array [CR1S AL0S AL1S CR0S]
            alternate_definition [single] c4
   setup 1x2 1x2 rotate
      array [CR0E AL0E]
            alternate_definition [half] c4
   setup 2x2 2x2
      array [0 0 ZM1N ZM0N]

call "buckle and @0" c4a
            dont_use_in_resolve single_is_inherited
   conc6p_or_normal_maybe_single nullcall [mandatory_anycall]
                                 ends_buckle [inherit_single conc_demand_lines conc_force_otherway]

call "buckle" c4a
            dont_use_in_resolve single_is_inherited
   conc6p_or_normal_maybe_single boguscall []
                                 ends_buckle [inherit_single conc_demand_lines conc_force_otherway endscando]

call "cloverleaf" mainstream tag cloverleaf
   setup 4x2 2x4 rotate
      array [0 0 AL0N AM1N CM2S CR3S 0 0]
            alternate_definition [cross] c1
   setup 4x2 2x4 rotate
      array [0 0 CR3S CM2S AM1N AL0N 0 0]
            alternate_definition [single] c4
   setup 2x2 2x2
      array [AL0E CR1W 0 0]
            alternate_definition [single cross] c4
   setup 2x2 2x2
      array [CR1W AL0E 0 0]
            alternate_definition [3x3 12matrix] c4
   setup 6x2 2x6 rotate
      array [0 0 0 AL0N AM1N AM2N CM3S CM4S CR5S 0 0 0]
            alternate_definition [3x3 12matrix cross] c4
   setup 6x2 2x6 rotate
      array [0 0 0 CR5S CM4S CM3S AM2N AM1N AL0N 0 0 0]
            alternate_definition [4x4 16matrix] c4
   setup 8x2 2x8 rotate
      array [0 0 0 0 AL0N AM1N AM2N AM3N CM4S CM5S CM6S CR7S 0 0 0 0]
            alternate_definition [4x4 16matrix cross] c4
   setup 8x2 2x8 rotate
      array [0 0 0 0 CR7S CM6S CM5S CM4S AM3N AM2N AM1N AL0N 0 0 0 0]
            alternate_definition [3x1] c4
   setup 4x2 2x4 rotate
      preds "Not in correct kind of columns."
         if antitandem_side_of_out_3n1_col [0 AL0N    0 AL0N CR3S    0 CR3S 0]
         if tandem_side_of_out_3n1_col     [0    0 AM1N AM2N CM1S CM2S    0 0]
            alternate_definition [1x3] c4    // Same as 3x1.
   setup 4x2 2x4 rotate
      preds "Not in correct kind of columns."
         if antitandem_side_of_out_3n1_col [0 AL0N    0 AL0N CR3S    0 CR3S 0]
         if tandem_side_of_out_3n1_col     [0    0 AM1N AM2N CM1S CM2S    0 0]
            alternate_definition [3x1 cross] c4
   setup 4x2 2x4 rotate
      preds "Not in correct kind of columns."
         if antitandem_side_of_out_3n1_col [0 CR3S    0 CR3S AL0N    0 AL0N 0]
         if tandem_side_of_out_3n1_col     [0    0 CM2S CM1S AM2N AM1N    0 0]
            alternate_definition [1x3 cross] c4    // Same as 3x1 cross.
   setup 4x2 2x4 rotate
      preds "Not in correct kind of columns."
         if antitandem_side_of_out_3n1_col [0 CR3S    0 CR3S AL0N    0 AL0N 0]
         if tandem_side_of_out_3n1_col     [0    0 CM2S CM1S AM2N AM1N    0 0]

call "_cloverflow 1" dontshow tag clovflow1
            twisted_is_inherited
   conc passthru [inherit_twisted] clover [conc_demand_columns conc_force_columns]

call "_cloverflow 2" dontshow tag clovflow2
   crossconc passthru [conc_demand_columns] clover [conc_force_columns]

call "_cloverflow 2 but @0" dontshow tag clovflow2_but
   crossconc nullcall [mandatory_anycall conc_demand_columns] clover [conc_force_columns]

call "cloverflow" c4a
            visible_fractions twisted_is_inherited
   seq clovflow1 [inherit_twisted]
   seq clovflow2 []

call "cloverflow but @0" c4
            visible_fractions twisted_is_inherited
   seq clovflow1 [inherit_twisted]
   seq clovflow2_but []

call "_cloverleaf turn 1" dontshow tag clovturn1
            cross_is_inherited
   conc turnthru [] clover [inherit_cross conc_demand_columns conc_force_columns]

call "_cloverleaf turn 2" dontshow tag clovturn2
            cross_is_inherited
   crossconc turnthru [conc_demand_columns] clover [inherit_cross conc_force_columns]

call "_cloverleaf turn 2, ctrs to a wave" dontshow tag clovturn2wv
            cross_is_inherited
   crossconc touch_n_4 [insert_number 2 conc_demand_columns]
             clover [inherit_cross conc_force_columns]

call "cloverleaf turn" c4
            visible_fractions cross_is_inherited
   seq clovturn1 [inherit_cross]
   seq clovturn2 [inherit_cross]

call "cloverleaf turn, new centers to a wave" c4
            visible_fractions cross_is_inherited
   seq clovturn1 [inherit_cross]
   seq clovturn2wv [inherit_cross]

// This does the actual clovering.
call "_clover and" dontshow tag clover
   setup 2x2 2x2
      array [AL0E CR1W 0 0]
            alternate_definition [cross] a1
   setup 2x2 2x2
      array [CR1W AL0E 0 0]

call "_final clover and @0" dontshow tag final_clover_and_anything
            dont_use_in_resolve cross_is_inherited
   conc nullcall [mandatory_anycall]
        clover [inherit_cross conc_demand_columns conc_force_columns]

call "clover and nothing" dontshow tag final_clover_and_nothing
            dont_use_in_resolve cross_is_inherited
   conc nullcall []
        clover [inherit_cross conc_demand_columns conc_force_columns]

// This moves the clovering/wheeling people to the outside.
// It has to identify, for example, a "heads pass thru" setup
// in which the centers are the ones doing the cloverleaf.
// If so, it effectively does a slim down.
call "_prepare to cloverleaf, no sel" dontshow tag prepare_to_clover_no_sel
   // If all are in column orientation, the ends better be looking out.
   setup 4x2 2x4 qualifier ntbone none
      array [   0 ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N    0]
   // If all couples are facing out, the ends cloverleaf,
   // though it's actually illegal.
   setup 4x2 2x4 qualifier out conc_cpls_same restriction serious_violation alwaysfail
      array [0 0 0 ZM3N ZM4N 0 0 0]
   setup 2x4 2x4 qualifier out conc_cpls_same restriction serious_violation alwaysfail
      array [0 ZM1N ZM2N 0 0 0 0 0]
   // If the centers aren't looking out, they can't cloverleaf.
   setup 4x2 2x4 qualifier tbone in centers_in_or_out
      array [   0 ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N    0]
   setup 2x4 2x4 qualifier tbone in centers_in_or_out
      array [   0 ZM1N ZM2N    0    0 ZM5N ZM6N    0]
   // If magic lines with centers looking out, they cloverleaf.
   setup 2x4 2x4 rotate qualifier ntbone out magic_only
      array [   0 ZM7W ZM0W    0 ZM2W    0    0 ZM5W]
   // If the centers are looking out but the ends aren't,
   // they cloverleaf with no controversy.
   setup 2x4 2x4 rotate qualifier tbone out centers_in_or_out
      array [   0 ZM7W ZM0W    0 ZM2W    0    0 ZM5W]
   setup 4x2 2x4 rotate qualifier tbone out centers_in_or_out
      array [ZM6W    0    0    0    0    0    0 ZM5W]
   // If some centers are looking out, but other centers
   // are looking in, we accept it and take no action.
   setup 4x2 2x4 qualifier tbone none
      array [   0 ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N    0]
   setup 2x4 2x4 qualifier tbone none
      array [   0 ZM1N ZM2N    0    0 ZM5N ZM6N    0]

   // From an alamo ring, find the people looking out.
   setup alamo 4x4 qualifier couples_only
      array [ZM13N ZM14N 0 0 ZM7N ZM11N 0 0]
   // Maybe they are rotated!
   setup alamo 4x4 qualifier magic_only plus_eighth_rotation
      array [10W 13N 0 0 7W 7N 0 0]

   // From an "O", find the people looking out.
   // This isn't very defensive.
   setup 4x4 4x4
      array [0 ZM3N ZM7N 0 0 ZM7N ZM11N 0 0 ZM11N ZM15N 0 0 ZM13N ZM14N 0]

   // The weird cases.
   setup rigger qtag
      array [ZM0N ZM1N ZM2N ZM3N    0    0 ZM6N ZM7N]
   setup prigger qtag
      array [   0    0 ZM2N ZM3N    0    0 ZM6N ZM7N]
   setup qtag qtag
      array [ZM0N ZM1N ZM2N ZM3N    0    0 ZM6N ZM7N]
   setup pqtag qtag
      array [   0    0 ZM2N ZM3N    0    0 ZM6N ZM7N]
   setup hrglass hrglass
      array [ZM0N ZM1N ZM2N ZM3N    0    0 ZM6N ZM7N]
   setup phrglass hrglass
      array [   0    0 ZM2N ZM3N    0    0 ZM6N ZM7N]
   setup dhrglass dhrglass
      array [   0    0 ZM2N ZM3N    0    0 ZM6N ZM7N]
   setup pdhrglass dhrglass
      array [   0 ZM1N ZM2N ZM3N ZM4N    0 ZM6N ZM7N]
   setup bone bone
      array [   0    0 ZM2N ZM3N    0    0 ZM6N ZM7N]
   setup pbone bone
      array [   0 ZM1N ZM2N ZM3N ZM4N    0 ZM6N ZM7N]

// This does a similar thing, when the caller has indicated
// who are supposed to cloverleaf.  It's easier.
// In fact, it's Mainstream.  Mainstream dancers don't know that
// there's an A1 definition of "clover and <anything>", the
// official definition of which says that it's the ends who
// have to do the cloverleaf.  They just know how to do it.
call "_prepare @6 to cloverleaf" dontshow tag prepare_to_clover
   setup 2x4 2x4 qualifier ends_sel
      array [   0 ZM1N ZM2N    0    0 ZM5N ZM6N    0]
   setup 4x2 2x4 qualifier ends_sel
      array [   0 ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N    0]
   setup 2x4 2x4 rotate qualifier centers_sel
      array [   0 ZM7W ZM0W    0 ZM2W    0    0 ZM5W]
   setup 4x2 2x4 rotate qualifier centers_sel
      array [ZM6W    0    0    0    0    0    0 ZM5W]
   setup rigger qtag qualifier centers_sel
      array [ZM0N ZM1N ZM2N ZM3N    0    0 ZM6N ZM7N]
   setup prigger qtag qualifier centers_sel
      array [   0    0 ZM2N ZM3N    0    0 ZM6N ZM7N]
   setup qtag qtag qualifier ends_sel
      array [ZM0N ZM1N ZM2N ZM3N    0    0 ZM6N ZM7N]
   setup pqtag qtag qualifier ends_sel
      array [   0    0 ZM2N ZM3N    0    0 ZM6N ZM7N]
   setup hrglass hrglass qualifier ends_sel
      array [ZM0N ZM1N ZM2N ZM3N    0    0 ZM6N ZM7N]
   setup phrglass hrglass qualifier ends_sel
      array [   0    0 ZM2N ZM3N    0    0 ZM6N ZM7N]
   setup dhrglass dhrglass qualifier ends_sel
      array [   0    0 ZM2N ZM3N    0    0 ZM6N ZM7N]
   setup pdhrglass dhrglass qualifier ends_sel
      array [   0 ZM1N ZM2N ZM3N ZM4N    0 ZM6N ZM7N]
   setup bone bone qualifier ends_sel
      array [   0    0 ZM2N ZM3N    0    0 ZM6N ZM7N]
   setup pbone bone qualifier ends_sel
      array [   0 ZM1N ZM2N ZM3N ZM4N    0 ZM6N ZM7N]

call "@6@C cloverleaf" mainstream
            dont_use_in_resolve cross_is_inherited
   seq prepare_to_clover [assumption_transparent]
   seq final_clover_and_nothing [inherit_cross]

call "@6@C cloverleaf while the others @0" mainstream
            dont_use_in_resolve cross_is_inherited
   seq prepare_to_clover [assumption_transparent]
   seq final_clover_and_anything [inherit_cross]

call "clover and @0" a1
            dont_use_in_resolve cross_is_inherited
   seq prepare_to_clover_no_sel [assumption_transparent normalize]
   seq final_clover_and_anything [inherit_cross]

call "eight by @0" c3a
            left_means_mirror twisted_is_inherited visible_fractions
   conc nullcall [mandatory_anycall] 8by [inherit_left inherit_twisted
                 suppress_elongation_warnings conc_demand_lines conc_force_otherway]

call "8 by @0" c3a
            dont_use_in_resolve left_means_mirror twisted_is_inherited visible_fractions
   conc nullcall [mandatory_anycall] 8by [inherit_left inherit_twisted
                 suppress_elongation_warnings conc_demand_lines conc_force_otherway]

call "rolling @0" c4
            first_part_visible dont_use_in_resolve
   seq roll []
   seq nullcall [mandatory_anycall finish_this_part]

call "flowing @0" c4
            first_part_visible dont_use_in_resolve
   seq withflow []
   seq nullcall [mandatory_anycall finish_this_part]

call "veering @0" c4
            first_part_visible dont_use_in_resolve
   seq veer_and_turn []
   seq nullcall [mandatory_anycall finish_this_part]

call "sweeping @0" c4
            first_part_visible dont_use_in_resolve
   seq circle4flow []
   seq nullcall [mandatory_anycall finish_this_part]

call "_fly away ctrs" dontshow tag flyback
   setup 2x2 2x2
      array [R3N R2N 0 0]

call "_fly away ends, @0" dontshow tag flyend
   seq trade []
   seq nullcall [mandatory_anycall]

call "fly away, new centers @0" c4x
            dont_use_in_resolve
   crossconc flyend [conc_demand_lines] flyback [conc_demand_lines conc_force_columns]

call "_ends detour" dontshow tag endsdetour
            fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq zoom [force_half]
   seq armturn_n4 [insert_number 1 inherit_fractal inherit_gensting]

call "_ends shadow box" dontshow tag endsshadow
   setup 2x2 2x2 restriction forbidden peelable_box
      array [AL0W CR1E CR2W AL3E]

call "detour" c2 tag detour
            fractal_is_inherited gen_sting_is_inherited
   conc ctrsdetour [inherit_fractal inherit_gensting conc_force_otherway]
        endsdetour [inherit_fractal inherit_gensting conc_demand_lines conc_force_spots endscando]

call "team up" c3a
   // Be a little less rigorous about where missing ends might have gone.
   // With two couple dancing, there will often be a lot of them.
   setup 4x2 2x4
      array [0 CR6S CR5S CR4S 0 ZM2N ZM1N 0]
            fractal_is_inherited gen_sting_is_inherited
   // The "force columns" makes the hingers stay together.
   conc beaurun [] half_circ_and_hinge [conc_force_columns endscando inherit_fractal inherit_gensting]

call "_tunnel part 1" dontshow tag tunnel1
           single_is_inherited
   maybesinglecrossconc vertical_half_tag [inherit_single conc_demand_columns]
                        partnertagbypairs [inherit_single conc_force_columns]

call "_tunnel thru part 1" dontshow tag tunnelthru1
           single_is_inherited
   maybesinglecrossconc verticaltag [inherit_single conc_demand_columns]
                        partnertagbypairs [inherit_single conc_force_columns]

call "_tunnel @h part 2" dontshow tag tunnel2
           single_is_inherited
   maybesingleconc quarter_maybe [] maybesingletrade [inherit_single]

call "_tunnel thru @h part 2" dontshow tag tunnelthru2
           single_is_inherited
   maybesingleconc face_dir [] maybesingletrade [inherit_single]

call "_tunnel @0 part 2" dontshow tag tunnela
   conc nullcall [mandatory_anycall] trade []

call "tunnel @h" c4a
           single_is_inherited
   seq tunnel1 [inherit_single]
   seq tunnel2 [inherit_single]

call "tunnel thru @h" c4a
           single_is_inherited
   seq tunnelthru1 [inherit_single]
   seq tunnelthru2 [inherit_single]

call "tunnel @0" c4a
           single_is_inherited
   seq tunnel1 [inherit_single]
   seq tunnela []

call "_start zip" dontshow tag startzip
   setup 2x2 2x2
      array [ACR0E CAL1W CR2W AL3E]

call "_start zip as you are" dontshow tag startzipasyouare
   setup 2x2 2x2
      array [AL0S CR1S 0 0]

call "_extend zip" dontshow tag extendzip
   setup 2x2 2x2
      array [R0E L1W M1N M0N]

call "_zipn" dontshow tag zipn
            neednumber
   seq startzip []
   seq extendzip [repeat_nm1]

call "_zipn as you are" dontshow tag zipnasyouare
            neednumber
   seq startzipasyouare []
   seq extendzip [repeat_nm1]

call "_zipn+1/2" dontshow tag zipnandhalf
            neednumber
   seq startzip []
   seq extendzip [repeat_nm1]
   seq touch []

call "_zipn+1/2 as you are" dontshow tag zipnandhalfasyouare
            neednumber
   seq startzipasyouare []
   seq extendzip [repeat_nm1]
   seq touch []

call "zip code @9, new centers @0" c2
            dont_use_in_resolve neednumber
   crossconc nullcall [mandatory_anycall] zipn [conc_demand_columns conc_force_lines]

call "centers go as you are, zip code @9, new centers @0" c2
            dont_use_in_resolve neednumber
   crossconc nullcall [mandatory_anycall] zipnasyouare [conc_demand_lines conc_force_lines]

call "zip code @9-1/2, new centers @0" c2
            dont_use_in_resolve neednumber yield_if_ambiguous
   crossconc nullcall [mandatory_anycall] zipnandhalf [conc_demand_columns conc_force_lines]

call "centers go as you are, zip code @9-1/2, new centers @0" c2
            dont_use_in_resolve neednumber yield_if_ambiguous
   crossconc nullcall [mandatory_anycall] zipnandhalfasyouare [conc_demand_lines conc_force_lines]

call "zip code @9" c2
            dont_use_in_resolve neednumber
   crossconc nullcall_noroll [] zipn [conc_demand_columns conc_force_lines]

call "centers go as you are, zip code @9" c2
            dont_use_in_resolve neednumber
   crossconc nullcall_noroll [] zipnasyouare [conc_demand_lines conc_force_lines]

call "zip code @9-1/2" c2
            dont_use_in_resolve neednumber yield_if_ambiguous
   crossconc nullcall_noroll [] zipnandhalf [conc_demand_columns conc_force_lines]

call "centers go as you are, zip code @9-1/2" c2
            dont_use_in_resolve neednumber yield_if_ambiguous
   crossconc nullcall_noroll [] zipnandhalfasyouare [conc_demand_lines conc_force_lines]

call "inner code @9" c4x
            dont_use_in_resolve neednumber
   conc zipn [] nullcall [conc_force_spots]

call "outer code @9" c4x
            dont_use_in_resolve neednumber
   conc nullcall [] zipn [conc_demand_columns conc_force_lines]

call "_finish hoop-de-do" dontshow tag hoopdedo
   seq startzip []
   seq star_thru []

call "hoop-de-do, new centers @0" c4x
            dont_use_in_resolve
   crossconc nullcall [mandatory_anycall] hoopdedo [conc_demand_columns conc_force_spots]

call "@6 rip n snort" c4x
   setup 4x4 4x4
      predsnoselect
         if select               [0 0 0 0 0 CR5N AL6N 0 0 0 0 0 0 0 0 0]
         if person_select_plus4  [0 0 0 0 0 CR5N CR6N 0 0 0 0 0 0 0 0 0]
         if person_select_plus8  [0 0 0 0 0 AL5N CR6N 0 0 0 0 0 0 0 0 0]
         if person_select_plus12 [0 0 0 0 0 AL5N AL6N 0 0 0 0 0 0 0 0 0]

call "acey deucey" plus tag aceydeucey
            fudge_to_q_tag
            left_means_mirror half_is_inherited yoyo_is_inherited gen_sting_is_inherited
            magic_is_inherited funny_is_inherited mxn_is_inherited
   conc6p_or_normal_or_2x6_2x3
                    trade_w_tbone    [inherit_left inherit_half inherit_funny inherit_yoyo
                                      inherit_gensting suppress_elongation_warnings]
                    circulateforacey [or_anycall inherit_left inherit_half inherit_magic
                                      inherit_funny inherit_mxn conc_force_spots endscando]

call "6X2 acey deucey" a1
            fudge_to_q_tag yield_if_ambiguous
            half_is_inherited yoyo_is_inherited gen_sting_is_inherited magic_is_inherited funny_is_inherited
   conc2_6 trade [inherit_half inherit_yoyo inherit_gensting or_anycall]
           circulate [inherit_half inherit_magic inherit_funny]

call "3X2 acey deucey" c1
            fudge_to_q_tag yield_if_ambiguous
            yoyo_is_inherited gen_sting_is_inherited funny_is_inherited
   conc2_6 trade [inherit_yoyo inherit_gensting] trngle_circ [or_anycall inherit_funny]


call "mix the deucey" c4a
   seq mix []
   seq aceydeucey []

call "trade the deucey" c3a tag trade_duck
   setup 2x4 2x4
      array [CR2S CM3S AM0S AL1S ZM2N AM7S CM4S ZM1N]
   setup 4x2 2x4 rotate
      array [ZM5W CM4E CM3E 0 0 AM0E AM7E ZM6W]
   setup qtag ptpd
      array [0 0 AM6S CM4S 0 0 CM2S AM0S]
   setup pqtag ptpd
      array [ZM7N CR5S 0 0 AL7S ZM5N 0 0]

call "mix the deal" c4a
            single_is_inherited
   maybesingleconc wheelanddeal [inherit_single] wheelanddeal [inherit_single]

call "mix the turn and deal" c4
            single_is_inherited
   maybesingleconc turnanddeal [inherit_single] natturnanddeal [inherit_single]

call "_o-late" dontshow tag olate
   setup 2x4 2x4
      array [CM6S ZM0N ZM3N AM5S AACR6N ZM4N ZM7N CCAL5N]
   setup qtag ptpd
      array [0 0 ZM4N ZM6N 0 0 ZM0N ZM2N]
   setup pqtag ptpd
      array [CCAL3N CCM1S 0 0 AAM3S AACR1N 0 0]
   setup thar thar
      array [CCAL7E ZM0N 0 0 AACR7W ZM4N 0 0]

call "swing-o-late" c3
            visible_fractions step_to_wave yoyo_is_inherited
            gen_sting_is_inherited left_means_touch_or_check
   seq checkawaventrade [inherit_yoyo inherit_gensting]
   seq any_hand_slip [inherit_yoyo inherit_gensting]
   seq olate []

call "@0-o-late" c3
   seq nullcall [mandatory_anycall]
   seq olate []

call "_finish snap the lock" dontshow tag finsnaplock
   setup 4x2 2x4
      array [CM7E CM5E 0 CM4E AM3W 0 AM2W AM0W]
   setup 2x4 2x4
      array [0 0 0 0 0 AM1W CM2E 0]
   setup rigger rigger
      array [0 0 AM3W CM2E AM0W CM1E CM7E AM6W]
   setup prigger rigger
      array [CM4E 0 0 0 0 AM1W 0 0]
            alternate_definition [single] c4
   setup 2x2 2x2
      array [CM1E AM0W AM3W CM2E]
            alternate_definition [3x3] c4
   setup 6x2 2x6
      array [0 CM8E 0 CM7E 0 CM6E AM5W 0 AM4W 0 AM3W 0]
            alternate_definition [4x4] c4
   setup 8x2 2x8
      array [0 CM11E 0 CM10E 0 CM9E 0 CM8E AM7W 0 AM6W 0 AM5W 0 AM4W 0]
            alternate_definition [1x3] c4
   setup 4x2 2x4
      preds "Not in correct kind of columns."
         if antitandem_side_of_out_3n1_col [0 CM6E    0 CM4E AM3W    0 AM1W 0]
         if tandem_side_of_out_3n1_col     [0    0 CM5E CM4E AM3W AM2W    0 0]
            alternate_definition [3x1] c4    /* Same as 1x3. */
   setup 4x2 2x4
      preds "Not in correct kind of columns."
         if antitandem_side_of_out_3n1_col [0 CM6E    0 CM4E AM3W    0 AM1W 0]
         if tandem_side_of_out_3n1_col     [0    0 CM5E CM4E AM3W AM2W    0 0]

call "snap the lock" c3a
            visible_fractions funny_is_inherited single_is_inherited bigmatrix_is_inherited
            mxn_is_inherited nxn_is_inherited
   seq partnertag_w_cross [inherit_funny inherit_mxn inherit_nxn inherit_bigmatrix]
   seq finsnaplock [inherit_funny inherit_single inherit_mxn inherit_nxn inherit_bigmatrix]

call "_ctrs fan chain thru" dontshow tag ctrs_fanchainthru
            fractal_is_inherited gen_sting_is_inherited
   seq cast_off_n4_with_warn [insert_number 3 inherit_fractal inherit_gensting]
   seq any_hand_slip [roll_transparent inherit_gensting]
   seq cast_off_n4_with_warn [insert_number 3 inherit_fractal inherit_gensting]

call "_ends fan tag the deucey part 2" dontshow tag ends_fantag2
   seq partnertag []
   seq quarter_right []
   seq circulate []

call "_ends fan tag the deucey @h part 2" dontshow tag ends_fantag2dir
   seq partnertag []
   seq quarter_maybe []
   seq circulate []

call "_fan tag the deucey part 2" dontshow tag fantag2
            fractal_is_inherited
   conc ctrs_fanchainthru [inherit_fractal] ends_fantag2 [conc_demand_lines conc_force_spots]

call "_fan tag the deucey @h part 2" dontshow tag fantag2dir
            fractal_is_inherited
   conc ctrs_fanchainthru [inherit_fractal] ends_fantag2dir [conc_demand_lines conc_force_spots]

call "fan tag the deucey" c4 tag fantagduck
            step_to_wave left_means_touch_or_check
   seq fantag2 []

call "fan tag the deucey @h" c4 tag fantagduckdir
            step_to_wave left_means_touch_or_check
   seq fantag2dir []

call "spin tag the deucey" c4a       /* Andy B. loves this call. */
            step_to_wave yoyo_is_inherited gen_sting_is_inherited can_be_fan left_means_touch_or_check first_part_visible
   seq trade [inherit_yoyo inherit_gensting]
   seq checkline []
   seq fantagduck []

call "spin tag the deucey @h" c4a
            step_to_wave yoyo_is_inherited gen_sting_is_inherited can_be_fan left_means_touch_or_check first_part_visible
   seq trade [inherit_yoyo inherit_gensting]
   seq checkline []
   seq fantagduckdir []

call "_check line" dontshow tag checkline
            12_16_matrix_means_split
   setup 1x4 1x4
      array [ZM0N ZM1N ZM2N ZM3N]

call "_check line, unusual" dontshow tag checkline_unusual
   setup 1x4 1x4
      array [ZM0N ZM1N ZM2N ZM3N]
   setup 2x2 2x2 restriction unusual alwaysfail
      array [ZM0N ZM1N ZM2N ZM3N]
   setup 1x2 1x2 restriction unusual alwaysfail
      array [ZM0N ZM1N]
            alternate_definition [diamond] c3a
   setup dmd dmd restriction unusual alwaysfail
      array [ZM0N ZM1N ZM2N ZM3N]
   // This is so we can do "central fan chain thru".  It is illegal
   // if the ends try to do anything.
   conc nullcall [] boguscall []

call "_check line or thar, unusual" dontshow tag checklineorthar_unusual
   setup 1x4 1x4
      array [ZM0N ZM1N ZM2N ZM3N]
   setup 2x2 2x2 restriction unusual alwaysfail
      array [ZM0N ZM1N ZM2N ZM3N]
   setup 1x2 1x2 restriction unusual alwaysfail
      array [ZM0N ZM1N]
   setup thar thar
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup crosswave crosswave
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup pcrosswave crosswave
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]

call "_check parallel lines" dontshow tag checkparlines
   setup 2x4 2x4
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   // This will allow "spin chain the gears" from a tidal wave, for those who
   // think it's legal, but will give a serious warning.
   setup 1x4 1x4 restriction controversial alwaysfail
      array [ZM0N ZM1N ZM2N ZM3N]
            alternate_definition [12matrix] c3a
   setup 3x4 3x4
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N ZM10N ZM11N]
            alternate_definition [16matrix] c3a
   setup 4x4 4x4
      array [ZM0N ZM1N  ZM2N  ZM3N  ZM4N  ZM5N  ZM6N  ZM7N
             ZM8N ZM9N ZM10N ZM11N ZM12N ZM13N ZM14N ZM15N]

call "_check a wave" dontshow tag checkawave
            overcast_transparent
   setup 1x4 1x4 restriction unusual wave_unless_say_2faced
      array [ZM0N ZM1N ZM2N ZM3N]
   setup 1x2 1x2 restriction unusual wave_unless_say_2faced
      array [ZM0N ZM1N]

call "_check parallel waves" dontshow tag checkparwaves
   setup 2x4 2x4 restriction unusual wave_unless_say_2faced
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   // This will allow "spin chain the gears" from a tidal wave, for those who
   // think it's legal, but will give a serious warning.
   setup 1x8 1x8 restriction controversial alwaysfail
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   // If we do things like "intially tandem", we get this one.
   setup 1x4 1x4 restriction unusual wave_unless_say_2faced
      array [ZM0N ZM1N ZM2N ZM3N]
            alternate_definition [12matrix] c3a
   setup 3x4 3x4 restriction unusual wave_unless_say_2faced
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N ZM8N ZM9N ZM10N ZM11N]
            alternate_definition [16matrix] c3a
   setup 4x4 4x4 restriction unusual wave_unless_say_2faced
      array [ZM0N ZM1N  ZM2N  ZM3N  ZM4N  ZM5N  ZM6N  ZM7N
             ZM8N ZM9N ZM10N ZM11N ZM12N ZM13N ZM14N ZM15N]

call "_trade and check line, unusual" dontshow tag tradencheckline_unusual
            yoyo_is_inherited gen_sting_is_inherited bigmatrix_is_inherited diamond_is_legal
   // We don't allow inheriting half here.  If one could say "initially half,
   // rims trade back" (or "initially snag", or whatever), the rims/hubs
   // identification would get confused.
   seq trade [inherit_yoyo inherit_gensting inherit_diamond inherit_bigmatrix]
   seq checkline_unusual [roll_transparent inherit_diamond inherit_bigmatrix]

call "_trade and check line or thar, unusual" dontshow tag tradenchecklineorthar_unusual
            yoyo_is_inherited gen_sting_is_inherited bigmatrix_is_inherited half_is_inherited
   seq trade [inherit_yoyo inherit_gensting inherit_half inherit_bigmatrix]
   seq checklineorthar_unusual [roll_transparent inherit_bigmatrix]

call "_trade and check line, illegal" dontshow tag tradencheckline_illegal
            yoyo_is_inherited gen_sting_is_inherited bigmatrix_is_inherited
   seq trade_for_8_person_call [inherit_yoyo inherit_gensting inherit_bigmatrix]
   seq checkline [inherit_bigmatrix roll_transparent]

// This raises "do your part", and hence is not allowed during a resolve,
//   if the setup isn't a wave.
call "trade, should be a wave" dontshow tag checkawaventrade
            half_is_inherited lasthalf_is_inherited yoyo_is_inherited gen_sting_is_inherited bigmatrix_is_inherited
   seq checkawave [roll_transparent inherit_bigmatrix]
   seq trade_or_swing_half [inherit_half inherit_yoyo inherit_gensting inherit_bigmatrix]

// This raises "do your part", and hence is not allowed during a resolve,
//   if the setup isn't waves.
call "trade, should be parallel waves" dontshow tag tradencheckparwaves
            half_is_inherited yoyo_is_inherited gen_sting_is_inherited bigmatrix_is_inherited
   seq checkparwaves [roll_transparent inherit_bigmatrix]
   seq trade_for_8_person_call [inherit_half inherit_yoyo inherit_gensting inherit_bigmatrix]

call "_check par lines and fan back" dontshow tag checkparlinesnfanback
            fractal_is_inherited gen_sting_is_inherited
   seq checkparlines [roll_transparent]
   seq fanback [inherit_fractal inherit_gensting]

call "_rims trade part 2" dontshow tag rims_trade_2
            yoyo_is_inherited gen_sting_is_inherited bigmatrix_is_inherited
   select_original_rims box_circulate_maybe_diamond [or_anycall] nullcall []

call "_hubs trade part 2" dontshow tag hubs_trade_2
            yoyo_is_inherited gen_sting_is_inherited bigmatrix_is_inherited
   select_original_hubs box_circulate_maybe_diamond [or_anycall] nullcall []

call "_rims trade @0 part 2" dontshow tag rims_trade_2_any
            yoyo_is_inherited gen_sting_is_inherited bigmatrix_is_inherited
   select_original_rims nullcall [mandatory_anycall] nullcall []

call "_hubs trade @0 part 2" dontshow tag hubs_trade_2_any
            yoyo_is_inherited gen_sting_is_inherited bigmatrix_is_inherited
   select_original_hubs nullcall [mandatory_anycall] nullcall []

call "rims trade @2back@3" c2
            visible_fractions yoyo_is_inherited gen_sting_is_inherited bigmatrix_is_inherited
   seq_with_split_1x8_id tradenchecklineorthar_unusual
            [seq_never_re_evaluate inherit_yoyo inherit_gensting]
   seq rims_trade_2
            [inherit_yoyo inherit_gensting inherit_bigmatrix]

call "hubs trade @2back@3" c2
            visible_fractions yoyo_is_inherited gen_sting_is_inherited bigmatrix_is_inherited
   seq_with_split_1x8_id tradenchecklineorthar_unusual
            [seq_never_re_evaluate inherit_yoyo inherit_gensting]
   seq hubs_trade_2
            [inherit_yoyo inherit_gensting inherit_bigmatrix]

call "rims trade @0" c2
            visible_fractions yoyo_is_inherited gen_sting_is_inherited bigmatrix_is_inherited dont_use_in_resolve
   seq_with_split_1x8_id tradenchecklineorthar_unusual
            [seq_never_re_evaluate inherit_yoyo inherit_gensting inherit_bigmatrix]
   seq rims_trade_2_any
            [inherit_yoyo inherit_gensting inherit_bigmatrix roll_transparent]

call "hubs trade @0" c2
            visible_fractions yoyo_is_inherited gen_sting_is_inherited bigmatrix_is_inherited dont_use_in_resolve
   seq_with_split_1x8_id tradenchecklineorthar_unusual
            [seq_never_re_evaluate inherit_yoyo inherit_gensting inherit_bigmatrix]
   seq hubs_trade_2_any
            [inherit_yoyo inherit_gensting inherit_bigmatrix roll_transparent]

call "round off" c4
   setup 2x4 2x4
      array [AL1E AL0E CR3W CR2W 0 0 0 0]
            alternate_definition [3x3] c4
   setup 2x6 2x6
      array [AL2E AL1E AL0E CR5W CR4W CR3W 0 0 0 0 0 0]
            alternate_definition [4x4] c4
   setup 2x8 2x8
      array [AL3E AL2E AL1E AL0E CR7W CR6W CR5W CR4W 0 0 0 0 0 0 0 0]
            alternate_definition [single] c4
   setup 2x2 2x2
      array [AL0E CR1W 0 0]

call "round and cross" c4
   setup 2x4 2x4
      array [AL6E AL7E CR4W CR5W 0 0 0 0]
            alternate_definition [3x3] c4
   setup 2x6 2x6
      array [AL9E AL10E AL11E CR6W CR7W CR8W 0 0 0 0 0 0]
            alternate_definition [4x4] c4
   setup 2x8 2x8
      array [AL12E AL13E AL14E AL15E CR8W CR9W CR10W CR11W 0 0 0 0 0 0 0 0]
            alternate_definition [single] c4
   setup 2x2 2x2
      array [AL3E CR2W 0 0]

call "_round the horn, mostly" dontshow tag roundthehornmostly
   setup 2x4 2x4
     array [AL1E AL0S CR3S CR2W 0 0 0 0]

call "round the horn" c4
            twisted_is_inherited visible_fractions
   seq roundthehornmostly [inherit_twisted]  // Must say "finally twisted".
   seq passthru [inherit_twisted]

call "_clover the horn, mostly" dontshow tag cloverthehornmostly
   setup 4x2 2x4 rotate
      array [0 0 AM0E AM1N CM2S CM3E 0 0]
            alternate_definition [cross] c4
   setup 4x2 2x4 rotate
      array [0 0 CM3E CM2S AM1N AM0E 0 0]

call "clover the horn" c4
            twisted_is_inherited cross_is_inherited visible_fractions
   // Must say "finally twisted".
   seq cloverthehornmostly [inherit_cross inherit_twisted]
   seq passthru [inherit_twisted]

call "fan chain thru" c3
            step_to_wave left_means_touch_or_check visible_fractions
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq checkline_and_ctrs_boxy_cast_3_4 [inherit_fractal inherit_gensting]
   seq ctrs_slip_with_mod [inherit_yoyo inherit_gensting roll_transparent]
   seq ctrs_cast_3_4_with_warn [inherit_fractal inherit_gensting]

call "spin chain thru" mainstream
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited can_be_fan
            left_means_touch_or_check visible_fractions bigmatrix_is_inherited
   seq tradencheckparwaves [inherit_yoyo inherit_gensting inherit_bigmatrix]
   seq ctrarmturn_n [inherit_bigmatrix insert_number 3 inherit_gensting inherit_fractal]
   seq ctrs_slip_with_mod1216 [inherit_bigmatrix roll_transparent]
   seq ctrarmturn_n [inherit_bigmatrix insert_number 3 inherit_gensting inherit_fractal]

call "swing chain thru" c3a
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited can_be_fan
            left_means_touch_or_check visible_fractions bigmatrix_is_inherited
   seq tradencheckparwaves [inherit_yoyo inherit_gensting inherit_bigmatrix]
   seq ctrarmturn_n [inherit_bigmatrix insert_number 1 inherit_gensting inherit_fractal]
   seq ctrs_slip_with_mod1216 [inherit_bigmatrix roll_transparent]
   seq ctrarmturn_n [inherit_bigmatrix insert_number 1 inherit_gensting inherit_fractal]

call "_counteract part 1" dontshow tag counteract1
            yoyo_is_inherited gen_sting_is_inherited
   // Inheriting yoyo to the centers will make it fail, of course.  This is
   // only legal if the yoyo modifier is given just to the outsides.
   conc ctr_rot [inherit_yoyo inherit_gensting] trade [inherit_yoyo inherit_gensting conc_demand_columns conc_force_spots]

call "_counteract part 2" dontshow tag counteract2
   setup 4x2 c1phan
      array [CR2E CR3S CR9S CR8E AL5W AL4S AL14S AL15W]
   setup 2x4 2x4
      array [CR1E CR3S AL0S AL2W AL3W AL5S CR6S CR0E]
            gen_sting_is_inherited   // Unused token, just to separate the two definitions.
   // This definition will only be legal in two couple mode.
   crossconc ctract_endtoctr []    // Because these people wouldn't be able to do anything.
             ctract_ctrtoend []

call "_centers counteract" dontshow tag ctract_ctrtoend
// This is the real thing.
   setup 2x2 2x4 qualifier miniwaves
      array [CR3S AL0S AL5S CR6S]

call "_ends counteract" dontshow tag ctract_endtoctr
   // Can't use concentric definition of counteract except in two couple mode.
   setup 2x2 2x2
      array [0 0 0 0]

call "counteract" c4a
   setup 4x2 2x4 restriction forbidden wave_only
      array [CR0W CR2W CR7W CR5W AL2E AL0E AL5E AL7E]
   // These are ambiguous and algorithmically ineffective.
   // But the dancers seem to like them.
            alternate_definition [3x3 12matrix] c4
   setup 6x2 2x6 restriction forbidden wave_only
      array [CR0W CR2W CR4W CR11W CR9W CR7W
            AL4E AL2E AL0E AL7E AL9E AL11E]
            alternate_definition [4x4 16matrix] c4
   setup 8x2 2x8 restriction forbidden wave_only
      array [CR0W CR2W CR4W CR6W CR15W CR13W CR11W CR9W
            AL6E AL4E AL2E AL0E AL9E AL11E AL13E AL15E]
            alternate_definition [single] c4
   setup 2x2 2x2 restriction forbidden wave_only
      array [CR2W AL3E AL2E CR3W]
            visible_fractions yoyo_is_inherited gen_sting_is_inherited
   seq counteract1 [inherit_yoyo inherit_gensting]
   seq counteract2 [normalize]

call "_centers 3/4 / ends half-circ, to star" dontshow tag motivate2
            bigmatrix_is_inherited fractal_is_inherited
   maybematrix_conc_star first_cast_off_34 [allow_forced_mod inherit_fractal]
                         half_circ_real_box []

// This one differs from "motivate2" only in that one can step to a wave on "fan relay the top".
call "_relay the top part 2" dontshow tag relaytop2
            step_to_wave bigmatrix_is_inherited fractal_is_inherited gen_sting_is_inherited
   maybematrix_conc_star first_cast_off_34 [allow_forced_mod inherit_fractal inherit_gensting]
                         half_circ_real_box []

// This one has a pretty name, because it will be shown in "do you want to replace?"
// messages.  So we show it as "first cast off 3/4".
call "first cast off 3/4" dontshow tag first_cast_off_34
            fractal_is_inherited gen_sting_is_inherited
   seq armturn_n4 [insert_number 3 inherit_fractal inherit_gensting]

call "@1motivate@S" a2
            bigmatrix_is_inherited visible_fractions fractal_is_inherited gen_sting_is_inherited
   seq circulate [inherit_bigmatrix or_anycall]
   seq motivate2 [inherit_bigmatrix inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_bigmatrix insert_number 2]
   seq finishwithplainmod [inherit_bigmatrix inherit_fractal inherit_gensting]

call "@T motivate@S" c2
            bigmatrix_is_inherited visible_fractions fractal_is_inherited gen_sting_is_inherited
   seq circulate [inherit_bigmatrix mandatory_anycall]
   seq motivate2 [inherit_bigmatrix inherit_fractal]
   seq turndmdn_endstrade [inherit_bigmatrix insert_number 2]
   seq finishwithplainmod [inherit_bigmatrix inherit_fractal inherit_gensting]

call "@N motivate@S" c2
            bigmatrix_is_inherited visible_fractions fractal_is_inherited gen_sting_is_inherited
   seq circnullcall [inherit_bigmatrix or_anycall]
   seq motivate2 [inherit_bigmatrix inherit_fractal]
   seq turndmdn_endstrade [inherit_bigmatrix insert_number 2]
   seq finishwithplainmod [inherit_bigmatrix inherit_fractal inherit_gensting]

// But you can say "motivate but [...]", because it's clear (well,
// it's clear to any group that you have any business calling this to)
// which cast off is being referred to.
call "motivate@S but @m" a2
            visible_fractions fractal_is_inherited
   seq circulate []
   seq motivate2 [inherit_fractal]
   seq turndmdn_endstrade [insert_number 2]
   seq finishwithmodbut2nd []

call "@T motivate@S but @m" c2
            visible_fractions fractal_is_inherited
   seq circulate [mandatory_anycall]
   seq motivate2 [inherit_fractal]
   seq turndmdn_endstrade [insert_number 2]
   seq finishwithmodbut2nd []

call "@N motivate@S but @m" c2
            visible_fractions fractal_is_inherited
   seq circnullcall [or_anycall]
   seq motivate2 [inherit_fractal]
   seq turndmdn_endstrade [insert_number 2]
   seq finishwithmodbut2nd []

call "relay the top@S" c1
            step_to_wave yoyo_is_inherited can_be_fan left_means_touch_or_check visible_fractions
            bigmatrix_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq tradencheckline_illegal [inherit_yoyo inherit_gensting inherit_bigmatrix]
   seq relaytop2 [inherit_bigmatrix inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_bigmatrix insert_number 1 inherit_fractal]
   seq finishwithplainmod [inherit_bigmatrix inherit_fractal inherit_gensting]

call "relay the top@S but @m" c1
            step_to_wave yoyo_is_inherited gen_sting_is_inherited can_be_fan left_means_touch_or_check
            visible_fractions fractal_is_inherited
   seq tradencheckline_illegal [inherit_yoyo inherit_gensting]
   seq relaytop2 [inherit_fractal]
   seq turndmdn_endstrade [insert_number 1 inherit_fractal]
   seq finishwithmodbut2nd []

call "@9-@9-@9-@9 relay the top" c4a
            step_to_wave left_means_touch_or_check visible_fractions
            need_four_numbers bigmatrix_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq armturn_n4 [inherit_bigmatrix inherit_yoyo inherit_fractal inherit_gensting]
   seq quarterdeucey2 [inherit_bigmatrix shift_one_number]
   seq turndmdn_endstrade [inherit_bigmatrix shift_two_numbers]
   seq quarterdeucey4 [inherit_bigmatrix shift_three_numbers]

call "@b cast and relay@S" c3
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            can_be_fan left_means_touch_or_check
            first_and_last_parts_visible neednumber bigmatrix_is_inherited
   seq armturn_n4 [inherit_bigmatrix inherit_yoyo inherit_fractal inherit_gensting]
   seq checkline [inherit_bigmatrix roll_transparent]
   seq relaytop2 [inherit_bigmatrix]
   seq turndmdn_endstrade [inherit_bigmatrix inherit_yoyo inherit_gensting]
   seq finishwithplainmod [inherit_bigmatrix inherit_fractal inherit_gensting]

call "@b cast and relay@S but @m" c3
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            can_be_fan left_means_touch_or_check
            first_and_last_parts_visible neednumber bigmatrix_is_inherited
   seq armturn_n4 [inherit_bigmatrix inherit_yoyo inherit_fractal inherit_gensting]
   seq checkline [inherit_bigmatrix roll_transparent]
   seq relaytop2 [inherit_bigmatrix]
   seq turndmdn_endstrade [inherit_bigmatrix inherit_yoyo inherit_gensting]
   seq finishwithmodbut2nd [inherit_bigmatrix inherit_fractal inherit_gensting]

call "fan chain the gears@S" c3 tag fan_chain_gears
            step_to_wave fractal_is_inherited gen_sting_is_inherited
   seq checkparlinesnfanback [inherit_fractal inherit_gensting]
   seq veryctr2trade [inherit_gensting]  // Of course, anyone who tried to apply generous/stingy here would lose.
   seq turnstarn_fudge [inherit_fractal insert_number 3]
   seq veryctr2trade [inherit_gensting]
   // The final ends U-turn away, not toward the center.
   // Callerlab plus definitions, page 6.
   seq ctrarmturn_n4_utaway [inherit_fractal inherit_gensting insert_number 3]

// Is this legal from a tidal wave?  Some people think so, based on their careful reading
// of the Callerlab definition.  The Callerlab definition says that it starts in parallel
// waves.  Of course, as challenge callers, we ignore that.  Then it says to trade, and the
// centers of each wave cast 3/4 while the others U-turn back.  OK so far.  But then it
// expects a "center wave", with the centers of that center wave trading.  That doesn't work.
// Then the stars turn, and all finish.  That's OK.  But the "centers of the center wave"
// trading doesn't work.  If it had been written as "center 2", it would be OK.
// Because of this, this is marked "controversial" if called from a tidal setup.
call "spin chain the gears@S" plus
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited can_be_fan
            left_means_touch_or_check first_part_visible visible_fractions
   seq tradencheckparwaves [inherit_yoyo inherit_gensting]
   seq checkparlinesnfanback [inherit_fractal inherit_gensting]
   seq veryctr2trade [inherit_gensting]
   seq turnstarn_fudge [inherit_fractal insert_number 3]
   seq veryctr2trade [inherit_gensting]
   // The final ends U-turn away, not toward the center.
   // Callerlab plus definitions, page 6
   seq ctrarmturn_n4_utaway [inherit_fractal inherit_gensting insert_number 3]

call "spin chain the gears@S but @m" c1
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited can_be_fan
            left_means_touch_or_check first_part_visible visible_fractions
   seq tradencheckparwaves [inherit_yoyo inherit_gensting]
   seq checkparlinesnfanback [inherit_fractal inherit_gensting]
   seq veryctr2trade [inherit_gensting]
   seq turnstarn_fudge [inherit_fractal insert_number 3]
   seq veryctr2trade [inherit_gensting]
   seq ctr_but_utaway []

call "@9-@9-@9-@9 spin chain the gears" c4
            step_to_wave left_means_touch_or_check visible_fractions
            need_four_numbers yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq armturn_n4 [inherit_yoyo inherit_gensting inherit_fractal]
   seq ctrarmturn_n4_utb [shift_one_number]
   seq veryctr2trade [inherit_gensting]
   seq turnstarn_fudge [inherit_fractal shift_two_numbers]
   seq veryctr2trade [inherit_gensting]
   seq ctrarmturn_n4_utaway [inherit_yoyo inherit_fractal inherit_gensting shift_three_numbers]

call "swing chain the gears@S" c4
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited can_be_fan
            left_means_touch_or_check first_part_visible
   seq tradencheckparwaves [inherit_yoyo inherit_gensting]
   seq youall [inherit_fractal inherit_gensting]
   seq veryctr2trade [inherit_gensting]
   seq turnstarn_fudge [inherit_fractal insert_number 1]
   seq veryctr2trade [inherit_gensting]
   seq ctrarmturn_n4_utaway [inherit_yoyo inherit_gensting insert_number 1]

call "swing chain the gears@S but @m" c4
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited can_be_fan
            left_means_touch_or_check first_part_visible
   seq tradencheckparwaves [inherit_yoyo inherit_gensting]
   seq youall [inherit_fractal inherit_gensting]
   seq veryctr2trade [inherit_gensting]
   seq turnstarn_fudge [inherit_fractal insert_number 1]
   seq veryctr2trade [inherit_gensting]
   seq ctr_but_utaway []

call "fan chain and exchange the gears@S" c3 tag fan_chain_exch_gears
            step_to_wave left_means_touch_or_check fractal_is_inherited gen_sting_is_inherited
   seq checkparlinesnfanback [inherit_fractal inherit_gensting]
   seq veryctr2trade [inherit_gensting]
   seq turnstarn_fudge [inherit_fractal insert_number 3]
   seq exchdmd [insert_number 3]
   // Yeah, this gets the roll information wrong.  Tough.
   seq flipdiamond [force_intlk no_check_mod_level]

// See comment about "spin chain the gears".
call "spin chain and exchange the gears@S" plus
            step_to_wave yoyo_is_inherited gen_sting_is_inherited can_be_fan
            left_means_touch_or_check first_part_visible
   seq tradencheckparwaves [inherit_yoyo inherit_gensting]
   seq fan_chain_exch_gears []

call "fan chain and circulate the gears@S" c4
            step_to_wave left_means_touch_or_check yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq checkparlinesnfanback [inherit_fractal inherit_gensting]
   seq lines_slip_thru [inherit_yoyo inherit_gensting]
   seq turnstarn_fudge [inherit_fractal insert_number 3]
   seq veryctr2trade [inherit_gensting]
   seq ctrarmturn_n4_utaway [inherit_gensting insert_number 3]
   seq ends_circ []

call "spin chain and circulate the gears@S" c4
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited can_be_fan
            left_means_touch_or_check first_part_visible
   seq tradencheckparwaves [inherit_yoyo inherit_gensting]
   seq checkparlinesnfanback [inherit_fractal inherit_gensting]
   seq lines_slip_thru [inherit_yoyo inherit_gensting]
   seq turnstarn_fudge [inherit_fractal insert_number 3]
   seq veryctr2trade [inherit_gensting]
   seq ctrarmturn_n4_utaway [inherit_gensting insert_number 3]
   seq ends_circ []

call "scoot back" mainstream tag scootback
            fudge_to_q_tag
   // Note to self:  This clearly ought to say "forbidden" rather than just raising
   // a "do your part" warning.  But don't change it.  It is this way in order
   // to catch careless people, and is mentioned in the FAQ.
   setup 2x2 2x2 restriction wave_only
      array [CR1S AL0S AM3S CM2S]
   setup dmd dmd qualifier right pu_qtag_like restriction serious_violation alwaysfail
      array [C2S 0 0 C3S]
   setup dmd dmd qualifier left pu_qtag_like restriction serious_violation alwaysfail
      array [0 0 A0S A3S]
   setup pmd dmd qualifier right dmd_ctrs_mwv
      array [CM0S CM3S 0 0]
   setup pmd dmd qualifier left dmd_ctrs_mwv
      array [AM0S 0 0 AM1S]
   setup star star restriction controversial alwaysfail
      array [C2S 0 A0S 3S]   // In a star?  Yeah, we sort of allow it.  See nd05.
   setup pmd dmd
      array [C0S 0 0 0]   // Nobody home?  Ends can still sort of do it.
            alternate_definition [cross] c4
   setup pmd dmd qualifier right dmd_ctrs_mwv
      array [A0S A1S 0 0]
   setup pmd dmd qualifier left dmd_ctrs_mwv
      array [C0S 0 0 C3S]
            alternate_definition [yoyo] c4
   setup qtag qtag rotate qualifier right dmd_ctrs_mwv
      array [0 0   0 C7S C2S C4S C5S   0]
   setup qtag qtag rotate qualifier left dmd_ctrs_mwv
      array [0 0 A0N   0 A1N A2N   0 A7N]
            alternate_definition [generous] c3
   setup qtag qtag rotate qualifier right dmd_ctrs_mwv
      array [0 0   0 C7S C2S C4S C5S   0]
   setup qtag qtag rotate qualifier left dmd_ctrs_mwv
      array [0 0 A0N   0 A1N A2N   0 A7N]
            alternate_definition [stingy] c3
   setup qtag qtag rotate qualifier right dmd_ctrs_mwv
      array [0 0   0 C0N C1N C3N C6N   0]
   setup qtag qtag rotate qualifier left dmd_ctrs_mwv
      array [0 0 A6S   0 A3S A4S   0 A5S]
            alternate_definition [interlocked] c3a
   setup qtag qtag qualifier right 2fl_only
      array [0 0    0    0 CM4S CM5S CM3S CM2S]
   setup qtag qtag qualifier left 2fl_only
      array [0 0 AM7S AM6S AM4S AM5S    0    0]
            alternate_definition [scatter] c1
   setup 2x4 2x4 qualifier ntbone none restriction forbidden wave_only
      array [CR3S CR2S AL1S AL0S AM5S CM4S AM7S CM6S]
            alternate_definition [yoyo interlocked] c4
   setup qtag qtag rotate qualifier right 2fl_only
      array [0 0    0    0 CM2S CM4S CM5S CM3S]
   setup qtag qtag rotate qualifier left 2fl_only
      array [0 0 AM0N AM3N AM1N AM2N    0    0]
            alternate_definition [generous interlocked] c3
   setup qtag qtag rotate qualifier right 2fl_only
      array [0 0    0    0 CM2S CM4S CM5S CM3S]
   setup qtag qtag rotate qualifier left 2fl_only
      array [0 0 AM0N AM3N AM1N AM2N    0    0]
            alternate_definition [stingy interlocked] c3
   setup qtag qtag rotate qualifier right 2fl_only
      array [0 0    0    0 CM1N CM7N CM6N CM0N]
   setup qtag qtag rotate qualifier left 2fl_only
      array [0 0 AM6S AM5S AM7S AM4S    0    0]
            alternate_definition [grand] c3
   setup pspindle spindle qualifier right dmd_ctrs_mwv
      array [C6S C5S C4S 0 0 0 0 C7S]
   setup pspindle spindle qualifier left dmd_ctrs_mwv
      array [0 0 0 0 A2S A1S A0S A7S]
   setup short6 short6 qualifier right dmd_ctrs_mwv
      array [C2S 0 0 0 C4S C3S]
   setup short6 short6 qualifier left dmd_ctrs_mwv
      array [0 0 A0S A5S A4S 0]
            alternate_definition [half] mainstream
   setup 2x2 1x4 no_cutting_through rotate restriction wave_only
      array [CR0N AL0S AL1S CR1N]
   setup pmd 1x4 qualifier right dmd_ctrs_mwv restriction unusual levelc1
      array [CR1E CR2E 0 0]
   setup pmd 1x4 qualifier left dmd_ctrs_mwv restriction unusual levelc1
      array [AL1W 0 0 AL2W]
            alternate_definition [interlocked half] c3a
   setup qtag 2x4 rotate qualifier right 2fl_only
      array [0 0 0    0    CR2N CR5N CR7N CR0N]
   setup qtag 2x4 rotate qualifier left 2fl_only
      array [0 0 AL0S AL7S AL2S AL5S 0    0]
            alternate_definition [lasthalf] mainstream
   setup 1x4 2x2 no_cutting_through qualifier 2fl_only
      array [C0E C1E A1W A0W]
   setup 1x4 dmd qualifier wave_only restriction unusual alwaysfail
      array [CM1E AM0W AM1W CM2E]
            alternate_definition [interlocked lasthalf] c3a
   setup 2x4 qtag rotate qualifier right wave_only
      array [CM6N 0 CM0N 0 0 CM1N 0 CM7N]
   setup 2x4 qtag rotate qualifier left wave_only
      array [0 AM5S 0 AM6S AM7S 0 AM4S 0]

// This is used to check for misuse of "scoot and counter" from a leftie.
// It doesn't complain if interlocked scoot and counter is done from a left 1/4 line.
// Nor does it complain if "cross" is given.
call "_demand 1/4 tag is right-handed" dontshow tag check_rqtag
            left_means_mirror
   setup pmd dmd qualifier left dmd_ctrs_mwv restriction serious_violation alwaysfail
      array [ZM0N ZM1N ZM2N ZM3N]
   setup pmd dmd
      array [ZM0N ZM1N ZM2N ZM3N]
   setup 2x2 2x2
      array [ZM0N ZM1N ZM2N ZM3N]
   setup pqtag qtag qualifier left dmd_ctrs_mwv restriction serious_violation alwaysfail
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup pqtag qtag
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
            alternate_definition [cross] c2
   setup pmd dmd
      array [ZM0N ZM1N ZM2N ZM3N]
   setup 2x2 2x2
      array [ZM0N ZM1N ZM2N ZM3N]
   setup pqtag qtag
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]

call "scoot back in 1/4 tag" dontshow tag qtagscootback
            left_means_touch_or_check fudge_to_q_tag
   setup pmd dmd qualifier right dmd_ctrs_mwv
      array [C0S C3S 0 0]
   setup pmd dmd qualifier left dmd_ctrs_mwv
      array [A0S 0 0 A1S]
   setup pmd dmd
      array [0S 0 0 0]   // Nobody home?  Ends can still sort of do it.
   // Well, usually in a 1/4 tag.
   setup 2x2 2x2 qualifier wave_only restriction unusual alwaysfail
      array [CR1S AL0S AM3S CM2S]
            alternate_definition [cross] c4
   setup pmd dmd qualifier right dmd_ctrs_mwv
      array [A0S A1S 0 0]
   setup pmd dmd qualifier left dmd_ctrs_mwv
      array [C0S 0 0 C3S]
            alternate_definition [yoyo] c4
   setup qtag qtag rotate qualifier right dmd_ctrs_mwv
      array [0 0   0 C7S C2S C4S C5S   0]
   setup qtag qtag rotate qualifier left dmd_ctrs_mwv
      array [0 0 A0N   0 A1N A2N   0 A7N]
            alternate_definition [generous] c3
   setup qtag qtag rotate qualifier right dmd_ctrs_mwv
      array [0 0   0 C7S C2S C4S C5S   0]
   setup qtag qtag rotate qualifier left dmd_ctrs_mwv
      array [0 0 A0N   0 A1N A2N   0 A7N]
            alternate_definition [stingy] c3
   setup qtag qtag rotate qualifier right dmd_ctrs_mwv
      array [0 0   0 C0N C1N C3N C6N   0]
   setup qtag qtag rotate qualifier left dmd_ctrs_mwv
      array [0 0 A6S   0 A3S A4S   0 A5S]
            alternate_definition [interlocked] c3a
   setup qtag qtag qualifier right 2fl_only
      array [0 0    0    0 CM4S CM5S CM3S CM2S]
   setup qtag qtag qualifier left 2fl_only
      array [0 0 AM7S AM6S AM4S AM5S    0    0]
            alternate_definition [yoyo interlocked] c4
   setup qtag qtag rotate qualifier right 2fl_only
      array [0 0    0    0 CM2S CM4S CM5S CM3S]
   setup qtag qtag rotate qualifier left 2fl_only
      array [0 0 AM0N AM3N AM1N AM2N    0    0]
            alternate_definition [generous interlocked] c3
   setup qtag qtag rotate qualifier right 2fl_only
      array [0 0    0    0 CM2S CM4S CM5S CM3S]
   setup qtag qtag rotate qualifier left 2fl_only
      array [0 0 AM0N AM3N AM1N AM2N    0    0]
            alternate_definition [stingy interlocked] c3
   setup qtag qtag rotate qualifier right 2fl_only
      array [0 0    0    0 CM1N CM7N CM6N CM0N]
   setup qtag qtag rotate qualifier left 2fl_only
      array [0 0 AM6S AM5S AM7S AM4S    0    0]
            alternate_definition [grand] c3
   setup pspindle spindle qualifier right dmd_ctrs_mwv
      array [C6S C5S C4S 0 0 0 0 C7S]
   setup pspindle spindle qualifier left dmd_ctrs_mwv
      array [0 0 0 0 A2S A1S A0S A7S]
   setup short6 short6 qualifier right dmd_ctrs_mwv
      array [C2S 0 0 0 C4S C3S]
   setup short6 short6 qualifier left dmd_ctrs_mwv
      array [0 0 A0S A5S A4S 0]

call "_boxy scoot back" dontshow tag plainboxyscootback
   // This one allows the people not in miniwaves, for follow and cross, etc.
   setup 2x2 2x2 restriction unusual wave_only
      array [CR1S AL0S AM3S CM2S]
            alternate_definition [scatter] c4
   setup 2x4 2x4 qualifier ntbone none restriction forbidden wave_only
      array [CR3S CR2S AL1S AL0S AM5S CM4S AM7S CM6S]
            alternate_definition [half] c4
   setup 2x2 1x4 no_cutting_through rotate qualifier wave_only
      array [CR0N AL0S AL1S CR1N]
   setup pmd 1x4 qualifier right dmd_ctrs_mwv restriction unusual alwaysfail
      array [CR1E CR2E 0 0]
   setup pmd 1x4 qualifier left dmd_ctrs_mwv restriction unusual alwaysfail
      array [AL1W 0 0 AL2W]
            alternate_definition [lasthalf] mainstream
   setup 1x4 2x2 no_cutting_through qualifier 2fl_only
      array [C0E C1E A1W A0W]
   setup 1x4 dmd qualifier wave_only restriction unusual alwaysfail
      array [CM1E AM0W AM1W CM2E]
   // Otherwise, we fall back on the "strict" definition.
            nxn_is_inherited single_is_inherited fast_is_inherited
            half_is_inherited lasthalf_is_inherited
   seq strictboxyscootback [inherit_nxn inherit_single inherit_fast
                           inherit_half inherit_lasthalf]

call "_strict boxy scoot back" dontshow tag strictboxyscootback
   setup 2x2 2x2 restriction forbidden wave_only
      array [CR1S AL0S AM3S CM2S]
            alternate_definition [half] c4
   setup 2x2 1x4 no_cutting_through rotate qualifier wave_only
      array [CR0N AL0S AL1S CR1N]
   setup pmd 1x4 qualifier right dmd_ctrs_mwv restriction unusual alwaysfail
      array [CR1E CR2E 0 0]
   setup pmd 1x4 qualifier left dmd_ctrs_mwv restriction unusual alwaysfail
      array [AL1W 0 0 AL2W]
            alternate_definition [lasthalf] mainstream
   setup 1x4 2x2 no_cutting_through qualifier 2fl_only
      array [C0E C1E A1W A0W]
   setup 1x4 dmd qualifier wave_only restriction unusual alwaysfail
      array [CM1E AM0W AM1W CM2E]
            alternate_definition [single] c4
   setup 1x2 1x2
      array [CR1S AL0S]
            alternate_definition [3x3] c4
   setup 3x2 2x3
      array [CM5S CM4S CR3S AL2S AM1S AM0S]
            alternate_definition [4x4] c4
   setup 4x2 2x4 restriction forbidden wave_only
      array [CM7S CM6S CM5S CR4S AL3S AM2S AM1S AM0S]
   setup 4x4 4x4 restriction forbidden wave_only
      array [AL14S AM3S AM7S CM1S AM5S CM4S AM8S CM2S
             CM6S CM11S CM15S AM9S CR13S AL12S CR0S AM10S]
            alternate_definition [fast] c4
   setup 2x2 2x2 restriction forbidden wave_only
      array [CR2S AL3S ZM2N ZM3N]

call "_fudgy boxy scoot back" dontshow tag fudgyboxyscootback
   /* What's fudgy about this?  The yoyo version, that's what.  Real dancers wouldn't
      do it, because the leads are just turning around.  This is only legal if followed
      by a "backemup" operation. That is, it is only legal if it is actually being done
      "to a wave", as the scoot back in things like "scoot reaction" is done.  But we
      do the whole thing, with the extend to a wave the way no human would, followed by
      backing up, so that the "scoot reaction" can be done in the presence of lots of
      phantoms.  That is, by having the original lead step back into a wave, he knows
      what handedness to use for the chain reaction.  If he just became the point of a
      1/4-tag, the centers might be phantoms, and he wouldn't know what to do. */
   setup 2x2 2x2 restriction forbidden wave_only
      array [CR1S AL0S AM3S CM2S]
            alternate_definition [generous] c4
   setup 2x2 2x2 restriction unusual alwaysfail
      array [CR0S AL1S AL2E CR3W]
            alternate_definition [stingy] c4
   setup 2x2 2x2 restriction unusual alwaysfail
      array [CR0S AL1S AL0W CR1E]
            alternate_definition [yoyo] c4
   setup 2x2 2x2 restriction unusual alwaysfail
      array [CR0S AL1S AL2E CR3W]

call "scoot back to a wave" c1 tag scootbacktowave
   setup 2x2 dmd rotate restriction unusual wave_only
      array [CR0E AL0E AL3E CR1E]
   setup pmd 2x2 qualifier right dmd_ctrs_mwv
      array [CR3S CR2S 0 0]
   setup pmd 2x2 qualifier left dmd_ctrs_mwv
      array [AL0S 0 0 AL1S]
            alternate_definition [interlocked] c3
   setup qtag 2x4 qualifier right 2fl_only
      array [0 0 0 0 CR4S CR6S CR1S CR3S]
   setup qtag 2x4 qualifier left 2fl_only
      array [0 0 AL2S AL0S AL5S AL7S 0 0]
            alternate_definition [generous] c4
   setup 2x2 1x4 rotate restriction unusual wave_only
      array [CR0E AL0E AL3N CR3S]
            alternate_definition [stingy] c4
   setup 2x2 1x4 rotate restriction unusual wave_only
      array [CR0E AL0E AL1S CR1N]
            alternate_definition [yoyo] c4
   setup 2x2 thar restriction unusual alwaysfail
      array [CR2S AL2S AL7E CR7W]
   setup pmd 1x4 qualifier right dmd_ctrs_mwv
      array [CR0W CR3W 0 0]
   setup pmd 1x4 qualifier left dmd_ctrs_mwv
      array [AL0E 0 0 AL3E]

/* This call requires the "left" modifier to be given if called from
   a left-handed setup.  The purpose is to avoid losing if we call
   "scoot and little" from a leftie.  The official rules require that
   people go left on the outside, even though we didn't say "left",
   since they observed the handedness of the setup during the scoot back.
   The way we address this problem is to forbid the scoot back from a leftie
   unless the word "left" is explicitly used.  This way, both the dancers
   and the program know to go left on the outside.  The calls little/little
   more/plenty/rally by themselves are legal from either handedness and
   always go right, in accordance with the rules. */
call "right scoot back" dontshow tag rtqtagscootback
            left_means_mirror fudge_to_q_tag
   setup pmd dmd qualifier right dmd_ctrs_mwv
      array [CM0S CM3S 0 0]
   setup pmd dmd
      array [C0S 0 0 0]   // Nobody home?  Ends can still sort of do it.
            alternate_definition [cross] c4
   // If done "cross", we of course expect a leftie.
   setup pmd dmd qualifier left dmd_ctrs_mwv
      array [C0S 0 0 C3S]
            alternate_definition [yoyo] c4
   setup qtag qtag rotate qualifier right dmd_ctrs_mwv
      array [0 0   0 C7S C2S C4S C5S   0]
            alternate_definition [generous] c3
   setup qtag qtag rotate qualifier right dmd_ctrs_mwv
      array [0 0   0 C7S C2S C4S C5S   0]
            alternate_definition [stingy] c3
   setup qtag qtag rotate qualifier right dmd_ctrs_mwv
      array [0 0   0 C0N C1N C3N C6N   0]
            alternate_definition [interlocked] c3a
   setup qtag qtag qualifier right 2fl_only
      array [0 0 0 0 CM4S CM5S CM3S CM2S]
            alternate_definition [yoyo interlocked] c4
   setup qtag qtag rotate qualifier right 2fl_only
      array [0 0 0 0 CM2S CM4S CM5S CM3S]
            alternate_definition [generous interlocked] c3
   setup qtag qtag rotate qualifier right 2fl_only
      array [0 0 0 0 CM2S CM4S CM5S CM3S]
            alternate_definition [stingy interlocked] c3
   setup qtag qtag rotate qualifier right 2fl_only
      array [0 0 0 0 CM1N CM7N CM6N CM0N]

call "_fix scoot the diamond" dontshow tag fixscootdiamond
            left_means_mirror
   setup dmd dmd qualifier right dmd_ctrs_mwv
                 restriction controversial alwaysfail
      array [CR0E 0 0 0]
   setup dmd dmd qualifier left dmd_ctrs_mwv_no_mirror
                 restriction controversial alwaysfail
      array [0 0 AL2W 0]
   setup dmd dmd qualifier live right pu_qtag_like
                 restriction serious_violation alwaysfail
      array [ZM0N CR1E ZM2N 0]
   setup dmd dmd qualifier live left pu_qtag_like
                 restriction serious_violation alwaysfail
      array [ZM0N AL1W ZM2N 0]
   setup star star qualifier live ntbone right dmd_ctrs_mwv
                   restriction controversial alwaysfail
      array [ZM0N CR1E 0 0]
   setup star star qualifier live ntbone left dmd_ctrs_mwv
                 restriction controversial alwaysfail
      array [0 AL1W ZM2N 0]
   setup pmd dmd qualifier right dmd_ctrs_mwv
      array [0 ZM1N CR2E 0]
   setup pmd dmd qualifier left dmd_ctrs_mwv_no_mirror
      array [0 0 AL2W ZM3N]
   setup pmd dmd
      array [0 0 CR2E 0]   // Nobody home?  Assume right hands, I guess.
            alternate_definition [interlocked] c3a
   setup qtag qtag qualifier ctr_pts_rh
      array [CR0E CR1E ZM2N ZM3N 0 0 ZM6N ZM7N]
   setup qtag qtag qualifier ctr_pts_lh
      array [AL0W AL1W ZM2N ZM3N 0 0 ZM6N ZM7N]
            alternate_definition [grand] c3
   setup pspindle spindle qualifier right dmd_ctrs_mwv
      array [ZM0N ZM1N ZM2N CR3E 0 0 0 0]
   setup pspindle spindle qualifier left dmd_ctrs_mwv
      array [0 0 0 AL3W ZM4N ZM5N ZM6N 0]
   setup short6 short6 qualifier right dmd_ctrs_mwv
      array [ZM0N CR1E 0 0 0 ZM5N]
   setup short6 short6 qualifier left dmd_ctrs_mwv
      array [0 AL1W ZM2N ZM3N 0 0]
            alternate_definition [rewind] c4
   setup pmd dmd
      array [0 ZM1N 0 ZM3N]
   setup dmd dmd
      array [CR0E 0 AL2W 0]

call "scoot the diamond" c3a
            visible_fractions left_means_mirror intlk_is_inherited cross_is_inherited
            rewind_is_inherited grand_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq scootback [inherit_intlk inherit_grand inherit_yoyo inherit_gensting inherit_cross]
   seq fixscootdiamond [inherit_left inherit_intlk inherit_grand inherit_rewind]  // "Left" will be checked.
   seq diamondcirc [inherit_intlk inherit_grand]

call "scoot chain thru the diamond" c4a
            visible_fractions intlk_is_inherited rewind_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq scootchainthru [inherit_intlk inherit_yoyo inherit_gensting]
   seq fixscootdiamond [inherit_intlk inherit_rewind]
   seq diamondcirc [inherit_intlk]

call "_triangle scoot back" dontshow tag tglscootback
            fudge_to_q_tag
   setup trngl trngl qualifier right dmd_ctrs_mwv
      array [C0S CR2S    0 0   0 C4S]
   setup trngl trngl qualifier left dmd_ctrs_mwv
      array [A0S    0 AL1S 0 A5S   0]
   setup trngl trngl
      array [0S 0 0 0 0 0]   /* Nobody home?  Apex can still sort of do it. */
            alternate_definition [grand] c4
   setup short6 short6 qualifier right dmd_ctrs_mwv
      array [C2S 0 0   0    C4S CR3S]
   setup short6 short6 qualifier left dmd_ctrs_mwv
      array [0   0 A0S AL5S A4S 0]
   setup short6 short6
      array [0 0 0 0 4S 0]   /* Nobody home?  Apex can still sort of do it. */

call "_fix scoot the triangle" dontshow tag fixscoottgl
   setup trngl trngl qualifier right dmd_ctrs_mwv
      array [0 ZM1N    0 CR3E    0 ZM5N]
   setup trngl trngl qualifier left dmd_ctrs_mwv
      array [0    0 ZM2N AL3W ZM4N    0]
            alternate_definition [grand] c4
   setup short6 short6 qualifier right dmd_ctrs_mwv
      array [ZM0N CR1E    0 0    0 ZM5N]
   setup short6 short6 qualifier left dmd_ctrs_mwv
      array [0    AL1W ZM2N ZM3N 0    0]

call "scoot the triangle" c4
            visible_fractions
   seq tglscootback []
   seq fixscoottgl []
   seq trngle_circ []

call "scoot the tall 6" c4
            visible_fractions
   seq tglscootback [force_grand]
   seq fixscoottgl [force_grand]
   seq diamondcirc [force_grand]

call "_fudgy scatter scoot" dontshow tag fudgyscatscoot
   // The yoyo version of this has the same fudge as "fudgyboxyscootback".  See above.
   setup 2x4 2x4 qualifier ntbone none restriction forbidden wave_only
      array [CR3S CR2S AL1S AL0S AM5S CM4S AM7S CM6S]
   setup 2x4 2x4 restriction unusual alwaysfail    // We get this if they're T-boned ...
      array [CR3S CR2S AL1S AL0S AM5S CM4S AM7S CM6S]
   setup 4x2 2x4 restriction unusual alwaysfail    // helped by this.
      array [CM7S    0 CM5S CR4S AL3S AM2S    0 AM0S]
            alternate_definition [generous] c4
   setup 2x4 2x4 restriction unusual alwaysfail
      array [CR2S CR3S AL0S AL1S AM5S CM4S AM7S CM6S]
   setup 4x2 2x4 restriction unusual alwaysfail
      array [CM0W    0 CM2W CR4S AL3S AM5E    0 AM7E]
            alternate_definition [stingy] c4
   setup 2x4 2x4 restriction unusual alwaysfail
      array [CR2S CR3S AL0S AL1S AM5S CM4S AM7S CM6S]
   setup 4x2 2x4 restriction unusual alwaysfail
      array [CM6E    0 CM5E CR4S AL3S AM3W    0 AM1W]
            alternate_definition [12matrix] c3x
   setup 2x6 2x6 qualifier wave_only
      array [CR5S CR4S CR3S AL2S AL1S AL0S AM7S CM6S AM9S CM8S AM11S CM10S]
            alternate_definition [16matrix] c3x
   setup 2x8 2x8 qualifier wave_only
      array [CR7S CR6S  CR5S  CR4S  AL3S  AL2S  AL1S  AL0S
             AM9S CM8S AM11S CM10S AM13S CM12S AM15S CM14S]
            alternate_definition [yoyo] c4
   setup 2x4 2x4 restriction unusual alwaysfail
      array [CR2S CR3S AL0S AL1S 0 0 0 0]
   setup 4x2 2x4 restriction unusual alwaysfail
      array [CR0W 0 CR2W 0 0 AL5E 0 AL7E]
            alternate_definition [half] c1
   setup 2x4 rigger rotate qualifier wave_only
      array [CR6N CR7N AL7S AL6S AL0S CR0N AL5S CR5N]
            alternate_definition [12matrix half] c3x
   setup 2x6 3x8 rotate qualifier wave_only
      array [CR20N CR21N CR22N AL22S AL21S AL20S AL3S CR3N AL23S CR23N AL16S CR16N]
            alternate_definition [lasthalf] c1
   setup rigger 2x4 rotate
      array [CM0N AM7S AL0S AL1S AM5S CM2N CR7N CR6N]

call "_fix scoot chain thru" dontshow tag fixscootchainthru
   setup 2x4 2x4 restriction forbidden wave_only
      array [CM6S CCAM3N AACM0N AM5S ZM4N ZM5N ZM6N ZM7N]
   setup qtag qtag qualifier right dmd_ctrs_mwv
      array [C7S   AAC0N   0   AAC6N 0 0 C5S 0]
   setup qtag qtag qualifier left dmd_ctrs_mwv
      array [CCA1N A3S     A4S 0     0 0 0   CCA2N]
            alternate_definition [interlocked] c3a
   setup qtag qtag qualifier ctr_pts_rh
      array [C3S AAC0N   0 0 0 0 C5S AAC6N]
   setup qtag qtag qualifier ctr_pts_lh
      array [CCA1N A7S A4S     CCA2N 0 0   0 0]
            alternate_definition [fast] c4
   setup 2x4 2x4 restriction forbidden wave_only
      array [CM6S CCAM3N AACM0N AM5S ZM4N ZM5N ZM6N ZM7N]

call "_inner scoot chain thru 1" dontshow tag innerscootchainthru_1
   setup 2x4 hrglass restriction forbidden wave_only
      array [CR0E AL0W CR1E AL1W AACR7W CR2S AL6S CCAL7E]
   setup qtag qtag rotate qualifier right wave_only
      array [0 0 0 CR0E CR1E CCAL2N CCAL7N 0]
   setup qtag qtag rotate qualifier left wave_only
      array [0 0 AACR7S 0 AACR2S AL4E 0 AL5E]
            alternate_definition [scatter] c1
   setup 2x4 3x1dmd rotate restriction forbidden wave_only
      array [CR0N CR1N AL1S AL0S AACR6S CCR3E AAL7E CCAL6N]
            alternate_definition [cross] c4
   setup qtag qtag rotate qualifier right wave_only
      array [0 0 0 AACR7S AACR2S AL4E AL5E 0]
   setup qtag qtag rotate qualifier left wave_only
      array [0 0 CR0E 0 CR1E CCAL2N 0 CCAL7N]
            alternate_definition [interlocked] c3a
   setup qtag qtag rotate qualifier right 2fl_only
      array [0 0 0 0 CR1E CCAL2N CCAL7N CR0E]
   setup qtag qtag rotate qualifier left 2fl_only
      array [0 0 AACR7S AL5E AACR2S AL4E 0 0]
            alternate_definition [yoyo] c4
   setup qtag qtag qualifier right wave_only
      array [0 0 0 CCCAL3S CR4W CR5W CCCAL6S 0]
   setup qtag qtag qualifier left wave_only
      array [0 0 AAACR2S 0 AL4E AL5E 0 AAACR7S]
            alternate_definition [yoyo interlocked] c4
   setup qtag qtag qualifier right 2fl_only
      array [0 0 0 0 CR4W CR5W CCCAL6S CCCAL3S]
   setup qtag qtag qualifier left 2fl_only
      array [0 0 AAACR2S AAACR7S AL4E AL5E 0 0]

call "_inner scoot chain thru 2" dontshow tag innerscootchainthru_2
   setup hrglass 2x4
      array [0 0 AM5S 0 0 0 CM6S 0]
   setup phrglass 2x4
      array [CR1E CR3E 0 CAM3W AL4W AL6W 0 ACM4E]
   setup qtag qtag rotate
      array [0 0 ACM0N CAM6S 0 0 CAM5S ACM6N]
   setup pqtag qtag rotate
      array [CM5E CM7E 0 0 AM3E AM4E 0 0]
            alternate_definition [scatter] c1
   setup 3x1dmd 2x4 rotate
      array [CR7N CR6N CAM7S 0 AL0S AL1S ACM0N 0]
   setup p3x1dmd 2x4 rotate
      array [0 0 0 CCM6E 0 0 0 AAM5E]
            alternate_definition [interlocked] c3a
   setup qtag qtag rotate
      array [0 0 ACM0N CAM6S 0 0 CAM5S ACM6N]
   setup pqtag qtag rotate
      array [CM5E CM3E 0 0 AM7E AM4E 0 0]
            alternate_definition [yoyo] c4
   setup qtag qtag
      array [0 0 ACM2S CAM3S 0 0 CAM6S ACM7S]
   setup pqtag qtag
      array [CM0W CM1W 0 0 AM4E AM5E 0 0]
            alternate_definition [yoyo interlocked] c4
   setup qtag qtag
      array [0 0 ACM2S CAM7S 0 0 CAM6S ACM3S]
   setup pqtag qtag
      array [CM0W CM1W 0 0 AM4E AM5E 0 0]

// This rather convoluted stuff is also done in
// "scatter scoot chain thru", below.
call "scoot chain thru" a2 tag scootchainthru
   // Note that we do *not* set visible_fractions.  This call does
   // not have parts.  It has halves.

   // The array definition is illegal if we do the whole call.
   // We will instead fall into the sequential definition below.
   setup 1x4 1x4
      array [0 0 0 0]
            alternate_definition [scatter half] c1
   setup 2x4 3x1dmd rotate restriction forbidden wave_only
      array [CR0N CR1N AL1S AL0S AACR6S CCR3E AAL7E CCAL6N]
            alternate_definition [scatter lasthalf] c1
   setup 3x1dmd 2x4 rotate
      array [CR7N CR6N CAM7S 0 AL0S AL1S ACM0N 0]
   setup p3x1dmd 2x4 rotate
      array [0 0 0 CCM6E 0 0 0 AAM5E]

   // The rest of the stuff is OK if we do the first or last half.
   // Why don't we just use the sequential definition here also?
   // Because this call has not been marked "visible_fractions"
   // (it has "halves" but not "parts"), so it won't recognize
   // the division.
            alternate_definition [half] a2
   // This is just a copy of innerscootchainthru_1.
   setup 2x4 hrglass restriction forbidden wave_only
      array [CR0E AL0W CR1E AL1W AACR7W CR2S AL6S CCAL7E]
   setup qtag qtag rotate qualifier right wave_only
      array [0 0 0 CR0E CR1E CCAL2N CCAL7N 0]
   setup qtag qtag rotate qualifier left wave_only
      array [0 0 AACR7S 0 AACR2S AL4E 0 AL5E]
            alternate_definition [half cross] c4
   setup qtag qtag rotate qualifier right wave_only
      array [0 0 0 AACR7S AACR2S AL4E AL5E 0]
   setup qtag qtag rotate qualifier left wave_only
      array [0 0 CR0E 0 CR1E CCAL2N 0 CCAL7N]
            alternate_definition [half interlocked] c3a
   setup qtag qtag rotate qualifier right 2fl_only
      array [0 0 0 0 CR1E CCAL2N CCAL7N CR0E]
   setup qtag qtag rotate qualifier left 2fl_only
      array [0 0 AACR7S AL5E AACR2S AL4E 0 0]
            alternate_definition [half yoyo] c4
   setup qtag qtag qualifier right wave_only
      array [0 0 0 CCCAL3S CR4W CR5W CCCAL6S 0]
   setup qtag qtag qualifier left wave_only
      array [0 0 AAACR2S 0 AL4E AL5E 0 AAACR7S]
            alternate_definition [half yoyo interlocked] c4
   setup qtag qtag qualifier right 2fl_only
      array [0 0 0 0 CR4W CR5W CCCAL6S CCCAL3S]
   setup qtag qtag qualifier left 2fl_only
      array [0 0 AAACR2S AAACR7S AL4E AL5E 0 0]
            alternate_definition [lasthalf] a2
   // This is just a copy of innerscootchainthru_2.
   setup hrglass 2x4
      array [0 0 AM5S 0 0 0 CM6S 0]
   setup phrglass 2x4
      array [CR1E CR3E 0 CAM3W AL4W AL6W 0 ACM4E]
   setup qtag qtag rotate
      array [0 0 ACM0N CAM6S 0 0 CAM5S ACM6N]
   setup pqtag qtag rotate
      array [CM5E CM7E 0 0 AM3E AM4E 0 0]
            alternate_definition [lasthalf interlocked] c3a
   setup qtag qtag rotate
      array [0 0 ACM0N CAM6S 0 0 CAM5S ACM6N]
   setup pqtag qtag rotate
      array [CM5E CM3E 0 0 AM7E AM4E 0 0]
   // Notice that we act on the "yoyo" modifier even in the last half
   // of the call.  This is so that "yoyo do the last 1/2 scoot chain thru"
   // will work properly (that last trade is the first trade if we're only
   // doing the last half of the call.)  We of course rely on the
   // expiration mechanism to do the right thing in the more common cases.
   //
   // Note:  When I started writing this program around 1985, it never
   // occurred to me that such software complexity would be required,
   // or that things as incredibly intricate as "yoyo do the last 1/2
   // scoot chain thru" would ever be done.  I doubt that anyone else
   // would have believed it either.  This level of intricacy in
   // challenge dancing was unheard-of back then.
            alternate_definition [lasthalf yoyo] c4
   setup qtag qtag
      array [0 0 ACM2S CAM3S 0 0 CAM6S ACM7S]
   setup pqtag qtag
      array [CM0W CM1W 0 0 AM4E AM5E 0 0]
            alternate_definition [lasthalf yoyo interlocked] c4
   setup qtag qtag
      array [0 0 ACM2S CAM7S 0 0 CAM6S ACM3S]
   setup pqtag qtag
      array [CM0W CM1W 0 0 AM4E AM5E 0 0]

   // A "seq" definition.  If we do the whole call, it comes here.
            visible_fractions intlk_is_inherited yoyo_is_inherited
            gen_sting_is_inherited cross_is_inherited scatter_is_inherited
   seq innerscootchainthru_1 [inherit_scatter inherit_intlk inherit_yoyo inherit_gensting inherit_cross]
   seq innerscootchainthru_2 [inherit_scatter inherit_intlk inherit_yoyo inherit_gensting]

   // What?  Two "seq" definitions?  Yes.  When we break it into halves, we can do it
   // from waves, because the leads know what to do.  When we break it into fifths,
   // there are no leads to worry about.
            visible_fractions yoyo_is_inherited
            gen_sting_is_inherited cross_is_inherited
   seq extend_1_to_2 [inherit_cross]
   seq cast_off_n4_with_warn [inherit_yoyo inherit_gensting insert_number 2]
   seq maybegrandslip [inherit_yoyo inherit_gensting]
   seq cast_off_n4_with_warn [inherit_yoyo inherit_gensting insert_number 2]
   seq extend_n [insert_number 3]

call "_fudgy scoot chain thru" dontshow tag fudgyscootchainthru
   // The yoyo version of this has the same fudge as "fudgyboxyscootback".  See above.
            yoyo_is_inherited gen_sting_is_inherited
   seq fudgyboxyscootback [inherit_yoyo inherit_gensting]
   seq fixscootchainthru []

call "_new extend" dontshow tag newextend
   setup pmd 2x2 qualifier right dmd_ctrs_mwv
      array [ZM0N ZM1N 0 0]
   setup pmd 2x2 qualifier left dmd_ctrs_mwv
      array [ZM3N 0 0 ZM2N]
   setup 2x2 dmd rotate qualifier miniwaves
      array [ZM0W ZM0W ZM1W ZM3W]
   setup 2x2 dmd rotate restriction unusual miniwaves
      array [ZM0W ZM0W ZM1W ZM3W]
            alternate_definition [cross] c4
   setup pmd 2x2 qualifier right dmd_ctrs_mwv
      array [ZM3N ZM2N 0 0]
   setup pmd 2x2 qualifier left dmd_ctrs_mwv
      array [ZM0N 0 0 ZM1N]
            alternate_definition [grand] c3
   setup pmd 2x2 qualifier right dmd_ctrs_mwv
      array [ZM0N ZM1N 0 0]
   setup pmd 2x2 qualifier left dmd_ctrs_mwv
      array [ZM3N 0 0 ZM2N]
   setup short6 2x3 rotate qualifier right dmd_ctrs_mwv
      array [ZM5W 0 0 0 ZM3W ZM4W]
   setup short6 2x3 rotate qualifier left dmd_ctrs_mwv
      array [0 0 ZM0W ZM1W ZM2W 0]
   setup pspindle 2x4 qualifier right dmd_ctrs_mwv
      array [ZM1N ZM2N ZM3N 0 0 0 0 ZM0N]
   setup pspindle 2x4 qualifier left dmd_ctrs_mwv
      array [0 0 0 0 ZM4N ZM5N ZM6N ZM7N]
            alternate_definition [interlocked] c3
   setup qtag 2x4 qualifier right 2fl_only
      array [0 0 0 0 ZM5N ZM7N ZM0N ZM2N]
   setup qtag 2x4 qualifier left 2fl_only
      array [0 0 ZM3N ZM1N ZM4N ZM6N 0 0]

call "_new swing in any wave" dontshow tag in_the_wave_swing
   setup 1x4 1x4 qualifier wave_only
      array [CR1S AL0S AL3S CR2S]
   setup qtag qtag qualifier right wave_only
      array [CR0E CR1E    0 CR2S 0 0 CR7S    0]
   setup pqtag qtag qualifier right wave_only
      array [CR0E CR1E 0 0 0 0 0 0]
   setup qtag qtag qualifier left wave_only
      array [AL0W AL1W AL3S    0 0 0    0 AL6S]
   setup pqtag qtag qualifier left wave_only
      array [0 0 0 0 AL4W AL5W 0 0]
            alternate_definition [yoyo] c4
   setup 2x2 1x4 rotate qualifier wave_only
      array [CR1S AL1N AL2N CR2S]
   setup 1x4 2x2 qualifier wave_only
      array [CR3W AL3E AL2E CR2W]
   setup 2x4 qtag rotate qualifier tbone right dmd_ctrs_mwv
      array [0 CR7S 0 0 0 0 CR2S 0]
   setup 4x2 qtag rotate qualifier tbone right dmd_ctrs_mwv
      array [0 0 0 CR0N CR1N 0 0 0]
   setup 2x4 qtag rotate qualifier tbone left dmd_ctrs_mwv
      array [0 0 AL7N 0 0 AL2N 0 0]
   setup 4x2 qtag rotate qualifier tbone left dmd_ctrs_mwv
      array [0 0 0 AL0S AL1S 0 0 0]
   setup qtag 2x4 rotate qualifier right wave_only
      array [CR7N CR0N    0 CR2S 0 0 CR5S    0]
   setup pqtag 2x4 rotate qualifier right wave_only
      array [CR7N CR0N 0 0 0 0 0 0]
   setup qtag 2x4 rotate qualifier left wave_only
      array [AL7S AL0S AL2N    0 0 0    0 AL5N]
   setup pqtag 2x4 rotate qualifier left wave_only
      array [0 0 0 0 AL3S AL4S 0 0]
            alternate_definition [generous] c4
   setup 2x2 1x4 rotate qualifier wave_only
      array [CR1S AL1N AL2N CR2S]
   setup 1x4 2x2 qualifier wave_only
      array [CR3W AL3E AL2E CR2W]
   setup 2x4 qtag rotate qualifier tbone right dmd_ctrs_mwv
      array [0 CR7S 0 0 0 0 CR2S 0]
   setup 4x2 qtag rotate qualifier tbone right dmd_ctrs_mwv
      array [0 0 0 CR0N CR1N 0 0 0]
   setup 2x4 qtag rotate qualifier tbone left dmd_ctrs_mwv
      array [0 0 AL7N 0 0 AL2N 0 0]
   setup 4x2 qtag rotate qualifier tbone left dmd_ctrs_mwv
      array [0 0 0 AL0S AL1S 0 0 0]
   setup qtag 2x4 rotate qualifier right wave_only
      array [CR7N CR0N    0 CR2S 0 0 CR5S    0]
   setup pqtag 2x4 rotate qualifier right wave_only
      array [CR7N CR0N 0 0 0 0 0 0]
   setup qtag 2x4 rotate qualifier left wave_only
      array [AL7S AL0S AL2N    0 0 0    0 AL5N]
   setup pqtag 2x4 rotate qualifier left wave_only
      array [0 0 0 0 AL3S AL4S 0 0]
            alternate_definition [stingy] c4
   setup 2x2 1x4 rotate qualifier wave_only
      array [CR0N AL0S AL3S CR3N]
   setup 1x4 2x2 qualifier wave_only
      array [CR0E AL0W AL1W CR1E]
   setup 2x4 qtag rotate qualifier tbone right dmd_ctrs_mwv
      array [0 CR6N 0 0 0 0 CR3N 0]
   setup 4x2 qtag rotate qualifier tbone right dmd_ctrs_mwv
      array [0 0 0 CR0N CR1N 0 0 0]
   setup 2x4 qtag rotate qualifier tbone left dmd_ctrs_mwv
      array [0 0 AL6S 0 0 AL3S 0 0]
   setup 4x2 qtag rotate qualifier tbone left dmd_ctrs_mwv
      array [0 0 0 AL0S AL1S 0 0 0]
   setup qtag 2x4 rotate qualifier right wave_only
      array [CR7N CR0N    0 CR1N 0 0 CR6N    0]
   setup pqtag 2x4 rotate qualifier right wave_only
      array [CR7N CR0N 0 0 0 0 0 0]
   setup qtag 2x4 rotate qualifier left wave_only
      array [AL7S AL0S AL1S    0 0 0    0 AL6S]
   setup pqtag 2x4 rotate qualifier left wave_only
      array [0 0 0 0 AL3S AL4S 0 0]
            alternate_definition [grand] c3a
   setup 1x6 1x6 qualifier wave_only
      array [CR1S AL0S CR5S AL4S CR3S AL2S]
   setup 1x8 1x8 qualifier wave_only
      array [CR1S AL0S AL3S CR2S AL5S CR4S CR7S AL6S]
            alternate_definition [grand yoyo] c4
   setup 1x6 2x3 qualifier wave_only
      array [CR5W AL5E CR4W AL3E CR3W AL4E]
   setup 1x8 2x4 qualifier wave_only
      array [CR7W AL7E AL6E CR6W AL5E CR5W CR4W AL4E]
   setup 3x2 1x6 qualifier wave_only
      array [CR0W CR2W CR4W AL4E AL2E AL0E]
   setup 4x2 1x8 qualifier wave_only
      array [CR0W CR3W CR6W CR5W AL5E AL6E AL3E AL0E]

call "_new slip in any wave" dontshow tag in_the_wave_slip
   setup 1x4 1x4 qualifier wave_only
      array [ZM0N CR3S ZM2N AL1S]
   setup qtag qtag qualifier right wave_only
      array [0 0 0 AL7S 0 0 ZM6N    0]
   setup pqtag qtag qualifier right wave_only
      array [ZM0N ZM1N 0 0 0 0 0 0]
   setup qtag qtag qualifier left wave_only
      array [AL0W AL1W ZM2N    0 0 0    0 CR3S]
   setup pqtag qtag qualifier left wave_only
      array [0 0 0 0 ZM4N ZM5N 0 0]
            alternate_definition [yoyo] c4
   setup 1x4 dmd qualifier wave_only
      array [ZM0N CR3W ZM2N AL3E]
            alternate_definition [grand] c3a
   setup 1x6 1x6 qualifier wave_only
      array [ZM0N CR2S AL1S ZM3N AL5S CR4S]
   setup 1x8 1x8 qualifier wave_only
      array [ZM0N CR3S CR6S AL1S ZM4N AL7S AL2S CR5S]
            alternate_definition [grand yoyo] c4
   setup 1x6 short6 rotate qualifier wave_only
      array [ZM4W CR3S AL3N ZM1W AL2N CR2S]
   setup 1x8 spindle qualifier wave_only
      array [ZM7N CR6W CR5W AL6E ZM3N AL4E AL5E CR4W]

call "scoot chain thru to a wave" c1 tag scootchainthrutowave
            visible_fractions yoyo_is_inherited gen_sting_is_inherited
            intlk_is_inherited grand_is_inherited cross_is_inherited
   seq newextend [inherit_intlk inherit_grand inherit_cross]
   seq in_the_wave_swing [inherit_grand inherit_yoyo inherit_gensting]
   seq in_the_wave_slip [inherit_grand inherit_yoyo inherit_gensting]
   seq in_the_wave_swing [inherit_grand inherit_yoyo inherit_gensting]

call "scoot and dodge" a1 tag scootndodge
   setup 2x2 2x2 restriction forbidden wave_only
      array [Z1N Z0N A3S C2S]
            alternate_definition [half] mainstream
   setup 2x2 1x4 rotate no_cutting_through restriction wave_only
      array [ZM0W ZM0W AL1S CR1N]

call "scoot chain thru and dodge" c4 tag scootchainthrundodge
   setup 2x4 2x4 restriction forbidden wave_only
      array [ZM1N ZM0N ZM3N ZM2N 7S CM2N AM1N 4S]

call "_fudgy scatter scoot chain thru" dontshow tag fudgyscatscootchainthru
   // The yoyo version of this has the same fudge as "fudgyboxyscootback".  See above.
            yoyo_is_inherited gen_sting_is_inherited
   seq fudgyscatscoot [inherit_yoyo inherit_gensting]  /* The yoyo version is only legal in a T-bone. */
   seq fixscootchainthru []

call "scatter scoot" c1
            bigmatrix_is_inherited visible_fractions
   seq fudgyscatscoot [inherit_bigmatrix]

call "scatter scoot to a wave" c1
   setup 2x4 qtag qualifier ntbone none restriction forbidden wave_only
      array [CR1S CR1S AL0S AL0S AL3S CR2S AL6S CR7S]
   setup 2x4 qtag restriction unusual alwaysfail       // We get this if they're T-boned ...
      array [CR1S CR1S AL0S AL0S AL3S CR2S AL6S CR7S]
   setup 4x2 2x4 rotate restriction unusual alwaysfail // helped by this.
      array [CR5E    0 CR2E 0 0 AL1E    0 AL6E]
            alternate_definition [yoyo] c4
   setup 2x4 2x4 rotate restriction unusual alwaysfail
      array [CR0E CR0E AL7E AL7E AL2N CR2S AL5N CR5S]
   setup 4x2 qtag restriction unusual alwaysfail
      array [CR6W 0 CR3W 0 0 AL3E 0 AL6E]

call "scatter scoot chain thru to a wave" c1
            yoyo_is_inherited gen_sting_is_inherited
   seq fudgyscatscoot [inherit_yoyo inherit_gensting]  /* We allow yoyo in a T-bone. */
   seq fixscootchainthru []
   seq backemup []

call "quick change" c4a
            visible_fractions yoyo_is_inherited gen_sting_is_inherited diamond_is_legal funny_is_inherited
   conc6p_or_normal trade_and_roll_w_tbone [inherit_yoyo inherit_gensting inherit_diamond inherit_funny]
                    circ_and_quarter_in [inherit_diamond inherit_funny conc_force_spots endscando]

call "deuces wild" c4a
            half_is_inherited yoyo_is_inherited gen_sting_is_inherited
            diamond_is_legal twisted_is_inherited funny_is_inherited
   conc6p_or_normal trade_w_tbone [inherit_half inherit_funny inherit_yoyo inherit_gensting inherit_twisted
                                  inherit_diamond suppress_elongation_warnings]
                    zoom [inherit_half inherit_diamond inherit_twisted conc_force_spots endscando]

call "nice and easy" c4a
            yoyo_is_inherited gen_sting_is_inherited diamond_is_legal funny_is_inherited
   conc trade_and_roll_w_tbone [inherit_yoyo inherit_gensting inherit_diamond inherit_funny]
   zing [inherit_diamond inherit_funny conc_demand_lines conc_force_columns]

call "drift apart" c3a
            take_right_hands
   setup 2x4 2x4
      array [CM6S CM4S AM7S AM5S AL2S AL0S CR3S CR1S]
   setup 4x2 2x4
      array [CR6S ZM4N AL3S CM5S AM2S CR4S ZM3N AL1S]
            alternate_definition [half] c3a
   setup 2x4 2x4
      array [CR1S CR3S AL0S AL2S ZM3N ZM2N ZM1N ZM0N]
   setup 4x2 2x4
      array [ZM1N ZM2N ZM4N CR4S AL3S ZM3N ZM5N ZM6N]
            alternate_definition [12matrix] c3a
   setup 3x4 3x4
      array [CM11S CM4S AM10S AM5S AL2S AL0S ZM3N ZM3N ZM0N ZM0N CR1S CR3S]
            alternate_definition [half 12matrix] c3a
   setup 3x4 3x4
      array [CR1S CR3S AL0S AL2S ZM3N ZM2N ZM4N ZM5N ZM11N ZM10N ZM0N ZM1N]
            alternate_definition [single] c4
   setup 1x4 1x4
      array [CR1S CR2S AL3S AL0S]
            alternate_definition [3x3 12matrix] c4
   setup 3x4 3x4
      array [C8S C6S A9S A7S A5S A10S A2S A0S C3S C1S C11S C4S]
            alternate_definition [4x4 16matrix] c4
   setup 4x4 4x4
      array [A5S A7S A3S A9S A14S A12S C0S A10S C13S C15S C11S C1S C6S C4S A8S C2S]
            alternate_definition [5x5] c4
   setup 5x4 4x5
      array [C5S C6S C7S C8S C9S C14S C13S C12S C11S C10S A15S A16S A17S A18S A19S A4S A3S A2S A1S A0S]

call "INVERT drift apart" c4
   setup 2x4 2x4
      array [CM5S AM7S CM4S AM6S AL1S CR3S AL0S CR2S]

call "drift around" c4
            reverse_means_mirror
   setup 2x2 2x2
      array [CR1S CR2N 0 0]

call "change your image" c3
   setup 2x4 2x4 rotate
      array [CM5E CR0E AL7E AM2E AL1E ZM0W ZM7W CR6E]
   setup 4x2 2x4
      array [CR6S ZM3N CR4S CM5S AM2S AL3S ZM4N AL1S]
   // These are, of course, bogus, but see test nf36t.
   setup rigger 3x6 restriction controversial alwaysfail
      array [CR3S AL2S 0 0 ZM3N ZM2N 0 0]
            alternate_definition [magic] c3
   setup 2x4 2x4 rotate
      array [CM5E AL7E CR0E AM2E AL1E ZM7W ZM0W CR6E]
   setup 4x2 2x4
      array [AL1S ZM4N AL3S AM2S CM5S CR4S ZM3N CR6S]
            alternate_definition [half] c3
   setup 2x4 4x4
      array [CR15S ZM13N ZM14N AL3S ZM1N ZM3N ZM15N ZM10N]
   setup 4x2 4x4
      array [ZM15N ZM3N ZM1N CR2S AL1S ZM2N ZM7N ZM11N]

call "turntable" c4a
         left_means_mirror reverse_means_mirror
   setup 2x4 2x4
      array [AL5E  CR4W  CM7W AL6E CAL1W CAM0W CAL3W CAL2W]
   setup 4x2 2x4
      array [CAL5W CAL4W CR7W AL6E AL1E  CM0W  CAM3W CAL2W]
            alternate_definition [single] c4
   setup 4x1 1x4
      array [CAL3W CAL2W AL1E CR0W]
            alternate_definition [3x3 12matrix] c4
   setup 4x3 3x4 restriction controversial 3x3couples_only
      array [CAL7W CA6W C9W AL8E AL11E C10W AL1E C0W CA3W CAL2W CAL5W CA4W]
            alternate_definition [4x4 16matrix] c4
   setup 4x4 4x4 restriction controversial 4x4couples_only
      array [AL9E C8W CA12W C6W CAL10W CAL15W CAL3W CA13W CAL1W CA0W C4W CA14W AL2E AL7E AL11E C5W]

call "centers go as you are, turntable" c4a
         left_means_mirror reverse_means_mirror
   setup 2x4 2x4
      array [AL5E  CM4S AM7S AL6E CAL1W AL0S CR3S CAL2W]
   setup 4x2 2x4
      array [CAL5W CR4S CM7S AL6E AL1E AM0S AL3S CAL2W]
            alternate_definition [single] c4
   setup 1x4 1x4
      array [0     CR2S 0    AL0S]
   setup 4x1 1x4
      array [CAL3W 0    AL1E 0]

call "switch to an hourglass" a2
   setup 2x4 hrglass rotate
      array [CR6N AL5E CR0E AL6S ZM3W CR1E AL4E ZM7W]

call "hourglass circulate" a2 tag hrglass_circ
            take_right_hands fudge_to_q_tag
   simple_funny
   setup hrglass hrglass
      array [0 0 AL1W 0 0 0 CR0E 0]
   setup phrglass hrglass
      array [ZM3N CR2E 0 ZM1N AL2W ZM7N 0 ZM4N]

call "squeeze the hourglass" c1
   setup hrglass galaxy
      array [0 0 ZM4N 0 0 0 ZM0N 0]
   setup phrglass galaxy
      array [CR7S CR5S ZM4N CM6S AL3S AL1S ZM0N AM2S]

call "squeeze the diamond" c1
   setup dmd dmd rotate
      array [CR1E 0 AL3E 0]
   setup pmd dmd rotate
      array [0 ZM2E 0 ZM0E]

call "squeeze the galaxy" c1
   setup galaxy hyperglass
      predscantdocallinsetup
         if next_galaxyspot_is_tboned [ZM0N ZM5S 0 ZM2S ZM6N ZM11S 0 ZM8S]
                            if always [CR7S ZM5S 0 ZM2S AL1S ZM11S 0 ZM8S]

call "squeeze the butterfly" c1
   setup 4x4 4x4
      array [AL13S 0 0 AM10S AL6S 0 0 AM9S CR5S 0 0 CM2S CR14S 0 0 CM1S]

call "squeeze the O" c1
   setup 4x4 4x4
      array [0 AL15S AL11S 0 0 AM8S CM4S 0 0 CR7S CR3S 0 0 CM0S AM12S 0]

call "flip the hourglass" a2
            fudge_to_q_tag take_right_hands
   setup hrglass 2x4 rotate
      array [0 0 AL0S 0 0 0 CR7N 0]
   setup phrglass 2x4 rotate
      array [CR6E CR1E 0 ZM0W AL2E AL5E 0 ZM3W]
            alternate_definition [reverse] c4
   setup hrglass crosswave
      array [0 0 CR4S 0 0 0 AL0S 0]
   setup phrglass crosswave
      array [ZM3N CR5E 0 AL2S AL5W ZM7N 0 CR6S]
            alternate_definition [funny] c2
   setup hrglass spindle qualifier dmd_facing
      array [0 0 ZM3N 0 0 0 ZM7N 0]
   setup phrglass spindle qualifier dmd_facing
      array [CR0S CR2S 0 ZM1N AL4S AL6S 0 ZM5N]

call "cut the hourglass" a2
            fudge_to_q_tag take_right_hands
   setup hrglass 2x4 rotate
      array [0 0 AL0S 0 0 0 CR7N 0]
   setup phrglass 2x4 rotate
      array [CR5E CR2E 0 ZM0W AL1E AL6E 0 ZM3W]
            alternate_definition [reverse] c4
   setup hrglass crosswave
      array [0 0 AL0S 0 0 0 CR4S 0]
   setup phrglass crosswave
      array [ZM3N CR5E 0 CR6S AL5W ZM7N 0 AL2S]
            alternate_definition [funny] c2
   setup hrglass spindle qualifier dmd_facing
      array [0 0 ZM3N 0 0 0 ZM7N 0]
   setup phrglass spindle qualifier dmd_facing
      array [CR6S CR4S 0 ZM1N AL2S AL0S 0 ZM5N]

call "galaxy circulate" c1 tag galaxy_circ
   take_right_hands simple_funny
   setup galaxy galaxy
      predscantdocallinsetup
         if next_galaxyspot_is_tboned [R1E R2E 0 L2W L3W M4N 0 M0N]
         if always [M1N R2E 0 L2W M3N M4N 0 M0N]

call "flip the galaxy" c1
   setup galaxy thar
      array [CR1S CR2E 0 AL2W AL5S ZM4N 0 ZM0N]
            alternate_definition [reverse] c2
   setup galaxy 2x4
      predscantdocallinsetup
         if next_galaxyspot_is_tboned [CR1E AL0S 0 CR3S AL2W CR4S 0 AL7S]
         if always                    [ZM1N AL0S 0 CR3S ZM2N CR4S 0 AL7S]

call "cut the galaxy" c1
   setup galaxy thar
      array [CR5S CR2E 0 AL2W AL1S ZM4N 0 ZM0N]
            alternate_definition [reverse] c2
   setup galaxy 2x4
      predscantdocallinsetup
         if next_galaxyspot_is_tboned [CR1E CM3S 0 AM0S AL2W AM7S 0 CM4S]
         if always                    [ZM1N CM3S 0 AM0S ZM2N AM7S 0 CM4S]
            alternate_definition [yoyo reverse] c4
   setup 3x1dmd 2x4 rotate
      array [CR6N CM4S AM4N 0 AL1S AM3N CM3S 0]
   setup p3x1dmd 2x4 rotate
      array [0 0 0 ZM1W 0 0 0 ZM2W]

call "the K" c2 tag the_k
            half_is_inherited yoyo_is_inherited gen_sting_is_inherited
   singleconc_together trade [inherit_half inherit_yoyo inherit_gensting]
                       uturnaway [inherit_half conc_force_spots]

call "the K but @m" c3a tag the_k_but
   singleconc_together nullsecond [mandatory_secondary_call]
                       uturnaway [conc_force_spots]

call "@2cross @3the K" c2
            twisted_is_inherited visible_fractions yoyo_is_inherited gen_sting_is_inherited
            mxn_is_inherited nxn_is_inherited
   seq crosstrail [inherit_twisted inherit_nxn inherit_mxn or_anycall]
   // Usual hack: you must say "initially 4x4", or next line will be illegal.
   seq the_k [inherit_yoyo inherit_gensting inherit_nxn inherit_mxn]

call "@0 the K" c2
            visible_fractions yoyo_is_inherited gen_sting_is_inherited
   seq nullcall [mandatory_anycall]
   seq the_k [inherit_yoyo inherit_gensting]

call "@2cross @3the K but @m" c3a
            twisted_is_inherited visible_fractions yoyo_is_inherited gen_sting_is_inherited
            mxn_is_inherited nxn_is_inherited
   seq crosstrail [inherit_twisted inherit_nxn inherit_mxn or_anycall]
   seq the_k_but []

call "@0 the K but @m" c3a
            visible_fractions yoyo_is_inherited gen_sting_is_inherited
   seq nullcall [mandatory_anycall]
   seq the_k_but []

call "counterpoint" c4a
            reverse_means_mirror single_is_inherited mxn_is_inherited nxn_is_inherited
            bigmatrix_is_inherited singlefile_is_inherited diamond_is_legal cross_is_inherited
   maybe_nxn_1331_cols_conc
      recycle [inherit_reverse inherit_single inherit_nxn inherit_singlefile
              inherit_diamond inherit_cross]
      ctr_rot [inherit_single inherit_nxn conc_force_otherway]

call "@2turn @3the key" c3
            can_be_one_side_lateral
            visible_fractions diamond_is_legal yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq trade [or_anycall inherit_diamond inherit_yoyo inherit_gensting]
   seq ctr_rot [allow_forced_mod inherit_diamond]
   seq hinge [allow_forced_mod inherit_diamond inherit_fractal inherit_gensting]

call "@0 the key" c3
            can_be_one_side_lateral
            visible_fractions diamond_is_legal fractal_is_inherited gen_sting_is_inherited
   seq nullcall [mandatory_anycall]
   seq ctr_rot [allow_forced_mod inherit_diamond]
   seq hinge [allow_forced_mod inherit_diamond inherit_fractal inherit_gensting]

call "the key" c3
            can_be_one_side_lateral   // Make the counter rotate behave the way we want.
            visible_fractions diamond_is_legal fractal_is_inherited gen_sting_is_inherited
   seq ctr_rot [allow_forced_mod inherit_diamond]
   seq hinge [allow_forced_mod inherit_diamond inherit_fractal inherit_gensting]

call "_clear the way ends to centers" dontshow tag clearwayec
            left_means_mirror
   seq hinge [inherit_left]
   seq hinge [inherit_left]
   seq vertical_half_tag [inherit_left]
   seq ctr_rot []

call "_finish clearing the way" dontshow tag finclearway
   setup 2x2 2x2 restriction forbidden wave_only
      array [AL3S CR2S CR1S AL0S]
            alternate_definition [cross] c4a
   setup 2x2 2x2 restriction forbidden wave_only
      array [CR2S AL3S AL0S CR1S]

call "_clear the way centers to ends" dontshow tag clearwayce
            cross_is_inherited left_means_mirror
   seq hinge [inherit_left]
   seq box_circ []
   seq finclearway [inherit_cross]

call "clear the way" c4
            cross_is_inherited left_means_mirror
   crossconc clearwayec [conc_demand_columns inherit_left]
             clearwayce [conc_force_lines inherit_cross
                         inherit_left suppress_elongation_warnings]

call "clear the centers for a @0" c4
            cross_is_inherited left_means_mirror dont_use_in_resolve
   crossconc nullcall [mandatory_anycall]
             clearwayce [conc_force_lines inherit_cross
                         inherit_left suppress_elongation_warnings]

call "create a column" c4
   setup 4x4 2x4 rotate
      array [AM6E AL7E ZM0W AL7E ZM1W ZM1W ZM6W ZM0W ZM6W ZM7W CR0E ZM7W CM1E CM1E AM6E CR0E]

call "deflate the O" c4
   setup 4x4 2x4 rotate
      array [   0 AL7E ZM0W    0    0 ZM1W ZM6W    0    0 ZM7W CR0E    0    0 CM1E AM6E    0]

call "deflate the butterfly" c4
   setup 4x4 2x4 rotate
      array [AM6E    0    0 AL7E ZM1W    0    0 ZM0W ZM6W    0    0 ZM7W CM1E    0    0 CR0E]

call "_twist part 1" dontshow tag twist1
   setup 1x4 2x3 rotate restriction forbidden explodable
      array [CR4N ZM5W AL1S ZM0W]

call "_twist part 2" dontshow tag twist2
   select_who_did_and_didnt star_thru [] trade []

call "_twist and @0 part 2" dontshow tag twist2_and
   select_who_did_and_didnt nullcall [mandatory_anycall] trade []

call "twist@4 the line@5@7 and @8@1" c1
   seq twist1 []
   seq twist2 []

call "twist and @0" c1
   seq twist1 []
   seq twist2_and []

call "_ctrs pass thru/ends slide thru" dontshow tag pass_thru_slide_thru
   conc passthru [] slidethru [conc_demand_lines conc_force_columns]

call "push open the gate" c4
            first_part_visible
   seq centersinifneeded []
   seq cast_off_n4 [allow_forced_mod insert_number 3]
   seq endsbend []
   seq pass_thru_slide_thru []

call "centers thru and close the gate" c4
   seq centersinifneeded []
   seq twist1 []
   seq twist2 []

call "_mini busy 1" dontshow tag mini_busy_1
   setup 2x4 3x4 restriction 2fl_only
      array [CR0E CR1E AL2W AL3W ZM4N ZM5N ZM11N ZM10N]

call "_mini busy 2" dontshow tag mini_busy_2
   in_out_triple_squash dpt [force_half] sglctrtogetherhinge []

call "_mini busy 3" dontshow tag mini_busy_3
   conc flipdiamond [] quarterin [conc_demand_lines conc_force_spots]

call "_mini busy 3 but @m" dontshow tag mini_busy_3_but
   conc nullsecond [mandatory_secondary_call] quarterin [conc_demand_lines conc_force_spots]

call "mini busy" a2
            visible_fractions
   seq mini_busy_1 []
   seq mini_busy_2 []
   seq mini_busy_3 []
   setup 2x4 qtag restriction 2fl_only
      array [CR0S CR1S AL0S AL1S AL3S AL6S CR2S CR7S]
            alternate_definition [single] c4
   setup 2x2 dmd rotate restriction wave_only
      array [CR0E AL0E AL3E CR1E]
            alternate_definition [3x3] c4
   setup 2x6 3dmd restriction 3x3_2fl_only
      array [CR0S CR1S CR2S AL0S AL1S AL2S AL4S AL11S AL9S CR3S CR5S CR10S]
            alternate_definition [4x4] c4
   setup 2x8 4dmd restriction 4x4_2fl_only
      array [CR0S CR1S CR2S CR3S AL0S AL1S AL2S AL3S AL5S AL7S AL14S AL12S CR4S CR6S CR15S CR13S]

call "mini busy but @m" c1
            visible_fractions
   seq mini_busy_1 []
   seq mini_busy_2 []
   seq mini_busy_3_but []

call "hinge/flip/stepnfold" dontshow tag hngflpstpnfld
   setup 1x4 2x2 restriction forbidden 2fl_only
       array [CM3S CR2N AM2S AL3N]

call "_busy nothing" dontshow tag busy_nothing
            equalize
   setup 2x4 bone restriction unusual siamese_in_quad
       array [CM4S CM1S AM0S AM5S ZM2N ZM3N ZM7N ZM6N]
   setup 4x2 2x4 restriction unusual siamese_in_quad
       array [ZM1N ZM2N 0 0 0 0 ZM5N ZM6N]
   setup c1phan 2x4 qualifier ntbone none restriction forbidden siamese_in_quad
       array [CM4S 0 CM3S 0 0 AM7S 0 AM0S 0 ZM5N 0 ZM2N ZM6N 0 ZM1N 0]
   setup c1phan hyperglass qualifier tbone none restriction forbidden siamese_in_quad
       array [CM8S 0 CM5S 0 0 AM11S 0 AM2S ZM6N 0 ZM7N 0 0 ZM0N 0 ZM1N]

call "_linking nothing" dontshow tag linking_nothing
            equalize
   setup 2x4 bone restriction unusual siamese_in_quad
       array [AM5S AL0S CR1S CM4S ZM2N ZM3N ZM7N ZM6N]
   setup 4x2 2x4 restriction unusual siamese_in_quad
       array [ZM1N ZM2N 0 0 0 0 ZM5N ZM6N]
   setup c1phan 2x4 qualifier ntbone none restriction forbidden siamese_in_quad
       array [AM7S 0 AL0S 0 0 CM4S 0 CR3S 0 ZM5N 0 ZM2N ZM6N 0 ZM1N 0]
   setup c1phan hyperglass qualifier tbone none restriction forbidden siamese_in_quad
       array [AM11S 0 AL2S 0 0 CM8S 0 CR5S ZM6N 0 ZM7N 0 0 ZM0N 0 ZM1N]

call "_busy_part_2" dontshow tag busy_part_2
   conc hngflpstpnfld [or_anycall] nullcall [suppress_elongation_warnings]

call "_busy_anything_part_2, @0" dontshow tag busy_any_part_2
   conc nullcall [mandatory_anycall] nullcall [suppress_elongation_warnings]

call "@4keep @5busy@1" c3a
   seq busy_nothing [normalize]
   seq busy_part_2 [normalize]

call "busy @0" c3
   seq busy_nothing [normalize]
   seq busy_any_part_2 [normalize]

call "link up but @0" c3a
   seq linking_nothing [normalize]
   seq busy_any_part_2 [normalize]

call "_make a pass part 1" dontshow tag makepass_1
   setup qtag qtag qualifier in qtag_like
      predscantdocallinsetup
      // If the concept had been "phantom 1/4 lines", the setup was pre-screened for
      // couples in the center.  But if it was "phantom 1/4 tags", the center line
      // could be anything.
         if q_tag_back   [   0    0 ZM2N ZM1N ZM3N ZM7N ZM6N ZM0N]
         //                         stay move           stay move
         if q_line_front [   0    0 ZM2N ZM1N ZM3N ZM7N ZM6N ZM0N]
         //                         stay move           stay move
         if always       [   0    0 ZM2N ZM1N ZM4N ZM5N ZM6N ZM0N]
         //                         stay move           stay move
   setup qtag qtag
      predscantdocallinsetup
         if q_tag_front  [ZM0N ZM1N ZM2N ZM1N ZM4N ZM5N ZM6N ZM0N]
         if q_line_back  [ZM0N ZM1N ZM2N ZM1N ZM4N ZM5N ZM6N ZM0N]
         if q_tag_back   [ZM0N ZM1N ZM2N ZM1N ZM3N ZM7N ZM6N ZM0N]
         if q_line_front [ZM0N ZM1N ZM2N ZM1N ZM3N ZM7N ZM6N ZM0N]
   setup 4x2 2x4
      predscantdocallinsetup
         if columns_antitandem [ZM1N ZM1N ZM3N ZM3N ZM4N ZM4N ZM6N ZM6N]
         if always             [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 3x2 2x3
      predscantdocallinsetup
         if columns_antitandem [ZM1N ZM2N ZM2N ZM3N ZM3N ZM4N]
         if always             [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N]
   setup 2x4 2x4
       array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
            alternate_definition [cross] c3
   setup qtag qtag qualifier in qtag_like
      predscantdocallinsetup
      // If the concept had been "phantom 1/4 lines", the setup was pre-screened for
      // couples in the center.  But if it was "phantom 1/4 tags", the center line
      // could be anything.
         if q_tag_front  [   0    0 ZM2N ZM0N ZM7N ZM3N ZM6N ZM1N]
         //                         stay move           stay move
         if q_line_back  [   0    0 ZM2N ZM0N ZM7N ZM3N ZM6N ZM1N]
         //                         stay move           stay move
         if always       [   0    0 ZM2N ZM0N ZM4N ZM5N ZM6N ZM1N]
         //                         stay move           stay move
   setup qtag qtag
      predscantdocallinsetup
         if q_tag_front  [ZM0N ZM1N ZM2N ZM0N ZM7N ZM3N ZM6N ZM1N]
         if q_line_back  [ZM0N ZM1N ZM2N ZM0N ZM7N ZM3N ZM6N ZM1N]
         if q_tag_back   [ZM0N ZM1N ZM2N ZM0N ZM4N ZM5N ZM6N ZM1N]
         if q_line_front [ZM0N ZM1N ZM2N ZM0N ZM4N ZM5N ZM6N ZM1N]
   setup 4x2 2x4
      predscantdocallinsetup
         if columns_magic_antitandem [ZM6N ZM1N ZM4N ZM3N ZM4N ZM3N ZM6N ZM1N]
         if always                   [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 2x4 2x4
       array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]

// This is very similar to "_make a pass part 1".
call "_nuclear reaction part 1" dontshow tag nuclear_1
   setup qtag qtag qualifier in qtag_like
      preds "Can't determine facing directions."
         if q_tag_back   [   0    0 ZM2N ZM1N ZM3N ZM7N ZM6N ZM0N]
         //                         stay move           stay move
         if q_line_front [   0    0 ZM2N ZM1N ZM3N ZM7N ZM6N ZM0N]
         //                         stay move           stay move
         if always       [   0    0 ZM2N ZM1N ZM4N ZM5N ZM6N ZM0N]
         //                         stay move           stay move
   setup qtag qtag
      preds "Can't determine facing directions."
         if q_tag_front  [ZM0N ZM1N ZM2N ZM1N ZM4N ZM5N ZM6N ZM0N]
         if q_line_back  [ZM0N ZM1N ZM2N ZM1N ZM4N ZM5N ZM6N ZM0N]
         if q_tag_back   [ZM0N ZM1N ZM2N ZM1N ZM3N ZM7N ZM6N ZM0N]
         if q_line_front [ZM0N ZM1N ZM2N ZM1N ZM3N ZM7N ZM6N ZM0N]
            alternate_definition [cross] c3
   setup qtag qtag qualifier in qtag_like
      preds "Can't determine facing directions."
      // If the concept had been "phantom 1/4 lines", the setup was pre-screened for
      // couples in the center.  But if it was "phantom 1/4 tags", the center line
      // could be anything.
         if q_tag_front  [   0    0 ZM2N ZM0N ZM7N ZM3N ZM6N ZM1N]
         //                         stay move           stay move
         if q_line_back  [   0    0 ZM2N ZM0N ZM7N ZM3N ZM6N ZM1N]
         //                         stay move           stay move
         if always       [   0    0 ZM2N ZM0N ZM4N ZM5N ZM6N ZM1N]
         //                         stay move           stay move
   setup qtag qtag
      preds "Can't determine facing directions."
         if q_tag_front  [ZM0N ZM1N ZM2N ZM0N ZM7N ZM3N ZM6N ZM1N]
         if q_line_back  [ZM0N ZM1N ZM2N ZM0N ZM7N ZM3N ZM6N ZM1N]
         if q_tag_back   [ZM0N ZM1N ZM2N ZM0N ZM4N ZM5N ZM6N ZM1N]
         if q_line_front [ZM0N ZM1N ZM2N ZM0N ZM4N ZM5N ZM6N ZM1N]

call "_finish make a pass" dontshow tag finmakepass
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc6p_or_normal cast_off_n4 [or_anycall inherit_fractal inherit_gensting insert_number 3]
                    trade_and_roll [conc_force_spots inherit_yoyo inherit_gensting]

call "make a pass@7 but@8@1" c4a
            visible_fractions cross_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq makepass_1 [inherit_cross]
   seq finmakepass [inherit_yoyo inherit_gensting]

call "_finish make a pass but @0" dontshow tag finmakepassbut
   conc6p_or_normal nullcall [mandatory_anycall] trade_and_roll [conc_force_lines]

call "make a pass but @0" c4a
            visible_fractions cross_is_inherited
   seq makepass_1 [inherit_cross]
   seq finmakepassbut []

call "cross make a pass but @0" c4a
            visible_fractions
   seq makepass_1 [force_cross]
   seq finmakepassbut []

call "straight away part 1" dontshow tag straightaway1
            fudge_to_q_tag
   setup qtag 3x4
      predscantdocallinsetup
         if q_tag_front  [ZM1N ZM2N ZM3N CR4S ZM7N ZM8N  ZM0N AL10S]
         if q_tag_back   [   0    0 ZM3N CR4S ZM5N ZM11N ZM0N AL10S]
         if q_line_front [ZM1N ZM2N ZM3N CR4S ZM7N ZM8N  ZM0N AL10S]
         if q_line_back  [   0    0 ZM3N CR4S ZM5N ZM11N ZM0N AL10S]
         if always       [   0    0 ZM3N CR4S   0   0    ZM0N AL10S]
            alternate_definition [cross] c4a
   setup qtag 3x4
      predscantdocallinsetup
         if q_tag_front  [ZM1N ZM2N ZM3N CR4S ZM7N  ZM8N  ZM0N AL10S]
         if q_tag_back   [   0    0 ZM3N CR4S ZM11N ZM5N  ZM0N AL10S]
         if q_line_front [ZM1N ZM2N ZM3N CR4S ZM7N  ZM8N  ZM0N AL10S]
         if q_line_back  [   0    0 ZM3N CR4S ZM11N ZM5N  ZM0N AL10S]
         if always       [   0    0 ZM3N CR4S   0     0   ZM0N AL10S]

call "straight away part 2" dontshow tag straightaway2
   in_out_triple_squash waverecycle [allow_plain_mod] nullcall []

call "straight away" c4a
            cross_is_inherited
   seq straightaway1 [inherit_cross]
   seq straightaway2 []

call "straight away but @0" c4a
            cross_is_inherited
   seq straightaway1 [inherit_cross]
   seq triple_squash_outers_anything []

call "_nuclear reaction part 2" dontshow tag nuclear_nucleus
            fractal_is_inherited
   crossconc vertical_half_tag []
             cast_n_4_roll [conc_force_lines inherit_fractal
                            insert_number 1 suppress_elongation_warnings]

call "_reactivate part 2" dontshow tag reactivate2
            take_right_hands
   setup spindle 2x4 rotate
      array [   0    0    0 AL0S    0    0    0 CR7N]
   setup pspindle 2x4 rotate
      array [CR5E CM4E CR2E    0 AL1E AM7E AL6E    0]

call "_reactivate to a diamond part 2" dontshow tag reactivate2dmd
            ends_take_right_hands
   setup pspindle qtag qualifier spd_base_mwv
      array [CR6W CM5S CR3W    0 AL3E AM0S AL6E    0]
   setup pspindle qtag
      array [CR6W CM5S CR3W    0 AL2E AM0S AL7E    0]
   setup spindle qtag
      array [   0    0    0 AL1W    0    0    0 CR0E]

call "_backemup" dontshow tag backemup
   setup 2x4 qtag restriction forbidden wave_only
      array [ZM6N ZM7N ZM3N ZM2N ZM4N ZM4N ZM5N ZM5N]

call "_chain react part 1" dontshow tag chreact_1
   // Some populations of the center line might make the wave vs. 2fl
   // determination ambiguous.  But, in that case, it won't matter
   // for the ends trying to decide whether to move.
   setup qtag spindle rotate qualifier right wave_only
      array [ZM6W ZM0W 0    ZM0W ZM2W ZM5W CR7N 0]
   setup qtag spindle rotate qualifier left wave_only
      array [ZM6W ZM0W AL7S 0    ZM1W ZM4W 0 ZM6W]
   setup qtag spindle rotate qualifier right 2fl_only
      array [ZM6W ZM0W 0    0    ZM1W ZM4W CR7N ZM6W]
   setup qtag spindle rotate qualifier left 2fl_only
      array [ZM6W ZM0W AL7S ZM0W ZM2W ZM5W 0    0]
   setup qtag spindle rotate
      // Otherwise, they're probably unsymmetrical.
      // The ends look at the person in front of them.
      preds "Can't determine facing directions."
         if columns_tandem     [ZM6W ZM0W AL7S ZM0W ZM2W ZM4W CR7N ZM6W]
         if columns_antitandem [ZM6W ZM0W AL7S ZM0W ZM1W ZM5W CR7N ZM6W]
         if always             [ZM6W ZM0W AL7S ZM0W 0    0    CR7N ZM6W]
   setup pspindle spindle
      preds "Can't determine facing directions."
         if columns_tandem     [ZM0N ZM2N ZM2N 0 ZM4N ZM4N ZM6N 0]
         if columns_antitandem [ZM1N ZM2N ZM2N 0 ZM4N ZM4N ZM5N 0]
         if always             [   0 ZM2N ZM2N 0 ZM4N ZM4N    0 0]
            alternate_definition [cross] c3a
   setup qtag spindle rotate
      preds "Can't determine facing directions."
         if q_tag_front  [ZM6W ZM0W AL7S ZM6W ZM5W ZM1W CR7N ZM0W]
         if q_tag_back   [ZM6W ZM0W AL7S ZM6W ZM2W ZM4W CR7N ZM0W]
         if q_line_front [ZM6W ZM0W AL7S ZM6W ZM2W ZM4W CR7N ZM0W]
         if q_line_back  [ZM6W ZM0W AL7S ZM6W ZM5W ZM1W CR7N ZM0W]

call "_wave chain react part 1" dontshow tag wvchreact_1
   setup 2x4 spindle rotate restriction forbidden wave_only
      array [7N 6W 0W 7S 1W 2W 4W 5W]
            alternate_definition [cross] c3a
   setup 2x4 spindle rotate restriction forbidden wave_only
      array [7N 0W 6W 7S 2W 5W 1W 4W]

call "_chain react part 2" dontshow tag chreact_2
            left_means_mirror fractal_is_inherited gen_sting_is_inherited
   ckpt_star nullcall [] hinge [inherit_left inherit_fractal inherit_gensting]

call "_wave chain react part 2" dontshow tag wvchreact_2
            fractal_is_inherited gen_sting_is_inherited
   ckpt_star nullcall [] armturn_n4 [inherit_fractal inherit_gensting insert_number 1]

call "chain reaction@S" a1
            visible_fractions left_means_mirror cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq chreact_1 [inherit_cross]
   seq chreact_2 [inherit_left inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal inherit_gensting insert_number 1]
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "chain reaction@S but @m" a1
            visible_fractions left_means_mirror cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq chreact_1 [inherit_cross]
   seq chreact_2 [inherit_left inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal inherit_gensting insert_number 1]
   seq finishwithmodbut2nd []

/* We don't put in "inherit_left" in the hinge of the chain reaction of these
   compound calls, because, in the case of tag reaction, left applies to the
   tag, and in the case of scoot reaction is it just too weird.  Also,
   we don't allow the final cast off 3/4 in scoot reaction to be replaced,
   because we might change it to a revert the tag reaction, which has another
   cast off 3/4. */

call "scoot@C reaction@S" c3a
            first_and_last_parts_visible cross_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq scootbacktowave [inherit_yoyo inherit_gensting]
   seq chreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "scoot@C reaction@S but @m" c3a
            first_and_last_parts_visible cross_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq scootbacktowave [inherit_yoyo inherit_gensting]
   seq chreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithmodbut2nd [inherit_fractal inherit_gensting]

call "cloverleaf turn@C reaction@S" c4
            last_part_visible cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq clovturn1 []
   seq clovturn2wv []
   seq chreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "cloverleaf turn@C reaction@S but @m" c4
            last_part_visible cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq clovturn1 []
   seq clovturn2wv []
   seq chreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithmodbut2nd [inherit_fractal inherit_gensting]

call "scatter scoot@C reaction@S" c3
            last_part_visible cross_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq fudgyscatscoot [inherit_yoyo inherit_gensting]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "scatter scoot@C reaction@S but @m" c3
            last_part_visible cross_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq fudgyscatscoot [inherit_yoyo inherit_gensting]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithmodbut2nd [inherit_fractal inherit_gensting]

call "scoot chain thru@C reaction@S" c3a
            last_part_visible cross_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq fudgyscootchainthru [inherit_yoyo inherit_gensting]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "scoot chain thru@C reaction@S but @m" c3a
            last_part_visible cross_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq fudgyscootchainthru [inherit_yoyo inherit_gensting]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithmodbut2nd [inherit_fractal inherit_gensting]

call "scatter scoot chain thru@C reaction@S" c3
            last_part_visible cross_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq fudgyscatscootchainthru [inherit_yoyo inherit_gensting]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "scatter scoot chain thru@C reaction@S but @m" c3
            last_part_visible cross_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq fudgyscatscootchainthru [inherit_yoyo inherit_gensting]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithmodbut2nd [inherit_fractal inherit_gensting]

call "@v@C reaction@S" c3a
            first_and_last_parts_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited gen_sting_is_inherited
            fast_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq strictboxyscootback [inherit_fast]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "@v@C reaction@S but @m" c3a
            first_and_last_parts_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited gen_sting_is_inherited
            fast_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq strictboxyscootback [inherit_fast]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [insert_number 1]
   seq finishwithmodbut2nd []

call "@v and scatter@C reaction@S" c3
            first_and_last_parts_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq fudgyscatscoot []    /* Note that we refuse to pass "yoyo". */
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "@v and scatter@C reaction@S but @m" c3
            first_and_last_parts_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq fudgyscatscoot []    /* Note that we refuse to pass "yoyo". */
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [insert_number 1]
   seq finishwithmodbut2nd []

call "@v chain thru@C reaction@S" c3a
            first_and_last_parts_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited gen_sting_is_inherited
            fast_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq strictboxyscootback [inherit_fast]
   seq fixscootchainthru [inherit_fast]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "@v chain thru@C reaction@S but @m" c3a
            first_and_last_parts_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited gen_sting_is_inherited
            fast_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq strictboxyscootback [inherit_fast]
   seq fixscootchainthru [inherit_fast]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [insert_number 1]
   seq finishwithmodbut2nd []

call "@v chain thru and scatter@C reaction@S" c3
            first_and_last_parts_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq scootchainthru [force_scatter]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "@v chain thru and scatter@C reaction@S but @m" c3
            first_and_last_parts_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq scootchainthru [force_scatter]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [insert_number 1]
   seq finishwithmodbut2nd []

call "_trans_nothing" dontshow tag trans_nothing
            magic_is_inherited fractal_is_inherited
   seq transfer [inherit_magic inherit_fractal]
   seq backemup []

// New, as of C3A definition rewrite.
call "transfer the column @jcross @lreaction@S" c3a
            last_part_visible magic_is_inherited cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq transfer [inherit_magic inherit_fractal]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "transfer the column @jcross @lreaction@S but @m" c3a
            last_part_visible magic_is_inherited cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq transfer [inherit_magic inherit_fractal]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithmodbut2nd []

call "trans@j cross chain re@laction@S" c4a
            last_part_visible magic_is_inherited cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq transfer [inherit_magic inherit_fractal]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithplainmod [inherit_fractal inherit_gensting]
   // This definition can't deal with everyone being #1 and #2
   // in the column, but has the first part visible.
   // (It makes no sense to have the cast 3/4 in the middle be
   // a recognizable part if no one is doing it.)
            first_and_last_parts_visible magic_is_inherited cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq trans_nothing [inherit_magic inherit_fractal]
   seq extend_1_to_2 []
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "trans@j cross chain re@laction@S but @m" c4a
            last_part_visible magic_is_inherited cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq transfer [inherit_magic inherit_fractal]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithmodbut2nd []
   // This definition can't deal with everyone being #1 and #2
   // in the column, but has the first part visible.
   // (It makes no sense to have the cast 3/4 in the middle be
   // a recognizable part if no one is doing it.)
            first_and_last_parts_visible magic_is_inherited cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq trans_nothing [inherit_magic inherit_fractal]
   seq extend_1_to_2 []
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal insert_number 1]
   seq finishwithmodbut2nd []

// New, as of C3A definition rewrite.
call "open up @jcross @lreaction@S" c3a
            last_part_visible magic_is_inherited cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq openup [inherit_magic]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal inherit_gensting insert_number 1]
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "open up @jcross @lreaction@S but @m" c3a
            last_part_visible magic_is_inherited cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq openup [inherit_magic]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [insert_number 1]
   seq finishwithmodbut2nd []

call "triple play @jcross @lreaction@S" c3a
            last_part_visible magic_is_inherited cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq tripleplay [inherit_magic]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [inherit_fractal inherit_gensting insert_number 1]
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "triple play @jcross @lreaction@S but @m" c3a
            last_part_visible magic_is_inherited cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq tripleplay [inherit_magic]
   seq wvchreact_1 [inherit_cross]
   seq wvchreact_2 [inherit_fractal inherit_gensting]
   seq turndmdn_endstrade [insert_number 1]
   seq finishwithmodbut2nd []

call "reactivate" c3
            cross_is_inherited
   seq chreact_1 [inherit_cross]
   seq reactivate2 []

call "reactivate to a diamond" c4a
            cross_is_inherited
   seq chreact_1 [inherit_cross]
   seq reactivate2dmd []

call "scoot@C reactivate" c3
            first_part_visible cross_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq scootbacktowave [inherit_yoyo inherit_gensting]
   seq chreact_1 [inherit_cross]
   seq reactivate2 []

call "cloverleaf turn@C reactivate" c4
            cross_is_inherited
   seq clovturn1 []
   seq clovturn2wv []
   seq chreact_1 [inherit_cross]
   seq reactivate2 []

call "scoot@C reactivate to a diamond" c4
            first_part_visible cross_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq scootbacktowave [inherit_yoyo inherit_gensting]
   seq chreact_1 [inherit_cross]
   seq reactivate2dmd []

call "cloverleaf turn@C reactivate to a diamond" c4
            cross_is_inherited
   seq clovturn1 []
   seq clovturn2wv []
   seq chreact_1 [inherit_cross]
   seq reactivate2dmd []

call "scatter scoot@C reactivate" c3
            cross_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq fudgyscatscoot [inherit_yoyo inherit_gensting]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2 []

call "scatter scoot@C reactivate to a diamond" c4
            cross_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq fudgyscatscoot [inherit_yoyo inherit_gensting]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2dmd []

call "scoot chain thru@C reactivate" c3
            cross_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq fudgyscootchainthru [inherit_yoyo inherit_gensting]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2 []

call "scoot chain thru@C reactivate to a diamond" c4
            cross_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq fudgyscootchainthru [inherit_yoyo inherit_gensting]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2dmd []

call "scatter scoot chain thru@C reactivate" c3
            cross_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq fudgyscatscootchainthru [inherit_yoyo inherit_gensting]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2 []

call "scatter scoot chain thru@C reactivate to a diamond" c4
            cross_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq fudgyscatscootchainthru [inherit_yoyo inherit_gensting]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2dmd []

call "@v@C reactivate" c3
            first_part_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited
            fast_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq strictboxyscootback [inherit_fast]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2 []

call "@v@C reactivate to a diamond" c4
            first_part_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited
            fast_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq strictboxyscootback [inherit_fast]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2dmd []

call "@v and scatter@C reactivate" c3
            first_part_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq fudgyscatscoot []    /* Note that we refuse to pass "yoyo". */
   seq wvchreact_1 [inherit_cross]
   seq reactivate2 []

call "@v and scatter@C reactivate to a diamond" c4
            first_part_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq fudgyscatscoot []    /* Note that we refuse to pass "yoyo". */
   seq wvchreact_1 [inherit_cross]
   seq reactivate2dmd []

call "@v chain thru@C reactivate" c3
            first_part_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited
            fast_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq strictboxyscootback [inherit_fast]
   seq fixscootchainthru [inherit_fast]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2 []

call "@v chain thru@C reactivate to a diamond" c4
            first_part_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited
            fast_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq strictboxyscootback [inherit_fast]
   seq fixscootchainthru [inherit_fast]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2dmd []

call "@v chain thru and scatter@C reactivate" c3
            first_part_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq scootchainthru [force_scatter]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2 []

call "@v chain thru and scatter@C reactivate to a diamond" c4
            first_part_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq scootchainthru [force_scatter]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2dmd []

/* These two allow "transactivate" as one word.  If the user puts "cross" in front,
   we change it to "trans cross reactivate". */

call "trans@j cross re@lactivate" c4
            magic_is_inherited cross_is_inherited yield_if_ambiguous
   seq transfer [inherit_magic]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2 []

call "trans@j cross re@lactivate to a diamond" c4
            magic_is_inherited cross_is_inherited yield_if_ambiguous
   seq transfer [inherit_magic]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2dmd []

/* These two are for "trans [cross] reactivate". */

call "trans@C reactivate" c4
            magic_is_inherited cross_is_inherited
   seq transfer [inherit_magic]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2 []

call "trans@C reactivate to a diamond" c4
            magic_is_inherited cross_is_inherited
   seq transfer [inherit_magic]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2dmd []

call "open up@C reactivate" c4
            magic_is_inherited cross_is_inherited
   seq openup [inherit_magic]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2 []

call "open up@C reactivate to a diamond" c4
            magic_is_inherited cross_is_inherited
   seq openup [inherit_magic]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2dmd []

call "triple play@C reactivate" c4
            magic_is_inherited cross_is_inherited
   seq tripleplay [inherit_magic]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2 []

call "triple play@C reactivate to a diamond" c4
            magic_is_inherited cross_is_inherited
   seq tripleplay [inherit_magic]
   seq wvchreact_1 [inherit_cross]
   seq reactivate2dmd []

call "counter rotate but @m" dontshow tag ctr_rot_but
   conc nullsecond [mandatory_secondary_call] ctr_rot [suppress_elongation_warnings]

call "nuclear reaction" c3
     // This should *NOT* be visible_fractions!  It should be first-and-last-part-visible.
            cross_is_inherited visible_fractions
            fractal_is_inherited
   seq nuclear_1 [inherit_cross]
   seq nuclear_nucleus [inherit_fractal]
   seq ctr_rot []

call "nuclear reaction but @m" c3
            cross_is_inherited first_and_last_parts_visible
            fractal_is_inherited
   seq nuclear_1 [inherit_cross]
   seq nuclear_nucleus [inherit_fractal]
   seq ctr_rot_but []

call "scoot@C nuclear reaction" c3
            first_part_visible cross_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq scootbacktowave [inherit_yoyo inherit_gensting]
   seq nuclear_1 [inherit_cross]
   seq nuclear_nucleus []
   seq ctr_rot []

call "cloverleaf turn@C nuclear reaction" c4
            cross_is_inherited
   seq clovturn1 []
   seq clovturn2wv []
   seq nuclear_1 [inherit_cross]
   seq nuclear_nucleus []
   seq ctr_rot []

call "scoot@C nuclear reaction but @m" c3
            first_part_visible cross_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq scootbacktowave [inherit_yoyo inherit_gensting]
   seq nuclear_1 [inherit_cross]
   seq nuclear_nucleus []
   seq ctr_rot_but []

call "scatter scoot@C nuclear reaction" c3
            cross_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq fudgyscatscoot [inherit_yoyo inherit_gensting]
   seq backemup []
   seq nuclear_1 [inherit_cross]
   seq nuclear_nucleus []
   seq ctr_rot []

call "scoot chain thru@C nuclear reaction" c3
            cross_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq fudgyscootchainthru [inherit_yoyo inherit_gensting]
   seq backemup []
   seq nuclear_1 [inherit_cross]
   seq nuclear_nucleus []
   seq ctr_rot []

call "scatter scoot chain thru@C nuclear reaction" c3
            cross_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq fudgyscatscootchainthru [inherit_yoyo inherit_gensting]
   seq backemup []
   seq nuclear_1 [inherit_cross]
   seq nuclear_nucleus []
   seq ctr_rot []

call "@v@C nuclear reaction" c3
            first_part_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited
            fast_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq strictboxyscootback [inherit_fast]
   seq backemup []
   seq nuclear_1 [inherit_cross]
   seq nuclear_nucleus []
   seq ctr_rot []

call "@v@C nuclear reaction but @m" c3
            first_part_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited
            fast_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq strictboxyscootback [inherit_fast]
   seq backemup []
   seq nuclear_1 [inherit_cross]
   seq nuclear_nucleus []
   seq ctr_rot_but []

call "@v and scatter@C nuclear reaction" c3
            first_part_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq fudgyscatscoot []    /* Note that we refuse to pass "yoyo". */
   seq backemup []
   seq nuclear_1 [inherit_cross]
   seq nuclear_nucleus []
   seq ctr_rot []

call "@v chain thru@C nuclear reaction" c3
            first_part_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited
            fast_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq strictboxyscootback [inherit_fast]
   seq fixscootchainthru [inherit_fast]
   seq backemup []
   seq nuclear_1 [inherit_cross]
   seq nuclear_nucleus []
   seq ctr_rot []

call "@v chain thru and scatter@C nuclear reaction" c3
            first_part_visible left_means_mirror
            cross_is_inherited singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq scootchainthru [force_scatter]
   seq backemup []
   seq nuclear_1 [inherit_cross]
   seq nuclear_nucleus []
   seq ctr_rot []

call "trans@C nuclear reaction" c4a
            magic_is_inherited cross_is_inherited
   seq trans_nothing [inherit_magic]
   seq nuclear_1 [inherit_cross]
   seq nuclear_nucleus []
   seq ctr_rot []

call "open up@C nuclear reaction" c4
            magic_is_inherited cross_is_inherited
   seq openup [inherit_magic]
   seq backemup []
   seq nuclear_1 [inherit_cross]
   seq nuclear_nucleus []
   seq ctr_rot []

call "triple play@C nuclear reaction" c4
            magic_is_inherited cross_is_inherited
   seq tripleplay [inherit_magic]
   seq backemup []
   seq nuclear_1 [inherit_cross]
   seq nuclear_nucleus []
   seq ctr_rot []

call "_first nothing" dontshow tag first_nothing
            take_right_hands
   setup 2x4 bone restriction unusual wave_only
      array [CM1S AM5S CM4S AM0S ZM2N ZM3N ZM7N ZM6N]

call "_first part 2" dontshow tag first_part_2
   select_center4 lock_the_hinge [or_anycall] nullcall []

call "_first @0 part 2" dontshow tag first_any_part_2
   select_center4 nullcall [mandatory_anycall] nullcall []

call "first @2choice@3" c4a
   seq first_nothing []
   seq first_part_2 []

call "first @0" c4a
   seq first_nothing []
   seq first_any_part_2 []

call "lock the hinge" c3a tag lock_the_hinge
            cross_is_inherited visible_fractions fractal_is_inherited
                  /* We must not allow modifications, even forced ones, on this
                     part, because this is invoked under locker's choice, which
                     also has a modifiable lockit.  We can't allow the same base
                     call to be modified in two different places in the definition
                     of a compound call.  In any case, it doesn't make much sense
                     to say "lock the hinge, but replace the lockit with a ... " */
   seq lockit [inherit_cross inherit_fractal]
   seq hinge_with_warn [inherit_fractal]

call "lock the hinge the lock" c3a
            visible_fractions fractal_is_inherited
   seq lockit [inherit_fractal]
   seq hinge [inherit_fractal]
   seq lockit [inherit_fractal]

call "hinge the@C lock" c3a
            cross_is_inherited visible_fractions fractal_is_inherited
   seq hinge [inherit_fractal]
   seq lockit [inherit_cross inherit_fractal]

call "hinge the@C lock the hinge" c3a
            cross_is_inherited visible_fractions fractal_is_inherited
   seq hinge [inherit_fractal]
   seq lockit [inherit_cross inherit_fractal]
   seq hinge [inherit_fractal]

call "@0 the@C lock" c3a
            cross_is_inherited visible_fractions dont_use_in_resolve fractal_is_inherited
   seq nullcall [mandatory_anycall]
   seq lockit [inherit_cross inherit_fractal]

call "hinge the top" c3a
            fractal_is_inherited visible_fractions
   seq hinge [inherit_fractal]
   seq fanthetop [inherit_fractal]

call "_lock em up 3" dontshow tag lockemup3
            fractal_is_inherited
   conc hinge [inherit_fractal] ctr_rot [conc_force_otherway]

call "_lock em up 4" dontshow tag lockemup4
            fractal_is_inherited
   conc lockit [inherit_fractal] roll []

call "_lock em up 4 but @m" dontshow tag lockemup4but
   conc nullsecond [mandatory_secondary_call] roll []

call "lock 'em up" c3
            visible_fractions cross_is_inherited fractal_is_inherited
   seq lockit [inherit_cross inherit_fractal]
   seq hinge [inherit_fractal]
   seq lockemup3 [inherit_fractal]
   seq lockemup4 [inherit_fractal]

call "@0 'em up" c4
            visible_fractions fractal_is_inherited
   seq nullcall [mandatory_anycall]
   seq hinge [inherit_fractal]
   seq lockemup3 [inherit_fractal]
   seq lockemup4 [inherit_fractal]

call "lock 'em up but @m" c3
            visible_fractions cross_is_inherited fractal_is_inherited
   seq lockit [inherit_cross inherit_fractal]
   seq hinge [inherit_fractal]
   seq lockemup3 [inherit_fractal]
   seq lockemup4but []

call "@0 'em up but @m" c4
            visible_fractions fractal_is_inherited
   seq nullcall [mandatory_anycall]
   seq hinge [inherit_fractal]
   seq lockemup3 [inherit_fractal]
   seq lockemup4but []

call "@2split @3the difference" c4a
            visible_fractions funny_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            diamond_is_legal grand_is_inherited
   seq box_circ [or_anycall inherit_funny]
   seq cast_off_n4_with_warn [insert_number 3 inherit_fractal inherit_gensting]
   seq slipforcatch [inherit_grand inherit_yoyo inherit_gensting inherit_diamond allow_forced_mod]
   seq cast_off_n4_with_warn [insert_number 3 inherit_fractal inherit_gensting]

call "split trade the difference" c4a
            visible_fractions funny_is_inherited yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            diamond_is_legal grand_is_inherited
   seq split_trade_circ [inherit_funny]
   seq cast_off_n4_with_warn [insert_number 3 inherit_fractal inherit_gensting]
   seq slipforcatch [inherit_grand inherit_yoyo inherit_gensting inherit_diamond allow_forced_mod]
   seq cast_off_n4_with_warn [insert_number 3 inherit_fractal inherit_gensting]

call "@0 the difference" c4a
            dont_use_in_resolve visible_fractions yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            diamond_is_legal grand_is_inherited
   seq nullcall [mandatory_anycall]
   seq cast_off_n4_with_warn [insert_number 3 inherit_fractal inherit_gensting]
   seq slipforcatch [inherit_grand inherit_yoyo inherit_gensting inherit_diamond allow_forced_mod]
   seq cast_off_n4_with_warn [insert_number 3 inherit_fractal inherit_gensting]

call "the difference" c4a
            visible_fractions yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            diamond_is_legal grand_is_inherited
   seq cast_off_n4_with_warn [insert_number 3 inherit_diamond inherit_fractal inherit_gensting]
   seq slipforcatch [inherit_grand inherit_yoyo inherit_gensting inherit_diamond allow_forced_mod]
   seq cast_off_n4_with_warn [insert_number 3 inherit_diamond inherit_fractal inherit_gensting]

call "contour the line" c4a
            left_means_mirror single_is_inherited grand_is_inherited
            magic_is_inherited bigmatrix_is_inherited nxn_is_inherited visible_fractions
   seq hinge_for_nicely [inherit_left inherit_single inherit_bigmatrix inherit_nxn]
   seq box_circ_1_w_3x3 [inherit_grand inherit_single inherit_magic inherit_bigmatrix inherit_nxn]
   seq box_circ_2_w_3x3 [inherit_grand inherit_single inherit_magic inherit_bigmatrix inherit_nxn]
   seq hinge_with_warn [inherit_left]

call "_centers big time" dontshow tag ctrs_big_time
            visible_fractions left_means_mirror
   seq shakedown [allow_plain_mod]
   seq pass_ocean [allow_plain_mod]

call "_centers big time but @0" dontshow tag ctrs_big_time_but
            visible_fractions left_means_mirror
   seq shakedown [allow_plain_mod]
   seq nullcall [mandatory_anycall]

call "_circ 1.5" dontshow tag circ_1p5
            visible_fractions left_means_mirror
   seq circulate []
   seq circulate [force_half]

call "big time" c4x
            visible_fractions left_means_mirror
   conc ctrs_big_time [] circ_1p5 [inherit_left endscando]

call "big time but @0" c4x
            visible_fractions left_means_mirror
   conc ctrs_big_time_but [] circ_1p5 [inherit_left endscando]

call "_hinge/half circ" dontshow tag hinge_and_half_circ
            left_means_mirror fractal_is_inherited gen_sting_is_inherited
   seq hinge_with_warn [inherit_left inherit_fractal inherit_gensting]
   seq circulate [force_half]

call "_half circ/hinge" dontshow tag half_circ_and_hinge
            visible_fractions fractal_is_inherited gen_sting_is_inherited
   seq circulate [force_half]
   seq hinge [inherit_fractal inherit_gensting]

call "_explode the top part 2" dontshow tag plodetop2
            left_means_mirror
   setup 2x4 qtag rotate
      array [0 0 0 0 A0E C1E CCA7S C6N]   /* This stability stuff is highly questionable! */

call "_explode the top part 4" dontshow tag plodetop4
   /* The roll info here is bogus, and is put in to make "veer and turn" and "plus <N>" work. */
   setup qtag 2x4 rotate
      array [0 0 AL0S CR1S 0 0 CR7N AL6N]
   setup pqtag 2x4 rotate
      array [CR4W CR2E 0 0 AL1E AL7W 0 0]

call "explode the top" c3a
            left_means_mirror first_part_visible
   seq explode []
   seq plodetop2 [inherit_left]
   seq diamondcirc []
   seq plodetop4 []

call "explode the top, turn the star 1 less than usual" c3a
            left_means_mirror first_part_visible
   seq explode []
   seq plodetop2 [inherit_left]
   seq plodetop4 []

call "explode the top, turn the star @9 more than usual" c3a
            left_means_mirror neednumber first_part_visible
   seq explode []
   seq plodetop2 [inherit_left]
   seq diamondcirc []
   seq diamondcirc [repeat_n]
   seq plodetop4 []

call "_centers bits and pieces part 1" dontshow tag c_bits_pieces1
   // Doing this call in a reasonably satisfactory way is tricky.
   // The tests are t54, nf32, ng25, ki05, lg02, lo01, and vg04.
   // First, if everyone is consistent with a "box circulate" box, do a standard Peel and Trail.
   setup 2x2 1x4 qualifier wave_only
      array [AL0S CR2S AL1S CR3S]
   // Next, if everyone is consistent with a "Reverse the Pass" box, do the same,
   // even though the result will not be suitable for an Ah So.
   setup 2x2 1x4 qualifier peelable_box
      array [AL0S CR2S AL1S CR3S]
   // Next, if everyone is facing in or everyone is facing out, and the
   // above clauses don't apply, do the special "touch/lockit/lockit/"
   // or "turn back and touch" thing.
   setup 2x2 1x4 qualifier in_or_out
      array [AL1S CR2S AL1S CR2S]
   // Finally, just do a Peel and Trail.  This takes care of T-bones.
   // The result will not be suitable for an Ah So.
   setup 2x2 1x4 restriction unusual wave_only
      array [AL0S CR2S AL1S CR3S]

call "_centers bits and pieces" dontshow tag c_bits_pieces
            visible_fractions
   seq c_bits_pieces1 []
   seq ahso []

call "_centers bits and pieces but @m" dontshow tag c_bits_pieces_but
            visible_fractions
   seq c_bits_pieces1 []
   seq nullsecond [mandatory_secondary_call]

call "_two o circs" dontshow tag two_o_circs
   /* For magic hocus-pocus.  Unfortunately, the sleazy way we do this
      does not allow us to specify roll information reliably, so we have
      taken it out.  Someday, of course, we will code hocus pocus correctly.
      So little time; so much to do. */
            parallel_conc_end
   simple_funny
   setup 2x2 2x2
      array [C1S A0S Z1N Z0N]
            alternate_definition [magic] c3
   simple_funny
   setup 2x2 2x2 restriction wave_only
      array [C0S A1S Z0N Z1N]

call "_two o circs, for fractions" dontshow tag two_o_circs_for_frac
   // This has the same stuff as plain "two_o_circs" above.
            parallel_conc_end
   simple_funny
   setup 4x4 4x4
      array [0 AL13S ZM14N 0 0 ZM1N ZM10N 0 0 ZM13N CR14S 0 0 CM1S AM10S 0]
   simple_funny
   setup 2x2 2x2
      array [C1S A0S Z1N Z0N]
            alternate_definition [half] mainstream
   simple_funny
   setup 4x4 4x4
      array [0 ZM14N ZM1N 0 0 ZM2N ZM9N 0 0 ZM10N ZM13N 0 0 CR14S AL13S 0]
            alternate_definition [magic] c2
   simple_funny
   setup 4x4 4x4 restriction wave_only
      array [0 CR14S ZM13N 0 0 ZM10N ZM1N 0 0 ZM14N AL13S 0 0 CM10S AM1S 0]
   simple_funny
   setup 2x2 2x2 restriction wave_only
      array [C0S A1S Z0N Z1N]
            alternate_definition [magic half] c2
   simple_funny
   setup 4x4 4x4
      array [0 ZM13N ZM1N 0 0 ZM9N ZM2N 0 0 ZM10N ZM14N 0 0 CR14S AL13S 0]
            visible_fractions magic_is_inherited
   seq one_o_circ_for_frac [inherit_magic]
   seq one_o_circ_for_frac [inherit_magic]

call "_one o circ, for fractions" dontshow tag one_o_circ_for_frac
            parallel_conc_end
   simple_funny
   setup 4x4 4x4
      array [0 ZM14N ZM1N 0 0 ZM2N ZM9N 0 0 ZM10N ZM13N 0 0 CR14S AL13S 0]
            alternate_definition [half] c2
   setup 4x4 galaxy
      array [0 0 ZM4N 0 0 0 0 0 0 ZM0N 0 0 0 CR2E AL2W 0]
            alternate_definition [magic] c2
   simple_funny
   setup 4x4 4x4 restriction wave_only
      array [0 ZM13N ZM1N 0 0 ZM9N ZM2N 0 0 ZM10N ZM14N 0 0 CR14S AL13S 0]

call "_two o circs and trade" dontshow tag two_o_circs_and_trade
            visible_fractions yoyo_is_inherited gen_sting_is_inherited magic_is_inherited
   seq two_o_circs [inherit_magic]
   seq trade [inherit_yoyo inherit_gensting]

call "bits and pieces" c4a
            visible_fractions yoyo_is_inherited gen_sting_is_inherited magic_is_inherited
   // Inheriting yoyo to the centers will make it fail, of course.  This is
   // only legal if the yoyo modifier is given just to the outsides.
   // We no longer put "conc_demand_lines" on the outsides part.  This allows
   // reverse order to work.  The trade part will complain anyway if the elongation
   // isn't right.
   conc c_bits_pieces         [inherit_yoyo inherit_gensting]
        two_o_circs_and_trade [inherit_yoyo inherit_gensting inherit_magic endscando]

call "bits and pieces but @m" c4a
            visible_fractions yoyo_is_inherited gen_sting_is_inherited
   // Inheriting yoyo to the centers will make it fail, of course.  This is
   // only legal if the yoyo modifier is given just to the outsides.
   // We no longer put "conc_demand_lines" on the outsides part.  This allows
   // reverse order to work.  The trade part will complain anyway if the elongation
   // isn't right.
   conc c_bits_pieces_but [inherit_yoyo inherit_gensting] two_o_circs_and_trade [inherit_yoyo inherit_gensting endscando]

call "_fascinate part 1" dontshow tag fascinate1
            fractal_is_inherited gen_sting_is_inherited
   conc_to_outer_dmd nat34thru [inherit_fractal inherit_gensting] box_circ_15 [conc_demand_lines]

call "_finish fascinat@pe@q@ning@o@t" dontshow tag fascinate2
   conc_no31dwarn diamond_ends_isolate []
        2facedwheelanddeal [or_secondary_call conc_concentric_rules suppress_elongation_warnings]

call "_finish fascinating @0" dontshow tag fascinating2
   conc_no31dwarn diamond_ends_isolate []
        nullcall [mandatory_anycall conc_concentric_rules suppress_elongation_warnings]

call "fascinat@pe@q@ning@o@t" c2
            fractal_is_inherited gen_sting_is_inherited
   seq fascinate1 [inherit_fractal inherit_gensting]
   seq fascinate2 [roll_transparent]

call "fascinating @0" c2
            fractal_is_inherited gen_sting_is_inherited
   seq fascinate1 [inherit_fractal inherit_gensting]
   seq fascinating2 [roll_transparent]

call "_fan the gate part 1" dontshow tag fanthegate1
            fractal_is_inherited gen_sting_is_inherited
   conc nat34_34 [inherit_fractal inherit_gensting] box_circ_15 [conc_demand_lines]

call "_finish fan the gat@pe@q@ning@o@t" dontshow tag fanthegate2
   // See vg05 for this schema.
   conc_or_2_6_line nullcall []
                    bendtheline [or_secondary_call
                                 conc_force_spots suppress_elongation_warnings]

call "_finish fan the gating @0" dontshow tag fanthegating2
   conc_or_2_6_line nullcall []
                    nullcall [mandatory_anycall
                              conc_force_spots suppress_elongation_warnings]

call "fan the gat@pe@q@ning@o@t" c4a
   seq fanthegate1 []
   seq fanthegate2 []

call "fan the gating @0" c4a
   seq fanthegate1 []
   seq fanthegating2 []

call "_do yellow brick stuff" dontshow tag do_yellow_brick
   setup 2x4 3x1dmd rotate restriction forbidden wave_only
      array [M2N M3E M7E M2S M5S L0S R0N M5N]

call "follow the yellow brick@ning@o@r road@s" c4a
            visible_fractions
   seq neighbor []
   seq do_yellow_brick []
   seq fascinate2 []

call "follow the yellow bricking @0" c4a
   seq neighbor []
   seq do_yellow_brick []
   seq fascinating2 []

call "pass and roll the yellow brick@ning@o@r road@s" c4
            rear_back_from_r_wave first_part_visible
            left_means_mirror twisted_is_inherited magic_is_inherited
   seq passthru [inherit_left inherit_magic inherit_twisted]
   seq fin_passnroll_something [inherit_left]
   seq neighbor []
   seq do_yellow_brick []
   seq fascinate2 []

call "pass and roll the yellow bricking @0" c4
            rear_back_from_r_wave first_part_visible
            left_means_mirror twisted_is_inherited magic_is_inherited
   seq passthru [inherit_left inherit_magic inherit_twisted]
   seq fin_passnroll_something [inherit_left]
   seq neighbor []
   seq do_yellow_brick []
   seq fascinating2 []

call "@v the yellow brick@ning@o@r road@s" c4a
            first_part_visible singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_singlefile inherit_revert inherit_fractal]
   seq neighbor []
   seq do_yellow_brick []
   seq fascinate2 []

call "@v the yellow bricking @0" c4a
            first_part_visible singlefile_is_inherited revert_is_inherited fractal_is_inherited
   seq real_base_0 [inherit_singlefile inherit_revert inherit_fractal]
   seq neighbor []
   seq do_yellow_brick []
   seq fascinating2 []

call "snap" c4a tag snap
            revert_is_inherited fractal_is_inherited
   seq partnertag [inherit_revert inherit_fractal]

call "_touch and lockit" dontshow tag touchandlockit
            step_to_wave left_means_touch_or_check fractal_is_inherited gen_sting_is_inherited
   seq lockit [inherit_fractal inherit_gensting]

call "crackle" c4a tag crackle
            fractal_is_inherited gen_sting_is_inherited
   conc touchandlockit [inherit_fractal inherit_gensting]
        hinge_ignore_gen_if_couple [inherit_fractal inherit_gensting]

call "pop" c4a
   seq explodeline []

call "snap, crackle, and pop" c4
            fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq partnertag []
   seq crackle [inherit_fractal inherit_gensting]
   seq explodeline []

call "snap and crackle" c4
            fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq partnertag []
   seq crackle [inherit_fractal inherit_gensting]

call "reflected snap, crackle, and pop" c4
            fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq partnertag [force_reflect]
   seq crackle [inherit_fractal inherit_gensting]
   seq explodeline []

call "reflected snap and crackle" c4
            fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq partnertag [force_reflect]
   seq crackle [inherit_fractal inherit_gensting]

call "_single scoot and trade part 2" dontshow tag scootntrade_part2
            left_means_mirror   /* Not right; need "left_means_check" */
   setup pmd 1x4 qualifier right dmd_ctrs_mwv
      array [0 CR3E CR2E 0]
   // ***** Need to preserve "no_mirror" stuff.
   // That is, this used to be dmd_ctrs_mwv_change_to_34_tag
   setup pmd 1x4 qualifier left dmd_ctrs_mwv_no_mirror
      array [0 0 AL2W AL3W]

call "single scoot and trade" c4a
            visible_fractions left_means_mirror cross_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq scootback [inherit_cross inherit_yoyo inherit_gensting]
   seq scootntrade_part2 [inherit_left]
   seq hinge [cpls_unless_single]     // Of course it's never "single" in the sense of this part.

call "_slant touch and nothing" dontshow tag slant_touch_nothing1
            equalize
   setup 4x2 bigbone restriction forbidden siamese_in_quad
      array [0 0 ZM4N ZM5N ZM6N ZM7N 0 0]
   setup 2x4 3x4 restriction forbidden siamese_in_quad
      array [ZM0N ZM1N ZM2N ZM3N ZM5N ZM10N ZM5N ZM10N]
   setup c1phan bigdmd rotate qualifier ntbone none restriction forbidden siamese_in_quad
      array [0 ZM11W 0 ZM10W ZM0W 0 ZM1W 0 ZM3W 0 ZM8W 0 0 ZM8W 0 ZM3W]
   setup c1phan 3x4 qualifier tbone none restriction forbidden siamese_in_quad
      array [ZM0N 0 ZM1N 0 0 ZM3N 0 ZM2N ZM5N 0 ZM10N 0 0 ZM10N 0 ZM5N]
   setup deepxwv crosswave       // Cf. vi04.
      array [ZM0N ZM1N 0 0 0 0 ZM4N ZM5N 0 0 0 0]
   setup pdeepxwv crosswave      // Cf. vi04.
      array [ZM0N ZM1N ZM2N ZM7N ZM2N ZM7N ZM4N ZM5N 0 0 0 0]
            alternate_definition [single] c4
   setup 2x2 2x3 rotate restriction forbidden wave_only
      array [Z5W Z0W Z4W Z4W]
            alternate_definition [3x3] c4
   setup 2x6 3x6 restriction forbidden 3x3_2fl_only
      array [Z0N Z1N Z2N Z3N Z4N Z5N Z7N Z17N Z15N Z7N Z17N Z15N]
            alternate_definition [4x4] c4
   setup 2x8 3x8 restriction forbidden 4x4_2fl_only
      array [Z0N Z1N Z2N Z3N Z4N Z5N Z6N Z7N Z9N Z11N Z22N Z20N Z9N Z11N Z22N Z20N]

call "_outers old @2wheel and deal@3" dontshow tag slant_touch_wheel2_old
            bigmatrix_is_inherited single_is_inherited nxn_is_inherited
   maybe_in_out_triple_squash
      2facedwheelanddeal [or_anycall inherit_single inherit_bigmatrix inherit_nxn]
      nullcall []

call "_outers @2wheel and deal@3" dontshow tag slant_touch_wheel2
            bigmatrix_is_inherited single_is_inherited nxn_is_inherited
   maybe_in_out_triple_dyp_squash
      2facedwheelanddeal [or_anycall inherit_single inherit_bigmatrix inherit_nxn]
      nullcall []

call "_outers @0" dontshow tag triple_squash_outers_anything
            bigmatrix_is_inherited single_is_inherited nxn_is_inherited
   maybe_in_out_triple_squash
      nullcall [mandatory_anycall inherit_single inherit_bigmatrix inherit_nxn]
      nullcall []

call "_outers (new) @0" dontshow tag triple_squash_outers_anything_new
            bigmatrix_is_inherited single_is_inherited nxn_is_inherited
   maybe_in_out_triple_dyp_squash
      nullcall [mandatory_anycall inherit_single inherit_bigmatrix inherit_nxn]
      nullcall []

call "_rear back from right wave" dontshow tag rwave_rear_back
   setup 1x4 2x2 qualifier right wave_only
      array [ZM3N 0 0 ZM2N]

call "_slant rear back and @0" dontshow tag slant_centers
   seq rwave_rear_back []
   seq nullcall [mandatory_anycall]

call "_centers (old) rear back and @0 while ends @m" dontshow tag slant_secondary_nothing2_old
   in_out_triple_squash nullsecond [mandatory_secondary_call] slant_centers []

call "_centers rear back and @0 while ends @m" dontshow tag slant_secondary_nothing2
   in_out_triple_dyp_squash nullsecond [mandatory_secondary_call] slant_centers []

call "_centers rear back and @0 while ends wheel and deal" dontshow tag slant_nothing2_wheel_old
   in_out_triple_squash 2facedwheelanddeal [] slant_centers []

call "_centers rear back and @0 while ends wheel and deal" dontshow tag slant_nothing2_wheel
   in_out_triple_dyp_squash 2facedwheelanddeal [] slant_centers []

call "slant touch and @2wheel@3" c3a
            bigmatrix_is_inherited single_is_inherited nxn_is_inherited
   seq slant_touch_nothing1 [inherit_single inherit_bigmatrix inherit_nxn]
   seq slant_touch_wheel2 [inherit_single inherit_bigmatrix inherit_nxn]

call "slant touch and @0" c3a
            bigmatrix_is_inherited single_is_inherited nxn_is_inherited
   seq slant_touch_nothing1 [inherit_single inherit_bigmatrix inherit_nxn]
   seq triple_squash_outers_anything_new [inherit_single inherit_bigmatrix inherit_nxn]

call "slant @0 and wheel" c3a
   seq slant_touch_nothing1 []
   seq slant_nothing2_wheel []

call "slant @0 and @m" c3a tag slantanythinganything
   seq slant_touch_nothing1 []
   seq slant_secondary_nothing2 []

call "slant @0 by @m" c3a
   alias slantanythinganything

/* This is, of course, a stupid way to do this.  Will do it the right way someday.... */
// Cf. nf37.
call "1x3 slant touch and wheel" c4
   setup 2x4 3dmd
      preds "Need a 3&1 line for this."
         if miniwave_side_of_out_3n1_line [CR1S 0 0 AL1S    0  ZM4N  ZM9N    0]
         if couple_side_of_out_3n1_line   [   0 0 0    0 ZM4N ZM11N ZM11N ZM9N]

call "_slant move in" dontshow tag slant_move_in
   setup 2x3 2x2 qualifier true_Z_cw
      array [ 0 0 0 0 ZM2N ZM3N]
   setup 2x3 2x2 qualifier true_Z_ccw
      array [ 0 0 0 ZM2N ZM3N 0]

call "slant @0" c3a
   seq slant_move_in []
   seq nullcall [mandatory_anycall]

call "_centers slip" dontshow tag ctrs_slip
            yoyo_is_inherited gen_sting_is_inherited bigmatrix_is_inherited
   /* This call, and the one following, create serious problems for
      the concentric call mechanism.  If we are doing diamond chain thru
      in, say, split phantom diamonds with only the points as real people
      (that is, we physically have columns far apart), then the outsides
      will all be phantoms when the setup is concentrified.  The concentric
      call mechanism has a hard time figuring out the result setup in such
      a case.  Special code has been added to look for the case of outsides
      being phantoms and the call being "nullcall", in which case it make
      the outsides hold the setup that the phantoms were occupying, and
      forces the "conc_force_spots" flag to be obeyed. */
   maybematrix_conc any_hand_slip [inherit_yoyo inherit_gensting inherit_bigmatrix] nullcall []

call "_centers slip, with mod and 12 or 16 matrix" dontshow tag ctrs_slip_with_mod1216
            yoyo_is_inherited gen_sting_is_inherited bigmatrix_is_inherited
   /* See the previous call. */
   maybematrix_conc any_hand_slip [inherit_yoyo inherit_gensting allow_forced_mod inherit_bigmatrix] nullcall []

call "_centers slip, with mod" dontshow tag ctrs_slip_with_mod
            yoyo_is_inherited gen_sting_is_inherited
   /* See the previous call. */
   select_center2 trade [inherit_yoyo inherit_gensting allow_forced_mod] nullcall []

call "_start sterling chain thru" dontshow tag startsterl
   setup 2x4 qtag rotate
   array [6N 1E 4E 6S 3S 1W 4W 3N]

call "@2diamond @3chain thru" a2
            yoyo_is_inherited gen_sting_is_inherited intlk_is_inherited magic_is_inherited
            funny_is_inherited fractal_is_inherited visible_fractions
   seq diamondcirc [or_anycall inherit_yoyo inherit_intlk inherit_magic inherit_funny]
   seq ctrs_slip_with_mod [inherit_yoyo inherit_gensting roll_transparent]
   seq ctrscastoff_n [inherit_fractal inherit_gensting roll_transparent insert_number 3]

// Of course this won't work unless something special, like "yoyo", is done.
call "@2hourglass @3chain thru" c2
            yoyo_is_inherited gen_sting_is_inherited intlk_is_inherited magic_is_inherited
            funny_is_inherited fractal_is_inherited visible_fractions
   seq hrglass_circ [or_anycall inherit_intlk inherit_magic inherit_funny]
   seq ctrs_slip_with_mod [inherit_yoyo inherit_gensting roll_transparent]
   seq ctrscastoff_n [inherit_fractal roll_transparent insert_number 3]

// Ditto.
call "@2galaxy @3chain thru" c2
            yoyo_is_inherited gen_sting_is_inherited intlk_is_inherited magic_is_inherited
            funny_is_inherited fractal_is_inherited visible_fractions
   seq galaxy_circ [or_anycall inherit_intlk inherit_magic inherit_funny]
   seq ctrs_slip_with_mod [inherit_yoyo inherit_gensting roll_transparent]
   seq ctrscastoff_n [inherit_fractal roll_transparent insert_number 3]

call "@2diamond @3chain thru but @m" c3a
            yoyo_is_inherited gen_sting_is_inherited intlk_is_inherited magic_is_inherited
            funny_is_inherited visible_fractions
   seq diamondcirc [or_anycall inherit_yoyo inherit_gensting inherit_intlk inherit_magic inherit_funny]
   seq ctrs_slip_with_mod [inherit_yoyo inherit_gensting roll_transparent]
   seq ctrs_mandatory_2ndcall [roll_transparent]

call "@0 chain thru" c1
            dont_use_in_resolve yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited visible_fractions
   seq nullcall [mandatory_anycall]
   seq ctrs_slip_with_mod [inherit_yoyo inherit_gensting roll_transparent]
   seq ctrscastoff_n [inherit_fractal roll_transparent insert_number 3]

call "@0 chain thru but @m" c3a
            dont_use_in_resolve yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq nullcall [mandatory_anycall]
   seq ctrs_slip_with_mod [inherit_yoyo inherit_gensting roll_transparent]
   seq ctrs_mandatory_2ndcall [roll_transparent]

call "@2hourglass @3yoyo chain thru" c4
            funny_is_inherited fractal_is_inherited visible_fractions
   seq hrglass_circ [or_anycall inherit_funny]
   seq ctrs_slip_with_mod [force_yoyo roll_transparent]
   seq ctrscastoff_n [inherit_fractal roll_transparent insert_number 3]

call "@0 yoyo chain thru" c4
            dont_use_in_resolve visible_fractions
   seq nullcall [mandatory_anycall]
   seq ctrs_slip_with_mod [force_yoyo roll_transparent]
   seq ctrscastoff_n [roll_transparent insert_number 3]

call "in point triangle circulate" c1 tag inpttglcirc
            fudge_to_q_tag
   setup pqtag qtag qualifier live right pu_qtag_like
      array [CR7S ZM1N CR4S ZM2N 0 0 0 0]
   setup pqtag qtag qualifier live left pu_qtag_like
      array [0 0 AL1S ZM2N ZM4N AL7S 0 0]
   setup qtag qtag restriction forbidden nice_diamonds
      array [0 0 AL1W CR2S 0 0 CR0E AL6S]
   setup pqtag qtag restriction forbidden nice_diamonds
      array [CR7E ZM1N 0 0 ZM4N AL7W 0 0]

call "out point triangle circulate" c1 tag outpttglcirc
            fudge_to_q_tag
   setup pqtag qtag qualifier live right pu_qtag_like
      array [ZM0N CR2S 0 0 0 0 ZM7N CR5S]
   setup pqtag qtag qualifier live left pu_qtag_like
      array [0 0 0 0 AL2S ZM5N ZM7N AL0S]
   setup qtag qtag restriction forbidden nice_diamonds
      array [0 0 AL3S CR1E 0 0 CR7S AL0W]
   setup pqtag qtag restriction forbidden nice_diamonds
      array [ZM0N CR2E 0 0 AL2W ZM5N 0 0]

call "in point triangle chain thru" c1
            yoyo_is_inherited gen_sting_is_inherited fractal_is_inherited visible_fractions
   seq inpttglcirc []
   seq ctrs_slip_with_mod [inherit_yoyo inherit_gensting roll_transparent]
   seq ctrscastoff_n [inherit_fractal roll_transparent insert_number 3]

call "out point triangle chain thru" c1
            yoyo_is_inherited gen_sting_is_inherited fractal_is_inherited visible_fractions
   seq outpttglcirc []
   seq ctrs_slip_with_mod [inherit_yoyo inherit_gensting roll_transparent]
   seq ctrscastoff_n [inherit_fractal roll_transparent insert_number 3]

call "sterling chain thru" c4x
            dont_use_in_resolve fractal_is_inherited
   seq startsterl []
   seq ctrs_slip_with_mod [roll_transparent]
   seq ctrscastoff_n [inherit_fractal roll_transparent insert_number 3]

call "_circulate @9 times" dontshow tag circ_n_times
            neednumber bigmatrix_is_inherited
   seq circulate [inherit_bigmatrix repeat_n]

call "_circulate @9-1/2 times" dontshow tag circ_n_times_and_a_half
            neednumber bigmatrix_is_inherited
   seq circulate [inherit_bigmatrix repeat_n]
   seq circulate [inherit_bigmatrix force_half]

call "_start @B chain and circ in" dontshow tag startchcircin
            bigmatrix_is_inherited neednumber fractal_is_inherited gen_sting_is_inherited yoyo_fractal_numbers
   maybematrix_conc armturn_n4 [inherit_fractal inherit_gensting]
                    circ_n_times [conc_demand_lines conc_force_spots insert_number 2]

call "_finish @B chain and circ in" dontshow tag finchcircin
            bigmatrix_is_inherited neednumber fractal_is_inherited gen_sting_is_inherited
   maybematrix_conc cast_off_n4_with_warn [allow_forced_mod inherit_fractal inherit_gensting]
                    nullcall [conc_demand_lines conc_force_lines]

call "_spread, with 2-faced" dontshow tag spread_2f
            12_16_matrix_means_split
   setup 1x4 1x4
      array [ZM1N ZM0N ZM3N ZM2N]
   setup 2x4 2x4 rotate qualifier tbone none
      array [ZM6W 0 0 ZM1W ZM2W 0 0 ZM5W]
   setup 4x2 2x4 rotate qualifier tbone none
      array [0 ZM7W ZM0W 0 0 ZM3W ZM4W 0]

call "@B chain and circulate in" c4
            step_to_wave bigmatrix_is_inherited neednumber fractal_is_inherited gen_sting_is_inherited
   seq startchcircin [inherit_bigmatrix inherit_fractal inherit_gensting]
   seq ctrs_slip_with_mod1216 [inherit_bigmatrix]
   seq finchcircin [inherit_bigmatrix insert_number 3 inherit_fractal inherit_gensting]
   seq spread_2f [inherit_bigmatrix]
   // Alternate definitions, from change lanes.
   crossconc circ_n_times [conc_demand_lines insert_number 2]
             any_hand_remake_start_with_n [conc_force_lines]
   crossconc circ_xocirc [conc_demand_columns]
             any_hand_remake_start_with_n [conc_force_lines]

call "fan chain and circulate in" c4
            step_to_wave bigmatrix_is_inherited left_means_touch_or_check fractal_is_inherited gen_sting_is_inherited
   seq startchcircin [inherit_bigmatrix inherit_fractal inherit_gensting insert_number 3]
   seq ctrs_slip_with_mod1216 [inherit_bigmatrix]
   seq finchcircin [inherit_bigmatrix inherit_fractal inherit_gensting insert_number 3]
   seq spread_2f [inherit_bigmatrix]
   // Alternate definitions, from change lanes.
   crossconc circ_n_times [conc_demand_lines insert_number 2]
             any_hand_remake_start_with_n [conc_force_lines insert_number 3]
   crossconc circ_xocirc [conc_demand_columns]
             any_hand_remake_start_with_n [conc_force_lines insert_number 3]

call "spin chain and circulate in" c4
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            can_be_fan bigmatrix_is_inherited left_means_touch_or_check first_part_visible
   seq trade [inherit_yoyo inherit_gensting inherit_bigmatrix]
   seq startchcircin [inherit_bigmatrix inherit_fractal inherit_gensting insert_number 3]
   seq ctrs_slip_with_mod1216 [inherit_bigmatrix]
   seq finchcircin [inherit_bigmatrix inherit_fractal inherit_gensting insert_number 3]
   seq spread_2f [inherit_bigmatrix]

call "swing chain and circulate in" c4
            step_to_wave yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
            can_be_fan bigmatrix_is_inherited left_means_touch_or_check first_part_visible
   seq trade [inherit_yoyo inherit_gensting inherit_bigmatrix]
   seq startchcircin [inherit_bigmatrix inherit_fractal inherit_gensting insert_number 1]
   seq ctrs_slip_with_mod1216 [inherit_bigmatrix]
   seq finchcircin [inherit_bigmatrix insert_number 1 inherit_fractal inherit_gensting]
   seq spread_2f [inherit_bigmatrix]

call "scoot and weave" a2
            fudge_to_q_tag
   setup 2x2 1x4 rotate restriction unusual wave_only
      array [CCAL3N AACR3S AL2N CR2S]
   setup pmd 1x4 qualifier right wave_only
      array [CR0W CCAL1E 0 0]
   setup pmd 1x4 qualifier left wave_only
      array [AL0E 0 0 AACR1W]
            alternate_definition [cross] c4
   setup pmd 1x4 qualifier right wave_only
      array [AL0E AACR1W 0 0]
   setup pmd 1x4 qualifier left wave_only
      array [CR0W 0 0 CCAL1E]
            alternate_definition [grand] a2
   setup 3x2 1x6 restriction forbidden wave_only
      array [CR0W CCAL1E CCAL5E AACR5W AACR1W AL0E]
   setup 4x2 1x8 restriction forbidden wave_only
      array [CR0W CCAL1E CCAL2E CCAL7E AACR7W AACR2W AACR1W AL0E]
            visible_fractions yoyo_is_inherited gen_sting_is_inherited
   seq strictboxyscootback [inherit_yoyo inherit_gensting]
   seq weave []
            visible_fractions yoyo_is_inherited gen_sting_is_inherited
   seq extend_1_to_2 []
   seq trade [inherit_yoyo inherit_gensting]
   seq weave []

call "@0 and weave" c1
            visible_fractions
   seq nullcall [mandatory_anycall]
   seq weave []

call "turn and weave" c4a
   // Sorry, but "yoyo turn and weave" is like slip, and will raise
   // overcast if preceded by a slip.
            step_to_wave left_means_mirror dont_raise_overcast
   setup 2x2 1x4 rotate restriction forbidden wave_only
      array [CCAL3N AACR3S AL2N CR2S]
   setup pmd 1x4 qualifier right dmd_ctrs_mwv
      array [AL3W CR0W 0 0]
   setup pmd 1x4 qualifier left dmd_ctrs_mwv
      array [CR3E 0 0 AL0E]
            alternate_definition [yoyo] c4
   setup 1x4 1x4 qualifier ntbone wave_only
      array [CR0N AAACR3S AL2N CCCAL1S]
   setup 4x1 1x4 qualifier right dmd_ctrs_mwv
      array [AL3W 0 0 0]
   setup 1x4 1x4 qualifier right dmd_ctrs_mwv
      array [0 CR0N 0 0]
   setup 4x1 1x4 qualifier left dmd_ctrs_mwv
      array [CR3E 0 0 0]
   setup 1x4 1x4 qualifier left dmd_ctrs_mwv
      array [0 0 0 AL2N]
            alternate_definition [generous] c3
   setup 1x4 1x4 qualifier ntbone wave_only
      array [CR0N AAACR3S AL2N CCCAL1S]
            alternate_definition [stingy] c3
   setup 1x4 1x4 qualifier ntbone wave_only
      array [CCAL3N AL0S AACR1N CR2S]

call "_fold to face" dontshow tag foldtoface
   setup 1x2 1x2 rotate restriction forbidden wave_only
      array [CR0E AL0E]
            alternate_definition [cross] c2
   setup 1x4 2x2 restriction forbidden wave_only
      array [CR1S CR1S AL0S AL0S]
            alternate_definition [interlocked] c3
   setup 1x4 2x2 restriction forbidden 2fl_only
      array [CR0S CR1S AL1S AL0S]

call "_ramble part 1" dontshow tag ramble_1
            cross_is_inherited intlk_is_inherited
   conc foldtoface [inherit_cross inherit_intlk]
        leads_div_move_along [inherit_cross conc_demand_columns conc_force_otherway endscando]

call "_ctrs ramble" dontshow tag ctrsramble
            cross_is_inherited intlk_is_inherited visible_fractions
   seq foldtoface [inherit_cross inherit_intlk]
   seq slidethru []

call "_ends ramble" dontshow tag endsramble
            cross_is_inherited visible_fractions
   seq leads_div_move_along [inherit_cross]
   seq slidethru []

call "ramble" c1 tag ramble
            fudge_to_q_tag cross_is_inherited intlk_is_inherited visible_fractions
   seq ramble_1 [inherit_cross inherit_intlk]
   seq slidethru []
            fudge_to_q_tag cross_is_inherited intlk_is_inherited visible_fractions
   conc ctrsramble [inherit_cross inherit_intlk]
        endsramble [inherit_cross conc_demand_columns conc_force_otherway endscando]

call "_check ctrs cross counter" dontshow tag check_cross_counter
   setup 1x2 1x2
      array [ZM0N ZM1N]
            alternate_definition [cross] c3a
   setup 1x4 1x4 restriction forbidden wave_only
      array [CR3S CR2S AL1S AL0S]

// We have to split this up this way so that the checking won't count as a visible fraction.
call "_ctrs counter part 1" dontshow tag ctr_counter_1
            cross_is_inherited intlk_is_inherited nxn_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq check_cross_counter [inherit_cross]
   seq cast_off_n4_with_warn [allow_forced_mod inherit_intlk inherit_nxn insert_number 3 inherit_fractal inherit_gensting]

call "_central counter" dontshow tag ctrscounter
            visible_fractions cross_is_inherited intlk_is_inherited
            fractal_is_inherited nxn_is_inherited gen_sting_is_inherited
   seq ctr_counter_1 [inherit_cross inherit_intlk inherit_nxn inherit_fractal inherit_gensting]
   seq splitctrrot [allow_forced_mod inherit_nxn]

call "_ctrs cross counter" dontshow tag ctrscrosscounter
            visible_fractions intlk_is_inherited fractal_is_inherited
   seq tradethewave []
   seq cast_off_n4 [inherit_intlk inherit_fractal insert_number 3]
   seq splitctrrot [or_anycall]

call "_ends counter" dontshow tag endscounter
            visible_fractions left_means_mirror cross_is_inherited gen_sting_is_inherited
   seq leads_div_move_along [inherit_cross]
   seq touch_n_4 [inherit_left inherit_gensting insert_number 2]
   seq stepnfold []

call "counter" c2 tag counter
            fudge_to_q_tag visible_fractions left_means_mirror
            cross_is_inherited intlk_is_inherited fractal_is_inherited gen_sting_is_inherited
            nxn_is_inherited
   conc ctrscounter [inherit_intlk inherit_cross inherit_nxn inherit_fractal inherit_gensting]
        endscounter [inherit_left inherit_cross inherit_nxn inherit_fractal inherit_gensting
                     conc_demand_columns conc_force_otherway endscando]

call "cross counter" c3a
            fudge_to_q_tag visible_fractions left_means_mirror
            intlk_is_inherited fractal_is_inherited
   conc ctrscrosscounter [inherit_intlk inherit_fractal]
        endscounter [inherit_left force_cross conc_demand_columns conc_force_otherway endscando]

call "_ctrs rally" dontshow tag ctrsrally
            visible_fractions intlk_is_inherited gen_sting_is_inherited
   seq stepnfold_c3b_intlk [inherit_intlk]
   seq peelntrail [allow_plain_mod inherit_gensting]

call "_ctrs rally but @m" dontshow tag ctrsrallybut2nd
            visible_fractions intlk_is_inherited
   seq stepnfold_c3b_intlk [inherit_intlk]
   seq nullsecond [mandatory_secondary_call]

call "_ends rally" dontshow tag endsrally
            left_means_mirror
   setup 2x2 1x4 qualifier out in_or_out
      array [CM2S CR3N CAL3S CAM2N]
   setup 2x2 1x4 restriction unusual alwaysfail
      array [CM2S CR3N CAL3S CAM2N]

call "_ends rally, ends go as you are" dontshow tag endsrally_ends_as_are
            left_means_mirror
   setup 2x2 1x4 rotate restriction wave_only
      array [CR1S AL1N AM0S CM0N]

call "rally" c3a tag rally
            fudge_to_q_tag left_means_mirror
   setup qtag 1x8 qualifier right wave_only
      array [CM4S CR5N 0 CR7S 0 0 CCAL6N 0]
   setup qtag 1x8 qualifier left wave_only
      array [CM4S CR5N AACR2N 0 0 0 0 AL3S]
            alternate_definition [interlocked] c3a
   setup qtag 1x8 qualifier right 2fl_only
      array [CM4S CR5N 0 0 0 0 CR2N AL3S]
   setup qtag 1x8 qualifier left 2fl_only
      array [CM4S CR5N AL6N CR7S 0 0 0 0]
            fudge_to_q_tag left_means_mirror intlk_is_inherited gen_sting_is_inherited
   conc ctrsrally [inherit_intlk inherit_gensting] endsrally [inherit_left conc_demand_columns endscando]

call "_natural rally" dontshow tag natural_rally
            fudge_to_q_tag left_means_touch_or_check
   setup qtag 1x8 qualifier right wave_only
      array [CM4S CR5N 0 CR7S 0 0 CCAL6N 0]
   setup qtag 1x8 qualifier left wave_only
      array [AL1N AM0S AACR2N 0 0 0 0 AL3S]
            alternate_definition [interlocked] c3a
   setup qtag 1x8 qualifier right 2fl_only
      array [CM4S CR5N 0 0 0 0 CR2N AL3S]
   setup qtag 1x8 qualifier left 2fl_only
      array [AL1N AM0S AL6N CR7S 0 0 0 0]
            fudge_to_q_tag left_means_mirror intlk_is_inherited
   conc ctrsrally [inherit_intlk] endsrally [inherit_left conc_demand_columns endscando]

call "rally but @m" c3a tag rallybut2nd
            fudge_to_q_tag left_means_mirror intlk_is_inherited
   conc ctrsrallybut2nd [inherit_intlk] endsrally [inherit_left conc_demand_columns endscando]

call "rally, ends go as you are" c3a
            fudge_to_q_tag left_means_mirror intlk_is_inherited
   conc ctrsrally [inherit_intlk]
        endsrally_ends_as_are [inherit_left conc_demand_lines endscando]

call "rally, ends go as you are but @m" c3a
            fudge_to_q_tag left_means_mirror intlk_is_inherited
   conc ctrsrallybut2nd [inherit_intlk]
        endsrally_ends_as_are [inherit_left conc_demand_lines endscando]

call "_ends little" dontshow tag endslittle
            left_means_mirror visible_fractions
   seq quarter_right [inherit_left]
   seq ctr_rot []

call "_ends little, face @h" dontshow tag endslittledir
            visible_fractions
   seq quarter_maybe []
   seq ctr_rot []

call "_centers finish plenty" dontshow tag cfinplenty
   setup 2x2 1x4 qualifier wave_only
      array [AL0S CR2S ZM3N ZM1N]
   setup 2x2 1x4 qualifier in_or_out
      array [AL1S CR2S ZM3N ZM0N]

call "_counter rotate and roll" dontshow tag ctr_rot_roll
            visible_fractions single_is_inherited
   seq ctr_rot [inherit_single]
   seq roll []

call "_finish plenty" dontshow tag finishplenty
   conc cfinplenty [] ctr_rot_roll [conc_force_otherway endscando]

call "_finish little more" dontshow tag finlilmore
   conc box_circulate_maybe_diamond [] nullcall []

call "little" c1 tag little
            fudge_to_q_tag left_means_mirror
            intlk_is_inherited straight_is_inherited visible_fractions
   conc4_2_or_normal stepnfold [inherit_intlk inherit_straight]
                     endslittle [inherit_left inherit_straight conc_force_otherway
                                only_force_elong_if_empty endscando]

call "little but @m" c1 tag littlebut2nd
            fudge_to_q_tag left_means_mirror
            visible_fractions
   conc4_2_or_normal nullsecond [mandatory_secondary_call]
                     endslittle [inherit_left conc_force_otherway
                                only_force_elong_if_empty endscando]

call "_natural little" dontshow tag natural_little
            fudge_to_q_tag left_means_touch_or_check
   // Note that, when the ends are facing in, this is a plain right little
   // (unless "left" was given) -- they couldn't possibly have just done
   // a scoot back.  Cf. test bi01t.
   setup qtag 2x4 qualifier right wave_only
      array [CR3S CR4S 0 ZM2N AL3N AL4N CR1S 0]
   setup qtag 2x4 qualifier left wave_only
      array [AL7S AL0S AL2S 0 AL3N AL4N 0 ZM1N]
            alternate_definition [interlocked] c3a
   setup qtag 2x4 qualifier right 2fl_only
      array [CR3S CR4S 0 0 AL3N AL4N CR2S ZM1N]
   setup qtag 2x4 qualifier left 2fl_only
      array [AL7S AL0S AL1S ZM2N AL3N AL4N 0 0]

call "little, ends go as you are" c1 tag little_ends_as_are
            fudge_to_q_tag intlk_is_inherited
   conc4_2_or_normal stepnfold [inherit_intlk]
                     ctr_rot [conc_force_otherway
                             only_force_elong_if_empty endscando]

call "little, ends face @h" c1 tag little_ends_face_dir
            fudge_to_q_tag left_means_touch_or_check intlk_is_inherited
   conc4_2_or_normal stepnfold [inherit_intlk]
                     endslittledir [conc_force_otherway
                                   only_force_elong_if_empty endscando]

call "little more" c2 tag lilmore
            fudge_to_q_tag left_means_mirror intlk_is_inherited visible_fractions
   seq little [inherit_intlk inherit_left]
   seq finlilmore []

call "_natural little more" dontshow tag natural_lilmore
            left_means_mirror intlk_is_inherited visible_fractions
   seq natural_little [inherit_left inherit_intlk]
   seq finlilmore []

call "little more, ends go as you are" c2 tag lilmore_ends_as_are
            fudge_to_q_tag intlk_is_inherited      /* No visible fractions. */
   seq little_ends_as_are [inherit_intlk]
   seq finlilmore []

call "little more, ends face @h" c2 tag lilmore_ends_face_dir
            fudge_to_q_tag left_means_mirror intlk_is_inherited visible_fractions
   seq little_ends_face_dir [inherit_left inherit_intlk]
   seq finlilmore []

call "plenty@S" c1 tag plenty
            left_means_mirror intlk_is_inherited visible_fractions
   seq little [inherit_left inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "_natural plenty@S" dontshow tag natural_plenty
            left_means_mirror intlk_is_inherited visible_fractions
   seq natural_little [inherit_left inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "plenty, ends go as you are@S" c1
            intlk_is_inherited visible_fractions
   seq little_ends_as_are [inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "plenty, ends face @h@S" c1
            intlk_is_inherited visible_fractions
   seq little_ends_face_dir [inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "plenty, replace the star turns with @m" c1
            left_means_mirror intlk_is_inherited visible_fractions
   seq little [inherit_left inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "plenty, ends go as you are, replace the star turns with @m" c1
            intlk_is_inherited visible_fractions
   seq little_ends_as_are [inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "plenty, ends face @h, replace the star turns with @m" c1
            intlk_is_inherited visible_fractions
   seq little_ends_face_dir [inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "plenty@S, interrupt before the star turns with @m" c1
            left_means_mirror intlk_is_inherited visible_fractions
   seq little [inherit_left inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "plenty, ends go as you are@S, interrupt before the star turns with @m" c1
            intlk_is_inherited visible_fractions
   seq little_ends_as_are [inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "plenty, ends face @h@S, interrupt before the star turns with @m" c1
            intlk_is_inherited visible_fractions
   seq little_ends_face_dir [inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "plenty@S, interrupt after the star turns with @m" c1
            left_means_mirror intlk_is_inherited visible_fractions
   seq little [inherit_left inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "plenty, ends go as you are@S, interrupt after the star turns with @m" c1
            intlk_is_inherited visible_fractions
   seq little_ends_as_are [inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "plenty, ends face @h@S, interrupt after the star turns with @m" c1
            intlk_is_inherited visible_fractions
   seq little_ends_face_dir [inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "@2scoot @3and little" c1
            visible_fractions left_means_mirror
            intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited cross_is_inherited
   seq qtagscootback [or_anycall inherit_intlk inherit_yoyo inherit_gensting inherit_cross]
   seq natural_little [inherit_left inherit_intlk]

call "@2scoot @3and little but @m" c1
            visible_fractions left_means_mirror
            intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited cross_is_inherited
   seq qtagscootback [or_anycall inherit_intlk inherit_yoyo inherit_gensting inherit_cross]
   seq littlebut2nd [inherit_left]

call "@2scoot @3and little, ends go as you are" c1
            left_means_mirror intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited cross_is_inherited
   seq rtqtagscootback [or_anycall inherit_left inherit_intlk inherit_yoyo inherit_gensting inherit_cross]
   seq little_ends_as_are [inherit_intlk]

call "@2scoot @3and little, ends face @h" c1
            left_means_mirror intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited cross_is_inherited
   seq qtagscootback [or_anycall inherit_intlk inherit_yoyo inherit_gensting inherit_cross]
   seq little_ends_face_dir [inherit_left inherit_intlk]

call "@2scoot @3and little more" c2
            visible_fractions left_means_mirror
            intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited cross_is_inherited
   seq qtagscootback [or_anycall inherit_intlk inherit_yoyo inherit_gensting inherit_cross]
   seq natural_lilmore [inherit_left inherit_intlk]

call "@2scoot @3and little more, ends go as you are" c2
            left_means_mirror intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited cross_is_inherited
   seq rtqtagscootback [or_anycall inherit_left inherit_intlk inherit_yoyo inherit_gensting inherit_cross]
   seq lilmore_ends_as_are [inherit_intlk]

call "@2scoot @3and little more, ends face @h" c2
            left_means_mirror intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited cross_is_inherited
   seq rtqtagscootback [or_anycall inherit_left inherit_intlk inherit_yoyo inherit_gensting inherit_cross]
   seq lilmore_ends_face_dir [inherit_intlk]

call "@2scoot @3and plenty@S" c1
   // This has two parts.  The second is "(natural) plenty", which has 3 parts.
   // We allow "left_means_mirror" so that people can give "left", but
   // we don't require them to.
            visible_fractions left_means_mirror
            intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited cross_is_inherited
   seq qtagscootback [or_anycall inherit_intlk inherit_yoyo inherit_gensting inherit_cross]
   seq natural_plenty [inherit_left inherit_intlk]

call "@2scoot @3and plenty, ends go as you are@S" c1
            left_means_mirror intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited
            cross_is_inherited visible_fractions
   seq rtqtagscootback [or_anycall inherit_left inherit_intlk inherit_yoyo inherit_gensting inherit_cross]
   seq little_ends_as_are [inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "@2scoot @3and plenty, ends face @h@S" c1
            left_means_mirror intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited
            cross_is_inherited visible_fractions
   seq qtagscootback [or_anycall inherit_intlk inherit_yoyo inherit_gensting inherit_cross]
   seq little_ends_face_dir [inherit_left inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "@2scoot @3and plenty, replace the star turns with @m" c1
            left_means_mirror intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq qtagscootback [or_anycall inherit_intlk inherit_yoyo inherit_gensting]
   seq natural_little [inherit_left inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "@2scoot @3and plenty, ends go as you are, replace the star turns with @m" c1
            left_means_mirror intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq rtqtagscootback [or_anycall inherit_left inherit_intlk inherit_yoyo inherit_gensting]
   seq little_ends_as_are [inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "@2scoot @3and plenty, ends face @h, replace the star turns with @m" c1
            left_means_mirror intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq qtagscootback [or_anycall inherit_intlk inherit_yoyo inherit_gensting]
   seq little_ends_face_dir [inherit_left inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "@2scoot @3and plenty@S, interrupt before the star turns with @m" c1
            left_means_mirror intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq qtagscootback [or_anycall inherit_intlk inherit_yoyo inherit_gensting]
   seq natural_little [inherit_left inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "@2scoot @3and plenty, ends go as you are@S, interrupt before the star turns with @m" c1
            left_means_mirror intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq rtqtagscootback [or_anycall inherit_left inherit_intlk inherit_yoyo inherit_gensting]
   seq little_ends_as_are [inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "@2scoot @3and plenty, ends face @h@S, interrupt before the star turns with @m" c1
            left_means_mirror intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq qtagscootback [or_anycall inherit_intlk inherit_yoyo inherit_gensting]
   seq little_ends_face_dir [inherit_left inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "@2scoot @3and plenty@S, interrupt after the star turns with @m" c1
            left_means_mirror intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq qtagscootback [or_anycall inherit_intlk inherit_yoyo inherit_gensting]
   seq natural_little [inherit_left inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "@2scoot @3and plenty, ends go as you are@S, interrupt after the star turns with @m" c1
            left_means_mirror intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq rtqtagscootback [or_anycall inherit_left inherit_intlk inherit_yoyo inherit_gensting]
   seq little_ends_as_are [inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "@2scoot @3and plenty, ends face @h@S, interrupt after the star turns with @m" c1
            left_means_mirror intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq qtagscootback [or_anycall inherit_yoyo inherit_gensting]
   seq little_ends_face_dir [inherit_left inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "@0 and little" c1
            left_means_mirror intlk_is_inherited
   seq nullcall [mandatory_anycall]
   seq little [inherit_left inherit_intlk]

call "@0 and little, ends go as you are" c1
            intlk_is_inherited
   seq nullcall [mandatory_anycall]
   seq little_ends_as_are [inherit_intlk]

call "@0 and little, ends face @h" c1
            intlk_is_inherited
   seq nullcall [mandatory_anycall]
   seq little_ends_face_dir [inherit_intlk]

call "@0 and little more" c2
            left_means_mirror intlk_is_inherited
   seq nullcall [mandatory_anycall]
   seq lilmore [inherit_left inherit_intlk]

call "@0 and little more, ends go as you are" c2
            intlk_is_inherited
   seq nullcall [mandatory_anycall]
   seq lilmore_ends_as_are [inherit_intlk]

call "@0 and little more, ends face @h" c2
            intlk_is_inherited
   seq nullcall [mandatory_anycall]
   seq lilmore_ends_face_dir [inherit_intlk]

call "@0 and plenty@S" c1
            left_means_mirror intlk_is_inherited visible_fractions
   seq nullcall [mandatory_anycall]
   seq little [inherit_left inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "@0 and plenty, ends go as you are@S" c1
            intlk_is_inherited visible_fractions
   seq nullcall [mandatory_anycall]
   seq little_ends_as_are [inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "@0 and plenty, ends face @h@S" c1
            intlk_is_inherited visible_fractions
   seq nullcall [mandatory_anycall]
   seq little_ends_face_dir [inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "@0 and plenty, replace the star turns with @m" c1
            left_means_mirror intlk_is_inherited visible_fractions
   seq nullcall [mandatory_anycall]
   seq little [inherit_left inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "@0 and plenty, ends go as you are, replace the star turns with @m" c1
            intlk_is_inherited visible_fractions
   seq nullcall [mandatory_anycall]
   seq little_ends_as_are [inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "@0 and plenty, ends face @h, replace the star turns with @m" c1
            intlk_is_inherited visible_fractions
   seq nullcall [mandatory_anycall]
   seq little_ends_face_dir [inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "@0 and plenty@S, interrupt before the star turns with @m" c1
            left_means_mirror intlk_is_inherited visible_fractions
   seq nullcall [mandatory_anycall]
   seq little [inherit_left inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "@0 and plenty, ends go as you are@S, interrupt before the star turns with @m" c1
            intlk_is_inherited visible_fractions
   seq nullcall [mandatory_anycall]
   seq little_ends_as_are [inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "@0 and plenty, ends face @h@S, interrupt before the star turns with @m" c1
            intlk_is_inherited visible_fractions
   seq nullcall [mandatory_anycall]
   seq little_ends_face_dir [inherit_intlk]
   seq nullsecond [mandatory_secondary_call]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "@0 and plenty@S, interrupt after the star turns with @m" c1
            left_means_mirror intlk_is_inherited visible_fractions
   seq nullcall [mandatory_anycall]
   seq little [inherit_left inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "@0 and plenty, ends go as you are@S, interrupt after the star turns with @m" c1
            intlk_is_inherited visible_fractions
   seq nullcall [mandatory_anycall]
   seq little_ends_as_are [inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "@0 and plenty, ends face @h@S, interrupt after the star turns with @m" c1
            intlk_is_inherited visible_fractions
   seq nullcall [mandatory_anycall]
   seq little_ends_face_dir [inherit_intlk]
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq nullsecond [mandatory_secondary_call]
   seq finishplenty []

call "_start good and plenty" dontshow tag start_good_and
   conc recoil [] circ_n_times [conc_demand_lines conc_force_lines insert_number 2]

call "good and plenty@S" c4x
   seq start_good_and []
   seq turnstar2 [allow_forced_mod insert_number 2]
   seq finishplenty []

call "@2scoot @3and@C ramble" c1
            intlk_is_inherited cross_is_inherited yoyo_is_inherited gen_sting_is_inherited visible_fractions
   seq qtagscootback [or_anycall inherit_intlk inherit_yoyo inherit_gensting]
   seq ramble [inherit_intlk inherit_cross]

call "@0 and@C ramble" c1
            cross_is_inherited visible_fractions
   seq nullcall [mandatory_anycall]
   seq ramble [inherit_cross]

call "@2scoot @3and@C counter" c2
            left_means_mirror cross_is_inherited intlk_is_inherited fractal_is_inherited
            yoyo_is_inherited gen_sting_is_inherited first_part_visible
   seq qtagscootback [or_anycall inherit_left inherit_intlk inherit_yoyo inherit_gensting]
   seq check_rqtag [inherit_left inherit_cross]
   seq counter [inherit_left inherit_cross inherit_fractal inherit_intlk]

call "@0 and@C counter" c2
            cross_is_inherited fractal_is_inherited
   seq nullcall [mandatory_anycall]
   seq counter [inherit_cross inherit_fractal]

call "@2scoot @3and rally" c3a
            first_part_visible left_means_mirror
            intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited cross_is_inherited
   seq qtagscootback [or_anycall inherit_intlk inherit_yoyo inherit_gensting inherit_cross]
   seq natural_rally [inherit_left inherit_intlk]

call "@2scoot @3and rally but @m" c3a
            first_part_visible left_means_mirror
            intlk_is_inherited yoyo_is_inherited gen_sting_is_inherited
   seq rtqtagscootback [or_anycall inherit_left inherit_intlk inherit_yoyo inherit_gensting]
   seq rallybut2nd [inherit_left inherit_intlk]

call "@0 and rally" c3a
            first_part_visible
   seq nullcall [mandatory_anycall]
   seq rally []

call "@0 and rally but @m" c3a
            intlk_is_inherited first_part_visible
   seq nullcall [mandatory_anycall]
   seq rallybut2nd [inherit_intlk]

call "LINES @0 THRU" c2
            twisted_is_inherited visible_fractions dont_use_in_resolve
   conc_or_diamond_line nullcall [mandatory_anycall]
                        box_circulate_maybe_diamond [inherit_twisted conc_force_spots]

call "LINES IT THRU @0" c2
            twisted_is_inherited visible_fractions dont_use_in_resolve
   conc_or_diamond_line nullcall [mandatory_anycall]
                        box_circulate_maybe_diamond [inherit_twisted conc_force_spots]

call "spin a wheel" c4
            visible_fractions mxn_is_inherited
   seq hinge [cpls_unless_single]
   /* Inheriting 1x3 etc. here makes it illegal.  You must say "random 3x1". */
   seq tripletrade [inherit_mxn]
   seq hinge [cpls_unless_single]

call "stack the wheel" c4a
            visible_fractions single_is_inherited nxn_is_inherited mxn_is_inherited
   seq hinge [cpls_unless_single]
   seq roll []

call "_cross trade and wheel part 2" dontshow tag crosstradewheel2
   setup 1x8 1x8           // very center 2 trade
      array [ZM0N ZM1N CR6S ZM3N ZM4N ZM5N AL2S ZM7N]
            alternate_definition [half] c2
   setup 1x8 1x3dmd        // very center 2 hinge
      array [ZM0N ZM1N CR3E ZM2N ZM4N ZM5N AL3W ZM6N]

            alternate_definition [single] c2
   setup 1x4 1x4           // center 2 trade
      array [ZM0N CR3S ZM2N AL1S]
   setup dmd dmd
      array [ZM0N 0 ZM2N 0]
   setup pmd dmd
      array [ZM0N CR3S ZM2N AL1S]
            alternate_definition [half single] c2
   setup 1x4 dmd           // center 2 hinge
      array [ZM0N CR1E ZM2N AL1W]
            alternate_definition [lasthalf single] c2

   setup dmd 1x4           // center 2 hinge
      array [ZM0N 0    ZM2N 0]
   setup pmd 1x4 restriction wave_only   // If not miniwave, how can we finish the trade?
      array [0    CR3E 0    AL3W]

            alternate_definition [grand] c2
   setup 1x8 1x8           // center 6 trade
      array [ZM0N CR3S CR6S AL1S ZM4N AL7S AL2S CR5S]
            alternate_definition [half grand] c2
   setup 1x8 spindle       // center 6 hinge
      array [ZM7N CR0E CR1E AL0W ZM3N AL2W AL1W CR2E]
            alternate_definition [lasthalf grand] c2
   setup spindle 1x8       // center 6 hinge
      array [0 0 0 ZM4N 0 0 0 ZM0N]
   setup pspindle 1x8       // center 6 hinge
      array [CR3E CR6E CR5E 0 AL5W AL6W AL3W 0]

            alternate_definition [grand single] c2
   setup 1x8 1x8           // center 6 trade
      array [ZM0N CR3S CR6S AL1S ZM4N AL7S AL2S CR5S]
   setup 1x6 1x6           // center 4 trade
      array [ZM0N CR2S AL1S ZM3N AL5S CR4S]
            alternate_definition [half grand single] c2
   setup 1x8 spindle qualifier live magic_only       // center 6 hinge
      array [ZM7N CR0E CR1E AL6W ZM3N AL4W AL1W CR2E]
   setup 1x8 spindle qualifier live 4x4_2fl_only
      array [ZM7N CR0E CR1E AL6W ZM3N AL4W AL1W CR2E]
   setup 1x8 spindle
      array [ZM7N CR0E CR1E AL0W ZM3N AL2W AL1W CR2E]
   setup 1x6 short6 rotate // center 4 hinge
      array [ZM4W CR5N AL5S ZM1W AL0S CR0N]
            alternate_definition [lasthalf grand single] c2
   setup spindle 1x8       // center 6 hinge
      array [0 0 0 ZM4N 0 0 0 ZM0N]
   setup pspindle 1x8      // center 6 hinge
      array [CR3E CR6E CR5E ZM4N AL5W AL6W AL3W ZM0N]
   setup short6 1x6 rotate // center 4 hinge
      array [CR1N ZM0W AL1S AL5S ZM3W CR5N]
   setup pshort6 1x6 rotate// center 4 hinge
      array [0 ZM0W 0 0 ZM3W 0]

call "_cross and wheel part 3" dontshow tag crossnwheel3
   setup 1x4 2x2 qualifier miniwaves
      array [CR0S ZM0N AL1S ZM1N]
   setup 1x4 2x2 qualifier 1fl_only
      array [CR0S ZM3N AL1S ZM2N]
   setup dmd 2x2 restriction forbidden diamond_like   // Might as well put these in.
      array [CR0S 0 AL1S 0]
   setup pmd 2x2 restriction forbidden diamond_like
      array [0 ZM1N 0 ZM2N]
            alternate_definition [single] c2
   setup 1x4 2x2 qualifier miniwaves
      array [CR0S ZM0N AL1S ZM1N]
   setup 1x4 2x2 qualifier 1fl_only restriction controversial alwaysfail
      array [CR0S ZM3N AL1S ZM2N]
   setup dmd 2x2 restriction forbidden diamond_like
      array [CR0S 0 AL1S 0]
   setup pmd 2x2 restriction forbidden diamond_like
      array [0 ZM1N 0 ZM2N]
            alternate_definition [grand] c2
   setup 1x4 2x2 qualifier miniwaves           // same as above
      array [CR0S ZM0N AL1S ZM1N]
            alternate_definition [grand single] c2
   setup 1x8 2x4           // 6 step; 2 fold
      array [CR0S ZM0N ZM1N ZM1N AL3S ZM3N ZM2N ZM2N]
   setup 1x6 2x3           // 4 step; 2 fold
      array [CR0S ZM0N ZM1N AL2S ZM2N ZM1N]

call "cross and wheel" c2 tag crossnwheel
            visible_fractions grand_is_inherited fractal_is_inherited gen_sting_is_inherited
            single_is_inherited nxn_is_inherited mxn_is_inherited
   seq hinge [inherit_fractal inherit_gensting cpls_unless_single]
   seq crossnwheel3 [cpls_unless_single inherit_grand inherit_single]

call "cross trade and wheel" c2
            visible_fractions grand_is_inherited fractal_is_inherited gen_sting_is_inherited
            single_is_inherited nxn_is_inherited mxn_is_inherited
   seq hinge [inherit_fractal inherit_gensting cpls_unless_single]
   // Inheriting 1x3 etc. here makes it illegal.  You must say "random 3x1".
   seq crosstradewheel2 [inherit_grand inherit_single inherit_nxn inherit_mxn roll_transparent]
   seq crossnwheel3 [cpls_unless_single inherit_grand inherit_single]

call "hinge and trade" c4a tag hingentrade
            visible_fractions single_is_inherited grand_is_inherited
            yoyo_is_inherited gen_sting_is_inherited dont_raise_overcast
            diamond_is_legal
   seq hinge_with_warn [cpls_unless_single inherit_yoyo inherit_gensting inherit_diamond]
   seq maybegrandslip [cpls_unless_single inherit_grand roll_transparent inherit_diamond]
   seq roll [cpls_unless_single]

call "_hinge & circ part 2" dontshow tag hc2
   setup 1x4 dmd rotate
      array [CR0N CR1E AL0S AL3E]

call "hinge and circulate @h" c4x
            single_is_inherited
   seq hinge [cpls_unless_single]
   seq hc2 [cpls_unless_single]
   seq quarter_maybe [cpls_unless_single]

call "_stim part 2" dontshow tag stim2
            fractal_is_inherited gen_sting_is_inherited
   conc6_2 armturn_n4 [inherit_fractal inherit_gensting insert_number 1] ctr_rot []

call "@1stimulate the column" c3
            first_and_last_parts_visible magic_is_inherited
            bigmatrix_is_inherited nxn_is_inherited mxn_is_inherited fractal_is_inherited gen_sting_is_inherited
   // Of course, it had better be *INITIALLY* 3x3 split counter stimulate, or whatever.
   seq colcirc [inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn or_anycall]
   seq circulate [force_half inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn]
   seq stim2 [inherit_bigmatrix inherit_nxn inherit_mxn inherit_gensting]
   // Of course, if you want it here, it had better be *FINALLY* generous stimulate, or whatever.
   seq finishwithplainmod [inherit_bigmatrix inherit_nxn inherit_mxn inherit_fractal inherit_gensting]

call "@1stimulate" c3
            first_and_last_parts_visible magic_is_inherited
            bigmatrix_is_inherited nxn_is_inherited mxn_is_inherited fractal_is_inherited gen_sting_is_inherited
   // Of course, it had better be *INITIALLY* 3x3 split counter stimulate, or whatever.
   seq colcirc [inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn or_anycall]
   seq circulate [force_half inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn]
   seq stim2 [inherit_bigmatrix inherit_nxn inherit_mxn inherit_gensting]
   seq finishwithplainmod [inherit_bigmatrix inherit_nxn inherit_mxn inherit_fractal inherit_gensting]

call "@T stimulate" c3
            first_and_last_parts_visible magic_is_inherited
            bigmatrix_is_inherited nxn_is_inherited mxn_is_inherited fractal_is_inherited gen_sting_is_inherited
   // Of course, it had better be *INITIALLY* 3x3 split counter stimulate, or whatever.
   seq circulate [mandatory_anycall inherit_bigmatrix inherit_nxn inherit_mxn]
   seq circulate [force_half inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn]
   seq stim2 [inherit_bigmatrix inherit_nxn inherit_mxn inherit_gensting]
   seq finishwithplainmod [inherit_bigmatrix inherit_nxn inherit_mxn inherit_fractal inherit_gensting]

call "@N stimulate" c3
            first_and_last_parts_visible magic_is_inherited
            bigmatrix_is_inherited nxn_is_inherited mxn_is_inherited fractal_is_inherited gen_sting_is_inherited
   // Of course, it had better be *INITIALLY* 3x3 split counter stimulate, or whatever.
   seq circnullcall [inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn or_anycall]
   seq circulate [force_half inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn]
   seq stim2 [inherit_bigmatrix inherit_nxn inherit_mxn inherit_gensting]
   seq finishwithplainmod [inherit_bigmatrix inherit_nxn inherit_mxn inherit_fractal inherit_gensting]

call "@1stimulate but @m" c3
            first_and_last_parts_visible magic_is_inherited
   seq colcirc [inherit_magic or_anycall]
   seq circulate [force_half inherit_magic]
   seq stim2 []
   seq finishwithmodbut2nd []

call "@T stimulate but @m" c3
            first_and_last_parts_visible
   seq circulate [mandatory_anycall]
   seq circulate [force_half]
   seq stim2 []
   seq finishwithmodbut2nd []

call "@N stimulate but @m" c3
            first_and_last_parts_visible
   seq circnullcall [or_anycall]
   seq circulate [force_half]
   seq stim2 []
   seq finishwithmodbut2nd []

// **** The last one in the original column (#1 or #5 now) is still wrong.  They had
// roll direction from the triple trade, so that "roll_transparent" will leave them able
// to roll at the end of the call.  But they moved up, which should erase the roll info.
call "_coordinate part 3" dontshow tag coord3
            take_right_hands
   setup spindle 2x4 rotate
      array [0 0 0 AL0S 0 0 0 CR7N]
   setup pspindle 2x4 rotate
      array [ZM6W ZM0W ZM1W 0 ZM2W ZM3W ZM5W 0]
   setup 1x8 qtag
      array [CR0E ZM6N ZM0N ZM7N AL1W ZM2N ZM1N ZM3N]
   setup ptpd 2x4 rotate
      array [CR7N    0 ZM7W    0 AL0S    0 ZM0W    0]
   setup pptpd 2x4 rotate
      array [   0 ZM6W    0 ZM5W    0 ZM2W    0 ZM1W]
   setup 1x3dmd qtag
      array [CR0E ZM6N ZM7N 0 AL1W ZM2N ZM3N 0]
   setup p1x3dmd qtag
      array [0 0 0 ZM1N 0 0 0 ZM4N]
   setup wingedstar qtag
      array [CR0E ZM6N ZM7N 0 AL1W ZM2N ZM3N 0]
   setup pwingedstar qtag
      array [0 0 0 ZM1N 0 0 0 ZM4N]
            alternate_definition [rewind] c4
   setup 2x4 spindle rotate restriction forbidden 2fl_only
      array [CR7N ZM6W ZM0W AL7S ZM1W ZM2W ZM4W ZM5W]

call "_coordinate to a diamond part 3" dontshow tag coord3d
            take_right_hands
   setup spindle qtag
      array [0 0 0 AL1W 0 0 0 CR0E]
   setup pspindle qtag qualifier spd_base_mwv
      array [CR7E ZM1N CR2E 0 AL2W ZM4N AL7W 0]
   setup pspindle qtag
      array [CR7E ZM1N CR2E 0 AL3W ZM4N AL6W 0]
   setup 1x8 2x4 rotate
      array [CR7N CR6N ZM7W AL6S AL0S AL1S ZM0W CR1N]
   setup 1x3dmd 2x4 rotate qualifier spd_base_mwv
      array [CR7N CR6N AL6S 0 AL0S AL1S CR1N 0]
   setup 1x3dmd 2x4 rotate
      array [CR7N CR6N AL5S 0 AL0S AL2S CR1N 0]
   setup p1x3dmd 2x4 rotate
      array [0 0 0 ZM0W 0 0 0 ZM3W]
   setup wingedstar 2x4 rotate qualifier spd_base_mwv
      array [CR7N CR6N AL6S 0 AL0S AL1S CR1N 0]
   setup wingedstar 2x4 rotate
      array [CR7N CR6N AL5S 0 AL0S AL2S CR1N 0]
   setup pwingedstar 2x4 rotate
      array [0 0 0 ZM0W 0 0 0 ZM3W]
            alternate_definition [rewind] c4
   setup qtag spindle restriction forbidden wave_only
      array [0 0 AL2W CR2E 0 0 CR0E AL0W]
   setup pqtag spindle
      array [ZM1N CR3E 0 0 AL3W ZM5N 0 0]

call "@1coordinate" plus
            magic_is_inherited yoyo_is_inherited gen_sting_is_inherited rewind_is_inherited
            twisted_is_inherited visible_fractions
   seq circ_for_coord [or_anycall inherit_magic inherit_twisted]
   seq circ_for_coord [force_half inherit_magic inherit_twisted inherit_rewind]
   seq tripletrade_for_coord [inherit_yoyo inherit_gensting]
   seq coord3 [inherit_rewind roll_transparent]

call "@T coordinate" c2
            magic_is_inherited yoyo_is_inherited gen_sting_is_inherited twisted_is_inherited visible_fractions
   seq circulate [mandatory_anycall inherit_twisted]
   seq circ_for_coord [force_half inherit_twisted inherit_magic]
   seq tripletrade_for_coord [inherit_yoyo inherit_gensting]
   seq coord3 [roll_transparent]

call "@N coordinate" c2
            yoyo_is_inherited gen_sting_is_inherited twisted_is_inherited visible_fractions
   seq circnullcall [or_anycall inherit_twisted]
   seq circ_for_coord [force_half inherit_twisted]
   seq tripletrade_for_coord [inherit_yoyo inherit_gensting]
   seq coord3 [roll_transparent]

call "@1coordinate to a diamond" c4a
            magic_is_inherited yoyo_is_inherited gen_sting_is_inherited rewind_is_inherited
            twisted_is_inherited first_two_parts_visible
   seq circ_for_coord [or_anycall inherit_twisted inherit_magic]
   seq circ_for_coord [force_half inherit_twisted inherit_magic inherit_rewind]
   seq tripletrade_for_coord [inherit_yoyo inherit_gensting]
   seq coord3d [inherit_rewind roll_transparent]

call "@T coordinate to a diamond" c4a
            magic_is_inherited yoyo_is_inherited gen_sting_is_inherited twisted_is_inherited first_two_parts_visible
   seq circulate [mandatory_anycall inherit_twisted]
   seq circ_for_coord [force_half inherit_twisted inherit_magic]
   seq tripletrade_for_coord [inherit_yoyo inherit_gensting]
   seq coord3d [roll_transparent]

call "@N coordinate to a diamond" c4a
            yoyo_is_inherited gen_sting_is_inherited twisted_is_inherited first_two_parts_visible
   seq circnullcall [or_anycall inherit_twisted]
   seq circ_for_coord [force_half inherit_twisted]
   seq tripletrade_for_coord [inherit_yoyo inherit_gensting]
   seq coord3d [roll_transparent]

call "_cooperate 2" dontshow tag coop2
            magic_is_inherited rewind_is_inherited
   conc6_2 invert_2_3 [allow_forced_mod inherit_magic inherit_rewind] nullcall []

call "_cooperate 3" dontshow tag coop3
            rewind_is_inherited
   conc dropin [allow_forced_mod inherit_rewind] nullcall []

call "@1cooperate" c4a
            magic_is_inherited rewind_is_inherited visible_fractions
            bigmatrix_is_inherited
            nxn_is_inherited mxn_is_inherited
   // Of course, it had better be *INITIALLY* 3x3 split counter cooperate, or whatever.
   seq colcirc [inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn or_anycall]
   seq colcirc [force_half inherit_magic inherit_rewind
                inherit_bigmatrix inherit_nxn inherit_mxn]
   seq coop2 [inherit_magic inherit_rewind inherit_bigmatrix inherit_nxn inherit_mxn]
   seq coop3 [inherit_rewind inherit_bigmatrix inherit_nxn inherit_mxn]

call "@T cooperate" c4
            magic_is_inherited visible_fractions
            bigmatrix_is_inherited
            nxn_is_inherited mxn_is_inherited
   // Of course, it had better be *INITIALLY* 3x3 split counter cooperate, or whatever.
   seq circulate [inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn mandatory_anycall]
   seq colcirc [force_half inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn]
   seq coop2 [inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn]
   seq coop3 [inherit_bigmatrix inherit_nxn inherit_mxn]

call "@N cooperate" c4
            magic_is_inherited visible_fractions
            bigmatrix_is_inherited
            nxn_is_inherited mxn_is_inherited
   // Of course, it had better be *INITIALLY* 3x3 split counter cooperate, or whatever.
   seq circnullcall [inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn or_anycall]
   seq colcirc [force_half inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn]
   seq coop2 [inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn]
   seq coop3 [inherit_bigmatrix inherit_nxn inherit_mxn]

call "@1cooperate but @m" c4
            magic_is_inherited visible_fractions
            bigmatrix_is_inherited
            nxn_is_inherited mxn_is_inherited
   // Of course, it had better be *INITIALLY* 3x3 split counter cooperate, or whatever.
   seq colcirc [inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn or_anycall]
   seq colcirc [force_half inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn]
   seq coop2 [inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn]
   seq ctrs_mandatory_2ndcall [inherit_bigmatrix inherit_nxn inherit_mxn]

call "@T cooperate but @m" c4
            magic_is_inherited visible_fractions
            bigmatrix_is_inherited
            nxn_is_inherited mxn_is_inherited
   // Of course, it had better be *INITIALLY* 3x3 split counter cooperate, or whatever.
   seq circulate [inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn mandatory_anycall]
   seq colcirc [force_half inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn]
   seq coop2 [inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn]
   seq ctrs_mandatory_2ndcall [inherit_bigmatrix inherit_nxn inherit_mxn]

call "@N cooperate but @m" c4
            magic_is_inherited visible_fractions
            bigmatrix_is_inherited
            nxn_is_inherited mxn_is_inherited
   // Of course, it had better be *INITIALLY* 3x3 split counter cooperate, or whatever.
   seq circnullcall [inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn or_anycall]
   seq colcirc [force_half inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn]
   seq coop2 [inherit_magic inherit_bigmatrix inherit_nxn inherit_mxn]
   seq ctrs_mandatory_2ndcall [inherit_bigmatrix inherit_nxn inherit_mxn]

call "_set your pace 2" dontshow tag pace2
   conc6_2 followthru [force_grand] nullcall []

call "_set your pace 3" dontshow tag pace3
   conc cyclewheel [] cyclewheel []

call "@2set @3your pace" c4
            first_two_parts_visible
   seq colcirc [or_anycall]
   seq colcirc [force_half]
   seq pace2 []
   seq pace3 []

call "@T set your pace" c4
            first_two_parts_visible
   seq circulate [mandatory_anycall]
   seq colcirc [force_half]
   seq pace2 []
   seq pace3 []

call "@N set your pace" c4    /* We leave the word "set" in for stuff like
                                    "split counter set your pace". */
            first_two_parts_visible
   seq circnullcall [or_anycall]
   seq colcirc [force_half]
   seq pace2 []
   seq pace3 []

call "_percolate part 3" dontshow tag percolate3
            left_means_mirror fractal_is_inherited yoyo_is_inherited gen_sting_is_inherited
   // Inheriting generous/stingy here makes it illegal unless you say "boys (or whatever) work generous, percolate."
   conc nicely [inherit_left inherit_fractal inherit_gensting]
        natturnthru [allow_forced_mod inherit_fractal inherit_yoyo inherit_gensting endscando
                    conc_force_spots suppress_elongation_warnings]

call "_percolate part 3 but @m" dontshow tag percolate3butany
            left_means_mirror yoyo_is_inherited gen_sting_is_inherited
   conc nullsecond [mandatory_secondary_call]
        natturnthru [allow_forced_mod inherit_yoyo inherit_gensting endscando
                    conc_force_spots suppress_elongation_warnings]

// The real definition -- there is no guarantee
// that centers stay centers and ends stay ends.
// Of course, we put the version that allows replacement first.
call "@1percolate" c1
            left_means_mirror fractal_is_inherited yoyo_is_inherited gen_sting_is_inherited
            twisted_is_inherited visible_fractions funny_is_inherited
   seq circulate [or_anycall inherit_left inherit_funny inherit_twisted]
   seq circulate [inherit_funny force_half inherit_left]
   seq percolate3 [inherit_left inherit_funny inherit_fractal inherit_yoyo inherit_gensting]
   // People sometimes do "central percolate"-types of things, so we have to
   // recognize that the circulate and 1/2 circulate are sometimes concentric,
   // at the cost of not being able to do other things that might also be interesting.
            left_means_mirror fractal_is_inherited yoyo_is_inherited gen_sting_is_inherited first_two_parts_visible
   seq conccirculate [inherit_left]
   seq conccirculate [force_half inherit_left]
   seq percolate3 [inherit_left inherit_fractal inherit_yoyo inherit_gensting]

call "@T percolate" c2
            left_means_mirror fractal_is_inherited yoyo_is_inherited gen_sting_is_inherited
            twisted_is_inherited first_two_parts_visible funny_is_inherited
   seq circulate [mandatory_anycall inherit_left inherit_funny inherit_twisted]
   seq circulate [inherit_funny force_half inherit_left]
   seq percolate3 [inherit_left inherit_funny inherit_fractal inherit_yoyo inherit_gensting]

call "@N percolate" c2
            left_means_mirror fractal_is_inherited yoyo_is_inherited gen_sting_is_inherited
            first_two_parts_visible funny_is_inherited
   seq circnullcall [or_anycall inherit_left inherit_funny]
   seq circulate [inherit_funny force_half inherit_left]
   seq percolate3 [inherit_left inherit_funny inherit_fractal inherit_yoyo inherit_gensting]

call "@1percolate but @m" c1
            left_means_mirror fractal_is_inherited yoyo_is_inherited gen_sting_is_inherited
            twisted_is_inherited first_two_parts_visible funny_is_inherited
   seq circulate [or_anycall inherit_left inherit_funny inherit_twisted]
   seq circulate [inherit_funny force_half inherit_left]
   seq percolate3butany [inherit_left inherit_funny inherit_fractal inherit_yoyo inherit_gensting]
            left_means_mirror fractal_is_inherited yoyo_is_inherited gen_sting_is_inherited first_two_parts_visible
   seq conccirculate [inherit_left]
   seq conccirculate [force_half inherit_left]
   seq percolate3butany [inherit_left inherit_fractal inherit_yoyo inherit_gensting]

call "@T percolate but @m" c2
            left_means_mirror yoyo_is_inherited gen_sting_is_inherited
            first_two_parts_visible funny_is_inherited
   seq circulate [inherit_funny mandatory_anycall]
   seq circulate [inherit_funny force_half]
   seq percolate3butany [inherit_yoyo inherit_gensting]

call "@N percolate but @m" c2
            left_means_mirror fractal_is_inherited yoyo_is_inherited gen_sting_is_inherited
            twisted_is_inherited first_two_parts_visible funny_is_inherited
   seq circnullcall [or_anycall inherit_left inherit_funny]
   seq circulate [inherit_funny force_half inherit_left]
   seq percolate3butany [inherit_yoyo inherit_gensting]

/* *** This isn't right -- the "nicely" people aren't checking that they aren't selected.
   We just can't be bothered to do everything that would be needed to fix this.
   There are more important things to do than protect against people making transparent
   blunders. */
call "_percolate part 3, @6 to a wave" dontshow tag percolate3_sometowave
            yoyo_is_inherited gen_sting_is_inherited
   conc nicely [] somedontturnthru [allow_forced_mod inherit_yoyo inherit_gensting endscando conc_force_spots suppress_elongation_warnings]

call "@1percolate, @6 to a wave" c1
            yoyo_is_inherited gen_sting_is_inherited twisted_is_inherited first_two_parts_visible funny_is_inherited
   seq circulate [or_anycall inherit_funny inherit_twisted]
   seq circulate [force_half]
   seq percolate3_sometowave [inherit_yoyo inherit_gensting]

call "@T percolate, @6 to a wave" c2
            yoyo_is_inherited gen_sting_is_inherited first_two_parts_visible
   seq circulate [mandatory_anycall]
   seq circulate [force_half]
   seq percolate3_sometowave [inherit_yoyo inherit_gensting]

call "@N percolate, @6 to a wave" c2
            yoyo_is_inherited gen_sting_is_inherited first_two_parts_visible funny_is_inherited
   seq circnullcall [inherit_funny or_anycall]
   seq circulate [force_half]
   seq percolate3_sometowave [inherit_yoyo inherit_gensting]

call "turn up" dontshow tag hinge_circ_trade
            visible_fractions yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq hinge_with_warn [allow_forced_mod inherit_fractal inherit_gensting]
   seq circulate []
   seq trade [allow_forced_mod inherit_yoyo inherit_gensting]

call "turn up but @m" dontshow tag hinge_circ_any
            visible_fractions fractal_is_inherited
   seq hinge [allow_forced_mod inherit_fractal]
   seq circulate []
   seq nullsecond [mandatory_secondary_call]

call "_finish perk up" dontshow tag finperk
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc hinge_circ_trade [inherit_yoyo inherit_gensting inherit_fractal] circ_n_times [insert_number 2]

call "_finish perk up but @m" dontshow tag finperkbut
            fractal_is_inherited
   conc hinge_circ_any [inherit_fractal] circ_n_times [insert_number 2]

// The real definition -- there is no guarantee
// that centers stay centers and ends stay ends.
// Of course, we put the version that allows replacement first.
call "@1perk up" c2
            first_part_visible yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq circulate [or_anycall]
   seq halfboxcirc_miniwaves []
   seq finperk [inherit_yoyo inherit_gensting inherit_fractal]
   // People sometimes do "central perk up"-types of things, so we have to
   // recognize that the circulate and 1/2 circulate are sometimes concentric,
   // at the cost of not being able to do other things that might also be interesting.
            first_part_visible yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq conccirculate []
   seq conchalfcirculate_ctrsin_endsout []
   seq finperk [inherit_yoyo inherit_gensting inherit_fractal]

call "@T perk up" c2
            first_part_visible yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq circulate [mandatory_anycall]
   seq halfboxcirc_miniwaves []
   seq finperk [inherit_yoyo inherit_gensting inherit_fractal]

call "@N perk up" c2
            first_part_visible yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq circnullcall [or_anycall]
   seq halfboxcirc_miniwaves []
   seq finperk [inherit_yoyo inherit_gensting inherit_fractal]

call "@1perk up but @m" c3
            first_part_visible fractal_is_inherited
   seq circulate [or_anycall]
   seq halfboxcirc_miniwaves []
   seq finperkbut [inherit_fractal]

call "@T perk up but @m" c3
            first_part_visible fractal_is_inherited
   seq circulate [mandatory_anycall]
   seq halfboxcirc_miniwaves []
   seq finperkbut [inherit_fractal]

call "@N perk up but @m" c3
            first_part_visible fractal_is_inherited
   seq circnullcall [or_anycall]
   seq halfboxcirc_miniwaves []
   seq finperkbut [inherit_fractal]

call "_bogus leads circulate" dontshow tag bogus_leads_circulate
   setup 2x2 2x2 restriction controversial alwaysfail
      array [CR1S AL0S 0 0]

call "_leads trade for trade by" dontshow tag leads_trade_for_trade_by
            left_means_mirror
   setup 2x2 2x2
      array [CR1S AL0S 0 0]
   setup 2x4 2x4 restriction unusual alwaysfail
      preds "Can't do this call in this formation."
         if lines_couple [CR1S AL0S CR3S AL2S 0 0 0 0]
   setup 4x2 2x4 restriction unusual alwaysfail
      array [0 0 0 CR4S AL3S 0 0 0]
            alternate_definition [single] c1
   setup 2x1 1x2
      array [0 1S]
            alternate_definition [half] mainstream
   setup 2x2 1x4 rotate
      array [CR0N AL1S 0 0]
            alternate_definition [lasthalf] mainstream
   setup 1x4 2x2 other_elongate restriction forbidden wave_only
      array [CR0E CR0E AL1W AL1W]

/* This is controversial, since the only setup from which the centers
   would stay centers and do what we are doing here as their part of a
   correctly executed complete Perk Up would have to start in a rather
   peculiar starting setup.  Since there are no ends actually doing anything,
   the live dancers can't see that this peculiar starting setup exists. */
call "central perk up" c4
            yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq bogus_leads_circulate []
   seq touch []
   seq hinge_circ_trade [inherit_yoyo inherit_gensting inherit_fractal]

call "_finish cover up" dontshow tag fincover
            diamond_is_legal
   conc recycle [allow_plain_mod inherit_diamond] about [suppress_elongation_warnings]

call "_finish cover up but @m" dontshow tag fincoverbut2nd
   conc nullsecond [mandatory_secondary_call] about [suppress_elongation_warnings]


// The real definition -- there is no guarantee
// that centers stay centers and ends stay ends.
// Of course, we put the version that allows replacement first.
call "@1cover up" c4a
            diamond_is_legal twisted_is_inherited visible_fractions
   // You have to say "finally diamond cover up", of course.
   seq circulate [or_anycall inherit_twisted inherit_diamond]
   seq circulate [force_half inherit_diamond]
   seq fincover [inherit_diamond]
   // People sometimes do "central cover up"-types of things, so we have to
   // recognize that the circulate and 1/2 circulate are sometimes concentric,
   // at the cost of not being able to do other things that might also be interesting.
            diamond_is_legal visible_fractions
   seq conccirculate [inherit_diamond]
   seq conccirculate [force_half inherit_diamond]
   seq fincover [inherit_diamond]

call "@T cover up" c4a
            diamond_is_legal visible_fractions
   seq circulate [mandatory_anycall]
   seq circulate [force_half inherit_diamond]
   seq fincover [inherit_diamond]

call "@N cover up" c4a
            diamond_is_legal visible_fractions
   seq circnullcall [or_anycall inherit_diamond]
   seq circulate [force_half inherit_diamond]
   seq fincover [inherit_diamond]

call "@1cover up but @m" c4a
            twisted_is_inherited visible_fractions
   seq circulate [or_anycall inherit_twisted]
   seq circulate [force_half]
   seq fincoverbut2nd []

call "@T cover up but @m" c4a
            visible_fractions
   seq circulate [mandatory_anycall]
   seq circulate [force_half]
   seq fincoverbut2nd []

call "@N cover up but @m" c4a
            visible_fractions
   seq circnullcall [or_anycall]
   seq circulate [force_half]
   seq fincoverbut2nd []

call "_start choice" dontshow tag startchoice
   conc lockit [] trade [allow_forced_mod conc_force_spots]

call "_finish choice" dontshow tag finchoice
   conc hinge_with_warn [allow_forced_mod]
        stepnfold [allow_forced_mod suppress_elongation_warnings conc_force_spots]

call "_rewind finish choice" dontshow tag rewfinchoice
   conc hinge [] zoom [force_half]

// We define it this way so one can do a "snag choice".  One can also fractionalize.
call "choice" c3a
            visible_fractions dont_use_in_resolve
   conc lock_the_hinge [allow_forced_mod]
        tradestpnfld [allow_forced_mod suppress_elongation_warnings endscando]

// We define it this way so one can fractionalize.  One couldn't use "snag" here anyway.
call "@2lock@3er's choice" c3a
            visible_fractions cross_is_inherited
   seq lockit [inherit_cross or_anycall normalize]
   seq startchoice []
   seq finchoice []

call "@0 er's choice" c3a
   seq nullcall [mandatory_anycall normalize]
   seq startchoice []
   seq finchoice []

call "REWIND locker's choice" c4
            visible_fractions cross_is_inherited
   seq rewfinchoice []
   seq startchoice []  // close enough
   seq lockit [inherit_cross]

call "cy-kick" c4a
            cross_is_inherited
   conc 23recycle [inherit_cross] beaukick [endscando]

call "_ends reciprocate" dontshow tag endrecip
            visible_fractions left_means_mirror fractal_is_inherited
   seq div_move_along []
   seq touch_3_4 [inherit_left inherit_fractal]

call "reciprocate" c4
            visible_fractions left_means_mirror yoyo_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc ctrwindmill [inherit_left inherit_yoyo inherit_fractal inherit_gensting]
        endrecip [inherit_left inherit_fractal conc_demand_columns conc_force_columns endscando]

call "_ctrs scamper" dontshow tag ctrs_scamper
            visible_fractions step_to_wave left_means_mirror fractal_is_inherited gen_sting_is_inherited
   seq armturn_n4 [inherit_fractal inherit_gensting insert_number 1]
   seq circulate []

call "_ctrs scamper but @0" dontshow tag ctrs_scamper_but
            visible_fractions step_to_wave left_means_mirror fractal_is_inherited gen_sting_is_inherited
   seq armturn_n4 [inherit_fractal inherit_gensting insert_number 1]
   seq nullcall [mandatory_anycall]

call "_ends scamper" dontshow tag ends_scamper
            visible_fractions left_means_mirror fractal_is_inherited gen_sting_is_inherited
   seq div_move_along []
   seq touch_1_4 [inherit_left inherit_fractal inherit_gensting]

call "divide" mainstream
            dont_use_in_resolve
      /* ***** make sure we do a "fudge to 3/4 tag" */
      /* Note that this is illegal unless just the ends (under some designation)
         are told to do it. */
   conc boguscall [] div_move_along [conc_demand_columns conc_force_lines endscando suppress_elongation_warnings]

call "divide and @0" mainstream
            dont_use_in_resolve
      /* ***** make sure we do a "fudge to 3/4 tag" */
      /* Note that this is illegal unless just the ends (under some designation)
         are told to do it. */
   conc boguscall [] ends_div_do_something [conc_demand_columns conc_force_otherway endscando suppress_elongation_warnings]

call "_ends divide and @0" dontshow tag ends_div_do_something
   seq div_move_along [seq_re_enable_elongation_check]
   seq nullcall [mandatory_anycall]

call "ends divide" mainstream
            dont_use_in_resolve
      /* ***** make sure we do a "fudge to 3/4 tag" */
      /* By making this "nullsecond" we make it illegal to do this with "central". */
   conc nullsecond [] div_move_along [conc_demand_columns conc_force_lines]

call "ends divide and @0" mainstream
            dont_use_in_resolve
      /* ***** make sure we do a "fudge to 3/4 tag" */
      /* Note that this is illegal unless just the ends (under some designation) are told to do it. */
   conc nullsecond [] ends_div_do_something [conc_demand_columns conc_force_otherway]

call "scamper" c4a tag scamper
            fudge_to_q_tag left_means_mirror fractal_is_inherited gen_sting_is_inherited
   conc ctrs_scamper [inherit_left inherit_fractal inherit_gensting]
        ends_scamper [inherit_left inherit_fractal inherit_gensting conc_demand_columns conc_force_columns endscando]

call "scamper but @0" c4
            fudge_to_q_tag left_means_mirror fractal_is_inherited gen_sting_is_inherited
   conc ctrs_scamper_but [inherit_left inherit_fractal inherit_gensting]
        ends_scamper [inherit_left inherit_fractal inherit_gensting conc_demand_columns conc_force_columns]

call "divvy up" c4a
   // ***** Make sure we do a "fudge to 3/4 tag".
   conc single_wheel [] div_move_along [conc_demand_columns conc_force_lines]

call "_centers lead the way" dontshow tag clead_way
            visible_fractions mxn_is_inherited nxn_is_inherited bigmatrix_is_inherited
   seq peeloff [inherit_mxn inherit_nxn inherit_bigmatrix]
   seq bendtheline [inherit_mxn inherit_nxn inherit_bigmatrix]

call "lead the way" c4a
            visible_fractions yoyo_is_inherited gen_sting_is_inherited
            mxn_is_inherited nxn_is_inherited bigmatrix_is_inherited
   conc clead_way [inherit_mxn inherit_nxn inherit_bigmatrix]
        trade_and_roll [inherit_yoyo inherit_gensting inherit_mxn inherit_nxn
                        inherit_bigmatrix conc_demand_columns endscando]

call "3X2 reshape" c2 tag 3x2reshape
            fudge_to_q_tag
            yoyo_is_inherited gen_sting_is_inherited funny_is_inherited
   conc2_6 trade [inherit_yoyo inherit_gensting] trngle_reshape [inherit_funny]

call "3X2 convert" c4 tag 3x2convert
            fudge_to_q_tag
            yoyo_is_inherited gen_sting_is_inherited funny_is_inherited
   conc2_6 trade [inherit_yoyo inherit_gensting] trngle_convert [or_anycall inherit_funny]

// Need these, because "3x2" is now treated as an ersatz concept, and it could
// get picked up with plain "reshape the triangle", and it wouldn't know what
// to tell the centers to do.
call "3X2 reshape the triangle" c2
   alias 3x2reshape

call "3X2 convert the triangle" c4
   alias 3x2convert

call "kick the habit" c4a
   conc6p_or_normal leadkick [] ctr_rot [conc_force_otherway allow_forced_mod]

call "_shuttle @h part 2" dontshow tag shuttle2d
   singleconc_together slidethru [] quarter_maybe []

call "_shuttle @0 part 2" dontshow tag shuttle2c
   singleconc_together slidethru [] nullcall [mandatory_anycall]

call "shuttle @h" c4
            visible_fractions twisted_is_inherited
   seq passthru [inherit_twisted]
   seq shuttle2d []

call "shuttle @0" c4
            visible_fractions twisted_is_inherited
   seq passthru [inherit_twisted]
   seq shuttle2c []

call "_tag and spin @h part 2" dontshow tag tagnspin2d
            fractal_is_inherited gen_sting_is_inherited
   singleconc_together armturn_n4 [insert_number 3 inherit_gensting inherit_fractal] quarter_maybe []

call "_tag and spin @0 part 2" dontshow tag tagnspin2c
            fractal_is_inherited gen_sting_is_inherited
   singleconc_together armturn_n4 [insert_number 3 inherit_gensting inherit_fractal] nullcall [mandatory_anycall]

call "@v and spin @h" c4
            visible_fractions left_means_mirror singlefile_is_inherited revert_is_inherited fractal_is_inherited
   // We pass "left" only to the tag, so we can say "left vertical tag
   // and spin right".  The direction part is invariant.
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq extend []
   seq tagnspin2d []

call "@v and spin @0" c4
            visible_fractions left_means_mirror singlefile_is_inherited revert_is_inherited fractal_is_inherited
   // We pass "left" only to the tag, so we can say "left vertical tag
   // and spin right".  The direction part is invariant.
   seq real_base_0 [inherit_left inherit_singlefile inherit_revert inherit_fractal]
   seq extend []
   seq tagnspin2c []

call "extend and spin @h" c4
            visible_fractions
   seq extend []
   seq tagnspin2d []

call "extend and spin @0" c4
            visible_fractions
   seq extend []
   seq tagnspin2c []

call "_centers turnstyle" dontshow tag central_turnstyle
            left_means_mirror parallel_conc_end
   setup 2x1 1x2 qualifier in in_or_out
      array [CR0W 0]
   setup 1x2 1x2 rotate qualifier miniwaves
      array [CR1S AL1N]
   setup 1x4 2x2 qualifier not_miniwaves
      predscantdo
         if cast_normal  [CR3W AL3E AL2E CR2W]
         if cast_pushy   [AL0E AL3E CR1W CR2W]
         if always       [0    AL3E 0    CR2W]
            alternate_definition [fractal] c4
   setup 2x1 1x2 qualifier in in_or_out
      array [CR1E 0]
   setup 1x2 1x2 rotate qualifier miniwaves
      array [CR0N AL0S]
            alternate_definition [generous] c3
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [CR0W 0]
   setup 1x2 1x2        qualifier miniwaves
      array [CR0N AL1N]
            alternate_definition [stingy] c3
   setup 2x1 1x2 rotate qualifier in in_or_out
      array [CR1E 0]
   setup 1x2 1x2        qualifier miniwaves
      array [CR1S AL0S]

call "turnstyle" c3
            left_means_mirror fractal_is_inherited gen_sting_is_inherited
   conc6p_or_singletogether central_turnstyle [inherit_left inherit_fractal inherit_gensting]
                            quarter_right [inherit_left conc_force_spots]

call "6X2 turnstyle" c3
            left_means_mirror fractal_is_inherited gen_sting_is_inherited
   conc2_6 touch_3_4 [inherit_left inherit_fractal inherit_gensting]
                     quarter_right [inherit_left conc_force_spots]

call "relocate the diamonds" c2
            funny_is_inherited fractal_is_inherited gen_sting_is_inherited
   // No, we don't check whether they are in fact in diamonds.  People similarly abuse
   // terminology in other calls, e.g. "dixie style to a wave" that ends in a column.
   conc2_6_or_2_4 armturn_n4 [insert_number 3 inherit_fractal inherit_gensting] ctr_rot [inherit_funny]

call "relocate" c2
            funny_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc2_6_or_2_4_or_2_2 armturn_n4 [insert_number 3 inherit_fractal inherit_gensting] ctr_rot [inherit_funny]

call "_tally ho part 2" dontshow tag tally_ho_part_2
            left_means_mirror fractal_is_inherited gen_sting_is_inherited
   conc hinge_and_half_circ [inherit_left inherit_fractal inherit_gensting] trade [inherit_gensting]

call "tally ho" c1
            visible_fractions left_means_mirror bigmatrix_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq circulate_for_tally_ho [force_half inherit_left inherit_bigmatrix]
   seq tally_ho_part_2 [inherit_left inherit_bigmatrix inherit_fractal inherit_gensting]
   seq finishwithplainmod [inherit_bigmatrix inherit_fractal inherit_gensting]

call "tally ho but @m" c1
            visible_fractions fractal_is_inherited gen_sting_is_inherited
   seq circulate [force_half]
   seq tally_ho_part_2 [inherit_fractal inherit_gensting]
   seq finishwithmodbut2nd []

call "_touchngo part 2" dontshow tag touchngo2
            neednumber fractal_is_inherited gen_sting_is_inherited
   conc6_2 armturn_n4 [inherit_fractal inherit_gensting] armturn_n4 [insert_number 1]

call "_touchngo @0 part 2" dontshow tag touchngo2c
   conc6_2 nullcall [mandatory_anycall] armturn_n4 [insert_number 1]

call "_touchngo part 3 @b" dontshow tag touchngo3
            neednumber fractal_is_inherited gen_sting_is_inherited
   conc_diamond_line cast_off_n4_with_warn [inherit_fractal inherit_gensting]
                     spec_drop_in [suppress_elongation_warnings]

call "_touchngo @0 anything part 3" dontshow tag touchngo3cpri
   conc_diamond_line nullcall [mandatory_anycall]
                     spec_drop_in [suppress_elongation_warnings]

call "touch and go @b X @b" c4a
            magic_is_inherited need_two_numbers fractal_is_inherited gen_sting_is_inherited
   seq circulate [force_half inherit_magic]
   seq touchngo2 [inherit_fractal inherit_gensting]
   seq touchngo3 [shift_one_number inherit_fractal inherit_gensting]

call "touch and go @b X @0" c4a
            magic_is_inherited neednumber fractal_is_inherited gen_sting_is_inherited
   seq circulate [force_half inherit_magic]
   seq touchngo2 [inherit_fractal inherit_gensting]
   seq touchngo3cpri []

call "touch and go @0 X @m" c4
            last_part_visible magic_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq circulate [force_half inherit_magic]
   seq touchngo2c []
   seq finishwithmodbut2nd []

call "_leftable 1/2 swap" dontshow tag half_swap_to_stars
            left_means_mirror
   setup 2x2 dmd rotate restriction not_tboned
      array [0 0 ZM1W CR2N]
            alternate_definition [cross] c3a
   setup 2x2 dmd rotate restriction not_tboned
      array [0 0 ZM3W CR2N]

call "_leftable 1/2 reverse swap" dontshow tag half_rev_swap
            left_means_mirror
   setup 2x2 dmd rotate restriction not_tboned
      array [0 0 AL2S ZM3W]
            alternate_definition [cross] c3a
   setup 2x2 dmd rotate restriction not_tboned
      array [0 0 AL2S ZM1W]

call "_start action" dontshow tag startaction
            left_means_mirror
   conc half_rev_swap [inherit_left] hinge [inherit_left conc_demand_columns]

call "the action@S" c4a
            last_part_visible left_means_mirror
            fractal_is_inherited gen_sting_is_inherited
   seq startaction [inherit_left]
   seq turndmdn_endstrade [insert_number 1]
   seq finishwithmod []

call "the action@S but @m" c4a
            last_part_visible left_means_mirror
            fractal_is_inherited gen_sting_is_inherited
   seq startaction [inherit_left]
   seq turndmdn_endstrade [insert_number 1]
   seq finishwithmodbut2nd []

call "barge the action@S" c4a
            first_and_last_parts_visible split_like_square_thru left_means_mirror twisted_is_inherited
            fractal_is_inherited gen_sting_is_inherited
   seq square_thru_n [inherit_twisted insert_number 2]
   seq startaction [inherit_left]
   seq turndmdn_endstrade [inherit_gensting insert_number 1]
   seq finishwithmod [inherit_gensting]

call "barge the action@S but @m" c4a
            first_and_last_parts_visible split_like_square_thru left_means_mirror twisted_is_inherited
            fractal_is_inherited gen_sting_is_inherited
   seq square_thru_n [inherit_twisted insert_number 2]
   seq startaction [inherit_left]
   seq turndmdn_endstrade [inherit_gensting insert_number 1]
   seq finishwithmodbut2nd [inherit_gensting]

call "square the barge the action@S" c4
            first_and_last_parts_visible split_like_square_thru left_means_mirror twisted_is_inherited
            fractal_is_inherited gen_sting_is_inherited
   seq square_thru_n [inherit_twisted insert_number 4]
   seq startaction [inherit_left]
   seq turndmdn_endstrade [inherit_gensting insert_number 1]
   seq finishwithmod [inherit_gensting]

call "square the barge the action@S but @m" c4
            first_and_last_parts_visible split_like_square_thru left_means_mirror twisted_is_inherited
            fractal_is_inherited gen_sting_is_inherited
   seq square_thru_n [inherit_twisted insert_number 4]
   seq startaction [inherit_left]
   seq turndmdn_endstrade [inherit_gensting insert_number 1]
   seq finishwithmodbut2nd [inherit_gensting]

call "_fudge to parallel diamonds" dontshow tag fudge_to_parallel_diamonds
   setup 2stars qtag
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup p2stars qtag
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup qtag qtag
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup pqtag qtag
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup ptpd qtag
      array [ZM6N ZM0N ZM7N ZM5N ZM2N ZM4N ZM3N ZM1N]
   setup pptpd qtag
      array [ZM6N ZM0N ZM7N ZM5N ZM2N ZM4N ZM3N ZM1N]
   // Use these if something really weird is going on.
   // The last part better have stingy/generous on it.  Cf. vq02t.
   setup 2x4 2x4
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 4x2 2x4
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]

call "swap the windmill" c4
            first_part_visible reverse_means_mirror cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   // Note that, like circle by, we magically turn "reverse" into "left".
   seq half_swap_to_stars [inherit_left inherit_cross]
   seq fudge_to_parallel_diamonds []
   seq finish_windmill [inherit_fractal inherit_gensting insert_number 2]

call "_breaker part 1" dontshow tag breaker_part_1
            left_means_mirror fractal_is_inherited gen_sting_is_inherited
   conc splitctrrot [] hinge_then_trade_for_breaker [conc_demand_columns inherit_left inherit_gensting inherit_fractal]

call "_detract part 1" dontshow tag detract_part_1
   conc splitctrrot [] ends_disbp1 [conc_force_columns endscando]

call "_breaker part 2" dontshow tag breaker_part_2
   conc box_circ [force_half] nullcall []

call "_detract part 2" dontshow tag detract_part_2
   conc box_circ [force_half] hinge []

call "_finish it with @0" dontshow tag finish_mandatory_mod
   conc_diamond_line nullcall [mandatory_anycall] spec_drop_in [suppress_elongation_warnings]

call "_finish it with cast @9, opt for normal" dontshow tag finish_with_cast_n_with_warn
            neednumber fractal_is_inherited gen_sting_is_inherited
   conc_diamond_line cast_off_n4_with_warn [inherit_fractal inherit_gensting] spec_drop_in [suppress_elongation_warnings]

call "breaker @0" c3a
            first_part_visible fractal_is_inherited gen_sting_is_inherited
   seq breaker_part_1 [inherit_gensting inherit_fractal]
   seq breaker_part_2 []
   seq finish_mandatory_mod []

call "breaker @9" c3a
            first_part_visible neednumber fractal_is_inherited gen_sting_is_inherited
   seq breaker_part_1 [inherit_gensting inherit_fractal]
   seq breaker_part_2 []
   seq finish_with_cast_n_with_warn [inherit_fractal inherit_gensting]

call "detract @0" c4
            first_part_visible
   seq detract_part_1 []
   seq detract_part_2 []
   seq finish_mandatory_mod []

call "detract @9" c4
            first_part_visible neednumber fractal_is_inherited gen_sting_is_inherited
   seq detract_part_1 []
   seq detract_part_2 []
   seq finish_with_cast_n_with_warn [inherit_fractal inherit_gensting]

call "_start reflected linear action, ctrs" dontshow tag startreflinctr
   seq ctr_rot []
   seq box_circ_15 []

call "_start linear action" dontshow tag startlinact
   conc box_circ_15 [] trade []

call "_start reflected linear action" dontshow tag startreflinact
   conc startreflinctr [] trade []

call "_linear action crossing part" dontshow tag cross_the_lin_act
   conc_diamond_line slither [] nullcall []

call "linear action" c1
            first_and_last_parts_visible left_means_mirror fractal_is_inherited gen_sting_is_inherited
   seq hinge [inherit_left inherit_fractal inherit_gensting]
   seq startlinact []
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "linear action but @m" c1
            first_and_last_parts_visible left_means_mirror
   seq hinge [inherit_left]
   seq startlinact []
   seq finishwithmodbut2nd []

call "linear action but cross it" c4
            first_and_last_parts_visible left_means_mirror fractal_is_inherited gen_sting_is_inherited
   seq hinge [inherit_left inherit_fractal inherit_gensting]
   seq startlinact []
   seq cross_the_lin_act []
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "reflected linear action" c3
            first_and_last_parts_visible left_means_mirror fractal_is_inherited gen_sting_is_inherited
   seq hinge [inherit_left inherit_fractal inherit_gensting]
   seq startreflinact []
   seq finishwithplainmod [inherit_fractal inherit_gensting]

call "reflected linear action but @m" c3
            first_and_last_parts_visible left_means_mirror
   seq hinge [inherit_left]
   seq startreflinact []
   seq finishwithmodbut2nd []

call "reflected linear action but cross it" c4
            first_and_last_parts_visible left_means_mirror fractal_is_inherited gen_sting_is_inherited
   seq hinge [inherit_left inherit_fractal inherit_gensting]
   seq startreflinact []
   seq cross_the_lin_act []
   seq finishwithplainmod [inherit_fractal inherit_gensting]

// This one allows syntactically easy modify, for "breaker [flip back]".
call "_finish it with modify" dontshow tag finishwithmod
            bigmatrix_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc_diamond_line cast_off_n4_with_warn [or_anycall inherit_fractal inherit_gensting insert_number 3]
                     spec_drop_in [inherit_bigmatrix conc_force_otherway
                                   suppress_elongation_warnings]

// This one allows plain modify, for "tally ho but [flip back]".
call "_finish it with plain modify" dontshow tag finishwithplainmod
            bigmatrix_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc_diamond_line final_cast_off_34 [allow_plain_mod inherit_fractal inherit_gensting]
                     spec_drop_in [inherit_bigmatrix conc_force_otherway
                                   suppress_elongation_warnings]

call "_finish it with modify but @m" dontshow tag finishwithmodbut2nd
            bigmatrix_is_inherited
   conc_diamond_line nullsecond [mandatory_secondary_call]
                     spec_drop_in [inherit_bigmatrix conc_force_otherway
                                   suppress_elongation_warnings]

call "good show" c3
   setup 2x4 2x4
      array [ZM1N AL0S CR3S ZM2N ZM3N CR2S AL1S ZM0N]
   setup 4x2 2x4
      array [ZM1N CR6S CR3S ZM4N ZM3N AL4S AL1S ZM6N]
            alternate_definition [magic] c4
   setup 4x2 2x4
      array [6N 6S 4S 4N 3N 3S 1S 1N]
            alternate_definition [single] c4
   setup 1x4 2x2 restriction forbidden wave_only
      array [ZM0N AL0S ZM1N CR1S]
            alternate_definition [3x3 12matrix] c4
   setup 3x4 2x6 restriction forbidden wave_only
      array [ZM2N AL0S CR5S ZM3N ZM4N CR4S ZM5N CR3S AL2S ZM0N ZM1N AL1S]
            alternate_definition [4x4 16matrix] c4
   setup 4x4 2x8 restriction forbidden wave_only
      array [ZM4N ZM5N ZM6N CR6S ZM7N CR4S AL3S CR5S ZM0N ZM1N ZM2N AL2S ZM3N AL0S CR7S AL1S]
            alternate_definition [2x1] c4
   setup pshort6 2x3 rotate restriction forbidden wave_only
      array [AL1E ZM0W AL0E CR2E ZM2W CR1E]
   setup bone6 2x3 restriction forbidden wave_only
      array [ZM1N ZM1N CR2S ZM2N ZM0N AL0S]
            alternate_definition [1x2] c4    /* Same as 2x1. */
   setup pshort6 2x3 rotate restriction forbidden wave_only
      array [AL1E ZM0W AL0E CR2E ZM2W CR1E]
   setup bone6 2x3 restriction forbidden wave_only
      array [ZM1N ZM1N CR2S ZM2N ZM0N AL0S]

call "INVERT good show" c4
   simple_funny
   setup 2x4 2x4
      array [CR1S ZM0N ZM3N AL2S AL3S ZM2N ZM1N CR0S]
   setup 4x2 2x4
      array [CR1S ZM6N ZM3N CR4S AL3S ZM4N ZM1N AL6S]

call "turn on" c4a
            visible_fractions funny_is_inherited single_is_inherited
            nxn_is_inherited
   seq splitctrrot [inherit_funny inherit_single inherit_nxn]
   // 3x3 and 4x4 are presumably illegal here, so this must be "initially 3x3".
   seq extend [inherit_single inherit_nxn]

call "tickle" c4a tag tickle
            visible_fractions single_is_inherited fractal_is_inherited gen_sting_is_inherited
            mxn_is_inherited nxn_is_inherited bigmatrix_is_inherited
   seq hinge_for_nicely [inherit_mxn inherit_nxn inherit_bigmatrix inherit_gensting inherit_fractal]
   seq splitctrrot [inherit_single inherit_mxn inherit_nxn]

/*  This never caught on.
call "_shake it part 1" dontshow tag shake_it_1
            left_means_mirror
   setup 2x2 2x2 restriction forbidden all_facing_same
      array [M2W M3W CM1N CM0N]

call "_shake it part 2d @h" dontshow tag shake_it_2d
   select_leads nullcall [] quarter_maybe []

call "_shake it part 2 and @0" dontshow tag shake_it_2
   select_leads nullcall [] nullcall [mandatory_anycall]

call "shake it @h" c4x
            dont_use_in_resolve
   seq shake_it_1 []
   seq shake_it_2d []

call "shake it and @0" c4x
            dont_use_in_resolve left_means_mirror
   seq shake_it_1 [inherit_left]
   seq shake_it_2 []
*/

call "_maybe extend for walk the clover" dontshow tag maybe_extend
   setup qtag qtag qualifier miniwaves
      array [ZM0N ZM1N ZM2N ZM3N    0    0 ZM6N ZM7N]
   setup 2x4 qtag qualifier wave_only
      array [ZM0N ZM0N ZM1N ZM1N ZM2N ZM3N ZM7N ZM6N]
   setup 2x4 2x4 rotate qualifier tbone none
      array [ZM7W ZM7W ZM0W ZM0W    0    0    0    0]
   setup 4x2 2x4 rotate qualifier tbone none
      array [ZM6W    0 ZM1W    0    0 ZM2W    0 ZM5W]
   setup 2x4 2x4
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup 4x2 qtag rotate qualifier ntbone out in_or_out
      array [   0 ZM6W    0 ZM0W ZM1W    0 ZM3W    0]
   setup 4x2 2x4 qualifier ntbone none
      array [   0 ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N    0]
   setup bone bone
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]
   setup pbone bone
      array [ZM0N ZM1N ZM2N ZM3N ZM4N ZM5N ZM6N ZM7N]

call "central walk the clover" c4 tag cwalkclv
            fractal_is_inherited gen_sting_is_inherited visible_fractions step_to_wave left_means_mirror
   seq armturn_n4 [inherit_fractal inherit_gensting insert_number 1]
   seq walkndodge []

call "central walk the clover but @0" c4 tag cwalkclv_but
            fractal_is_inherited gen_sting_is_inherited visible_fractions step_to_wave left_means_mirror
   seq armturn_n4 [inherit_fractal inherit_gensting insert_number 1]
   seq nullcall [mandatory_anycall]

call "walk the@C clover" c4a
            left_means_mirror cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq maybe_extend []
   seq walk_clover_for_central [inherit_left inherit_cross inherit_fractal inherit_gensting]

call "walk the@C clover but @0" c4
            left_means_mirror cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   seq maybe_extend []
   seq walk_clover_for_central_but [inherit_left inherit_cross inherit_fractal inherit_gensting]

call "walk the@C clover, for central" dontshow tag walk_clover_for_central
            left_means_mirror cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc cwalkclv [inherit_fractal inherit_gensting inherit_left]
        clover [inherit_cross conc_demand_columns conc_force_otherway]

call "walk the@C clover, for central but @0" dontshow tag walk_clover_for_central_but
            left_means_mirror cross_is_inherited fractal_is_inherited gen_sting_is_inherited
   conc cwalkclv_but [inherit_fractal inherit_gensting inherit_left]
        clover [inherit_cross conc_demand_columns conc_force_otherway]
