Mastering Color Water Sort Puzzle Games

Jerry An
6 min readNov 18, 2023

Are you ready to challenge your problem-solving skills with color water sort games? Let’s dive into how to approach these puzzles.

Understanding the Game

In this engaging puzzle game, the objective is to sort different colored liquids into individual test tubes until each tube contains a single color. The catch? You can only pour a liquid into another tube if it matches the topmost color, and there’s enough space.

Game State

In a real-life context, the “game state” refers to the current status or setup of a game at any given point in time. It includes the position, status, or condition of all the relevant pieces, players, or elements that are part of the game’s rules and play.

For the color water sort puzzle game, it would be the physical arrangement of the test tubes and the colored liquids within them at the start of the game or at any moment during gameplay.

It can be represented by a list of tuples, where each tuple contains a color (represented as a number) and a corresponding volume.

# Yellow: 1
# Red: 2
# Purple: 3
# Orange: 4
# Green: 5
# Light purple: 6
# Blue: 7

Here’s an example game state for the above image.



game_state = [
# Tube 1: yellow with volume 1, blue with volume 1, light purple with volume 1, purple with volume 1
[(3, 1), (6, 1), (5, 1), (1, 1)],
# Tube 2: orange with volume1, light purple with volume 1, yellow with volume 1, light purple with volume 1
[(6, 1), (1, 1), (6, 1), (4, 1)],
# Tube 3: red with volume 1, blue with volume 1, green with volume 1, red with volume 1
[(2, 1), (7, 1), (5, 1), (2, 1)],
# Tube 4: green with volume 1, orange with volume 1, green with volume 1, yellow with volume 1
[(1, 1), (7, 1), (4, 1), (7, 1)],
# Tube 5: red with volume 1, green with volume 1, orange with volume 1, blue with volume 1
[(5, 1), (4, 1), (7, 1), (2, 1)],
# Tube 6: blue with volume 1, orange with volume 1, yellow with volume 1, red with volume 1
[(2, 1), (1, 1), (4, 1), (5, 1)],
# Tube 7: purple with volume 3, light purple with volume 1
[(6, 1), (3, 3)],
# Tube 8: empty
[],
# Tube 9: empty
[],
]

--

--