Time for a challenge
Challenge #1
Assume that a door is fixed at an office and the owner wants to allow entry of only specific types of people into the office. So now, program your door to do the following:
- Open when it senses people with green and blue hats.
- Keep the door closed for people with red hats. Display Sorry, entry is restricted to such people.
You need to use the same man that you built using the BOOST elements. Keep changing the hat color to test it.
Challenge #2
Try to add more colored hats, such as black, white, and yellow hats, using your LEGO elements, and modify the list as follows:
- Open the door for people with blue, green, and yellow hats.
- Keep the door closed for people with white, black, and red hats. You can display the same warning message.
You can use more of these if-else
statements and add to the decision-making capabilities of your BOOST robot for many such exciting projects.