08 Mission Instructions

3. Code: Start with the End in Mind!

Today we’re inventing a very playful robot, so let’s start with a fun warm-up. When a game ends, someone wins and someone else loses, but if it’s a fair game, then the winner and loser will not always be the same person. That means your robot will sometimes win and sometimes lose. 

To keep our code clean and organized, we’ll create a special Function for when our robot wins and when our robot loses. Functions are available at the bottom of the list to the left of your programming canvas. Choose the to [do something] block and then type the name of that function. Make it something obvious and easy to remember.  We chose robot_wins and robot_loses so we wouldn’t get confused about whether our robot was supposed to behave happy or sad. 






How do you want your robot to celebrate when it wins?  How will it let you know it lost, but be a good sport about it?  

When you are ready to test your celebrations, simply attach your new functions directly to the yellow Connect Your Blocks Here to Create Your Program block!


The sky's the limit for how simple or complicated your robot dances are. You might include flashing lights, blinkers, spinning around in circles, or even text printed on your computer screen.  We chose a pretty basic dance for when our robot wins and loses: changing the eye color and then printing a short message on the computer screen. Feel free to use our example for your robot or invent your own.