# at.turtleme.game.sweepReef

> Published by [turtleme.at](https://lexicon.garden/identity/did:plc:f4h4tl43o4vx4hv2xps6siuz)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:f4h4tl43o4vx4hv2xps6siuz/at.turtleme.game.sweepReef)
- [Documentation](https://lexicon.garden/lexicon/did:plc:f4h4tl43o4vx4hv2xps6siuz/at.turtleme.game.sweepReef/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:f4h4tl43o4vx4hv2xps6siuz/at.turtleme.game.sweepReef/examples)

## Definitions

### `at.turtleme.game.sweepReef`

**Type**: `procedure`

Sweep one patch of the reef, or the handful a chord opens, in the order given. What comes back is the patches that opened and what each one counts. While the board is still being played it also carries the covered patches the open numbers already prove safe, with what each of those counts, so a page can open one the moment it is tapped: a player could open every one of them at no risk and read the same counts. Where the shoal lies is not sent until the board is over. Sweeping a patch with a turtle under it wakes the shoal and ends the board, and only a board swept clean pays anything. Requires an atproto service auth token addressed to did:web:turtleme.at#turtle_game and naming this method, so a token issued for one call cannot be spent on another.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `netted` | `array` | No | Where the player's nets are. They are the player's own marks and are not kept here; they are sent because a net stops a sweep spreading, the way a flag does. Leaving them out only opens more of the caller's own board. |
| `patches` | `array` | Yes | Which patches to sweep, in order. Sweeping stops at the first one that wakes the shoal. |

#### Output

**Encoding**: `application/json`

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Sweep one patch of the reef, or the handful a chord opens, in the order given. What comes back is the patches that opened and what each one counts. While the board is still being played it also carries the covered patches the open numbers already prove safe, with what each of those counts, so a page can open one the moment it is tapped: a player could open every one of them at no risk and read the same counts. Where the shoal lies is not sent until the board is over. Sweeping a patch with a turtle under it wakes the shoal and ends the board, and only a board swept clean pays anything. Requires an atproto service auth token addressed to did:web:turtleme.at#turtle_game and naming this method, so a token issued for one call cannot be spent on another.",
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "netted": {
              "description": "Where the player's nets are. They are the player's own marks and are not kept here; they are sent because a net stops a sweep spreading, the way a flag does. Leaving them out only opens more of the caller's own board.",
              "items": {
                "minimum": 0,
                "type": "integer"
              },
              "maxLength": 256,
              "type": "array"
            },
            "patches": {
              "description": "Which patches to sweep, in order. Sweeping stops at the first one that wakes the shoal.",
              "items": {
                "minimum": 0,
                "type": "integer"
              },
              "maxLength": 9,
              "minLength": 1,
              "type": "array"
            }
          },
          "required": [
            "patches"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "ref": "at.turtleme.game.defs#state",
          "type": "ref"
        }
      },
      "type": "procedure"
    }
  },
  "id": "at.turtleme.game.sweepReef",
  "lexicon": 1
}
```
