Battleship Parity Placement Strategy

Enumerate straight ship placements in declared currently available cells and audit actual parity search coverage; length-one ships need not be covered, no hidden-ship probability or optimal shot guarantee.

Description

A Battleship parity screen tests whether selected cells intersect every viable straight ship placement.

A Battleship parity screen tests whether selected cells intersect every viable straight ship placement. Single-cell placements need separate deduplication.1

Enter a nonempty binary availability grid through 32×32 with 1 available, ship length 1–32 and parity 0/1. Enumerate horizontal/vertical all-available placements, counting length 1 once. Return selected cells, viable/covered counts and complete-coverage flag requiring at least one placement.

When to use Battleship Parity Placement Strategy

Use Battleship Parity Placement Strategy when you need to evaluate the supplied records under the calculation and evidence rules below. No ship inventory, hit evidence, probability ranking or firing action is supplied.

Prepare the supplied game state, observations and explicit variant settings. Follow the card, board, coordinate and state conventions in the calculation rules.

How to use Battleship Parity Placement Strategy and understand its results

  1. Prepare the supplied game state, observations and explicit variant settings. Follow the card, board, coordinate and state conventions in the calculation rules.
  2. Enter availableCellBoard, shipLength, selectedSearchParity using the field table and calculation rules, then run the tool.
  3. Read paritySearchCells, viableShipPlacementCount, coveredViablePlacementCount, allViablePlacementsCovered. The explanation below defines the units, signs, ordering and any flags or placeholder values.
  4. If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
Input fieldMeaningValue type; see rules belowRequirement
availableCellBoardAvailable cell boardlist of list of numberRequired
shipLengthShip lengthnumberRequired
selectedSearchParitySelected search paritynumberRequired

Enter a nonempty binary availability grid through 32×32 with 1 available, ship length 1–32 and parity 0/1. Enumerate horizontal/vertical all-available placements, counting length 1 once. Return selected cells, viable/covered counts and complete-coverage flag requiring at least one placement.

coveredPlacement=any available cell of selected parity within placement

Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.

Output fieldMeaningValue type
paritySearchCellsParity search cellslist of list of number
viableShipPlacementCountViable ship placement countnumber
coveredViablePlacementCountCovered viable placement countnumber
allViablePlacementsCoveredAll viable placements coveredboolean
json
{
  "input": {
    "availableCellBoard": [
      [
        1,
        1,
        1
      ],
      [
        1,
        1,
        1
      ]
    ],
    "shipLength": 3,
    "selectedSearchParity": 0
  },
  "output": {
    "paritySearchCells": [
      [
        0,
        0
      ],
      [
        0,
        2
      ],
      [
        1,
        1
      ]
    ],
    "viableShipPlacementCount": 2,
    "coveredViablePlacementCount": 2,
    "allViablePlacementsCovered": true
  }
}

Limitations and assumptions

No ship inventory, hit evidence, probability ranking or firing action is supplied.

Numeric inputs, where present, must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Matrices are limited to 128 rows and 128 entries per row. Numeric lists are limited to 10,000 entries; string lists to 128 strings of at most 128 characters each. The rules above may impose smaller limits. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors. A successfully returned false flag is an evaluated outcome; its meaning is explained above.

Alternative or Complementary methods

Use Minesweeper Neighbor Mine Count (8-Neighbors): Minesweeper clues count mines in eight neighboring cells. The center cell is never part of its own count. For a complementary task, use Random-Walk Carve Percent Target (Procgen): Coverage of walkable map cells is an evidence audit. Repeated visits should count once toward the caller coverage target.

References

  1. Battleship Parity Placement Strategy — tool.io

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies