- :-
Mini-challenge solutions

Program Review: Color Sensor Comparison

Hover on any block in the program to view a detailed explanation.
1_IfElse_Block Checks whether the Color Sensor value is 'colorGreen'. If it is, sends program flow to the 'if'(first) branch. If not, sends program flow to the 'else'(second) branch. Robot makes a decision based on whether the Color Sensor sees Green or not.
2_TurnRight_ Turns in place to the right, for 0.7 rotations (approx. 90 degrees) at 50% power. Turns 90 degrees to the right if there is an object within 50cm.
3_TurnLeft_ Turns in place to the left, for 0.7 rotations (approx. 90 degrees) at 50% power. Turns 90 degrees to the left if there is NO object within 50cm.

Program Review: Tiled Maze

  • The program shown below is a sample solution to the Tile Maze Mini-Challenge from If/Else 4.
  • Note: the sample maze shown in the Tile Maze Mini-Challenge will appear to require a left turn, but it can be solved using only right turns! It is slow, but the robot can figure its way out.
Hover on any block in the program to view a detailed explanation.
1_Repeat_Block Always sends the program flow back to the start of the loop when the flow reaches the end of the loop. Robot repeats the movements inside the loop forever.
2_IfElse2_Block Checks whether the Distance Sensor value is less than '500'. If it is, sends program flow to the 'if'(first) branch. If not, sends program flow to the 'else'(second) branch. Robot makes a decision based on whether there is a maze wall within 50cm.
3_TurnRight_ Turns in place to the right, for 0.7 rotations (approx. 90 degrees) at 50% power. Turns 90 degrees to the right to avoid hitting the maze wall.
5_Forward_ Moves the robot forward 1.5 rotations (approx. 30cm) at 50% power. The robot drives 30cm forward. This would be a single 'maze tile'.