Programming the robots to move in square should start with few simple questions about the properties of the square itself. If the students are not familiar, you should explain to them that the square consists of 4 equal sides and 4 equal angles, each 90 degrees.
Then the program is just alternating moving straight and turning 90-degrees. The side of the square will be 3 rotations, while the angle is 90-degrees clockwise. It is expected that the students will mistaken the direction of the turn at least once. In such case you may explain to them, that the EV3 gyro sensor measures the clockwise angle as positive and counterclockwise as negative.
The next tricky moment is to make the second turn. They should add 90 more degrees to the 90 degrees they turned at the first turn. Hence, the robot should turn until the gyro sensor measures 180 degrees deviation from its starting position. For the next turns, the formula is the same. Just add 90 degrees to the value from the precious turn. So the 3rd will be 270 degrees and the 4th 360 degrees.

The task for programming the robot to move in a triangle is similar. However, the trick here is to figure out that you need to turn at the measure of the exterior angles, not the inside. There is a tutorial in the lesson that explains that, without going into too much details. If you decide you can explain them more about exterior angles.
After they have successfully tackled the task with moving in square, they should figure out that at the second turn the Gyro sensor should wait fo 240 degrees, while on the third it should be 360 degrees. The side of the triangle will once again be of length 3 rotations.
You can download the programs from the following link: /programs/ch9kl8-program-for-the-ev3-sailboat-robot-barco
