{
  "id": "faro-shuffle",
  "description": "A perfect alternating weave of two halves",
  "labels": {
    "en": "Faro Shuffle",
    "es": "Barajada Faro",
    "fr": "Mélange Faro",
    "de": "Faro-Mischen"
  },
  "family_ref": "true-shuffles",
  "action_contract": {
    "parameters": {
      "weave": {
        "required": false,
        "description": "Which half retains the top and bottom card of the combined packet (required when n is even)",
        "domain": [
          "in",
          "out"
        ]
      },
      "straddle": {
        "required": false,
        "description": "Which half is larger, for an odd packet (required when n is odd)",
        "domain": [
          "top",
          "bottom"
        ]
      }
    },
    "post_state_invariant": "The two halves interleave card-for-card. For an even packet, weave: out keeps the original top and bottom cards outermost, and weave: in moves them to second from the top and second from the bottom. For an odd packet, the halves differ by one card, the larger half named by straddle supplies both the top and the bottom card, and every card interleaves.",
    "post_state": {
      "state_schema_ref": "https://tamaraspec.org/schema/tcs-playing-cards-state-0.1.json",
      "effects": [
        {
          "op": "permute",
          "subject": "target",
          "permutation": "faro",
          "args": {
            "weave": {
              "param": "weave"
            },
            "straddle": {
              "param": "straddle"
            }
          }
        }
      ]
    }
  }
}