Help with IR sensor/ gesture coding

Hi everyone, I'm new to Arduino and I really need some help for my coding.

I'm currently doing a project on IR sensors with hand gestures.

How do I code the sequence of motion detected? For example, if sensor A is detected, followed by B then C. The program should read Left to Right. How do I code the "sensor A followed by B then C" part?

Any advice is greatly appreciated. Thank you!