Display a Victory Message When the Micro:bits Are Nearby

Show an icon or a message on the screen when two micro:bits are close together. 

Step 1

For this exercise try to make a 'hot and cold' game. One player hides their micro:bit somewhere in the room, and the other person has to hunt it using the graph on the other micro:bit. When they get closer they get 'hotter'. If they move in the wrong direction, they are 'getting colder'. Write the code so a victory message appears when the two micro:bits are very close together.

Think about how you would be able to tell when the player has found the other micro:bit. 

You might want to use an if block in your code.

Step 2

Test your solution on the simulator.

Download your code onto the micro:bit and test it.