From left to right, the square moves '3 steps' clockwise along the edge each time.
From left to right, the triangle moves two steps to the right each time and starts again on the left, but one row lower when the end is reached. When the bottom is reached, it continues at the top again.