Matching the last elements in an array

Godot Version

v4.2.2.stable.official [15073afe3]

Question

I’m learning to use the match statement, I’m attempting to match the last 3 elements of an array without looking at the first x elements. I thought I could use the … pattern but the editor says that can only be used as the last element in the pattern array.

	match lastStick:
			[.., [0,-1], [1,-1], [1,0]]:
			pass

Not implemented, you will have to use an if statement for now. Doesn’t seem impossible or much slower to implement though.

1 Like

Was worried that would be the case, thanks for confirming though.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.