Scratch 101: Creating a "Maze"

Hello and Welcome to Scratch 101! In this tutorial we will be creating a Maze.

The Finished Product:

Graphical Setup:
1.) After creating your project, delete the default sprite 
2.) Turn you backdrop color to black
3.) Using the paintbrush, add two new sprites
4.) Add a ball sprite/character into Sprite 2 

The Graphical Template can be found here: https://scratch.mit.edu/projects/131846395/#player

Scripts:

For Sprite1:



 Remember to combine these two! 


For Sprite2:


Common Mistakes!
Remember to combine the two pieces to form one piece!

If your game isn't working then your character may be to large. You need a character that fits in the width of the pathway.

After the map generates for the first time, then your character is given movement!

Make sure you typed in all of the numbers correctly!

If you are having a problem with regeneration, change the 240 in the last program to 220. 

Tips:
The duplication feature is useful! Make sure to utilize it! 


If you are interested in seeing the fully functional version to debug your code of play the game you will find it here https://scratch.mit.edu/projects/126684473/

Scratch 101: Introduction

Announcement:
Hello and Welcome to Scratch 101! This is going to be a series which will teach you how to create interesting projects with the programming language Scratch. 

Hopefully lessons will be posted on a weekly basis. A running list will be kept here on the introduction page.

Lessons:

Scratch 101: Creating a Maze 

If you have any questions, please post in the comments section and we will hopefully answer them! You could also share the lessons if you found them helpful! Thank you and Enjoy!

To see the most up-to-date listing of CS curricula please visit the "computer science" page. Thanks!


What is the Modulus/mod Operator?

What is the Modulus/mod Operator?

When you are programming, you have the standard operations addition, subtraction, multiplication, and division. You also have another operator which you may not be familiar with. This is the modulus (mod) operator. 

The modulus operator finds remainders. Allow me to illustrate this with an example. 
5/3
3 cannot divide into 5 evenly, so after taking the closest multiple of three which is below 5 and subtracting it, we are given our remainder. The remainder in our case was 2. Often you will see it written as (5)mod(3).

What can you use the modulus operator for? One of its most simplistic uses is to distinguish even and odd numbers. All even numbers divide by 2 evenly. They don't have any remainders. This means that if (number)mod(2) = 0, then it is even. Otherwise it is odd. Below is a program which utilizes this concept to tell you if a number is even or odd. 

This was a quick introduction to the mod(modulus) operator. 

Press the green flag to run the program!