Now, if I have two variables of the numeric type and I want to perform any arithmetic operation, addition, subtraction, multiplication, or division, it will be like this:
Each scratch command is a function that the program assigns to you, and we can also learn how to create functions ourselves. Now, if I want the object to ask me my name, and when I tell it, it welcomes me on its own. This method has one input but more than one output, meaning that it is not fixed because it can call me by any name. To solve it, we follow the following: Because we want a question, we will choose ask from Sensing and write what's your name. Then the object receives the answer, which is my name. Then we store the answer in say, which we will fetch from Looks . In order to be able to combine the name with the word hallo, we choose join from operators so that it appears with us in this image.
Now that I was able to create a function myself, I learned the input input for this function, and this input can be anything, such as the number of repetitions, etc., and so on. It is not a normal function, but rather you used it correctly, and this input appears like this. So this function can receive input, but its function is not known, so I register any function for it and let it be the number of times for it to appear in this image.
Conditionals Today I learned one of the most important programming concepts, which is conditions. The conditions we use in normal life are exactly the ones we use in programming, for example when a mother says to her son, “If you finish your homework, I will allow you to play.” Now I want to do something, but this order can only be executed under a certain condition. If it is met, the order will be executed. If it is not fulfilled, it will not be executed. This is done through the Control field and then bringing the if command. But before anything else, the forever command must be shared with us so that the computer always receives the condition and does not stop at a specific moment. Example: If the mouse touches the object, it will meow. We will write the commands like this:
Comments
Post a Comment