# The same result in many ways

The thirteenth puzzle is almost completed.

## Drag the color

In this puzzle, player draw multiple lines with paint. When lines intersect, the subsequent lines drag the color of the original line.

As player intersect lines with multiple colors, the results change depending on the direction and order of the lines. The goal of the puzzle is to draw lines that match the picture presented.

Our shader handles one stroke with one material. To achieve this, the script records in order with the color, position, and direction of the strokes that the user draws. After that, we instruct the shader how the colors are mixed as multiple gradations.

## Hesitate to judge

The whole logic was completed, but a problem occurred when judging whether the procedure was correct. It was not enough to simply compare the records of user operations with correct patterns.。

The reason is that there are patterns that give the same result even with different drawing procedures. Specifically, there are the following three cases.

• a) First line (drawing in either direction yields the same result)
• b) Intersections of the same color (colors do not mix, so orientation and order do not matter)
• c)Lines drawn continuously in the same direction (in the case of the figure below, the result is the same regardless of which is the second or third line)

For the time being, we created the correct answer pattern so that it would not fall into cases b and c. Since it is unavoidable for a, we decided to ignore the direction in the first drawing.

Recommend