Student Login

Coding Activity #3

Bowser has taken Mario hostage! Can you help Princess Peach save Mario?

Activity #3 - A Game of Chance!

The tables have turned! Now it's Peach’s turn to rescue Mario! Bowser has taken Mario hostage and to save him, you’re going to have to first navigate a maze in his lair. You will need to create a series of step-by-step motions so that Peach can navigate Bowser’s castle to reach the door and rescue Mario.

  • Ontario curriculum alignment:  Grade 5
  • Best for:  Beginning coders of all grade levels!

Before you begin ...

This hands-on activity uses a free coding platform called "Scratch". Please make sure you've watched our "Introduction to Scratch" video, and that you're signed into your Scratch account. If you need help, click below. Otherwise, skip down to STEP 1 to get started!

Open the Scratch activity

Click the button below to open the activity. It will open in a new window/tab which allows you to keep this page open at the same time and easily switch between tabs while you work through this activity.

  • After you open the activity, click on the blue "See inside" button to access the activity.
  • If you are logged into your Scratch account, then you can click on the green "Remix" button to save this activity to your personal Scratch account so you can save your work and also share it with others!
Open the activity

Watch This Video

Help Princess Peach navigate Bowser's castle

The tables have turned! Now it's Peach’s turn to rescue Mario! Bowser has taken Mario hostage and to save him, you’re going to have to first navigate a maze in his lair.

  • You will need to create a series of step-by-step motions so that Peach can navigate Bowser’s castle to reach the door in one go and rescue Mario.
  • Think of your steps as 25 step blocks to get to the door in the maze.
  • You can find the “move ___ steps” block from the blue “Motion” menu on the left. Use those move blocks to get Peach to the door.

When you’ve reached the door, watch the next video below.

Watch This Video

Yikes! Bowser popped out of nowhere!

Did you see Bowser pop out of nowhere? We won’t challenge him just yet!

  • To help us simplify our initial code, we will use a “repeat” block (or a loop) from the yellow “Control” menu.
  • Count how many “move” blocks you have and use the “repeat ___” and input the number of “move” blocks you counted in the repeat loop to help simplify your code and make it easier to read.

When you’re ready, watch the next video below.

Watch This Video

Oh no! Bowser heard you coming ...

Oh no! Bowser heard you coming and looks like he’s not going to let you go. Good thing he can’t resist a game of chance! Unfortunately, Bowser has some very specific rules: he will only play this game if he has a 60% or better chance of winning. Here’s how you can get started in this game of chance by following the steps below:

  1. Show Bowser your honesty by setting the “Number” variable to pick between 1 and 100, using the “Number” variable from the “variables” menu and the “pick random ___ to ___” from the “operators” menu.
  2. Then have Peach say that number selected out loud using the “say ___ for 2 seconds” block and inputting that “number” variable inside the “say” block.
  3. Finally, to help trigger this number selection whenever we want, use the “when key pressed” block from the “events” menu and change it to “up arrow”.

Put all these blocks of code together and try it out. When you’re ready, watch the next video below.

Watch This Video

Play the game. Can you beat Bowser?

We’ve already set the game in a way that if the “Bowser” variable is equal to 0, Peach wins and if the “Bowser” variable is equal to 1, Bowser wins and will reset you back to the beginning of the maze. Here’s how you can finish this game by following these steps below:

  1. Use “if-then” or “if-then-else” blocks from the “control” menu and place your blocks of code together.
  2. if the random “number” variable that Peach selects is greater than 60 (> 60) then use the “set Bowser to 0” and Peach wins!
  3. Otherwise, also known as else, “set Bowser to 1” and Bowser wins.

Try this 10 times and see how many times you get past Bowser. Before you begin the game, make a guess, and see if you (or Peach) wins!

#207 - 8501 - 162nd Street
Surrey, British Columbia
Canada  V4N 1B2

Parents

Learn More
Book Samples
Online Platform
Pricing
Online Store
Free Trial

Teachers

Learn More
Book Samples
Teacher Resources
School Pricing

About

About Us
Contact
Privacy Policy
Cookie Policy
Terms & Conditions