I’m trying to learn how expressions work and I don’t have a lot of programming experience. I have Peg A and Peg B, and when I move Peg A I want to have Peg B move at the same time. I have that part done, but I also want when Peg A moves past a certain point, Peg B moves back in the opposite direction.
So let’s say Peg A is at point 0, then moves in the x direction to the right. Peg B follows in the same direction. When Peg A reaches 5, Peg B switches direction heading to the left. As Peg A keeps going to the right, Peg B keeps going to the left.
This is what i would like to do, and I imagine it is an if and else statement with >5 and <5, but I can’t seem to figure it out. Any help or a pointer to documentation on writing expressions would be greatly appreciated.