CODE FOR CASE 1: GOING TO CHECKPOINT 1
Make the following code based on the logic discussed.
Run it by clicking the green flag and enjoy!
CASE 2: GOING TO CHECKPOINT 2
All the things would be the same, but there would be one major difference. As you can notice, number 2 is detected at checkpoint 1 and checkpoint 2, but when the robot is at checkpoint 2, number 1 is not visible. And this is what we will use. Checkpoint 2 is detected only when number 2 is visible and number 1 is not visible.