The thirteenth puzzle is almost completed.
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.
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.
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.