Ball Sort Tube JSON Format Guide

Tube JSON is a small text copy of a Ball Sort board. The outer array is the full level. Each inner array is one tube, and every value inside it is one separate ball.

Quick answer

Write every tube from bottom to top

The first value is the bottom ball, the last value is the exposed top ball, and a completely empty tube is []. In the current Solver, capacity is 4 and every color must appear exactly 4 times.

Include every tube, even when it is empty. Leaving out a spare tube changes the puzzle that the Solver searches.

Three Ball Sort tubes beside a matching bottom-to-top sequence of separate colored balls
The tube and its array describe the same stack. Read from the bottom ball upward.

What Each Part of the JSON Means

[The full board begins
[1, 2, 3, 1],Tube A, bottom to top
[2, 3],Tube B, partly filled
[]Tube C, completely empty
]The full board ends
Open space is not a value. A tube with two balls is written with two values. Do not add null, zeros, or blank strings to fill the remaining slots.

A Complete Valid Ball Sort Example

This is the example used on the current Ball Sort Solver page. It has three colors, four balls of each color, and two empty tubes.

[
  [1, 2, 3, 1],
  [2, 3, 1, 2],
  [3, 1, 2, 3],
  [],
  []
]
Colors3Balls per color4Empty tubes2
A B C D E

Tube A ends in 1, so color 1 is its exposed top ball.

The Last Value Is the Top Ball

Tube A

Top: last value = 1Middle: 2Bottom: first value = 4

Correct order

[4, 2, 1]

The Solver can remove only the final value, so 1 is the next ball that may move.

Writing [1, 2, 4] does not cause a JSON error. It describes a different tube with color 4 on top.

Write Every Empty Tube as []

An empty tube is part of the level. It gives the puzzle working space and changes which moves are possible. The current Ball validator also requires at least one explicit empty tube before Solve is enabled.

Correct
[
  [1, 2],
  [2, 1],
  []
]

The last inner array records the empty tube.

Wrong
[
  [1, 2],
  [2, 1]
]

The board now has one fewer tube and fails the empty-tube check.

Wrong placeholders
[null, null]

null is not an empty slot. It is an unsupported ball value.

Wrong use of zero
[0, 0]

Zero is a valid numeric color ID, so this means two balls of color 0.

The Checks the Current Ball Solver Makes

These are tool rules, not a claim that every Ball Sort game on the web uses the same setup. The current SortingGames.io Solver supports standard capacity-four levels.

CheckCurrent ruleWhat to do
Tube capacity0 to 4 balls in each tubeRemove placeholders and recheck overfilled tubes
Color countExactly 4 balls for every colorRecount similar shades across the whole board
Empty tubeAt least one tube must be exactly []Include all empty tubes shown in the level
Number of tubesNo more than 32Use only the current level, not an archive or several boards
Color valuesFinite numbers or non-empty strings up to 32 charactersUse short, consistent IDs
Move meaningOne final array value moves per actionDo not group touching balls into one value

If a color appears three or five times, search does not start. This is stricter than the current Water Sort Solver, where a count other than four is shown as a warning but does not by itself block search.

JSON Shapes the Parser Accepts

A direct top-level array is the clearest choice for manual entry. The parser also accepts a few object shapes used by other parts of the site.

ShapeExampleMeaning
Direct array[[1,2],[]]The top-level value is the tube list
tubes wrapper{"tubes":[[1,2],[]]}The tubes property holds the list
bottles wrapper{"bottles":[[1,2],[]]}Accepted as a tube list even though “tubes” is clearer
level wrapper{"level":[[1,2],[]]}The level property holds the list
data wrapper{"data":[[1,2],[]]}The data property holds the list
Tube object{"balls":[1,2]} or {"colors":[1,2]}An individual tube stores its ball array in a property

Keep Color IDs Simple and Consistent

Numbers

Easy to enter

[
  [1, 2, 1],
  [2],
  []
]

Use the same number every time the same color appears. Different colors need different IDs.

Names

Easy to remember

[
  ["blue", "red"],
  ["red", "blue"],
  []
]

Short strings work too. Keep spelling and case consistent so the preview and counts are easy to check.

Do not change one color from 1 to "1" halfway through the board. The parser normalizes color matching through its text form, but one clear style avoids confusing input and makes manual review easier.

Why Ball and Water JSON Can Look the Same

Both tools use nested arrays and both read each container from bottom to top. That shared shape describes a stack. It does not make the move rules the same.

Same arrayBall Sort meaningWater Sort meaning
[2, 1, 1]Three separate balls; the final 1 is the only ball moved nowThree liquid layers; the two connected top 1 layers may pour together
[]An empty tubeAn empty bottle
Final valueThe exposed top ballThe exposed top liquid layer

Use the Water Sort vs Ball Sort comparison for the full move example. If your puzzle contains liquid bands, follow the separate Water Sort Bottle JSON Guide.

Common Ball Sort Input Mistakes

  • Reading top to bottom: reverse the inner array so the top ball is last.
  • Leaving out an empty tube: add one [] for every empty tube in the game.
  • Merging matching balls: repeat the color ID once for each separate sphere.
  • Mixing close shades: choose a different ID only when the balls are truly different colors.
  • Using placeholders: open slots do not need values.
  • Entering hidden colors: the Solver does not support unknown or covered ball values.
  • Using another capacity: the current Ball Solver is fixed at 4.
  • Expecting screenshot reading: the Solver itself reads JSON, not images.

Preview the Board Before Solving

Paste the finished JSON into the Solver and select Load JSON. Compare the preview tube by tube. Check the top ball, the order below it, the empty tubes, and the color-count result before starting a search.

FAQ

What does each inner Ball Sort array represent?

Each inner array is one tube. The inner arrays follow the same left-to-right order as the tubes in the puzzle.

Which value is the top ball?

The last value in an inner array is the exposed top ball. The first value is the ball at the bottom of that tube.

How do I write an empty tube?

Write a completely empty tube as an empty array: []. Do not use null, zero, blank text, or four placeholders.

Does the Ball Sort Solver require an empty tube?

Yes. The current validator requires at least one explicit empty tube written as [] before search can start. Include every empty tube shown in the level.

Why must every color appear exactly four times?

The current SortingGames.io Ball Sort Solver uses capacity-four standard levels. Its validator requires exactly four separate balls for each color.

Can I use color names instead of numbers?

Yes. The parser accepts finite numbers or trimmed non-empty strings up to 32 characters. Use the same value for the same color everywhere.

What wrapper objects can the Ball Sort Solver read?

It can read a direct top-level array or an array under tubes, bottles, level, or data. A tube object may store its array under balls or colors.

Is Ball Sort JSON the same as Water Sort JSON?

The nested arrays can look alike, but their meaning is different. Each Ball value is one separate ball and only the final value moves per action. Water values are liquid layers and a connected top group may pour together.

Explore Ball and Other Sorting Games

Choose the sorting style that matches the way you want to play.