2048 Merge Value Sum Per Swipe

Resolve deterministic 2048 left swipe compression and each-tile-at-most-once merging, with score from produced merged values; no random spawn or chain-merging newly created tiles.

Description

A 2048 left move compresses a row and merges equal neighbors once per move.

A 2048 left move compresses a row and merges equal neighbors once per move. Newly merged tiles cannot merge again immediately.1

Enter 1–16 cells, each zero or a power of two through 2^52. Scan nonzero tiles left to right, merge disjoint equal pairs and pad to original length. Return row and safe-integer merge score; an unsafe merged tile or score is an input error.

When to use 2048 Merge Value Sum Per Swipe

Use 2048 Merge Value Sum Per Swipe when you need to evaluate the supplied records under the calculation and evidence rules below. No random tile spawn, board rotation or game-over search is performed.

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 2048 Merge Value Sum Per Swipe 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 lineBeforeSwipe using the field table and calculation rules, then run the tool.
  3. Read lineAfterLeftSwipe, mergeScoreAdded, lineChanged. 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
lineBeforeSwipeLine before swipelist of numberRequired

Enter 1–16 cells, each zero or a power of two through 2^52. Scan nonzero tiles left to right, merge disjoint equal pairs and pad to original length. Return row and safe-integer merge score; an unsafe merged tile or score is an input error.

compress → pairwise single merges → zero padding

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

Output fieldMeaningValue type
lineAfterLeftSwipeLine after left swipelist of number
mergeScoreAddedMerge score addednumber
lineChangedLine changedboolean
json
{
  "input": {
    "lineBeforeSwipe": [
      2,
      2,
      2,
      2
    ]
  },
  "output": {
    "lineAfterLeftSwipe": [
      4,
      4,
      0,
      0
    ],
    "mergeScoreAdded": 8,
    "lineChanged": true
  }
}

Limitations and assumptions

No random tile spawn, board rotation or game-over search is performed.

Numeric inputs, where present, must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. 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 Monopoly Jail Three-Doubles Exit Rule: Monopoly doubles and jail create distinct turn transitions. Doubles release a jailed player without awarding an extra roll. For a complementary task, 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.

References

  1. 2048 Merge Value Sum Per Swipe — tool.io

Similar or alternative tools

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