Conditions (Part 1)

For this series of challenges, we will need to use the color sensor to determine which way to move.

To properly complete the missions, you will need to reset and run the program a few times. This is to make sure your robot can handle all the possible conditions, and not just one.

Example

Reset the world a few times to see where the green box may appear...

In this example challenge, the box may appear in front of the robot, or to the right of the robot.

If the box is in front...

If the box is to the right...

How can we decide which blocks to use?

Color Sensor

Notice that the ground below the robot is Green when the box is on the right, and white when the box is in front?

We can use a condition to check the color of the ground, then decide which way to move.

The example above uses 5 blocks. Can you reduce it to 4 blocks?

Challenges

For each challenge, click on the Simulator Tab, then the Mission button to see the mission you need to do.

Follow the instructions and note down the special Code after doing the challenge successfully!

Conditions Challenge 1

Conditions Challenge 2

Conditions Challenge 3

Conditions Challenge 4

Conditions Challenge 5