home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / s / sd-27.zip / sdtables.c < prev    next >
C/C++ Source or Header  |  1992-11-23  |  106KB  |  1,785 lines

  1. /* SD -- square dance caller's helper.
  2.  
  3.     Copyright (C) 1990, 1991, 1992  William B. Ackerman.
  4.  
  5.     This program is free software; you can redistribute it and/or modify
  6.     it under the terms of the GNU General Public License as published by
  7.     the Free Software Foundation; either version 1, or (at your option)
  8.     any later version.
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19.     This is for version 27. */
  20.  
  21. /* This defines the following external variables:
  22.    general_concept_size
  23.    general_concept_offset
  24.    concept_offset_tables
  25.    concept_size_tables
  26.    concept_menu_strings
  27.    main_call_lists
  28.    number_of_calls
  29.    calling_level
  30.    getout_strings
  31.    filename_strings
  32.    resolve_names
  33.    resolve_distances
  34.    menu_names
  35.    keytab
  36.    setup_coords
  37.    nice_setup_coords
  38.    setup_limits
  39.    begin_sizes
  40.    startinfolist
  41.    map_b6_trngl
  42.    map_s6_trngl
  43.    map_2x2v
  44.    map_4x4v
  45.    map_2x4_magic
  46.    map_qtg_magic
  47.    map_qtg_intlk
  48.    map_qtg_magic_intlk
  49.    map_ptp_magic
  50.    map_ptp_intlk
  51.    map_ptp_magic_intlk
  52.    map_4x4_ns
  53.    map_4x4_ew
  54.    map_offset
  55.    map_ov_s2x4_k
  56.    map_dbloff1
  57.    map_dbloff2
  58.    map_trngl_box1
  59.    map_trngl_box2
  60.    map_lh_s2x3_3
  61.    map_lh_s2x3_2
  62.    map_rh_s2x3_3
  63.    map_rh_s2x3_2
  64.    map_lf_s2x4_r
  65.    map_rf_s2x4_r
  66.    map_dmd_1x1
  67.    maps_3diag
  68.    maps_3diagwk
  69.    map_lists
  70.    special_magic
  71.    special_interlocked
  72.    mark_end_of_list
  73.    marker_decline
  74.    marker_concept_mod
  75.    marker_concept_modreact
  76.    marker_concept_modtag
  77.    marker_concept_force
  78.    marker_concept_comment
  79.    concept_descriptor_table
  80.    nice_setup_concept
  81. */
  82.  
  83. #include "sd.h"
  84.  
  85.  
  86.  
  87. /* These are used in setup_coords. */
  88.  
  89. static coordrec thing1x1 = {s_1x1, 3,
  90.    {  0},
  91.    {  0}, {
  92.       -1, -1, -1, -1, -1, -1, -1, -1,
  93.       -1, -1, -1, -1, -1, -1, -1, -1,
  94.       -1, -1, -1, -1, -1, -1, -1, -1,
  95.       -1, -1, -1, -1,  0, -1, -1, -1,
  96.       -1, -1, -1, -1, -1, -1, -1, -1,
  97.       -1, -1, -1, -1, -1, -1, -1, -1,
  98.       -1, -1, -1, -1, -1, -1, -1, -1,
  99.       -1, -1, -1, -1, -1, -1, -1, -1}};
  100.  
  101. static coordrec thing1x2 = {s_1x2, 3,
  102.    { -2,   2},
  103.    {  0,   0}, {
  104.       -1, -1, -1, -1, -1, -1, -1, -1,
  105.       -1, -1, -1, -1, -1, -1, -1, -1,
  106.       -1, -1, -1, -1, -1, -1, -1, -1,
  107.       -1, -1, -1,  0,  1, -1, -1, -1,
  108.       -1, -1, -1, -1, -1, -1, -1, -1,
  109.       -1, -1, -1, -1, -1, -1, -1, -1,
  110.       -1, -1, -1, -1, -1, -1, -1, -1,
  111.       -1, -1, -1, -1, -1, -1, -1, -1}};
  112.  
  113. static coordrec thing1x3 = {s_1x3, 3,
  114.    { -4,   0,   4},
  115.    {  0,   0,   0}, {
  116.       -1, -1, -1, -1, -1, -1, -1, -1,
  117.       -1, -1, -1, -1, -1, -1, -1, -1,
  118.       -1, -1, -1, -1, -1, -1, -1, -1,
  119.       -1, -1, -1,  0,  1,  2, -1, -1,
  120.       -1, -1, -1, -1, -1, -1, -1, -1,
  121.       -1, -1, -1, -1, -1, -1, -1, -1,
  122.       -1, -1, -1, -1, -1, -1, -1, -1,
  123.       -1, -1, -1, -1, -1, -1, -1, -1}};
  124.  
  125. static coordrec thing1x4 = {s1x4, 3,
  126.    { -6,  -2,   6,   2},
  127.    {  0,   0,   0,   0}, {
  128.       -1, -1, -1, -1, -1, -1, -1, -1,
  129.       -1, -1, -1, -1, -1, -1, -1, -1,
  130.       -1, -1, -1, -1, -1, -1, -1, -1,
  131.       -1, -1,  0,  1,  3,  2, -1, -1,
  132.       -1, -1, -1, -1, -1, -1, -1, -1,
  133.       -1, -1, -1, -1, -1, -1, -1, -1,
  134.       -1, -1, -1, -1, -1, -1, -1, -1,
  135.       -1, -1, -1, -1, -1, -1, -1, -1}};
  136.  
  137. static coordrec thing1x6 = {s_1x6, 3,
  138.    {-10,  -6,  -2,  10,   6,   2},
  139.    {  0,   0,   0,   0,   0,   0}, {
  140.       -1, -1, -1, -1, -1, -1, -1, -1,
  141.       -1, -1, -1, -1, -1, -1, -1, -1,
  142.       -1, -1, -1, -1, -1, -1, -1, -1,
  143.       -1,  0,  1,  2,  5,  4,  3, -1,
  144.       -1, -1, -1, -1, -1, -1, -1, -1,
  145.       -1, -1, -1, -1, -1, -1, -1, -1,
  146.       -1, -1, -1, -1, -1, -1, -1, -1,
  147.       -1, -1, -1, -1, -1, -1, -1, -1}};
  148.  
  149. static coordrec thing1x8 = {s1x8, 3,
  150.    {-14, -10,  -2,  -6,  14,  10,   2,   6},
  151.    {  0,   0,   0,   0,   0,   0,   0,   0}, {
  152.       -1, -1, -1, -1, -1, -1, -1, -1,
  153.       -1, -1, -1, -1, -1, -1, -1, -1,
  154.       -1, -1, -1, -1, -1, -1, -1, -1,
  155.        0,  1,  3,  2,  6,  7,  5,  4,
  156.       -1, -1, -1, -1, -1, -1, -1, -1,
  157.       -1, -1, -1, -1, -1, -1, -1, -1,
  158.       -1, -1, -1, -1, -1, -1, -1, -1,
  159.       -1, -1, -1, -1, -1, -1, -1, -1}};
  160.  
  161. static coordrec thing1x10 = {s1x10, 4,
  162.    {-18, -14, -10,  -6,  -2,  18,  14,  10,   6,   2},
  163.    {  0,   0,   0,   0,   0,   0,   0,   0,   0,   0}, {
  164.       -1, -1, -1, -1, -1, -1, -1, -1,
  165.       -1, -1, -1, -1, -1, -1, -1, -1,
  166.       -1, -1, -1, -1, -1, -1, -1,  0,
  167.        1,  2,  3,  4,  9,  8,  7,  6,
  168.        5, -1, -1, -1, -1, -1, -1, -1,
  169.       -1, -1, -1, -1, -1, -1, -1, -1,
  170.       -1, -1, -1, -1, -1, -1, -1, -1,
  171.       -1, -1, -1, -1, -1, -1, -1, -1}};
  172.  
  173. static coordrec thing1x12 = {s1x12, 4,
  174.    {-22, -18, -14, -10,  -6,  -2,  22,  18,  14,  10,   6,   2},
  175.    {  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0}, {
  176.       -1, -1, -1, -1, -1, -1, -1, -1,
  177.       -1, -1, -1, -1, -1, -1, -1, -1,
  178.       -1, -1, -1, -1, -1, -1,  0,  1,
  179.        2,  3,  4,  5, 11, 10,  9,  8,
  180.        7,  6, -1, -1, -1, -1, -1, -1,
  181.       -1, -1, -1, -1, -1, -1, -1, -1,
  182.       -1, -1, -1, -1, -1, -1, -1, -1,
  183.       -1, -1, -1, -1, -1, -1, -1, -1}};
  184.  
  185. static coordrec thing1x14 = {s1x14, 4,
  186.    {-26, -22, -18, -14, -10,  -6,  -2,  26,  22,  18,  14,  10,   6,   2},
  187.    {  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0}, {
  188.       -1, -1, -1, -1, -1, -1, -1, -1,
  189.       -1, -1, -1, -1, -1, -1, -1, -1,
  190.       -1, -1, -1, -1, -1,  0,  1,  2,
  191.        3,  4,  5,  6, 13, 12, 11, 10,
  192.        9,  8,  7, -1, -1, -1, -1, -1,
  193.       -1, -1, -1, -1, -1, -1, -1, -1,
  194.       -1, -1, -1, -1, -1, -1, -1, -1,
  195.       -1, -1, -1, -1, -1, -1, -1, -1}};
  196.  
  197. static coordrec thing1x16 = {s1x16, 4,
  198.    {-30, -26, -22, -18, -14, -10,  -6,  -2,  30,  26,  22,  18,  14,  10,   6,   2},
  199.    {  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0}, {
  200.       -1, -1, -1, -1, -1, -1, -1, -1,
  201.       -1, -1, -1, -1, -1, -1, -1, -1,
  202.       -1, -1, -1, -1,  0,  1,  2,  3,
  203.        4,  5,  6,  7, 15, 14, 13, 12,
  204.       11, 10,  9,  8, -1, -1, -1, -1,
  205.       -1, -1, -1, -1, -1, -1, -1, -1,
  206.       -1, -1, -1, -1, -1, -1, -1, -1,
  207.       -1, -1, -1, -1, -1, -1, -1, -1}};
  208.  
  209. static coordrec thing2x2 = {s2x2, 3,
  210.    { -2,   2,   2,  -2},
  211.    {  2,   2,  -2,  -2}, {
  212.       -1, -1, -1, -1, -1, -1, -1, -1,
  213.       -1, -1, -1, -1, -1, -1, -1, -1,
  214.       -1, -1, -1, -1, -1, -1, -1, -1,
  215.       -1, -1, -1,  0,  1, -1, -1, -1,
  216.       -1, -1, -1,  3,  2, -1, -1, -1,
  217.       -1, -1, -1, -1, -1, -1, -1, -1,
  218.       -1, -1, -1, -1, -1, -1, -1, -1,
  219.       -1, -1, -1, -1, -1, -1, -1, -1}};
  220.  
  221. static coordrec thing2x3 = {s_2x3, 3,
  222.    { -4,   0,   4,   4,   0,  -4},
  223.    {  2,   2,   2,  -2,  -2,  -2}, {
  224.       -1, -1, -1, -1, -1, -1, -1, -1,
  225.       -1, -1, -1, -1, -1, -1, -1, -1,
  226.       -1, -1, -1, -1, -1, -1, -1, -1,
  227.       -1, -1, -1,  0,  1,  2, -1, -1,
  228.       -1, -1, -1,  5,  4,  3, -1, -1,
  229.       -1, -1, -1, -1, -1, -1, -1, -1,
  230.       -1, -1, -1, -1, -1, -1, -1, -1,
  231.       -1, -1, -1, -1, -1, -1, -1, -1}};
  232.  
  233. static coordrec thing2x4 = {s2x4, 3,
  234.    { -6,  -2,   2,   6,   6,   2,  -2,  -6},
  235.    {  2,   2,   2,   2,  -2,  -2,  -2,  -2}, {
  236.       -1, -1, -1, -1, -1, -1, -1, -1,
  237.       -1, -1, -1, -1, -1, -1, -1, -1,
  238.       -1, -1, -1, -1, -1, -1, -1, -1,
  239.       -1, -1,  0,  1,  2,  3, -1, -1,
  240.       -1, -1,  7,  6,  5,  4, -1, -1,
  241.       -1, -1, -1, -1, -1, -1, -1, -1,
  242.       -1, -1, -1, -1, -1, -1, -1, -1,
  243.       -1, -1, -1, -1, -1, -1, -1, -1}};
  244.  
  245. static coordrec thing2x6 = {s2x6, 3,
  246.    {-10,  -6,  -2,   2,   6,  10,  10,   6,   2,  -2,  -6,  -10},
  247.    {  2,   2,   2,   2,   2,   2,  -2,  -2,  -2,  -2,  -2,  -2}, {
  248.       -1, -1, -1, -1, -1, -1, -1, -1,
  249.       -1, -1, -1, -1, -1, -1, -1, -1,
  250.       -1, -1, -1, -1, -1, -1, -1, -1,
  251.       -1,  0,  1,  2,  3,  4,  5, -1,
  252.       -1, 11, 10,  9,  8,  7,  6, -1,
  253.       -1, -1, -1, -1, -1, -1, -1, -1,
  254.       -1, -1, -1, -1, -1, -1, -1, -1,
  255.       -1, -1, -1, -1, -1, -1, -1, -1}};
  256.  
  257. static coordrec thing2x8 = {s2x8, 3,
  258.    {-14, -10,  -6,  -2,   2,   6,  10,  14,  14,  10,   6,   2,  -2,  -6, -10, -14},
  259.    {  2,   2,   2,   2,   2,   2,   2,   2,  -2,  -2,  -2,  -2,  -2,  -2,  -2,  -2}, {
  260.       -1, -1, -1, -1, -1, -1, -1, -1,
  261.       -1, -1, -1, -1, -1, -1, -1, -1,
  262.       -1, -1, -1, -1, -1, -1, -1, -1,
  263.        0,  1,  2,  3,  4,  5,  6,  7,
  264.       15, 14, 13, 12, 11, 10,  9,  8,
  265.       -1, -1, -1, -1, -1, -1, -1, -1,
  266.       -1, -1, -1, -1, -1, -1, -1, -1,
  267.       -1, -1, -1, -1, -1, -1, -1, -1}};
  268.  
  269. static coordrec thing3x4 = {s3x4, 3,
  270.    { -6,  -2,   2,   6,   6,   2,   6,   2,  -2,  -6,  -6,  -2},
  271.    {  4,   4,   4,   4,   0,   0,  -4,  -4,  -4,  -4,   0,   0}, {
  272.       -1, -1, -1, -1, -1, -1, -1, -1,
  273.       -1, -1, -1, -1, -1, -1, -1, -1,
  274.       -1, -1,  0,  1,  2,  3, -1, -1,
  275.       -1, -1, 10, 11,  5,  4, -1, -1,
  276.       -1, -1,  9,  8,  7,  6, -1, -1,
  277.       -1, -1, -1, -1, -1, -1, -1, -1,
  278.       -1, -1, -1, -1, -1, -1, -1, -1,
  279.       -1, -1, -1, -1, -1, -1, -1, -1}};
  280.  
  281. static coordrec thinggal = {s_galaxy, 3,
  282.    { -7,  -2,   0,   2,   7,   2,   0,  -2},
  283.    {  0,   2,   7,   2,   0,  -2,  -7,  -2}, {
  284.       -1, -1, -1, -1, -1, -1, -1, -1,
  285.       -1, -1, -1, -1, -1, -1, -1, -1,
  286.       -1, -1, -1, -1,  2, -1, -1, -1,
  287.       -1, -1,  0,  1,  3,  4, -1, -1,
  288.       -1, -1, -1,  7,  5, -1, -1, -1,
  289.       -1, -1, -1, -1,  6, -1, -1, -1,
  290.       -1, -1, -1, -1, -1, -1, -1, -1,
  291.       -1, -1, -1, -1, -1, -1, -1, -1}};
  292.  
  293. static coordrec thingrigger = {s_rigger, 3,
  294.    { -2,   2,  10,   6,   2,  -2, -10,  -6},
  295.    {  2,   2,   0,   0,  -2,  -2,   0,   0}, {
  296.       -1, -1, -1, -1, -1, -1, -1, -1,
  297.       -1, -1, -1, -1, -1, -1, -1, -1,
  298.       -1, -1, -1, -1, -1, -1, -1, -1,
  299.       -1,  6,  7,  0,  1,  3,  2, -1,
  300.       -1, -1, -1,  5,  4, -1, -1, -1,
  301.       -1, -1, -1, -1, -1, -1, -1, -1,
  302.       -1, -1, -1, -1, -1, -1, -1, -1,
  303.       -1, -1, -1, -1, -1, -1, -1, -1}};
  304.  
  305. static coordrec thingspindle = {s_spindle, 3,
  306.    { -4,   0,   4,   8,   4,   0,  -4,  -8},
  307.    {  2,   2,   2,   0,  -2,  -2,  -2,   0}, {
  308.       -1, -1, -1, -1, -1, -1, -1, -1,
  309.       -1, -1, -1, -1, -1, -1, -1, -1,
  310.       -1, -1, -1, -1, -1, -1, -1, -1,
  311.       -1, -1,  7,  0,  1,  2,  3, -1,
  312.       -1, -1, -1,  6,  5,  4, -1, -1,
  313.       -1, -1, -1, -1, -1, -1, -1, -1,
  314.       -1, -1, -1, -1, -1, -1, -1, -1,
  315.       -1, -1, -1, -1, -1, -1, -1, -1}};
  316.  
  317. static coordrec thingbone = {s_bone, 3,
  318.    {-10,  10,   6,   2,  10, -10,  -6,  -2},
  319.    {  2,   2,   0,   0,  -2,  -2,   0,   0}, {
  320.       -1, -1, -1, -1, -1, -1, -1, -1,
  321.       -1, -1, -1, -1, -1, -1, -1, -1,
  322.       -1, -1, -1, -1, -1, -1, -1, -1,
  323.       -1,  0,  6,  7,  3,  2,  1, -1,
  324.       -1,  5, -1, -1, -1, -1,  4, -1,
  325.       -1, -1, -1, -1, -1, -1, -1, -1,
  326.       -1, -1, -1, -1, -1, -1, -1, -1,
  327.       -1, -1, -1, -1, -1, -1, -1, -1}};
  328.  
  329. static coordrec thingqtag = {s_qtag, 3,       /* "fudged" coordinates */
  330.    { -4,   5,   6,   2,   4,  -5,  -6,  -2},
  331.    {  5,   5,   0,   0,  -5,  -5,   0,   0}, {
  332.       -1, -1, -1, -1, -1, -1, -1, -1,
  333.       -1, -1, -1, -1, -1, -1, -1, -1,
  334.       -1, -1, -1,  0, -1,  1, -1, -1,
  335.       -1, -1,  6,  7,  3,  2, -1, -1,
  336.       -1, -1, -1, -1, -1, -1, -1, -1,
  337.       -1, -1,  5, -1, -1,  4, -1, -1,
  338.       -1, -1, -1, -1, -1, -1, -1, -1,
  339.       -1, -1, -1, -1, -1, -1, -1, -1}};
  340.  
  341. static coordrec nicethingqtag = {s_qtag, 3,   /* "true" coordinates */
  342.    { -5,   5,   6,   2,   5,  -5,  -6,  -2},
  343.    {  5,   5,   0,   0,  -5,  -5,   0,   0}, {
  344.       -1, -1, -1, -1, -1, -1, -1, -1,
  345.       -1, -1, -1, -1, -1, -1, -1, -1,
  346.       -1, -1,  0, -1, -1,  1, -1, -1,
  347.       -1, -1,  6,  7,  3,  2, -1, -1,
  348.       -1, -1, -1, -1, -1, -1, -1, -1,
  349.       -1, -1,  5, -1, -1,  4, -1, -1,
  350.       -1, -1, -1, -1, -1, -1, -1, -1,
  351.       -1, -1, -1, -1, -1, -1, -1, -1}};
  352.  
  353. static coordrec thing3x1dmd = {s_3x1dmd, 3,   /* used for both -- symmetric and safe for press/truck */
  354.    {-10,  -6,  -2,   0,  10,   6,   2,   0},
  355.    {  0,   0,   0,   5,   0,   0,   0,  -5}, {
  356.       -1, -1, -1, -1, -1, -1, -1, -1,
  357.       -1, -1, -1, -1, -1, -1, -1, -1,
  358.       -1, -1, -1, -1,  3, -1, -1, -1,
  359.       -1,  0,  1,  2,  6,  5,  4, -1,
  360.       -1, -1, -1, -1, -1, -1, -1, -1,
  361.       -1, -1, -1, -1,  7, -1, -1, -1,
  362.       -1, -1, -1, -1, -1, -1, -1, -1,
  363.       -1, -1, -1, -1, -1, -1, -1, -1}};
  364.  
  365. static coordrec thing3dmd = {s_3dmd, 3,   /* used for both -- symmetric and safe for press/truck */
  366.    { -7,   0,   7,  10,   6,   2,   7,   0,  -7, -10,  -6,  -2},
  367.    {  5,   5,   5,   0,   0,   0,  -5,  -5,  -5,   0,   0,   0}, {
  368.       -1, -1, -1, -1, -1, -1, -1, -1,
  369.       -1, -1, -1, -1, -1, -1, -1, -1,
  370.       -1, -1,  0, -1,  1,  2, -1, -1,
  371.       -1,  9, 10, 11,  5,  4,  3, -1,
  372.       -1, -1, -1, -1, -1, -1, -1, -1,
  373.       -1, -1,  8, -1,  7,  6, -1, -1,
  374.       -1, -1, -1, -1, -1, -1, -1, -1,
  375.       -1, -1, -1, -1, -1, -1, -1, -1}};
  376.  
  377. static coordrec thing4dmd = {s_4dmd, 3,   /* used for both -- symmetric and safe for press/truck */
  378.    {-11,  -5,   5,  11,  14,  10,   6,   2,  11,   5,  -5, -11, -14, -10,  -6,  -2},
  379.    {  5,   5,   5,   5,   0,   0,   0,   0,  -5,  -5,  -5,  -5,   0,   0,   0,   0}, {
  380.       -1, -1, -1, -1, -1, -1, -1, -1,
  381.       -1, -1, -1, -1, -1, -1, -1, -1,
  382.       -1,  0,  1, -1, -1,  2,  3, -1,
  383.       12, 13, 14, 15,  7,  6,  5,  4,
  384.       -1, -1, -1, -1, -1, -1, -1, -1,
  385.       -1, 11, 10, -1, -1,  9,  8, -1,
  386.       -1, -1, -1, -1, -1, -1, -1, -1,
  387.       -1, -1, -1, -1, -1, -1, -1, -1}};
  388.  
  389. static coordrec nicethingdmd = {sdmd, 3,          /* "true" coordinates -- there is no "fudged" version */
  390.    { -4,   0,   4,   0},
  391.    {  0,   4,   0,  -4}, {
  392.       -1, -1, -1, -1, -1, -1, -1, -1,
  393.       -1, -1, -1, -1, -1, -1, -1, -1,
  394.       -1, -1, -1, -1,  1, -1, -1, -1,
  395.       -1, -1, -1,  0, -1,  2, -1, -1,
  396.       -1, -1, -1, -1,  3, -1, -1, -1,
  397.       -1, -1, -1, -1, -1, -1, -1, -1,
  398.       -1, -1, -1, -1, -1, -1, -1, -1,
  399.       -1, -1, -1, -1, -1, -1, -1, -1}};
  400.  
  401. static coordrec nicethingshort6 = {s_short6, 3,   /* "true" coordinates -- there is no "fudged" version */
  402.    { -2,   0,   2,   2,   0,  -2},
  403.    {  2,   6,   2,  -2,  -6,  -2}, {
  404.       -1, -1, -1, -1, -1, -1, -1, -1,
  405.       -1, -1, -1, -1, -1, -1, -1, -1,
  406.       -1, -1, -1, -1,  1, -1, -1, -1,
  407.       -1, -1, -1,  0,  2, -1, -1, -1,
  408.       -1, -1, -1,  5,  3, -1, -1, -1,
  409.       -1, -1, -1, -1,  4, -1, -1, -1,
  410.       -1, -1, -1, -1, -1, -1, -1, -1,
  411.       -1, -1, -1, -1, -1, -1, -1, -1}};
  412.  
  413. static coordrec nicethingphan = {s_c1phan, 3,   /* "true" coordinates -- there is no "fudged" version */
  414.    {-10,  -6,  -2,  -6,   6,  10,   6,   2,  10,   6,   2,   6,  -6, -10,  -6,  -2},
  415.    {  6,  10,   6,   2,  10,   6,   2,   6,  -6, -10,  -6,  -2, -10,  -6,  -2,  -6}, {
  416.       -1, -1, -1, -1, -1, -1, -1, -1,
  417.       -1, -1,  1, -1, -1,  4, -1, -1,
  418.       -1,  0, -1,  2,  7, -1,  5, -1,
  419.       -1, -1,  3, -1, -1,  6, -1, -1,
  420.       -1, -1, 14, -1, -1, 11, -1, -1,
  421.       -1, 13, -1, 15, 10, -1,  8, -1,
  422.       -1, -1, 12, -1, -1,  9, -1, -1,
  423.       -1, -1, -1, -1, -1, -1, -1, -1}};
  424.  
  425. static coordrec thingglass = {s_hrglass, 3,
  426.    { -4,   5,   5,   0,   4,  -5,  -5,   0},
  427.    {  5,   5,   0,   2,  -5,  -5,   0,  -2}, {
  428.       -1, -1, -1, -1, -1, -1, -1, -1,
  429.       -1, -1, -1, -1, -1, -1, -1, -1,
  430.       -1, -1, -1,  0, -1,  1, -1, -1,
  431.       -1, -1,  6, -1,  3,  2, -1, -1,
  432.       -1, -1, -1, -1,  7, -1, -1, -1,
  433.       -1, -1,  5, -1, -1,  4, -1, -1,
  434.       -1, -1, -1, -1, -1, -1, -1, -1,
  435.       -1, -1, -1, -1, -1, -1, -1, -1}};
  436.  
  437. static coordrec thing4x4 = {s4x4, 3,
  438.    {  6,   6,   6,   2,   6,   2,  -2,   2,  -6,  -6,  -6,  -2,  -6,  -2,   2,  -2},
  439.    {  6,   2,  -2,   2,  -6,  -6,  -6,  -2,  -6,  -2,   2,  -2,   6,   6,   6,   2}, {
  440.       -1, -1, -1, -1, -1, -1, -1, -1,
  441.       -1, -1, -1, -1, -1, -1, -1, -1,
  442.       -1, -1, 12, 13, 14,  0, -1, -1,
  443.       -1, -1, 10, 15,  3,  1, -1, -1,
  444.       -1, -1,  9, 11,  7,  2, -1, -1,
  445.       -1, -1,  8,  6,  5,  4, -1, -1,
  446.       -1, -1, -1, -1, -1, -1, -1, -1,
  447.       -1, -1, -1, -1, -1, -1, -1, -1}};
  448.  
  449. static coordrec thing4x6 = {s4x6, 3,
  450.    {-10,  -6,  -2,   2,   6,  10,  10,   6,   2,  -2,  -6, -10,  10,   6,   2,  -2,  -6, -10, -10,  -6,  -2,   2,   6,  10},
  451.    {  6,   6,   6,   6,   6,   6,   2,   2,   2,   2,   2,   2,  -6,  -6,  -6,  -6,  -6,  -6,  -2,  -2,  -2,  -2,  -2,  -2}, {
  452.       -1, -1, -1, -1, -1, -1, -1, -1,
  453.       -1, -1, -1, -1, -1, -1, -1, -1,
  454.       -1,  0,  1,  2,  3,  4,  5, -1,
  455.       -1, 11, 10,  9,  8,  7,  6, -1,
  456.       -1, 18, 19, 20, 21, 22, 23, -1,
  457.       -1, 17, 16, 15, 14, 13, 12, -1,
  458.       -1, -1, -1, -1, -1, -1, -1, -1,
  459.       -1, -1, -1, -1, -1, -1, -1, -1}};
  460.  
  461. static coordrec thingblob = {s_bigblob, 3,
  462.    { -2,   2,   2,   6,   6,   2,  10,  10,   6,   6,   2,   2,   2,  -2,  -2,  -6,  -6,  -2, -10, -10,  -6,  -6,  -2,  -2},
  463.    { 10,  10,   6,   6,   2,   2,   2,  -2,  -2,  -6,  -6,  -2, -10, -10,  -6,  -6,  -2,  -2,  -2,   2,   2,   6,   6,   2}, {
  464.       -1, -1, -1, -1, -1, -1, -1, -1,
  465.       -1, -1, -1,  0,  1, -1, -1, -1,
  466.       -1, -1, 21, 22,  2,  3, -1, -1,
  467.       -1, 19, 20, 23,  5,  4,  6, -1,
  468.       -1, 18, 16, 17, 11,  8,  7, -1,
  469.       -1, -1, 15, 14, 10,  9, -1, -1,
  470.       -1, -1, -1, 13, 12, -1, -1, -1,
  471.       -1, -1, -1, -1, -1, -1, -1, -1}};
  472.  
  473.  
  474.  
  475. /* BEWARE!!  This list is keyed to the definition of "level" in sd.h . */
  476. char *getout_strings[] = {
  477.    "Mainstream",
  478.    "Plus",
  479.    "A1",
  480.    "A2",
  481.    "C1",
  482.    "C2",
  483.    "C3A",
  484.    "C3",
  485.    "C3X",
  486.    "C4A",
  487.    "C4",
  488.    "all",
  489.    ""};
  490.  
  491. /* BEWARE!!  This list is keyed to the definition of "level" in sd.h . */
  492. char *filename_strings[] = {
  493.    ".MS",
  494.    ".Plus",
  495.    ".A1",
  496.    ".A2",
  497.    ".C1",
  498.    ".C2",
  499.    ".C3A",
  500.    ".C3",
  501.    ".C3X",
  502.    ".C4A",
  503.    ".C4",
  504.    ".all",
  505.    ""};
  506.  
  507. /* BEWARE!!  This list is keyed to the definition of "resolve_kind" in sd.h . */
  508. char *resolve_names[] = {
  509.    "???",
  510.    "right and left grand",
  511.    "left allemande",
  512.    "extend, right and left grand",
  513.    "extend, left allemande",
  514.    "circulate, right and left grand",
  515.    "circulate, left allemande",
  516.    "pass thru, right and left grand",
  517.    "pass thru, left allemande",
  518.    "trade by, right and left grand",
  519.    "trade by, left allemande",
  520.    "cross by, right and left grand",
  521.    "cross by, left allemande",
  522.    "dixie grand, left allemande",
  523.    "promenade"};
  524.  
  525. char *resolve_distances[] = {
  526.    "  (At home)",
  527.    "  (1/8 promenade)",
  528.    "  (1/4 promenade)",
  529.    "  (3/8 promenade)",
  530.    "  (1/2 promenade)",
  531.    "  (5/8 promenade)",
  532.    "  (3/4 promenade)",
  533.    "  (7/8 promenade)"};
  534.  
  535. /* BEWARE!!  This list is keyed to the definition of "call_list_kind" in sd.h . */
  536. char *menu_names[] = {
  537.    "???",
  538.    "???",
  539.    "(any setup)",
  540.    "grand wave",
  541.    "left grand wave",
  542.    "dpt",
  543.    "cdpt",
  544.    "column",
  545.    "left column",
  546.    "8 chain",
  547.    "trade by",
  548.    "facing lines",
  549.    "lines-out",
  550.    "waves",
  551.    "left waves",
  552.    "2-faced lines",
  553.    "left 2-faced lines",
  554.    "grand column",
  555.    "diamond/qtag"};
  556.  
  557. /* BEWARE!!  This list is keyed to the definition of "setup_kind" in database.h . */
  558. begin_kind keytab[][2] = {
  559.    {b_nothing,       b_nothing},        /* nothing */
  560.    {b_1x1,           b_1x1},            /* s_1x1 */
  561.    {b_1x2,           b_2x1},            /* s_1x2 */
  562.    {b_1x3,           b_3x1},            /* s_1x3 */
  563.    {b_2x2,           b_2x2},            /* s2x2 */
  564.    {b_dmd,           b_pmd},            /* sdmd */
  565.    {b_star,          b_star},           /* s_star */
  566.    {b_trngl,         b_ptrngl},         /* s_trngl */
  567.    {b_bone6,         b_pbone6},         /* s_bone6 */
  568.    {b_short6,        b_pshort6},        /* s_short6 */
  569.    {b_qtag,          b_pqtag},          /* s_qtag */
  570.    {b_nothing,       b_nothing},        /* s_bone */
  571.    {b_rigger,        b_prigger},        /* s_rigger */
  572.    {b_spindle,       b_pspindle},       /* s_spindle */
  573.    {b_hrglass,       b_phrglass},       /* s_hrglass */
  574.    {b_nothing,       b_nothing},        /* s_hyperglass */
  575.    {b_crosswave,     b_pcrosswave},     /* s_crosswave */
  576.    {b_1x4,           b_4x1},            /* s1x4 */
  577.    {b_1x8,           b_8x1},            /* s1x8 */
  578.    {b_2x4,           b_4x2},            /* s2x4 */
  579.    {b_2x3,           b_3x2},            /* s_2x3 */
  580.    {b_1x6,           b_6x1},            /* s_1x6 */
  581.    {b_3x4,           b_4x3},            /* s3x4 */
  582.    {b_2x6,           b_6x2},            /* s2x6 */
  583.    {b_2x8,           b_8x2},            /* s2x8 */
  584.    {b_4x4,           b_4x4},            /* s4x4 */
  585.    {b_1x10,          b_10x1},           /* b_1x10 */
  586.    {b_1x12,          b_12x1},           /* b_1x12 */
  587.    {b_1x14,          b_14x1},           /* b_1x14 */
  588.    {b_1x16,          b_16x1},           /* b_1x16 */
  589.    {b_c1phan,        b_c1phan},         /* s_c1phan */
  590.    {b_nothing,       b_nothing},        /* s_bigblob */
  591.    {b_ptpd,          b_pptpd},          /* s_ptpd */
  592.    {b_3x1dmd,        b_p3x1dmd},        /* s_3x1dmd */
  593.    {b_3dmd,          b_p3dmd},          /* s_3dmd */
  594.    {b_4dmd,          b_p4dmd},          /* s_4dmd */
  595.    {b_nothing,       b_nothing},        /* s_concstar */
  596.    {b_nothing,       b_nothing},        /* s_concstar12 */
  597.    {b_nothing,       b_nothing},        /* s_concstar16 */
  598.    {b_galaxy,        b_galaxy},         /* s_galaxy */
  599.    {b_nothing,       b_nothing},        /* s4x6 */
  600.    {b_nothing,       b_nothing},        /* s_thar */
  601.    {b_nothing,       b_nothing}};       /* s_normal_concentric */
  602.  
  603.  
  604. /* These "coordrec" items have the fudged coordinates that are used for doing
  605.    press/truck calls.  For some setups, the coordinates of some people are
  606.    deliberately moved away from the obvious precise matrix spots so that
  607.    those people can't press or truck.  For example, the lateral spacing of
  608.    diamond points is not an integer.  If a diamond point does any truck or loop
  609.    call, he/she will not end up on the other diamond point spot (or any other
  610.    spot in the formation), so the call will not be legal.  This enforces our
  611.    view, not shared by all callers (Hi, Clark!) that the diamond points are NOT
  612.    as if the ends of lines of 3, and hence can NOT trade with each other by
  613.    doing a right loop 1. */
  614.  
  615. /* BEWARE!!  This list is keyed to the definition of "setup_kind" in database.h . */
  616. coordrec *setup_coords[] = {
  617.    0,                  /* nothing */
  618.    &thing1x1,          /* s_1x1 */
  619.    &thing1x2,          /* s_1x2 */
  620.    &thing1x3,          /* s_1x3 */
  621.    &thing2x2,          /* s2x2 */
  622.    0,                  /* sdmd */      /* nothing here -- press and truck not done here */
  623.    0,                  /* s_star */
  624.    0,                  /* s_trngl */
  625.    0,                  /* s_bone6 */
  626.    0,                  /* s_short6 */  /* nothing here -- press and truck not done here */
  627.    &thingqtag,         /* s_qtag */
  628.    &thingbone,         /* s_bone */
  629.    &thingrigger,       /* s_rigger */
  630.    &thingspindle,      /* s_spindle */
  631.    &thingglass,        /* s_hrglass */
  632.    0,                  /* s_hyperglass */
  633.    0,                  /* s_crosswave */
  634.    &thing1x4,          /* s1x4 */
  635.    &thing1x8,          /* s1x8 */
  636.    &thing2x4,          /* s2x4 */
  637.    &thing2x3,          /* s_2x3 */
  638.    &thing1x6,          /* s_1x6 */
  639.    &thing3x4,          /* s3x4 */
  640.    &thing2x6,          /* s2x6 */
  641.    &thing2x8,          /* s2x8 */
  642.    &thing4x4,          /* s4x4 */
  643.    &thing1x10,         /* s1x10 */
  644.    &thing1x12,         /* s1x12 */
  645.    &thing1x14,         /* s1x14 */
  646.    &thing1x16,         /* s1x16 */
  647.    0,                  /* s_c1phan */
  648.    &thingblob,         /* s_bigblob */
  649.    0,                  /* s_ptpd */
  650.    &thing3x1dmd,       /* s_3x1dmd */
  651.    &thing3dmd,         /* s_3dmd */
  652.    &thing4dmd,         /* s_4dmd */
  653.    0,                  /* s_concstar */
  654.    0,                  /* s_concstar12 */
  655.    0,                  /* s_concstar16 */
  656.    &thinggal,          /* s_galaxy */
  657.    &thing4x6,          /* s4x6 */
  658.    0,                  /* s_thar */
  659.    0};                 /* s_normal_concentric */
  660.  
  661.  
  662. /* The above table is not suitable for performing mirror inversion because,
  663.    for example, the points of diamonds do not reflect onto each other.  This
  664.    table has unfudged coordinates, in which all the symmetries are observed.
  665.    This is the table that is used for mirror reversal.  Most of the items in
  666.    it are the same as those in the table above. */
  667.  
  668. /* BEWARE!!  This list is keyed to the definition of "setup_kind" in database.h . */
  669. coordrec *nice_setup_coords[] = {
  670.    0,                  /* nothing */
  671.    &thing1x1,          /* s_1x1 */
  672.    &thing1x2,          /* s_1x2 */
  673.    &thing1x3,          /* s_1x3 */
  674.    &thing2x2,          /* s2x2 */
  675.    &nicethingdmd,      /* sdmd */
  676.    0,                  /* s_star */
  677.    0,                  /* s_trngl */
  678.    0,                  /* s_bone6 */
  679.    &nicethingshort6,   /* s_short6 */
  680.    &nicethingqtag,     /* s_qtag */
  681.    &thingbone,         /* s_bone */
  682.    &thingrigger,       /* s_rigger */
  683.    &thingspindle,      /* s_spindle */
  684.    &thingglass,        /* s_hrglass */
  685.    0,                  /* s_hyperglass */
  686.    0,                  /* s_crosswave */
  687.    &thing1x4,          /* s1x4 */
  688.    &thing1x8,          /* s1x8 */
  689.    &thing2x4,          /* s2x4 */
  690.    &thing2x3,          /* s_2x3 */
  691.    &thing1x6,          /* s_1x6 */
  692.    &thing3x4,          /* s3x4 */
  693.    &thing2x6,          /* s2x6 */
  694.    &thing2x8,          /* s2x8 */
  695.    &thing4x4,          /* s4x4 */
  696.    &thing1x10,         /* s1x10 */
  697.    &thing1x12,         /* s1x12 */
  698.    &thing1x14,         /* s1x14 */
  699.    &thing1x16,         /* s1x16 */
  700.    &nicethingphan,     /* s_c1phan */
  701.    &thingblob,         /* s_bigblob */
  702.    0,                  /* s_ptpd */
  703.    &thing3x1dmd,       /* s_3x1dmd */
  704.    &thing3dmd,         /* s_3dmd */
  705.    &thing4dmd,         /* s_4dmd */
  706.    0,                  /* s_concstar */
  707.    0,                  /* s_concstar12 */
  708.    0,                  /* s_concstar16 */
  709.    &thinggal,          /* s_galaxy */
  710.    &thing4x6,          /* s4x6 */
  711.    0,                  /* s_thar */
  712.    0};                 /* s_normal_concentric */
  713.  
  714.  
  715. /* BEWARE!!  This list is keyed to the definition of "setup_kind" in database.h . */
  716. int setup_limits[] = {
  717.    -1,         /* nothing */
  718.    0,          /* s_1x1 */
  719.    1,          /* s_1x2 */
  720.    2,          /* s_1x3 */
  721.    3,          /* s2x2 */
  722.    3,          /* sdmd */
  723.    3,          /* s_star */
  724.    2,          /* s_trngl */
  725.    5,          /* s_bone6 */
  726.    5,          /* s_short6 */
  727.    7,          /* s_qtag */
  728.    7,          /* s_bone */
  729.    7,          /* s_rigger */
  730.    7,          /* s_spindle */
  731.    7,          /* s_hrglass */
  732.    11,         /* s_hyperglass */
  733.    7,          /* s_crosswave */
  734.    3,          /* s1x4 */
  735.    7,          /* s1x8 */
  736.    7,          /* s2x4 */
  737.    5,          /* s_2x3 */
  738.    5,          /* s_1x6 */
  739.    11,         /* s3x4 */
  740.    11,         /* s2x6 */
  741.    15,         /* s2x8 */
  742.    15,         /* s4x4 */
  743.    9,          /* s1x10 */
  744.    11,         /* s1x12 */
  745.    13,         /* s1x14 */
  746.    15,         /* s1x16 */
  747.    15,         /* s_c1phan */
  748.    23,         /* s_bigblob */
  749.    7,          /* s_ptpd */
  750.    7,          /* s_3x1dmd */
  751.    11,         /* s_3dmd */
  752.    15,         /* s_4dmd */
  753.    7,          /* s_concstar */
  754.    11,         /* s_concstar12 */
  755.    15,         /* s_concstar16 */
  756.    7,          /* s_galaxy */
  757.    23,         /* s4x6 */
  758.    7,          /* s_thar */
  759.    -1};        /* s_normal_concentric */
  760.  
  761. /* BEWARE!!  This list is keyed to the definition of "begin_kind" in SD.H. */
  762. /*   It must also match the similar table in the database-building program. */
  763. int begin_sizes[] = {
  764.    0,          /* b_nothing */
  765.    1,          /* b_1x1 */
  766.    2,          /* b_1x2 */
  767.    2,          /* b_2x1 */
  768.    3,          /* b_1x3 */
  769.    3,          /* b_3x1 */
  770.    4,          /* b_2x2 */
  771.    4,          /* b_dmd */
  772.    4,          /* b_pmd */
  773.    4,          /* b_star */
  774.    6,          /* b_trngl */
  775.    6,          /* b_ptrngl */
  776.    6,          /* b_bone6 */
  777.    6,          /* b_pbone6 */
  778.    6,          /* b_short6 */
  779.    6,          /* b_pshort6 */
  780.    8,          /* b_qtag */
  781.    8,          /* b_pqtag */
  782.    8,          /* b_bone */
  783.    8,          /* b_pbone */
  784.    8,          /* b_rigger */
  785.    8,          /* b_prigger */
  786.    8,          /* b_spindle */
  787.    8,          /* b_pspindle */
  788.    8,          /* b_hrglass */
  789.    8,          /* b_phrglass */
  790.    8,          /* b_crosswave */
  791.    8,          /* b_pcrosswave */
  792.    4,          /* b_1x4 */
  793.    4,          /* b_4x1 */
  794.    8,          /* b_1x8 */
  795.    8,          /* b_8x1 */
  796.    8,          /* b_2x4 */
  797.    8,          /* b_4x2 */
  798.    6,          /* b_2x3 */
  799.    6,          /* b_3x2 */
  800.    6,          /* b_1x6 */
  801.    6,          /* b_6x1 */
  802.    12,         /* b_3x4 */
  803.    12,         /* b_4x3 */
  804.    12,         /* b_2x6 */
  805.    12,         /* b_6x2 */
  806.    16,         /* b_2x8 */
  807.    16,         /* b_8x2 */
  808.    16,         /* b_4x4 */
  809.    10,         /* b_1x10 */
  810.    10,         /* b_10x1 */
  811.    12,         /* b_1x12 */
  812.    12,         /* b_12x1 */
  813.    14,         /* b_1x14 */
  814.    14,         /* b_14x1 */
  815.    16,         /* b_1x16 */
  816.    16,         /* b_16x1 */
  817.    16,         /* b_c1phan */
  818.    8,          /* b_galaxy */
  819.    24,         /* b_4x6 */
  820.    24,         /* b_6x4 */
  821.    8,          /* b_thar */
  822.    8,          /* b_ptpd */
  823.    8,          /* b_pptpd */
  824.    8,          /* b_3x1dmd */
  825.    8,          /* b_p3x1dmd */
  826.    12,         /* b_3dmd */
  827.    12,         /* b_p3dmd */
  828.    16,         /* b_4dmd */
  829.    16};        /* b_p4dmd */
  830.  
  831.  
  832. #define B1A 0000
  833. #define G1A 0100
  834. #define B2A 0200
  835. #define G2A 0300
  836. #define B3A 0400
  837. #define G3A 0500
  838. #define B4A 0600
  839. #define G4A 0700
  840.  
  841. #define B1B (ID2_NSG|ID2_NSB|ID2_NHG|ID2_HCOR|ID2_HEAD|ID2_BOY)
  842. #define G1B (ID2_NSG|ID2_NSB|ID2_NHB|ID2_SCOR|ID2_HEAD|ID2_GIRL)
  843. #define B2B (ID2_NSG|ID2_NHG|ID2_NHB|ID2_SCOR|ID2_SIDE|ID2_BOY)
  844. #define G2B (ID2_NSB|ID2_NHG|ID2_NHB|ID2_HCOR|ID2_SIDE|ID2_GIRL)
  845. #define B3B B1B
  846. #define G3B G1B
  847. #define B4B B2B
  848. #define G4B G2B
  849.  
  850. /* BEWARE!!  This list is keyed to the definition of "start_select_kind" in sd.h. */
  851. startinfo startinfolist[] = {
  852.    {
  853.       "???",      /* A non-existent setup. */
  854.       FALSE,
  855.       {
  856.          nothing,
  857.          0,
  858.          {{0,0}},
  859.          1
  860.       }
  861.    },
  862.    {
  863.       "Heads 1P2P",
  864.       FALSE,                         /* into_the_middle */
  865.       {
  866.          s2x4,                       /* kind */
  867.          0,                          /* setupflags */
  868.          {{G2A|d_south,G2B}, {B2A|d_south,B2B}, {G1A|d_south,G1B}, {B1A|d_south,B1B},
  869.             {G4A|d_north,G4B}, {B4A|d_north,B4B}, {G3A|d_north,G3B}, {B3A|d_north,B3B}},
  870.          1                           /* rotation */
  871.       }
  872.    },
  873.    {
  874.       "Sides 1P2P",
  875.       FALSE,                         /* into_the_middle */
  876.       {
  877.          s2x4,                       /* kind */
  878.          0,                          /* setupflags */
  879.          {{G3A|d_south,G3B}, {B3A|d_south,B3B}, {G2A|d_south,G2B}, {B2A|d_south,B2B},
  880.             {G1A|d_north,G1B}, {B1A|d_north,B1B}, {G4A|d_north,G4B}, {B4A|d_north,B4B}},
  881.          0                           /* rotation */
  882.       }
  883.    },
  884.    {
  885.       "HEADS",
  886.       TRUE,                          /* into_the_middle */
  887.       {
  888.          s2x4,                       /* kind */
  889.          0,                          /* setupflags */
  890.          {{B4A|d_east,B4B}, {G3A|d_south,G3B}, {B3A|d_south,B3B}, {G2A|d_west,G2B},
  891.             {B2A|d_west,B2B}, {G1A|d_north,G1B}, {B1A|d_north,B1B}, {G4A|d_east,G4B}},
  892.          0                           /* rotation */
  893.       }
  894.    },
  895.    {
  896.       "SIDES",
  897.       TRUE,                          /* into_the_middle */
  898.       {
  899.          s2x4,                       /* kind */
  900.          0,                          /* setupflags */
  901.          {{B3A|d_east,B3B}, {G2A|d_south,G2B}, {B2A|d_south,B2B}, {G1A|d_west,G1B},
  902.             {B1A|d_west,B1B}, {G4A|d_north,G4B}, {B4A|d_north,B4B}, {G3A|d_east,G3B}},
  903.          1                           /* rotation */
  904.       }
  905.    },
  906.    {
  907.       "From squared set",
  908.       FALSE,                         /* into_the_middle */
  909.       {
  910.          s4x4,                       /* kind */
  911.          0,                          /* setupflags */
  912.          {{0,0}, {G2A|d_west,G2B}, {B2A|d_west,B2B}, {0,0}, {0,0}, {G1A|d_north,G1B},
  913.             {B1A|d_north,B1B}, {0,0}, {0,0}, {G4A|d_east,G4B}, {B4A|d_east,B4B}, {0,0},
  914.             {0,0}, {G3A|d_south,G3B}, {B3A|d_south,B3B}, {0,0}},
  915.          0                           /* rotation */
  916.       }
  917.    }
  918. #ifdef ripnsnortstuff
  919.    {
  920.       "1/4 stable, couple #3 rip 'n' snort, then HEADS",
  921.       TRUE,                          /* into_the_middle */
  922.       {
  923.          s2x4,                       /* kind */
  924.          0,                          /* setupflags */
  925.          {{B4A|d_south,B4B}, {G3A|d_west,G3B}, {B3A|d_east,B3B}, {G2A|d_south,G2B},
  926.             {B2A|d_south,B2B}, {G1A|d_west,G1B}, {B1A|d_east,B1B}, {G4A|d_south,G4B}},
  927.          0                           /* rotation */
  928.       }
  929.    }
  930. #endif
  931. };
  932.  
  933.  
  934.  
  935.  
  936. /*                                                                                                         setups are stacked on top of each other -----------------|
  937.                                                                                        each setup is rotated clockwise before being concatenated ---------------|   |
  938.                                                                                              (rot = 2 for second setup upside-down, 1-fold symmetry)            |   |
  939.                                                                                                 (rot = 3 for 1st setup ccw, 2nd cw, 1-fold symmetry)            |   |
  940.                                                                                                                                                                 V   V
  941.                                             map1                             map2                        map3 map4   map_kind          arity  outer   inner    rot vert */
  942.  
  943.        map_thing map_b6_trngl          = {{5, 4, 0},                      {2, 1, 3},                      {0}, {0}, MPKIND__SPLIT,       2,  s_bone6, s_trngl,  3, 0};
  944.        map_thing map_s6_trngl          = {{4, 5, 3},                      {1, 2, 0},                      {0}, {0}, MPKIND__SPLIT,       2,  s_short6, s_trngl, 2, 1};
  945.        map_thing map_2x2v              = {{0, 3},                         {1, 2},                         {0}, {0}, MPKIND__SPLIT,       2,  s2x2,   s_1x2,     1, 0};
  946.        map_thing map_2x4_magic         = {{0, 6, 3, 5},                   {7, 1, 4, 2},                   {0}, {0}, MPKIND__NONE,        2,  s2x4,   s1x4,      0, 0};
  947.        map_thing map_qtg_magic         = {{0, 2, 5, 3},                   {1, 7, 4, 6},                   {0}, {0}, MPKIND__NONE,        2,  s_qtag, sdmd,      1, 0};
  948.        map_thing map_qtg_intlk         = {{0, 3, 5, 6},                   {1, 2, 4, 7},                   {0}, {0}, MPKIND__NONE,        2,  s_qtag, sdmd,      1, 0};
  949.        map_thing map_qtg_magic_intlk   = {{0, 2, 5, 7},                   {1, 3, 4, 6},                   {0}, {0}, MPKIND__NONE,        2,  s_qtag, sdmd,      1, 0};
  950.        map_thing map_ptp_magic         = {{6, 1, 4, 3},                   {0, 7, 2, 5},                   {0}, {0}, MPKIND__NONE,        2,  s_ptpd, sdmd,      0, 0};
  951.        map_thing map_ptp_intlk         = {{0, 1, 6, 3},                   {2, 7, 4, 5},                   {0}, {0}, MPKIND__NONE,        2,  s_ptpd, sdmd,      0, 0};
  952.        map_thing map_ptp_magic_intlk   = {{2, 1, 4, 3},                   {0, 7, 6, 5},                   {0}, {0}, MPKIND__NONE,        2,  s_ptpd, sdmd,      0, 0};
  953. static map_thing map_2x4_diagonal      = {{2, 3, 6, 7},                   {0, 1, 4, 5},                   {0}, {0}, MPKIND__NONE,        2,  s2x4,   s2x2,      0, 0};
  954. static map_thing map_2x4_int_pgram     = {{1, 3, 5, 7},                   {0, 2, 4, 6},                   {0}, {0}, MPKIND__NONE,        2,  s2x4,   s2x2,      0, 0};
  955. static map_thing map_2x4_trapezoid     = {{1, 2, 4, 7},                   {0, 3, 5, 6},                   {0}, {0}, MPKIND__NONE,        2,  s2x4,   s2x2,      0, 0};
  956. static map_thing map_3x4_2x3_intlk     = {{2, 5, 7, 9, 10, 0},            {3, 4, 6, 8, 11, 1},            {0}, {0}, MPKIND__NONE,        2,  s3x4,   s_2x3,     1, 0};
  957. static map_thing map_3x4_2x3_conc      = {{3, 4, 6, 9, 10, 0},            {2, 5, 7, 8, 11, 1},            {0}, {0}, MPKIND__NONE,        2,  s3x4,   s_2x3,     1, 0};
  958.        map_thing map_4x4_ns            = {{12, 13, 0, 14},                {8, 6, 4, 5},                   {0}, {0}, MPKIND__NONE,        2,  s4x4,   s1x4,      0, 1};
  959.        map_thing map_4x4_ew            = {{0, 1, 4, 2},                   {12, 10, 8, 9},                 {0}, {0}, MPKIND__NONE,        2,  s4x4,   s1x4,      1, 1};
  960. static map_thing map_phantom_box       = {{0, 1, 6, 7, 8, 9, 14, 15},     {2, 3, 4, 5, 10, 11, 12, 13},   {0}, {0}, MPKIND__NONE,        2,  s2x8,   s2x4,      0, 0};
  961. static map_thing map_intlk_phantom_box = {{0, 1, 4, 5, 10, 11, 14, 15},   {2, 3, 6, 7, 8, 9, 12, 13},     {0}, {0}, MPKIND__INTLK,       2,  s2x8,   s2x4,      0, 0};
  962. static map_thing map_phantom_dmd       = {{0, 3, 4, 5, 8, 11, 12, 13},    {1, 2, 6, 7, 9, 10, 14, 15},    {0}, {0}, MPKIND__NONE,        2,  s_4dmd, s_qtag,    0, 0};
  963. static map_thing map_intlk_phantom_dmd = {{0, 2, 6, 7, 9, 11, 12, 13},    {1, 3, 4, 5, 8, 10, 14, 15},    {0}, {0}, MPKIND__INTLK,       2,  s_4dmd, s_qtag,    0, 0};
  964. static map_thing map_split_f           = {{13, 15, 11, 6, 8, 9, 10, 12},  {0, 1, 2, 4, 5, 7, 3, 14},      {0}, {0}, MPKIND__SPLIT,       2,  s4x4,   s2x4,      1, 0};
  965. static map_thing map_intlk_f           = {{14, 3, 7, 5, 8, 9, 10, 12},    {0, 1, 2, 4, 6, 11, 15, 13},    {0}, {0}, MPKIND__INTLK,       2,  s4x4,   s2x4,      1, 0};
  966. static map_thing map_full_f            = {{0, 1, 2, 4, 8, 9, 10, 12},     {14, 3, 7, 5, 6, 11, 15, 13},   {0}, {0}, MPKIND__NONE,        2,  s4x4,   s2x4,      1, 0};
  967. static map_thing map_stagger           = {{14, 1, 7, 4, 6, 9, 15, 12},    {0, 3, 2, 5, 8, 11, 10, 13},    {0}, {0}, MPKIND__NONE,        2,  s4x4,   s2x4,      1, 0};
  968. static map_thing map_stairst           = {{13, 1, 11, 4, 5, 9, 3, 12},    {0, 15, 2, 6, 8, 7, 10, 14},    {0}, {0}, MPKIND__NONE,        2,  s4x4,   s2x4,      1, 0};
  969. static map_thing map_ladder            = {{14, 3, 2, 4, 6, 11, 10, 12},   {0, 1, 7, 5, 8, 9, 15, 13},     {0}, {0}, MPKIND__NONE,        2,  s4x4,   s2x4,      1, 0};
  970. static map_thing map_but_o             = {{14, 1, 2, 5, 6, 9, 10, 13},    {0, 3, 7, 4, 8, 11, 15, 12},    {0}, {0}, MPKIND__NONE,        2,  s4x4,   s2x4,      1, 0};
  971. static map_thing map_o_s2x4_3          = {{14, 1, 2, 5, 6, 9, 10, 13},    {0, 3, 7, 4, 8, 11, 15, 12},    {0}, {0}, MPKIND__O_SPOTS,     2,  s4x4,   s2x4,      1, 0};
  972. static map_thing map_x_s2x4_3          = {{14, 1, 2, 5, 6, 9, 10, 13},    {0, 3, 7, 4, 8, 11, 15, 12},    {0}, {0}, MPKIND__X_SPOTS,     2,  s4x4,   s2x4,      1, 0};
  973. static map_thing map_o_s2x4_2          = {{10, 13, 14, 1, 2, 5, 6, 9},    {12, 15, 3, 0, 4, 7, 11, 8},    {0}, {0}, MPKIND__O_SPOTS,     2,  s4x4,   s2x4,      0, 0};
  974. static map_thing map_x_s2x4_2          = {{10, 13, 14, 1, 2, 5, 6, 9},    {12, 15, 3, 0, 4, 7, 11, 8},    {0}, {0}, MPKIND__X_SPOTS,     2,  s4x4,   s2x4,      0, 0};
  975.        map_thing map_offset            = {{13, 15, 2, 4, 5, 7, 10, 12},   {0, 1, 11, 6, 8, 9, 3, 14},     {0}, {0}, MPKIND__NONE,        2,  s4x4,   s2x4,      1, 0};
  976.        map_thing map_4x4v     = {{12, 10, 8, 9},       {13, 15, 6, 11},      {14, 3, 5, 7},      {0, 1, 4, 2},      MPKIND__SPLIT,       4,  s4x4,   s1x4,      1, 0};
  977. static map_thing map_blocks   = {{12, 14, 7, 9},       {13, 0, 2, 11},       {15, 1, 4, 6},      {10, 3, 5, 8},     MPKIND__NONE,        4,  s4x4,   s2x2,      0, 0};
  978. static map_thing map_trglbox  = {{12, 14, 15, 9},      {13, 0, 2, 3},        {7, 1, 4, 6},       {10, 11, 5, 8},    MPKIND__NONE,        4,  s4x4,   s2x2,      0, 0};
  979. static map_thing map_4x4_1x4  = {{8, 6, 4, 5},         {9, 11, 2, 7},        {10, 15, 1, 3},     {12, 13, 0, 14},   MPKIND__SPLIT,       4,  s4x4,   s1x4,      0, 1};
  980. static map_thing map_1x16_1x4 = {{0, 1, 3, 2},         {4, 5, 7, 6},         {15, 14, 12, 13},   {11, 10, 8, 9},    MPKIND__SPLIT,       4,  s1x16,  s1x4,      0, 0};
  981. static map_thing map_2x8_2x2  = {{0, 1, 14, 15},       {2, 3, 12, 13},       {4, 5, 10, 11},     {6, 7, 8, 9},      MPKIND__SPLIT,       4,  s2x8,   s2x2,      0, 0};
  982. static map_thing map_4dmd_dmd = {{0, 13, 11, 12},      {1, 15, 10, 14},      {2, 6, 9, 7},       {3, 4, 8, 5},      MPKIND__SPLIT,       4,  s_4dmd, sdmd,      1, 0};
  983. static map_thing map_2x6_1x6   = {{11, 10, 9, 6, 7, 8},              {0, 1, 2, 5, 4, 3},                  {0}, {0}, MPKIND__SPLIT,       2,  s2x6,   s_1x6,     0, 1};
  984. static map_thing map_2x8_1x8   = {{15, 14, 12, 13, 8, 9, 11, 10},    {0, 1, 3, 2, 7, 6, 4, 5},            {0}, {0}, MPKIND__SPLIT,       2,  s2x8,   s1x8,      0, 1};
  985. static map_thing map_1x16_1x8  = {{0, 1, 3, 2, 7, 6, 4, 5},          {15, 14, 12, 13, 8, 9, 11, 10},      {0}, {0}, MPKIND__SPLIT,       2,  s1x16,  s1x8,      0, 0};
  986. static map_thing map_hv_2x4_2  = {{0, 1, 2, 3, 12, 13, 14, 15},      {4, 5, 6, 7, 8, 9, 10, 11},          {0}, {0}, MPKIND__SPLIT,       2,  s2x8,   s2x4,      0, 0};
  987. static map_thing map_3x4_2x3   = {{1, 11, 8, 9, 10, 0},              {3, 4, 6, 7, 5, 2},                  {0}, {0}, MPKIND__SPLIT,       2,  s3x4,   s_2x3,     1, 0};
  988. static map_thing map_4x4_2x4v  = {{9, 11, 7, 2, 4, 5, 6, 8},         {12, 13, 14, 0, 1, 3, 15, 10},       {0}, {0}, MPKIND__SPLIT,       2,  s4x4,   s2x4,      0, 1};
  989. static map_thing map_4x4_2x4intv       = {{10, 15, 3, 1, 4, 5, 6, 8},     {12, 13, 14, 0, 2, 7, 11, 9},   {0}, {0}, MPKIND__SPLIT,       2,  s4x4,   s2x4,      0, 1};
  990. static map_thing map_2x4_2x2   = {{0, 1, 6, 7},                      {2, 3, 4, 5},                        {0}, {0}, MPKIND__SPLIT,       2,  s2x4,   s2x2,      0, 0};
  991. static map_thing map_2x3_1x3   = {{5, 4, 3},                         {0, 1, 2},                           {0}, {0}, MPKIND__SPLIT,       2,  s_2x3,  s_1x3,     0, 1};
  992. static map_thing map_2x4_1x4   = {{7, 6, 4, 5},                      {0, 1, 3, 2},                        {0}, {0}, MPKIND__SPLIT,       2,  s2x4,   s1x4,      0, 1};
  993. static map_thing map_qtg_dmd   = {{0, 7, 5, 6},                      {1, 2, 4, 3},                        {0}, {0}, MPKIND__SPLIT,       2,  s_qtag, sdmd,      1, 0};
  994. static map_thing map_ptp_dmd   = {{0, 1, 2, 3},                      {6, 7, 4, 5},                        {0}, {0}, MPKIND__SPLIT,       2,  s_ptpd, sdmd,      0, 0};
  995. static map_thing map_3dmd_dmd = {{0, 10, 8, 9},                  {1, 5, 7, 11},                 {2, 3, 6, 4},  {0}, MPKIND__SPLIT,       3,  s_3dmd, sdmd,      1, 0};
  996. static map_thing map_4x6_2x4  = {{1, 10, 19, 16, 17, 18, 11, 0}, {3, 8, 21, 14, 15, 20, 9, 2},
  997.                                                                  {5, 6, 23, 12, 13, 22, 7, 4},                 {0}, MPKIND__SPLIT,       3,  s4x6,   s2x4,      1, 0};
  998. static map_thing map_hv_qtg_2  = {{0, 1, 15, 14, 10, 11, 12, 13}, {2, 3, 4, 5, 8, 9, 7, 6},               {0}, {0}, MPKIND__SPLIT,       2,  s_4dmd, s_qtag,    0, 0};
  999. static map_thing map_1x6_1x3   = {{0, 1, 2},                         {5, 4, 3},                           {0}, {0}, MPKIND__SPLIT,       2,  s_1x6,  s_1x3,     0, 0};
  1000. static map_thing map_1x8_1x4   = {{0, 1, 2, 3},                      {6, 7, 4, 5},                        {0}, {0}, MPKIND__SPLIT,       2,  s1x8,   s1x4,      0, 0};
  1001. static map_thing map_1x12_1x4 = {{0, 1, 3, 2},                   {4, 5, 10, 11},                {9, 8, 6, 7},  {0}, MPKIND__SPLIT,       3,  s1x12,  s1x4,      0, 0};
  1002. static map_thing map_1x2_1x1 =  {{0},                            {1},                           {0},           {0}, MPKIND__SPLIT,       2,  s_1x2,  s_1x1,     0, 0};
  1003. static map_thing map_1x4_1x2 = {{0, 1},                          {3, 2},                        {0},           {0}, MPKIND__SPLIT,       2,  s1x4,   s_1x2,     0, 0};
  1004. static map_thing map_2x6_2x2 = {{0, 1, 10, 11},                  {2, 3, 8, 9},                  {4, 5, 6, 7},  {0}, MPKIND__SPLIT,       3,  s2x6,   s2x2,      0, 0};
  1005. static map_thing map_3x4_1x4 = {{9, 8, 6, 7},                    {10, 11, 4, 5},                {0, 1, 3, 2},  {0}, MPKIND__SPLIT,       3,  s3x4,   s1x4,      0, 1};
  1006. static map_thing map_2x3_1x2 = {{0, 5},                          {1, 4},                        {2, 3},        {0}, MPKIND__SPLIT,       3,  s_2x3,  s_1x2,     1, 0};
  1007. static map_thing map_1x6_1x2 = {{0, 1},                          {2, 5},                        {4, 3},        {0}, MPKIND__SPLIT,       3,  s_1x6,  s_1x2,     0, 0};
  1008. static map_thing map_2x2h = {{3, 2},                             {0, 1},                        {0},           {0}, MPKIND__SPLIT,       2,  s2x2,   s_1x2,     0, 1};
  1009. static map_thing map_2x4_2x2r = {{1, 6, 7, 0},                   {3, 4, 5, 2},                  {0},           {0}, MPKIND__SPLIT,       2,  s2x4,   s2x2,      1, 0};
  1010. static map_thing map_2x6_2x2r = {{1, 10, 11, 0},                 {3, 8, 9, 2},                  {5, 6, 7, 4},  {0}, MPKIND__SPLIT,       3,  s2x6,   s2x2,      1, 0};
  1011. static map_thing map_2x6_2x3   = {{0, 1, 2, 9, 10, 11},              {3, 4, 5, 6, 7, 8},                  {0}, {0}, MPKIND__SPLIT,       2,  s2x6,   s_2x3,     0, 0};
  1012. static map_thing map_1x2_rmv   = {{0, 3},                            {1, 2},                              {0}, {0}, MPKIND__REMOVED,     2,  s1x4,   s_1x2,     0, 0};
  1013. static map_thing map_1x2_rmvr  = {{0, 3},                            {1, 2},                              {0}, {0}, MPKIND__REMOVED,     2,  s2x2,   s_1x2,     1, 0};
  1014. static map_thing map_2x2_rmv   = {{0, 2, 5, 7},                      {1, 3, 4, 6},                        {0}, {0}, MPKIND__REMOVED,     2,  s2x4,   s2x2,      0, 0};
  1015. static map_thing map_1x4_rmv   = {{0, 3, 5, 6},                      {1, 2, 4, 7},                        {0}, {0}, MPKIND__REMOVED,     2,  s1x8,   s1x4,      0, 0};
  1016. static map_thing map_1x4_rmvr  = {{7, 6, 4, 5},                      {0, 1, 3, 2},                        {0}, {0}, MPKIND__REMOVED,     2,  s2x4,   s1x4,      0, 1};
  1017. static map_thing map_dmd_rmv   = {{6, 0, 3, 5},                      {7, 1, 2, 4},                        {0}, {0}, MPKIND__REMOVED,     2,  s_rigger, sdmd,    0, 0};
  1018. static map_thing map_dmd_rmvr  = {{0, 3, 5, 6},                      {1, 2, 4, 7},                        {0}, {0}, MPKIND__REMOVED,     2,  s_qtag, sdmd,      1, 0};
  1019.        map_thing map_ov_s2x4_k = {{13, 15, 11, 6, 8, 9, 10, 12}, {14, 3, 7, 5, 6, 11, 15, 13},
  1020.                                   {0, 1, 2, 4, 5, 7, 3, 14},     {0},                                               MPKIND__OVERLAP,     3,  s4x4,   s2x4,      1, 0};
  1021.        map_thing map_dbloff1   = {{0, 1, 3, 2, 4, 5, 7, 6},      {0},                           {0},           {0}, MPKIND__NONE,        1,  s2x4,   s_qtag,    0, 0};
  1022.        map_thing map_dbloff2   = {{2, 3, 4, 5, 6, 7, 0, 1},      {0},                           {0},           {0}, MPKIND__NONE,        1,  s2x4,   s_qtag,    0, 0};
  1023. static map_thing map_ov_1x4_2  = {{0, 1, 2, 3},                  {3, 2, 7, 6},                 {6, 7, 4, 5},   {0}, MPKIND__OVERLAP,     3,  s1x8,   s1x4,      0, 0};
  1024. static map_thing map_ov_1x4_3  = {{9, 8, 6, 7},                  {10, 11, 4, 5},               {0, 1, 3, 2},   {1}, MPKIND__OVERLAP,     3,  s3x4,   s1x4,      0, 0};
  1025. static map_thing map_ov_s2x2_2 = {{0, 1, 6, 7},                  {1, 2, 5, 6},                 {2, 3, 4, 5},   {0}, MPKIND__OVERLAP,     3,  s2x4,   s2x2,      0, 0};
  1026. static map_thing map_ov_2x3_3  = {{1, 11, 8, 9, 10, 0},      {2, 5, 7, 8, 11, 1},     {3, 4, 6, 7, 5, 2},      {0}, MPKIND__OVERLAP,     3,  s3x4,   s_2x3,     1, 0};
  1027. static map_thing map_ov_2x4_0  = {{0, 1, 2, 3, 8, 9, 10, 11},        {2, 3, 4, 5, 6, 7, 8, 9},            {0}, {0}, MPKIND__OVERLAP,     2,  s2x6,   s2x4,      0, 0};
  1028. static map_thing map_ov_2x4_1  = {{10, 11, 5, 4, 6, 7, 8, 9},        {0, 1, 2, 3, 4, 5, 11, 10},          {0}, {0}, MPKIND__OVERLAP,     2,  s3x4,   s2x4,      0, 1};
  1029. static map_thing map_ov_2x4_2  = {{0, 1, 2, 3, 12, 13, 14, 15},           {2, 3, 4, 5, 10, 11, 12, 13},
  1030.                                   {4, 5, 6, 7, 8, 9, 10, 11},        {0},                                           MPKIND__OVERLAP,     3,  s2x8,   s2x4,      0, 0};
  1031. static map_thing map_ov_2x4_3  = {{9, 11, 7, 2, 4, 5, 6, 8},         {10, 15, 3, 1, 2, 7, 11, 9},
  1032.                                   {12, 13, 14, 0, 1, 3, 15, 10},     {0},                                           MPKIND__OVERLAP,     3,  s4x4,   s2x4,      0, 1};
  1033. static map_thing map_ov_s1x8_0 = {{0, 1, 3, 2, 10, 11, 4, 5},        {4, 5, 10, 11, 6, 7, 9, 8},          {0}, {0}, MPKIND__OVERLAP,     2,  s1x12,  s1x8,      0, 0};
  1034. static map_thing map_ov_s1x8_1 = {{0, 1, 3, 2, 7, 6, 4, 5},          {4, 5, 7, 6, 12, 13, 15, 14},
  1035.                                   {15, 14, 12, 13, 8, 9, 11, 10},    {0},                                           MPKIND__OVERLAP,     3,  s1x16,  s1x8,      0, 0};
  1036. static map_thing map_ov_qtag_0 = {{0, 1, 5, 11, 7, 8, 9, 10},        {1, 2, 3, 4, 6, 7, 11, 5},           {0}, {0}, MPKIND__OVERLAP,     2,  s_3dmd, s_qtag,    0, 0};
  1037. static map_thing map_ov_qtag_2 = {{0, 1, 15, 14, 10, 11, 12, 13},    {1, 2, 6, 7, 9, 10, 14, 15},
  1038.                                   {2, 3, 4, 5, 8, 9, 7, 6},          {0},                                           MPKIND__OVERLAP,     3,  s_4dmd, s_qtag,    0, 0};
  1039.  
  1040. /* Maps for turning triangles into boxes for the "triangle" concept. */
  1041. /* Nonzero item in map3[1] for arity 1 map means do not reassemble. */
  1042.        map_thing map_trngl_box1        = {{1, 2, -1, 0},                  {0},                         {0, 1}, {0}, MPKIND__NONE,        1,  s_trngl, s2x2,     0, 0};
  1043.        map_thing map_trngl_box2        = {{1, 2, 0, -1},                  {0},                         {0, 1}, {0}, MPKIND__NONE,        1,  s_trngl, s2x2,     0, 0};
  1044.  
  1045. /* For maps with arity 1, a nonzero item in map3[0] means that the "offset goes away" warning should be given in certain cases. */
  1046. /* For maps with arity 3, a nonzero item in map4[0] means that the "overlap goes away" warning should be given in certain cases. */
  1047.  
  1048. static map_thing map_lh_s1x4_3         = {{9, 8, 6, 7},                   {0, 1, 3, 2},                   {0}, {0}, MPKIND__OFFS_L_HALF, 2,  s2x6,   s1x4,      0, 1};
  1049. static map_thing map_lh_s2x2_2         = {{10, 11, 8, 9},                 {2, 3, 4, 5},                   {0}, {0}, MPKIND__OFFS_L_HALF, 2,  s3x4,   s2x2,      0, 0};
  1050. static map_thing map_lh_s2x2_3         = {{11, 8, 9, 10},                 {3, 4, 5, 2},                   {0}, {0}, MPKIND__OFFS_L_HALF, 2,  s3x4,   s2x2,      1, 0};
  1051. static map_thing map_lh_s2x4_0         = {{0, 1, 2, 3, 6, 7, 8, 9},       {0},                            {0}, {0}, MPKIND__OFFS_L_HALF, 1,  s2x6,   s2x4,      0, 0};
  1052. static map_thing map_lh_s2x4_1         = {{10, 11, 2, 3, 4, 5, 8, 9},     {0},                            {0}, {0}, MPKIND__OFFS_L_HALF, 1,  s3x4,   s2x4,      0, 1};
  1053. static map_thing map_lh_s1x8_0         = {{0, 1, 2, 3, 4, 5, 6, 7},       {0},                            {1}, {0}, MPKIND__OFFS_L_HALF, 1,  s1x8,   s1x8,      0, 0};
  1054.        map_thing map_lh_s2x3_3         = {{1, 2, 4, 5, 7, 3},             {13, 15, 11, 9, 10, 12},        {0}, {0}, MPKIND__OFFS_L_HALF, 2,  s4x4,   s_2x3,     1, 1};
  1055.        map_thing map_lh_s2x3_2         = {{9, 11, 7, 5, 6, 8},            {13, 14, 0, 1, 3, 15},          {0}, {0}, MPKIND__OFFS_L_HALF, 2,  s4x4,   s_2x3,     0, 0};
  1056.  
  1057. static map_thing map_rh_s1x4_3         = {{11, 10, 8, 9},                 {2, 3, 5, 4},                   {0}, {0}, MPKIND__OFFS_R_HALF, 2,  s2x6,   s1x4,      0, 1};
  1058. static map_thing map_rh_s2x2_2         = {{0, 1, 11, 10},                 {5, 4, 6, 7},                   {0}, {0}, MPKIND__OFFS_R_HALF, 2,  s3x4,   s2x2,      0, 0};
  1059. static map_thing map_rh_s2x2_3         = {{1, 11, 10, 0},                 {4, 6, 7, 5},                   {0}, {0}, MPKIND__OFFS_R_HALF, 2,  s3x4,   s2x2,      1, 0};
  1060. static map_thing map_rh_s2x4_0         = {{2, 3, 4, 5, 8, 9, 10, 11},     {0},                            {0}, {0}, MPKIND__OFFS_R_HALF, 1,  s2x6,   s2x4,      0, 0};
  1061. static map_thing map_rh_s2x4_1         = {{0, 1, 5, 4, 6, 7, 11, 10},     {0},                            {0}, {0}, MPKIND__OFFS_R_HALF, 1,  s3x4,   s2x4,      0, 1};
  1062. static map_thing map_rh_s1x8_0         = {{0, 1, 2, 3, 4, 5, 6, 7},       {0},                            {1}, {0}, MPKIND__OFFS_R_HALF, 1,  s1x8,   s1x8,      0, 0};
  1063.        map_thing map_rh_s2x3_3         = {{15, 11, 6, 8, 9, 10},          {0, 1, 2, 7, 3, 14},            {0}, {0}, MPKIND__OFFS_R_HALF, 2,  s4x4,   s_2x3,     1, 1};
  1064.        map_thing map_rh_s2x3_2         = {{12, 13, 14, 3, 15, 10},        {11, 7, 2, 4, 5, 6},            {0}, {0}, MPKIND__OFFS_R_HALF, 2,  s4x4,   s_2x3,     0, 0};
  1065.  
  1066. static map_thing map_lf_s1x4_3         = {{11, 10, 8, 9},                 {0, 1, 3, 2},                   {0}, {0}, MPKIND__OFFS_L_FULL, 2,  s2x8,   s1x4,      0, 1};
  1067. static map_thing map_lf_s2x2_2         = {{9, 11, 6, 8},                  {14, 0, 1, 3},                  {0}, {0}, MPKIND__OFFS_L_FULL, 2,  s4x4,   s2x2,      0, 0};
  1068. static map_thing map_lf_s2x2_3         = {{11, 6, 8, 9},                  {0, 1, 3, 14},                  {0}, {0}, MPKIND__OFFS_L_FULL, 2,  s4x4,   s2x2,      1, 0};
  1069. static map_thing map_lf_s2x4_0         = {{0, 1, 2, 3, 8, 9, 10, 11},     {0},                            {0}, {0}, MPKIND__OFFS_L_FULL, 1,  s2x8,   s2x4,      0, 0};
  1070. static map_thing map_lf_s2x4_1         = {{13, 15, 2, 4, 5, 7, 10, 12},   {0},                            {0}, {0}, MPKIND__OFFS_L_FULL, 1,  s4x4,   s2x4,      1, 0};
  1071. static map_thing map_lf_s1x8_0         = {{0, 1, 2, 3, 4, 5, 6, 7},       {0},                            {1}, {0}, MPKIND__OFFS_L_FULL, 1,  s1x8,   s1x8,      0, 0};
  1072.  
  1073. static map_thing map_rf_s1x4_3         = {{15, 14, 12, 13},               {4, 5, 7, 6},                   {0}, {0}, MPKIND__OFFS_R_FULL, 2,  s2x8,   s1x4,      0, 1};
  1074. static map_thing map_rf_s2x2_2         = {{12, 13, 15, 10},               {7, 2, 4, 5},                   {0}, {0}, MPKIND__OFFS_R_FULL, 2,  s4x4,   s2x2,      0, 0};
  1075. static map_thing map_rf_s2x2_3         = {{13, 15, 10, 12},               {2, 4, 5, 7},                   {0}, {0}, MPKIND__OFFS_R_FULL, 2,  s4x4,   s2x2,      1, 0};
  1076. static map_thing map_rf_s2x4_0         = {{4, 5, 6, 7, 12, 13, 14, 15},   {0},                            {0}, {0}, MPKIND__OFFS_R_FULL, 1,  s2x8,   s2x4,      0, 0};
  1077. static map_thing map_rf_s2x4_1         = {{0, 1, 11, 6, 8, 9, 3, 14},     {0},                            {0}, {0}, MPKIND__OFFS_R_FULL, 1,  s4x4,   s2x4,      1, 0};
  1078. static map_thing map_rf_s1x8_0         = {{0, 1, 2, 3, 4, 5, 6, 7},       {0},                            {1}, {0}, MPKIND__OFFS_R_FULL, 1,  s1x8,   s1x8,      0, 0};
  1079.        map_thing map_lf_s2x4_r         = {{9, 11, 14, 0, 1, 3, 6, 8},     {0},                            {0}, {0}, MPKIND__OFFS_L_FULL, 1,  s4x4,   s2x4,      0, 1};
  1080.        map_thing map_rf_s2x4_r         = {{12, 13, 7, 2, 4, 5, 15, 10},   {0},                            {0}, {0}, MPKIND__OFFS_R_FULL, 1,  s4x4,   s2x4,      0, 1};
  1081.  
  1082. static map_thing map_blob_1x4a = {{13, 10, 6, 8},                {15, 17, 3, 5},            {18, 20, 1, 22},   {0}, MPKIND__NONE,        3,  s_bigblob,   s1x4, 0, 1};
  1083. static map_thing map_blob_1x4b = {{19, 16, 12, 14},              {21, 23, 9, 11},           {0, 2, 7, 4},      {0}, MPKIND__NONE,        3,  s_bigblob,   s1x4, 0, 1};
  1084. static map_thing map_blob_1x4c = {{1, 22, 18, 20},               {3, 5, 15, 17},            {6, 8, 13, 10},    {0}, MPKIND__NONE,        3,  s_bigblob,   s1x4, 1, 0};
  1085. static map_thing map_blob_1x4d = {{19, 16, 12, 14},              {21, 23, 9, 11},           {0, 2, 7, 4},      {0}, MPKIND__NONE,        3,  s_bigblob,   s1x4, 1, 0};
  1086. static map_thing map_wblob_1x4a        = {{15, 17, 5, 3, 6, 8, 10, 13},   {18, 20, 22, 1, 3, 5, 17, 15},  {0}, {0}, MPKIND__NONE,        2,  s_bigblob,   s2x4, 0, 1};
  1087. static map_thing map_wblob_1x4b        = {{21, 23, 11, 9, 12, 14, 16, 19},{0, 2, 4, 7, 9, 11, 23, 21},    {0}, {0}, MPKIND__NONE,        2,  s_bigblob,   s2x4, 0, 1};
  1088. static map_thing map_wblob_1x4c        = {{3, 5, 17, 15, 18, 20, 22, 1},  {6, 8, 10, 13, 15, 17, 5, 3},   {0}, {0}, MPKIND__NONE,        2,  s_bigblob,   s2x4, 1, 0};
  1089. static map_thing map_wblob_1x4d        = {{21, 23, 11, 9, 12, 14, 16, 19},{0, 2, 4, 7, 9, 11, 23, 21},    {0}, {0}, MPKIND__NONE,        2,  s_bigblob,   s2x4, 1, 0};
  1090.  
  1091.        map_thing map_dmd_1x1  = {{0},                  {1},                  {2},                {3},               MPKIND__NONE,        4,  sdmd,  s_1x1,      0, 0};
  1092.  
  1093. static map_thing map_4quads1  = {{0, 2},               {4, 6},               {10, 8},            {14, 12},          MPKIND__4_QUADRANTS, 4,  s_c1phan,    s_1x2,0, 0};
  1094. static map_thing map_4quads2  = {{1, 3},               {7, 5},               {11, 9},            {13, 15},          MPKIND__4_QUADRANTS, 4,  s_c1phan,    s_1x2,1, 0};
  1095.  
  1096. static map_thing map_dmd1     = {{0, 2},               {1, 3},               {0},                {0},               MPKIND__DMD_STUFF,   2,  sdmd,        s_1x2,0, 0};
  1097. static map_thing map_dmd2     = {{1, 3},               {0, 2},               {0},                {0},               MPKIND__DMD_STUFF,   2,  sdmd,        s_1x2,1, 0};
  1098.  
  1099.        map_thing *maps_3diag[4] = {&map_blob_1x4c, &map_blob_1x4a, &map_blob_1x4d, &map_blob_1x4b};
  1100.        map_thing *maps_3diagwk[4] = {&map_wblob_1x4a, &map_wblob_1x4c, &map_wblob_1x4b, &map_wblob_1x4d};
  1101.        
  1102. /* Beware!!  These items must be keyed to definition of "mpkind" in sd.h as follows:
  1103.                     split
  1104.                     |        removed
  1105.                     |        |        overlap
  1106.                     |        |        |        intlk
  1107.                     |        |        |        |        l_half
  1108.                     |        |        |        |        |        r_half
  1109.                     |        |        |        |        |        |        l_full
  1110.                     |        |        |        |        |        |        |        r_full
  1111.                     |        |        |        |        |        |        |        |        o_spots
  1112.                     |        |        |        |        |        |        |        |        |        x_spots
  1113.                     |        |        |        |        |        |        |        |        |        |        4quads
  1114.                     |        |        |        |        |        |        |        |        |        |        |        diamond
  1115.                     |        |        |        |        |        |        |        |        |        |        |        |
  1116.                     |        |        |        |        |        |        |        |        |        |        |        | */
  1117. static map_hunk mm_1x8_1 = {{0, 0},
  1118.                     {0, 0},  {0, 0},  {0, 0},  {0, 0},  {&map_lh_s1x8_0, 0},
  1119.                                                                  {&map_rh_s1x8_0, 0},
  1120.                                                                           {&map_lf_s1x8_0, 0},
  1121.                                                                                    {&map_rf_s1x8_0, 0},
  1122.                                                                                             {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1123.        
  1124. static map_hunk mm_2x4_1 = {{0, 0},
  1125.                     {0, 0},  {0, 0},  {0, 0},  {0, 0},  {&map_lh_s2x4_0, &map_lh_s2x4_1},
  1126.                                                                  {&map_rh_s2x4_0, &map_rh_s2x4_1},
  1127.                                                                           {&map_lf_s2x4_0, &map_lf_s2x4_1},
  1128.                                                                                    {&map_rf_s2x4_0, &map_rf_s2x4_1},
  1129.                                                                                             {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1130.        
  1131. static map_hunk mm_1x1_2 = {{0, 0},
  1132.                     {&map_1x2_1x1, &map_1x2_1x1},
  1133.                              {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1134.        
  1135. static map_hunk mm_1x2_2 = {{0, 0},
  1136.                     {&map_1x4_1x2, &map_2x2h},
  1137.                              {&map_1x2_rmv, &map_1x2_rmvr},
  1138.                                       {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {&map_dmd1, &map_dmd2}};
  1139.        
  1140. static map_hunk mm_2x2_2 = {{0, 0},
  1141.                     {&map_2x4_2x2, &map_2x4_2x2r},
  1142.                              {&map_2x2_rmv, 0},
  1143.                                       {0, 0},  {0, 0},  {&map_lh_s2x2_2, &map_lh_s2x2_3},
  1144.                                                                  {&map_rh_s2x2_2, &map_rh_s2x2_3},
  1145.                                                                           {&map_lf_s2x2_2, &map_lf_s2x2_3},
  1146.                                                                                    {&map_rf_s2x2_2, &map_rf_s2x2_3},
  1147.                                                                                             {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1148.        
  1149. static map_hunk mm_dmd_2 = {{0, 0},
  1150.                     {&map_ptp_dmd, &map_qtg_dmd},
  1151.                              {&map_dmd_rmv, &map_dmd_rmvr},
  1152.                                       {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1153.        
  1154. static map_hunk mm_tgl_2 = {{0, 0},
  1155.                     {0, &map_s6_trngl},
  1156.                              {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1157.        
  1158. static map_hunk mm_qtg_2 = {{0, 0},
  1159.                     {&map_hv_qtg_2, 0},
  1160.                              {0, 0},  {&map_ov_qtag_0, 0},
  1161.                                                {&map_intlk_phantom_dmd, 0},
  1162.                                                         {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1163.        
  1164. static map_hunk mm_1x3_2 = {{0, 0},
  1165.                     {&map_1x6_1x3, &map_2x3_1x3},
  1166.                              {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1167.        
  1168. static map_hunk mm_1x4_2 = {{0, 0},
  1169.                     {&map_1x8_1x4, &map_2x4_1x4},
  1170.                              {&map_1x4_rmv, &map_1x4_rmvr},
  1171.                                       {0, 0},  {0, 0},  {0, &map_lh_s1x4_3},
  1172.                                                                  {0, &map_rh_s1x4_3},
  1173.                                                                           {0, &map_lf_s1x4_3},
  1174.                                                                                    {0, &map_rf_s1x4_3},
  1175.                                                                                             {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1176.        
  1177. static map_hunk mm_1x8_2 = {{0, 0},
  1178.                     {&map_1x16_1x8, &map_2x8_1x8},
  1179.                              {0, 0},  {&map_ov_s1x8_0, 0},
  1180.                                                {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1181.  
  1182. static map_hunk mm_1x8_3 = {{0, 0},
  1183.                     {0, 0},  {0, 0},  {&map_ov_s1x8_1, 0},
  1184.                                                {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1185.  
  1186. static map_hunk mm_2x4_2 = {{0, 0},
  1187.                     {&map_hv_2x4_2, &map_4x4_2x4v},
  1188.                              {0, 0},  {&map_ov_2x4_0, &map_ov_2x4_1},
  1189.                                                {&map_intlk_phantom_box, &map_4x4_2x4intv},
  1190.                                                         {0, 0},  {0, 0},  {0, 0},  {0, 0},  {&map_o_s2x4_2, &map_o_s2x4_3},
  1191.                                                                                                      {&map_x_s2x4_2, &map_x_s2x4_3},
  1192.                                                                                                               {0, 0},  {0, 0}};
  1193.        
  1194. static map_hunk mm_2x3_2 = {{0, 0},
  1195.                     {&map_2x6_2x3, &map_3x4_2x3},
  1196.                              {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1197.  
  1198. static map_hunk mm_2x3_3 = {{0, 0},
  1199.                     {0, 0},  {0, 0},  {0, &map_ov_2x3_3},
  1200.                                                {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1201.  
  1202. static map_hunk mm_1x6_2 = {{0, 0},
  1203.                     {0, &map_2x6_1x6},
  1204.                              {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1205.        
  1206. static map_hunk mm_1x2_3 = {{0, 0},
  1207.                     {&map_1x6_1x2, &map_2x3_1x2},
  1208.                              {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1209.        
  1210. static map_hunk mm_2x2_3 = {{0, 0},
  1211.                     {&map_2x6_2x2, &map_2x6_2x2r},
  1212.                              {0, 0},  {&map_ov_s2x2_2, 0},
  1213.                                                {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1214.        
  1215. static map_hunk mm_dmd_3 = {{0, 0},
  1216.                     {0, &map_3dmd_dmd},
  1217.                              {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1218.        
  1219. static map_hunk mm_qtg_3 = {{0, 0},
  1220.                     {0, 0},  {0, 0},  {&map_ov_qtag_2, 0},
  1221.                                                {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1222.        
  1223. static map_hunk mm_1x4_3 = {{0, 0},
  1224.                     {&map_1x12_1x4, &map_3x4_1x4},
  1225.                              {0, 0},  {&map_ov_1x4_2, &map_ov_1x4_3},
  1226.                                                {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1227.        
  1228. static map_hunk mm_2x4_3 = {{0, 0},
  1229.                     {0, &map_4x6_2x4},
  1230.                              {0, 0},  {&map_ov_2x4_2, &map_ov_2x4_3},
  1231.                                                {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1232.        
  1233. static map_hunk mm_1x2_4 = {{0, 0},
  1234.                     {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {&map_4quads1, &map_4quads2},
  1235.                                                                                                                        {0, 0}};
  1236.        
  1237. static map_hunk mm_2x2_4 = {{0, 0},
  1238.                     {&map_2x8_2x2, 0},
  1239.                              {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1240.        
  1241. static map_hunk mm_dmd_4 = {{0, 0},
  1242.                     {0, &map_4dmd_dmd},
  1243.                              {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1244.        
  1245. static map_hunk mm_1x4_4 = {{0, 0},
  1246.                     {&map_1x16_1x4, &map_4x4_1x4},
  1247.                              {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0},  {0, 0}};
  1248.  
  1249.  
  1250.  
  1251. /* BEWARE!!  This list is keyed to the definition of "setup_kind" in database.h. */
  1252. map_hunk *map_lists[][4] = {
  1253.    {0,         0,         0,         0},          /* nothing */
  1254.    {0,         &mm_1x1_2, 0,         0},          /* s_1x1 */
  1255.    {0,         &mm_1x2_2, &mm_1x2_3, &mm_1x2_4},  /* s_1x2 */
  1256.    {0,         &mm_1x3_2, 0,         0},          /* s_1x3 */
  1257.    {0,         &mm_2x2_2, &mm_2x2_3, &mm_2x2_4},  /* s2x2 */
  1258.    {0,         &mm_dmd_2, &mm_dmd_3, &mm_dmd_4},  /* sdmd */
  1259.    {0,         0,         0,         0},          /* s_star */
  1260.    {0,         &mm_tgl_2, 0,         0},          /* s_trngl */
  1261.    {0,         0,         0,         0},          /* s_bone6 */
  1262.    {0,         0,         0,         0},          /* s_short6 */
  1263.    {0,         &mm_qtg_2, &mm_qtg_3, 0},          /* s_qtag */
  1264.    {0,         0,         0,         0},          /* s_bone */
  1265.    {0,         0,         0,         0},          /* s_rigger */
  1266.    {0,         0,         0,         0},          /* s_spindle */
  1267.    {0,         0,         0,         0},          /* s_hrglass */
  1268.    {0,         0,         0,         0},          /* s_hyperglass */
  1269.    {0,         0,         0,         0},          /* s_crosswave */
  1270.    {0,         &mm_1x4_2, &mm_1x4_3, &mm_1x4_4},  /* s1x4 */
  1271.    {&mm_1x8_1, &mm_1x8_2, &mm_1x8_3, 0},          /* s1x8 */
  1272.    {&mm_2x4_1, &mm_2x4_2, &mm_2x4_3, 0},          /* s2x4 */
  1273.    {0,         &mm_2x3_2, &mm_2x3_3, 0},          /* s_2x3 */
  1274.    {0,         &mm_1x6_2, 0,         0},          /* s_1x6 */
  1275.    {0,         0,         0,         0},          /* s3x4 */
  1276.    {0,         0,         0,         0},          /* s2x6 */
  1277.    {0,         0,         0,         0},          /* s2x8 */
  1278.    {0,         0,         0,         0},          /* s4x4 */
  1279.    {0,         0,         0,         0},          /* s1x10 */
  1280.    {0,         0,         0,         0},          /* s1x12 */
  1281.    {0,         0,         0,         0},          /* s1x14 */
  1282.    {0,         0,         0,         0},          /* s1x16 */
  1283.    {0,         0,         0,         0},          /* s_c1phan */
  1284.    {0,         0,         0,         0},          /* s_bigblob */
  1285.    {0,         0,         0,         0},          /* s_ptpd */
  1286.    {0,         0,         0,         0},          /* s_3x1dmd */
  1287.    {0,         0,         0,         0},          /* s_3dmd */
  1288.    {0,         0,         0,         0},          /* s_4dmd */
  1289.    {0,         0,         0,         0},          /* s_concstar */
  1290.    {0,         0,         0,         0},          /* s_concstar12 */
  1291.    {0,         0,         0,         0},          /* s_concstar16 */
  1292.    {0,         0,         0,         0},          /* s_galaxy */
  1293.    {0,         0,         0,         0},          /* s4x6 */
  1294.    {0,         0,         0,         0},          /* s_thar */
  1295.    {0,         0,         0,         0}};         /* s_normal_concentric */
  1296.  
  1297.  
  1298.  
  1299. concept_descriptor special_magic = {"MAGIC DIAMOND,", concept_magic, l_dontshow, {0, 1}};
  1300. concept_descriptor special_interlocked = {"INTERLOCKED DIAMOND,", concept_interlocked, l_dontshow, {0, 1}};
  1301.  
  1302.  
  1303. concept_descriptor mark_end_of_list = {"????", marker_end_of_list, l_dontshow};
  1304. concept_descriptor marker_decline = {"decline???", concept_mod_declined, l_dontshow};
  1305. concept_descriptor marker_concept_mod = {">>MODIFIED BY<<", concept_another_call_next_mod, l_dontshow};
  1306. concept_descriptor marker_concept_modreact = {">>REACTION MODIFIED BY<<", concept_another_call_next_modreact, l_dontshow};
  1307. concept_descriptor marker_concept_modtag = {">>TAG ENDING MODIFIED BY<<", concept_another_call_next_modtag, l_dontshow};
  1308. concept_descriptor marker_concept_force = {">>FORCIBLY MODIFIED BY<<", concept_another_call_next_force, l_dontshow};
  1309. concept_descriptor marker_concept_comment = {"{{COMMENT, l_dontshow}, l_dontshow}", concept_comment, l_dontshow};
  1310.  
  1311. callspec_block **main_call_lists[NUM_CALL_LIST_KINDS];
  1312. int number_of_calls[NUM_CALL_LIST_KINDS];
  1313. level calling_level;
  1314.  
  1315.  
  1316. /* **** BEWARE!!!!  Four concepts must be at positions indicated in "nice_setup_concept" (below) */
  1317.  
  1318. concept_descriptor concept_descriptor_table[] = {
  1319.  
  1320. /* phantom concepts */
  1321.  
  1322. #define pp__1 35
  1323.    {"SPLIT PHANTOM LINES",                   concept_do_phantom_2x4,        l_c3a, {&(map_split_f), phantest_impossible, 1}},
  1324.    {"INTERLOCKED PHANTOM LINES",             concept_do_phantom_2x4,        l_c3, {&(map_intlk_f), phantest_impossible, 1}},
  1325.    {"PHANTOM LINES",                         concept_do_phantom_2x4,        l_c3a, {&(map_full_f), phantest_first_or_both, 1}},
  1326.          {"", concept_comment, l_nonexistent_concept},
  1327.    {"12 MATRIX SPLIT PHANTOM LINES",         concept_do_phantom_2x3,        l_c3a, {&(map_3x4_2x3), phantest_impossible, 1}},
  1328.    {"12 MATRIX INTERLOCKED PHANTOM LINES",   concept_do_phantom_2x3,        l_c3, {&(map_3x4_2x3_intlk), phantest_impossible, 1}},
  1329.    {"12 MATRIX PHANTOM LINES",               concept_do_phantom_2x3,        l_c3a, {&(map_3x4_2x3_conc), phantest_first_or_both, 1}},
  1330.          {"", concept_comment, l_nonexistent_concept},
  1331.    {"DIVIDED LINES",                         concept_divided_2x4,           l_c4, {&(map_hv_2x4_2), phantest_impossible, 1}},
  1332.    {"12 MATRIX DIVIDED LINES",               concept_divided_2x3,           l_c4, {&(map_2x6_2x3), phantest_impossible, 1}},
  1333.          {"", concept_comment, l_nonexistent_concept},
  1334.    {"TWO PHANTOM LINES OF 8",                concept_do_phantom_1x8,        l_c3, {0, phantest_impossible, TRUE, 1}},
  1335.    {"TWO PHANTOM LINES OF 6",                concept_do_phantom_1x6,        l_c3, {0, phantest_impossible, TRUE, 1}},
  1336.          {"", concept_comment, l_nonexistent_concept},
  1337.    {"TRIPLE LINES",                          concept_triple_lines,          l_c2, {0, 1}},
  1338.    {"TRIPLE LINES WORKING TOGETHER",         concept_triple_lines_together, l_c3x, {0, 8, 1}},
  1339.    {"TRIPLE LINES WORKING APART",            concept_triple_lines_together, l_c3x, {0, 9, 1}},
  1340.    {"TRIPLE LINES WORKING FORWARD",          concept_triple_lines_together, l_c3x, {0, 0, 1}},
  1341.    {"TRIPLE LINES WORKING BACKWARD",         concept_triple_lines_together, l_c3x, {0, 2, 1}},
  1342.          {"", concept_comment, l_nonexistent_concept},
  1343.          {"", concept_comment, l_nonexistent_concept},
  1344.          {"", concept_comment, l_nonexistent_concept},
  1345.    {"TRIPLE DIAGONAL LINES",                 concept_triple_diag,           l_c4, {0, 1}},
  1346.    {"TRIPLE DIAGONAL LINES WORKING FORWARD", concept_triple_diag_together,  l_c4, {0, 0, 1}},
  1347.    {"TRIPLE DIAGONAL LINES WORKING BACKWARD",concept_triple_diag_together,  l_c4, {0, 2, 1}},
  1348.          {"", concept_comment, l_nonexistent_concept},
  1349.          {"", concept_comment, l_nonexistent_concept},
  1350.          {"", concept_comment, l_nonexistent_concept},
  1351.    {"TRIPLE TWIN LINES",                     concept_triple_twin,           l_c4a, {&(map_4x6_2x4), 0}},
  1352.          {"", concept_comment, l_nonexistent_concept},
  1353.    {"QUADRUPLE LINES",                       concept_quad_lines,            l_c4a, {0, 1}},
  1354.    {"QUADRUPLE LINES WORKING TOGETHER",      concept_quad_lines_together,   l_c4a, {0, 8, 1}},
  1355.    {"QUADRUPLE LINES WORKING APART",         concept_quad_lines_together,   l_c4a, {0, 9, 1}},
  1356.    {"QUADRUPLE LINES WORKING FORWARD",       concept_quad_lines_together,   l_c4a, {0, 0, 1}},
  1357.    {"QUADRUPLE LINES WORKING BACKWARD",      concept_quad_lines_together,   l_c4a, {0, 2, 1}},
  1358. /* -------- column break -------- */
  1359. #define pp__2 37
  1360.    {"SPLIT PHANTOM COLUMNS",                 concept_do_phantom_2x4,        l_c3a, {&(map_split_f), phantest_impossible, 0}},
  1361.    {"INTERLOCKED PHANTOM COLUMNS",           concept_do_phantom_2x4,        l_c3, {&(map_intlk_f), phantest_impossible, 0}},
  1362.    {"PHANTOM COLUMNS",                       concept_do_phantom_2x4,        l_c3a, {&(map_full_f), phantest_first_or_both, 0}},
  1363.          {"", concept_comment, l_nonexistent_concept},
  1364.    {"12 MATRIX SPLIT PHANTOM COLUMNS",       concept_do_phantom_2x3,        l_c3a, {&(map_3x4_2x3), phantest_impossible, 0}},
  1365.    {"12 MATRIX INTERLOCKED PHANTOM COLUMNS", concept_do_phantom_2x3,        l_c3, {&(map_3x4_2x3_intlk), phantest_impossible, 0}},
  1366.    {"12 MATRIX PHANTOM COLUMNS",             concept_do_phantom_2x3,        l_c3a, {&(map_3x4_2x3_conc), phantest_first_or_both, 0}},
  1367.          {"", concept_comment, l_nonexistent_concept},
  1368.    {"DIVIDED COLUMNS",                       concept_divided_2x4,           l_c4, {&(map_hv_2x4_2), phantest_impossible, 0}},
  1369.    {"12 MATRIX DIVIDED COLUMNS",             concept_divided_2x3,           l_c4, {&(map_2x6_2x3), phantest_impossible, 0}},
  1370.          {"", concept_comment, l_nonexistent_concept},
  1371.    {"TWO PHANTOM COLUMNS OF 8",              concept_do_phantom_1x8,        l_c3, {0, phantest_impossible, TRUE, 0}},
  1372.    {"TWO PHANTOM COLUMNS OF 6",              concept_do_phantom_1x6,        l_c3, {0, phantest_impossible, TRUE, 0}},
  1373.          {"", concept_comment, l_nonexistent_concept},
  1374.    {"TRIPLE COLUMNS",                        concept_triple_lines,          l_c3x, {0, 0}},
  1375.    {"TRIPLE COLUMNS WORKING TOGETHER",       concept_triple_lines_together, l_c3x, {0, 8, 0}},
  1376.    {"TRIPLE COLUMNS WORKING APART",          concept_triple_lines_together, l_c3x, {0, 9, 0}},
  1377.          {"", concept_comment, l_nonexistent_concept},
  1378.          {"", concept_comment, l_nonexistent_concept},
  1379.    {"TRIPLE COLUMNS WORKING RIGHT",          concept_triple_lines_together, l_c3x, {0, 3, 0}},
  1380.    {"TRIPLE COLUMNS WORKING LEFT",           concept_triple_lines_together, l_c3x, {0, 1, 0}},
  1381.          {"", concept_comment, l_nonexistent_concept},
  1382.    {"TRIPLE DIAGONAL COLUMNS",               concept_triple_diag,           l_c4, {0, 0}},
  1383.          {"", concept_comment, l_nonexistent_concept},
  1384.          {"", concept_comment, l_nonexistent_concept},
  1385.    {"TRIPLE DIAGONAL COLUMNS WORKING RIGHT", concept_triple_diag_together,  l_c4, {0, 3, 0}},
  1386.    {"TRIPLE DIAGONAL COLUMNS WORKING LEFT",  concept_triple_diag_together,  l_c4, {0, 1, 0}},
  1387.          {"", concept_comment, l_nonexistent_concept},
  1388.    {"TRIPLE TWIN COLUMNS",                   concept_triple_twin,           l_c4a, {&(map_4x6_2x4), 1}},
  1389.          {"", concept_comment, l_nonexistent_concept},
  1390.    {"QUADRUPLE COLUMNS",                     concept_quad_lines,            l_c4a, {0, 0}},
  1391.    {"QUADRUPLE COLUMNS WORKING TOGETHER",    concept_quad_lines_together,   l_c4a, {0, 8, 0}},
  1392.    {"QUADRUPLE COLUMNS WORKING APART",       concept_quad_lines_together,   l_c4a, {0, 9, 0}},
  1393.          {"", concept_comment, l_nonexistent_concept},
  1394.          {"", concept_comment, l_nonexistent_concept},
  1395.    {"QUADRUPLE COLUMNS WORKING RIGHT",       concept_quad_lines_together,   l_c4a, {0, 3, 0}},
  1396.    {"QUADRUPLE COLUMNS WORKING LEFT",        concept_quad_lines_together,   l_c4a, {0, 1, 0}},
  1397. /* -------- column break -------- */
  1398. #define pp__3 37
  1399.    {"SPLIT PHANTOM BOXES",                   concept_do_phantom_boxes,      l_c4a, {&(map_hv_2x4_2), phantest_impossible}},
  1400.    {"INTERLOCKED PHANTOM BOXES",             concept_do_phantom_boxes,      l_c4, {&(map_intlk_phantom_box), phantest_impossible}},
  1401.    {"PHANTOM BOXES",                         concept_do_phantom_boxes,      l_c4a, {&(map_phantom_box), phantest_first_or_both}},
  1402.          {"", concept_comment, l_nonexistent_concept},
  1403.          {"", concept_comment, l_nonexistent_concept},
  1404.          {"", concept_comment, l_nonexistent_concept},
  1405.          {"", concept_comment, l_nonexistent_concept},
  1406.          {"", concept_comment, l_nonexistent_concept},
  1407.          {"", concept_comment, l_nonexistent_concept},
  1408.          {"", concept_comment, l_nonexistent_concept},
  1409.          {"", concept_comment, l_nonexistent_concept},
  1410.          {"", concept_comment, l_nonexistent_concept},
  1411.          {"", concept_comment, l_nonexistent_concept},
  1412.          {"", concept_comment, l_nonexistent_concept},
  1413.    {"TRIPLE BOXES",                          concept_triple_boxes,          l_c2},
  1414.    {"TRIPLE BOXES WORKING TOGETHER",         concept_triple_boxes_together, l_c3x, {0, 8, 0}},
  1415.    {"TRIPLE BOXES WORKING APART",            concept_triple_boxes_together, l_c3x, {0, 9, 0}},
  1416.    {"TRIPLE BOXES WORKING FORWARD",          concept_triple_boxes_together, l_c3x, {0, 0, 0}},
  1417.    {"TRIPLE BOXES WORKING BACKWARD",         concept_triple_boxes_together, l_c3x, {0, 2, 0}},
  1418.    {"TRIPLE BOXES WORKING RIGHT",            concept_triple_boxes_together, l_c3x, {0, 3, 0}},
  1419.    {"TRIPLE BOXES WORKING LEFT",             concept_triple_boxes_together, l_c3x, {0, 1, 0}},
  1420.          {"", concept_comment, l_nonexistent_concept},
  1421.          {"", concept_comment, l_nonexistent_concept},
  1422.          {"", concept_comment, l_nonexistent_concept},
  1423.          {"", concept_comment, l_nonexistent_concept},
  1424.          {"", concept_comment, l_nonexistent_concept},
  1425.          {"", concept_comment, l_nonexistent_concept},
  1426.          {"", concept_comment, l_nonexistent_concept},
  1427.          {"", concept_comment, l_nonexistent_concept},
  1428.          {"", concept_comment, l_nonexistent_concept},
  1429.    {"QUADRUPLE BOXES",                       concept_quad_boxes,            l_c4a},
  1430.    {"QUADRUPLE BOXES WORKING TOGETHER",      concept_quad_boxes_together,   l_c4a, {0, 8, 0}},
  1431.    {"QUADRUPLE BOXES WORKING APART",         concept_quad_boxes_together,   l_c4a, {0, 9, 0}},
  1432.    {"QUADRUPLE BOXES WORKING FORWARD",       concept_quad_boxes_together,   l_c4a, {0, 0, 0}},
  1433.    {"QUADRUPLE BOXES WORKING BACKWARD",      concept_quad_boxes_together,   l_c4a, {0, 2, 0}},
  1434.    {"QUADRUPLE BOXES WORKING RIGHT",         concept_quad_boxes_together,   l_c4a, {0, 3, 0}},
  1435.    {"QUADRUPLE BOXES WORKING LEFT",          concept_quad_boxes_together,   l_c4a, {0, 1, 0}},
  1436. /* -------- column break -------- */
  1437. #define pp__4 32
  1438.    {"SPLIT PHANTOM DIAMONDS",                concept_do_phantom_diamonds,   l_c3x, {&(map_hv_qtg_2), phantest_impossible}},
  1439.    {"INTERLOCKED PHANTOM DIAMONDS",          concept_do_phantom_diamonds,   l_c4, {&(map_intlk_phantom_dmd), phantest_impossible}},
  1440.    {"PHANTOM DIAMONDS",                      concept_do_phantom_diamonds,   l_c4, {&(map_phantom_dmd), phantest_first_or_both}},
  1441.          {"", concept_comment, l_nonexistent_concept},
  1442.          {"", concept_comment, l_nonexistent_concept},
  1443.          {"", concept_comment, l_nonexistent_concept},
  1444.          {"", concept_comment, l_nonexistent_concept},
  1445.          {"", concept_comment, l_nonexistent_concept},
  1446.          {"", concept_comment, l_nonexistent_concept},
  1447.          {"", concept_comment, l_nonexistent_concept},
  1448.          {"", concept_comment, l_nonexistent_concept},
  1449.          {"", concept_comment, l_nonexistent_concept},
  1450.          {"", concept_comment, l_nonexistent_concept},
  1451.          {"", concept_comment, l_nonexistent_concept},
  1452.    {"TRIPLE DIAMONDS",                       concept_triple_diamonds,          l_c3a},
  1453.    {"TRIPLE DIAMONDS WORKING TOGETHER",      concept_triple_diamonds_together, l_c3x},
  1454.          {"", concept_comment, l_nonexistent_concept},
  1455.          {"", concept_comment, l_nonexistent_concept},
  1456.          {"", concept_comment, l_nonexistent_concept},
  1457.          {"", concept_comment, l_nonexistent_concept},
  1458.          {"", concept_comment, l_nonexistent_concept},
  1459.          {"", concept_comment, l_nonexistent_concept},
  1460.          {"", concept_comment, l_nonexistent_concept},
  1461.          {"", concept_comment, l_nonexistent_concept},
  1462.          {"", concept_comment, l_nonexistent_concept},
  1463.          {"", concept_comment, l_nonexistent_concept},
  1464.          {"", concept_comment, l_nonexistent_concept},
  1465.          {"", concept_comment, l_nonexistent_concept},
  1466.          {"", concept_comment, l_nonexistent_concept},
  1467.          {"", concept_comment, l_nonexistent_concept},
  1468.    {"QUADRUPLE DIAMONDS",                    concept_quad_diamonds,          l_c4a},
  1469.    {"QUADRUPLE DIAMONDS WORKING TOGETHER",   concept_quad_diamonds_together, l_c4a},
  1470.  
  1471. /* tandem concepts */
  1472.  
  1473. #define tt__1 10
  1474.    {"AS COUPLES",                            concept_tandem,                l_a1,         {0, FALSE, 0, 0, 1}},
  1475.    {"TANDEM",                                concept_tandem,                l_c1,         {0, FALSE, 0, 0, 0}},
  1476.    {"SIAMESE",                               concept_tandem,                l_c2,         {0, FALSE, 0, 0, 2}},
  1477.    {"SKEW",                                  concept_tandem,                l_c2,         {0, FALSE, 0, 0, 3}},
  1478.    {"SO-AND-SO AS COUPLES",                  concept_some_are_tandem,       l_a1,         {0, TRUE,  0, 0, 1}},
  1479.    {"SO-AND-SO TANDEM",                      concept_some_are_tandem,       l_c1,         {0, TRUE,  0, 0, 0}},
  1480.    {"PHANTOM AS COUPLES",                    concept_phantom_tandem,        l_c4,         {0, FALSE, 0, 1, 1}},
  1481.    {"PHANTOM TANDEM",                        concept_phantom_tandem,        l_c4a,        {0, FALSE, 0, 1, 0}},
  1482.    {"GRUESOME AS COUPLES",                   concept_gruesome_tandem,       l_c4a,        {0, FALSE, 0, 2, 1}},
  1483.    {"GRUESOME TANDEM",                       concept_gruesome_tandem,       l_c4a,        {0, FALSE, 0, 2, 0}},
  1484. /* -------- column break -------- */
  1485. #define tt__2 10
  1486.    {"COUPLES TWOSOME",                       concept_tandem,                l_c3,         {0, FALSE, 1, 0, 1}},
  1487.    {"TANDEM TWOSOME",                        concept_tandem,                l_c3,         {0, FALSE, 1, 0, 0}},
  1488.    {"SIAMESE TWOSOME",                       concept_tandem,                l_c3,         {0, FALSE, 1, 0, 2}},
  1489.    {"SKEWSOME",                              concept_tandem,                l_c2,         {0, FALSE, 1, 0, 3}},
  1490.    {"SO-AND-SO COUPLES TWOSOME",             concept_some_are_tandem,       l_c3,         {0, TRUE,  1, 0, 1}},
  1491.    {"SO-AND-SO TANDEM TWOSOME",              concept_some_are_tandem,       l_c3,         {0, TRUE,  1, 0, 0}},
  1492.    {"PHANTOM COUPLES TWOSOME",               concept_phantom_tandem,        l_c3,         {0, FALSE, 1, 1, 1}},
  1493.    {"PHANTOM TANDEM TWOSOME",                concept_phantom_tandem,        l_c3,         {0, FALSE, 1, 1, 0}},
  1494.    {"GRUESOME TWOSOME",                      concept_gruesome_tandem,       l_c4a,        {0, FALSE, 1, 2, 1}},
  1495.    {"GRUESOME TANDEM TWOSOME",               concept_gruesome_tandem,       l_c4a,        {0, FALSE, 1, 2, 0}},
  1496. /* -------- column break -------- */
  1497. #define tt__3 10
  1498.    {"COUPLES N/4 TWOSOME",                   concept_frac_tandem,           l_a1,         {0, FALSE, 2, 0, 1}},
  1499.    {"TANDEM N/4 TWOSOME",                    concept_frac_tandem,           l_c1,         {0, FALSE, 2, 0, 0}},
  1500.    {"SIAMESE N/4 TWOSOME",                   concept_frac_tandem,           l_c2,         {0, FALSE, 2, 0, 2}},
  1501.    {"SKEW N/4 TWOSOME",                      concept_frac_tandem,           l_c2,         {0, FALSE, 2, 0, 3}},
  1502.    {"SO-AND-SO COUPLES N/4 TWOSOME",         concept_some_are_frac_tandem,  l_a1,         {0, TRUE,  2, 0, 1}},
  1503.    {"SO-AND-SO TANDEM N/4 TWOSOME",          concept_some_are_frac_tandem,  l_c1,         {0, TRUE,  2, 0, 0}},
  1504.    {"PHANTOM AS COUPLES N/4 TWOSOME",        concept_phantom_frac_tandem,   l_c4,         {0, FALSE, 2, 1, 1}},
  1505.    {"PHANTOM TANDEM N/4 TWOSOME",            concept_phantom_frac_tandem,   l_c4a,        {0, FALSE, 2, 1, 0}},
  1506.    {"GRUESOME AS COUPLES N/4 TWOSOME",       concept_gruesome_frac_tandem,  l_c4a,        {0, FALSE, 2, 2, 1}},
  1507.    {"GRUESOME TANDEM N/4 TWOSOME",           concept_gruesome_frac_tandem,  l_c4a,        {0, FALSE, 2, 2, 0}},
  1508. /* -------- column break -------- */
  1509. #define tt__4 10
  1510.    {"COUPLES TWOSOME N/4 SOLID",              concept_frac_tandem,          l_c3,         {0, FALSE, 3, 0, 1}},
  1511.    {"TANDEM TWOSOME N/4 SOLID",               concept_frac_tandem,          l_c3,         {0, FALSE, 3, 0, 0}},
  1512.    {"SIAMESE TWOSOME N/4 SOLID",              concept_frac_tandem,          l_c3,         {0, FALSE, 3, 0, 2}},
  1513.    {"SKEWSOME N/4 SOLID",                     concept_frac_tandem,          l_c2,         {0, FALSE, 3, 0, 3}},
  1514.    {"SO-AND-SO COUPLES TWOSOME N/4 SOLID",    concept_some_are_frac_tandem, l_c3,         {0, TRUE,  3, 0, 1}},
  1515.    {"SO-AND-SO TANDEM TWOSOME N/4 SOLID",     concept_some_are_frac_tandem, l_c3,         {0, TRUE,  3, 0, 0}},
  1516.    {"PHANTOM COUPLES TWOSOME N/4 SOLID",      concept_phantom_frac_tandem,  l_c3,         {0, FALSE, 3, 1, 1}},
  1517.    {"PHANTOM TANDEM TWOSOME N/4 SOLID",       concept_phantom_frac_tandem,  l_c3,         {0, FALSE, 3, 1, 0}},
  1518.    {"GRUESOME TWOSOME N/4 SOLID",             concept_gruesome_frac_tandem, l_c4a,        {0, FALSE, 3, 2, 1}},
  1519.    {"GRUESOME TANDEM TWOSOME N/4 SOLID",      concept_gruesome_frac_tandem, l_c4a,        {0, FALSE, 3, 2, 0}},
  1520.  
  1521. /* distorted concepts */
  1522.  
  1523. #define dd__1 10
  1524.    {"STAGGER",                               concept_do_phantom_2x4,        l_c2,         {&(map_stagger), phantest_only_one, 0}},
  1525.    {"STAIRSTEP COLUMNS",                     concept_do_phantom_2x4,        l_c4,         {&(map_stairst), phantest_only_one, 0}},
  1526.    {"LADDER COLUMNS",                        concept_do_phantom_2x4,        l_c4,         {&(map_ladder), phantest_only_one, 0}},
  1527.    {"OFFSET COLUMNS",                        concept_distorted,             l_c2,         {0, 0, disttest_offset}},
  1528.    {"\"Z\" COLUMNS",                         concept_distorted,             l_c3,         {0, 0, disttest_z}},
  1529.    {"DISTORTED COLUMNS",                     concept_distorted,             l_c3,         {0, 0, disttest_any}},
  1530.    {"DIAGONAL COLUMN",                       concept_single_diagonal,       l_c3,         {0, 0}},
  1531.    {"TWO DIAGONAL COLUMNS",                  concept_double_diagonal,       l_c3,         {0, 0}},
  1532.    {"\"O\"",                                 concept_do_phantom_2x4,        l_c1,         {&(map_o_s2x4_3), phantest_only_first_one, 0}},
  1533.    {"BUTTERFLY",                             concept_do_phantom_2x4,        l_c1,         {&(map_x_s2x4_3), phantest_only_second_one, 0}},
  1534. /* -------- column break -------- */
  1535. #define dd__2 8
  1536.    {"BIGBLOCK",                              concept_do_phantom_2x4,        l_c3a,        {&(map_stagger), phantest_only_one, 1}},
  1537.    {"STAIRSTEP LINES",                       concept_do_phantom_2x4,        l_c4,         {&(map_ladder), phantest_only_one, 1}},
  1538.    {"LADDER LINES",                          concept_do_phantom_2x4,        l_c4,         {&(map_stairst), phantest_only_one, 1}},
  1539.    {"OFFSET LINES",                          concept_distorted,             l_c2,         {0, 1, disttest_offset}},
  1540.    {"\"Z\" LINES",                           concept_distorted,             l_c3,         {0, 1, disttest_z}},
  1541.    {"DISTORTED LINES",                       concept_distorted,             l_c3,         {0, 1, disttest_any}},
  1542.    {"DIAGONAL LINE",                         concept_single_diagonal,       l_c3,         {0, 1}},
  1543.    {"TWO DIAGONAL LINES",                    concept_double_diagonal,       l_c3,         {0, 1}},
  1544. /* -------- column break -------- */
  1545. #define dd__3 9
  1546.    {"PHANTOM STAGGER COLUMNS",               concept_do_phantom_2x4,        l_c4,         {&(map_stagger), phantest_both, 0}},
  1547.    {"PHANTOM STAIRSTEP COLUMNS",             concept_do_phantom_2x4,        l_c4,         {&(map_stairst), phantest_both, 0}},
  1548.    {"PHANTOM LADDER COLUMNS",                concept_do_phantom_2x4,        l_c4,         {&(map_ladder), phantest_both, 0}},
  1549.    {"PHANTOM OFFSET COLUMNS",                concept_do_phantom_2x4,        l_c4a,        {&(map_offset), phantest_both, 0}},
  1550.          {"", concept_comment, l_nonexistent_concept},
  1551.          {"", concept_comment, l_nonexistent_concept},
  1552.          {"", concept_comment, l_nonexistent_concept},
  1553.          {"", concept_comment, l_nonexistent_concept},
  1554.    {"PHANTOM BUTTERFLY OR \"O\"",            concept_do_phantom_2x4,        l_c4a,        {&(map_but_o), phantest_both, 0}},
  1555. /* -------- column break -------- */
  1556. #define dd__4 4
  1557.    {"PHANTOM BIGBLOCK LINES",                concept_do_phantom_2x4,        l_c4,         {&(map_stagger), phantest_both, 1}},
  1558.    {"PHANTOM STAIRSTEP LINES",               concept_do_phantom_2x4,        l_c4,         {&(map_ladder), phantest_both, 1}},
  1559.    {"PHANTOM LADDER LINES",                  concept_do_phantom_2x4,        l_c4,         {&(map_stairst), phantest_both, 1}},
  1560.    {"PHANTOM OFFSET LINES",                  concept_do_phantom_2x4,        l_c4a,        {&(map_offset), phantest_both, 1}},
  1561.  
  1562. /* 4-person distorted concepts */
  1563.  
  1564. #define d4__1 6
  1565.    {"SPLIT",                                 concept_split,                 l_mainstream},
  1566.    {"ONCE REMOVED",                          concept_once_removed,          l_c2,         {0, 0}},
  1567.    {"ONCE REMOVED DIAMONDS",                 concept_once_removed,          l_c3,         {0, 1}},
  1568.    {"MAGIC",                                 concept_magic,                 l_c1},
  1569.    {"DIAGONAL",                              concept_do_both_boxes,         l_c3a,        {&(map_2x4_diagonal), 97, FALSE}},
  1570.    {"TRAPEZOID",                             concept_do_both_boxes,         l_c3a,        {&(map_2x4_trapezoid), 97, FALSE}},
  1571. /* -------- column break -------- */
  1572. #define d4__2 5
  1573.    {"INTERLOCKED PARALLELOGRAM",             concept_do_both_boxes,         l_c3x,        {&(map_2x4_int_pgram), 97, TRUE}},
  1574.    {"INTERLOCKED BOXES",                     concept_misc_distort,          l_c3x,        {0, 3, 0}},
  1575.    {"TWIN PARALLELOGRAMS",                   concept_misc_distort,          l_c3x,        {0, 2, 0}},
  1576.    {"EACH \"Z\"",                            concept_misc_distort,          l_c3a,        {0, 0, 0}},
  1577.    {"INTERLOCKED \"Z's\"",                   concept_misc_distort,          l_c3a,        {0, 0, 8}},
  1578. /* -------- column break -------- */
  1579. #define d4__3 6
  1580.    {"JAY",                                   concept_misc_distort,          l_c3a,        {0, 1, 0}},
  1581.    {"BACK-TO-FRONT JAY",                     concept_misc_distort,          l_c3a,        {0, 1, 8}},
  1582.    {"BACK-TO-BACK JAY",                      concept_misc_distort,          l_c3a,        {0, 1, 16}},
  1583.    {"FACING PARALLELOGRAM",                  concept_misc_distort,          l_c3x,        {0, 4, 0}},
  1584.    {"BACK-TO-FRONT PARALLELOGRAM",           concept_misc_distort,          l_c3x,        {0, 4, 8}},
  1585.    {"BACK-TO-BACK PARALLELOGRAM",            concept_misc_distort,          l_c3x,        {0, 4, 16}},
  1586. /* -------- column break -------- */
  1587. #define d4__4 4
  1588.    {"IN YOUR BLOCKS",                        concept_do_phantom_2x2,        l_c1,         {&(map_blocks), phantest_2x2_only_two}},
  1589.    {"4 PHANTOM INTERLOCKED BLOCKS",          concept_do_phantom_2x2,        l_c4a,        {&(map_blocks), phantest_2x2_both}},
  1590.    {"TRIANGULAR BOXES",                      concept_do_phantom_2x2,        l_c4,         {&(map_trglbox), phantest_2x2_only_two}},
  1591.    {"4 PHANTOM TRIANGULAR BOXES",            concept_do_phantom_2x2,        l_c4,         {&(map_trglbox), phantest_2x2_both}},
  1592.  
  1593. /* Miscellaneous concepts */
  1594.  
  1595. #define mm__1 11
  1596.    {"LEFT",                                  concept_left,                  l_mainstream},
  1597.    {"REVERSE",                               concept_reverse,               l_mainstream},
  1598.    {"CROSS",                                 concept_cross,                 l_mainstream},
  1599.    {"SINGLE",                                concept_single,                l_mainstream},
  1600.    {"GRAND",                                 concept_grand,                 l_plus},
  1601.          {"", concept_comment, l_nonexistent_concept},
  1602.    {"TRIANGLE",                              concept_triangle,              l_c1},
  1603.    {"DIAMOND",                               concept_diamond,               l_c3a},
  1604.    {"INTERLOCKED",                           concept_interlocked,           l_c1},
  1605.    {"12 MATRIX",                             concept_12_matrix,             l_c3a},
  1606.    {"FUNNY",                                 concept_funny,                 l_c2},
  1607. /* -------- column break -------- */
  1608. #define mm__2 12
  1609.    {"PARALLELOGRAM",                         concept_parallelogram,         l_c2},
  1610.    {"PHANTOM",                               concept_c1_phantom,            l_c1},
  1611.    {"SO-AND-SO ARE STANDARD",                concept_standard,              l_c4a,        {0, 0}},
  1612.    {"STABLE",                                concept_stable,                l_c3a,        {0, FALSE, FALSE}},
  1613.    {"SO-AND-SO ARE STABLE",                  concept_so_and_so_stable,      l_c3a,        {0, TRUE,  FALSE}},
  1614.    {"N/4 STABLE",                            concept_frac_stable,           l_c4,         {0, FALSE, TRUE}},
  1615.    {"SO-AND-SO ARE N/4 STABLE",              concept_so_and_so_frac_stable, l_c4,         {0, TRUE,  TRUE}},
  1616.    {"TRACE",                                 concept_trace,                 l_c3x},
  1617.    {"(old) STRETCH",                         concept_old_stretch,           l_c1},
  1618.    {"STRETCHED SETUP",                       concept_new_stretch,           l_c2},
  1619.    {"FERRIS",                                concept_ferris,                l_c3x,        {0, 0}},
  1620.    {"RELEASE",                               concept_ferris,                l_c3a,        {0, 1}},
  1621. /* -------- column break -------- */
  1622. #define mm__3 33
  1623.    {"CENTERS",                               concept_centers_or_ends,       l_mainstream, {0, 0}},
  1624.    {"ENDS",                                  concept_centers_or_ends,       l_mainstream, {0, 1}},
  1625.    {"CENTERS AND ENDS",                      concept_centers_and_ends,      l_mainstream, {0, 0}},
  1626.    {"CENTER SIX",                            concept_centers_or_ends,       l_mainstream, {0, 2}},
  1627.    {"OUTER SIX",                             concept_centers_or_ends,       l_mainstream, {0, 5}},
  1628.    {"CENTER TWO",                            concept_centers_or_ends,       l_mainstream, {0, 4}},
  1629.    {"OUTER TWO",                             concept_centers_or_ends,       l_mainstream, {0, 3}},
  1630.    {"CENTER 6/OUTER 2",                      concept_centers_and_ends,      l_mainstream, {0, 2}},
  1631.    {"CENTER 2/OUTER 6",                      concept_centers_and_ends,      l_mainstream, {0, 3}},
  1632.          {"", concept_comment, l_nonexistent_concept},
  1633.    {"CHECKPOINT",                            concept_checkpoint,            l_c2,         {0, 0}},
  1634.    {"REVERSE CHECKPOINT",                    concept_checkpoint,            l_c4,         {0, 1}},
  1635.          {"", concept_comment, l_nonexistent_concept},
  1636.    {"CHECKERBOARD",                          concept_checkerboard,          l_c3a,        {0, s1x4}},
  1637.    {"CHECKERBOX",                            concept_checkerboard,          l_c3a,        {0, s2x2}},
  1638.    {"CHECKERDIAMOND",                        concept_checkerboard,          l_c3a,        {0, sdmd}},
  1639.          {"", concept_comment, l_nonexistent_concept},
  1640.    {"two calls in succession",               concept_sequential,            l_mainstream},
  1641.          {"", concept_comment, l_nonexistent_concept},
  1642.    {"ON YOUR OWN",                           concept_on_your_own,           l_c3x},
  1643.    {"SO-AND-SO ONLY",                        concept_so_and_so_only,        l_mainstream, {0, 0}},
  1644.    {"OWN THE SO-AND-SO",                     concept_some_vs_others,        l_c3x,        {0, 1}},
  1645.    {"SO-AND-SO START",                       concept_so_and_so_begin,       l_c2,         {0, 0}},
  1646.          {"", concept_comment, l_nonexistent_concept},
  1647.    {"RANDOM",                                concept_meta,                  l_c3x,        {0, 0}},
  1648.    {"REVERSE RANDOM",                        concept_meta,                  l_c3x,        {0, 1}},
  1649.    {"PIECEWISE",                             concept_meta,                  l_c3x,        {0, 2}},
  1650.    {"FRACTIONAL",                            concept_fractional,            l_c2,         {0, 0}},
  1651.    {"INTERLACE",                             concept_interlace,             l_c3x},
  1652.    {"START <concept>",                       concept_meta,                  l_c2,         {0, 3}},
  1653.    {"DO THE Nth PART <concept>",             concept_nth_part,              l_c2,         {0, 0}},
  1654.    {"REPLACE THE Nth PART OF X WITH Y",      concept_replace_nth_part,      l_c2,         {0, 0}},
  1655.    {"INTERRUPT X AFTER THE Nth PART WITH Y", concept_replace_nth_part,      l_c2,         {0, 1}},
  1656. /* -------- column break -------- */
  1657. #define mm__4 32
  1658.    {"IN POINT TRIANGLE",                     concept_randomtrngl,           l_c1,         {0, 1}},
  1659.    {"OUT POINT TRIANGLE",                    concept_randomtrngl,           l_c1,         {0, 0}},
  1660.    {"INSIDE TRIANGLES",                      concept_randomtrngl,           l_c1,         {0, 2}},
  1661.    {"OUTSIDE TRIANGLES",                     concept_randomtrngl,           l_c1,         {0, 3}},
  1662.    {"TALL 6",                                concept_randomtrngl,           l_c1,         {0, 4}},
  1663.    {"SHORT 6",                               concept_randomtrngl,           l_c1,         {0, 5}},
  1664.    {"WAVE-BASE TRIANGLES",                   concept_randomtrngl,           l_c1,         {0, 6}},
  1665.    {"TANDEM-BASE TRIANGLES",                 concept_randomtrngl,           l_c1,         {0, 7}},
  1666.    {"SO-AND-SO-BASED TRIANGLE",              concept_selbasedtrngl,         l_c1,         {0, 20}},
  1667.          {"", concept_comment, l_nonexistent_concept},
  1668.    {"CONCENTRIC",                            concept_concentric,            l_c1,         {0, schema_concentric}},
  1669.    {"CROSS CONCENTRIC",                      concept_concentric,            l_c2,         {0, schema_cross_concentric}},
  1670.    {"SINGLE CONCENTRIC",                     concept_single_concentric,     l_c4,         {0, schema_single_concentric}},
  1671.    {"SINGLE CROSS CONCENTRIC",               concept_single_concentric,     l_c4,         {0, schema_single_cross_concentric}},
  1672.          {"", concept_comment, l_nonexistent_concept},
  1673.    {"GRAND WORKING FORWARD",                 concept_grand_working,         l_c3x,        {0, 0}},
  1674.    {"GRAND WORKING BACKWARD",                concept_grand_working,         l_c3x,        {0, 2}},
  1675.    {"GRAND WORKING LEFT",                    concept_grand_working,         l_c3x,        {0, 1}},
  1676.    {"GRAND WORKING RIGHT",                   concept_grand_working,         l_c3x,        {0, 3}},
  1677.    {"GRAND WORKING TOGETHER",                concept_grand_working,         l_c3x,        {0, 8}},
  1678.    {"GRAND WORKING APART",                   concept_grand_working,         l_c3x,        {0, 9}},
  1679.          {"", concept_comment, l_nonexistent_concept},
  1680.    {"DOUBLE-OFFSET 1/4-TAG",                 concept_double_offset,         l_c4,         {0, 0}},
  1681.    {"DOUBLE-OFFSET 3/4-TAG",                 concept_double_offset,         l_c4,         {0, 1}},
  1682.    {"DOUBLE-OFFSET THING",                   concept_double_offset,         l_c4,         {0, 2}},
  1683.    {"DOUBLE-OFFSET DIAMONDS",                concept_double_offset,         l_c4,         {0, 3}},
  1684.          {"", concept_comment, l_nonexistent_concept},
  1685.    {"INRIGGER",                              concept_rigger,                l_c3x,        {0, 2}},
  1686.    {"OUTRIGGER",                             concept_rigger,                l_c3x,        {0, 0}},
  1687.    {"LEFTRIGGER",                            concept_rigger,                l_c3x,        {0, 1}},
  1688.    {"RIGHTRIGGER",                           concept_rigger,                l_c3x,        {0, 3}},
  1689.    {"[call]-RIGGER",                         concept_callrigger,            l_c3x},
  1690.  
  1691. /* general concepts */
  1692.  
  1693.    {"CENTERS",                               concept_centers_or_ends,       l_mainstream, {0, 0}},
  1694.    {"ENDS",                                  concept_centers_or_ends,       l_mainstream, {0, 1}},
  1695.    {"CENTERS AND ENDS",                      concept_centers_and_ends,      l_mainstream, {0, 0}},
  1696.    {"LEFT",                                  concept_left,                  l_mainstream},
  1697.    {"REVERSE",                               concept_reverse,               l_mainstream},
  1698.    {"SPLIT",                                 concept_split,                 l_mainstream},
  1699.    {"CROSS",                                 concept_cross,                 l_mainstream},
  1700.    {"GRAND",                                 concept_grand,                 l_plus},
  1701.    {"MAGIC",                                 concept_magic,                 l_c1},
  1702.    {"INTERLOCKED",                           concept_interlocked,           l_c1},
  1703.    {"12 MATRIX",                             concept_12_matrix,             l_c3a},
  1704.    {"FUNNY",                                 concept_funny,                 l_c2},
  1705.    {"SINGLE",                                concept_single,                l_mainstream},
  1706.    {"CONCENTRIC",                            concept_concentric,            l_c1,         {0, schema_concentric}},
  1707.    {"AS COUPLES",                            concept_tandem,                l_a1,         {0, FALSE, FALSE, 0, 1}},
  1708.    {"TANDEM",                                concept_tandem,                l_c1,         {0, FALSE, FALSE, 0, 0}},
  1709.    {"???",                                   marker_end_of_list}};
  1710.  
  1711. /* **** BEWARE!!!!  These are indices into "concept_descriptor_table"
  1712.    (just above) for SPLIT PHANTOM LINES, SPLIT PHANTOM COLUMNS,
  1713.    INTERLOCKED PHANTOM LINES, and INTERLOCKED PHANTOM COLUMNS.
  1714.    We use the fact that they are the first two items in the
  1715.    first two columns. */
  1716.  
  1717. int nice_setup_concept[] = {0, pp__1, 1, pp__1+1};
  1718.  
  1719. /* **** BEWARE!!!!  These things are keyed to "concept_descriptor_table"
  1720.    (above) and tell how to divide things into the various menus and popups.
  1721.    BE CAREFUL!! */
  1722.  
  1723. #define pp__z (pp__1+pp__2+pp__3+pp__4)
  1724. #define tt__z (tt__1+tt__2+tt__3+tt__4)
  1725. #define dd__z (dd__1+dd__2+dd__3+dd__4)
  1726. #define d4__z (d4__1+d4__2+d4__3+d4__4)
  1727.  
  1728. static int phantom_sizes[]       = {pp__1, pp__2, pp__3, pp__4, -1};
  1729. static int tandem_sizes[]        = {tt__1, tt__2, tt__3, tt__4, -1};
  1730. static int distort_sizes[]       = {dd__1, dd__2, dd__3, dd__4, -1};
  1731. static int dist4_sizes[]         = {d4__1, d4__2, d4__3, d4__4, -1};
  1732. static int misc_c_sizes[]        = {mm__1, mm__2, mm__3, mm__4, -1};
  1733.  
  1734. static int phantom_offsets[] = {0,
  1735.                                 0 + pp__1,
  1736.                                 0 + pp__1 + pp__2,
  1737.                                 0 + pp__1 + pp__2 + pp__3};
  1738.  
  1739. static int tandem_offsets[]  = {0 + pp__z,
  1740.                                 0 + pp__z + tt__1,
  1741.                                 0 + pp__z + tt__1 + tt__2,
  1742.                                 0 + pp__z + tt__1 + tt__2 + tt__3};
  1743.  
  1744. static int distort_offsets[] = {0 + pp__z + tt__z,
  1745.                                 0 + pp__z + tt__z + dd__1,
  1746.                                 0 + pp__z + tt__z + dd__1 + dd__2,
  1747.                                 0 + pp__z + tt__z + dd__1 + dd__2 + dd__3};
  1748.  
  1749. static int dist4_offsets[]   = {0 + pp__z + tt__z + dd__z,
  1750.                                 0 + pp__z + tt__z + dd__z + d4__1,
  1751.                                 0 + pp__z + tt__z + dd__z + d4__1 + d4__2,
  1752.                                 0 + pp__z + tt__z + dd__z + d4__1 + d4__2 + d4__3};
  1753.  
  1754. static int misc_c_offsets[]  = {0 + pp__z + tt__z + dd__z + d4__z,
  1755.                                 0 + pp__z + tt__z + dd__z + d4__z + mm__1,
  1756.                                 0 + pp__z + tt__z + dd__z + d4__z + mm__1 + mm__2,
  1757.                                 0 + pp__z + tt__z + dd__z + d4__z + mm__1 + mm__2 + mm__3};
  1758. int general_concept_offset   =  0 + pp__z + tt__z + dd__z + d4__z + mm__1 + mm__2 + mm__3 + mm__4;
  1759.  
  1760. int general_concept_size;           /* Gets filled in during initialization. */
  1761.  
  1762. int *concept_offset_tables[] = {
  1763.    phantom_offsets,
  1764.    tandem_offsets,
  1765.    distort_offsets,
  1766.    dist4_offsets,
  1767.    misc_c_offsets,
  1768.    0};
  1769.  
  1770. int *concept_size_tables[] = {
  1771.    phantom_sizes,
  1772.    tandem_sizes,
  1773.    distort_sizes,
  1774.    dist4_sizes,
  1775.    misc_c_sizes,
  1776.    0};
  1777.  
  1778. char *concept_menu_strings[] = {
  1779.    "PHANTOM SETUP concepts",
  1780.    "COUPLES/TANDEM concepts",
  1781.    "DISTORTED SETUP concepts",
  1782.    "4-PERSON DISTORTED concepts",
  1783.    "MISCELLANEOUS concepts",
  1784.    0};
  1785.