Skip to main content

Learning Scratch (1)

I teach Scratch [1], a computer programming language, to 10 to 12 years old students from last year. Sometimes they show me an interesting creative idea. I would like to write one of them here.

Before I explain what my students did, I will explain what is Scratch. First I will explain it in a conceptual way, then with an example. If someone can understand a conceptual explanation, he/she can apply the idea to many cases, but this is a bit difficult since their understanding must be deep. An explanation by example is rather easy to understand since it is shallow, that means you don't know it is still true in other cases. So there is a trade-off.

Scratch is a computer language, but also a programming environment.  In the environment, the developer writes event driven programs to control many sprite [2] characters. You can think each sprite character an object. Each event invokes a program and each program runs in parallel.

Maybe this explanation doesn't make sense for whom has never written a program. There are many conceptual words here: programming environment, sprite, event, object, and so on.. Each term is a concept in programming and we need to lean them. But I usually don't explain these concepts to 10 years old students. So I use examples. But I hope they can understand the concept in the future.

When you start scratch programming environment, there is a cat (Figure 1).  The developer writes a program what the cat does when something happened. ``Something happened'' means, for instance, a key is pushed, a mouse button is pushed. These ``something happened'' is called an ``event.'' An event starts a program. Such program can also create other events. This type of program is called an event driven program. Each character, for instance, a cat, a dog, and so forth, usually has an own state. The developer uses this state to write a program. Here ``a state'' is for example, where is the cat (position), which direction the cat is looking at (directional angle). An object is a programming instance that has a state. Here, you can consider that a cat is an object, a dog is also an object.
Figure 1. Scratch programming environment
In the scratch environment, the green flag button is the start button of the program. Most of the scratch programs use this green flag as the start event. For example, when the green flag button is pushed, the cat moves to the center of the screen and says ``Hello!'' I usually first tell my students about ``a coordinate system.'' My explanation is simple as ``x'' means left or right, ``y''means up or down. If you set both value to 0, the character moves to the center of the screen. When you make the x value large, the character moves to the right. In the scratch environment, the coordinates x and y are always shown. So I can show how the coordinates change as I move the character. When I catch the cat by the mouse (I mean a computer mouse), I say ``See, when the cat move to the right, the x value becomes larger.''  I drag the cat and move it around to show them.

This time I explained briefly what is Scratch. In the next blog entry, I would like to talk about 10 years old student story who made a character animation program on Scratch.

References

Comments

Popular posts from this blog

Why A^{T}A is invertible? (2) Linear Algebra

Why A^{T}A has the inverse Let me explain why A^{T}A has the inverse, if the columns of A are independent. First, if a matrix is n by n, and all the columns are independent, then this is a square full rank matrix. Therefore, there is the inverse. So, the problem is when A is a m by n, rectangle matrix.  Strang's explanation is based on null space. Null space and column space are the fundamental of the linear algebra. This explanation is simple and clear. However, when I was a University student, I did not recall the explanation of the null space in my linear algebra class. Maybe I was careless. I regret that... Explanation based on null space This explanation is based on Strang's book. Column space and null space are the main characters. Let's start with this explanation. Assume  x  where x is in the null space of A .  The matrices ( A^{T} A ) and A share the null space as the following: This means, if x is in the null space of A , x is also in the null spa

Gauss's quote for positive, negative, and imaginary number

Recently I watched the following great videos about imaginary numbers by Welch Labs. https://youtu.be/T647CGsuOVU?list=PLiaHhY2iBX9g6KIvZ_703G3KJXapKkNaF I like this article about naming of math by Kalid Azad. https://betterexplained.com/articles/learning-tip-idea-name/ Both articles mentioned about Gauss, who suggested to use other names of positive, negative, and imaginary numbers. Gauss wrote these names are wrong and that is one of the reason people didn't get why negative times negative is positive, or, pure positive imaginary times pure positive imaginary is negative real number. I made a few videos about explaining why -1 * -1 = +1, too. Explanation: why -1 * -1 = +1 by pattern https://youtu.be/uD7JRdAzKP8 Explanation: why -1 * -1 = +1 by climbing a mountain https://youtu.be/uD7JRdAzKP8 But actually Gauss's insight is much powerful. The original is in the Gauß, Werke, Bd. 2, S. 178 . Hätte man +1, -1, √-1) nicht positiv, negative, imaginäre (oder gar um

Why parallelogram area is |ad-bc|?

Here is my question. The area of parallelogram is the difference of these two rectangles (red rectangle - blue rectangle). This is not intuitive for me. If you also think it is not so intuitive, you might interested in my slides. I try to explain this for hight school students. Slides:  A bit intuitive (for me) explanation of area of parallelogram  (to my site, external link) .