Brain Teasers
Traffic Lights
The following task involves several steps, but they are out of order. Arrange them so that a person who follows the steps exactly can perform the task:
A procedure is needed to change all the red traffic lights in a small town to green, and vice versa. (Luckily there are no yellow lights in this town, and also no lights that don't work). Assume that you have a street map that shows the locations of all the lights.
a) If all lights on your map are marked "done," skip the next six statements.
b) If the light is red, skip the next two statements.
c) Turn the light red.
d) Turn the light green.
e) On your map, mark the light you just changed as "done" and go back to the first statement.
f) Find a light that is not marked "done" on your map, and check whether it is red or green.
g) Skip the next statement.
h) End.
A procedure is needed to change all the red traffic lights in a small town to green, and vice versa. (Luckily there are no yellow lights in this town, and also no lights that don't work). Assume that you have a street map that shows the locations of all the lights.
a) If all lights on your map are marked "done," skip the next six statements.
b) If the light is red, skip the next two statements.
c) Turn the light red.
d) Turn the light green.
e) On your map, mark the light you just changed as "done" and go back to the first statement.
f) Find a light that is not marked "done" on your map, and check whether it is red or green.
g) Skip the next statement.
h) End.
Answer
a) If all lights on your map are marked "done," skip the next six statements.f) Find a light that is not marked "done" on your map, and check whether it is red or green.
b) If the light is red, skip the next two statements.
c) Turn the light red.
g) Skip the next statement.
d) Turn the light green.
e) On your map, mark the light you just changed as "done" and go back to the first statement.
h) End.
Hide Answer Show Answer
What Next?
View a Similar Brain Teaser...
If you become a registered user you can vote on this brain teaser, keep track of which ones you have seen, and even make your own.
Solve a Puzzle
Comments hidden to avoid spoilers.
Follow Braingle!