TamaraThe specification

TCS taxonomy v0.7

Sort

Experimental: structure may change in a subsequent edition. This page is pinned to v0.7.

Openly rearrange cards into the order given by key

Source fragment

The following is documentation data, not a standalone document or validation schema. Resolve references against the original source schema.

{
  "id": "sort",
  "description": "Openly rearrange cards into the order given by key",
  "labels": {
    "en": "Sort",
    "es": "Ordenar",
    "fr": "Trier",
    "de": "Sortieren"
  },
  "family_ref": "true-handling",
  "action_contract": {
    "requires": [
      "target"
    ],
    "parameters": {
      "key": {
        "required": true,
        "description": "The property cards are sorted by",
        "domain": [
          "rank",
          "suit",
          "color",
          "mates",
          "named_stack"
        ]
      },
      "direction": {
        "required": false,
        "description": "Sort direction, when key is ordered",
        "domain": [
          "ascending",
          "descending"
        ],
        "default": "ascending"
      },
      "rank_order": {
        "required": false,
        "description": "Whether ace sorts low or high",
        "domain": [
          "ace_low",
          "ace_high"
        ],
        "default": "ace_low"
      },
      "suit_order": {
        "required": false,
        "description": "Suit letters in sort order (required for key: suit)",
        "domain": "array of 4 suit letters",
        "default": "unspecified"
      },
      "color_order": {
        "required": false,
        "description": "Which color sorts first",
        "domain": [
          "red_first",
          "black_first"
        ],
        "default": "red_first"
      },
      "stack": {
        "required": false,
        "description": "A name or Atlas pointer for the target order; a label only",
        "domain": "string"
      },
      "stack_order": {
        "required": false,
        "description": "Face labels in target order (required for key: named_stack)",
        "domain": "array of face labels",
        "default": "unspecified"
      }
    },
    "post_state_invariant": "Cards end in the order key (and direction, rank_order, suit_order or color_order, as key requires) specifies; ties are unconstrained, and a card whose face label does not parse against the canonical grammar is free of the ordering constraint (docs/tcs/post-state-effects.md §10).",
    "post_state": {
      "state_schema_ref": "https://tamaraspec.org/schema/tcs-playing-cards-state-0.1.json",
      "effects": [
        {
          "op": "permute",
          "subject": "target",
          "permutation": "sort",
          "args": {
            "key": {
              "param": "key"
            },
            "direction": {
              "param": "direction"
            },
            "rank_order": {
              "param": "rank_order"
            },
            "suit_order": {
              "param": "suit_order"
            },
            "color_order": {
              "param": "color_order"
            },
            "stack_order": {
              "param": "stack_order"
            }
          }
        }
      ]
    }
  }
}

Verbatim JSON · Source: schemas/tcs-taxonomy-0.7.json/verbs/sort

See also